From: Cris Di Sclafani
Date: Fri, 30 Oct 2020 15:38:48 +0000 (+0100)
Subject: Built motion from commit (unavailable).|2.5.4
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=14547f04184024c74cffd710f531f04dec48ce41;p=motion2.git
Built motion from commit (unavailable).|2.5.4
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 9aad36a..eb7b805 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-30T15:16:57.330Z",
"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:30:56.119Z",
"url": "http://apidocjs.com",
"version": "0.19.0"
}
});
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 09961f7..ef4e6d9 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-30T15:16:57.330Z",
"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:30:56.119Z",
"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 d5a0e07..29db3c9 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 _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
+var _0xf791=['motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','getDataValue','action','STRING','contactManager','motionbar','jscripty','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]'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf791,0x11f));var _0x1f79=function(_0x274f14,_0x27dd7f){_0x274f14=_0x274f14-0x0;var _0x13b97e=_0xf791[_0x274f14];return _0x13b97e;};'use strict';var Sequelize=require(_0x1f79('0x0'));module[_0x1f79('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x28acbb){return this[_0x1f79('0x2')](_0x1f79('0x3'));}},'action':{'type':Sequelize[_0x1f79('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1f79('0x5'),'integration',_0x1f79('0x6'),_0x1f79('0x7'),'urlForward','browser',_0x1f79('0x8'),_0x1f79('0x9')]],'msg':_0x1f79('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x1f79('0x4')](0x1000),'comment':_0x1f79('0xb')},'data2':{'type':Sequelize[_0x1f79('0x4')](0x1000),'comment':_0x1f79('0xc')},'data3':{'type':Sequelize[_0x1f79('0x4')](0x1000),'comment':_0x1f79('0xd')},'data4':{'type':Sequelize[_0x1f79('0x4')](0x1000)},'data5':{'type':Sequelize[_0x1f79('0x4')](0x1000)},'data6':{'type':Sequelize[_0x1f79('0x4')]},'data7':{'type':Sequelize[_0x1f79('0xe')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 23b3ed8..6704a76 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 _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
+var _0x64ee=['params','catch','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','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','apply','reject','save','then','destroy','error','stack','name','send','update','body','find','Action'];(function(_0x2333c0,_0x5c6c0c){var _0x2c8c88=function(_0x559797){while(--_0x559797){_0x2333c0['push'](_0x2333c0['shift']());}};_0x2c8c88(++_0x5c6c0c);}(_0x64ee,0x122));var _0xe64e=function(_0x11541a,_0x1dd673){_0x11541a=_0x11541a-0x0;var _0x5dded5=_0x64ee[_0x11541a];return _0x5dded5;};'use strict';var pdf=require(_0xe64e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe64e('0x1'));var zipdir=require(_0xe64e('0x2'));var jsonpatch=require(_0xe64e('0x3'));var rp=require(_0xe64e('0x4'));var moment=require(_0xe64e('0x5'));var BPromise=require(_0xe64e('0x6'));var Mustache=require('mustache');var util=require(_0xe64e('0x7'));var path=require(_0xe64e('0x8'));var sox=require(_0xe64e('0x9'));var csv=require(_0xe64e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe64e('0xb'));var squel=require(_0xe64e('0xc'));var crypto=require(_0xe64e('0xd'));var jsforce=require(_0xe64e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe64e('0xf'));var Papa=require('papaparse');var Redis=require(_0xe64e('0x10'));var authService=require(_0xe64e('0x11'));var qs=require(_0xe64e('0x12'));var as=require(_0xe64e('0x13'));var hardwareService=require(_0xe64e('0x14'));var logger=require(_0xe64e('0x15'))(_0xe64e('0x16'));var utils=require(_0xe64e('0x17'));var config=require('../../config/environment');var db=require(_0xe64e('0x18'))['db'];function respondWithStatusCode(_0xdc2989,_0x1ed575){_0x1ed575=_0x1ed575||0xcc;return function(_0x144964){if(_0x144964){return _0xdc2989[_0xe64e('0x19')](_0x1ed575);}return _0xdc2989[_0xe64e('0x1a')](_0x1ed575)[_0xe64e('0x1b')]();};}function respondWithResult(_0x4c7ea8,_0x2ece82){_0x2ece82=_0x2ece82||0xc8;return function(_0x236650){if(_0x236650){return _0x4c7ea8[_0xe64e('0x1a')](_0x2ece82)[_0xe64e('0x1c')](_0x236650);}};}function respondWithFilteredResult(_0x48753f,_0x40e552){return function(_0x264d94){if(_0x264d94){var _0x608037=_0x264d94[_0xe64e('0x1d')],_0x4e7996=_0x40e552[_0xe64e('0x1e')],_0x51555e=_0x40e552[_0xe64e('0x1e')]+_0x40e552[_0xe64e('0x1f')],_0xad1461;if(_0x51555e>=_0x608037){_0x51555e=_0x608037;_0xad1461=0xc8;}else{_0xad1461=0xce;}_0x48753f['status'](_0xad1461);return _0x48753f[_0xe64e('0x20')]('Content-Range',_0x4e7996+'-'+_0x51555e+'/'+_0x608037)['json'](_0x264d94);}return null;};}function patchUpdates(_0x163cdd){return function(_0x463f46){try{jsonpatch[_0xe64e('0x21')](_0x463f46,_0x163cdd,!![]);}catch(_0x4f38de){return BPromise[_0xe64e('0x22')](_0x4f38de);}return _0x463f46[_0xe64e('0x23')]();};}function saveUpdates(_0x2111f7,_0x4b65e2){return function(_0x16300b){if(_0x16300b){return _0x16300b['update'](_0x2111f7)[_0xe64e('0x24')](function(_0x5b3030){return _0x5b3030;});}return null;};}function removeEntity(_0x19a9ee,_0x4520e5){return function(_0x251302){if(_0x251302){return _0x251302[_0xe64e('0x25')]()[_0xe64e('0x24')](function(){_0x19a9ee['status'](0xcc)[_0xe64e('0x1b')]();});}};}function handleEntityNotFound(_0x2b0c47,_0x2b8b95){return function(_0xc473b8){if(!_0xc473b8){_0x2b0c47[_0xe64e('0x19')](0x194);}return _0xc473b8;};}function handleError(_0x5879a9,_0x147414){_0x147414=_0x147414||0x1f4;return function(_0x21a58a){logger[_0xe64e('0x26')](_0x21a58a[_0xe64e('0x27')]);if(_0x21a58a[_0xe64e('0x28')]){delete _0x21a58a['name'];}_0x5879a9[_0xe64e('0x1a')](_0x147414)[_0xe64e('0x29')](_0x21a58a);};}exports[_0xe64e('0x2a')]=function(_0x9b7a2b,_0xfc7fef){if(_0x9b7a2b[_0xe64e('0x2b')]['id']){delete _0x9b7a2b[_0xe64e('0x2b')]['id'];}return db['Action'][_0xe64e('0x2c')]({'where':{'id':_0x9b7a2b['params']['id']}})['then'](handleEntityNotFound(_0xfc7fef,null))[_0xe64e('0x24')](saveUpdates(_0x9b7a2b[_0xe64e('0x2b')],null))['then'](respondWithResult(_0xfc7fef,null))['catch'](handleError(_0xfc7fef,null));};exports[_0xe64e('0x25')]=function(_0x2a18d0,_0x1c33a5){return db[_0xe64e('0x2d')][_0xe64e('0x2c')]({'where':{'id':_0x2a18d0[_0xe64e('0x2e')]['id']}})[_0xe64e('0x24')](handleEntityNotFound(_0x1c33a5,null))[_0xe64e('0x24')](removeEntity(_0x1c33a5,null))[_0xe64e('0x2f')](handleError(_0x1c33a5,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 893e08e..bc9710a 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 _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
+var _0x34df=['util','../../config/logger','request-promise','path','rimraf','./action.attributes','exports','define','Action','tools_actions'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x34df,0x1a4));var _0xf34d=function(_0x56b138,_0x2396d6){_0x56b138=_0x56b138-0x0;var _0x3df878=_0x34df[_0x56b138];return _0x3df878;};'use strict';var _=require('lodash');var util=require(_0xf34d('0x0'));var logger=require(_0xf34d('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf34d('0x2'));var fs=require('fs');var path=require(_0xf34d('0x3'));var rimraf=require(_0xf34d('0x4'));var config=require('../../config/environment');var attributes=require(_0xf34d('0x5'));module[_0xf34d('0x6')]=function(_0x3ca501,_0x258f35){return _0x3ca501[_0xf34d('0x7')](_0xf34d('0x8'),attributes,{'tableName':_0xf34d('0x9'),'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 06323b3..44f641d 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 _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
+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(_0x1bc509,_0x2eb50e){var _0x3fac54=function(_0x301618){while(--_0x301618){_0x1bc509['push'](_0x1bc509['shift']());}};_0x3fac54(++_0x2eb50e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xb7e7[_0x49ca18];return _0x145d54;};'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 75785e6..d07f8e7 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 _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
+var _0x89b7=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','isAuthenticated','update','/:id'];(function(_0x42bfb7,_0x25a3ec){var _0x5c497d=function(_0x48e83e){while(--_0x48e83e){_0x42bfb7['push'](_0x42bfb7['shift']());}};_0x5c497d(++_0x25a3ec);}(_0x89b7,0x7f));var _0x789b=function(_0x5c7ea7,_0x4f7d6f){_0x5c7ea7=_0x5c7ea7-0x0;var _0x4c3cf1=_0x89b7[_0x5c7ea7];return _0x4c3cf1;};'use strict';var multer=require(_0x789b('0x0'));var util=require(_0x789b('0x1'));var path=require(_0x789b('0x2'));var timeout=require(_0x789b('0x3'));var express=require(_0x789b('0x4'));var router=express[_0x789b('0x5')]();var auth=require(_0x789b('0x6'));var interaction=require(_0x789b('0x7'));var config=require(_0x789b('0x8'));var controller=require(_0x789b('0x9'));router['put']('/:id',auth[_0x789b('0xa')](),controller[_0x789b('0xb')]);router['delete'](_0x789b('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x789b('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index ca5ea7b..f4b925c 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 _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
+var _0xf6d1=['sequelize','exports','STRING'];(function(_0x43f552,_0x42808c){var _0x17911b=function(_0x4407a7){while(--_0x4407a7){_0x43f552['push'](_0x43f552['shift']());}};_0x17911b(++_0x42808c);}(_0xf6d1,0xd8));var _0x1f6d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf6d1[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x1f6d('0x0'));module[_0x1f6d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1f6d('0x2')]},'parent':{'type':Sequelize[_0x1f6d('0x2')]},'table':{'type':Sequelize[_0x1f6d('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index da17ecd..5b95013 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 _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
+var _0x4849=['offset','limit','set','Content-Range','reject','update','then','CustomReports','UserProfileResource','destroy','stack','name','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','params','find','catch','create','body','get','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','metric','replace','function','format','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','MetricId','groupBy','%s.%s\x20=\x20%s.%s','QueryTypes','web','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','output','../../files/reports','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','count'];(function(_0x312ea4,_0x1dbcb0){var _0x467369=function(_0x5a8dd9){while(--_0x5a8dd9){_0x312ea4['push'](_0x312ea4['shift']());}};_0x467369(++_0x1dbcb0);}(_0x4849,0x86));var _0x9484=function(_0x9a3880,_0x8368e6){_0x9a3880=_0x9a3880-0x0;var _0x2fd0db=_0x4849[_0x9a3880];return _0x2fd0db;};'use strict';var pdf=require(_0x9484('0x0'));var emlformat=require(_0x9484('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9484('0x2'));var jsonpatch=require(_0x9484('0x3'));var rp=require(_0x9484('0x4'));var moment=require(_0x9484('0x5'));var BPromise=require(_0x9484('0x6'));var Mustache=require(_0x9484('0x7'));var util=require(_0x9484('0x8'));var path=require('path');var sox=require(_0x9484('0x9'));var csv=require(_0x9484('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9484('0xb'));var squel=require(_0x9484('0xc'));var crypto=require(_0x9484('0xd'));var jsforce=require(_0x9484('0xe'));var deskjs=require(_0x9484('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9484('0x10'));var Papa=require(_0x9484('0x11'));var Redis=require(_0x9484('0x12'));var authService=require(_0x9484('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9484('0x14'));var hardwareService=require(_0x9484('0x15'));var logger=require(_0x9484('0x16'))(_0x9484('0x17'));var utils=require(_0x9484('0x18'));var config=require(_0x9484('0x19'));var db=require(_0x9484('0x1a'))['db'];var dbH=require('../../mysqldb')[_0x9484('0x1b')];function respondWithStatusCode(_0x3deb1e,_0x5e3f76){_0x5e3f76=_0x5e3f76||0xcc;return function(_0x5ed6a9){if(_0x5ed6a9){return _0x3deb1e[_0x9484('0x1c')](_0x5e3f76);}return _0x3deb1e[_0x9484('0x1d')](_0x5e3f76)[_0x9484('0x1e')]();};}function respondWithResult(_0x4200c1,_0x81eb94){_0x81eb94=_0x81eb94||0xc8;return function(_0x39699c){if(_0x39699c){return _0x4200c1[_0x9484('0x1d')](_0x81eb94)[_0x9484('0x1f')](_0x39699c);}};}function respondWithFilteredResult(_0x207007,_0x37cf72){return function(_0x4bb57e){if(_0x4bb57e){var _0x96d182=_0x4bb57e[_0x9484('0x20')],_0x44b13e=_0x37cf72[_0x9484('0x21')],_0x58dab8=_0x37cf72[_0x9484('0x21')]+_0x37cf72[_0x9484('0x22')],_0x44ee26;if(_0x58dab8>=_0x96d182){_0x58dab8=_0x96d182;_0x44ee26=0xc8;}else{_0x44ee26=0xce;}_0x207007['status'](_0x44ee26);return _0x207007[_0x9484('0x23')](_0x9484('0x24'),_0x44b13e+'-'+_0x58dab8+'/'+_0x96d182)[_0x9484('0x1f')](_0x4bb57e);}return null;};}function patchUpdates(_0x45f183){return function(_0x431751){try{jsonpatch['apply'](_0x431751,_0x45f183,!![]);}catch(_0x230097){return BPromise[_0x9484('0x25')](_0x230097);}return _0x431751['save']();};}function saveUpdates(_0x42fe66,_0x5f0937){return function(_0x1558e4){if(_0x1558e4){return _0x1558e4[_0x9484('0x26')](_0x42fe66)[_0x9484('0x27')](function(_0xa04f20){return _0xa04f20;});}return null;};}function removeEntity(_0x890846,_0x39240b){return function(_0x43939e){if(_0x43939e){return _0x43939e['destroy']()['then'](function(){var _0x4bfc05=_0x43939e['get']({'plain':!![]});var _0x45c2c4=_0x9484('0x28');return db[_0x9484('0x29')][_0x9484('0x2a')]({'where':{'type':_0x45c2c4,'resourceId':_0x4bfc05['id']}})[_0x9484('0x27')](function(){return _0x43939e;});})[_0x9484('0x27')](function(){_0x890846['status'](0xcc)[_0x9484('0x1e')]();});}};}function handleEntityNotFound(_0x53ffc3,_0x58dc7b){return function(_0x4b7eb9){if(!_0x4b7eb9){_0x53ffc3[_0x9484('0x1c')](0x194);}return _0x4b7eb9;};}function handleError(_0x37552c,_0x425760){_0x425760=_0x425760||0x1f4;return function(_0x11a90c){logger['error'](_0x11a90c[_0x9484('0x2b')]);if(_0x11a90c[_0x9484('0x2c')]){delete _0x11a90c[_0x9484('0x2c')];}_0x37552c['status'](_0x425760)['send'](_0x11a90c);};}exports['index']=function(_0x1cd898,_0x11e9b0){var _0x10a8d7={},_0x4da693={},_0x1650e5={'count':0x0,'rows':[]};var _0x30cfd5=_[_0x9484('0x2d')](db[_0x9484('0x2e')][_0x9484('0x2f')],function(_0xb10926){return{'name':_0xb10926[_0x9484('0x30')],'type':_0xb10926[_0x9484('0x31')][_0x9484('0x32')]};});_0x4da693[_0x9484('0x33')]=_['map'](_0x30cfd5,_0x9484('0x2c'));_0x4da693[_0x9484('0x34')]=_[_0x9484('0x35')](_0x1cd898[_0x9484('0x34')]);_0x4da693[_0x9484('0x36')]=_[_0x9484('0x37')](_0x4da693[_0x9484('0x33')],_0x4da693[_0x9484('0x34')]);_0x10a8d7[_0x9484('0x38')]=_[_0x9484('0x37')](_0x4da693[_0x9484('0x33')],qs[_0x9484('0x39')](_0x1cd898[_0x9484('0x34')]['fields']));_0x10a8d7[_0x9484('0x38')]=_0x10a8d7[_0x9484('0x38')][_0x9484('0x3a')]?_0x10a8d7[_0x9484('0x38')]:_0x4da693[_0x9484('0x33')];if(!_0x1cd898[_0x9484('0x34')][_0x9484('0x3b')](_0x9484('0x3c'))){_0x10a8d7['limit']=qs[_0x9484('0x22')](_0x1cd898[_0x9484('0x34')][_0x9484('0x22')]);_0x10a8d7[_0x9484('0x21')]=qs[_0x9484('0x21')](_0x1cd898['query'][_0x9484('0x21')]);}_0x10a8d7[_0x9484('0x3d')]=qs[_0x9484('0x3e')](_0x1cd898[_0x9484('0x34')][_0x9484('0x3e')]);_0x10a8d7[_0x9484('0x3f')]=qs[_0x9484('0x36')](_['pick'](_0x1cd898['query'],_0x4da693[_0x9484('0x36')]),_0x30cfd5);if(_0x1cd898[_0x9484('0x34')][_0x9484('0x40')]){_0x10a8d7[_0x9484('0x3f')]=_[_0x9484('0x41')](_0x10a8d7['where'],{'$or':_['map'](_0x30cfd5,function(_0xcee4c){if(_0xcee4c['type']!==_0x9484('0x42')){var _0x4806fc={};_0x4806fc[_0xcee4c[_0x9484('0x2c')]]={'$like':'%'+_0x1cd898[_0x9484('0x34')]['filter']+'%'};return _0x4806fc;}})});}_0x10a8d7=_['merge']({},_0x10a8d7,_0x1cd898[_0x9484('0x43')]);var _0x905ce0={'where':_0x10a8d7[_0x9484('0x3f')]};return db[_0x9484('0x2e')][_0x9484('0x20')](_0x905ce0)['then'](function(_0x25d30e){_0x1650e5[_0x9484('0x20')]=_0x25d30e;if(_0x1cd898[_0x9484('0x34')][_0x9484('0x44')]){_0x10a8d7[_0x9484('0x45')]=[{'all':!![]}];}return db[_0x9484('0x2e')]['findAll'](_0x10a8d7);})[_0x9484('0x27')](function(_0x224441){_0x1650e5['rows']=_0x224441;return _0x1650e5;})[_0x9484('0x27')](respondWithFilteredResult(_0x11e9b0,_0x10a8d7))['catch'](handleError(_0x11e9b0,null));};exports['show']=function(_0xa22a,_0x4fd8eb){var _0x254d7e={'raw':![],'where':{'id':_0xa22a[_0x9484('0x46')]['id']}},_0x3baa5c={};_0x3baa5c['model']=_['keys'](db[_0x9484('0x2e')][_0x9484('0x2f')]);_0x3baa5c[_0x9484('0x34')]=_[_0x9484('0x35')](_0xa22a[_0x9484('0x34')]);_0x3baa5c[_0x9484('0x36')]=_[_0x9484('0x37')](_0x3baa5c['model'],_0x3baa5c[_0x9484('0x34')]);_0x254d7e['attributes']=_[_0x9484('0x37')](_0x3baa5c[_0x9484('0x33')],qs[_0x9484('0x39')](_0xa22a[_0x9484('0x34')][_0x9484('0x39')]));_0x254d7e[_0x9484('0x38')]=_0x254d7e[_0x9484('0x38')]['length']?_0x254d7e[_0x9484('0x38')]:_0x3baa5c['model'];if(_0xa22a['query'][_0x9484('0x44')]){_0x254d7e[_0x9484('0x45')]=[{'all':!![]}];}_0x254d7e=_['merge']({},_0x254d7e,_0xa22a[_0x9484('0x43')]);return db[_0x9484('0x2e')][_0x9484('0x47')](_0x254d7e)[_0x9484('0x27')](handleEntityNotFound(_0x4fd8eb,null))['then'](respondWithResult(_0x4fd8eb,null))[_0x9484('0x48')](handleError(_0x4fd8eb,null));};exports[_0x9484('0x49')]=function(_0x391903,_0x6c72d9){return db['AnalyticCustomReport'][_0x9484('0x49')](_0x391903[_0x9484('0x4a')],{})[_0x9484('0x27')](function(_0x390faf){var _0x255c6e=_0x391903['user'][_0x9484('0x4b')]({'plain':!![]});if(!_0x255c6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x255c6e[_0x9484('0x4c')]===_0x9484('0x4d')){var _0x599b0e=_0x390faf[_0x9484('0x4b')]({'plain':!![]});var _0x3b22ff=_0x9484('0x4e');return db[_0x9484('0x4f')]['find']({'where':{'name':_0x3b22ff,'userProfileId':_0x255c6e[_0x9484('0x50')]},'raw':!![]})[_0x9484('0x27')](function(_0x50c607){if(_0x50c607&&_0x50c607[_0x9484('0x51')]===0x0){return db['UserProfileResource'][_0x9484('0x49')]({'name':_0x599b0e[_0x9484('0x2c')],'resourceId':_0x599b0e['id'],'type':_0x9484('0x28'),'sectionId':_0x50c607['id']},{})[_0x9484('0x27')](function(){return _0x390faf;});}else{return _0x390faf;}})[_0x9484('0x48')](function(_0x433249){logger['error'](_0x9484('0x52'),_0x433249);throw _0x433249;});}return _0x390faf;})[_0x9484('0x27')](respondWithResult(_0x6c72d9,0xc9))['catch'](handleError(_0x6c72d9,null));};exports[_0x9484('0x26')]=function(_0x114ea6,_0x3124f8){if(_0x114ea6[_0x9484('0x4a')]['id']){delete _0x114ea6[_0x9484('0x4a')]['id'];}return db['AnalyticCustomReport'][_0x9484('0x47')]({'where':{'id':_0x114ea6['params']['id']}})[_0x9484('0x27')](handleEntityNotFound(_0x3124f8,null))[_0x9484('0x27')](saveUpdates(_0x114ea6['body'],null))[_0x9484('0x27')](respondWithResult(_0x3124f8,null))[_0x9484('0x48')](handleError(_0x3124f8,null));};exports[_0x9484('0x2a')]=function(_0x395aaa,_0xaa62e4){return db[_0x9484('0x2e')][_0x9484('0x47')]({'where':{'id':_0x395aaa[_0x9484('0x46')]['id']}})['then'](handleEntityNotFound(_0xaa62e4,null))[_0x9484('0x27')](removeEntity(_0xaa62e4,null))['catch'](handleError(_0xaa62e4,null));};exports[_0x9484('0x53')]=function(_0x4162f1,_0x880736){var _0x153637=0xa;var _0x1046a5=[_0x9484('0x54'),_0x9484('0x55'),_0x9484('0x56'),_0x9484('0x57')];var _0x43a401={'SUM':_0x9484('0x58'),'COUNT':_0x9484('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9484('0x5a'),'MIN':_0x9484('0x5b'),'AVG':_0x9484('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x9484('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x28525f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9484('0x5e'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9484('0x5f')};var _0x54e78d=function(_0x124db1){return!_[_0x9484('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x9484('0x61')],_0x124db1);};var _0x181779=function(_0x3aae2c){if(!_0x3aae2c||!_0x3aae2c[_0x9484('0x62')][_0x9484('0x3a')]){return'';}for(var _0x10facc='(',_0x5b7dc3=0x0;_0x5b7dc3<_0x3aae2c[_0x9484('0x62')]['length'];_0x5b7dc3+=0x1){_0x5b7dc3>0x0&&(_0x10facc+='\x20'+_0x3aae2c[_0x9484('0x63')]+'\x20');_0x10facc+=_0x3aae2c['rules'][_0x5b7dc3]['group']?_0x181779(_0x3aae2c['rules'][_0x5b7dc3][_0x9484('0x64')]):_0x3aae2c[_0x9484('0x62')][_0x5b7dc3][_0x9484('0x65')]+'\x20'+_0x3aae2c[_0x9484('0x62')][_0x5b7dc3]['condition']+(_0x54e78d(_0x3aae2c[_0x9484('0x62')][_0x5b7dc3][_0x9484('0x66')])?'\x20'+_0x3aae2c[_0x9484('0x62')][_0x5b7dc3][_0x9484('0x67')]:'');}return _0x10facc+')';};var _0x474a90={'where':{'id':_0x4162f1[_0x9484('0x46')]['id']}},_0x5edcfb,_0x1e990d,_0x3fe362,_0x57590e,_0x406522;_0x474a90=_[_0x9484('0x41')]({},_0x474a90,_0x4162f1['options']);return db[_0x9484('0x2e')][_0x9484('0x47')](_0x474a90)['then'](function(_0x48f752){if(_0x48f752){_0x5edcfb=_0x48f752;return _0x48f752[_0x9484('0x68')]();}return null;})[_0x9484('0x27')](function(_0x19a20a){if(_0x19a20a){if(!_0x19a20a['length']){throw new db[(_0x9484('0x69'))][(_0x9484('0x6a'))](_0x9484('0x6b'),0x193);}_0x1e990d=_0x19a20a;return db[_0x9484('0x6c')][_0x9484('0x6d')]({'raw':!![]});}return null;})['then'](function(_0x573ecb){if(_0x573ecb){_0x3fe362=_[_0x9484('0x6e')](_0x573ecb,'id');var _0x16dfc4;var _0x177322=squel[_0x9484('0x6f')]();_0x177322[_0x9484('0x70')](_0x5edcfb[_0x9484('0x71')]);for(var _0x30a364=0x0;_0x30a364<_0x1e990d[_0x9484('0x3a')];_0x30a364+=0x1){_0x16dfc4=_0x1e990d[_0x30a364]['MetricId']?_0x3fe362[_0x1e990d[_0x30a364]['MetricId']][_0x9484('0x72')]:_0x1e990d[_0x30a364]['field'];_0x16dfc4=_0x1e990d[_0x30a364]['function']?_[_0x9484('0x73')](_0x43a401[_0x1e990d[_0x30a364][_0x9484('0x74')]],'%s',_0x16dfc4):_0x16dfc4;_0x16dfc4=_0x1e990d[_0x30a364][_0x9484('0x75')]?_['replace'](_0x28525f[_0x1e990d[_0x30a364]['format']],'%s',_0x16dfc4):_0x16dfc4;if(_0x1e990d[_0x30a364]['groupBy']){_0x177322[_0x9484('0x64')](_0x16dfc4);}_0x1e990d[_0x30a364][_0x9484('0x76')]&&_0x177322[_0x9484('0x3d')](_0x16dfc4,_0x1e990d[_0x30a364][_0x9484('0x76')]===_0x9484('0x77')?![]:!![]);_0x177322['field'](_0x16dfc4,_0x1e990d[_0x30a364][_0x9484('0x78')]||_0x16dfc4);}if(_0x5edcfb[_0x9484('0x79')]){_0x5edcfb['joins']=JSON['parse'](_0x5edcfb['joins']);for(var _0x34d62a=0x0;_0x34d62a<_0x5edcfb[_0x9484('0x79')]['length'];_0x34d62a+=0x1){if(_0x5edcfb['joins'][_0x34d62a][_0x9484('0x31')]&&_[_0x9484('0x60')](_0x1046a5,_0x5edcfb[_0x9484('0x79')][_0x34d62a]['type'])&&_0x5edcfb[_0x9484('0x79')][_0x34d62a][_0x9484('0x7a')]&&_0x5edcfb[_0x9484('0x79')][_0x34d62a][_0x9484('0x7b')]&&_0x5edcfb[_0x9484('0x79')][_0x34d62a][_0x9484('0x7c')]){_0x177322[_0x5edcfb[_0x9484('0x79')][_0x34d62a][_0x9484('0x31')]](_0x5edcfb['joins'][_0x34d62a][_0x9484('0x7b')],null,util[_0x9484('0x75')]('%s.%s\x20=\x20%s.%s',_0x5edcfb['table'],_0x5edcfb['joins'][_0x34d62a]['parentKey'],_0x5edcfb['joins'][_0x34d62a]['foreignTable'],_0x5edcfb[_0x9484('0x79')][_0x34d62a][_0x9484('0x7c')]));}}}if(_0x5edcfb[_0x9484('0x7d')]){_0x5edcfb[_0x9484('0x7d')]=JSON[_0x9484('0x7e')](_0x5edcfb[_0x9484('0x7d')]);_0x177322[_0x9484('0x3f')](_0x181779(_0x5edcfb['conditions'][_0x9484('0x64')]));}_0x406522=_0x177322[_0x9484('0x7f')]();_0x177322[_0x9484('0x22')](_0x153637);_0x177322[_0x9484('0x21')](0x0);logger[_0x9484('0x80')](_0x9484('0x81'),_0x177322[_0x9484('0x82')]());return db[_0x9484('0x83')][_0x9484('0x34')](_0x177322[_0x9484('0x82')](),{'type':db[_0x9484('0x83')]['QueryTypes'][_0x9484('0x84')]});}})[_0x9484('0x27')](respondWithResult(_0x880736,null))[_0x9484('0x48')](handleError(_0x880736,null));};function runReport(_0x2d983e,_0x327ee2,_0x172320){var _0x525fe4=_0x327ee2[_0x9484('0x2c')];var _0x555874=0xa;var _0x25f9b2=[_0x9484('0x54'),_0x9484('0x55'),_0x9484('0x56'),_0x9484('0x57')];var _0xac9cf2={'SUM':_0x9484('0x58'),'COUNT':_0x9484('0x59'),'COUNT DISTINCT':_0x9484('0x85'),'MAX':_0x9484('0x5a'),'MIN':'MIN(%s)','AVG':_0x9484('0x5c'),'GROUP_CONCAT':_0x9484('0x86'),'GROUP_CONCAT ASC':_0x9484('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1a7e09={'SEC_TO_TIME':_0x9484('0x87'),'DATE':'DATE(%s)','HOUR':_0x9484('0x88'),'ROUND':_0x9484('0x89'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x348a49=function(_0x3184ad){return!_[_0x9484('0x60')]([_0x9484('0x8a'),_0x9484('0x8b'),'IS\x20EMPTY',_0x9484('0x61')],_0x3184ad);};var _0x58a232=function(_0x38ddcc){if(!_0x38ddcc||!_0x38ddcc[_0x9484('0x62')][_0x9484('0x3a')]){return'';}for(var _0x17fb60='(',_0x4d6382=0x0;_0x4d6382<_0x38ddcc[_0x9484('0x62')][_0x9484('0x3a')];_0x4d6382+=0x1){_0x4d6382>0x0&&(_0x17fb60+='\x20'+_0x38ddcc['operator']+'\x20');_0x17fb60+=_0x38ddcc['rules'][_0x4d6382][_0x9484('0x64')]?_0x58a232(_0x38ddcc['rules'][_0x4d6382][_0x9484('0x64')]):_0x38ddcc[_0x9484('0x62')][_0x4d6382][_0x9484('0x65')]+'\x20'+_0x38ddcc[_0x9484('0x62')][_0x4d6382][_0x9484('0x66')]+(_0x348a49(_0x38ddcc[_0x9484('0x62')][_0x4d6382][_0x9484('0x66')])?'\x20'+_0x38ddcc[_0x9484('0x62')][_0x4d6382][_0x9484('0x67')]:'');}return _0x17fb60+')';};var _0x5bd6c3={'where':{'id':_0x2d983e['id']}},_0x3bf3a9,_0x57d0c7,_0x3ba6d3,_0x19e74f,_0x13451c;_0x5bd6c3=_[_0x9484('0x41')]({},_0x5bd6c3,_0x172320);return db[_0x9484('0x2e')]['find'](_0x5bd6c3)['then'](function(_0x16b440){if(_0x16b440){_0x3bf3a9=_0x16b440;return _0x16b440[_0x9484('0x68')]();}return null;})[_0x9484('0x27')](function(_0xf4baaa){if(_0xf4baaa){if(!_0xf4baaa[_0x9484('0x3a')]){throw new db[(_0x9484('0x69'))][(_0x9484('0x6a'))](_0x9484('0x6b'),0x193);}_0x57d0c7=_0xf4baaa;return db[_0x9484('0x6c')][_0x9484('0x6d')]({'raw':!![]});}return null;})['then'](function(_0x9642be){if(_0x9642be){_0x3ba6d3=_['keyBy'](_0x9642be,'id');var _0x18bbdf;var _0x4a3d96=squel[_0x9484('0x6f')]();_0x4a3d96[_0x9484('0x70')](_0x3bf3a9[_0x9484('0x71')]);for(var _0x2a9273=0x0;_0x2a9273<_0x57d0c7[_0x9484('0x3a')];_0x2a9273+=0x1){_0x18bbdf=_0x57d0c7[_0x2a9273][_0x9484('0x8c')]?_0x3ba6d3[_0x57d0c7[_0x2a9273]['MetricId']][_0x9484('0x72')]:_0x57d0c7[_0x2a9273][_0x9484('0x65')];_0x18bbdf=_0x57d0c7[_0x2a9273][_0x9484('0x74')]?_['replace'](_0xac9cf2[_0x57d0c7[_0x2a9273][_0x9484('0x74')]],'%s',_0x18bbdf):_0x18bbdf;_0x18bbdf=_0x57d0c7[_0x2a9273]['format']?_[_0x9484('0x73')](_0x1a7e09[_0x57d0c7[_0x2a9273][_0x9484('0x75')]],'%s',_0x18bbdf):_0x18bbdf;if(_0x57d0c7[_0x2a9273][_0x9484('0x8d')]){_0x4a3d96[_0x9484('0x64')](_0x18bbdf);}_0x57d0c7[_0x2a9273][_0x9484('0x76')]&&_0x4a3d96['order'](_0x18bbdf,_0x57d0c7[_0x2a9273][_0x9484('0x76')]==='DESC'?![]:!![]);_0x4a3d96['field'](_0x18bbdf,_0x57d0c7[_0x2a9273][_0x9484('0x78')]||_0x18bbdf);}if(_0x3bf3a9['joins']){_0x3bf3a9['joins']=JSON[_0x9484('0x7e')](_0x3bf3a9['joins']);for(var _0x157f2a=0x0;_0x157f2a<_0x3bf3a9[_0x9484('0x79')][_0x9484('0x3a')];_0x157f2a+=0x1){if(_0x3bf3a9[_0x9484('0x79')][_0x157f2a][_0x9484('0x31')]&&_[_0x9484('0x60')](_0x25f9b2,_0x3bf3a9[_0x9484('0x79')][_0x157f2a]['type'])&&_0x3bf3a9[_0x9484('0x79')][_0x157f2a][_0x9484('0x7a')]&&_0x3bf3a9['joins'][_0x157f2a][_0x9484('0x7b')]&&_0x3bf3a9[_0x9484('0x79')][_0x157f2a]['foreignKey']){_0x4a3d96[_0x3bf3a9['joins'][_0x157f2a][_0x9484('0x31')]](_0x3bf3a9[_0x9484('0x79')][_0x157f2a][_0x9484('0x7b')],null,util[_0x9484('0x75')](_0x9484('0x8e'),_0x3bf3a9[_0x9484('0x71')],_0x3bf3a9[_0x9484('0x79')][_0x157f2a][_0x9484('0x7a')],_0x3bf3a9[_0x9484('0x79')][_0x157f2a][_0x9484('0x7b')],_0x3bf3a9[_0x9484('0x79')][_0x157f2a]['foreignKey']));}}}if(_0x3bf3a9[_0x9484('0x7d')]){_0x3bf3a9[_0x9484('0x7d')]=JSON[_0x9484('0x7e')](_0x3bf3a9[_0x9484('0x7d')]);_0x4a3d96[_0x9484('0x3f')](_0x58a232(_0x3bf3a9[_0x9484('0x7d')][_0x9484('0x64')]));}_0x13451c=_0x4a3d96[_0x9484('0x7f')]();_0x4a3d96[_0x9484('0x22')](_0x555874);_0x4a3d96[_0x9484('0x21')](0x0);logger[_0x9484('0x80')](_0x9484('0x81'),_0x4a3d96['toString']());return db['sequelize'][_0x9484('0x34')](_0x4a3d96[_0x9484('0x82')](),{'type':db['sequelize'][_0x9484('0x8f')][_0x9484('0x84')]});}})[_0x9484('0x27')](function(_0x4db460){if(!_0x4db460[_0x9484('0x3a')]){throw new db[(_0x9484('0x69'))][(_0x9484('0x6a'))]('No\x20available\x20data',0xcc);}if(_0x327ee2['output']===_0x9484('0x90')){return null;}var _0x218030=_['merge'](_0x327ee2,{'name':_0x327ee2['fullPath']||_0x327ee2[_0x9484('0x2c')]||_0x3bf3a9['name'],'basename':_0x525fe4,'savename':util[_0x9484('0x75')](_0x9484('0x91'),_0x327ee2[_0x9484('0x2c')]||_0x3bf3a9[_0x9484('0x2c')],require('randomstring')[_0x9484('0x92')](0x4),_0x327ee2['output']||_0x9484('0x93')),'reportId':_0x3bf3a9['id'],'reportType':_0x9484('0x94')});return db[_0x9484('0x95')]['create'](_0x218030,{'raw':!![]});})[_0x9484('0x27')](function(_0x2171e7){if(_0x3bf3a9['table']===_0x9484('0x96')){_0x13451c[_0x9484('0x3f')](_0x3bf3a9[_0x9484('0x71')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x327ee2['startDate'],_0x327ee2['endDate']);}else{_0x13451c[_0x9484('0x3f')](_0x3bf3a9['table']+_0x9484('0x97'),_0x327ee2[_0x9484('0x98')],_0x327ee2[_0x9484('0x99')]);}if(_0x2171e7){logger[_0x9484('0x9a')]('Run\x20Query:',_0x13451c[_0x9484('0x82')]());require(_0x9484('0x9b'))[_0x9484('0x9c')](path['join'](__dirname,_0x9484('0x9d'),_0x2171e7[_0x9484('0x9e')]),[_0x2171e7['id'],_0x13451c[_0x9484('0x82')](),path[_0x9484('0x54')](__dirname,_0x9484('0x9f'),_0x2171e7[_0x9484('0xa0')]),_0x525fe4]);return _0x2171e7;}else{var _0x4a352c=squel['select']();_0x4a352c[_0x9484('0x70')]('('+_0x13451c[_0x9484('0x82')]()+')',_0x9484('0xa1'));_0x4a352c[_0x9484('0x65')](_0x9484('0xa2'),_0x9484('0x20'));_0x13451c[_0x9484('0x22')](_0x327ee2[_0x9484('0x22')]||_0x555874);_0x13451c[_0x9484('0x21')](_0x327ee2[_0x9484('0x21')]||0x0);return dbH[_0x9484('0x83')][_0x9484('0x34')](_0x4a352c[_0x9484('0x82')](),{'type':dbH[_0x9484('0x83')][_0x9484('0x8f')][_0x9484('0x84')]})[_0x9484('0x27')](function(_0x1113d0){if(!_0x1113d0[_0x9484('0x3a')]){_0x19e74f=0x0;}else{_0x19e74f=_0x1113d0[0x0][_0x9484('0x20')]||0x0;}return dbH[_0x9484('0x83')][_0x9484('0x34')](_0x13451c[_0x9484('0x82')](),{'type':dbH['sequelize'][_0x9484('0x8f')]['SELECT']});})['then'](function(_0x5c1cce){return{'rows':_0x5c1cce||[],'count':_0x19e74f};});}});}exports[_0x9484('0xa3')]=function(_0x34bcd3,_0x474da8){return runReport(_0x34bcd3[_0x9484('0x46')],_0x34bcd3[_0x9484('0x34')],_0x34bcd3[_0x9484('0x43')])[_0x9484('0x27')](respondWithResult(_0x474da8,null))[_0x9484('0x48')](handleError(_0x474da8,null));};exports[_0x9484('0xa4')]=runReport;exports[_0x9484('0x34')]=function(_0x162cce,_0x4b3ca6){var _0x26dff9=0xa;var _0xb51894=['join',_0x9484('0x55'),_0x9484('0x56'),_0x9484('0x57')];var _0x5756f4={'SUM':_0x9484('0x58'),'COUNT':_0x9484('0x59'),'COUNT DISTINCT':_0x9484('0x85'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x9484('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9484('0xa5')};var _0x424812={'SEC_TO_TIME':_0x9484('0x87'),'DATE':_0x9484('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x9484('0x89'),'UNIX_TIMESTAMP':_0x9484('0x5f')};var _0x533cd3=function(_0x306c1d){return!_['includes']([_0x9484('0x8a'),'IS\x20NOT\x20NULL',_0x9484('0xa6'),_0x9484('0x61')],_0x306c1d);};var _0x3e4228=function(_0x38d798){if(!_0x38d798||!_0x38d798['rules'][_0x9484('0x3a')]){return'';}for(var _0x38a9c9='(',_0x168db9=0x0;_0x168db9<_0x38d798[_0x9484('0x62')][_0x9484('0x3a')];_0x168db9+=0x1){_0x168db9>0x0&&(_0x38a9c9+='\x20'+_0x38d798[_0x9484('0x63')]+'\x20');_0x38a9c9+=_0x38d798[_0x9484('0x62')][_0x168db9][_0x9484('0x64')]?_0x3e4228(_0x38d798[_0x9484('0x62')][_0x168db9][_0x9484('0x64')]):_0x38d798[_0x9484('0x62')][_0x168db9][_0x9484('0x65')]+'\x20'+_0x38d798[_0x9484('0x62')][_0x168db9][_0x9484('0x66')]+(_0x533cd3(_0x38d798[_0x9484('0x62')][_0x168db9][_0x9484('0x66')])?'\x20'+_0x38d798[_0x9484('0x62')][_0x168db9][_0x9484('0x67')]:'');}return _0x38a9c9+')';};var _0x3e573b={'where':{'id':_0x162cce[_0x9484('0x46')]['id']}},_0x464c4a,_0x4fd6c6,_0x3580d3,_0x3a45f2,_0xe9488b;_0x3e573b=_[_0x9484('0x41')]({},_0x3e573b,_0x162cce['options']);return db[_0x9484('0x2e')]['find'](_0x3e573b)[_0x9484('0x27')](function(_0x1be136){if(_0x1be136){_0x464c4a=_0x1be136;return _0x1be136[_0x9484('0x68')]();}return null;})['then'](function(_0x971ed3){if(_0x971ed3){if(!_0x971ed3[_0x9484('0x3a')]){throw new db[(_0x9484('0x69'))][(_0x9484('0x6a'))](_0x9484('0x6b'),0x193);}_0x4fd6c6=_0x971ed3;return db[_0x9484('0x6c')][_0x9484('0x6d')]({'raw':!![]});}return null;})[_0x9484('0x27')](function(_0x33f83f){if(_0x33f83f){_0x3580d3=_[_0x9484('0x6e')](_0x33f83f,'id');var _0x360d1d;var _0x53adbf=squel[_0x9484('0x6f')]();_0x53adbf[_0x9484('0x70')](_0x464c4a[_0x9484('0x71')]);for(var _0x54d850=0x0;_0x54d850<_0x4fd6c6['length'];_0x54d850+=0x1){_0x360d1d=_0x4fd6c6[_0x54d850]['MetricId']?_0x3580d3[_0x4fd6c6[_0x54d850][_0x9484('0x8c')]][_0x9484('0x72')]:_0x4fd6c6[_0x54d850][_0x9484('0x65')];_0x360d1d=_0x4fd6c6[_0x54d850][_0x9484('0x74')]?_[_0x9484('0x73')](_0x5756f4[_0x4fd6c6[_0x54d850][_0x9484('0x74')]],'%s',_0x360d1d):_0x360d1d;_0x360d1d=_0x4fd6c6[_0x54d850]['format']?_[_0x9484('0x73')](_0x424812[_0x4fd6c6[_0x54d850][_0x9484('0x75')]],'%s',_0x360d1d):_0x360d1d;if(_0x4fd6c6[_0x54d850][_0x9484('0x8d')]){_0x53adbf[_0x9484('0x64')](_0x360d1d);}_0x4fd6c6[_0x54d850][_0x9484('0x76')]&&_0x53adbf['order'](_0x360d1d,_0x4fd6c6[_0x54d850][_0x9484('0x76')]===_0x9484('0x77')?![]:!![]);_0x53adbf['field'](_0x360d1d,_0x4fd6c6[_0x54d850][_0x9484('0x78')]||_0x360d1d);}if(_0x464c4a[_0x9484('0x79')]){_0x464c4a[_0x9484('0x79')]=JSON['parse'](_0x464c4a[_0x9484('0x79')]);for(var _0xfe9d8b=0x0;_0xfe9d8b<_0x464c4a[_0x9484('0x79')][_0x9484('0x3a')];_0xfe9d8b+=0x1){if(_0x464c4a[_0x9484('0x79')][_0xfe9d8b][_0x9484('0x31')]&&_[_0x9484('0x60')](_0xb51894,_0x464c4a[_0x9484('0x79')][_0xfe9d8b][_0x9484('0x31')])&&_0x464c4a['joins'][_0xfe9d8b]['parentKey']&&_0x464c4a[_0x9484('0x79')][_0xfe9d8b][_0x9484('0x7b')]&&_0x464c4a[_0x9484('0x79')][_0xfe9d8b]['foreignKey']){_0x53adbf[_0x464c4a[_0x9484('0x79')][_0xfe9d8b][_0x9484('0x31')]](_0x464c4a['joins'][_0xfe9d8b]['foreignTable'],null,util[_0x9484('0x75')]('%s.%s\x20=\x20%s.%s',_0x464c4a[_0x9484('0x71')],_0x464c4a[_0x9484('0x79')][_0xfe9d8b][_0x9484('0x7a')],_0x464c4a[_0x9484('0x79')][_0xfe9d8b][_0x9484('0x7b')],_0x464c4a[_0x9484('0x79')][_0xfe9d8b]['foreignKey']));}}}if(_0x464c4a['conditions']){_0x464c4a['conditions']=JSON[_0x9484('0x7e')](_0x464c4a[_0x9484('0x7d')]);_0x53adbf[_0x9484('0x3f')](_0x3e4228(_0x464c4a['conditions']['group']));}_0xe9488b=_0x53adbf[_0x9484('0x7f')]();_0x53adbf[_0x9484('0x22')](_0x26dff9);_0x53adbf[_0x9484('0x21')](0x0);logger[_0x9484('0x80')](_0x9484('0x81'),_0x53adbf['toString']());return db[_0x9484('0x83')][_0x9484('0x34')](_0x53adbf[_0x9484('0x82')](),{'type':db[_0x9484('0x83')][_0x9484('0x8f')][_0x9484('0x84')]});}})[_0x9484('0x27')](function(){return{'sql':_0xe9488b['toString']()};})[_0x9484('0x27')](respondWithResult(_0x4b3ca6,null))['catch'](handleError(_0x4b3ca6,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 55e6091..a2d4832 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 _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
+var _0x6962=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','api','moment','bluebird'];(function(_0x4e1a35,_0x4e13d7){var _0x582820=function(_0x4c06a6){while(--_0x4c06a6){_0x4e1a35['push'](_0x4e1a35['shift']());}};_0x582820(++_0x4e13d7);}(_0x6962,0x73));var _0x2696=function(_0x54c878,_0x45156c){_0x54c878=_0x54c878-0x0;var _0x4494f7=_0x6962[_0x54c878];return _0x4494f7;};'use strict';var _=require(_0x2696('0x0'));var util=require(_0x2696('0x1'));var logger=require('../../config/logger')(_0x2696('0x2'));var moment=require(_0x2696('0x3'));var BPromise=require(_0x2696('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2696('0x5'));var rimraf=require(_0x2696('0x6'));var config=require(_0x2696('0x7'));var attributes=require(_0x2696('0x8'));module[_0x2696('0x9')]=function(_0x562bc9,_0x3b7a58){return _0x562bc9[_0x2696('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x2696('0xb'),'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 ad97736..5e93f9a 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 _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
+var _0xfc71=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x131390,_0xd0846e){var _0x550870=function(_0x13e841){while(--_0x13e841){_0x131390['push'](_0x131390['shift']());}};_0x550870(++_0xd0846e);}(_0xfc71,0x8b));var _0x1fc7=function(_0x9647da,_0x1f7117){_0x9647da=_0x9647da-0x0;var _0x25c414=_0xfc71[_0x9647da];return _0x25c414;};'use strict';var _=require(_0x1fc7('0x0'));var util=require(_0x1fc7('0x1'));var moment=require('moment');var BPromise=require(_0x1fc7('0x2'));var rs=require(_0x1fc7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1fc7('0x4'))['db'];var utils=require(_0x1fc7('0x5'));var logger=require(_0x1fc7('0x6'))(_0x1fc7('0x7'));var config=require(_0x1fc7('0x8'));var jayson=require(_0x1fc7('0x9'));var client=jayson[_0x1fc7('0xa')][_0x1fc7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44e66b,_0x30c189,_0x3914e4){return new BPromise(function(_0x14a468,_0x4def10){return client[_0x1fc7('0xc')](_0x44e66b,_0x3914e4)[_0x1fc7('0xd')](function(_0x3a276d){logger[_0x1fc7('0xe')](_0x1fc7('0xf'),_0x30c189,_0x1fc7('0x10'));logger[_0x1fc7('0x11')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x30c189,_0x1fc7('0x10'),JSON[_0x1fc7('0x12')](_0x3a276d));if(_0x3a276d[_0x1fc7('0x13')]){if(_0x3a276d['error'][_0x1fc7('0x14')]===0x1f4){logger[_0x1fc7('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x30c189,_0x3a276d[_0x1fc7('0x13')][_0x1fc7('0x15')]);return _0x4def10(_0x3a276d[_0x1fc7('0x13')][_0x1fc7('0x15')]);}logger['error'](_0x1fc7('0xf'),_0x30c189,_0x3a276d[_0x1fc7('0x13')][_0x1fc7('0x15')]);return _0x14a468(_0x3a276d['error']['message']);}else{logger[_0x1fc7('0xe')](_0x1fc7('0xf'),_0x30c189,_0x1fc7('0x10'));_0x14a468(_0x3a276d['result'][_0x1fc7('0x15')]);}})[_0x1fc7('0x16')](function(_0x54e29c){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x30c189,_0x54e29c);_0x4def10(_0x54e29c);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 93bb062..2405c2d 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 _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
+var _0xf8ab=['put','/:id','delete','multer','util','path','express','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id/preview','/:id/run','run','query','post','create'];(function(_0xbe0633,_0x1a3590){var _0x14ef18=function(_0x3a84c7){while(--_0x3a84c7){_0xbe0633['push'](_0xbe0633['shift']());}};_0x14ef18(++_0x1a3590);}(_0xf8ab,0x1cb));var _0xbf8a=function(_0x392416,_0x5edecb){_0x392416=_0x392416-0x0;var _0x495907=_0xf8ab[_0x392416];return _0x495907;};'use strict';var multer=require(_0xbf8a('0x0'));var util=require(_0xbf8a('0x1'));var path=require(_0xbf8a('0x2'));var timeout=require('connect-timeout');var express=require(_0xbf8a('0x3'));var router=express['Router']();var auth=require(_0xbf8a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbf8a('0x5'));var controller=require(_0xbf8a('0x6'));router['get']('/',auth[_0xbf8a('0x7')](),controller[_0xbf8a('0x8')]);router[_0xbf8a('0x9')]('/:id',auth[_0xbf8a('0x7')](),controller['show']);router[_0xbf8a('0x9')](_0xbf8a('0xa'),auth[_0xbf8a('0x7')](),controller['preview']);router[_0xbf8a('0x9')](_0xbf8a('0xb'),auth[_0xbf8a('0x7')](),controller[_0xbf8a('0xc')]);router[_0xbf8a('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0xbf8a('0xd')]);router[_0xbf8a('0xe')]('/',auth[_0xbf8a('0x7')](),controller[_0xbf8a('0xf')]);router[_0xbf8a('0x10')](_0xbf8a('0x11'),auth[_0xbf8a('0x7')](),controller['update']);router[_0xbf8a('0x12')]('/:id',auth[_0xbf8a('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 41aece1..f1fb52a 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 _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
+var _0xfa4d=['TEXT','exports','STRING'];(function(_0x57e545,_0x34d6d8){var _0x33fa1e=function(_0x55664e){while(--_0x55664e){_0x57e545['push'](_0x57e545['shift']());}};_0x33fa1e(++_0x34d6d8);}(_0xfa4d,0x64));var _0xdfa4=function(_0x29d643,_0x16adc5){_0x29d643=_0x29d643-0x0;var _0x20fced=_0xfa4d[_0x29d643];return _0x20fced;};'use strict';var Sequelize=require('sequelize');module[_0xdfa4('0x0')]={'name':{'type':Sequelize[_0xdfa4('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xdfa4('0x1')]},'parent':{'type':Sequelize[_0xdfa4('0x1')]},'table':{'type':Sequelize[_0xdfa4('0x1')]},'conditions':{'type':Sequelize[_0xdfa4('0x2')]},'joins':{'type':Sequelize[_0xdfa4('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 2d11e31..8e250ef 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 _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
+var _0x4114=['zip-dir','request-promise','moment','mustache','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','../../mysqldb','dbH','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','error','name','index','map','AnalyticDefaultReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','filter','merge','findAll','rows','catch','show','params','rawAttributes','includeAll','include','options','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','preview','join','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','toString','QueryTypes','SELECT','COUNT(%s)','MIN(%s)','SEC_TO_TIME(%s)','ROUND(%s)','DESC','debug','No\x20available\x20data','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','clone','html-pdf','eml-format','rimraf'];(function(_0xccaf5,_0x7c8b40){var _0x293e64=function(_0x1540cf){while(--_0x1540cf){_0xccaf5['push'](_0xccaf5['shift']());}};_0x293e64(++_0x7c8b40);}(_0x4114,0x14b));var _0x4411=function(_0x136a7a,_0x3218f8){_0x136a7a=_0x136a7a-0x0;var _0x5d3632=_0x4114[_0x136a7a];return _0x5d3632;};'use strict';var pdf=require(_0x4411('0x0'));var emlformat=require(_0x4411('0x1'));var rimraf=require(_0x4411('0x2'));var zipdir=require(_0x4411('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4411('0x4'));var moment=require(_0x4411('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4411('0x6'));var util=require('util');var path=require(_0x4411('0x7'));var sox=require(_0x4411('0x8'));var csv=require(_0x4411('0x9'));var ejs=require(_0x4411('0xa'));var fs=require('fs');var _=require(_0x4411('0xb'));var squel=require(_0x4411('0xc'));var crypto=require(_0x4411('0xd'));var jsforce=require(_0x4411('0xe'));var deskjs=require(_0x4411('0xf'));var toCsv=require(_0x4411('0x9'));var querystring=require(_0x4411('0x10'));var Papa=require('papaparse');var Redis=require(_0x4411('0x11'));var authService=require(_0x4411('0x12'));var qs=require(_0x4411('0x13'));var as=require(_0x4411('0x14'));var hardwareService=require(_0x4411('0x15'));var logger=require(_0x4411('0x16'))(_0x4411('0x17'));var utils=require(_0x4411('0x18'));var config=require('../../config/environment');var db=require(_0x4411('0x19'))['db'];var dbH=require(_0x4411('0x19'))[_0x4411('0x1a')];function respondWithStatusCode(_0x1c1984,_0x3ac441){_0x3ac441=_0x3ac441||0xcc;return function(_0x250905){if(_0x250905){return _0x1c1984[_0x4411('0x1b')](_0x3ac441);}return _0x1c1984[_0x4411('0x1c')](_0x3ac441)['end']();};}function respondWithResult(_0x27ab16,_0x248871){_0x248871=_0x248871||0xc8;return function(_0x68756c){if(_0x68756c){return _0x27ab16[_0x4411('0x1c')](_0x248871)[_0x4411('0x1d')](_0x68756c);}};}function respondWithFilteredResult(_0x180343,_0x4788fe){return function(_0x503084){if(_0x503084){var _0x39c6b7=_0x503084[_0x4411('0x1e')],_0x1c45d8=_0x4788fe[_0x4411('0x1f')],_0x253b85=_0x4788fe[_0x4411('0x1f')]+_0x4788fe[_0x4411('0x20')],_0x559b61;if(_0x253b85>=_0x39c6b7){_0x253b85=_0x39c6b7;_0x559b61=0xc8;}else{_0x559b61=0xce;}_0x180343[_0x4411('0x1c')](_0x559b61);return _0x180343[_0x4411('0x21')](_0x4411('0x22'),_0x1c45d8+'-'+_0x253b85+'/'+_0x39c6b7)['json'](_0x503084);}return null;};}function patchUpdates(_0x543d99){return function(_0x220187){try{jsonpatch[_0x4411('0x23')](_0x220187,_0x543d99,!![]);}catch(_0x394575){return BPromise[_0x4411('0x24')](_0x394575);}return _0x220187[_0x4411('0x25')]();};}function saveUpdates(_0x1147eb,_0x1820b3){return function(_0x359dd0){if(_0x359dd0){return _0x359dd0[_0x4411('0x26')](_0x1147eb)[_0x4411('0x27')](function(_0x4bcb0d){return _0x4bcb0d;});}return null;};}function removeEntity(_0x2cf33b,_0x2664a6){return function(_0x29c901){if(_0x29c901){return _0x29c901[_0x4411('0x28')]()[_0x4411('0x27')](function(){var _0x24e5b7=_0x29c901['get']({'plain':!![]});var _0x269191='DefaultReports';return db[_0x4411('0x29')][_0x4411('0x28')]({'where':{'type':_0x269191,'resourceId':_0x24e5b7['id']}})[_0x4411('0x27')](function(){return _0x29c901;});})['then'](function(){_0x2cf33b[_0x4411('0x1c')](0xcc)[_0x4411('0x2a')]();});}};}function handleEntityNotFound(_0x282bc8,_0x313081){return function(_0xdb06ec){if(!_0xdb06ec){_0x282bc8[_0x4411('0x1b')](0x194);}return _0xdb06ec;};}function handleError(_0x1a4a24,_0x3cb533){_0x3cb533=_0x3cb533||0x1f4;return function(_0x10b81c){logger[_0x4411('0x2b')](_0x10b81c['stack']);if(_0x10b81c['name']){delete _0x10b81c[_0x4411('0x2c')];}_0x1a4a24[_0x4411('0x1c')](_0x3cb533)['send'](_0x10b81c);};}exports[_0x4411('0x2d')]=function(_0xe6ba5d,_0x286470){var _0x2515d4={},_0x1181ec={},_0x2a67bb={'count':0x0,'rows':[]};var _0x2a946d=_[_0x4411('0x2e')](db[_0x4411('0x2f')]['rawAttributes'],function(_0x162972){return{'name':_0x162972[_0x4411('0x30')],'type':_0x162972['type'][_0x4411('0x31')]};});_0x1181ec[_0x4411('0x32')]=_['map'](_0x2a946d,'name');_0x1181ec[_0x4411('0x33')]=_[_0x4411('0x34')](_0xe6ba5d[_0x4411('0x33')]);_0x1181ec[_0x4411('0x35')]=_[_0x4411('0x36')](_0x1181ec[_0x4411('0x32')],_0x1181ec['query']);_0x2515d4[_0x4411('0x37')]=_[_0x4411('0x36')](_0x1181ec[_0x4411('0x32')],qs[_0x4411('0x38')](_0xe6ba5d[_0x4411('0x33')][_0x4411('0x38')]));_0x2515d4[_0x4411('0x37')]=_0x2515d4[_0x4411('0x37')][_0x4411('0x39')]?_0x2515d4[_0x4411('0x37')]:_0x1181ec[_0x4411('0x32')];if(!_0xe6ba5d[_0x4411('0x33')][_0x4411('0x3a')](_0x4411('0x3b'))){_0x2515d4[_0x4411('0x20')]=qs[_0x4411('0x20')](_0xe6ba5d['query'][_0x4411('0x20')]);_0x2515d4[_0x4411('0x1f')]=qs['offset'](_0xe6ba5d[_0x4411('0x33')][_0x4411('0x1f')]);}_0x2515d4[_0x4411('0x3c')]=qs[_0x4411('0x3d')](_0xe6ba5d[_0x4411('0x33')][_0x4411('0x3d')]);_0x2515d4[_0x4411('0x3e')]=qs[_0x4411('0x35')](_['pick'](_0xe6ba5d[_0x4411('0x33')],_0x1181ec['filters']),_0x2a946d);if(_0xe6ba5d[_0x4411('0x33')]['filter']){_0x2515d4[_0x4411('0x3e')]=_['merge'](_0x2515d4[_0x4411('0x3e')],{'$or':_['map'](_0x2a946d,function(_0xd1b5d6){if(_0xd1b5d6[_0x4411('0x3f')]!==_0x4411('0x40')){var _0x5090c0={};_0x5090c0[_0xd1b5d6[_0x4411('0x2c')]]={'$like':'%'+_0xe6ba5d[_0x4411('0x33')][_0x4411('0x41')]+'%'};return _0x5090c0;}})});}_0x2515d4=_[_0x4411('0x42')]({},_0x2515d4,_0xe6ba5d['options']);var _0x597a57={'where':_0x2515d4['where']};return db['AnalyticDefaultReport'][_0x4411('0x1e')](_0x597a57)[_0x4411('0x27')](function(_0x445abe){_0x2a67bb[_0x4411('0x1e')]=_0x445abe;if(_0xe6ba5d[_0x4411('0x33')]['includeAll']){_0x2515d4['include']=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x4411('0x43')](_0x2515d4);})[_0x4411('0x27')](function(_0x450f1b){_0x2a67bb[_0x4411('0x44')]=_0x450f1b;return _0x2a67bb;})[_0x4411('0x27')](respondWithFilteredResult(_0x286470,_0x2515d4))[_0x4411('0x45')](handleError(_0x286470,null));};exports[_0x4411('0x46')]=function(_0x54fce3,_0x2e5e53){var _0x525429={'raw':!![],'where':{'id':_0x54fce3[_0x4411('0x47')]['id']}},_0x5ee5ce={};_0x5ee5ce['model']=_[_0x4411('0x34')](db[_0x4411('0x2f')][_0x4411('0x48')]);_0x5ee5ce[_0x4411('0x33')]=_[_0x4411('0x34')](_0x54fce3[_0x4411('0x33')]);_0x5ee5ce['filters']=_[_0x4411('0x36')](_0x5ee5ce[_0x4411('0x32')],_0x5ee5ce[_0x4411('0x33')]);_0x525429['attributes']=_[_0x4411('0x36')](_0x5ee5ce[_0x4411('0x32')],qs['fields'](_0x54fce3['query'][_0x4411('0x38')]));_0x525429[_0x4411('0x37')]=_0x525429[_0x4411('0x37')][_0x4411('0x39')]?_0x525429[_0x4411('0x37')]:_0x5ee5ce[_0x4411('0x32')];if(_0x54fce3[_0x4411('0x33')][_0x4411('0x49')]){_0x525429[_0x4411('0x4a')]=[{'all':!![]}];}_0x525429=_[_0x4411('0x42')]({},_0x525429,_0x54fce3[_0x4411('0x4b')]);return db[_0x4411('0x2f')][_0x4411('0x4c')](_0x525429)[_0x4411('0x27')](handleEntityNotFound(_0x2e5e53,null))[_0x4411('0x27')](respondWithResult(_0x2e5e53,null))['catch'](handleError(_0x2e5e53,null));};exports[_0x4411('0x4d')]=function(_0x1fd5d4,_0xd15aa1){return db[_0x4411('0x2f')]['create'](_0x1fd5d4[_0x4411('0x4e')],{})[_0x4411('0x27')](function(_0x91f05d){var _0x4d7f63=_0x1fd5d4[_0x4411('0x4f')]['get']({'plain':!![]});if(!_0x4d7f63)throw new Error(_0x4411('0x50'));if(_0x4d7f63[_0x4411('0x51')]===_0x4411('0x4f')){var _0xb17afd=_0x91f05d['get']({'plain':!![]});var _0x2cf173='Reports';return db[_0x4411('0x52')][_0x4411('0x4c')]({'where':{'name':_0x2cf173,'userProfileId':_0x4d7f63[_0x4411('0x53')]},'raw':!![]})[_0x4411('0x27')](function(_0x23c530){if(_0x23c530&&_0x23c530[_0x4411('0x54')]===0x0){return db[_0x4411('0x29')][_0x4411('0x4d')]({'name':_0xb17afd[_0x4411('0x2c')],'resourceId':_0xb17afd['id'],'type':'DefaultReports','sectionId':_0x23c530['id']},{})[_0x4411('0x27')](function(){return _0x91f05d;});}else{return _0x91f05d;}})[_0x4411('0x45')](function(_0x425b66){logger['error'](_0x4411('0x55'),_0x425b66);throw _0x425b66;});}return _0x91f05d;})[_0x4411('0x27')](respondWithResult(_0xd15aa1,0xc9))[_0x4411('0x45')](handleError(_0xd15aa1,null));};exports[_0x4411('0x26')]=function(_0x21e826,_0x507101){if(_0x21e826[_0x4411('0x4e')]['id']){delete _0x21e826[_0x4411('0x4e')]['id'];}return db[_0x4411('0x2f')]['find']({'where':{'id':_0x21e826[_0x4411('0x47')]['id']}})['then'](handleEntityNotFound(_0x507101,null))[_0x4411('0x27')](saveUpdates(_0x21e826[_0x4411('0x4e')],null))[_0x4411('0x27')](respondWithResult(_0x507101,null))[_0x4411('0x45')](handleError(_0x507101,null));};exports['destroy']=function(_0x1485eb,_0x46bb8d){return db['AnalyticDefaultReport'][_0x4411('0x4c')]({'where':{'id':_0x1485eb[_0x4411('0x47')]['id']}})[_0x4411('0x27')](handleEntityNotFound(_0x46bb8d,null))['then'](removeEntity(_0x46bb8d,null))[_0x4411('0x45')](handleError(_0x46bb8d,null));};exports[_0x4411('0x56')]=function(_0xcab3a,_0x7e1d0d){var _0x4e7a02=0xa;var _0x44402a=[_0x4411('0x57'),_0x4411('0x58'),_0x4411('0x59'),_0x4411('0x5a')];var _0x2d671e={'SUM':_0x4411('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4411('0x5c'),'MIN':'MIN(%s)','AVG':_0x4411('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x4411('0x5e'),'GROUP_CONCAT DESC':_0x4411('0x5f')};var _0xd6a862={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4411('0x60'),'HOUR':_0x4411('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xea221b=function(_0x2030f4){return!_[_0x4411('0x62')]([_0x4411('0x63'),_0x4411('0x64'),_0x4411('0x65'),_0x4411('0x66')],_0x2030f4);};var _0x4ecd3e=function(_0x28eef6){if(!_0x28eef6||!_0x28eef6[_0x4411('0x67')][_0x4411('0x39')]){return'';}for(var _0x44186e='(',_0xc063dd=0x0;_0xc063dd<_0x28eef6[_0x4411('0x67')][_0x4411('0x39')];_0xc063dd+=0x1){_0xc063dd>0x0&&(_0x44186e+='\x20'+_0x28eef6[_0x4411('0x68')]+'\x20');_0x44186e+=_0x28eef6[_0x4411('0x67')][_0xc063dd]['group']?_0x4ecd3e(_0x28eef6['rules'][_0xc063dd][_0x4411('0x69')]):_0x28eef6['rules'][_0xc063dd]['field']+'\x20'+_0x28eef6[_0x4411('0x67')][_0xc063dd][_0x4411('0x6a')]+(_0xea221b(_0x28eef6[_0x4411('0x67')][_0xc063dd][_0x4411('0x6a')])?'\x20'+_0x28eef6['rules'][_0xc063dd][_0x4411('0x6b')]:'');}return _0x44186e+')';};var _0x4db41c={'where':{'id':_0xcab3a['params']['id']}},_0x507d6d,_0x151aef,_0x3ba7f4,_0x461dd2,_0x4ee248;_0x4db41c=_['merge']({},_0x4db41c,_0xcab3a['options']);return db['AnalyticDefaultReport'][_0x4411('0x4c')](_0x4db41c)['then'](function(_0x3085c){if(_0x3085c){_0x507d6d=_0x3085c;return _0x3085c[_0x4411('0x6c')]();}return null;})[_0x4411('0x27')](function(_0x1a40d5){if(_0x1a40d5){if(!_0x1a40d5['length']){throw new db[(_0x4411('0x6d'))][(_0x4411('0x6e'))](_0x4411('0x6f'),0x193);}_0x151aef=_0x1a40d5;return db[_0x4411('0x70')][_0x4411('0x43')]({'raw':!![]});}return null;})[_0x4411('0x27')](function(_0x44103d){if(_0x44103d){_0x3ba7f4=_[_0x4411('0x71')](_0x44103d,'id');var _0x22087a;var _0x55c3be=squel[_0x4411('0x72')]();_0x55c3be[_0x4411('0x73')](_0x507d6d[_0x4411('0x74')]);for(var _0x3a6ba4=0x0;_0x3a6ba4<_0x151aef[_0x4411('0x39')];_0x3a6ba4+=0x1){_0x22087a=_0x151aef[_0x3a6ba4][_0x4411('0x75')]?_0x3ba7f4[_0x151aef[_0x3a6ba4]['MetricId']][_0x4411('0x76')]:_0x151aef[_0x3a6ba4][_0x4411('0x77')];_0x22087a=_0x151aef[_0x3a6ba4][_0x4411('0x78')]?_[_0x4411('0x79')](_0x2d671e[_0x151aef[_0x3a6ba4][_0x4411('0x78')]],'%s',_0x22087a):_0x22087a;_0x22087a=_0x151aef[_0x3a6ba4][_0x4411('0x7a')]?_[_0x4411('0x79')](_0xd6a862[_0x151aef[_0x3a6ba4][_0x4411('0x7a')]],'%s',_0x22087a):_0x22087a;if(_0x151aef[_0x3a6ba4][_0x4411('0x7b')]){_0x55c3be[_0x4411('0x69')](_0x22087a);}_0x151aef[_0x3a6ba4][_0x4411('0x7c')]&&_0x55c3be[_0x4411('0x3c')](_0x22087a,_0x151aef[_0x3a6ba4][_0x4411('0x7c')]==='DESC'?![]:!![]);_0x55c3be[_0x4411('0x77')](_0x22087a,_0x151aef[_0x3a6ba4][_0x4411('0x7d')]||_0x22087a);}if(_0x507d6d['joins']){_0x507d6d[_0x4411('0x7e')]=JSON[_0x4411('0x7f')](_0x507d6d['joins']);for(var _0x7b4501=0x0;_0x7b4501<_0x507d6d[_0x4411('0x7e')][_0x4411('0x39')];_0x7b4501+=0x1){if(_0x507d6d[_0x4411('0x7e')][_0x7b4501][_0x4411('0x3f')]&&_['includes'](_0x44402a,_0x507d6d['joins'][_0x7b4501]['type'])&&_0x507d6d[_0x4411('0x7e')][_0x7b4501][_0x4411('0x80')]&&_0x507d6d[_0x4411('0x7e')][_0x7b4501]['foreignTable']&&_0x507d6d['joins'][_0x7b4501][_0x4411('0x81')]){_0x55c3be[_0x507d6d['joins'][_0x7b4501]['type']](_0x507d6d[_0x4411('0x7e')][_0x7b4501][_0x4411('0x82')],null,util[_0x4411('0x7a')](_0x4411('0x83'),_0x507d6d[_0x4411('0x74')],_0x507d6d[_0x4411('0x7e')][_0x7b4501][_0x4411('0x80')],_0x507d6d[_0x4411('0x7e')][_0x7b4501][_0x4411('0x82')],_0x507d6d['joins'][_0x7b4501][_0x4411('0x81')]));}}}if(_0x507d6d[_0x4411('0x84')]){_0x507d6d['conditions']=JSON[_0x4411('0x7f')](_0x507d6d['conditions']);_0x55c3be[_0x4411('0x3e')](_0x4ecd3e(_0x507d6d[_0x4411('0x84')][_0x4411('0x69')]));}_0x4ee248=_0x55c3be['clone']();_0x55c3be[_0x4411('0x20')](_0x4e7a02);_0x55c3be['offset'](0x0);logger['debug'](_0x4411('0x85'),_0x55c3be[_0x4411('0x86')]());return db['sequelize'][_0x4411('0x33')](_0x55c3be[_0x4411('0x86')](),{'type':db['sequelize'][_0x4411('0x87')][_0x4411('0x88')]});}})[_0x4411('0x27')](respondWithResult(_0x7e1d0d,null))[_0x4411('0x45')](handleError(_0x7e1d0d,null));};function runReport(_0x3b9dca,_0xf81a54,_0x392661){var _0x12d848=_0xf81a54[_0x4411('0x2c')];var _0x36fb2d=0xa;var _0x10fca9=[_0x4411('0x57'),_0x4411('0x58'),'right_join',_0x4411('0x5a')];var _0x4eafb4={'SUM':_0x4411('0x5b'),'COUNT':_0x4411('0x89'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4411('0x5c'),'MIN':_0x4411('0x8a'),'AVG':_0x4411('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x4411('0x5e'),'GROUP_CONCAT DESC':_0x4411('0x5f')};var _0x29fe20={'SEC_TO_TIME':_0x4411('0x8b'),'DATE':_0x4411('0x60'),'HOUR':'HOUR(%s)','ROUND':_0x4411('0x8c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2585a0=function(_0x11359d){return!_['includes']([_0x4411('0x63'),_0x4411('0x64'),'IS\x20EMPTY',_0x4411('0x66')],_0x11359d);};var _0x25b084=function(_0x340391){if(!_0x340391||!_0x340391[_0x4411('0x67')][_0x4411('0x39')]){return'';}for(var _0x114c54='(',_0x48e45c=0x0;_0x48e45c<_0x340391[_0x4411('0x67')][_0x4411('0x39')];_0x48e45c+=0x1){_0x48e45c>0x0&&(_0x114c54+='\x20'+_0x340391[_0x4411('0x68')]+'\x20');_0x114c54+=_0x340391[_0x4411('0x67')][_0x48e45c][_0x4411('0x69')]?_0x25b084(_0x340391[_0x4411('0x67')][_0x48e45c][_0x4411('0x69')]):_0x340391[_0x4411('0x67')][_0x48e45c][_0x4411('0x77')]+'\x20'+_0x340391[_0x4411('0x67')][_0x48e45c][_0x4411('0x6a')]+(_0x2585a0(_0x340391[_0x4411('0x67')][_0x48e45c]['condition'])?'\x20'+_0x340391[_0x4411('0x67')][_0x48e45c]['value']:'');}return _0x114c54+')';};var _0x47316c={'where':{'id':_0x3b9dca['id']}},_0x1a2fc2,_0x42c886,_0x4dfe50,_0x586dde,_0x11bee9;_0x47316c=_[_0x4411('0x42')]({},_0x47316c,_0x392661);return db[_0x4411('0x2f')][_0x4411('0x4c')](_0x47316c)[_0x4411('0x27')](function(_0x1a433d){if(_0x1a433d){_0x1a2fc2=_0x1a433d;return _0x1a433d[_0x4411('0x6c')]();}return null;})['then'](function(_0x56f8b0){if(_0x56f8b0){if(!_0x56f8b0[_0x4411('0x39')]){throw new db['Sequelize'][(_0x4411('0x6e'))](_0x4411('0x6f'),0x193);}_0x42c886=_0x56f8b0;return db[_0x4411('0x70')][_0x4411('0x43')]({'raw':!![]});}return null;})['then'](function(_0x2b91ab){if(_0x2b91ab){_0x4dfe50=_[_0x4411('0x71')](_0x2b91ab,'id');var _0x5f5f5c;var _0x3caab5=squel['select']();_0x3caab5[_0x4411('0x73')](_0x1a2fc2[_0x4411('0x74')]);for(var _0x38b57a=0x0;_0x38b57a<_0x42c886['length'];_0x38b57a+=0x1){_0x5f5f5c=_0x42c886[_0x38b57a][_0x4411('0x75')]?_0x4dfe50[_0x42c886[_0x38b57a]['MetricId']][_0x4411('0x76')]:_0x42c886[_0x38b57a][_0x4411('0x77')];_0x5f5f5c=_0x42c886[_0x38b57a][_0x4411('0x78')]?_['replace'](_0x4eafb4[_0x42c886[_0x38b57a][_0x4411('0x78')]],'%s',_0x5f5f5c):_0x5f5f5c;_0x5f5f5c=_0x42c886[_0x38b57a]['format']?_[_0x4411('0x79')](_0x29fe20[_0x42c886[_0x38b57a][_0x4411('0x7a')]],'%s',_0x5f5f5c):_0x5f5f5c;if(_0x42c886[_0x38b57a][_0x4411('0x7b')]){_0x3caab5['group'](_0x5f5f5c);}_0x42c886[_0x38b57a][_0x4411('0x7c')]&&_0x3caab5[_0x4411('0x3c')](_0x5f5f5c,_0x42c886[_0x38b57a][_0x4411('0x7c')]===_0x4411('0x8d')?![]:!![]);_0x3caab5['field'](_0x5f5f5c,_0x42c886[_0x38b57a][_0x4411('0x7d')]||_0x5f5f5c);}if(_0x1a2fc2['joins']){_0x1a2fc2[_0x4411('0x7e')]=JSON[_0x4411('0x7f')](_0x1a2fc2[_0x4411('0x7e')]);for(var _0x29e1a6=0x0;_0x29e1a6<_0x1a2fc2[_0x4411('0x7e')]['length'];_0x29e1a6+=0x1){if(_0x1a2fc2[_0x4411('0x7e')][_0x29e1a6][_0x4411('0x3f')]&&_['includes'](_0x10fca9,_0x1a2fc2[_0x4411('0x7e')][_0x29e1a6][_0x4411('0x3f')])&&_0x1a2fc2[_0x4411('0x7e')][_0x29e1a6][_0x4411('0x80')]&&_0x1a2fc2['joins'][_0x29e1a6][_0x4411('0x82')]&&_0x1a2fc2['joins'][_0x29e1a6][_0x4411('0x81')]){_0x3caab5[_0x1a2fc2[_0x4411('0x7e')][_0x29e1a6]['type']](_0x1a2fc2[_0x4411('0x7e')][_0x29e1a6]['foreignTable'],null,util[_0x4411('0x7a')]('%s.%s\x20=\x20%s.%s',_0x1a2fc2[_0x4411('0x74')],_0x1a2fc2[_0x4411('0x7e')][_0x29e1a6][_0x4411('0x80')],_0x1a2fc2[_0x4411('0x7e')][_0x29e1a6][_0x4411('0x82')],_0x1a2fc2['joins'][_0x29e1a6][_0x4411('0x81')]));}}}if(_0x1a2fc2[_0x4411('0x84')]){_0x1a2fc2[_0x4411('0x84')]=JSON[_0x4411('0x7f')](_0x1a2fc2[_0x4411('0x84')]);_0x3caab5[_0x4411('0x3e')](_0x25b084(_0x1a2fc2[_0x4411('0x84')][_0x4411('0x69')]));}_0x11bee9=_0x3caab5['clone']();_0x3caab5['limit'](_0x36fb2d);_0x3caab5[_0x4411('0x1f')](0x0);logger[_0x4411('0x8e')](_0x4411('0x85'),_0x3caab5['toString']());return db['sequelize'][_0x4411('0x33')](_0x3caab5['toString'](),{'type':db['sequelize'][_0x4411('0x87')][_0x4411('0x88')]});}})[_0x4411('0x27')](function(_0x481495){if(!_0x481495[_0x4411('0x39')]){throw new db[(_0x4411('0x6d'))][(_0x4411('0x6e'))](_0x4411('0x8f'),0xcc);}if(_0xf81a54[_0x4411('0x90')]===_0x4411('0x91')){return null;}var _0x19a833=_[_0x4411('0x42')](_0xf81a54,{'name':_0xf81a54[_0x4411('0x92')]||_0xf81a54['name']||_0x1a2fc2[_0x4411('0x2c')],'basename':_0x12d848,'savename':util[_0x4411('0x7a')]('%s-%s.%s',_0xf81a54[_0x4411('0x2c')]||_0x1a2fc2['name'],require(_0x4411('0x93'))[_0x4411('0x94')](0x4),_0xf81a54[_0x4411('0x90')]||_0x4411('0x95')),'reportId':_0x1a2fc2['id'],'reportType':_0x4411('0x96')});return db[_0x4411('0x97')]['create'](_0x19a833,{'raw':!![]});})[_0x4411('0x27')](function(_0x509152){if(_0x1a2fc2[_0x4411('0x74')]==='cdr'){_0x11bee9[_0x4411('0x3e')](_0x1a2fc2['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xf81a54[_0x4411('0x98')],_0xf81a54[_0x4411('0x99')]);}else{_0x11bee9[_0x4411('0x3e')](_0x1a2fc2[_0x4411('0x74')]+_0x4411('0x9a'),_0xf81a54['startDate'],_0xf81a54[_0x4411('0x99')]);}if(_0x509152){logger[_0x4411('0x9b')](_0x4411('0x9c'),_0x11bee9[_0x4411('0x86')]());require('child_process')[_0x4411('0x9d')](path[_0x4411('0x57')](__dirname,_0x4411('0x9e'),_0x509152[_0x4411('0x90')]),[_0x509152['id'],_0x11bee9[_0x4411('0x86')](),path[_0x4411('0x57')](__dirname,_0x4411('0x9f'),_0x509152[_0x4411('0xa0')]),_0x12d848]);return _0x509152;}else{var _0x4d1482=squel[_0x4411('0x72')]();_0x4d1482[_0x4411('0x73')]('('+_0x11bee9['toString']()+')',_0x4411('0xa1'));_0x4d1482[_0x4411('0x77')](_0x4411('0xa2'),_0x4411('0x1e'));_0x11bee9[_0x4411('0x20')](_0xf81a54[_0x4411('0x20')]||_0x36fb2d);_0x11bee9['offset'](_0xf81a54[_0x4411('0x1f')]||0x0);return dbH[_0x4411('0xa3')][_0x4411('0x33')](_0x4d1482[_0x4411('0x86')](),{'type':dbH[_0x4411('0xa3')][_0x4411('0x87')]['SELECT']})[_0x4411('0x27')](function(_0x2ae0e9){if(!_0x2ae0e9[_0x4411('0x39')]){_0x586dde=0x0;}else{_0x586dde=_0x2ae0e9[0x0][_0x4411('0x1e')]||0x0;}return dbH[_0x4411('0xa3')]['query'](_0x11bee9[_0x4411('0x86')](),{'type':dbH[_0x4411('0xa3')][_0x4411('0x87')][_0x4411('0x88')]});})[_0x4411('0x27')](function(_0x5e8ff7){return{'rows':_0x5e8ff7||[],'count':_0x586dde};});}});}exports['run']=function(_0x5bcdd2,_0x11c2af){return runReport(_0x5bcdd2[_0x4411('0x47')],_0x5bcdd2['query'],_0x5bcdd2[_0x4411('0x4b')])[_0x4411('0x27')](respondWithResult(_0x11c2af,null))['catch'](handleError(_0x11c2af,null));};exports['runReport']=runReport;exports[_0x4411('0x33')]=function(_0x3eae5d,_0x1a5013){var _0x1c4571=0xa;var _0x3ad318=[_0x4411('0x57'),'left_join',_0x4411('0x59'),'cross_join'];var _0x55525d={'SUM':_0x4411('0x5b'),'COUNT':_0x4411('0x89'),'COUNT DISTINCT':_0x4411('0xa4'),'MAX':_0x4411('0x5c'),'MIN':_0x4411('0x8a'),'AVG':_0x4411('0x5d'),'GROUP_CONCAT':_0x4411('0xa5'),'GROUP_CONCAT ASC':_0x4411('0x5e'),'GROUP_CONCAT DESC':_0x4411('0x5f')};var _0x2bf25f={'SEC_TO_TIME':_0x4411('0x8b'),'DATE':_0x4411('0x60'),'HOUR':_0x4411('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2f63a0=function(_0x239020){return!_[_0x4411('0x62')]([_0x4411('0x63'),_0x4411('0x64'),_0x4411('0x65'),'IS\x20NOT\x20EMPTY'],_0x239020);};var _0x2ad748=function(_0x5eeb34){if(!_0x5eeb34||!_0x5eeb34[_0x4411('0x67')][_0x4411('0x39')]){return'';}for(var _0x45cd32='(',_0x5d4ce1=0x0;_0x5d4ce1<_0x5eeb34[_0x4411('0x67')][_0x4411('0x39')];_0x5d4ce1+=0x1){_0x5d4ce1>0x0&&(_0x45cd32+='\x20'+_0x5eeb34[_0x4411('0x68')]+'\x20');_0x45cd32+=_0x5eeb34['rules'][_0x5d4ce1]['group']?_0x2ad748(_0x5eeb34[_0x4411('0x67')][_0x5d4ce1][_0x4411('0x69')]):_0x5eeb34[_0x4411('0x67')][_0x5d4ce1]['field']+'\x20'+_0x5eeb34[_0x4411('0x67')][_0x5d4ce1]['condition']+(_0x2f63a0(_0x5eeb34['rules'][_0x5d4ce1][_0x4411('0x6a')])?'\x20'+_0x5eeb34['rules'][_0x5d4ce1]['value']:'');}return _0x45cd32+')';};var _0x52c0fb={'where':{'id':_0x3eae5d[_0x4411('0x47')]['id']}},_0x53e88f,_0x3af2f5,_0x4e056e,_0x4c15f0,_0x1c2ccb;_0x52c0fb=_['merge']({},_0x52c0fb,_0x3eae5d[_0x4411('0x4b')]);return db[_0x4411('0x2f')][_0x4411('0x4c')](_0x52c0fb)['then'](function(_0x7eca6a){if(_0x7eca6a){_0x53e88f=_0x7eca6a;return _0x7eca6a[_0x4411('0x6c')]();}return null;})[_0x4411('0x27')](function(_0x219737){if(_0x219737){if(!_0x219737[_0x4411('0x39')]){throw new db[(_0x4411('0x6d'))]['ValidationErrorItem'](_0x4411('0x6f'),0x193);}_0x3af2f5=_0x219737;return db[_0x4411('0x70')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1840fb){if(_0x1840fb){_0x4e056e=_[_0x4411('0x71')](_0x1840fb,'id');var _0x4942e6;var _0x9f410e=squel[_0x4411('0x72')]();_0x9f410e[_0x4411('0x73')](_0x53e88f[_0x4411('0x74')]);for(var _0x4fdbd7=0x0;_0x4fdbd7<_0x3af2f5[_0x4411('0x39')];_0x4fdbd7+=0x1){_0x4942e6=_0x3af2f5[_0x4fdbd7][_0x4411('0x75')]?_0x4e056e[_0x3af2f5[_0x4fdbd7][_0x4411('0x75')]][_0x4411('0x76')]:_0x3af2f5[_0x4fdbd7][_0x4411('0x77')];_0x4942e6=_0x3af2f5[_0x4fdbd7][_0x4411('0x78')]?_['replace'](_0x55525d[_0x3af2f5[_0x4fdbd7][_0x4411('0x78')]],'%s',_0x4942e6):_0x4942e6;_0x4942e6=_0x3af2f5[_0x4fdbd7][_0x4411('0x7a')]?_['replace'](_0x2bf25f[_0x3af2f5[_0x4fdbd7][_0x4411('0x7a')]],'%s',_0x4942e6):_0x4942e6;if(_0x3af2f5[_0x4fdbd7]['groupBy']){_0x9f410e['group'](_0x4942e6);}_0x3af2f5[_0x4fdbd7][_0x4411('0x7c')]&&_0x9f410e[_0x4411('0x3c')](_0x4942e6,_0x3af2f5[_0x4fdbd7]['orderBy']===_0x4411('0x8d')?![]:!![]);_0x9f410e['field'](_0x4942e6,_0x3af2f5[_0x4fdbd7]['alias']||_0x4942e6);}if(_0x53e88f[_0x4411('0x7e')]){_0x53e88f[_0x4411('0x7e')]=JSON['parse'](_0x53e88f[_0x4411('0x7e')]);for(var _0x50b081=0x0;_0x50b081<_0x53e88f['joins'][_0x4411('0x39')];_0x50b081+=0x1){if(_0x53e88f[_0x4411('0x7e')][_0x50b081][_0x4411('0x3f')]&&_[_0x4411('0x62')](_0x3ad318,_0x53e88f['joins'][_0x50b081][_0x4411('0x3f')])&&_0x53e88f['joins'][_0x50b081][_0x4411('0x80')]&&_0x53e88f[_0x4411('0x7e')][_0x50b081][_0x4411('0x82')]&&_0x53e88f[_0x4411('0x7e')][_0x50b081][_0x4411('0x81')]){_0x9f410e[_0x53e88f['joins'][_0x50b081][_0x4411('0x3f')]](_0x53e88f[_0x4411('0x7e')][_0x50b081][_0x4411('0x82')],null,util['format'](_0x4411('0x83'),_0x53e88f['table'],_0x53e88f[_0x4411('0x7e')][_0x50b081][_0x4411('0x80')],_0x53e88f['joins'][_0x50b081]['foreignTable'],_0x53e88f['joins'][_0x50b081][_0x4411('0x81')]));}}}if(_0x53e88f['conditions']){_0x53e88f[_0x4411('0x84')]=JSON[_0x4411('0x7f')](_0x53e88f[_0x4411('0x84')]);_0x9f410e[_0x4411('0x3e')](_0x2ad748(_0x53e88f[_0x4411('0x84')]['group']));}_0x1c2ccb=_0x9f410e[_0x4411('0xa6')]();_0x9f410e[_0x4411('0x20')](_0x1c4571);_0x9f410e[_0x4411('0x1f')](0x0);logger[_0x4411('0x8e')](_0x4411('0x85'),_0x9f410e[_0x4411('0x86')]());return db['sequelize'][_0x4411('0x33')](_0x9f410e['toString'](),{'type':db['sequelize'][_0x4411('0x87')][_0x4411('0x88')]});}})[_0x4411('0x27')](function(){return{'sql':_0x1c2ccb[_0x4411('0x86')]()};})[_0x4411('0x27')](respondWithResult(_0x1a5013,null))[_0x4411('0x45')](handleError(_0x1a5013,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index f7c0806..d1006a7 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 _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
+var _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util'];(function(_0x437660,_0x1c47ca){var _0x5771ef=function(_0x1a005a){while(--_0x1a005a){_0x437660['push'](_0x437660['shift']());}};_0x5771ef(++_0x1c47ca);}(_0x5fab,0x177));var _0xb5fa=function(_0xf58288,_0x35333c){_0xf58288=_0xf58288-0x0;var _0x196e87=_0x5fab[_0xf58288];return _0x196e87;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'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 9ccd5e7..47eb566 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 _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
+var _0x8cc8=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x47fe90,_0x18792d){var _0x20572b=function(_0x56d2e2){while(--_0x56d2e2){_0x47fe90['push'](_0x47fe90['shift']());}};_0x20572b(++_0x18792d);}(_0x8cc8,0x177));var _0x88cc=function(_0x4b154c,_0x3874bc){_0x4b154c=_0x4b154c-0x0;var _0x5c0e8e=_0x8cc8[_0x4b154c];return _0x5c0e8e;};'use strict';var _=require(_0x88cc('0x0'));var util=require(_0x88cc('0x1'));var moment=require(_0x88cc('0x2'));var BPromise=require(_0x88cc('0x3'));var rs=require(_0x88cc('0x4'));var fs=require('fs');var Redis=require(_0x88cc('0x5'));var db=require(_0x88cc('0x6'))['db'];var utils=require(_0x88cc('0x7'));var logger=require(_0x88cc('0x8'))(_0x88cc('0x9'));var config=require(_0x88cc('0xa'));var jayson=require(_0x88cc('0xb'));var client=jayson[_0x88cc('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58bdd5,_0x3d35ed,_0x2db13a){return new BPromise(function(_0x219585,_0x4471b0){return client['request'](_0x58bdd5,_0x2db13a)[_0x88cc('0xd')](function(_0x2e77ae){logger['info'](_0x88cc('0xe'),_0x3d35ed,'request\x20sent');logger[_0x88cc('0xf')](_0x88cc('0x10'),_0x3d35ed,_0x88cc('0x11'),JSON[_0x88cc('0x12')](_0x2e77ae));if(_0x2e77ae['error']){if(_0x2e77ae[_0x88cc('0x13')][_0x88cc('0x14')]===0x1f4){logger[_0x88cc('0x13')](_0x88cc('0xe'),_0x3d35ed,_0x2e77ae[_0x88cc('0x13')][_0x88cc('0x15')]);return _0x4471b0(_0x2e77ae[_0x88cc('0x13')][_0x88cc('0x15')]);}logger['error'](_0x88cc('0xe'),_0x3d35ed,_0x2e77ae[_0x88cc('0x13')][_0x88cc('0x15')]);return _0x219585(_0x2e77ae[_0x88cc('0x13')][_0x88cc('0x15')]);}else{logger[_0x88cc('0x16')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3d35ed,_0x88cc('0x11'));_0x219585(_0x2e77ae[_0x88cc('0x17')][_0x88cc('0x15')]);}})[_0x88cc('0x18')](function(_0x13ff73){logger['error'](_0x88cc('0xe'),_0x3d35ed,_0x13ff73);_0x4471b0(_0x13ff73);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 15793e2..75ed757 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 _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
+var _0x9256=['isAuthenticated','index','show','/:id/preview','preview','/:id/run','/:id/query','post','create','put','/:id','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get'];(function(_0x37f85a,_0x240e20){var _0x190eeb=function(_0x2ae374){while(--_0x2ae374){_0x37f85a['push'](_0x37f85a['shift']());}};_0x190eeb(++_0x240e20);}(_0x9256,0x120));var _0x6925=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9256[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x6925('0x0'));var util=require(_0x6925('0x1'));var path=require(_0x6925('0x2'));var timeout=require(_0x6925('0x3'));var express=require(_0x6925('0x4'));var router=express[_0x6925('0x5')]();var auth=require(_0x6925('0x6'));var interaction=require(_0x6925('0x7'));var config=require(_0x6925('0x8'));var controller=require(_0x6925('0x9'));router[_0x6925('0xa')]('/',auth[_0x6925('0xb')](),controller[_0x6925('0xc')]);router[_0x6925('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x6925('0xd')]);router[_0x6925('0xa')](_0x6925('0xe'),auth['isAuthenticated'](),controller[_0x6925('0xf')]);router['get'](_0x6925('0x10'),auth[_0x6925('0xb')](),controller['run']);router[_0x6925('0xa')](_0x6925('0x11'),auth[_0x6925('0xb')](),controller['query']);router[_0x6925('0x12')]('/',auth[_0x6925('0xb')](),controller[_0x6925('0x13')]);router[_0x6925('0x14')](_0x6925('0x15'),auth[_0x6925('0xb')](),controller[_0x6925('0x16')]);router['delete'](_0x6925('0x15'),auth[_0x6925('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index c8849cf..a7f0798 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 _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
+var _0xeed5=['DATE','Loading','scheduled','manual','INTEGER','UNSIGNED','moment','STRING','pdf','xlsx'];(function(_0x32a9a2,_0x1a31c5){var _0x598836=function(_0x16c158){while(--_0x16c158){_0x32a9a2['push'](_0x32a9a2['shift']());}};_0x598836(++_0x1a31c5);}(_0xeed5,0xe2));var _0x5eed=function(_0x40192b,_0x43bf7e){_0x40192b=_0x40192b-0x0;var _0x4c9e4f=_0xeed5[_0x40192b];return _0x4c9e4f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5eed('0x0'));module['exports']={'name':{'type':Sequelize[_0x5eed('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0x5eed('0x2'),_0x5eed('0x3')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x5eed('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5eed('0x4')]},'endDate':{'type':Sequelize[_0x5eed('0x4')]},'status':{'type':Sequelize[_0x5eed('0x1')],'defaultValue':_0x5eed('0x5')},'type':{'type':Sequelize['ENUM']('manual',_0x5eed('0x6')),'allowNull':![],'defaultValue':_0x5eed('0x7')},'reportId':{'type':Sequelize[_0x5eed('0x8')](0xb)[_0x5eed('0x9')]},'reportType':{'type':Sequelize[_0x5eed('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index ed9711c..cb2010d 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 _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
+var _0xfbeb=['intersection','fields','nolimit','order','sort','where','pick','filter','merge','type','count','includeAll','findAll','rows','catch','length','include','options','find','create','body','user','UserProfileSection','userProfileId','error','params','download','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','toLowerCase','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','model','map','query','keys','filters','attributes'];(function(_0x4b68eb,_0x354dcb){var _0x5e0c4a=function(_0x2c0a81){while(--_0x2c0a81){_0x4b68eb['push'](_0x4b68eb['shift']());}};_0x5e0c4a(++_0x354dcb);}(_0xfbeb,0x18f));var _0xbfbe=function(_0x5eb442,_0xe2ae2e){_0x5eb442=_0x5eb442-0x0;var _0x53aad0=_0xfbeb[_0x5eb442];return _0x53aad0;};'use strict';var pdf=require(_0xbfbe('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbfbe('0x1'));var zipdir=require(_0xbfbe('0x2'));var jsonpatch=require(_0xbfbe('0x3'));var rp=require(_0xbfbe('0x4'));var moment=require(_0xbfbe('0x5'));var BPromise=require(_0xbfbe('0x6'));var Mustache=require(_0xbfbe('0x7'));var util=require(_0xbfbe('0x8'));var path=require('path');var sox=require(_0xbfbe('0x9'));var csv=require('to-csv');var ejs=require(_0xbfbe('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbfbe('0xb'));var crypto=require(_0xbfbe('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbfbe('0xd'));var toCsv=require(_0xbfbe('0xe'));var querystring=require(_0xbfbe('0xf'));var Papa=require('papaparse');var Redis=require(_0xbfbe('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbfbe('0x11'));var logger=require(_0xbfbe('0x12'))(_0xbfbe('0x13'));var utils=require(_0xbfbe('0x14'));var config=require(_0xbfbe('0x15'));var db=require(_0xbfbe('0x16'))['db'];function respondWithStatusCode(_0x22eeaf,_0x2bef8c){_0x2bef8c=_0x2bef8c||0xcc;return function(_0xab6850){if(_0xab6850){return _0x22eeaf[_0xbfbe('0x17')](_0x2bef8c);}return _0x22eeaf[_0xbfbe('0x18')](_0x2bef8c)[_0xbfbe('0x19')]();};}function respondWithResult(_0x27d39a,_0x487303){_0x487303=_0x487303||0xc8;return function(_0x5b1b89){if(_0x5b1b89){return _0x27d39a['status'](_0x487303)['json'](_0x5b1b89);}};}function respondWithFilteredResult(_0x5dabed,_0x511a78){return function(_0x5f1723){if(_0x5f1723){var _0x56b16d=_0x5f1723['count'],_0xfb2234=_0x511a78['offset'],_0x217a43=_0x511a78[_0xbfbe('0x1a')]+_0x511a78[_0xbfbe('0x1b')],_0x14244f;if(_0x217a43>=_0x56b16d){_0x217a43=_0x56b16d;_0x14244f=0xc8;}else{_0x14244f=0xce;}_0x5dabed[_0xbfbe('0x18')](_0x14244f);return _0x5dabed['set'](_0xbfbe('0x1c'),_0xfb2234+'-'+_0x217a43+'/'+_0x56b16d)['json'](_0x5f1723);}return null;};}function patchUpdates(_0x10a5c7){return function(_0xff6723){try{jsonpatch[_0xbfbe('0x1d')](_0xff6723,_0x10a5c7,!![]);}catch(_0x344f49){return BPromise[_0xbfbe('0x1e')](_0x344f49);}return _0xff6723[_0xbfbe('0x1f')]();};}function saveUpdates(_0x7eb34b,_0x426bdf){return function(_0x1a4e4b){if(_0x1a4e4b){return _0x1a4e4b[_0xbfbe('0x20')](_0x7eb34b)[_0xbfbe('0x21')](function(_0x296874){return _0x296874;});}return null;};}function removeEntity(_0x1dd0a3,_0x33e352){return function(_0xaac30c){if(_0xaac30c){return _0xaac30c[_0xbfbe('0x22')]()['then'](function(){var _0x3a22b9=_0xaac30c[_0xbfbe('0x23')]({'plain':!![]});var _0x581910=_0xbfbe('0x24');return db[_0xbfbe('0x25')][_0xbfbe('0x22')]({'where':{'type':_0x581910,'resourceId':_0x3a22b9['id']}})[_0xbfbe('0x21')](function(){return _0xaac30c;});})[_0xbfbe('0x21')](function(){_0x1dd0a3[_0xbfbe('0x18')](0xcc)[_0xbfbe('0x19')]();});}};}function handleEntityNotFound(_0x4b9444,_0x213b12){return function(_0x57d57e){if(!_0x57d57e){_0x4b9444[_0xbfbe('0x17')](0x194);}return _0x57d57e;};}function handleError(_0xc470a1,_0x19311d){_0x19311d=_0x19311d||0x1f4;return function(_0x2aebe){logger['error'](_0x2aebe[_0xbfbe('0x26')]);if(_0x2aebe['name']){delete _0x2aebe[_0xbfbe('0x27')];}_0xc470a1[_0xbfbe('0x18')](_0x19311d)[_0xbfbe('0x28')](_0x2aebe);};}exports[_0xbfbe('0x29')]=function(_0x2dfa21,_0x34bd16){var _0x14afc6={},_0x1788bd={},_0x4dc14e={'count':0x0,'rows':[]};var _0x5ee1ef=_['map'](db[_0xbfbe('0x2a')][_0xbfbe('0x2b')],function(_0x1d47fd){return{'name':_0x1d47fd[_0xbfbe('0x2c')],'type':_0x1d47fd['type']['key']};});_0x1788bd[_0xbfbe('0x2d')]=_[_0xbfbe('0x2e')](_0x5ee1ef,_0xbfbe('0x27'));_0x1788bd[_0xbfbe('0x2f')]=_[_0xbfbe('0x30')](_0x2dfa21['query']);_0x1788bd[_0xbfbe('0x31')]=_['intersection'](_0x1788bd[_0xbfbe('0x2d')],_0x1788bd[_0xbfbe('0x2f')]);_0x14afc6[_0xbfbe('0x32')]=_[_0xbfbe('0x33')](_0x1788bd[_0xbfbe('0x2d')],qs[_0xbfbe('0x34')](_0x2dfa21['query'][_0xbfbe('0x34')]));_0x14afc6['attributes']=_0x14afc6['attributes']['length']?_0x14afc6[_0xbfbe('0x32')]:_0x1788bd[_0xbfbe('0x2d')];if(!_0x2dfa21[_0xbfbe('0x2f')]['hasOwnProperty'](_0xbfbe('0x35'))){_0x14afc6[_0xbfbe('0x1b')]=qs['limit'](_0x2dfa21[_0xbfbe('0x2f')][_0xbfbe('0x1b')]);_0x14afc6[_0xbfbe('0x1a')]=qs[_0xbfbe('0x1a')](_0x2dfa21['query']['offset']);}_0x14afc6[_0xbfbe('0x36')]=qs[_0xbfbe('0x37')](_0x2dfa21[_0xbfbe('0x2f')][_0xbfbe('0x37')]);_0x14afc6[_0xbfbe('0x38')]=qs['filters'](_[_0xbfbe('0x39')](_0x2dfa21[_0xbfbe('0x2f')],_0x1788bd[_0xbfbe('0x31')]),_0x5ee1ef);if(_0x2dfa21[_0xbfbe('0x2f')][_0xbfbe('0x3a')]){_0x14afc6[_0xbfbe('0x38')]=_[_0xbfbe('0x3b')](_0x14afc6[_0xbfbe('0x38')],{'$or':_[_0xbfbe('0x2e')](_0x5ee1ef,function(_0x26d58d){if(_0x26d58d[_0xbfbe('0x3c')]!=='VIRTUAL'){var _0x5d6cff={};_0x5d6cff[_0x26d58d[_0xbfbe('0x27')]]={'$like':'%'+_0x2dfa21[_0xbfbe('0x2f')][_0xbfbe('0x3a')]+'%'};return _0x5d6cff;}})});}_0x14afc6=_[_0xbfbe('0x3b')]({},_0x14afc6,_0x2dfa21['options']);var _0xc4d112={'where':_0x14afc6[_0xbfbe('0x38')]};return db['AnalyticExtractedReport'][_0xbfbe('0x3d')](_0xc4d112)[_0xbfbe('0x21')](function(_0x23757c){_0x4dc14e[_0xbfbe('0x3d')]=_0x23757c;if(_0x2dfa21[_0xbfbe('0x2f')][_0xbfbe('0x3e')]){_0x14afc6['include']=[{'all':!![]}];}return db[_0xbfbe('0x2a')][_0xbfbe('0x3f')](_0x14afc6);})[_0xbfbe('0x21')](function(_0x2224f4){_0x4dc14e[_0xbfbe('0x40')]=_0x2224f4;return _0x4dc14e;})[_0xbfbe('0x21')](respondWithFilteredResult(_0x34bd16,_0x14afc6))[_0xbfbe('0x41')](handleError(_0x34bd16,null));};exports['show']=function(_0x311c42,_0x1e2897){var _0x298ce0={'raw':!![],'where':{'id':_0x311c42['params']['id']}},_0x392c3b={};_0x392c3b[_0xbfbe('0x2d')]=_[_0xbfbe('0x30')](db['AnalyticExtractedReport'][_0xbfbe('0x2b')]);_0x392c3b[_0xbfbe('0x2f')]=_[_0xbfbe('0x30')](_0x311c42[_0xbfbe('0x2f')]);_0x392c3b[_0xbfbe('0x31')]=_['intersection'](_0x392c3b[_0xbfbe('0x2d')],_0x392c3b['query']);_0x298ce0[_0xbfbe('0x32')]=_[_0xbfbe('0x33')](_0x392c3b['model'],qs[_0xbfbe('0x34')](_0x311c42[_0xbfbe('0x2f')][_0xbfbe('0x34')]));_0x298ce0[_0xbfbe('0x32')]=_0x298ce0[_0xbfbe('0x32')][_0xbfbe('0x42')]?_0x298ce0[_0xbfbe('0x32')]:_0x392c3b[_0xbfbe('0x2d')];if(_0x311c42['query'][_0xbfbe('0x3e')]){_0x298ce0[_0xbfbe('0x43')]=[{'all':!![]}];}_0x298ce0=_['merge']({},_0x298ce0,_0x311c42[_0xbfbe('0x44')]);return db[_0xbfbe('0x2a')][_0xbfbe('0x45')](_0x298ce0)[_0xbfbe('0x21')](handleEntityNotFound(_0x1e2897,null))[_0xbfbe('0x21')](respondWithResult(_0x1e2897,null))[_0xbfbe('0x41')](handleError(_0x1e2897,null));};exports[_0xbfbe('0x46')]=function(_0xdc60e9,_0x2625e7){return db[_0xbfbe('0x2a')][_0xbfbe('0x46')](_0xdc60e9[_0xbfbe('0x47')],{})[_0xbfbe('0x21')](function(_0x1de0a8){var _0x50ff90=_0xdc60e9[_0xbfbe('0x48')][_0xbfbe('0x23')]({'plain':!![]});if(!_0x50ff90)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x50ff90['role']===_0xbfbe('0x48')){var _0x45fd13=_0x1de0a8[_0xbfbe('0x23')]({'plain':!![]});var _0x3c8689=_0xbfbe('0x24');return db[_0xbfbe('0x49')]['find']({'where':{'name':_0x3c8689,'userProfileId':_0x50ff90[_0xbfbe('0x4a')]},'raw':!![]})[_0xbfbe('0x21')](function(_0x700b83){if(_0x700b83&&_0x700b83['autoAssociation']===0x0){return db[_0xbfbe('0x25')][_0xbfbe('0x46')]({'name':_0x45fd13[_0xbfbe('0x27')],'resourceId':_0x45fd13['id'],'type':_0x700b83['name'],'sectionId':_0x700b83['id']},{})[_0xbfbe('0x21')](function(){return _0x1de0a8;});}else{return _0x1de0a8;}})[_0xbfbe('0x41')](function(_0x2f4152){logger[_0xbfbe('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f4152);throw _0x2f4152;});}return _0x1de0a8;})[_0xbfbe('0x21')](respondWithResult(_0x2625e7,0xc9))[_0xbfbe('0x41')](handleError(_0x2625e7,null));};exports[_0xbfbe('0x20')]=function(_0x13057d,_0x57b70c){if(_0x13057d[_0xbfbe('0x47')]['id']){delete _0x13057d[_0xbfbe('0x47')]['id'];}return db[_0xbfbe('0x2a')][_0xbfbe('0x45')]({'where':{'id':_0x13057d['params']['id']}})[_0xbfbe('0x21')](handleEntityNotFound(_0x57b70c,null))[_0xbfbe('0x21')](saveUpdates(_0x13057d[_0xbfbe('0x47')],null))[_0xbfbe('0x21')](respondWithResult(_0x57b70c,null))['catch'](handleError(_0x57b70c,null));};exports[_0xbfbe('0x22')]=function(_0x4cf388,_0x52efd0){return db[_0xbfbe('0x2a')][_0xbfbe('0x45')]({'where':{'id':_0x4cf388[_0xbfbe('0x4c')]['id']}})[_0xbfbe('0x21')](handleEntityNotFound(_0x52efd0,null))['then'](removeEntity(_0x52efd0,null))[_0xbfbe('0x41')](handleError(_0x52efd0,null));};exports[_0xbfbe('0x4d')]=function(_0x174f4d,_0x467e93,_0x30b0e9){return db[_0xbfbe('0x2a')][_0xbfbe('0x45')]({'where':{'id':_0x174f4d[_0xbfbe('0x4c')]['id']},'attributes':[_0xbfbe('0x27'),_0xbfbe('0x4e'),_0xbfbe('0x4f'),_0xbfbe('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x467e93,null))[_0xbfbe('0x21')](function(_0x432ff5){if(_0x432ff5){if(!fs[_0xbfbe('0x51')](path[_0xbfbe('0x52')](config['root'],_0xbfbe('0x53'),_0x432ff5['savename']))){throw new db[(_0xbfbe('0x54'))][(_0xbfbe('0x55'))](_0xbfbe('0x56'));}if(_0x174f4d[_0xbfbe('0x2f')][_0xbfbe('0x57')]){return _0x467e93[_0xbfbe('0x17')](0xc8);}return _0x467e93[_0xbfbe('0x4d')](path[_0xbfbe('0x52')](config['root'],_0xbfbe('0x53'),_0x432ff5['savename']),util[_0xbfbe('0x58')]('%s.%s',_0x432ff5['basename']||_0x432ff5['name'],_0x432ff5[_0xbfbe('0x50')][_0xbfbe('0x59')]()));}})[_0xbfbe('0x41')](handleError(_0x467e93,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index b4a6bf5..b4fe41a 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 _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
+var _0x032d=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','lodash'];(function(_0x2e913b,_0x4b7071){var _0x173899=function(_0x2a7d22){while(--_0x2a7d22){_0x2e913b['push'](_0x2e913b['shift']());}};_0x173899(++_0x4b7071);}(_0x032d,0x137));var _0xd032=function(_0x34ffea,_0x1a6761){_0x34ffea=_0x34ffea-0x0;var _0x48b48d=_0x032d[_0x34ffea];return _0x48b48d;};'use strict';var _=require(_0xd032('0x0'));var util=require(_0xd032('0x1'));var logger=require(_0xd032('0x2'))(_0xd032('0x3'));var moment=require(_0xd032('0x4'));var BPromise=require(_0xd032('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd032('0x6'));var rimraf=require(_0xd032('0x7'));var config=require(_0xd032('0x8'));var attributes=require(_0xd032('0x9'));module[_0xd032('0xa')]=function(_0x1b7e5e,_0xaaaa6){return _0x1b7e5e['define'](_0xd032('0xb'),attributes,{'tableName':'analytics_extracted_reports','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 ffa5649..b17c291 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 _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
+var _0xbaf7=['../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','message','error','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x454629,_0x486c3f){var _0xb6121c=function(_0x14db28){while(--_0x14db28){_0x454629['push'](_0x454629['shift']());}};_0xb6121c(++_0x486c3f);}(_0xbaf7,0x142));var _0x7baf=function(_0x5f5cbb,_0xbd6e7){_0x5f5cbb=_0x5f5cbb-0x0;var _0x2b0c2f=_0xbaf7[_0x5f5cbb];return _0x2b0c2f;};'use strict';var _=require(_0x7baf('0x0'));var util=require(_0x7baf('0x1'));var moment=require(_0x7baf('0x2'));var BPromise=require('bluebird');var rs=require(_0x7baf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7baf('0x4'))['db'];var utils=require(_0x7baf('0x5'));var logger=require(_0x7baf('0x6'))(_0x7baf('0x7'));var config=require(_0x7baf('0x8'));var jayson=require(_0x7baf('0x9'));var client=jayson[_0x7baf('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31bc70,_0x14c3c5,_0x13f367){return new BPromise(function(_0x495013,_0xaa39ef){return client[_0x7baf('0xb')](_0x31bc70,_0x13f367)[_0x7baf('0xc')](function(_0x3bbb18){logger[_0x7baf('0xd')](_0x7baf('0xe'),_0x14c3c5,_0x7baf('0xf'));logger[_0x7baf('0x10')](_0x7baf('0x11'),_0x14c3c5,_0x7baf('0xf'),JSON[_0x7baf('0x12')](_0x3bbb18));if(_0x3bbb18['error']){if(_0x3bbb18['error']['code']===0x1f4){logger['error'](_0x7baf('0xe'),_0x14c3c5,_0x3bbb18['error'][_0x7baf('0x13')]);return _0xaa39ef(_0x3bbb18['error'][_0x7baf('0x13')]);}logger[_0x7baf('0x14')](_0x7baf('0xe'),_0x14c3c5,_0x3bbb18[_0x7baf('0x14')][_0x7baf('0x13')]);return _0x495013(_0x3bbb18['error']['message']);}else{logger[_0x7baf('0xd')](_0x7baf('0xe'),_0x14c3c5,_0x7baf('0xf'));_0x495013(_0x3bbb18['result'][_0x7baf('0x13')]);}})[_0x7baf('0x15')](function(_0x382a20){logger[_0x7baf('0x14')](_0x7baf('0xe'),_0x14c3c5,_0x382a20);_0xaa39ef(_0x382a20);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 2485dea..5f2e21b 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 _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
+var _0x3173=['show','download','post','create','put','update','destroy','exports','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated'];(function(_0x3bdbda,_0x2d813c){var _0x14abc5=function(_0xfcd5e4){while(--_0xfcd5e4){_0x3bdbda['push'](_0x3bdbda['shift']());}};_0x14abc5(++_0x2d813c);}(_0x3173,0x13a));var _0x3317=function(_0x1ff0a2,_0x4e4ab7){_0x1ff0a2=_0x1ff0a2-0x0;var _0x5129ca=_0x3173[_0x1ff0a2];return _0x5129ca;};'use strict';var multer=require(_0x3317('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3317('0x1'));var router=express['Router']();var auth=require(_0x3317('0x2'));var interaction=require(_0x3317('0x3'));var config=require(_0x3317('0x4'));var controller=require(_0x3317('0x5'));router[_0x3317('0x6')]('/',auth['isAuthenticated'](),controller[_0x3317('0x7')]);router[_0x3317('0x6')](_0x3317('0x8'),auth[_0x3317('0x9')](),controller[_0x3317('0xa')]);router[_0x3317('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x3317('0xb')]);router[_0x3317('0xc')]('/',auth[_0x3317('0x9')](),controller[_0x3317('0xd')]);router[_0x3317('0xe')]('/:id',auth[_0x3317('0x9')](),controller[_0x3317('0xf')]);router['delete'](_0x3317('0x8'),auth[_0x3317('0x9')](),controller[_0x3317('0x10')]);module[_0x3317('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 409365e..28c6f6c 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 _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
+var _0x814b=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x3881bf,_0x1b016){var _0x539015=function(_0x5a5aea){while(--_0x5a5aea){_0x3881bf['push'](_0x3881bf['shift']());}};_0x539015(++_0x1b016);}(_0x814b,0x1a2));var _0xb814=function(_0x2468b5,_0x506b9e){_0x2468b5=_0x2468b5-0x0;var _0x1056e4=_0x814b[_0x2468b5];return _0x1056e4;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'field':{'type':Sequelize[_0xb814('0x2')]},'alias':{'type':Sequelize[_0xb814('0x3')]},'function':{'type':Sequelize[_0xb814('0x3')]},'format':{'type':Sequelize[_0xb814('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb814('0x3')]},'custom':{'type':Sequelize[_0xb814('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 19266f3..309df7c 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 _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
+var _0xbeff=['end','json','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','options','AnalyticFieldReport','includeAll','show','params','length','include','find','create','body','catch','bulkCreate','destroy','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','html-pdf','eml-format','rimraf','zip-dir','request-promise','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/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x303c30,_0x16edcb){var _0x43161b=function(_0x3330ff){while(--_0x3330ff){_0x303c30['push'](_0x303c30['shift']());}};_0x43161b(++_0x16edcb);}(_0xbeff,0x13e));var _0xfbef=function(_0x3fe651,_0x416b77){_0x3fe651=_0x3fe651-0x0;var _0x545d94=_0xbeff[_0x3fe651];return _0x545d94;};'use strict';var pdf=require(_0xfbef('0x0'));var emlformat=require(_0xfbef('0x1'));var rimraf=require(_0xfbef('0x2'));var zipdir=require(_0xfbef('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfbef('0x4'));var moment=require(_0xfbef('0x5'));var BPromise=require(_0xfbef('0x6'));var Mustache=require(_0xfbef('0x7'));var util=require(_0xfbef('0x8'));var path=require(_0xfbef('0x9'));var sox=require(_0xfbef('0xa'));var csv=require(_0xfbef('0xb'));var ejs=require(_0xfbef('0xc'));var fs=require('fs');var _=require(_0xfbef('0xd'));var squel=require(_0xfbef('0xe'));var crypto=require(_0xfbef('0xf'));var jsforce=require(_0xfbef('0x10'));var deskjs=require(_0xfbef('0x11'));var toCsv=require('to-csv');var querystring=require(_0xfbef('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfbef('0x13'));var qs=require(_0xfbef('0x14'));var as=require(_0xfbef('0x15'));var hardwareService=require(_0xfbef('0x16'));var logger=require(_0xfbef('0x17'))(_0xfbef('0x18'));var utils=require(_0xfbef('0x19'));var config=require(_0xfbef('0x1a'));var db=require(_0xfbef('0x1b'))['db'];function respondWithStatusCode(_0x4d9dd4,_0x28df2d){_0x28df2d=_0x28df2d||0xcc;return function(_0x13f4e2){if(_0x13f4e2){return _0x4d9dd4[_0xfbef('0x1c')](_0x28df2d);}return _0x4d9dd4[_0xfbef('0x1d')](_0x28df2d)[_0xfbef('0x1e')]();};}function respondWithResult(_0x50fee5,_0x200f5e){_0x200f5e=_0x200f5e||0xc8;return function(_0x44d2a7){if(_0x44d2a7){return _0x50fee5[_0xfbef('0x1d')](_0x200f5e)[_0xfbef('0x1f')](_0x44d2a7);}};}function respondWithFilteredResult(_0x3f3963,_0x1f4b3f){return function(_0x4549b2){if(_0x4549b2){var _0xb7f745=_0x4549b2[_0xfbef('0x20')],_0xb1c31a=_0x1f4b3f[_0xfbef('0x21')],_0xc2616d=_0x1f4b3f['offset']+_0x1f4b3f['limit'],_0x40e77d;if(_0xc2616d>=_0xb7f745){_0xc2616d=_0xb7f745;_0x40e77d=0xc8;}else{_0x40e77d=0xce;}_0x3f3963[_0xfbef('0x1d')](_0x40e77d);return _0x3f3963[_0xfbef('0x22')](_0xfbef('0x23'),_0xb1c31a+'-'+_0xc2616d+'/'+_0xb7f745)[_0xfbef('0x1f')](_0x4549b2);}return null;};}function patchUpdates(_0x39a345){return function(_0x371af4){try{jsonpatch[_0xfbef('0x24')](_0x371af4,_0x39a345,!![]);}catch(_0x26b8c0){return BPromise[_0xfbef('0x25')](_0x26b8c0);}return _0x371af4[_0xfbef('0x26')]();};}function saveUpdates(_0x471df0,_0x5369f1){return function(_0x475599){if(_0x475599){return _0x475599[_0xfbef('0x27')](_0x471df0)[_0xfbef('0x28')](function(_0x1f6750){return _0x1f6750;});}return null;};}function removeEntity(_0x428ad8,_0x2cfc47){return function(_0x461941){if(_0x461941){return _0x461941['destroy']()['then'](function(){_0x428ad8[_0xfbef('0x1d')](0xcc)[_0xfbef('0x1e')]();});}};}function handleEntityNotFound(_0x242c2e,_0x344626){return function(_0xb99935){if(!_0xb99935){_0x242c2e[_0xfbef('0x1c')](0x194);}return _0xb99935;};}function handleError(_0x19cddb,_0x3fac85){_0x3fac85=_0x3fac85||0x1f4;return function(_0x486773){logger[_0xfbef('0x29')](_0x486773[_0xfbef('0x2a')]);if(_0x486773[_0xfbef('0x2b')]){delete _0x486773['name'];}_0x19cddb['status'](_0x3fac85)[_0xfbef('0x2c')](_0x486773);};}exports[_0xfbef('0x2d')]=function(_0x3b5646,_0x1573fa){var _0x492b51={},_0x341ee2={},_0x407184={'count':0x0,'rows':[]};var _0x56ae04=_[_0xfbef('0x2e')](db['AnalyticFieldReport'][_0xfbef('0x2f')],function(_0x180d3f){return{'name':_0x180d3f[_0xfbef('0x30')],'type':_0x180d3f['type'][_0xfbef('0x31')]};});_0x341ee2[_0xfbef('0x32')]=_[_0xfbef('0x2e')](_0x56ae04,_0xfbef('0x2b'));_0x341ee2[_0xfbef('0x33')]=_[_0xfbef('0x34')](_0x3b5646[_0xfbef('0x33')]);_0x341ee2[_0xfbef('0x35')]=_[_0xfbef('0x36')](_0x341ee2['model'],_0x341ee2[_0xfbef('0x33')]);_0x492b51[_0xfbef('0x37')]=_[_0xfbef('0x36')](_0x341ee2['model'],qs[_0xfbef('0x38')](_0x3b5646['query'][_0xfbef('0x38')]));_0x492b51[_0xfbef('0x37')]=_0x492b51['attributes']['length']?_0x492b51[_0xfbef('0x37')]:_0x341ee2['model'];if(!_0x3b5646[_0xfbef('0x33')][_0xfbef('0x39')](_0xfbef('0x3a'))){_0x492b51[_0xfbef('0x3b')]=qs['limit'](_0x3b5646['query']['limit']);_0x492b51[_0xfbef('0x21')]=qs[_0xfbef('0x21')](_0x3b5646['query'][_0xfbef('0x21')]);}_0x492b51[_0xfbef('0x3c')]=qs[_0xfbef('0x3d')](_0x3b5646['query']['sort']);_0x492b51['where']=qs[_0xfbef('0x35')](_[_0xfbef('0x3e')](_0x3b5646[_0xfbef('0x33')],_0x341ee2['filters']),_0x56ae04);if(_0x3b5646[_0xfbef('0x33')][_0xfbef('0x3f')]){_0x492b51[_0xfbef('0x40')]=_[_0xfbef('0x41')](_0x492b51[_0xfbef('0x40')],{'$or':_[_0xfbef('0x2e')](_0x56ae04,function(_0x34e246){if(_0x34e246['type']!=='VIRTUAL'){var _0x128c35={};_0x128c35[_0x34e246[_0xfbef('0x2b')]]={'$like':'%'+_0x3b5646['query'][_0xfbef('0x3f')]+'%'};return _0x128c35;}})});}_0x492b51=_[_0xfbef('0x41')]({},_0x492b51,_0x3b5646[_0xfbef('0x42')]);var _0x2efb39={'where':_0x492b51[_0xfbef('0x40')]};return db[_0xfbef('0x43')][_0xfbef('0x20')](_0x2efb39)[_0xfbef('0x28')](function(_0xe82946){_0x407184['count']=_0xe82946;if(_0x3b5646['query'][_0xfbef('0x44')]){_0x492b51['include']=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x492b51);})[_0xfbef('0x28')](function(_0xeb3157){_0x407184['rows']=_0xeb3157;return _0x407184;})[_0xfbef('0x28')](respondWithFilteredResult(_0x1573fa,_0x492b51))['catch'](handleError(_0x1573fa,null));};exports[_0xfbef('0x45')]=function(_0x1af6eb,_0x20cf74){var _0x103984={'raw':![],'where':{'id':_0x1af6eb[_0xfbef('0x46')]['id']}},_0x5841d2={};_0x5841d2[_0xfbef('0x32')]=_['keys'](db['AnalyticFieldReport'][_0xfbef('0x2f')]);_0x5841d2[_0xfbef('0x33')]=_[_0xfbef('0x34')](_0x1af6eb['query']);_0x5841d2['filters']=_[_0xfbef('0x36')](_0x5841d2[_0xfbef('0x32')],_0x5841d2[_0xfbef('0x33')]);_0x103984[_0xfbef('0x37')]=_[_0xfbef('0x36')](_0x5841d2[_0xfbef('0x32')],qs[_0xfbef('0x38')](_0x1af6eb[_0xfbef('0x33')][_0xfbef('0x38')]));_0x103984['attributes']=_0x103984['attributes'][_0xfbef('0x47')]?_0x103984[_0xfbef('0x37')]:_0x5841d2[_0xfbef('0x32')];if(_0x1af6eb[_0xfbef('0x33')][_0xfbef('0x44')]){_0x103984[_0xfbef('0x48')]=[{'all':!![]}];}_0x103984=_[_0xfbef('0x41')]({},_0x103984,_0x1af6eb[_0xfbef('0x42')]);return db[_0xfbef('0x43')][_0xfbef('0x49')](_0x103984)[_0xfbef('0x28')](handleEntityNotFound(_0x20cf74,null))[_0xfbef('0x28')](respondWithResult(_0x20cf74,null))['catch'](handleError(_0x20cf74,null));};exports[_0xfbef('0x4a')]=function(_0x21a517,_0x2672f9){return db[_0xfbef('0x43')][_0xfbef('0x4a')](_0x21a517[_0xfbef('0x4b')],{})[_0xfbef('0x28')](respondWithResult(_0x2672f9,0xc9))[_0xfbef('0x4c')](handleError(_0x2672f9,null));};exports[_0xfbef('0x4d')]=function(_0x5519d2,_0xa8e45a){return db[_0xfbef('0x43')][_0xfbef('0x4d')](_0x5519d2[_0xfbef('0x4b')],{'raw':![],'individualHooks':!![]})[_0xfbef('0x28')](respondWithResult(_0xa8e45a,0xc9))['catch'](handleError(_0xa8e45a,null));};exports[_0xfbef('0x27')]=function(_0x27e9de,_0x43afad){if(_0x27e9de['body']['id']){delete _0x27e9de[_0xfbef('0x4b')]['id'];}return db[_0xfbef('0x43')]['find']({'where':{'id':_0x27e9de[_0xfbef('0x46')]['id']}})[_0xfbef('0x28')](handleEntityNotFound(_0x43afad,null))[_0xfbef('0x28')](saveUpdates(_0x27e9de[_0xfbef('0x4b')],null))['then'](respondWithResult(_0x43afad,null))[_0xfbef('0x4c')](handleError(_0x43afad,null));};exports[_0xfbef('0x4e')]=function(_0x564912,_0x443f62){return db[_0xfbef('0x43')][_0xfbef('0x49')]({'where':{'id':_0x564912[_0xfbef('0x46')]['id']}})[_0xfbef('0x28')](handleEntityNotFound(_0x443f62,null))[_0xfbef('0x28')](removeEntity(_0x443f62,null))[_0xfbef('0x4c')](handleError(_0x443f62,null));};exports[_0xfbef('0x4f')]=function(_0x12cdeb,_0xe32ec4){return db[_0xfbef('0x43')]['destroy']({'where':{'id':_0x12cdeb['query'][_0xfbef('0x50')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xe32ec4,0xcc))[_0xfbef('0x4c')](handleError(_0xe32ec4,null));};exports['addFields']=function(_0x4f15d9,_0x50c3af,_0x441f15){return db[_0xfbef('0x51')][_0xfbef('0x52')]({'where':{'id':_0x4f15d9[_0xfbef('0x46')]['id']}})['then'](handleEntityNotFound(_0x50c3af,null))[_0xfbef('0x28')](function(_0x16b433){if(_0x16b433){return db[_0xfbef('0x53')][_0xfbef('0x54')](function(_0x2f3b5f){return db[_0xfbef('0x43')][_0xfbef('0x4e')]({'where':{'CustomReportId':_0x4f15d9[_0xfbef('0x46')]['id']},'transaction':_0x2f3b5f})[_0xfbef('0x28')](function(_0x386b53){var _0x288e86=_[_0xfbef('0x2e')](_0x4f15d9[_0xfbef('0x4b')],function(_0x209c5f){delete _0x209c5f['id'];_0x209c5f[_0xfbef('0x55')]=_0x4f15d9[_0xfbef('0x46')]['id'];return _0x209c5f;});return db[_0xfbef('0x43')][_0xfbef('0x4d')](_0x288e86,{'transaction':_0x2f3b5f});});})['then'](function(){return db[_0xfbef('0x43')][_0xfbef('0x56')]({'where':{'CustomReportId':_0x4f15d9[_0xfbef('0x46')]['id']}});});}})[_0xfbef('0x28')](respondWithResult(_0x50c3af,null))['catch'](handleError(_0x50c3af,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index e27ebe4..4985597 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 _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
+var _0xb9cf=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0x4a21be,_0x4f8c11){var _0x2bd67a=function(_0x5c7964){while(--_0x5c7964){_0x4a21be['push'](_0x4a21be['shift']());}};_0x2bd67a(++_0x4f8c11);}(_0xb9cf,0x98));var _0xfb9c=function(_0x1b7ff9,_0x187c24){_0x1b7ff9=_0x1b7ff9-0x0;var _0x5268a2=_0xb9cf[_0x1b7ff9];return _0x5268a2;};'use strict';var _=require(_0xfb9c('0x0'));var util=require(_0xfb9c('0x1'));var logger=require(_0xfb9c('0x2'))(_0xfb9c('0x3'));var moment=require(_0xfb9c('0x4'));var BPromise=require(_0xfb9c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb9c('0x6'));var rimraf=require(_0xfb9c('0x7'));var config=require(_0xfb9c('0x8'));var attributes=require(_0xfb9c('0x9'));module[_0xfb9c('0xa')]=function(_0x353043,_0x317420){return _0x353043[_0xfb9c('0xb')](_0xfb9c('0xc'),attributes,{'tableName':_0xfb9c('0xd'),'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 d9f0461..90c522d 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 _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
+var _0x8648=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','bluebird'];(function(_0x375f7a,_0x373c24){var _0x2d3a5b=function(_0x1a7b4f){while(--_0x1a7b4f){_0x375f7a['push'](_0x375f7a['shift']());}};_0x2d3a5b(++_0x373c24);}(_0x8648,0xcd));var _0x8864=function(_0x53bcdc,_0x3b0993){_0x53bcdc=_0x53bcdc-0x0;var _0x36f6fb=_0x8648[_0x53bcdc];return _0x36f6fb;};'use strict';var _=require(_0x8864('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8864('0x1'));var rs=require(_0x8864('0x2'));var fs=require('fs');var Redis=require(_0x8864('0x3'));var db=require(_0x8864('0x4'))['db'];var utils=require(_0x8864('0x5'));var logger=require(_0x8864('0x6'))(_0x8864('0x7'));var config=require(_0x8864('0x8'));var jayson=require(_0x8864('0x9'));var client=jayson['client'][_0x8864('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1593ae,_0x5e1295,_0x381214){return new BPromise(function(_0x5bf0e1,_0x50985a){return client[_0x8864('0xb')](_0x1593ae,_0x381214)[_0x8864('0xc')](function(_0x2e4b56){logger[_0x8864('0xd')](_0x8864('0xe'),_0x5e1295,'request\x20sent');logger['debug'](_0x8864('0xf'),_0x5e1295,'request\x20sent',JSON[_0x8864('0x10')](_0x2e4b56));if(_0x2e4b56[_0x8864('0x11')]){if(_0x2e4b56['error'][_0x8864('0x12')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x5e1295,_0x2e4b56[_0x8864('0x11')][_0x8864('0x13')]);return _0x50985a(_0x2e4b56[_0x8864('0x11')][_0x8864('0x13')]);}logger[_0x8864('0x11')](_0x8864('0xe'),_0x5e1295,_0x2e4b56[_0x8864('0x11')][_0x8864('0x13')]);return _0x5bf0e1(_0x2e4b56['error']['message']);}else{logger[_0x8864('0xd')](_0x8864('0xe'),_0x5e1295,_0x8864('0x14'));_0x5bf0e1(_0x2e4b56[_0x8864('0x15')][_0x8864('0x13')]);}})[_0x8864('0x16')](function(_0x1584ec){logger[_0x8864('0x11')](_0x8864('0xe'),_0x5e1295,_0x1584ec);_0x50985a(_0x1584ec);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 491289e..d8c0512 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 _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
+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(_0x1907cd,_0x202496){_0x1907cd=_0x1907cd-0x0;var _0xc77506=_0x55ca[_0x1907cd];return _0xc77506;};'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 56c9986..2dc5c33 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 _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
+var _0x09e4=['name','TEXT','sequelize','exports','STRING'];(function(_0x419d47,_0x2795dd){var _0x40ac84=function(_0x27c4fe){while(--_0x27c4fe){_0x419d47['push'](_0x419d47['shift']());}};_0x40ac84(++_0x2795dd);}(_0x09e4,0x1ce));var _0x409e=function(_0x3b56ff,_0x52ac2d){_0x3b56ff=_0x3b56ff-0x0;var _0x50ac37=_0x09e4[_0x3b56ff];return _0x50ac37;};'use strict';var Sequelize=require(_0x409e('0x0'));module[_0x409e('0x1')]={'name':{'type':Sequelize[_0x409e('0x2')],'allowNull':![],'unique':_0x409e('0x3')},'table':{'type':Sequelize[_0x409e('0x2')]},'metric':{'type':Sequelize[_0x409e('0x4')]},'description':{'type':Sequelize[_0x409e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 106c02f..029eb1c 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 _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
+var _0x3495=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','apply','save','then','destroy','get','Metrics','UserProfileResource','stack','name','send','index','AnalyticMetric','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','count','includeAll','catch','show','rawAttributes','include','options','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x242c62,_0x2fd8fd){var _0x5d9f4d=function(_0x41b2d8){while(--_0x41b2d8){_0x242c62['push'](_0x242c62['shift']());}};_0x5d9f4d(++_0x2fd8fd);}(_0x3495,0x1de));var _0x5349=function(_0x3d78d9,_0x2b135b){_0x3d78d9=_0x3d78d9-0x0;var _0x5a64b9=_0x3495[_0x3d78d9];return _0x5a64b9;};'use strict';var pdf=require(_0x5349('0x0'));var emlformat=require(_0x5349('0x1'));var rimraf=require(_0x5349('0x2'));var zipdir=require(_0x5349('0x3'));var jsonpatch=require(_0x5349('0x4'));var rp=require(_0x5349('0x5'));var moment=require(_0x5349('0x6'));var BPromise=require(_0x5349('0x7'));var Mustache=require(_0x5349('0x8'));var util=require('util');var path=require(_0x5349('0x9'));var sox=require(_0x5349('0xa'));var csv=require('to-csv');var ejs=require(_0x5349('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5349('0xc'));var crypto=require('crypto');var jsforce=require(_0x5349('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5349('0xe'));var querystring=require(_0x5349('0xf'));var Papa=require(_0x5349('0x10'));var Redis=require(_0x5349('0x11'));var authService=require(_0x5349('0x12'));var qs=require(_0x5349('0x13'));var as=require(_0x5349('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5349('0x15'))('api');var utils=require(_0x5349('0x16'));var config=require(_0x5349('0x17'));var db=require(_0x5349('0x18'))['db'];function respondWithStatusCode(_0x11d230,_0x2f5172){_0x2f5172=_0x2f5172||0xcc;return function(_0x3c592a){if(_0x3c592a){return _0x11d230[_0x5349('0x19')](_0x2f5172);}return _0x11d230[_0x5349('0x1a')](_0x2f5172)[_0x5349('0x1b')]();};}function respondWithResult(_0x3890a8,_0x534e31){_0x534e31=_0x534e31||0xc8;return function(_0x2fde66){if(_0x2fde66){return _0x3890a8[_0x5349('0x1a')](_0x534e31)['json'](_0x2fde66);}};}function respondWithFilteredResult(_0x1ed049,_0x269f7f){return function(_0x2fe611){if(_0x2fe611){var _0x49bbec=_0x2fe611['count'],_0x5bcb3a=_0x269f7f[_0x5349('0x1c')],_0x558fbb=_0x269f7f['offset']+_0x269f7f[_0x5349('0x1d')],_0x1fcbba;if(_0x558fbb>=_0x49bbec){_0x558fbb=_0x49bbec;_0x1fcbba=0xc8;}else{_0x1fcbba=0xce;}_0x1ed049[_0x5349('0x1a')](_0x1fcbba);return _0x1ed049[_0x5349('0x1e')](_0x5349('0x1f'),_0x5bcb3a+'-'+_0x558fbb+'/'+_0x49bbec)['json'](_0x2fe611);}return null;};}function patchUpdates(_0x22d1ca){return function(_0x24e74c){try{jsonpatch[_0x5349('0x20')](_0x24e74c,_0x22d1ca,!![]);}catch(_0x443b0a){return BPromise['reject'](_0x443b0a);}return _0x24e74c[_0x5349('0x21')]();};}function saveUpdates(_0x3594a4,_0x4f2cb6){return function(_0x4c96dc){if(_0x4c96dc){return _0x4c96dc['update'](_0x3594a4)[_0x5349('0x22')](function(_0x48ba3c){return _0x48ba3c;});}return null;};}function removeEntity(_0x270593,_0x1ff911){return function(_0x164978){if(_0x164978){return _0x164978[_0x5349('0x23')]()[_0x5349('0x22')](function(){var _0x29e912=_0x164978[_0x5349('0x24')]({'plain':!![]});var _0x43a0c2=_0x5349('0x25');return db[_0x5349('0x26')][_0x5349('0x23')]({'where':{'type':_0x43a0c2,'resourceId':_0x29e912['id']}})[_0x5349('0x22')](function(){return _0x164978;});})['then'](function(){_0x270593[_0x5349('0x1a')](0xcc)[_0x5349('0x1b')]();});}};}function handleEntityNotFound(_0x41d67e,_0x49435a){return function(_0x404700){if(!_0x404700){_0x41d67e['sendStatus'](0x194);}return _0x404700;};}function handleError(_0x1afba7,_0x203896){_0x203896=_0x203896||0x1f4;return function(_0x1db8cc){logger['error'](_0x1db8cc[_0x5349('0x27')]);if(_0x1db8cc[_0x5349('0x28')]){delete _0x1db8cc[_0x5349('0x28')];}_0x1afba7[_0x5349('0x1a')](_0x203896)[_0x5349('0x29')](_0x1db8cc);};}exports[_0x5349('0x2a')]=function(_0x3b6faa,_0x463a42){var _0x39b3a9={},_0x5b5d6c={},_0x3b3e79={'count':0x0,'rows':[]};var _0x1ab20a=_['map'](db[_0x5349('0x2b')]['rawAttributes'],function(_0x1df8b0){return{'name':_0x1df8b0[_0x5349('0x2c')],'type':_0x1df8b0[_0x5349('0x2d')][_0x5349('0x2e')]};});_0x5b5d6c[_0x5349('0x2f')]=_[_0x5349('0x30')](_0x1ab20a,'name');_0x5b5d6c[_0x5349('0x31')]=_[_0x5349('0x32')](_0x3b6faa[_0x5349('0x31')]);_0x5b5d6c[_0x5349('0x33')]=_['intersection'](_0x5b5d6c['model'],_0x5b5d6c[_0x5349('0x31')]);_0x39b3a9[_0x5349('0x34')]=_[_0x5349('0x35')](_0x5b5d6c['model'],qs[_0x5349('0x36')](_0x3b6faa['query'][_0x5349('0x36')]));_0x39b3a9[_0x5349('0x34')]=_0x39b3a9[_0x5349('0x34')][_0x5349('0x37')]?_0x39b3a9[_0x5349('0x34')]:_0x5b5d6c[_0x5349('0x2f')];if(!_0x3b6faa['query']['hasOwnProperty'](_0x5349('0x38'))){_0x39b3a9[_0x5349('0x1d')]=qs[_0x5349('0x1d')](_0x3b6faa[_0x5349('0x31')][_0x5349('0x1d')]);_0x39b3a9[_0x5349('0x1c')]=qs[_0x5349('0x1c')](_0x3b6faa['query']['offset']);}_0x39b3a9[_0x5349('0x39')]=qs['sort'](_0x3b6faa['query'][_0x5349('0x3a')]);_0x39b3a9['where']=qs[_0x5349('0x33')](_[_0x5349('0x3b')](_0x3b6faa[_0x5349('0x31')],_0x5b5d6c['filters']),_0x1ab20a);if(_0x3b6faa[_0x5349('0x31')]['filter']){_0x39b3a9[_0x5349('0x3c')]=_[_0x5349('0x3d')](_0x39b3a9[_0x5349('0x3c')],{'$or':_['map'](_0x1ab20a,function(_0x48a765){if(_0x48a765['type']!==_0x5349('0x3e')){var _0x26da1e={};_0x26da1e[_0x48a765[_0x5349('0x28')]]={'$like':'%'+_0x3b6faa[_0x5349('0x31')][_0x5349('0x3f')]+'%'};return _0x26da1e;}})});}_0x39b3a9=_[_0x5349('0x3d')]({},_0x39b3a9,_0x3b6faa['options']);var _0x52ab9d={'where':_0x39b3a9[_0x5349('0x3c')]};return db[_0x5349('0x2b')][_0x5349('0x40')](_0x52ab9d)['then'](function(_0x7ca6dc){_0x3b3e79[_0x5349('0x40')]=_0x7ca6dc;if(_0x3b6faa[_0x5349('0x31')][_0x5349('0x41')]){_0x39b3a9['include']=[{'all':!![]}];}return db[_0x5349('0x2b')]['findAll'](_0x39b3a9);})[_0x5349('0x22')](function(_0x196d68){_0x3b3e79['rows']=_0x196d68;return _0x3b3e79;})[_0x5349('0x22')](respondWithFilteredResult(_0x463a42,_0x39b3a9))[_0x5349('0x42')](handleError(_0x463a42,null));};exports[_0x5349('0x43')]=function(_0x370849,_0x173904){var _0xd29178={'raw':!![],'where':{'id':_0x370849['params']['id']}},_0x4252ec={};_0x4252ec['model']=_[_0x5349('0x32')](db[_0x5349('0x2b')][_0x5349('0x44')]);_0x4252ec[_0x5349('0x31')]=_['keys'](_0x370849[_0x5349('0x31')]);_0x4252ec['filters']=_['intersection'](_0x4252ec[_0x5349('0x2f')],_0x4252ec[_0x5349('0x31')]);_0xd29178[_0x5349('0x34')]=_[_0x5349('0x35')](_0x4252ec['model'],qs[_0x5349('0x36')](_0x370849[_0x5349('0x31')][_0x5349('0x36')]));_0xd29178[_0x5349('0x34')]=_0xd29178[_0x5349('0x34')][_0x5349('0x37')]?_0xd29178[_0x5349('0x34')]:_0x4252ec[_0x5349('0x2f')];if(_0x370849[_0x5349('0x31')][_0x5349('0x41')]){_0xd29178[_0x5349('0x45')]=[{'all':!![]}];}_0xd29178=_[_0x5349('0x3d')]({},_0xd29178,_0x370849[_0x5349('0x46')]);return db[_0x5349('0x2b')]['find'](_0xd29178)['then'](handleEntityNotFound(_0x173904,null))[_0x5349('0x22')](respondWithResult(_0x173904,null))[_0x5349('0x42')](handleError(_0x173904,null));};exports[_0x5349('0x47')]=function(_0x366634,_0x5e8cf3){return db[_0x5349('0x2b')]['create'](_0x366634[_0x5349('0x48')],{})[_0x5349('0x22')](function(_0x1fa080){var _0x3652dc=_0x366634[_0x5349('0x49')][_0x5349('0x24')]({'plain':!![]});if(!_0x3652dc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3652dc[_0x5349('0x4a')]==='user'){var _0x7374d6=_0x1fa080[_0x5349('0x24')]({'plain':!![]});var _0x35ca92=_0x5349('0x25');return db[_0x5349('0x4b')]['find']({'where':{'name':_0x35ca92,'userProfileId':_0x3652dc[_0x5349('0x4c')]},'raw':!![]})[_0x5349('0x22')](function(_0x3891af){if(_0x3891af&&_0x3891af[_0x5349('0x4d')]===0x0){return db['UserProfileResource'][_0x5349('0x47')]({'name':_0x7374d6[_0x5349('0x28')],'resourceId':_0x7374d6['id'],'type':_0x3891af[_0x5349('0x28')],'sectionId':_0x3891af['id']},{})[_0x5349('0x22')](function(){return _0x1fa080;});}else{return _0x1fa080;}})[_0x5349('0x42')](function(_0x1a82af){logger[_0x5349('0x4e')](_0x5349('0x4f'),_0x1a82af);throw _0x1a82af;});}return _0x1fa080;})[_0x5349('0x22')](respondWithResult(_0x5e8cf3,0xc9))[_0x5349('0x42')](handleError(_0x5e8cf3,null));};exports[_0x5349('0x50')]=function(_0x2a6f80,_0x1286a2){if(_0x2a6f80[_0x5349('0x48')]['id']){delete _0x2a6f80[_0x5349('0x48')]['id'];}return db[_0x5349('0x2b')][_0x5349('0x51')]({'where':{'id':_0x2a6f80[_0x5349('0x52')]['id']}})['then'](handleEntityNotFound(_0x1286a2,null))[_0x5349('0x22')](saveUpdates(_0x2a6f80[_0x5349('0x48')],null))['then'](respondWithResult(_0x1286a2,null))['catch'](handleError(_0x1286a2,null));};exports[_0x5349('0x23')]=function(_0x450751,_0x13cbb5){return db[_0x5349('0x2b')][_0x5349('0x51')]({'where':{'id':_0x450751[_0x5349('0x52')]['id']}})[_0x5349('0x22')](handleEntityNotFound(_0x13cbb5,null))['then'](removeEntity(_0x13cbb5,null))[_0x5349('0x42')](handleError(_0x13cbb5,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 409e82f..3869e07 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 _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
+var _0x0df0=['request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger','api','moment'];(function(_0x18f807,_0x515512){var _0x1d7cd5=function(_0x31dc0b){while(--_0x31dc0b){_0x18f807['push'](_0x18f807['shift']());}};_0x1d7cd5(++_0x515512);}(_0x0df0,0x1dd));var _0x00df=function(_0x56e790,_0x5bec09){_0x56e790=_0x56e790-0x0;var _0x4fa9fa=_0x0df0[_0x56e790];return _0x4fa9fa;};'use strict';var _=require('lodash');var util=require(_0x00df('0x0'));var logger=require(_0x00df('0x1'))(_0x00df('0x2'));var moment=require(_0x00df('0x3'));var BPromise=require('bluebird');var rp=require(_0x00df('0x4'));var fs=require('fs');var path=require(_0x00df('0x5'));var rimraf=require(_0x00df('0x6'));var config=require(_0x00df('0x7'));var attributes=require(_0x00df('0x8'));module[_0x00df('0x9')]=function(_0x324500,_0x5aef8c){return _0x324500[_0x00df('0xa')](_0x00df('0xb'),attributes,{'tableName':_0x00df('0xc'),'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 172c1af..7c83105 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 _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
+var _0xd5dc=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','message','error','request\x20sent','catch','lodash','util','moment','randomstring'];(function(_0x5dc8c3,_0x22eee9){var _0x456a93=function(_0x12a63d){while(--_0x12a63d){_0x5dc8c3['push'](_0x5dc8c3['shift']());}};_0x456a93(++_0x22eee9);}(_0xd5dc,0x6f));var _0xcd5d=function(_0x3049f8,_0xb5bede){_0x3049f8=_0x3049f8-0x0;var _0x2fda1d=_0xd5dc[_0x3049f8];return _0x2fda1d;};'use strict';var _=require(_0xcd5d('0x0'));var util=require(_0xcd5d('0x1'));var moment=require(_0xcd5d('0x2'));var BPromise=require('bluebird');var rs=require(_0xcd5d('0x3'));var fs=require('fs');var Redis=require(_0xcd5d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd5d('0x5'));var logger=require(_0xcd5d('0x6'))(_0xcd5d('0x7'));var config=require(_0xcd5d('0x8'));var jayson=require(_0xcd5d('0x9'));var client=jayson[_0xcd5d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34e0bc,_0x2bb79c,_0x5c48c7){return new BPromise(function(_0x581a01,_0x1936ba){return client[_0xcd5d('0xb')](_0x34e0bc,_0x5c48c7)[_0xcd5d('0xc')](function(_0x21f8b3){logger[_0xcd5d('0xd')](_0xcd5d('0xe'),_0x2bb79c,'request\x20sent');logger[_0xcd5d('0xf')](_0xcd5d('0x10'),_0x2bb79c,'request\x20sent',JSON[_0xcd5d('0x11')](_0x21f8b3));if(_0x21f8b3['error']){if(_0x21f8b3['error'][_0xcd5d('0x12')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x2bb79c,_0x21f8b3['error'][_0xcd5d('0x13')]);return _0x1936ba(_0x21f8b3[_0xcd5d('0x14')][_0xcd5d('0x13')]);}logger['error'](_0xcd5d('0xe'),_0x2bb79c,_0x21f8b3[_0xcd5d('0x14')]['message']);return _0x581a01(_0x21f8b3[_0xcd5d('0x14')][_0xcd5d('0x13')]);}else{logger[_0xcd5d('0xd')](_0xcd5d('0xe'),_0x2bb79c,_0xcd5d('0x15'));_0x581a01(_0x21f8b3['result']['message']);}})[_0xcd5d('0x16')](function(_0x5ad188){logger[_0xcd5d('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x2bb79c,_0x5ad188);_0x1936ba(_0x5ad188);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index e013f85..d1f7fec 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(_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
+var _0x53ec=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./analyticMetric.controller','get','index','/:id','isAuthenticated'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x53ec,0x192));var _0xc53e=function(_0x254c9e,_0xab8a1b){_0x254c9e=_0x254c9e-0x0;var _0x2d4cb6=_0x53ec[_0x254c9e];return _0x2d4cb6;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc53e('0x6'));var config=require('../../config/environment');var controller=require(_0xc53e('0x7'));router[_0xc53e('0x8')]('/',auth['isAuthenticated'](),controller[_0xc53e('0x9')]);router['get'](_0xc53e('0xa'),auth[_0xc53e('0xb')](),controller['show']);router[_0xc53e('0xc')]('/',auth[_0xc53e('0xb')](),controller[_0xc53e('0xd')]);router[_0xc53e('0xe')](_0xc53e('0xa'),auth[_0xc53e('0xb')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xc53e('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 2908e7f..42fd947 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 _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
+var _0xb18f=['exports','TEXT','sequelize'];(function(_0x45fbed,_0x4ef9a8){var _0x404d70=function(_0x36f9d9){while(--_0x36f9d9){_0x45fbed['push'](_0x45fbed['shift']());}};_0x404d70(++_0x4ef9a8);}(_0xb18f,0xa1));var _0xfb18=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0xb18f[_0x1e6659];return _0x4d16e4;};'use strict';var Sequelize=require(_0xfb18('0x0'));module[_0xfb18('0x1')]={'tree':{'type':Sequelize[_0xfb18('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index dcb4d80..fe7c526 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 _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
+var _0xea04=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','error','name','map','AnalyticTreeReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse'];(function(_0x1761f2,_0x2f64bd){var _0x1a3063=function(_0x476350){while(--_0x476350){_0x1761f2['push'](_0x1761f2['shift']());}};_0x1a3063(++_0x2f64bd);}(_0xea04,0x105));var _0x4ea0=function(_0x243bba,_0x1ea69f){_0x243bba=_0x243bba-0x0;var _0x12e696=_0xea04[_0x243bba];return _0x12e696;};'use strict';var pdf=require(_0x4ea0('0x0'));var emlformat=require(_0x4ea0('0x1'));var rimraf=require(_0x4ea0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4ea0('0x3'));var moment=require('moment');var BPromise=require(_0x4ea0('0x4'));var Mustache=require(_0x4ea0('0x5'));var util=require(_0x4ea0('0x6'));var path=require('path');var sox=require(_0x4ea0('0x7'));var csv=require(_0x4ea0('0x8'));var ejs=require(_0x4ea0('0x9'));var fs=require('fs');var _=require(_0x4ea0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4ea0('0xb'));var deskjs=require(_0x4ea0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4ea0('0xd'));var Papa=require(_0x4ea0('0xe'));var Redis=require(_0x4ea0('0xf'));var authService=require(_0x4ea0('0x10'));var qs=require(_0x4ea0('0x11'));var as=require(_0x4ea0('0x12'));var hardwareService=require(_0x4ea0('0x13'));var logger=require('../../config/logger')(_0x4ea0('0x14'));var utils=require(_0x4ea0('0x15'));var config=require(_0x4ea0('0x16'));var db=require(_0x4ea0('0x17'))['db'];function respondWithStatusCode(_0x1613b2,_0x5acd73){_0x5acd73=_0x5acd73||0xcc;return function(_0x54089c){if(_0x54089c){return _0x1613b2[_0x4ea0('0x18')](_0x5acd73);}return _0x1613b2[_0x4ea0('0x19')](_0x5acd73)[_0x4ea0('0x1a')]();};}function respondWithResult(_0x22e5c9,_0x13093f){_0x13093f=_0x13093f||0xc8;return function(_0x1a99c4){if(_0x1a99c4){return _0x22e5c9[_0x4ea0('0x19')](_0x13093f)[_0x4ea0('0x1b')](_0x1a99c4);}};}function respondWithFilteredResult(_0x4adcc3,_0x109122){return function(_0x1b4f10){if(_0x1b4f10){var _0x25b786=_0x1b4f10[_0x4ea0('0x1c')],_0xf2a53d=_0x109122[_0x4ea0('0x1d')],_0x375377=_0x109122[_0x4ea0('0x1d')]+_0x109122[_0x4ea0('0x1e')],_0x22118a;if(_0x375377>=_0x25b786){_0x375377=_0x25b786;_0x22118a=0xc8;}else{_0x22118a=0xce;}_0x4adcc3[_0x4ea0('0x19')](_0x22118a);return _0x4adcc3[_0x4ea0('0x1f')](_0x4ea0('0x20'),_0xf2a53d+'-'+_0x375377+'/'+_0x25b786)['json'](_0x1b4f10);}return null;};}function patchUpdates(_0x542954){return function(_0x200710){try{jsonpatch['apply'](_0x200710,_0x542954,!![]);}catch(_0x3d19ca){return BPromise[_0x4ea0('0x21')](_0x3d19ca);}return _0x200710[_0x4ea0('0x22')]();};}function saveUpdates(_0x2ac08d,_0x6de371){return function(_0x1f210c){if(_0x1f210c){return _0x1f210c[_0x4ea0('0x23')](_0x2ac08d)[_0x4ea0('0x24')](function(_0x798e77){return _0x798e77;});}return null;};}function removeEntity(_0x18d6d6,_0x239976){return function(_0x540631){if(_0x540631){return _0x540631['destroy']()[_0x4ea0('0x24')](function(){_0x18d6d6[_0x4ea0('0x19')](0xcc)[_0x4ea0('0x1a')]();});}};}function handleEntityNotFound(_0x992d43,_0x12d4d2){return function(_0x45303f){if(!_0x45303f){_0x992d43['sendStatus'](0x194);}return _0x45303f;};}function handleError(_0x3f64f7,_0x3e0692){_0x3e0692=_0x3e0692||0x1f4;return function(_0x895cc9){logger[_0x4ea0('0x25')](_0x895cc9['stack']);if(_0x895cc9[_0x4ea0('0x26')]){delete _0x895cc9[_0x4ea0('0x26')];}_0x3f64f7[_0x4ea0('0x19')](_0x3e0692)['send'](_0x895cc9);};}exports['index']=function(_0x3ea3cf,_0x525f76){var _0x1083dd={},_0x4cd05e={},_0xf950f4={'count':0x0,'rows':[]};var _0x16e0bc=_[_0x4ea0('0x27')](db[_0x4ea0('0x28')][_0x4ea0('0x29')],function(_0x160530){return{'name':_0x160530[_0x4ea0('0x2a')],'type':_0x160530[_0x4ea0('0x2b')]['key']};});_0x4cd05e['model']=_[_0x4ea0('0x27')](_0x16e0bc,_0x4ea0('0x26'));_0x4cd05e[_0x4ea0('0x2c')]=_[_0x4ea0('0x2d')](_0x3ea3cf[_0x4ea0('0x2c')]);_0x4cd05e[_0x4ea0('0x2e')]=_['intersection'](_0x4cd05e[_0x4ea0('0x2f')],_0x4cd05e[_0x4ea0('0x2c')]);_0x1083dd[_0x4ea0('0x30')]=_[_0x4ea0('0x31')](_0x4cd05e[_0x4ea0('0x2f')],qs['fields'](_0x3ea3cf[_0x4ea0('0x2c')][_0x4ea0('0x32')]));_0x1083dd[_0x4ea0('0x30')]=_0x1083dd[_0x4ea0('0x30')][_0x4ea0('0x33')]?_0x1083dd[_0x4ea0('0x30')]:_0x4cd05e[_0x4ea0('0x2f')];if(!_0x3ea3cf[_0x4ea0('0x2c')][_0x4ea0('0x34')]('nolimit')){_0x1083dd['limit']=qs[_0x4ea0('0x1e')](_0x3ea3cf[_0x4ea0('0x2c')][_0x4ea0('0x1e')]);_0x1083dd['offset']=qs[_0x4ea0('0x1d')](_0x3ea3cf[_0x4ea0('0x2c')][_0x4ea0('0x1d')]);}_0x1083dd['order']=qs['sort'](_0x3ea3cf['query'][_0x4ea0('0x35')]);_0x1083dd['where']=qs[_0x4ea0('0x2e')](_[_0x4ea0('0x36')](_0x3ea3cf[_0x4ea0('0x2c')],_0x4cd05e[_0x4ea0('0x2e')]),_0x16e0bc);if(_0x3ea3cf['query'][_0x4ea0('0x37')]){_0x1083dd[_0x4ea0('0x38')]=_[_0x4ea0('0x39')](_0x1083dd[_0x4ea0('0x38')],{'$or':_['map'](_0x16e0bc,function(_0x20cca3){if(_0x20cca3[_0x4ea0('0x2b')]!==_0x4ea0('0x3a')){var _0x47b30d={};_0x47b30d[_0x20cca3[_0x4ea0('0x26')]]={'$like':'%'+_0x3ea3cf[_0x4ea0('0x2c')][_0x4ea0('0x37')]+'%'};return _0x47b30d;}})});}_0x1083dd=_['merge']({},_0x1083dd,_0x3ea3cf[_0x4ea0('0x3b')]);var _0x139cf8={'where':_0x1083dd['where']};return db[_0x4ea0('0x28')]['count'](_0x139cf8)[_0x4ea0('0x24')](function(_0x1b2583){_0xf950f4['count']=_0x1b2583;if(_0x3ea3cf[_0x4ea0('0x2c')][_0x4ea0('0x3c')]){_0x1083dd['include']=[{'all':!![]}];}return db[_0x4ea0('0x28')]['findAll'](_0x1083dd);})[_0x4ea0('0x24')](function(_0x5d7ba4){_0xf950f4[_0x4ea0('0x3d')]=_0x5d7ba4;return _0xf950f4;})[_0x4ea0('0x24')](respondWithFilteredResult(_0x525f76,_0x1083dd))[_0x4ea0('0x3e')](handleError(_0x525f76,null));};exports[_0x4ea0('0x3f')]=function(_0x5cbf90,_0x5c8f70){var _0x2e7b95={'raw':!![],'where':{'id':_0x5cbf90[_0x4ea0('0x40')]['id']}},_0x30060f={};_0x30060f[_0x4ea0('0x2f')]=_['keys'](db[_0x4ea0('0x28')][_0x4ea0('0x29')]);_0x30060f[_0x4ea0('0x2c')]=_[_0x4ea0('0x2d')](_0x5cbf90[_0x4ea0('0x2c')]);_0x30060f[_0x4ea0('0x2e')]=_[_0x4ea0('0x31')](_0x30060f[_0x4ea0('0x2f')],_0x30060f['query']);_0x2e7b95['attributes']=_['intersection'](_0x30060f[_0x4ea0('0x2f')],qs[_0x4ea0('0x32')](_0x5cbf90[_0x4ea0('0x2c')][_0x4ea0('0x32')]));_0x2e7b95['attributes']=_0x2e7b95[_0x4ea0('0x30')][_0x4ea0('0x33')]?_0x2e7b95['attributes']:_0x30060f['model'];if(_0x5cbf90[_0x4ea0('0x2c')][_0x4ea0('0x3c')]){_0x2e7b95[_0x4ea0('0x41')]=[{'all':!![]}];}_0x2e7b95=_[_0x4ea0('0x39')]({},_0x2e7b95,_0x5cbf90[_0x4ea0('0x3b')]);return db[_0x4ea0('0x28')][_0x4ea0('0x42')](_0x2e7b95)[_0x4ea0('0x24')](handleEntityNotFound(_0x5c8f70,null))[_0x4ea0('0x24')](respondWithResult(_0x5c8f70,null))['catch'](handleError(_0x5c8f70,null));};exports[_0x4ea0('0x43')]=function(_0x44044c,_0x58e9e9){return db['AnalyticTreeReport'][_0x4ea0('0x43')](_0x44044c[_0x4ea0('0x44')],{})[_0x4ea0('0x24')](respondWithResult(_0x58e9e9,0xc9))[_0x4ea0('0x3e')](handleError(_0x58e9e9,null));};exports[_0x4ea0('0x23')]=function(_0x4c9ec4,_0x784e69){if(_0x4c9ec4[_0x4ea0('0x44')]['id']){delete _0x4c9ec4[_0x4ea0('0x44')]['id'];}return db[_0x4ea0('0x28')][_0x4ea0('0x42')]({'where':{'id':_0x4c9ec4[_0x4ea0('0x40')]['id']}})[_0x4ea0('0x24')](handleEntityNotFound(_0x784e69,null))[_0x4ea0('0x24')](saveUpdates(_0x4c9ec4[_0x4ea0('0x44')],null))[_0x4ea0('0x24')](respondWithResult(_0x784e69,null))[_0x4ea0('0x3e')](handleError(_0x784e69,null));};exports['destroy']=function(_0x274525,_0x3ab0a3){return db['AnalyticTreeReport'][_0x4ea0('0x42')]({'where':{'id':_0x274525['params']['id']}})[_0x4ea0('0x24')](handleEntityNotFound(_0x3ab0a3,null))[_0x4ea0('0x24')](removeEntity(_0x3ab0a3,null))['catch'](handleError(_0x3ab0a3,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index c8f8b05..a81fe20 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 _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
+var _0xbcb5=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x5cb54b,_0x5b038c){var _0xaeb5c4=function(_0x10ab41){while(--_0x10ab41){_0x5cb54b['push'](_0x5cb54b['shift']());}};_0xaeb5c4(++_0x5b038c);}(_0xbcb5,0x15f));var _0x5bcb=function(_0x62ae40,_0x573e9a){_0x62ae40=_0x62ae40-0x0;var _0x5364cb=_0xbcb5[_0x62ae40];return _0x5364cb;};'use strict';var _=require(_0x5bcb('0x0'));var util=require(_0x5bcb('0x1'));var logger=require(_0x5bcb('0x2'))(_0x5bcb('0x3'));var moment=require('moment');var BPromise=require(_0x5bcb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5bcb('0x5'));var rimraf=require(_0x5bcb('0x6'));var config=require(_0x5bcb('0x7'));var attributes=require(_0x5bcb('0x8'));module[_0x5bcb('0x9')]=function(_0x4b5df3,_0x52ccc2){return _0x4b5df3[_0x5bcb('0xa')](_0x5bcb('0xb'),attributes,{'tableName':_0x5bcb('0xc'),'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 63fd311..136cdc4 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 _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
+var _0x4e35=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticTreeReport,\x20%s,\x20%s'];(function(_0x3f74ac,_0x2dca2a){var _0x32fc00=function(_0x2ffa2b){while(--_0x2ffa2b){_0x3f74ac['push'](_0x3f74ac['shift']());}};_0x32fc00(++_0x2dca2a);}(_0x4e35,0x76));var _0x54e3=function(_0x310d10,_0x3fe887){_0x310d10=_0x310d10-0x0;var _0x1fb8af=_0x4e35[_0x310d10];return _0x1fb8af;};'use strict';var _=require(_0x54e3('0x0'));var util=require(_0x54e3('0x1'));var moment=require(_0x54e3('0x2'));var BPromise=require(_0x54e3('0x3'));var rs=require(_0x54e3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x54e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x54e3('0x6'))(_0x54e3('0x7'));var config=require(_0x54e3('0x8'));var jayson=require(_0x54e3('0x9'));var client=jayson['client'][_0x54e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15af7a,_0x4af0f4,_0x5ab1b2){return new BPromise(function(_0x1514a6,_0x1b7731){return client[_0x54e3('0xb')](_0x15af7a,_0x5ab1b2)[_0x54e3('0xc')](function(_0x42ae5b){logger[_0x54e3('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4af0f4,_0x54e3('0xe'));logger[_0x54e3('0xf')](_0x54e3('0x10'),_0x4af0f4,_0x54e3('0xe'),JSON[_0x54e3('0x11')](_0x42ae5b));if(_0x42ae5b[_0x54e3('0x12')]){if(_0x42ae5b['error']['code']===0x1f4){logger['error'](_0x54e3('0x13'),_0x4af0f4,_0x42ae5b[_0x54e3('0x12')][_0x54e3('0x14')]);return _0x1b7731(_0x42ae5b[_0x54e3('0x12')][_0x54e3('0x14')]);}logger[_0x54e3('0x12')](_0x54e3('0x13'),_0x4af0f4,_0x42ae5b[_0x54e3('0x12')][_0x54e3('0x14')]);return _0x1514a6(_0x42ae5b['error'][_0x54e3('0x14')]);}else{logger[_0x54e3('0xd')](_0x54e3('0x13'),_0x4af0f4,_0x54e3('0xe'));_0x1514a6(_0x42ae5b[_0x54e3('0x15')][_0x54e3('0x14')]);}})[_0x54e3('0x16')](function(_0x11e84e){logger[_0x54e3('0x12')](_0x54e3('0x13'),_0x4af0f4,_0x11e84e);_0x1b7731(_0x11e84e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 64e2541..8240e95 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 _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
+var _0x92db=['Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','util','connect-timeout'];(function(_0x5cc486,_0x41ac4c){var _0x2ef367=function(_0x5456b0){while(--_0x5456b0){_0x5cc486['push'](_0x5cc486['shift']());}};_0x2ef367(++_0x41ac4c);}(_0x92db,0x163));var _0xb92d=function(_0x43aae6,_0x4c34d6){_0x43aae6=_0x43aae6-0x0;var _0x1913bb=_0x92db[_0x43aae6];return _0x1913bb;};'use strict';var multer=require('multer');var util=require(_0xb92d('0x0'));var path=require('path');var timeout=require(_0xb92d('0x1'));var express=require('express');var router=express[_0xb92d('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xb92d('0x3'));var config=require(_0xb92d('0x4'));var controller=require(_0xb92d('0x5'));router[_0xb92d('0x6')]('/',auth[_0xb92d('0x7')](),controller[_0xb92d('0x8')]);router['get']('/:id',auth[_0xb92d('0x7')](),controller[_0xb92d('0x9')]);router[_0xb92d('0xa')]('/',auth[_0xb92d('0x7')](),controller[_0xb92d('0xb')]);router[_0xb92d('0xc')](_0xb92d('0xd'),auth[_0xb92d('0x7')](),controller[_0xb92d('0xe')]);router[_0xb92d('0xf')](_0xb92d('0xd'),auth[_0xb92d('0x7')](),controller['destroy']);module[_0xb92d('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index a00995c..2b27454 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 _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
+var _0x81d4=['sequelize','exports','STRING'];(function(_0xffc0e7,_0x4ae80b){var _0x21ea1a=function(_0x44a9a2){while(--_0x44a9a2){_0xffc0e7['push'](_0xffc0e7['shift']());}};_0x21ea1a(++_0x4ae80b);}(_0x81d4,0xc0));var _0x481d=function(_0x406ef5,_0x5bf927){_0x406ef5=_0x406ef5-0x0;var _0x2b96d2=_0x81d4[_0x406ef5];return _0x2b96d2;};'use strict';var Sequelize=require(_0x481d('0x0'));module[_0x481d('0x1')]={'name':{'type':Sequelize[_0x481d('0x2')]},'basename':{'type':Sequelize[_0x481d('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 2afa58f..d09c0e6 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 _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
+var _0x6e98=['intersection','find','catch','params','omit','createdAt','updatedAt','body','file','originalname','basename','filename','mimetype','create','download','findOne','root','server/files/attachments/','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','count','offset','json','reject','update','then','destroy','error','stack','name','map','Attachment','rawAttributes','fieldName','keys','query','filters','fields','attributes','length','model','hasOwnProperty','nolimit','limit','sort','where','pick','filter','type','merge','includeAll','include','findAll','rows'];(function(_0x3bdb7c,_0x2b2e13){var _0x299ed4=function(_0xef4f5a){while(--_0xef4f5a){_0x3bdb7c['push'](_0x3bdb7c['shift']());}};_0x299ed4(++_0x2b2e13);}(_0x6e98,0xff));var _0x86e9=function(_0xf93076,_0x1acb30){_0xf93076=_0xf93076-0x0;var _0x33d1da=_0x6e98[_0xf93076];return _0x33d1da;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x86e9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x86e9('0x1'));var rp=require('request-promise');var moment=require(_0x86e9('0x2'));var BPromise=require(_0x86e9('0x3'));var Mustache=require(_0x86e9('0x4'));var util=require(_0x86e9('0x5'));var path=require(_0x86e9('0x6'));var sox=require(_0x86e9('0x7'));var csv=require(_0x86e9('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x86e9('0x9'));var squel=require(_0x86e9('0xa'));var crypto=require(_0x86e9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x86e9('0xc'));var toCsv=require('to-csv');var querystring=require(_0x86e9('0xd'));var Papa=require(_0x86e9('0xe'));var Redis=require(_0x86e9('0xf'));var authService=require(_0x86e9('0x10'));var qs=require(_0x86e9('0x11'));var as=require(_0x86e9('0x12'));var hardwareService=require(_0x86e9('0x13'));var logger=require(_0x86e9('0x14'))(_0x86e9('0x15'));var utils=require(_0x86e9('0x16'));var config=require('../../config/environment');var db=require(_0x86e9('0x17'))['db'];function respondWithStatusCode(_0xeec1d5,_0x11e4eb){_0x11e4eb=_0x11e4eb||0xcc;return function(_0x1dd62a){if(_0x1dd62a){return _0xeec1d5[_0x86e9('0x18')](_0x11e4eb);}return _0xeec1d5['status'](_0x11e4eb)[_0x86e9('0x19')]();};}function respondWithResult(_0x596a1c,_0x2fadb7){_0x2fadb7=_0x2fadb7||0xc8;return function(_0x20b1b4){if(_0x20b1b4){return _0x596a1c[_0x86e9('0x1a')](_0x2fadb7)['json'](_0x20b1b4);}};}function respondWithFilteredResult(_0x8fdfd,_0x227461){return function(_0x10f2ef){if(_0x10f2ef){var _0x26ea51=_0x10f2ef[_0x86e9('0x1b')],_0x197097=_0x227461[_0x86e9('0x1c')],_0x54b6ef=_0x227461[_0x86e9('0x1c')]+_0x227461['limit'],_0x20f48a;if(_0x54b6ef>=_0x26ea51){_0x54b6ef=_0x26ea51;_0x20f48a=0xc8;}else{_0x20f48a=0xce;}_0x8fdfd[_0x86e9('0x1a')](_0x20f48a);return _0x8fdfd['set']('Content-Range',_0x197097+'-'+_0x54b6ef+'/'+_0x26ea51)[_0x86e9('0x1d')](_0x10f2ef);}return null;};}function patchUpdates(_0x49d03f){return function(_0x5efb16){try{jsonpatch['apply'](_0x5efb16,_0x49d03f,!![]);}catch(_0x3f6db7){return BPromise[_0x86e9('0x1e')](_0x3f6db7);}return _0x5efb16['save']();};}function saveUpdates(_0x3e526a,_0x2de0e1){return function(_0x433dfa){if(_0x433dfa){return _0x433dfa[_0x86e9('0x1f')](_0x3e526a)[_0x86e9('0x20')](function(_0x2a8450){return _0x2a8450;});}return null;};}function removeEntity(_0x5bb92f,_0x45064a){return function(_0x1cc1c3){if(_0x1cc1c3){return _0x1cc1c3[_0x86e9('0x21')]()[_0x86e9('0x20')](function(){_0x5bb92f[_0x86e9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd4298,_0x54527d){return function(_0x48ab9d){if(!_0x48ab9d){_0xd4298[_0x86e9('0x18')](0x194);}return _0x48ab9d;};}function handleError(_0x27de41,_0x46f0f8){_0x46f0f8=_0x46f0f8||0x1f4;return function(_0x309081){logger[_0x86e9('0x22')](_0x309081[_0x86e9('0x23')]);if(_0x309081[_0x86e9('0x24')]){delete _0x309081[_0x86e9('0x24')];}_0x27de41['status'](_0x46f0f8)['send'](_0x309081);};}exports['index']=function(_0x3fc785,_0x1208d7){var _0x14ef6b={},_0x41645f={},_0x39aae0={'count':0x0,'rows':[]};var _0x481619=_[_0x86e9('0x25')](db[_0x86e9('0x26')][_0x86e9('0x27')],function(_0x3bf0d9){return{'name':_0x3bf0d9[_0x86e9('0x28')],'type':_0x3bf0d9['type']['key']};});_0x41645f['model']=_[_0x86e9('0x25')](_0x481619,_0x86e9('0x24'));_0x41645f['query']=_[_0x86e9('0x29')](_0x3fc785[_0x86e9('0x2a')]);_0x41645f[_0x86e9('0x2b')]=_['intersection'](_0x41645f['model'],_0x41645f['query']);_0x14ef6b['attributes']=_['intersection'](_0x41645f['model'],qs['fields'](_0x3fc785[_0x86e9('0x2a')][_0x86e9('0x2c')]));_0x14ef6b['attributes']=_0x14ef6b[_0x86e9('0x2d')][_0x86e9('0x2e')]?_0x14ef6b['attributes']:_0x41645f[_0x86e9('0x2f')];if(!_0x3fc785[_0x86e9('0x2a')][_0x86e9('0x30')](_0x86e9('0x31'))){_0x14ef6b[_0x86e9('0x32')]=qs[_0x86e9('0x32')](_0x3fc785[_0x86e9('0x2a')]['limit']);_0x14ef6b[_0x86e9('0x1c')]=qs['offset'](_0x3fc785['query'][_0x86e9('0x1c')]);}_0x14ef6b['order']=qs[_0x86e9('0x33')](_0x3fc785[_0x86e9('0x2a')][_0x86e9('0x33')]);_0x14ef6b[_0x86e9('0x34')]=qs[_0x86e9('0x2b')](_[_0x86e9('0x35')](_0x3fc785[_0x86e9('0x2a')],_0x41645f[_0x86e9('0x2b')]),_0x481619);if(_0x3fc785['query'][_0x86e9('0x36')]){_0x14ef6b[_0x86e9('0x34')]=_['merge'](_0x14ef6b[_0x86e9('0x34')],{'$or':_[_0x86e9('0x25')](_0x481619,function(_0x405889){if(_0x405889[_0x86e9('0x37')]!=='VIRTUAL'){var _0x259380={};_0x259380[_0x405889[_0x86e9('0x24')]]={'$like':'%'+_0x3fc785[_0x86e9('0x2a')][_0x86e9('0x36')]+'%'};return _0x259380;}})});}_0x14ef6b=_[_0x86e9('0x38')]({},_0x14ef6b,_0x3fc785['options']);var _0x3d3280={'where':_0x14ef6b[_0x86e9('0x34')]};return db[_0x86e9('0x26')]['count'](_0x3d3280)[_0x86e9('0x20')](function(_0x2a9210){_0x39aae0['count']=_0x2a9210;if(_0x3fc785[_0x86e9('0x2a')][_0x86e9('0x39')]){_0x14ef6b[_0x86e9('0x3a')]=[{'all':!![]}];}return db[_0x86e9('0x26')][_0x86e9('0x3b')](_0x14ef6b);})[_0x86e9('0x20')](function(_0x1e0a98){_0x39aae0[_0x86e9('0x3c')]=_0x1e0a98;return _0x39aae0;})['then'](respondWithFilteredResult(_0x1208d7,_0x14ef6b))['catch'](handleError(_0x1208d7,null));};exports['show']=function(_0x37e225,_0x5ea145){var _0x10755b={'raw':!![],'where':{'id':_0x37e225['params']['id']}},_0x30362c={};_0x30362c['model']=_['keys'](db[_0x86e9('0x26')][_0x86e9('0x27')]);_0x30362c['query']=_[_0x86e9('0x29')](_0x37e225[_0x86e9('0x2a')]);_0x30362c[_0x86e9('0x2b')]=_['intersection'](_0x30362c[_0x86e9('0x2f')],_0x30362c['query']);_0x10755b['attributes']=_[_0x86e9('0x3d')](_0x30362c[_0x86e9('0x2f')],qs['fields'](_0x37e225[_0x86e9('0x2a')][_0x86e9('0x2c')]));_0x10755b['attributes']=_0x10755b[_0x86e9('0x2d')][_0x86e9('0x2e')]?_0x10755b[_0x86e9('0x2d')]:_0x30362c[_0x86e9('0x2f')];if(_0x37e225[_0x86e9('0x2a')][_0x86e9('0x39')]){_0x10755b[_0x86e9('0x3a')]=[{'all':!![]}];}_0x10755b=_[_0x86e9('0x38')]({},_0x10755b,_0x37e225['options']);return db['Attachment'][_0x86e9('0x3e')](_0x10755b)[_0x86e9('0x20')](handleEntityNotFound(_0x5ea145,null))[_0x86e9('0x20')](respondWithResult(_0x5ea145,null))[_0x86e9('0x3f')](handleError(_0x5ea145,null));};exports['clone']=function(_0x296f9d,_0x4c21ca){var _0x2cead2={'where':{'id':_0x296f9d[_0x86e9('0x40')]['id']}},_0x4e0f55={};_0x4e0f55[_0x86e9('0x2f')]=_['keys'](db[_0x86e9('0x26')][_0x86e9('0x27')]);_0x2cead2[_0x86e9('0x2d')]=_[_0x86e9('0x3d')](_0x4e0f55['model'],qs[_0x86e9('0x2c')](_0x296f9d['query'][_0x86e9('0x2c')]));_0x2cead2[_0x86e9('0x2d')]=_0x2cead2[_0x86e9('0x2d')]['length']?_0x2cead2['attributes']:_0x4e0f55[_0x86e9('0x2f')];if(_0x296f9d[_0x86e9('0x2a')]['includeAll']){_0x2cead2[_0x86e9('0x3a')]=[{'all':!![]}];}_0x2cead2=_['merge']({},_0x2cead2,_0x296f9d['options']);return db['Attachment']['find'](_0x2cead2)[_0x86e9('0x20')](handleEntityNotFound(_0x4c21ca,null))[_0x86e9('0x20')](function(_0x1fa238){if(_0x1fa238){var _0x36f416=_0x1fa238['get']({'plain':!![]});_0x36f416=qs[_0x86e9('0x41')](_0x36f416,['id',_0x86e9('0x42'),_0x86e9('0x43')]);_0x296f9d['body']=_[_0x86e9('0x41')](_0x296f9d[_0x86e9('0x44')],['id','createdAt',_0x86e9('0x43')]);return db['Attachment']['create'](_[_0x86e9('0x38')](_0x36f416,_0x296f9d['body']),{'include':_0x296f9d[_0x86e9('0x2a')][_0x86e9('0x39')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4c21ca,0xc9))[_0x86e9('0x3f')](handleError(_0x4c21ca,null));};exports[_0x86e9('0x1f')]=function(_0x34207e,_0x5cc2fe){if(_0x34207e[_0x86e9('0x44')]['id']){delete _0x34207e[_0x86e9('0x44')]['id'];}return db['Attachment'][_0x86e9('0x3e')]({'where':{'id':_0x34207e[_0x86e9('0x40')]['id']}})[_0x86e9('0x20')](handleEntityNotFound(_0x5cc2fe,null))['then'](saveUpdates(_0x34207e['body'],null))[_0x86e9('0x20')](respondWithResult(_0x5cc2fe,null))[_0x86e9('0x3f')](handleError(_0x5cc2fe,null));};exports[_0x86e9('0x21')]=function(_0x2855cb,_0x46ce1f){return db[_0x86e9('0x26')][_0x86e9('0x3e')]({'where':{'id':_0x2855cb['params']['id']}})['then'](handleEntityNotFound(_0x46ce1f,null))[_0x86e9('0x20')](removeEntity(_0x46ce1f,null))['catch'](handleError(_0x46ce1f,null));};exports['create']=function(_0x4375f1,_0x59775c,_0x2dc8c1){_0x4375f1['body'][_0x86e9('0x24')]=_0x4375f1[_0x86e9('0x45')][_0x86e9('0x46')];_0x4375f1[_0x86e9('0x44')][_0x86e9('0x47')]=_0x4375f1[_0x86e9('0x45')][_0x86e9('0x48')];_0x4375f1[_0x86e9('0x44')][_0x86e9('0x37')]=_0x4375f1[_0x86e9('0x45')][_0x86e9('0x49')];return db[_0x86e9('0x26')][_0x86e9('0x4a')](_0x4375f1[_0x86e9('0x44')])[_0x86e9('0x20')](respondWithResult(_0x59775c,0xc9))['catch'](handleError(_0x59775c,null));};exports[_0x86e9('0x4b')]=function(_0x150017,_0x4461d9,_0x3aeafb){return db[_0x86e9('0x26')][_0x86e9('0x4c')]({'where':{'id':_0x150017[_0x86e9('0x40')]['id']},'raw':!![]})[_0x86e9('0x20')](handleEntityNotFound(_0x4461d9,null))[_0x86e9('0x20')](function(_0x47b673){if(_0x47b673){return _0x4461d9[_0x86e9('0x4b')](path['join'](config[_0x86e9('0x4d')],_0x86e9('0x4e'),_0x47b673[_0x86e9('0x47')]));}})[_0x86e9('0x3f')](handleError(_0x4461d9,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index fcf43a0..4134c55 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 _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
+var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','Attachment','util'];(function(_0xa8bd05,_0x20f53d){var _0x1be566=function(_0x30579b){while(--_0x30579b){_0xa8bd05['push'](_0xa8bd05['shift']());}};_0x1be566(++_0x20f53d);}(_0xedd9,0xfc));var _0x9edd=function(_0x4ab779,_0x17d890){_0x4ab779=_0x4ab779-0x0;var _0x394088=_0xedd9[_0x4ab779];return _0x394088;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'attachments','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 392807c..07464c4 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 _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
+var _0x0f44=['code','message','result','Attachment','create','body','options','then','debug','CreateAttachment','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x0f44,0x149));var _0x40f4=function(_0x108567,_0x593bec){_0x108567=_0x108567-0x0;var _0x14be2d=_0x0f44[_0x108567];return _0x14be2d;};'use strict';var _=require(_0x40f4('0x0'));var util=require(_0x40f4('0x1'));var moment=require('moment');var BPromise=require(_0x40f4('0x2'));var rs=require(_0x40f4('0x3'));var fs=require('fs');var Redis=require(_0x40f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x40f4('0x5'));var logger=require(_0x40f4('0x6'))(_0x40f4('0x7'));var config=require(_0x40f4('0x8'));var jayson=require(_0x40f4('0x9'));var client=jayson[_0x40f4('0xa')][_0x40f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2159ca,_0xf7197b,_0x215a20){return new BPromise(function(_0x3e99ef,_0x323fef){return client[_0x40f4('0xc')](_0x2159ca,_0x215a20)['then'](function(_0x1c9a83){logger[_0x40f4('0xd')](_0x40f4('0xe'),_0xf7197b,'request\x20sent');logger['debug'](_0x40f4('0xf'),_0xf7197b,_0x40f4('0x10'),JSON[_0x40f4('0x11')](_0x1c9a83));if(_0x1c9a83[_0x40f4('0x12')]){if(_0x1c9a83[_0x40f4('0x12')][_0x40f4('0x13')]===0x1f4){logger[_0x40f4('0x12')](_0x40f4('0xe'),_0xf7197b,_0x1c9a83[_0x40f4('0x12')][_0x40f4('0x14')]);return _0x323fef(_0x1c9a83['error']['message']);}logger[_0x40f4('0x12')](_0x40f4('0xe'),_0xf7197b,_0x1c9a83[_0x40f4('0x12')][_0x40f4('0x14')]);return _0x3e99ef(_0x1c9a83[_0x40f4('0x12')][_0x40f4('0x14')]);}else{logger[_0x40f4('0xd')]('Attachment,\x20%s,\x20%s',_0xf7197b,_0x40f4('0x10'));_0x3e99ef(_0x1c9a83[_0x40f4('0x15')][_0x40f4('0x14')]);}})['catch'](function(_0x348eb2){logger[_0x40f4('0x12')]('Attachment,\x20%s,\x20%s',_0xf7197b,_0x348eb2);_0x323fef(_0x348eb2);});});}exports['CreateAttachment']=function(_0x25d6a2){var _0x4fe08d=this;return new Promise(function(_0x1ccd02,_0x1f6d43){return db[_0x40f4('0x16')][_0x40f4('0x17')](_0x25d6a2[_0x40f4('0x18')],{'raw':_0x25d6a2[_0x40f4('0x19')]?_0x25d6a2[_0x40f4('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x40f4('0x1a')](function(_0x3f611c){logger['info']('CreateAttachment',_0x25d6a2);logger[_0x40f4('0x1b')]('CreateAttachment',_0x25d6a2,JSON['stringify'](_0x3f611c));_0x1ccd02(_0x3f611c);})['catch'](function(_0x4296a2){logger[_0x40f4('0x12')](_0x40f4('0x1c'),_0x4296a2[_0x40f4('0x14')],_0x25d6a2);_0x1f6d43(_0x4fe08d[_0x40f4('0x12')](0x1f4,_0x4296a2[_0x40f4('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 5baa6e7..9f5ef4b 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 _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
+var _0x6c00=['index','show','download','post','/:id/clone','clone','diskStorage','join','format','%s-%s','replace','single','file','create','put','/:id','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./attachment.controller','get','isAuthenticated'];(function(_0x5c5096,_0x3ceeec){var _0x235ded=function(_0x5ac063){while(--_0x5ac063){_0x5c5096['push'](_0x5c5096['shift']());}};_0x235ded(++_0x3ceeec);}(_0x6c00,0x1a9));var _0x06c0=function(_0x17b0d4,_0x377add){_0x17b0d4=_0x17b0d4-0x0;var _0x2d02c7=_0x6c00[_0x17b0d4];return _0x2d02c7;};'use strict';var multer=require(_0x06c0('0x0'));var util=require(_0x06c0('0x1'));var path=require(_0x06c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x06c0('0x3'));var router=express[_0x06c0('0x4')]();var auth=require(_0x06c0('0x5'));var interaction=require(_0x06c0('0x6'));var config=require('../../config/environment');var controller=require(_0x06c0('0x7'));router[_0x06c0('0x8')]('/',auth[_0x06c0('0x9')](),controller[_0x06c0('0xa')]);router[_0x06c0('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x06c0('0xb')]);router[_0x06c0('0x8')]('/:id/download',auth[_0x06c0('0x9')](),controller[_0x06c0('0xc')]);router[_0x06c0('0xd')](_0x06c0('0xe'),auth[_0x06c0('0x9')](),controller[_0x06c0('0xf')]);var upload=multer({'storage':multer[_0x06c0('0x10')]({'destination':function(_0x139770,_0x3bad48,_0x804c54){_0x804c54(null,path[_0x06c0('0x11')](config['root'],'server/files/attachments/'));},'filename':function(_0x394397,_0xc05495,_0x462ee2){_0x462ee2(null,util[_0x06c0('0x12')](_0x06c0('0x13'),Date['now'](),_0xc05495['originalname'][_0x06c0('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x06c0('0xd')]('/',upload[_0x06c0('0x15')](_0x06c0('0x16')),controller[_0x06c0('0x17')]);router[_0x06c0('0x18')](_0x06c0('0x19'),auth['isAuthenticated'](),controller[_0x06c0('0x1a')]);router[_0x06c0('0x1b')](_0x06c0('0x19'),auth[_0x06c0('0x9')](),controller[_0x06c0('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 591b874..f031c4b 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 _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
+var _0xb6a5=['allowedLoginAttempts','then','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','blockDuration','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','profile','/login','clientID','clientSecret','secret','callbackURL','findOne'];(function(_0x31d478,_0x6dc61d){var _0x416219=function(_0xc49291){while(--_0xc49291){_0x31d478['push'](_0x31d478['shift']());}};_0x416219(++_0x6dc61d);}(_0xb6a5,0xd4));var _0x5b6a=function(_0x5ec418,_0x334eb6){_0x5ec418=_0x5ec418-0x0;var _0x10acdf=_0xb6a5[_0x5ec418];return _0x10acdf;};'use strict';var _=require(_0x5b6a('0x0'));var passport=require(_0x5b6a('0x1'));var GoogleStrategy=require(_0x5b6a('0x2'))['Strategy'];var moment=require(_0x5b6a('0x3'));var db=require(_0x5b6a('0x4'))['db'];var config=require(_0x5b6a('0x5'));var signToken=require(_0x5b6a('0x6'))[_0x5b6a('0x7')];var utils=require(_0x5b6a('0x8'));exports[_0x5b6a('0x9')]=passport[_0x5b6a('0xa')](_0x5b6a('0xb'),{'failureRedirect':'/login','scope':[_0x5b6a('0xc'),'email'],'session':![]});exports['callback']=passport['authenticate'](_0x5b6a('0xb'),{'failureRedirect':_0x5b6a('0xd'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x5b6a('0xb')]?config[_0x5b6a('0xb')][_0x5b6a('0xe')]:'id','clientSecret':config[_0x5b6a('0xb')]?config[_0x5b6a('0xb')][_0x5b6a('0xf')]:_0x5b6a('0x10'),'callbackURL':config[_0x5b6a('0xb')]?config[_0x5b6a('0xb')][_0x5b6a('0x11')]:''},function(_0x5e7b96,_0x2e44b3,_0x58208f,_0x163f4b){var _0xc47645,_0x2d90b9;return db['Setting'][_0x5b6a('0x12')]({'where':{'id':0x1},'attributes':[_0x5b6a('0x13'),'blockDuration'],'raw':!![]})[_0x5b6a('0x14')](function(_0xd9299e){_0xc47645=_0xd9299e;return db['User'][_0x5b6a('0x15')]({'where':{'email':_[_0x5b6a('0x16')](_0x58208f['emails'],_0x5b6a('0x17')),'role':{'$or':[_0x5b6a('0x18'),_0x5b6a('0x19'),_0x5b6a('0x1a')]}}});})[_0x5b6a('0x14')](function(_0x164931){_0x2d90b9=_0x164931;if(_0x2d90b9){if(_0x2d90b9['disabled']){return _0x163f4b(_0x5b6a('0x1b'));}else if(_0xc47645['blockDuration']>0x0){if(_0x2d90b9['blocked']){if(moment(_0x2d90b9['blockedAt'])[_0x5b6a('0x1c')](_0xc47645[_0x5b6a('0x1d')],'minutes')>moment()){return _0x163f4b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x5b6a('0x1e')](_0x2d90b9,0x0,![],null)[_0x5b6a('0x14')](function(){return utils[_0x5b6a('0x1f')](_0x2d90b9);})[_0x5b6a('0x14')](function(){return _0x163f4b(null,_0x2d90b9);});}}else{return utils[_0x5b6a('0x1f')](_0x2d90b9)['then'](function(){return _0x163f4b(null,_0x2d90b9);});}}else{return utils['getLicense'](_0x2d90b9)[_0x5b6a('0x14')](function(){return _0x163f4b(null,_0x2d90b9);});}}return _0x163f4b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x5b6a('0x20')](function(_0x51a473){_0x163f4b(_0x51a473);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 38091fa..ff06671 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 _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
+var _0x8bdf=['/callback','callback','isMiddleware','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','login'];(function(_0x4a58eb,_0x5aac55){var _0x1ce75c=function(_0x3d565c){while(--_0x3d565c){_0x4a58eb['push'](_0x4a58eb['shift']());}};_0x1ce75c(++_0x5aac55);}(_0x8bdf,0x1a7));var _0xf8bd=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8bdf[_0x501510];return _0x1e6ee5;};'use strict';var express=require(_0xf8bd('0x0'));var passport=require(_0xf8bd('0x1'));var router=express[_0xf8bd('0x2')]();var controller=require(_0xf8bd('0x3'));var userController=require(_0xf8bd('0x4'));var authService=require('../../components/auth/service');router[_0xf8bd('0x5')]('/',controller[_0xf8bd('0x6')]);router[_0xf8bd('0x5')](_0xf8bd('0x7'),controller[_0xf8bd('0x8')],authService[_0xf8bd('0x9')],userController['login'],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index eb56728..917f1d0 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 _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
+var _0xd3d3=['blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','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~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','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://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','params','token','securePassword','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts'];(function(_0xfc0976,_0x33776f){var _0x23579f=function(_0x4143d9){while(--_0x4143d9){_0xfc0976['push'](_0xfc0976['shift']());}};_0x23579f(++_0x33776f);}(_0xd3d3,0xa1));var _0x3d3d=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xd3d3[_0x10004e];return _0x5af990;};'use strict';var util=require(_0x3d3d('0x0'));var passport=require(_0x3d3d('0x1'));var LocalStrategy=require(_0x3d3d('0x2'))[_0x3d3d('0x3')];var jayson=require(_0x3d3d('0x4'));var _=require(_0x3d3d('0x5'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x3d3d('0x6'))['db'];var authService=require(_0x3d3d('0x7'));var utils=require(_0x3d3d('0x8'));var client=jayson['client'][_0x3d3d('0x9')]({'port':0x232b});function localAuthenticate(_0x2eeec,_0x52d016,_0x5d2548,_0x4d4587){var _0x15ded0,_0x33a017;return db[_0x3d3d('0xa')][_0x3d3d('0xb')]({'where':{'id':0x1},'attributes':[_0x3d3d('0xc'),_0x3d3d('0xd')],'raw':!![]})[_0x3d3d('0xe')](function(_0xe2e8ff){_0x15ded0=_0xe2e8ff;return _0x2eeec[_0x3d3d('0xb')]({'attributes':['id',_0x3d3d('0xf'),_0x3d3d('0x10'),_0x3d3d('0x11'),_0x3d3d('0x12'),_0x3d3d('0x13'),_0x3d3d('0x14'),_0x3d3d('0x15'),'loginAttempts'],'where':{'name':_0x52d016,'role':{'$or':[_0x3d3d('0x16'),'user',_0x3d3d('0x17')]}}});})[_0x3d3d('0xe')](function(_0x4d9e7f){if(!_0x4d9e7f||_0x4d9e7f&&_0x4d9e7f[_0x3d3d('0xf')]!==_0x52d016){throw new Error(_0x3d3d('0x18'));}else{_0x33a017=_0x4d9e7f;return _0x33a017;}})[_0x3d3d('0xe')](function(){_0x33a017[_0x3d3d('0x19')](_0x5d2548,function(_0x2a8b08,_0x298fbb){var _0x46b679=_0x33a017[_0x3d3d('0x1a')]+0x1;if(_0x2a8b08){return _0x4d4587(_0x2a8b08);}else if(!_0x298fbb){if(_0x33a017['disabled']){return _0x4d4587(null,![],{'message':_0x3d3d('0x18')});}else if(_0x15ded0['allowedLoginAttempts']>0x0){if(_0x33a017['blocked']){if(_0x15ded0[_0x3d3d('0xd')]>0x0){if(moment(_0x33a017[_0x3d3d('0x15')])[_0x3d3d('0x1b')](_0x15ded0[_0x3d3d('0xd')],_0x3d3d('0x1c'))>moment()){return _0x4d4587(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3d3d('0x1d')](_0x33a017,_0x46b679,![],null)['then'](function(){return _0x4d4587(null,![],{'message':_0x3d3d('0x18')});});}}else{return _0x4d4587(null,![],{'message':_0x3d3d('0x18')});}}else{if(_0x46b679>=_0x15ded0[_0x3d3d('0xc')]){return utils['clearBlockUser'](_0x33a017,0x0,!![],moment())[_0x3d3d('0xe')](function(){return _0x4d4587(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x3d3d('0x1d')](_0x33a017,_0x46b679,![],null)[_0x3d3d('0xe')](function(){return _0x4d4587(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x4d4587(null,![],{'message':_0x3d3d('0x18')});}}else{if(_0x33a017[_0x3d3d('0x13')]){return _0x4d4587(null,![],{'message':_0x3d3d('0x18')});}else if(_0x15ded0[_0x3d3d('0xc')]>0x0){if(_0x33a017[_0x3d3d('0x14')]){if(_0x15ded0[_0x3d3d('0xd')]>0x0){if(moment(_0x33a017[_0x3d3d('0x15')])[_0x3d3d('0x1b')](_0x15ded0[_0x3d3d('0xd')],_0x3d3d('0x1c'))>moment()){return _0x4d4587(null,![],{'message':_0x3d3d('0x18')});}else{return utils[_0x3d3d('0x1d')](_0x33a017,0x0,![],null)[_0x3d3d('0xe')](function(){return utils['getLicense'](_0x33a017);})[_0x3d3d('0xe')](function(){return _0x4d4587(null,_0x33a017);});}}else{return _0x4d4587(null,![],{'message':_0x3d3d('0x18')});}}else{return utils[_0x3d3d('0x1d')](_0x33a017,0x0,![],null)['then'](function(){return utils[_0x3d3d('0x1e')](_0x33a017);})[_0x3d3d('0xe')](function(){return _0x4d4587(null,_0x33a017);})['catch'](function(_0x5e1b03){return _0x4d4587(null,![],_0x5e1b03);});}}else{if(_0x33a017[_0x3d3d('0x14')]){return _0x4d4587(null,![],{'message':_0x3d3d('0x18')});}else{return utils[_0x3d3d('0x1e')](_0x33a017)['then'](function(){return _0x4d4587(null,_0x33a017);});}}}});})[_0x3d3d('0x1f')](function(_0x23b2ba){return _0x4d4587(null,![],_0x23b2ba);});}function sendServiceMail(_0x39b1a7){return db[_0x3d3d('0x20')][_0x3d3d('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0x3d3d('0x22')],'include':[{'model':db[_0x3d3d('0x23')],'as':_0x3d3d('0x24')}]})[_0x3d3d('0xe')](function(_0x48ae9d){if(!_0x48ae9d){throw new Error(_0x3d3d('0x25'));}var _0x42f007={'tls':{'rejectUnauthorized':![]}};if(_0x48ae9d[_0x3d3d('0x24')][_0x3d3d('0x26')]){_0x42f007[_0x3d3d('0x26')]=_0x48ae9d[_0x3d3d('0x24')][_0x3d3d('0x26')];}else{_0x42f007[_0x3d3d('0x27')]=_0x48ae9d['Smtp'][_0x3d3d('0x27')];_0x42f007[_0x3d3d('0x28')]=_0x48ae9d[_0x3d3d('0x24')][_0x3d3d('0x28')];_0x42f007['secure']=_0x48ae9d[_0x3d3d('0x24')][_0x3d3d('0x29')];}if(_0x48ae9d[_0x3d3d('0x24')][_0x3d3d('0x2a')]){_0x42f007[_0x3d3d('0x2b')]={'user':_0x48ae9d[_0x3d3d('0x24')]['user'],'pass':_0x48ae9d[_0x3d3d('0x24')][_0x3d3d('0x2c')]};}var _0x4da471={'account':_0x42f007,'message':_['merge']({'from':util[_0x3d3d('0x2d')](_0x3d3d('0x2e'),_0x48ae9d[_0x3d3d('0xf')],_0x48ae9d[_0x3d3d('0x22')]||_0x48ae9d[_0x3d3d('0x24')][_0x3d3d('0x2f')])},_0x39b1a7)};return client[_0x3d3d('0x30')](_0x3d3d('0x31'),_0x4da471);})[_0x3d3d('0xe')](function(_0x5810c6){if(_0x5810c6[_0x3d3d('0x32')]){throw new Error(util[_0x3d3d('0x2d')](_0x3d3d('0x33'),_0x5810c6[_0x3d3d('0x32')]['message']||JSON[_0x3d3d('0x34')](_0x5810c6[_0x3d3d('0x32')])));}return!![];});}function handleError(_0x46916b,_0x414b7f,_0x15d034){return _0x46916b['status'](_0x414b7f||0x1f4)[_0x3d3d('0x35')]({'message':_0x15d034?_0x15d034[_0x3d3d('0x36')]||_0x15d034:''});}function checkPasswordPattern(_0x354f97,_0x2eeaf8,_0x325f4b){if(_0x325f4b){var _0x4ac83a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ac83a[_0x3d3d('0x37')](_0x2eeaf8)){return _0x354f97;}else{throw new Error(_0x3d3d('0x38'));}}else{return _0x354f97;}}exports[_0x3d3d('0x39')]=function(_0x529e05,_0x3d7d00,_0x333176){passport['authenticate'](_0x3d3d('0x3a'),function(_0x12eaee,_0x1b56b1,_0x42f280){var _0x434164=_0x12eaee||_0x42f280;if(_0x434164){return handleError(_0x3d7d00,0x191,_0x434164);}if(!_0x1b56b1){return handleError(_0x3d7d00,0x194,{'message':_0x3d3d('0x3b')});}else{var _0x1732aa={'payload':{'id':_0x1b56b1['id'],'role':_0x1b56b1[_0x3d3d('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x3d3d('0x3c')](_0x1732aa)[_0x3d3d('0xe')](function(_0x228826){_0x3d7d00[_0x3d3d('0x3d')]({'id':_0x1b56b1['id'],'token':_0x228826,'statusCall':'','isAlreadyLogged':_0x1b56b1['online']});});}})(_0x529e05,_0x3d7d00,_0x333176);};exports[_0x3d3d('0x3e')]=function(_0x112c70,_0x257663,_0x2a2d47){if(!_0x112c70['body']['email']){return handleError(_0x257663,0x1f4,{'message':_0x3d3d('0x3f')});}var _0x457e26=rs[_0x3d3d('0x40')]();_0x112c70[_0x3d3d('0x41')][_0x3d3d('0x22')]=_0x112c70['body'][_0x3d3d('0x22')][_0x3d3d('0x42')]()[_0x3d3d('0x43')]();var _0x384f34;return db[_0x3d3d('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x3d3d('0xd')],'raw':!![]})['then'](function(_0x45c354){_0x384f34=_0x45c354;return db[_0x3d3d('0x44')][_0x3d3d('0x21')]({'where':{'email':_0x112c70[_0x3d3d('0x41')][_0x3d3d('0x22')]}});})[_0x3d3d('0xe')](function(_0x59d0ed){if(!_0x59d0ed){throw new Error(_0x3d3d('0x45'));}if(_0x59d0ed[_0x3d3d('0x13')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x59d0ed[_0x3d3d('0x14')]){if(moment(_0x59d0ed['blockedAt'])[_0x3d3d('0x1b')](_0x384f34['blockDuration'],_0x3d3d('0x1c'))>moment()){throw new Error(_0x3d3d('0x46'));}else{_0x59d0ed[_0x3d3d('0x14')]=![];_0x59d0ed[_0x3d3d('0x15')]=null;}}_0x59d0ed[_0x3d3d('0x47')]=_0x457e26;_0x59d0ed['resetPasswordExpires']=Date[_0x3d3d('0x48')]()+0x36ee80;return _0x59d0ed[_0x3d3d('0x49')]();})['then'](function(){return sendServiceMail({'to':_0x112c70[_0x3d3d('0x41')][_0x3d3d('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x3d3d('0x4a')+_0x3d3d('0x4b')+_0x3d3d('0x4c')+_0x112c70['headers'][_0x3d3d('0x27')]+_0x3d3d('0x4d')+_0x457e26+'\x0a\x0a'+_0x3d3d('0x4e')});})[_0x3d3d('0xe')](function(){_0x257663[_0x3d3d('0x4f')](0xc8)[_0x3d3d('0x35')]({'message':_0x3d3d('0x50')});})['catch'](function(_0x471b8d){return handleError(_0x257663,0x1f4,_0x471b8d);});};exports['reset']=function(_0x15ddeb,_0x5a5f26,_0x422a7b){var _0x34f673;return db[_0x3d3d('0x44')]['find']({'where':{'resetPasswordToken':_0x15ddeb[_0x3d3d('0x51')][_0x3d3d('0x52')],'resetPasswordExpires':{'$gt':Date[_0x3d3d('0x48')]()}}})['then'](function(_0x2d76b4){_0x34f673=_0x2d76b4;if(!_0x34f673){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x3d3d('0xa')][_0x3d3d('0xb')]({'attributes':['id',_0x3d3d('0x53')]});})['then'](function(_0x5ab60b){return checkPasswordPattern(_0x5ab60b,_0x15ddeb[_0x3d3d('0x41')][_0x3d3d('0x10')],_0x5ab60b[_0x3d3d('0x53')]);})[_0x3d3d('0xe')](function(){_0x34f673[_0x3d3d('0x10')]=_0x15ddeb[_0x3d3d('0x41')][_0x3d3d('0x10')];_0x34f673[_0x3d3d('0x47')]=null;_0x34f673[_0x3d3d('0x54')]=null;return _0x34f673[_0x3d3d('0x49')]();})[_0x3d3d('0xe')](function(){_0x5a5f26['status'](0xc8)[_0x3d3d('0x35')]({'message':_0x3d3d('0x55')});})[_0x3d3d('0x1f')](function(_0x163859){return handleError(_0x5a5f26,0x1f4,_0x163859);});};passport[_0x3d3d('0x56')](new LocalStrategy({'usernameField':'name','passwordField':_0x3d3d('0x10')},function(_0xc8d408,_0x796c3e,_0x5b590b){return localAuthenticate(db[_0x3d3d('0x44')],_0xc8d408,_0x796c3e,_0x5b590b);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 40fbf01..61588e8 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 _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
+var _0x7c3a=['reset','exports','./authLocal.controller','post','login','forgot','/reset/:token'];(function(_0x292db3,_0x5e5e03){var _0x1687e5=function(_0x28d064){while(--_0x28d064){_0x292db3['push'](_0x292db3['shift']());}};_0x1687e5(++_0x5e5e03);}(_0x7c3a,0x18a));var _0xa7c3=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x7c3a[_0x45e98e];return _0x374dba;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xa7c3('0x0'));router[_0xa7c3('0x1')]('/',controller[_0xa7c3('0x2')]);router[_0xa7c3('0x1')]('/forgot',controller[_0xa7c3('0x3')]);router[_0xa7c3('0x1')](_0xa7c3('0x4'),controller[_0xa7c3('0x5')]);module[_0xa7c3('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 01170d0..df6f53e 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 _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
+var _0x3af7=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x154d77,_0x1993ea){var _0x306342=function(_0x1e3e9d){while(--_0x1e3e9d){_0x154d77['push'](_0x154d77['shift']());}};_0x306342(++_0x1993ea);}(_0x3af7,0x1e4));var _0x73af=function(_0xde9e41,_0x37ba38){_0xde9e41=_0xde9e41-0x0;var _0x1ac9cb=_0x3af7[_0xde9e41];return _0x1ac9cb;};'use strict';var Sequelize=require(_0x73af('0x0'));module[_0x73af('0x1')]={'name':{'type':Sequelize[_0x73af('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x73af('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x73af('0x4')],'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 7fa9f06..82dbc47 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 _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
+var _0x72f8=['fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','options','create','body','find','addConditions','Condition','ids','getConditions','findOne','order','nolimit','addActions','Action','omit','getActions','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','Automation','fieldName','key','model','map','keys','filters','intersection','query','attributes'];(function(_0x544463,_0x214963){var _0x1add2a=function(_0x5e1006){while(--_0x5e1006){_0x544463['push'](_0x544463['shift']());}};_0x1add2a(++_0x214963);}(_0x72f8,0x1b5));var _0x872f=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x72f8[_0x4e9d3c];return _0x2d0825;};'use strict';var pdf=require(_0x872f('0x0'));var emlformat=require(_0x872f('0x1'));var rimraf=require(_0x872f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x872f('0x3'));var BPromise=require(_0x872f('0x4'));var Mustache=require(_0x872f('0x5'));var util=require(_0x872f('0x6'));var path=require(_0x872f('0x7'));var sox=require('sox');var csv=require(_0x872f('0x8'));var ejs=require(_0x872f('0x9'));var fs=require('fs');var _=require(_0x872f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x872f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x872f('0x8'));var querystring=require(_0x872f('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x872f('0xd'));var qs=require(_0x872f('0xe'));var as=require(_0x872f('0xf'));var hardwareService=require(_0x872f('0x10'));var logger=require(_0x872f('0x11'))(_0x872f('0x12'));var utils=require(_0x872f('0x13'));var config=require(_0x872f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d8d74,_0x300ab4){_0x300ab4=_0x300ab4||0xcc;return function(_0xec3659){if(_0xec3659){return _0x2d8d74[_0x872f('0x15')](_0x300ab4);}return _0x2d8d74[_0x872f('0x16')](_0x300ab4)[_0x872f('0x17')]();};}function respondWithResult(_0x308e3c,_0x3dcbca){_0x3dcbca=_0x3dcbca||0xc8;return function(_0x1c84c){if(_0x1c84c){return _0x308e3c['status'](_0x3dcbca)[_0x872f('0x18')](_0x1c84c);}};}function respondWithFilteredResult(_0x1a906a,_0x30195b){return function(_0x24dad6){if(_0x24dad6){var _0x274143=_0x24dad6[_0x872f('0x19')],_0x37231e=_0x30195b[_0x872f('0x1a')],_0x1193ca=_0x30195b[_0x872f('0x1a')]+_0x30195b[_0x872f('0x1b')],_0x33b3f7;if(_0x1193ca>=_0x274143){_0x1193ca=_0x274143;_0x33b3f7=0xc8;}else{_0x33b3f7=0xce;}_0x1a906a[_0x872f('0x16')](_0x33b3f7);return _0x1a906a[_0x872f('0x1c')](_0x872f('0x1d'),_0x37231e+'-'+_0x1193ca+'/'+_0x274143)['json'](_0x24dad6);}return null;};}function patchUpdates(_0x1797f5){return function(_0x18379f){try{jsonpatch[_0x872f('0x1e')](_0x18379f,_0x1797f5,!![]);}catch(_0xee744f){return BPromise[_0x872f('0x1f')](_0xee744f);}return _0x18379f['save']();};}function saveUpdates(_0x854a3e,_0x378ae1){return function(_0x29ae94){if(_0x29ae94){return _0x29ae94['update'](_0x854a3e)['then'](function(_0x464cb5){return _0x464cb5;});}return null;};}function removeEntity(_0x2160f0,_0x3d325a){return function(_0x2e6742){if(_0x2e6742){return _0x2e6742[_0x872f('0x20')]()[_0x872f('0x21')](function(){_0x2160f0[_0x872f('0x16')](0xcc)[_0x872f('0x17')]();});}};}function handleEntityNotFound(_0x71629,_0x4ce3d1){return function(_0x37ff60){if(!_0x37ff60){_0x71629['sendStatus'](0x194);}return _0x37ff60;};}function handleError(_0x439c96,_0x4d699a){_0x4d699a=_0x4d699a||0x1f4;return function(_0x14c416){logger[_0x872f('0x22')](_0x14c416[_0x872f('0x23')]);if(_0x14c416['name']){delete _0x14c416[_0x872f('0x24')];}_0x439c96[_0x872f('0x16')](_0x4d699a)[_0x872f('0x25')](_0x14c416);};}exports[_0x872f('0x26')]=function(_0x445328,_0x4d0712){var _0x1638db={},_0x2d1ad6={},_0x21ad3d={'count':0x0,'rows':[]};var _0x20fa4f=_['map'](db[_0x872f('0x27')]['rawAttributes'],function(_0x4aca01){return{'name':_0x4aca01[_0x872f('0x28')],'type':_0x4aca01['type'][_0x872f('0x29')]};});_0x2d1ad6[_0x872f('0x2a')]=_[_0x872f('0x2b')](_0x20fa4f,'name');_0x2d1ad6['query']=_[_0x872f('0x2c')](_0x445328['query']);_0x2d1ad6[_0x872f('0x2d')]=_[_0x872f('0x2e')](_0x2d1ad6[_0x872f('0x2a')],_0x2d1ad6[_0x872f('0x2f')]);_0x1638db[_0x872f('0x30')]=_['intersection'](_0x2d1ad6[_0x872f('0x2a')],qs[_0x872f('0x31')](_0x445328[_0x872f('0x2f')][_0x872f('0x31')]));_0x1638db[_0x872f('0x30')]=_0x1638db[_0x872f('0x30')][_0x872f('0x32')]?_0x1638db[_0x872f('0x30')]:_0x2d1ad6['model'];if(!_0x445328[_0x872f('0x2f')][_0x872f('0x33')]('nolimit')){_0x1638db[_0x872f('0x1b')]=qs[_0x872f('0x1b')](_0x445328[_0x872f('0x2f')][_0x872f('0x1b')]);_0x1638db['offset']=qs['offset'](_0x445328[_0x872f('0x2f')][_0x872f('0x1a')]);}_0x1638db['order']=qs[_0x872f('0x34')](_0x445328[_0x872f('0x2f')][_0x872f('0x34')]);_0x1638db[_0x872f('0x35')]=qs[_0x872f('0x2d')](_[_0x872f('0x36')](_0x445328['query'],_0x2d1ad6[_0x872f('0x2d')]),_0x20fa4f);if(_0x445328[_0x872f('0x2f')][_0x872f('0x37')]){_0x1638db[_0x872f('0x35')]=_[_0x872f('0x38')](_0x1638db[_0x872f('0x35')],{'$or':_[_0x872f('0x2b')](_0x20fa4f,function(_0x583b73){if(_0x583b73[_0x872f('0x39')]!==_0x872f('0x3a')){var _0x16d4d1={};_0x16d4d1[_0x583b73[_0x872f('0x24')]]={'$like':'%'+_0x445328['query'][_0x872f('0x37')]+'%'};return _0x16d4d1;}})});}_0x1638db=_[_0x872f('0x38')]({},_0x1638db,_0x445328['options']);var _0x24c60c={'where':_0x1638db['where']};return db[_0x872f('0x27')][_0x872f('0x19')](_0x24c60c)[_0x872f('0x21')](function(_0x100f39){_0x21ad3d[_0x872f('0x19')]=_0x100f39;if(_0x445328[_0x872f('0x2f')][_0x872f('0x3b')]){_0x1638db[_0x872f('0x3c')]=[{'all':!![]}];}return db[_0x872f('0x27')]['findAll'](_0x1638db);})[_0x872f('0x21')](function(_0x2b6308){_0x21ad3d[_0x872f('0x3d')]=_0x2b6308;return _0x21ad3d;})['then'](respondWithFilteredResult(_0x4d0712,_0x1638db))[_0x872f('0x3e')](handleError(_0x4d0712,null));};exports[_0x872f('0x3f')]=function(_0x2411b5,_0x10be05){var _0x419dee={'raw':![],'where':{'id':_0x2411b5[_0x872f('0x40')]['id']}},_0x481cb0={};_0x481cb0[_0x872f('0x2a')]=_[_0x872f('0x2c')](db[_0x872f('0x27')][_0x872f('0x41')]);_0x481cb0['query']=_['keys'](_0x2411b5[_0x872f('0x2f')]);_0x481cb0[_0x872f('0x2d')]=_[_0x872f('0x2e')](_0x481cb0[_0x872f('0x2a')],_0x481cb0['query']);_0x419dee[_0x872f('0x30')]=_['intersection'](_0x481cb0[_0x872f('0x2a')],qs['fields'](_0x2411b5[_0x872f('0x2f')][_0x872f('0x31')]));_0x419dee['attributes']=_0x419dee[_0x872f('0x30')][_0x872f('0x32')]?_0x419dee['attributes']:_0x481cb0[_0x872f('0x2a')];if(_0x2411b5['query'][_0x872f('0x3b')]){_0x419dee['include']=[{'all':!![]}];}_0x419dee=_['merge']({},_0x419dee,_0x2411b5[_0x872f('0x42')]);return db[_0x872f('0x27')]['find'](_0x419dee)[_0x872f('0x21')](handleEntityNotFound(_0x10be05,null))[_0x872f('0x21')](respondWithResult(_0x10be05,null))[_0x872f('0x3e')](handleError(_0x10be05,null));};exports[_0x872f('0x43')]=function(_0x74248,_0xd86f13){return db[_0x872f('0x27')]['create'](_0x74248[_0x872f('0x44')],{})['then'](respondWithResult(_0xd86f13,0xc9))['catch'](handleError(_0xd86f13,null));};exports['update']=function(_0x1fde69,_0x55b1f8){if(_0x1fde69[_0x872f('0x44')]['id']){delete _0x1fde69[_0x872f('0x44')]['id'];}return db[_0x872f('0x27')][_0x872f('0x45')]({'where':{'id':_0x1fde69['params']['id']}})[_0x872f('0x21')](handleEntityNotFound(_0x55b1f8,null))[_0x872f('0x21')](saveUpdates(_0x1fde69['body'],null))['then'](respondWithResult(_0x55b1f8,null))['catch'](handleError(_0x55b1f8,null));};exports[_0x872f('0x20')]=function(_0x199609,_0xb7499b){return db['Automation'][_0x872f('0x45')]({'where':{'id':_0x199609['params']['id']}})[_0x872f('0x21')](handleEntityNotFound(_0xb7499b,null))[_0x872f('0x21')](removeEntity(_0xb7499b,null))[_0x872f('0x3e')](handleError(_0xb7499b,null));};exports[_0x872f('0x46')]=function(_0x1b315e,_0x29a307,_0x581b5e){return db[_0x872f('0x47')][_0x872f('0x45')]({'where':{'id':_0x1b315e['params']['id']}})[_0x872f('0x21')](handleEntityNotFound(_0x29a307,null))['then'](function(_0x455a2c){if(_0x455a2c){return _0x455a2c[_0x872f('0x46')](_0x1b315e['body'][_0x872f('0x48')],_['omit'](_0x1b315e[_0x872f('0x44')],[_0x872f('0x48'),'id'])||{});}})[_0x872f('0x21')](respondWithResult(_0x29a307,null))['catch'](handleError(_0x29a307,null));};exports[_0x872f('0x49')]=function(_0x1689f2,_0x4cda97,_0x44d171){var _0x5e199d={};var _0x4140ec={};var _0x3ec269;var _0xaccbf5;return db['Automation'][_0x872f('0x4a')]({'where':{'id':_0x1689f2[_0x872f('0x40')]['id']}})[_0x872f('0x21')](handleEntityNotFound(_0x4cda97,null))[_0x872f('0x21')](function(_0xc42c01){if(_0xc42c01){_0x3ec269=_0xc42c01;_0x4140ec[_0x872f('0x2a')]=_[_0x872f('0x2c')](db['Condition']['rawAttributes']);_0x4140ec['query']=_[_0x872f('0x2c')](_0x1689f2['query']);_0x4140ec[_0x872f('0x2d')]=_[_0x872f('0x2e')](_0x4140ec[_0x872f('0x2a')],_0x4140ec[_0x872f('0x2f')]);_0x5e199d['attributes']=_[_0x872f('0x2e')](_0x4140ec['model'],qs[_0x872f('0x31')](_0x1689f2[_0x872f('0x2f')]['fields']));_0x5e199d['attributes']=_0x5e199d[_0x872f('0x30')][_0x872f('0x32')]?_0x5e199d[_0x872f('0x30')]:_0x4140ec[_0x872f('0x2a')];_0x5e199d[_0x872f('0x4b')]=qs[_0x872f('0x34')](_0x1689f2[_0x872f('0x2f')][_0x872f('0x34')]);_0x5e199d['where']=qs[_0x872f('0x2d')](_[_0x872f('0x36')](_0x1689f2[_0x872f('0x2f')],_0x4140ec['filters']));if(_0x1689f2[_0x872f('0x2f')][_0x872f('0x37')]){_0x5e199d[_0x872f('0x35')]=_[_0x872f('0x38')](_0x5e199d[_0x872f('0x35')],{'$or':_[_0x872f('0x2b')](_0x5e199d[_0x872f('0x30')],function(_0x691949){var _0x474f6c={};_0x474f6c[_0x691949]={'$like':'%'+_0x1689f2[_0x872f('0x2f')][_0x872f('0x37')]+'%'};return _0x474f6c;})});}_0x5e199d=_[_0x872f('0x38')]({},_0x5e199d,_0x1689f2[_0x872f('0x42')]);return _0x3ec269[_0x872f('0x49')](_0x5e199d);}})[_0x872f('0x21')](function(_0x560291){if(_0x560291){_0xaccbf5=_0x560291[_0x872f('0x32')];if(!_0x1689f2[_0x872f('0x2f')][_0x872f('0x33')](_0x872f('0x4c'))){_0x5e199d[_0x872f('0x1b')]=qs['limit'](_0x1689f2['query'][_0x872f('0x1b')]);_0x5e199d[_0x872f('0x1a')]=qs[_0x872f('0x1a')](_0x1689f2['query']['offset']);}return _0x3ec269[_0x872f('0x49')](_0x5e199d);}})[_0x872f('0x21')](function(_0x45ca59){if(_0x45ca59){return _0x45ca59?{'count':_0xaccbf5,'rows':_0x45ca59}:null;}})[_0x872f('0x21')](respondWithResult(_0x4cda97,null))[_0x872f('0x3e')](handleError(_0x4cda97,null));};exports[_0x872f('0x4d')]=function(_0x21e09e,_0x12910c,_0x309c31){return db[_0x872f('0x4e')][_0x872f('0x45')]({'where':{'id':_0x21e09e[_0x872f('0x40')]['id']}})[_0x872f('0x21')](handleEntityNotFound(_0x12910c,null))[_0x872f('0x21')](function(_0x1efb0e){if(_0x1efb0e){return _0x1efb0e[_0x872f('0x4d')](_0x21e09e['body'][_0x872f('0x48')],_[_0x872f('0x4f')](_0x21e09e['body'],[_0x872f('0x48'),'id'])||{});}})['then'](respondWithResult(_0x12910c,null))[_0x872f('0x3e')](handleError(_0x12910c,null));};exports[_0x872f('0x50')]=function(_0x317649,_0x19d90b,_0x39ec0a){var _0x3ac2dd={};var _0x166b20={};var _0x4d247c;var _0x13d5fe;return db[_0x872f('0x27')]['findOne']({'where':{'id':_0x317649[_0x872f('0x40')]['id']}})[_0x872f('0x21')](handleEntityNotFound(_0x19d90b,null))['then'](function(_0x146147){if(_0x146147){_0x4d247c=_0x146147;_0x166b20[_0x872f('0x2a')]=_['keys'](db[_0x872f('0x4e')]['rawAttributes']);_0x166b20[_0x872f('0x2f')]=_[_0x872f('0x2c')](_0x317649['query']);_0x166b20['filters']=_[_0x872f('0x2e')](_0x166b20[_0x872f('0x2a')],_0x166b20[_0x872f('0x2f')]);_0x3ac2dd['attributes']=_[_0x872f('0x2e')](_0x166b20[_0x872f('0x2a')],qs[_0x872f('0x31')](_0x317649['query']['fields']));_0x3ac2dd[_0x872f('0x30')]=_0x3ac2dd[_0x872f('0x30')]['length']?_0x3ac2dd[_0x872f('0x30')]:_0x166b20['model'];_0x3ac2dd['order']=qs['sort'](_0x317649[_0x872f('0x2f')][_0x872f('0x34')]);_0x3ac2dd[_0x872f('0x35')]=qs[_0x872f('0x2d')](_[_0x872f('0x36')](_0x317649[_0x872f('0x2f')],_0x166b20[_0x872f('0x2d')]));if(_0x317649['query']['filter']){_0x3ac2dd[_0x872f('0x35')]=_[_0x872f('0x38')](_0x3ac2dd[_0x872f('0x35')],{'$or':_[_0x872f('0x2b')](_0x3ac2dd[_0x872f('0x30')],function(_0x27acb7){var _0x23371b={};_0x23371b[_0x27acb7]={'$like':'%'+_0x317649[_0x872f('0x2f')]['filter']+'%'};return _0x23371b;})});}_0x3ac2dd=_['merge']({},_0x3ac2dd,_0x317649['options']);return _0x4d247c[_0x872f('0x50')](_0x3ac2dd);}})[_0x872f('0x21')](function(_0x49ee80){if(_0x49ee80){_0x13d5fe=_0x49ee80[_0x872f('0x32')];if(!_0x317649['query']['hasOwnProperty']('nolimit')){_0x3ac2dd[_0x872f('0x1b')]=qs[_0x872f('0x1b')](_0x317649[_0x872f('0x2f')][_0x872f('0x1b')]);_0x3ac2dd[_0x872f('0x1a')]=qs[_0x872f('0x1a')](_0x317649[_0x872f('0x2f')][_0x872f('0x1a')]);}return _0x4d247c[_0x872f('0x50')](_0x3ac2dd);}})[_0x872f('0x21')](function(_0x52dc80){if(_0x52dc80){return _0x52dc80?{'count':_0x13d5fe,'rows':_0x52dc80}:null;}})['then'](respondWithResult(_0x19d90b,null))[_0x872f('0x3e')](handleError(_0x19d90b,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index d5a0e29..50c1488 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 _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
+var _0x425d=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','Automation'];(function(_0x11ec4b,_0x46287c){var _0x58f422=function(_0x2c4c3e){while(--_0x2c4c3e){_0x11ec4b['push'](_0x11ec4b['shift']());}};_0x58f422(++_0x46287c);}(_0x425d,0x1e0));var _0xd425=function(_0x24bfc6,_0x24399d){_0x24bfc6=_0x24bfc6-0x0;var _0x33bdb0=_0x425d[_0x24bfc6];return _0x33bdb0;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var logger=require(_0xd425('0x1'))(_0xd425('0x2'));var moment=require(_0xd425('0x3'));var BPromise=require(_0xd425('0x4'));var rp=require(_0xd425('0x5'));var fs=require('fs');var path=require(_0xd425('0x6'));var rimraf=require(_0xd425('0x7'));var config=require('../../config/environment');var attributes=require(_0xd425('0x8'));module[_0xd425('0x9')]=function(_0xc4e080,_0x36866e){return _0xc4e080[_0xd425('0xa')](_0xd425('0xb'),attributes,{'tableName':'tools_automations','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 f068979..e3c8d16 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 _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
+var _0xe93b=['client','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x28ffe7,_0x37530c){var _0x4dd6ba=function(_0x1c6a6a){while(--_0x1c6a6a){_0x28ffe7['push'](_0x28ffe7['shift']());}};_0x4dd6ba(++_0x37530c);}(_0xe93b,0x1c2));var _0xbe93=function(_0x13e8e1,_0x36032d){_0x13e8e1=_0x13e8e1-0x0;var _0x507f03=_0xe93b[_0x13e8e1];return _0x507f03;};'use strict';var _=require('lodash');var util=require(_0xbe93('0x0'));var moment=require(_0xbe93('0x1'));var BPromise=require(_0xbe93('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe93('0x3'));var db=require(_0xbe93('0x4'))['db'];var utils=require(_0xbe93('0x5'));var logger=require(_0xbe93('0x6'))(_0xbe93('0x7'));var config=require(_0xbe93('0x8'));var jayson=require(_0xbe93('0x9'));var client=jayson[_0xbe93('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d79b4,_0x29bc15,_0x317a09){return new BPromise(function(_0xb5f3bb,_0x3832c0){return client[_0xbe93('0xb')](_0x1d79b4,_0x317a09)[_0xbe93('0xc')](function(_0x3ed10a){logger[_0xbe93('0xd')]('Automation,\x20%s,\x20%s',_0x29bc15,_0xbe93('0xe'));logger[_0xbe93('0xf')](_0xbe93('0x10'),_0x29bc15,_0xbe93('0xe'),JSON[_0xbe93('0x11')](_0x3ed10a));if(_0x3ed10a[_0xbe93('0x12')]){if(_0x3ed10a['error'][_0xbe93('0x13')]===0x1f4){logger[_0xbe93('0x12')](_0xbe93('0x14'),_0x29bc15,_0x3ed10a['error']['message']);return _0x3832c0(_0x3ed10a[_0xbe93('0x12')][_0xbe93('0x15')]);}logger[_0xbe93('0x12')]('Automation,\x20%s,\x20%s',_0x29bc15,_0x3ed10a['error'][_0xbe93('0x15')]);return _0xb5f3bb(_0x3ed10a[_0xbe93('0x12')][_0xbe93('0x15')]);}else{logger[_0xbe93('0xd')](_0xbe93('0x14'),_0x29bc15,_0xbe93('0xe'));_0xb5f3bb(_0x3ed10a['result'][_0xbe93('0x15')]);}})[_0xbe93('0x16')](function(_0x481af3){logger[_0xbe93('0x12')](_0xbe93('0x14'),_0x29bc15,_0x481af3);_0x3832c0(_0x481af3);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 5a36d52..51e05af 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 _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
+var _0x5b2a=['../../config/environment','get','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','update','delete','exports','multer','path','express','../../components/auth/service'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x5b2a,0x150));var _0xa5b2=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0x5b2a[_0x79cd47];return _0x3b9484;};'use strict';var multer=require(_0xa5b2('0x0'));var util=require('util');var path=require(_0xa5b2('0x1'));var timeout=require('connect-timeout');var express=require(_0xa5b2('0x2'));var router=express['Router']();var auth=require(_0xa5b2('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa5b2('0x4'));var controller=require('./automation.controller');router[_0xa5b2('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa5b2('0x5')](_0xa5b2('0x6'),auth[_0xa5b2('0x7')](),controller[_0xa5b2('0x8')]);router[_0xa5b2('0x5')](_0xa5b2('0x9'),auth[_0xa5b2('0x7')](),controller[_0xa5b2('0xa')]);router[_0xa5b2('0x5')](_0xa5b2('0xb'),auth[_0xa5b2('0x7')](),controller[_0xa5b2('0xc')]);router[_0xa5b2('0xd')]('/',auth['isAuthenticated'](),controller[_0xa5b2('0xe')]);router[_0xa5b2('0xd')]('/:id/conditions',auth['isAuthenticated'](),controller[_0xa5b2('0xf')]);router['post']('/:id/actions',auth['isAuthenticated'](),controller[_0xa5b2('0x10')]);router['put']('/:id',auth[_0xa5b2('0x7')](),controller[_0xa5b2('0x11')]);router[_0xa5b2('0x12')](_0xa5b2('0x6'),auth[_0xa5b2('0x7')](),controller['destroy']);module[_0xa5b2('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index e245d24..0691185 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 _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
+var _0x9eb9=['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\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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#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'];(function(_0x24c2c3,_0x31eabf){var _0x6e30ac=function(_0xfbf8f1){while(--_0xfbf8f1){_0x24c2c3['push'](_0x24c2c3['shift']());}};_0x6e30ac(++_0x31eabf);}(_0x9eb9,0x1b8));var _0x99eb=function(_0x47bc89,_0x456e04){_0x47bc89=_0x47bc89-0x0;var _0x25fbe2=_0x9eb9[_0x47bc89];return _0x25fbe2;};'use strict';var Sequelize=require(_0x99eb('0x0'));module[_0x99eb('0x1')]={'name':{'type':Sequelize[_0x99eb('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x99eb('0x3')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x99eb('0x4')],'defaultValue':0x0,'comment':_0x99eb('0x5')},'limitCalls':{'type':Sequelize[_0x99eb('0x6')](0x4)[_0x99eb('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x99eb('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x99eb('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x99eb('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x99eb('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x99eb('0x6')](0x5)[_0x99eb('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x99eb('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x99eb('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x99eb('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x99eb('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x99eb('0x6')](0x5)[_0x99eb('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x99eb('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x99eb('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x99eb('0xd')},'dialTimezone':{'type':Sequelize[_0x99eb('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x99eb('0x2')],'defaultValue':_0x99eb('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x99eb('0x3')](_0x99eb('0xf'),_0x99eb('0x10'),_0x99eb('0x11')),'defaultValue':_0x99eb('0xf')},'dialAMDActive':{'type':Sequelize[_0x99eb('0x4')],'defaultValue':0x0,'comment':_0x99eb('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x99eb('0x6')](0x9)[_0x99eb('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x99eb('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x99eb('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x99eb('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x99eb('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x99eb('0x6')](0x9)[_0x99eb('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x99eb('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x99eb('0x6')](0x9)[_0x99eb('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x99eb('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x99eb('0x6')](0x9)[_0x99eb('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x99eb('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x99eb('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x99eb('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x99eb('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x99eb('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x99eb('0x6')](0x9)[_0x99eb('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x99eb('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x99eb('0x3')]('DESC',_0x99eb('0x1b')),'defaultValue':_0x99eb('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x99eb('0x6')](0x3)[_0x99eb('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x99eb('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x99eb('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x99eb('0x6')](0x3)[_0x99eb('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x99eb('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x99eb('0x6')](0x5)[_0x99eb('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x99eb('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x99eb('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x99eb('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x99eb('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x99eb('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x99eb('0x6')](0x3)[_0x99eb('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x99eb('0x6')](0x5)[_0x99eb('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x99eb('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x99eb('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x99eb('0x6')](0x5)[_0x99eb('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x99eb('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x99eb('0x6')](0x3)[_0x99eb('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x99eb('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x99eb('0x6')](0x5)[_0x99eb('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x99eb('0x26')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 72e87e0..7e99357 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 _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
+var _0x0625=['getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','from','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','into','deletedAt\x20IS\x20NULL','push','all','removeLists','CmHopper','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','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','sendStatus','status','end','json','apply','reject','save','then','destroy','IvrCampaigns','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','limit','offset','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','Campaign','findAll','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','update','getHoppers','findOne','nolimit','CmHopperHistory','order','rows','CmHopperFinal','CampaignId','CmHopperBlack'];(function(_0x25e7cb,_0x1326df){var _0x4ac0f3=function(_0x4b1679){while(--_0x4b1679){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x4ac0f3(++_0x1326df);}(_0x0625,0xb2));var _0x5062=function(_0xd11615,_0xecd492){_0xd11615=_0xd11615-0x0;var _0x18a16c=_0x0625[_0xd11615];return _0x18a16c;};'use strict';var pdf=require(_0x5062('0x0'));var emlformat=require(_0x5062('0x1'));var rimraf=require(_0x5062('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5062('0x3'));var rp=require(_0x5062('0x4'));var moment=require(_0x5062('0x5'));var BPromise=require(_0x5062('0x6'));var Mustache=require(_0x5062('0x7'));var util=require(_0x5062('0x8'));var path=require(_0x5062('0x9'));var sox=require(_0x5062('0xa'));var csv=require('to-csv');var ejs=require(_0x5062('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5062('0xc'));var crypto=require(_0x5062('0xd'));var jsforce=require(_0x5062('0xe'));var deskjs=require(_0x5062('0xf'));var toCsv=require(_0x5062('0x10'));var querystring=require(_0x5062('0x11'));var Papa=require(_0x5062('0x12'));var Redis=require(_0x5062('0x13'));var authService=require(_0x5062('0x14'));var qs=require(_0x5062('0x15'));var as=require(_0x5062('0x16'));var hardwareService=require(_0x5062('0x17'));var logger=require(_0x5062('0x18'))(_0x5062('0x19'));var utils=require(_0x5062('0x1a'));var config=require(_0x5062('0x1b'));var db=require(_0x5062('0x1c'))['db'];function respondWithStatusCode(_0x53fb27,_0x998383){_0x998383=_0x998383||0xcc;return function(_0x439cb6){if(_0x439cb6){return _0x53fb27[_0x5062('0x1d')](_0x998383);}return _0x53fb27[_0x5062('0x1e')](_0x998383)[_0x5062('0x1f')]();};}function respondWithResult(_0x29113c,_0x427b08){_0x427b08=_0x427b08||0xc8;return function(_0x2a44d4){if(_0x2a44d4){return _0x29113c[_0x5062('0x1e')](_0x427b08)[_0x5062('0x20')](_0x2a44d4);}};}function respondWithFilteredResult(_0x25cf9a,_0xce925e){return function(_0x1693ea){if(_0x1693ea){var _0x5847f1=_0x1693ea['count'],_0x40da23=_0xce925e['offset'],_0x2f15f8=_0xce925e['offset']+_0xce925e['limit'],_0x2e110d;if(_0x2f15f8>=_0x5847f1){_0x2f15f8=_0x5847f1;_0x2e110d=0xc8;}else{_0x2e110d=0xce;}_0x25cf9a[_0x5062('0x1e')](_0x2e110d);return _0x25cf9a['set']('Content-Range',_0x40da23+'-'+_0x2f15f8+'/'+_0x5847f1)[_0x5062('0x20')](_0x1693ea);}return null;};}function patchUpdates(_0x234050){return function(_0x15f61e){try{jsonpatch[_0x5062('0x21')](_0x15f61e,_0x234050,!![]);}catch(_0x5f392e){return BPromise[_0x5062('0x22')](_0x5f392e);}return _0x15f61e[_0x5062('0x23')]();};}function saveUpdates(_0x40c662,_0x174b8c){return function(_0x4e4ae0){if(_0x4e4ae0){return _0x4e4ae0['update'](_0x40c662)[_0x5062('0x24')](function(_0x2b01a7){return _0x2b01a7;});}return null;};}function removeEntity(_0x513a03,_0x82a8b2){return function(_0x2d29ba){if(_0x2d29ba){return _0x2d29ba[_0x5062('0x25')]()[_0x5062('0x24')](function(){var _0x12a431=_0x2d29ba['get']({'plain':!![]});var _0x53995a=_0x5062('0x26');return db[_0x5062('0x27')][_0x5062('0x25')]({'where':{'type':_0x53995a,'resourceId':_0x12a431['id']}})[_0x5062('0x24')](function(){return _0x2d29ba;});})[_0x5062('0x24')](function(){_0x513a03[_0x5062('0x1e')](0xcc)[_0x5062('0x1f')]();});}};}function handleEntityNotFound(_0x13d572,_0xc56d9f){return function(_0x3c6a7c){if(!_0x3c6a7c){_0x13d572[_0x5062('0x1d')](0x194);}return _0x3c6a7c;};}function handleError(_0x2cd4af,_0xf2a0bb){_0xf2a0bb=_0xf2a0bb||0x1f4;return function(_0xe05baa){logger[_0x5062('0x28')](_0xe05baa[_0x5062('0x29')]);if(_0xe05baa[_0x5062('0x2a')]){delete _0xe05baa[_0x5062('0x2a')];}_0x2cd4af[_0x5062('0x1e')](_0xf2a0bb)[_0x5062('0x2b')](_0xe05baa);};}exports[_0x5062('0x2c')]=function(_0x4ab8a1,_0x206af9){var _0x2fd862={},_0x1bfa97={},_0x1c70e4={'count':0x0,'rows':[]};var _0x10f655=_['map'](db['Campaign'][_0x5062('0x2d')],function(_0x3893c9){return{'name':_0x3893c9[_0x5062('0x2e')],'type':_0x3893c9[_0x5062('0x2f')][_0x5062('0x30')]};});_0x1bfa97[_0x5062('0x31')]=_[_0x5062('0x32')](_0x10f655,_0x5062('0x2a'));_0x1bfa97[_0x5062('0x33')]=_[_0x5062('0x34')](_0x4ab8a1['query']);_0x1bfa97['filters']=_[_0x5062('0x35')](_0x1bfa97['model'],_0x1bfa97[_0x5062('0x33')]);_0x2fd862['attributes']=_[_0x5062('0x35')](_0x1bfa97[_0x5062('0x31')],qs[_0x5062('0x36')](_0x4ab8a1['query'][_0x5062('0x36')]));_0x2fd862[_0x5062('0x37')]=_0x2fd862[_0x5062('0x37')][_0x5062('0x38')]?_0x2fd862[_0x5062('0x37')]:_0x1bfa97[_0x5062('0x31')];if(!_0x4ab8a1['query'][_0x5062('0x39')]('nolimit')){_0x2fd862[_0x5062('0x3a')]=qs['limit'](_0x4ab8a1[_0x5062('0x33')][_0x5062('0x3a')]);_0x2fd862[_0x5062('0x3b')]=qs[_0x5062('0x3b')](_0x4ab8a1[_0x5062('0x33')][_0x5062('0x3b')]);}_0x2fd862['order']=qs[_0x5062('0x3c')](_0x4ab8a1[_0x5062('0x33')][_0x5062('0x3c')]);_0x2fd862[_0x5062('0x3d')]=qs[_0x5062('0x3e')](_[_0x5062('0x3f')](_0x4ab8a1[_0x5062('0x33')],_0x1bfa97['filters']),_0x10f655);if(_0x4ab8a1[_0x5062('0x33')][_0x5062('0x40')]){_0x2fd862[_0x5062('0x3d')]=_[_0x5062('0x41')](_0x2fd862[_0x5062('0x3d')],{'$or':_[_0x5062('0x32')](_0x10f655,function(_0x2f27ac){if(_0x2f27ac['type']!==_0x5062('0x42')){var _0xabc82b={};_0xabc82b[_0x2f27ac[_0x5062('0x2a')]]={'$like':'%'+_0x4ab8a1[_0x5062('0x33')][_0x5062('0x40')]+'%'};return _0xabc82b;}})});}_0x2fd862=_[_0x5062('0x41')]({},_0x2fd862,_0x4ab8a1[_0x5062('0x43')]);var _0xc9bea9={'where':_0x2fd862['where']};return db['Campaign'][_0x5062('0x44')](_0xc9bea9)[_0x5062('0x24')](function(_0x45b815){_0x1c70e4[_0x5062('0x44')]=_0x45b815;if(_0x4ab8a1[_0x5062('0x33')][_0x5062('0x45')]){_0x2fd862[_0x5062('0x46')]=[{'all':!![]}];}return db[_0x5062('0x47')][_0x5062('0x48')](_0x2fd862);})[_0x5062('0x24')](function(_0x273cb6){_0x1c70e4['rows']=_0x273cb6;return _0x1c70e4;})['then'](respondWithFilteredResult(_0x206af9,_0x2fd862))[_0x5062('0x49')](handleError(_0x206af9,null));};exports['show']=function(_0xaa1cc4,_0x12dab2){var _0x377d36={'raw':![],'where':{'id':_0xaa1cc4[_0x5062('0x4a')]['id']}},_0x2e453e={};_0x2e453e[_0x5062('0x31')]=_[_0x5062('0x34')](db[_0x5062('0x47')][_0x5062('0x2d')]);_0x2e453e['query']=_['keys'](_0xaa1cc4[_0x5062('0x33')]);_0x2e453e['filters']=_[_0x5062('0x35')](_0x2e453e['model'],_0x2e453e[_0x5062('0x33')]);_0x377d36[_0x5062('0x37')]=_[_0x5062('0x35')](_0x2e453e[_0x5062('0x31')],qs[_0x5062('0x36')](_0xaa1cc4['query']['fields']));_0x377d36[_0x5062('0x37')]=_0x377d36[_0x5062('0x37')][_0x5062('0x38')]?_0x377d36[_0x5062('0x37')]:_0x2e453e[_0x5062('0x31')];if(_0xaa1cc4[_0x5062('0x33')]['includeAll']){_0x377d36['include']=[{'all':!![]}];}_0x377d36=_[_0x5062('0x41')]({},_0x377d36,_0xaa1cc4[_0x5062('0x43')]);return db[_0x5062('0x47')][_0x5062('0x4b')](_0x377d36)['then'](handleEntityNotFound(_0x12dab2,null))[_0x5062('0x24')](respondWithResult(_0x12dab2,null))[_0x5062('0x49')](handleError(_0x12dab2,null));};exports[_0x5062('0x4c')]=function(_0x3203d4,_0x1320fa){return db['Campaign']['create'](_0x3203d4[_0x5062('0x4d')],{})[_0x5062('0x24')](function(_0x217084){var _0x241b9a=_0x3203d4[_0x5062('0x4e')][_0x5062('0x4f')]({'plain':!![]});if(!_0x241b9a)throw new Error(_0x5062('0x50'));if(_0x241b9a[_0x5062('0x51')]===_0x5062('0x4e')){var _0xcb56a6=_0x217084[_0x5062('0x4f')]({'plain':!![]});var _0x4498a7=_0x5062('0x26');return db[_0x5062('0x52')]['find']({'where':{'name':_0x4498a7,'userProfileId':_0x241b9a[_0x5062('0x53')]},'raw':!![]})[_0x5062('0x24')](function(_0x2cc890){if(_0x2cc890&&_0x2cc890[_0x5062('0x54')]===0x0){return db['UserProfileResource'][_0x5062('0x4c')]({'name':_0xcb56a6[_0x5062('0x2a')],'resourceId':_0xcb56a6['id'],'type':_0x2cc890['name'],'sectionId':_0x2cc890['id']},{})[_0x5062('0x24')](function(){return _0x217084;});}else{return _0x217084;}})[_0x5062('0x49')](function(_0x3a1172){logger[_0x5062('0x28')](_0x5062('0x55'),_0x3a1172);throw _0x3a1172;});}return _0x217084;})[_0x5062('0x24')](respondWithResult(_0x1320fa,0xc9))[_0x5062('0x49')](handleError(_0x1320fa,null));};exports[_0x5062('0x56')]=function(_0x15f69e,_0x4bf9ce){var _0x2eb92c={'where':{'id':_0x15f69e['params']['id']}},_0x347914={};_0x347914[_0x5062('0x31')]=_[_0x5062('0x34')](db[_0x5062('0x47')][_0x5062('0x2d')]);_0x2eb92c[_0x5062('0x37')]=_['intersection'](_0x347914['model'],qs['fields'](_0x15f69e[_0x5062('0x33')]['fields']));_0x2eb92c[_0x5062('0x37')]=_0x2eb92c[_0x5062('0x37')]['length']?_0x2eb92c[_0x5062('0x37')]:_0x347914[_0x5062('0x31')];if(_0x15f69e[_0x5062('0x33')]['includeAll']){_0x2eb92c[_0x5062('0x46')]=[{'all':!![]}];}_0x2eb92c=_[_0x5062('0x41')]({},_0x2eb92c,_0x15f69e[_0x5062('0x43')]);return db['Campaign'][_0x5062('0x4b')](_0x2eb92c)[_0x5062('0x24')](handleEntityNotFound(_0x4bf9ce,null))[_0x5062('0x24')](function(_0x4a7068){if(_0x4a7068){var _0x3f5300=_0x4a7068[_0x5062('0x4f')]({'plain':!![]});_0x3f5300=qs[_0x5062('0x57')](_0x3f5300,['id',_0x5062('0x58'),_0x5062('0x59')]);_0x15f69e[_0x5062('0x4d')]=_[_0x5062('0x57')](_0x15f69e['body'],['id',_0x5062('0x58'),_0x5062('0x59')]);return db[_0x5062('0x47')][_0x5062('0x4c')](_[_0x5062('0x41')](_0x3f5300,_0x15f69e[_0x5062('0x4d')]),{'include':_0x15f69e['query'][_0x5062('0x45')]?[{'all':!![]}]:undefined})['then'](function(_0x351132){var _0x43512a=_0x15f69e[_0x5062('0x4e')][_0x5062('0x4f')]({'plain':!![]});if(!_0x43512a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x43512a[_0x5062('0x51')]==='user'){var _0x479754=_0x351132[_0x5062('0x4f')]({'plain':!![]});var _0x1d89df=_0x5062('0x26');return db[_0x5062('0x52')][_0x5062('0x4b')]({'where':{'name':_0x1d89df,'userProfileId':_0x43512a['userProfileId']},'raw':!![]})[_0x5062('0x24')](function(_0x560680){if(_0x560680&&_0x560680[_0x5062('0x54')]===0x0){return db[_0x5062('0x27')][_0x5062('0x4c')]({'name':_0x479754[_0x5062('0x2a')],'resourceId':_0x479754['id'],'type':_0x560680[_0x5062('0x2a')],'sectionId':_0x560680['id']},{})[_0x5062('0x24')](function(){return _0x351132;});}else{return _0x351132;}})['catch'](function(_0x41982f){logger[_0x5062('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41982f);throw _0x41982f;});}return _0x351132;});}})['then'](respondWithResult(_0x4bf9ce,0xc9))[_0x5062('0x49')](handleError(_0x4bf9ce,null));};exports[_0x5062('0x5a')]=function(_0x2df61f,_0x5dace8){if(_0x2df61f[_0x5062('0x4d')]['id']){delete _0x2df61f[_0x5062('0x4d')]['id'];}return db[_0x5062('0x47')][_0x5062('0x4b')]({'where':{'id':_0x2df61f[_0x5062('0x4a')]['id']}})[_0x5062('0x24')](handleEntityNotFound(_0x5dace8,null))[_0x5062('0x24')](saveUpdates(_0x2df61f[_0x5062('0x4d')],null))['then'](respondWithResult(_0x5dace8,null))['catch'](handleError(_0x5dace8,null));};exports[_0x5062('0x25')]=function(_0x3f10c8,_0x45bff6){return db['Campaign']['find']({'where':{'id':_0x3f10c8['params']['id']}})[_0x5062('0x24')](handleEntityNotFound(_0x45bff6,null))[_0x5062('0x24')](removeEntity(_0x45bff6,null))['catch'](handleError(_0x45bff6,null));};exports[_0x5062('0x5b')]=function(_0x1e5aff,_0x2dd265,_0x237386){var _0x198ac8={'raw':!![],'where':{}};var _0x5a9b58={};var _0x58805f={'count':0x0,'rows':[]};return db[_0x5062('0x47')][_0x5062('0x5c')]({'where':{'id':_0x1e5aff['params']['id']}})[_0x5062('0x24')](handleEntityNotFound(_0x2dd265,null))[_0x5062('0x24')](function(_0x16bfdc){if(_0x16bfdc){_0x5a9b58[_0x5062('0x31')]=_[_0x5062('0x34')](db['CmHopper'][_0x5062('0x2d')]);_0x5a9b58['query']=_[_0x5062('0x34')](_0x1e5aff[_0x5062('0x33')]);_0x5a9b58['filters']=_['intersection'](_0x5a9b58[_0x5062('0x31')],_0x5a9b58[_0x5062('0x33')]);_0x198ac8['attributes']=_[_0x5062('0x35')](_0x5a9b58[_0x5062('0x31')],qs['fields'](_0x1e5aff[_0x5062('0x33')][_0x5062('0x36')]));_0x198ac8['attributes']=_0x198ac8[_0x5062('0x37')][_0x5062('0x38')]?_0x198ac8[_0x5062('0x37')]:_0x5a9b58[_0x5062('0x31')];if(!_0x1e5aff[_0x5062('0x33')][_0x5062('0x39')](_0x5062('0x5d'))){_0x198ac8[_0x5062('0x3a')]=qs[_0x5062('0x3a')](_0x1e5aff[_0x5062('0x33')][_0x5062('0x3a')]);_0x198ac8[_0x5062('0x3b')]=qs['offset'](_0x1e5aff[_0x5062('0x33')][_0x5062('0x3b')]);}_0x198ac8['order']=qs[_0x5062('0x3c')](_0x1e5aff[_0x5062('0x33')]['sort']);_0x198ac8[_0x5062('0x3d')]=qs['filters'](_['pick'](_0x1e5aff[_0x5062('0x33')],_0x5a9b58[_0x5062('0x3e')]));_0x198ac8[_0x5062('0x3d')]['CampaignId']=_0x16bfdc['id'];if(_0x1e5aff['query'][_0x5062('0x40')]){_0x198ac8[_0x5062('0x3d')]=_[_0x5062('0x41')](_0x198ac8[_0x5062('0x3d')],{'$or':_[_0x5062('0x32')](_0x198ac8[_0x5062('0x37')],function(_0x109d9d){var _0x352c11={};_0x352c11[_0x109d9d]={'$like':'%'+_0x1e5aff[_0x5062('0x33')][_0x5062('0x40')]+'%'};return _0x352c11;})});}_0x198ac8=_['merge']({},_0x198ac8,_0x1e5aff['options']);return db['CmHopper'][_0x5062('0x44')]({'where':_0x198ac8[_0x5062('0x3d')]})['then'](function(_0x14d2f1){_0x58805f[_0x5062('0x44')]=_0x14d2f1;if(_0x1e5aff[_0x5062('0x33')][_0x5062('0x45')]){_0x198ac8[_0x5062('0x46')]=[{'all':!![]}];}return db['CmHopper'][_0x5062('0x48')](_0x198ac8);})['then'](function(_0xfbb902){_0x58805f['rows']=_0xfbb902;return _0x58805f;});}})[_0x5062('0x24')](respondWithFilteredResult(_0x2dd265,_0x198ac8))[_0x5062('0x49')](handleError(_0x2dd265,null));};exports['getHopperHistories']=function(_0x123e4d,_0x3d52b5,_0x3a8bba){var _0x2b9788={'raw':!![],'where':{}};var _0x5c0f63={};var _0x37d150={'count':0x0,'rows':[]};return db[_0x5062('0x47')][_0x5062('0x5c')]({'where':{'id':_0x123e4d['params']['id']}})[_0x5062('0x24')](handleEntityNotFound(_0x3d52b5,null))[_0x5062('0x24')](function(_0x45b935){if(_0x45b935){_0x5c0f63[_0x5062('0x31')]=_['keys'](db[_0x5062('0x5e')][_0x5062('0x2d')]);_0x5c0f63[_0x5062('0x33')]=_[_0x5062('0x34')](_0x123e4d['query']);_0x5c0f63[_0x5062('0x3e')]=_[_0x5062('0x35')](_0x5c0f63[_0x5062('0x31')],_0x5c0f63['query']);_0x2b9788[_0x5062('0x37')]=_[_0x5062('0x35')](_0x5c0f63[_0x5062('0x31')],qs[_0x5062('0x36')](_0x123e4d[_0x5062('0x33')]['fields']));_0x2b9788['attributes']=_0x2b9788['attributes'][_0x5062('0x38')]?_0x2b9788['attributes']:_0x5c0f63[_0x5062('0x31')];if(!_0x123e4d[_0x5062('0x33')]['hasOwnProperty']('nolimit')){_0x2b9788[_0x5062('0x3a')]=qs['limit'](_0x123e4d['query'][_0x5062('0x3a')]);_0x2b9788[_0x5062('0x3b')]=qs[_0x5062('0x3b')](_0x123e4d['query']['offset']);}_0x2b9788[_0x5062('0x5f')]=qs[_0x5062('0x3c')](_0x123e4d[_0x5062('0x33')]['sort']);_0x2b9788[_0x5062('0x3d')]=qs[_0x5062('0x3e')](_['pick'](_0x123e4d[_0x5062('0x33')],_0x5c0f63[_0x5062('0x3e')]));_0x2b9788[_0x5062('0x3d')]['CampaignId']=_0x45b935['id'];if(_0x123e4d['query'][_0x5062('0x40')]){_0x2b9788['where']=_['merge'](_0x2b9788[_0x5062('0x3d')],{'$or':_[_0x5062('0x32')](_0x2b9788[_0x5062('0x37')],function(_0x3f9eee){var _0x8394b6={};_0x8394b6[_0x3f9eee]={'$like':'%'+_0x123e4d['query'][_0x5062('0x40')]+'%'};return _0x8394b6;})});}_0x2b9788=_[_0x5062('0x41')]({},_0x2b9788,_0x123e4d[_0x5062('0x43')]);return db[_0x5062('0x5e')][_0x5062('0x44')]({'where':_0x2b9788[_0x5062('0x3d')]})[_0x5062('0x24')](function(_0x19441b){_0x37d150[_0x5062('0x44')]=_0x19441b;if(_0x123e4d['query'][_0x5062('0x45')]){_0x2b9788[_0x5062('0x46')]=[{'all':!![]}];}return db[_0x5062('0x5e')][_0x5062('0x48')](_0x2b9788);})[_0x5062('0x24')](function(_0x2e4dfd){_0x37d150[_0x5062('0x60')]=_0x2e4dfd;return _0x37d150;});}})[_0x5062('0x24')](respondWithFilteredResult(_0x3d52b5,_0x2b9788))['catch'](handleError(_0x3d52b5,null));};exports['getHopperFinals']=function(_0x5a5f0b,_0x1bffdd,_0x1d01b2){var _0x545e65={'raw':!![],'where':{}};var _0xf42a6f={};var _0x139504={'count':0x0,'rows':[]};return db['Campaign'][_0x5062('0x5c')]({'where':{'id':_0x5a5f0b['params']['id']}})['then'](handleEntityNotFound(_0x1bffdd,null))[_0x5062('0x24')](function(_0x347da0){if(_0x347da0){_0xf42a6f[_0x5062('0x31')]=_[_0x5062('0x34')](db[_0x5062('0x61')]['rawAttributes']);_0xf42a6f[_0x5062('0x33')]=_[_0x5062('0x34')](_0x5a5f0b[_0x5062('0x33')]);_0xf42a6f[_0x5062('0x3e')]=_[_0x5062('0x35')](_0xf42a6f[_0x5062('0x31')],_0xf42a6f[_0x5062('0x33')]);_0x545e65['attributes']=_[_0x5062('0x35')](_0xf42a6f[_0x5062('0x31')],qs['fields'](_0x5a5f0b[_0x5062('0x33')][_0x5062('0x36')]));_0x545e65[_0x5062('0x37')]=_0x545e65[_0x5062('0x37')]['length']?_0x545e65[_0x5062('0x37')]:_0xf42a6f['model'];if(!_0x5a5f0b['query'][_0x5062('0x39')](_0x5062('0x5d'))){_0x545e65[_0x5062('0x3a')]=qs[_0x5062('0x3a')](_0x5a5f0b[_0x5062('0x33')][_0x5062('0x3a')]);_0x545e65[_0x5062('0x3b')]=qs[_0x5062('0x3b')](_0x5a5f0b['query'][_0x5062('0x3b')]);}_0x545e65[_0x5062('0x5f')]=qs[_0x5062('0x3c')](_0x5a5f0b[_0x5062('0x33')]['sort']);_0x545e65[_0x5062('0x3d')]=qs['filters'](_[_0x5062('0x3f')](_0x5a5f0b[_0x5062('0x33')],_0xf42a6f[_0x5062('0x3e')]));_0x545e65[_0x5062('0x3d')][_0x5062('0x62')]=_0x347da0['id'];if(_0x5a5f0b['query'][_0x5062('0x40')]){_0x545e65[_0x5062('0x3d')]=_[_0x5062('0x41')](_0x545e65[_0x5062('0x3d')],{'$or':_[_0x5062('0x32')](_0x545e65[_0x5062('0x37')],function(_0x2a7208){var _0x44cc56={};_0x44cc56[_0x2a7208]={'$like':'%'+_0x5a5f0b['query'][_0x5062('0x40')]+'%'};return _0x44cc56;})});}_0x545e65=_[_0x5062('0x41')]({},_0x545e65,_0x5a5f0b['options']);return db[_0x5062('0x61')]['count']({'where':_0x545e65[_0x5062('0x3d')]})['then'](function(_0x3b9a7a){_0x139504['count']=_0x3b9a7a;if(_0x5a5f0b[_0x5062('0x33')]['includeAll']){_0x545e65[_0x5062('0x46')]=[{'all':!![]}];}return db[_0x5062('0x61')][_0x5062('0x48')](_0x545e65);})['then'](function(_0x166b29){_0x139504[_0x5062('0x60')]=_0x166b29;return _0x139504;});}})[_0x5062('0x24')](respondWithFilteredResult(_0x1bffdd,_0x545e65))[_0x5062('0x49')](handleError(_0x1bffdd,null));};exports['getHopperBlacks']=function(_0x1d6b06,_0x210000,_0x51ba76){var _0x6422a0={'raw':!![],'where':{}};var _0x4e2c42={};var _0x47378a={'count':0x0,'rows':[]};return db[_0x5062('0x47')][_0x5062('0x5c')]({'where':{'id':_0x1d6b06[_0x5062('0x4a')]['id']}})[_0x5062('0x24')](handleEntityNotFound(_0x210000,null))['then'](function(_0x3c18e7){if(_0x3c18e7){_0x4e2c42[_0x5062('0x31')]=_[_0x5062('0x34')](db['CmHopperBlack']['rawAttributes']);_0x4e2c42[_0x5062('0x33')]=_[_0x5062('0x34')](_0x1d6b06[_0x5062('0x33')]);_0x4e2c42[_0x5062('0x3e')]=_['intersection'](_0x4e2c42['model'],_0x4e2c42['query']);_0x6422a0[_0x5062('0x37')]=_[_0x5062('0x35')](_0x4e2c42[_0x5062('0x31')],qs[_0x5062('0x36')](_0x1d6b06[_0x5062('0x33')][_0x5062('0x36')]));_0x6422a0[_0x5062('0x37')]=_0x6422a0['attributes'][_0x5062('0x38')]?_0x6422a0['attributes']:_0x4e2c42[_0x5062('0x31')];if(!_0x1d6b06['query']['hasOwnProperty'](_0x5062('0x5d'))){_0x6422a0[_0x5062('0x3a')]=qs[_0x5062('0x3a')](_0x1d6b06[_0x5062('0x33')][_0x5062('0x3a')]);_0x6422a0[_0x5062('0x3b')]=qs[_0x5062('0x3b')](_0x1d6b06[_0x5062('0x33')]['offset']);}_0x6422a0[_0x5062('0x5f')]=qs[_0x5062('0x3c')](_0x1d6b06['query'][_0x5062('0x3c')]);_0x6422a0[_0x5062('0x3d')]=qs[_0x5062('0x3e')](_[_0x5062('0x3f')](_0x1d6b06[_0x5062('0x33')],_0x4e2c42[_0x5062('0x3e')]));_0x6422a0[_0x5062('0x3d')]['CampaignId']=_0x3c18e7['id'];if(_0x1d6b06[_0x5062('0x33')]['filter']){_0x6422a0[_0x5062('0x3d')]=_[_0x5062('0x41')](_0x6422a0[_0x5062('0x3d')],{'$or':_[_0x5062('0x32')](_0x6422a0[_0x5062('0x37')],function(_0x3b8c23){var _0x4f413e={};_0x4f413e[_0x3b8c23]={'$like':'%'+_0x1d6b06['query'][_0x5062('0x40')]+'%'};return _0x4f413e;})});}_0x6422a0=_['merge']({},_0x6422a0,_0x1d6b06[_0x5062('0x43')]);return db[_0x5062('0x63')]['count']({'where':_0x6422a0[_0x5062('0x3d')]})[_0x5062('0x24')](function(_0x794d42){_0x47378a[_0x5062('0x44')]=_0x794d42;if(_0x1d6b06[_0x5062('0x33')]['includeAll']){_0x6422a0[_0x5062('0x46')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x6422a0);})[_0x5062('0x24')](function(_0x1a5d40){_0x47378a[_0x5062('0x60')]=_0x1a5d40;return _0x47378a;});}})[_0x5062('0x24')](respondWithFilteredResult(_0x210000,_0x6422a0))[_0x5062('0x49')](handleError(_0x210000,null));};exports[_0x5062('0x64')]=function(_0x2ea113,_0x372761,_0xa06aec){var _0x24bd1d={};var _0x204ae3={};var _0x494eab;var _0x380c3c;return db[_0x5062('0x47')][_0x5062('0x5c')]({'where':{'id':_0x2ea113['params']['id']}})[_0x5062('0x24')](handleEntityNotFound(_0x372761,null))[_0x5062('0x24')](function(_0x1cdb94){if(_0x1cdb94){_0x494eab=_0x1cdb94;_0x204ae3[_0x5062('0x31')]=_[_0x5062('0x34')](db[_0x5062('0x65')]['rawAttributes']);_0x204ae3[_0x5062('0x33')]=_['keys'](_0x2ea113['query']);_0x204ae3[_0x5062('0x3e')]=_['intersection'](_0x204ae3['model'],_0x204ae3[_0x5062('0x33')]);_0x24bd1d[_0x5062('0x37')]=_[_0x5062('0x35')](_0x204ae3['model'],qs[_0x5062('0x36')](_0x2ea113['query'][_0x5062('0x36')]));_0x24bd1d[_0x5062('0x37')]=_0x24bd1d[_0x5062('0x37')][_0x5062('0x38')]?_0x24bd1d[_0x5062('0x37')]:_0x204ae3[_0x5062('0x31')];_0x24bd1d[_0x5062('0x5f')]=qs[_0x5062('0x3c')](_0x2ea113[_0x5062('0x33')][_0x5062('0x3c')]);_0x24bd1d[_0x5062('0x3d')]=qs[_0x5062('0x3e')](_[_0x5062('0x3f')](_0x2ea113[_0x5062('0x33')],_0x204ae3[_0x5062('0x3e')]));if(_0x2ea113[_0x5062('0x33')][_0x5062('0x40')]){_0x24bd1d['where']=_[_0x5062('0x41')](_0x24bd1d[_0x5062('0x3d')],{'$or':_['map'](_0x24bd1d[_0x5062('0x37')],function(_0x4a0dc5){var _0x36b222={};_0x36b222[_0x4a0dc5]={'$like':'%'+_0x2ea113[_0x5062('0x33')]['filter']+'%'};return _0x36b222;})});}_0x24bd1d=_['merge']({},_0x24bd1d,_0x2ea113[_0x5062('0x43')]);return _0x494eab[_0x5062('0x64')](_0x24bd1d);}})[_0x5062('0x24')](function(_0x5b11d2){if(_0x5b11d2){_0x380c3c=_0x5b11d2['length'];if(!_0x2ea113['query']['hasOwnProperty'](_0x5062('0x5d'))){_0x24bd1d[_0x5062('0x3a')]=qs[_0x5062('0x3a')](_0x2ea113[_0x5062('0x33')][_0x5062('0x3a')]);_0x24bd1d[_0x5062('0x3b')]=qs[_0x5062('0x3b')](_0x2ea113[_0x5062('0x33')][_0x5062('0x3b')]);}return _0x494eab[_0x5062('0x64')](_0x24bd1d);}})[_0x5062('0x24')](function(_0x417054){if(_0x417054){return _0x417054?{'count':_0x380c3c,'rows':_0x417054}:null;}})['then'](respondWithResult(_0x372761,null))['catch'](handleError(_0x372761,null));};exports[_0x5062('0x66')]=function(_0x2b1762,_0x4ef0f0,_0x12e077){var _0x1de03d,_0x32576b;return db['Campaign']['find']({'where':{'id':_0x2b1762[_0x5062('0x4a')]['id']}})[_0x5062('0x24')](handleEntityNotFound(_0x4ef0f0,null))[_0x5062('0x24')](function(_0x1e60ca){if(_0x1e60ca){_0x32576b=_0x1e60ca;return _0x1e60ca[_0x5062('0x66')](_0x2b1762[_0x5062('0x4d')][_0x5062('0x67')],_[_0x5062('0x57')](_0x2b1762[_0x5062('0x4d')],[_0x5062('0x67'),'id'])||{});}return null;})[_0x5062('0x68')](function(_0x3bee7b){var _0x185368;_0x1de03d=_0x3bee7b||[];var _0x31bcac=[];if(_0x3bee7b){for(var _0x4fd833=0x0;_0x4fd833<_0x3bee7b['length'];_0x4fd833+=0x1){var _0xf8903e=_0x3bee7b[_0x4fd833][_0x5062('0x4f')]({'plain':!![]});_0x32576b[_0x5062('0x69')]=_0x2b1762[_0x5062('0x4d')][_0x5062('0x69')]?_0x2b1762['body'][_0x5062('0x69')]:_0x32576b['dialCheckDuplicateType'];switch(_0x32576b[_0x5062('0x69')]){case _0x5062('0x6a'):_0x185368=squel[_0x5062('0x6b')]()['into'](_0x5062('0x6c'))[_0x5062('0x6d')]([_0x5062('0x6e'),_0x5062('0x6f'),_0x5062('0x70'),_0x5062('0x71'),_0x5062('0x62'),'createdAt',_0x5062('0x59')],squel[_0x5062('0x72')]()[_0x5062('0x73')](_0x5062('0x6e'),_0x5062('0x6e'))[_0x5062('0x73')](_0x5062('0x74'),'scheduledAt')[_0x5062('0x73')]('id',_0x5062('0x70'))[_0x5062('0x73')](_0xf8903e['CmListId']['toString'](),'ListId')[_0x5062('0x73')](_0x2b1762[_0x5062('0x4a')]['id'][_0x5062('0x75')](),_0x5062('0x62'))[_0x5062('0x73')](_0x5062('0x74'),_0x5062('0x58'))[_0x5062('0x73')](_0x5062('0x74'),_0x5062('0x59'))[_0x5062('0x76')](_0x5062('0x77'))[_0x5062('0x3d')]('deletedAt\x20IS\x20NULL')[_0x5062('0x3d')](_0x5062('0x78'),_0xf8903e[_0x5062('0x79')][_0x5062('0x75')]())[_0x5062('0x3d')](_0x5062('0x7a'))[_0x5062('0x3d')](_0x5062('0x7b'),squel['select']()[_0x5062('0x73')]('COALESCE(calleridnum,\x27\x27)')[_0x5062('0x76')](_0x5062('0x7c'))['where']('CampaignId\x20=\x20?',_0x2b1762['params']['id'][_0x5062('0x75')]()))[_0x5062('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x5062('0x72')]()['field'](_0x5062('0x7d'))['from'](_0x5062('0x6c'))['where'](_0x5062('0x7e'),_0x2b1762['params']['id'][_0x5062('0x75')]())))['toString']();break;case _0x5062('0x7f'):_0x185368=squel[_0x5062('0x6b')]()[_0x5062('0x80')](_0x5062('0x6c'))['fromQuery'](['phone',_0x5062('0x6f'),'ContactId','ListId',_0x5062('0x62'),_0x5062('0x58'),_0x5062('0x59')],squel[_0x5062('0x72')]()[_0x5062('0x73')]('phone',_0x5062('0x6e'))[_0x5062('0x73')](_0x5062('0x74'),'scheduledAt')[_0x5062('0x73')]('id',_0x5062('0x70'))[_0x5062('0x73')](_0xf8903e['CmListId'][_0x5062('0x75')](),_0x5062('0x71'))['field'](_0x2b1762[_0x5062('0x4a')]['id'][_0x5062('0x75')](),_0x5062('0x62'))[_0x5062('0x73')](_0x5062('0x74'),_0x5062('0x58'))[_0x5062('0x73')](_0x5062('0x74'),_0x5062('0x59'))[_0x5062('0x76')](_0x5062('0x77'))[_0x5062('0x3d')](_0x5062('0x81'))['where'](_0x5062('0x78'),_0xf8903e[_0x5062('0x79')]['toString']())[_0x5062('0x3d')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x5062('0x7b'),squel['select']()[_0x5062('0x73')](_0x5062('0x7d'))[_0x5062('0x76')](_0x5062('0x6c'))[_0x5062('0x3d')](_0x5062('0x7e'),_0x2b1762[_0x5062('0x4a')]['id']['toString']())))[_0x5062('0x75')]();break;default:_0x185368=squel[_0x5062('0x6b')]()[_0x5062('0x80')](_0x5062('0x6c'))[_0x5062('0x6d')](['phone',_0x5062('0x6f'),_0x5062('0x70'),'ListId',_0x5062('0x62'),_0x5062('0x58'),_0x5062('0x59')],squel[_0x5062('0x72')]()[_0x5062('0x73')](_0x5062('0x6e'),_0x5062('0x6e'))[_0x5062('0x73')](_0x5062('0x74'),_0x5062('0x6f'))['field']('id',_0x5062('0x70'))['field'](_0xf8903e[_0x5062('0x79')][_0x5062('0x75')](),_0x5062('0x71'))['field'](_0x2b1762[_0x5062('0x4a')]['id'][_0x5062('0x75')](),_0x5062('0x62'))[_0x5062('0x73')](_0x5062('0x74'),_0x5062('0x58'))[_0x5062('0x73')]('NOW()',_0x5062('0x59'))[_0x5062('0x76')](_0x5062('0x77'))[_0x5062('0x3d')](_0x5062('0x81'))[_0x5062('0x3d')]('ListId\x20=\x20?',_0xf8903e['CmListId'][_0x5062('0x75')]())[_0x5062('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0x5062('0x75')]();}_0x31bcac[_0x5062('0x82')](db['sequelize'][_0x5062('0x33')](_0x185368));}return BPromise[_0x5062('0x83')](_0x31bcac);}})[_0x5062('0x24')](function(){return _0x1de03d;})['then'](respondWithResult(_0x4ef0f0,null))[_0x5062('0x49')](handleError(_0x4ef0f0,null));};exports['removeLists']=function(_0x183a77,_0x4a4b70,_0x52ccf8){return db[_0x5062('0x47')][_0x5062('0x4b')]({'where':{'id':_0x183a77[_0x5062('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4a4b70,null))[_0x5062('0x24')](function(_0x370a1a){if(_0x370a1a){return _0x370a1a[_0x5062('0x84')](_0x183a77[_0x5062('0x33')][_0x5062('0x67')]);}})[_0x5062('0x24')](function(_0x2bff33){if(_0x2bff33){return db[_0x5062('0x85')][_0x5062('0x25')]({'where':{'ListId':_0x183a77[_0x5062('0x33')]['ids'],'CampaignId':_0x183a77[_0x5062('0x4a')]['id']}})['then'](function(){return _0x2bff33;});}})[_0x5062('0x24')](respondWithStatusCode(_0x4a4b70,null))[_0x5062('0x49')](handleError(_0x4a4b70,null));};exports[_0x5062('0x86')]=function(_0x4d594e,_0x8a4c36,_0x1fd845){var _0x45b096={'raw':!![],'where':{}};var _0x59a73c={};var _0x205860={'count':0x0,'rows':[]};return db[_0x5062('0x47')][_0x5062('0x5c')]({'where':{'id':_0x4d594e['params']['id']}})[_0x5062('0x24')](handleEntityNotFound(_0x8a4c36,null))[_0x5062('0x24')](function(_0x5b7eb8){if(_0x5b7eb8){_0x59a73c['model']=_[_0x5062('0x34')](db[_0x5062('0x65')][_0x5062('0x2d')]);_0x59a73c[_0x5062('0x33')]=_[_0x5062('0x34')](_0x4d594e[_0x5062('0x33')]);_0x59a73c['filters']=_['intersection'](_0x59a73c[_0x5062('0x31')],_0x59a73c[_0x5062('0x33')]);_0x45b096[_0x5062('0x37')]=_[_0x5062('0x35')](_0x59a73c[_0x5062('0x31')],qs[_0x5062('0x36')](_0x4d594e['query'][_0x5062('0x36')]));_0x45b096[_0x5062('0x37')]=_0x45b096['attributes'][_0x5062('0x38')]?_0x45b096[_0x5062('0x37')]:_0x59a73c['model'];if(!_0x4d594e['query'][_0x5062('0x39')](_0x5062('0x5d'))){_0x45b096[_0x5062('0x3a')]=qs['limit'](_0x4d594e[_0x5062('0x33')][_0x5062('0x3a')]);_0x45b096[_0x5062('0x3b')]=qs[_0x5062('0x3b')](_0x4d594e[_0x5062('0x33')][_0x5062('0x3b')]);}_0x45b096[_0x5062('0x5f')]=qs[_0x5062('0x3c')](_0x4d594e[_0x5062('0x33')][_0x5062('0x3c')]);_0x45b096[_0x5062('0x3d')]=qs['filters'](_[_0x5062('0x3f')](_0x4d594e[_0x5062('0x33')],_0x59a73c['filters']));_0x45b096[_0x5062('0x3d')][_0x5062('0x62')]=_0x5b7eb8['id'];if(_0x4d594e[_0x5062('0x33')]['filter']){_0x45b096[_0x5062('0x3d')]=_[_0x5062('0x41')](_0x45b096[_0x5062('0x3d')],{'$or':_[_0x5062('0x32')](_0x45b096[_0x5062('0x37')],function(_0x305823){var _0x31e4c1={};_0x31e4c1[_0x305823]={'$like':'%'+_0x4d594e['query'][_0x5062('0x40')]+'%'};return _0x31e4c1;})});}_0x45b096=_['merge']({},_0x45b096,_0x4d594e[_0x5062('0x43')]);return db['CmList'][_0x5062('0x44')]({'where':_0x45b096[_0x5062('0x3d')]})[_0x5062('0x24')](function(_0x4c34fe){_0x205860[_0x5062('0x44')]=_0x4c34fe;if(_0x4d594e[_0x5062('0x33')][_0x5062('0x45')]){_0x45b096[_0x5062('0x46')]=[{'all':!![]}];}return db['CmList'][_0x5062('0x48')](_0x45b096);})[_0x5062('0x24')](function(_0x4d8dd8){_0x205860[_0x5062('0x60')]=_0x4d8dd8;return _0x205860;});}})['then'](respondWithFilteredResult(_0x8a4c36,_0x45b096))[_0x5062('0x49')](handleError(_0x8a4c36,null));};exports[_0x5062('0x87')]=function(_0x51d77b,_0xf26037,_0x4f063b){var _0x36ca22,_0x264663;return db[_0x5062('0x47')][_0x5062('0x4b')]({'where':{'id':_0x51d77b[_0x5062('0x4a')]['id']}})[_0x5062('0x24')](handleEntityNotFound(_0xf26037,null))[_0x5062('0x24')](function(_0x405953){if(_0x405953){_0x264663=_0x405953;return _0x405953['addBlackLists'](_0x51d77b[_0x5062('0x4d')][_0x5062('0x67')],_[_0x5062('0x57')](_0x51d77b['body'],[_0x5062('0x67'),'id'])||{});}return null;})[_0x5062('0x68')](function(_0x2bc89d){var _0x53b70c;_0x36ca22=_0x2bc89d||[];var _0x104722=[];if(_0x2bc89d){for(var _0x112f5a=0x0;_0x112f5a<_0x2bc89d[_0x5062('0x38')];_0x112f5a+=0x1){var _0x1a9adc=_0x2bc89d[_0x112f5a][_0x5062('0x4f')]({'plain':!![]});_0x53b70c=squel['insert']()[_0x5062('0x80')](_0x5062('0x88'))[_0x5062('0x6d')]([_0x5062('0x6e'),_0x5062('0x70'),_0x5062('0x71'),_0x5062('0x62'),_0x5062('0x58'),_0x5062('0x59')],squel['select']()['field'](_0x5062('0x6e'),_0x5062('0x6e'))[_0x5062('0x73')]('id','ContactId')[_0x5062('0x73')](_0x1a9adc[_0x5062('0x79')]['toString'](),_0x5062('0x71'))[_0x5062('0x73')](_0x51d77b[_0x5062('0x4a')]['id'][_0x5062('0x75')](),_0x5062('0x62'))[_0x5062('0x73')](_0x5062('0x74'),'createdAt')[_0x5062('0x73')](_0x5062('0x74'),_0x5062('0x59'))[_0x5062('0x76')](_0x5062('0x77'))[_0x5062('0x3d')](_0x5062('0x81'))[_0x5062('0x3d')]('ListId\x20=\x20?',_0x1a9adc[_0x5062('0x79')][_0x5062('0x75')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x5062('0x75')]();_0x104722['push'](db[_0x5062('0x89')][_0x5062('0x33')](_0x53b70c));}return BPromise[_0x5062('0x83')](_0x104722);}})[_0x5062('0x24')](function(){return _0x36ca22;})[_0x5062('0x24')](respondWithResult(_0xf26037,null))[_0x5062('0x49')](handleError(_0xf26037,null));};exports['removeBlackLists']=function(_0x1f62c8,_0x28cb49,_0x495e82){return db[_0x5062('0x47')]['find']({'where':{'id':_0x1f62c8['params']['id']}})[_0x5062('0x24')](handleEntityNotFound(_0x28cb49,null))[_0x5062('0x24')](function(_0x3d1758){if(_0x3d1758){return _0x3d1758[_0x5062('0x8a')](_0x1f62c8['query']['ids']);}})[_0x5062('0x24')](function(_0x5a6ba9){if(_0x5a6ba9){return db[_0x5062('0x63')][_0x5062('0x25')]({'where':{'ListId':_0x1f62c8[_0x5062('0x33')][_0x5062('0x67')],'CampaignId':_0x1f62c8[_0x5062('0x4a')]['id']}})['then'](function(){return _0x5a6ba9;});}})[_0x5062('0x24')](respondWithStatusCode(_0x28cb49,null))['catch'](handleError(_0x28cb49,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 8a3cfcf..ddcc29c 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(_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
+var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./campaign.attributes','exports','define','campaigns','lodash','../../config/logger'];(function(_0x311f44,_0x1d7f5b){var _0x46f1e6=function(_0x27342a){while(--_0x27342a){_0x311f44['push'](_0x311f44['shift']());}};_0x46f1e6(++_0x1d7f5b);}(_0xb10b,0x12a));var _0xbb10=function(_0x28e7e1,_0x45f235){_0x28e7e1=_0x28e7e1-0x0;var _0x1d8a9e=_0xb10b[_0x28e7e1];return _0x1d8a9e;};'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')]('Campaign',attributes,{'tableName':_0xbb10('0xb'),'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 f45a816..bc42480 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(_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
+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(_0x336892,_0x9346f4){var _0x46f2f0=function(_0x4b77b4){while(--_0x4b77b4){_0x336892['push'](_0x336892['shift']());}};_0x46f2f0(++_0x9346f4);}(_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);});});}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 c935947..25c1617 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 _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
+var _0x231d=['/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','clone','addLists','/:id/blacklists','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals'];(function(_0x2f227c,_0x360c3a){var _0x5032bc=function(_0x824bb){while(--_0x824bb){_0x2f227c['push'](_0x2f227c['shift']());}};_0x5032bc(++_0x360c3a);}(_0x231d,0x78));var _0xd231=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x231d[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xd231('0x0'));var util=require(_0xd231('0x1'));var path=require(_0xd231('0x2'));var timeout=require(_0xd231('0x3'));var express=require(_0xd231('0x4'));var router=express[_0xd231('0x5')]();var auth=require(_0xd231('0x6'));var interaction=require(_0xd231('0x7'));var config=require(_0xd231('0x8'));var controller=require(_0xd231('0x9'));router[_0xd231('0xa')]('/',auth['isAuthenticated'](),controller[_0xd231('0xb')]);router[_0xd231('0xa')](_0xd231('0xc'),auth[_0xd231('0xd')](),controller[_0xd231('0xe')]);router[_0xd231('0xa')](_0xd231('0xf'),auth[_0xd231('0xd')](),controller[_0xd231('0x10')]);router[_0xd231('0xa')](_0xd231('0x11'),auth['isAuthenticated'](),controller[_0xd231('0x12')]);router['get']('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0xd231('0x13')]);router[_0xd231('0xa')](_0xd231('0x14'),auth[_0xd231('0xd')](),controller[_0xd231('0x15')]);router[_0xd231('0xa')](_0xd231('0x16'),auth[_0xd231('0xd')](),controller[_0xd231('0x17')]);router['get']('/:id/blacklists',auth[_0xd231('0xd')](),controller[_0xd231('0x18')]);router[_0xd231('0x19')]('/',auth[_0xd231('0xd')](),controller['create']);router[_0xd231('0x19')]('/:id/clone',auth[_0xd231('0xd')](),controller[_0xd231('0x1a')]);router[_0xd231('0x19')]('/:id/lists',auth[_0xd231('0xd')](),controller[_0xd231('0x1b')]);router['post'](_0xd231('0x1c'),auth[_0xd231('0xd')](),controller['addBlackLists']);router['put'](_0xd231('0xc'),auth['isAuthenticated'](),controller[_0xd231('0x1d')]);router['delete'](_0xd231('0xc'),auth['isAuthenticated'](),controller[_0xd231('0x1e')]);router[_0xd231('0x1f')](_0xd231('0x16'),auth['isAuthenticated'](),controller[_0xd231('0x20')]);router['delete'](_0xd231('0x1c'),auth[_0xd231('0xd')](),controller[_0xd231('0x21')]);module[_0xd231('0x22')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 4eb8f5d..db37bb5 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 _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
+var _0x0759=['VIRTUAL','key','exports','STRING','TEXT'];(function(_0x3d5909,_0x17417b){var _0x52d088=function(_0x3fa3fb){while(--_0x3fa3fb){_0x3d5909['push'](_0x3d5909['shift']());}};_0x52d088(++_0x17417b);}(_0x0759,0x129));var _0x9075=function(_0x32ccfa,_0x15d7d8){_0x32ccfa=_0x32ccfa-0x0;var _0x200aee=_0x0759[_0x32ccfa];return _0x200aee;};'use strict';var Sequelize=require('sequelize');module[_0x9075('0x0')]={'key':{'type':Sequelize[_0x9075('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x9075('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9075('0x1')]},'name':{'type':Sequelize[_0x9075('0x3')],'get':function(){return this['getDataValue'](_0x9075('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 6d9c149..dcd72f3 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 _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
+var _0x92ea=['util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','includeAll','findAll','catch','show','params','options','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache'];(function(_0x498581,_0x1f06d5){var _0x48fff6=function(_0x44bf66){while(--_0x44bf66){_0x498581['push'](_0x498581['shift']());}};_0x48fff6(++_0x1f06d5);}(_0x92ea,0xa2));var _0xa92e=function(_0x40b457,_0x3e178f){_0x40b457=_0x40b457-0x0;var _0x199b0d=_0x92ea[_0x40b457];return _0x199b0d;};'use strict';var pdf=require(_0xa92e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa92e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa92e('0x2'));var rp=require(_0xa92e('0x3'));var moment=require(_0xa92e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa92e('0x5'));var util=require(_0xa92e('0x6'));var path=require('path');var sox=require(_0xa92e('0x7'));var csv=require(_0xa92e('0x8'));var ejs=require(_0xa92e('0x9'));var fs=require('fs');var _=require(_0xa92e('0xa'));var squel=require(_0xa92e('0xb'));var crypto=require(_0xa92e('0xc'));var jsforce=require(_0xa92e('0xd'));var deskjs=require(_0xa92e('0xe'));var toCsv=require(_0xa92e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa92e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa92e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa92e('0x11'));var logger=require(_0xa92e('0x12'))(_0xa92e('0x13'));var utils=require('../../config/utils');var config=require(_0xa92e('0x14'));var db=require(_0xa92e('0x15'))['db'];function respondWithStatusCode(_0x11f5ba,_0x563259){_0x563259=_0x563259||0xcc;return function(_0x3c4595){if(_0x3c4595){return _0x11f5ba[_0xa92e('0x16')](_0x563259);}return _0x11f5ba[_0xa92e('0x17')](_0x563259)[_0xa92e('0x18')]();};}function respondWithResult(_0x4463e4,_0xe6512){_0xe6512=_0xe6512||0xc8;return function(_0x348e26){if(_0x348e26){return _0x4463e4[_0xa92e('0x17')](_0xe6512)['json'](_0x348e26);}};}function respondWithFilteredResult(_0x2a518b,_0x53ba5d){return function(_0x45ec26){if(_0x45ec26){var _0x10d7fc=_0x45ec26[_0xa92e('0x19')],_0x506e1c=_0x53ba5d[_0xa92e('0x1a')],_0x4921be=_0x53ba5d['offset']+_0x53ba5d[_0xa92e('0x1b')],_0x5095f1;if(_0x4921be>=_0x10d7fc){_0x4921be=_0x10d7fc;_0x5095f1=0xc8;}else{_0x5095f1=0xce;}_0x2a518b[_0xa92e('0x17')](_0x5095f1);return _0x2a518b[_0xa92e('0x1c')]('Content-Range',_0x506e1c+'-'+_0x4921be+'/'+_0x10d7fc)['json'](_0x45ec26);}return null;};}function patchUpdates(_0x4bd588){return function(_0x2e2f7f){try{jsonpatch[_0xa92e('0x1d')](_0x2e2f7f,_0x4bd588,!![]);}catch(_0x4efc7b){return BPromise['reject'](_0x4efc7b);}return _0x2e2f7f[_0xa92e('0x1e')]();};}function saveUpdates(_0xb47c53,_0x18f1c4){return function(_0x1f3edd){if(_0x1f3edd){return _0x1f3edd[_0xa92e('0x1f')](_0xb47c53)[_0xa92e('0x20')](function(_0x140d76){return _0x140d76;});}return null;};}function removeEntity(_0x1d0c82,_0x1e49ac){return function(_0x4df310){if(_0x4df310){return _0x4df310[_0xa92e('0x21')]()['then'](function(){var _0x235d4f=_0x4df310[_0xa92e('0x22')]({'plain':!![]});var _0x3a891b=_0xa92e('0x23');return db[_0xa92e('0x24')][_0xa92e('0x21')]({'where':{'type':_0x3a891b,'resourceId':_0x235d4f['id']}})[_0xa92e('0x20')](function(){return _0x4df310;});})[_0xa92e('0x20')](function(){_0x1d0c82['status'](0xcc)[_0xa92e('0x18')]();});}};}function handleEntityNotFound(_0x54864d,_0x8b6802){return function(_0x2de8b7){if(!_0x2de8b7){_0x54864d[_0xa92e('0x16')](0x194);}return _0x2de8b7;};}function handleError(_0x5c748a,_0x50a59b){_0x50a59b=_0x50a59b||0x1f4;return function(_0x2aa661){logger[_0xa92e('0x25')](_0x2aa661[_0xa92e('0x26')]);if(_0x2aa661[_0xa92e('0x27')]){delete _0x2aa661[_0xa92e('0x27')];}_0x5c748a['status'](_0x50a59b)[_0xa92e('0x28')](_0x2aa661);};}exports[_0xa92e('0x29')]=function(_0x216e1b,_0x11cc0d){var _0x5b707b={},_0x3083e2={},_0x279e67={'count':0x0,'rows':[]};var _0x1e642b=_[_0xa92e('0x2a')](db[_0xa92e('0x2b')][_0xa92e('0x2c')],function(_0x4cb087){return{'name':_0x4cb087[_0xa92e('0x2d')],'type':_0x4cb087[_0xa92e('0x2e')][_0xa92e('0x2f')]};});_0x3083e2[_0xa92e('0x30')]=_[_0xa92e('0x2a')](_0x1e642b,_0xa92e('0x27'));_0x3083e2[_0xa92e('0x31')]=_[_0xa92e('0x32')](_0x216e1b['query']);_0x3083e2[_0xa92e('0x33')]=_[_0xa92e('0x34')](_0x3083e2[_0xa92e('0x30')],_0x3083e2[_0xa92e('0x31')]);_0x5b707b[_0xa92e('0x35')]=_[_0xa92e('0x34')](_0x3083e2[_0xa92e('0x30')],qs[_0xa92e('0x36')](_0x216e1b['query']['fields']));_0x5b707b[_0xa92e('0x35')]=_0x5b707b[_0xa92e('0x35')][_0xa92e('0x37')]?_0x5b707b[_0xa92e('0x35')]:_0x3083e2[_0xa92e('0x30')];if(!_0x216e1b['query']['hasOwnProperty']('nolimit')){_0x5b707b[_0xa92e('0x1b')]=qs[_0xa92e('0x1b')](_0x216e1b[_0xa92e('0x31')][_0xa92e('0x1b')]);_0x5b707b[_0xa92e('0x1a')]=qs[_0xa92e('0x1a')](_0x216e1b['query'][_0xa92e('0x1a')]);}_0x5b707b[_0xa92e('0x38')]=qs[_0xa92e('0x39')](_0x216e1b[_0xa92e('0x31')][_0xa92e('0x39')]);_0x5b707b[_0xa92e('0x3a')]=qs[_0xa92e('0x33')](_[_0xa92e('0x3b')](_0x216e1b[_0xa92e('0x31')],_0x3083e2[_0xa92e('0x33')]),_0x1e642b);if(_0x216e1b['query'][_0xa92e('0x3c')]){_0x5b707b[_0xa92e('0x3a')]=_[_0xa92e('0x3d')](_0x5b707b['where'],{'$or':_[_0xa92e('0x2a')](_0x1e642b,function(_0x5749ac){if(_0x5749ac['type']!=='VIRTUAL'){var _0x163199={};_0x163199[_0x5749ac[_0xa92e('0x27')]]={'$like':'%'+_0x216e1b[_0xa92e('0x31')][_0xa92e('0x3c')]+'%'};return _0x163199;}})});}_0x5b707b=_['merge']({},_0x5b707b,_0x216e1b['options']);var _0x28ee57={'where':_0x5b707b[_0xa92e('0x3a')]};return db['CannedAnswer'][_0xa92e('0x19')](_0x28ee57)[_0xa92e('0x20')](function(_0x46b868){_0x279e67[_0xa92e('0x19')]=_0x46b868;if(_0x216e1b[_0xa92e('0x31')][_0xa92e('0x3e')]){_0x5b707b['include']=[{'all':!![]}];}return db[_0xa92e('0x2b')][_0xa92e('0x3f')](_0x5b707b);})[_0xa92e('0x20')](function(_0x6d9537){_0x279e67['rows']=_0x6d9537;return _0x279e67;})[_0xa92e('0x20')](respondWithFilteredResult(_0x11cc0d,_0x5b707b))[_0xa92e('0x40')](handleError(_0x11cc0d,null));};exports[_0xa92e('0x41')]=function(_0x19fce9,_0x5d5919){var _0xe4b8bc={'raw':!![],'where':{'id':_0x19fce9[_0xa92e('0x42')]['id']}},_0x1cce54={};_0x1cce54[_0xa92e('0x30')]=_['keys'](db['CannedAnswer'][_0xa92e('0x2c')]);_0x1cce54['query']=_['keys'](_0x19fce9[_0xa92e('0x31')]);_0x1cce54[_0xa92e('0x33')]=_[_0xa92e('0x34')](_0x1cce54[_0xa92e('0x30')],_0x1cce54['query']);_0xe4b8bc['attributes']=_[_0xa92e('0x34')](_0x1cce54[_0xa92e('0x30')],qs[_0xa92e('0x36')](_0x19fce9[_0xa92e('0x31')][_0xa92e('0x36')]));_0xe4b8bc[_0xa92e('0x35')]=_0xe4b8bc['attributes']['length']?_0xe4b8bc['attributes']:_0x1cce54['model'];if(_0x19fce9[_0xa92e('0x31')][_0xa92e('0x3e')]){_0xe4b8bc['include']=[{'all':!![]}];}_0xe4b8bc=_[_0xa92e('0x3d')]({},_0xe4b8bc,_0x19fce9[_0xa92e('0x43')]);return db[_0xa92e('0x2b')]['find'](_0xe4b8bc)[_0xa92e('0x20')](handleEntityNotFound(_0x5d5919,null))[_0xa92e('0x20')](respondWithResult(_0x5d5919,null))[_0xa92e('0x40')](handleError(_0x5d5919,null));};exports[_0xa92e('0x1f')]=function(_0x22d69a,_0x2b0cb1){if(_0x22d69a[_0xa92e('0x44')]['id']){delete _0x22d69a[_0xa92e('0x44')]['id'];}return db[_0xa92e('0x2b')]['find']({'where':{'id':_0x22d69a[_0xa92e('0x42')]['id']}})[_0xa92e('0x20')](handleEntityNotFound(_0x2b0cb1,null))[_0xa92e('0x20')](saveUpdates(_0x22d69a[_0xa92e('0x44')],null))[_0xa92e('0x20')](respondWithResult(_0x2b0cb1,null))[_0xa92e('0x40')](handleError(_0x2b0cb1,null));};exports[_0xa92e('0x21')]=function(_0x594794,_0x389a74){return db['CannedAnswer'][_0xa92e('0x45')]({'where':{'id':_0x594794[_0xa92e('0x42')]['id']}})[_0xa92e('0x20')](handleEntityNotFound(_0x389a74,null))['then'](removeEntity(_0x389a74,null))['catch'](handleError(_0x389a74,null));};exports[_0xa92e('0x46')]=function(_0x2b5fce,_0x14bcac){var _0x16de06={'key':_0x2b5fce[_0xa92e('0x44')]['key']};if(_0x2b5fce[_0xa92e('0x44')][_0xa92e('0x47')]){_0x16de06['MailAccountId']=_0x2b5fce['body'][_0xa92e('0x47')];}else if(_0x2b5fce[_0xa92e('0x44')][_0xa92e('0x48')]){_0x16de06[_0xa92e('0x48')]=_0x2b5fce['body'][_0xa92e('0x48')];}else if(_0x2b5fce[_0xa92e('0x44')][_0xa92e('0x49')]){_0x16de06[_0xa92e('0x49')]=_0x2b5fce['body'][_0xa92e('0x49')];}else if(_0x2b5fce['body'][_0xa92e('0x4a')]){_0x16de06[_0xa92e('0x4a')]=_0x2b5fce[_0xa92e('0x44')]['ChatWebsiteId'];}return db[_0xa92e('0x2b')]['find']({'where':_0x16de06})[_0xa92e('0x20')](function(_0x121126){if(_0x121126){throw new db[(_0xa92e('0x4b'))][(_0xa92e('0x4c'))](_0xa92e('0x4d'));}return db[_0xa92e('0x2b')][_0xa92e('0x46')](_0x2b5fce['body']);})['then'](function(_0x360364){var _0x1bdf92=_0x2b5fce[_0xa92e('0x4e')][_0xa92e('0x22')]({'plain':!![]});if(!_0x1bdf92)throw new Error(_0xa92e('0x4f'));if(_0x1bdf92[_0xa92e('0x50')]===_0xa92e('0x4e')){var _0x4b396b=_0x360364[_0xa92e('0x22')]({'plain':!![]});return db['UserProfileSection'][_0xa92e('0x45')]({'where':{'name':_0xa92e('0x23'),'userProfileId':_0x1bdf92[_0xa92e('0x51')]},'raw':!![]})['then'](function(_0xe925f7){if(_0xe925f7&&_0xe925f7[_0xa92e('0x52')]===0x0){return db[_0xa92e('0x24')][_0xa92e('0x46')]({'name':_0x4b396b[_0xa92e('0x27')],'resourceId':_0x4b396b['id'],'type':_0xe925f7[_0xa92e('0x27')],'sectionId':_0xe925f7['id']},{})[_0xa92e('0x20')](function(){return _0x360364;});}else{return _0x360364;}})[_0xa92e('0x40')](function(_0x108f52){logger[_0xa92e('0x25')](_0xa92e('0x53'),_0x108f52);throw _0x108f52;});}return _0x360364;})[_0xa92e('0x20')](respondWithResult(_0x14bcac,0xc9))[_0xa92e('0x40')](handleError(_0x14bcac,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index c16d015..22ea303 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 _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
+var _0x2e88=['util','../../config/logger','api','moment','bluebird','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x146f3a,_0x373e03){var _0x4ebd8a=function(_0x2b4ea9){while(--_0x2b4ea9){_0x146f3a['push'](_0x146f3a['shift']());}};_0x4ebd8a(++_0x373e03);}(_0x2e88,0x95));var _0x82e8=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x2e88[_0x209941];return _0x1e8729;};'use strict';var _=require(_0x82e8('0x0'));var util=require(_0x82e8('0x1'));var logger=require(_0x82e8('0x2'))(_0x82e8('0x3'));var moment=require(_0x82e8('0x4'));var BPromise=require(_0x82e8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x82e8('0x6'));var rimraf=require(_0x82e8('0x7'));var config=require('../../config/environment');var attributes=require(_0x82e8('0x8'));module[_0x82e8('0x9')]=function(_0x4e909a,_0x3162d1){return _0x4e909a[_0x82e8('0xa')](_0x82e8('0xb'),attributes,{'tableName':_0x82e8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x82e8('0xd'),'collate':_0x82e8('0xe')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 8ba1dc2..8340d1e 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 _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
+var _0xaab6=['CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','CannedAnswer,\x20%s,\x20%s','debug'];(function(_0x516e09,_0x509ae7){var _0x16cab3=function(_0x458b72){while(--_0x458b72){_0x516e09['push'](_0x516e09['shift']());}};_0x16cab3(++_0x509ae7);}(_0xaab6,0x125));var _0x6aab=function(_0x38cb58,_0x203de5){_0x38cb58=_0x38cb58-0x0;var _0x57fc2a=_0xaab6[_0x38cb58];return _0x57fc2a;};'use strict';var _=require(_0x6aab('0x0'));var util=require(_0x6aab('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6aab('0x2'));var fs=require('fs');var Redis=require(_0x6aab('0x3'));var db=require(_0x6aab('0x4'))['db'];var utils=require(_0x6aab('0x5'));var logger=require(_0x6aab('0x6'))('rpc');var config=require(_0x6aab('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6aab('0x8')][_0x6aab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2120eb,_0x3108aa,_0x58db13){return new BPromise(function(_0x1101f5,_0x2d1c4e){return client['request'](_0x2120eb,_0x58db13)['then'](function(_0x57e9fc){logger[_0x6aab('0xa')](_0x6aab('0xb'),_0x3108aa,'request\x20sent');logger[_0x6aab('0xc')](_0x6aab('0xd'),_0x3108aa,_0x6aab('0xe'),JSON[_0x6aab('0xf')](_0x57e9fc));if(_0x57e9fc['error']){if(_0x57e9fc[_0x6aab('0x10')]['code']===0x1f4){logger[_0x6aab('0x10')]('CannedAnswer,\x20%s,\x20%s',_0x3108aa,_0x57e9fc[_0x6aab('0x10')][_0x6aab('0x11')]);return _0x2d1c4e(_0x57e9fc[_0x6aab('0x10')][_0x6aab('0x11')]);}logger[_0x6aab('0x10')](_0x6aab('0xb'),_0x3108aa,_0x57e9fc[_0x6aab('0x10')][_0x6aab('0x11')]);return _0x1101f5(_0x57e9fc[_0x6aab('0x10')][_0x6aab('0x11')]);}else{logger['info'](_0x6aab('0xb'),_0x3108aa,_0x6aab('0xe'));_0x1101f5(_0x57e9fc['result'][_0x6aab('0x11')]);}})['catch'](function(_0x27e652){logger['error'](_0x6aab('0xb'),_0x3108aa,_0x27e652);_0x2d1c4e(_0x27e652);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index f44e3aa..ba6c6f3 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 _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
+var _0x4128=['destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','show','post','create','put','/:id','delete'];(function(_0x571fad,_0xa41ecb){var _0x45fa03=function(_0x3f89c3){while(--_0x3f89c3){_0x571fad['push'](_0x571fad['shift']());}};_0x45fa03(++_0xa41ecb);}(_0x4128,0x80));var _0x8412=function(_0x57c280,_0x48bdf5){_0x57c280=_0x57c280-0x0;var _0x20ea49=_0x4128[_0x57c280];return _0x20ea49;};'use strict';var multer=require('multer');var util=require(_0x8412('0x0'));var path=require(_0x8412('0x1'));var timeout=require('connect-timeout');var express=require(_0x8412('0x2'));var router=express[_0x8412('0x3')]();var auth=require(_0x8412('0x4'));var interaction=require(_0x8412('0x5'));var config=require(_0x8412('0x6'));var controller=require(_0x8412('0x7'));router[_0x8412('0x8')]('/',auth[_0x8412('0x9')](),controller['index']);router[_0x8412('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8412('0xa')]);router[_0x8412('0xb')]('/',auth['isAuthenticated'](),controller[_0x8412('0xc')]);router[_0x8412('0xd')](_0x8412('0xe'),auth[_0x8412('0x9')](),controller['update']);router[_0x8412('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x8412('0x10')]);module[_0x8412('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index fe2f8ac..bf0d973 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 _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
+var _0x7e02=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x537293,_0x449f77){var _0x560e66=function(_0x5a9386){while(--_0x5a9386){_0x537293['push'](_0x537293['shift']());}};_0x560e66(++_0x449f77);}(_0x7e02,0x1b7));var _0x27e0=function(_0x197043,_0x3ebf47){_0x197043=_0x197043-0x0;var _0x233e33=_0x7e02[_0x197043];return _0x233e33;};'use strict';var Sequelize=require(_0x27e0('0x0'));module[_0x27e0('0x1')]={'calldate':{'type':Sequelize[_0x27e0('0x2')],'allowNull':![],'defaultValue':_0x27e0('0x3')},'clid':{'type':Sequelize[_0x27e0('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x27e0('0x4')]},'dcontext':{'type':Sequelize[_0x27e0('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x27e0('0x4')]},'lastapp':{'type':Sequelize[_0x27e0('0x4')]},'lastdata':{'type':Sequelize[_0x27e0('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x27e0('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x27e0('0x4')]},'amaflags':{'type':Sequelize[_0x27e0('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x27e0('0x4')]},'userfield':{'type':Sequelize[_0x27e0('0x4')]},'uniqueid':{'type':Sequelize[_0x27e0('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x27e0('0x4')]},'peeraccount':{'type':Sequelize[_0x27e0('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x27e0('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 4ae90db..93ded04 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 _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
+var _0x1ebe=['keys','create','body','find','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','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','../../config/logger','../../config/utils','../../mysqldb','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','sendStatus','error','name','Cdr','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x49e9cc,_0xd2239){var _0x3a1c4c=function(_0x24aa73){while(--_0x24aa73){_0x49e9cc['push'](_0x49e9cc['shift']());}};_0x3a1c4c(++_0xd2239);}(_0x1ebe,0x12c));var _0xe1eb=function(_0x1907f3,_0x4bda55){_0x1907f3=_0x1907f3-0x0;var _0x1fcc14=_0x1ebe[_0x1907f3];return _0x1fcc14;};'use strict';var pdf=require(_0xe1eb('0x0'));var emlformat=require(_0xe1eb('0x1'));var rimraf=require(_0xe1eb('0x2'));var zipdir=require(_0xe1eb('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe1eb('0x4'));var moment=require(_0xe1eb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe1eb('0x6'));var util=require(_0xe1eb('0x7'));var path=require(_0xe1eb('0x8'));var sox=require(_0xe1eb('0x9'));var csv=require(_0xe1eb('0xa'));var ejs=require(_0xe1eb('0xb'));var fs=require('fs');var _=require(_0xe1eb('0xc'));var squel=require(_0xe1eb('0xd'));var crypto=require(_0xe1eb('0xe'));var jsforce=require(_0xe1eb('0xf'));var deskjs=require(_0xe1eb('0x10'));var toCsv=require(_0xe1eb('0xa'));var querystring=require(_0xe1eb('0x11'));var Papa=require(_0xe1eb('0x12'));var Redis=require('ioredis');var authService=require(_0xe1eb('0x13'));var qs=require(_0xe1eb('0x14'));var as=require(_0xe1eb('0x15'));var hardwareService=require(_0xe1eb('0x16'));var logger=require(_0xe1eb('0x17'))('api');var utils=require(_0xe1eb('0x18'));var config=require('../../config/environment');var db=require(_0xe1eb('0x19'))['db'];function respondWithStatusCode(_0x1f30bb,_0x3fd20b){_0x3fd20b=_0x3fd20b||0xcc;return function(_0x56e12a){if(_0x56e12a){return _0x1f30bb['sendStatus'](_0x3fd20b);}return _0x1f30bb[_0xe1eb('0x1a')](_0x3fd20b)[_0xe1eb('0x1b')]();};}function respondWithResult(_0x33d9b5,_0x5498a6){_0x5498a6=_0x5498a6||0xc8;return function(_0x532e96){if(_0x532e96){return _0x33d9b5[_0xe1eb('0x1a')](_0x5498a6)[_0xe1eb('0x1c')](_0x532e96);}};}function respondWithFilteredResult(_0x459abe,_0x383489){return function(_0x2a5558){if(_0x2a5558){var _0x1ca8e7=_0x2a5558[_0xe1eb('0x1d')],_0x5c08f2=_0x383489[_0xe1eb('0x1e')],_0x473eaf=_0x383489[_0xe1eb('0x1e')]+_0x383489['limit'],_0x2a7005;if(_0x473eaf>=_0x1ca8e7){_0x473eaf=_0x1ca8e7;_0x2a7005=0xc8;}else{_0x2a7005=0xce;}_0x459abe[_0xe1eb('0x1a')](_0x2a7005);return _0x459abe['set'](_0xe1eb('0x1f'),_0x5c08f2+'-'+_0x473eaf+'/'+_0x1ca8e7)[_0xe1eb('0x1c')](_0x2a5558);}return null;};}function patchUpdates(_0x5b2546){return function(_0x4572ee){try{jsonpatch[_0xe1eb('0x20')](_0x4572ee,_0x5b2546,!![]);}catch(_0x34af40){return BPromise[_0xe1eb('0x21')](_0x34af40);}return _0x4572ee[_0xe1eb('0x22')]();};}function saveUpdates(_0x253384,_0x38081){return function(_0x2d51e0){if(_0x2d51e0){return _0x2d51e0[_0xe1eb('0x23')](_0x253384)[_0xe1eb('0x24')](function(_0x228746){return _0x228746;});}return null;};}function removeEntity(_0x356ce8,_0x13ff2c){return function(_0x3a4a5c){if(_0x3a4a5c){return _0x3a4a5c['destroy']()[_0xe1eb('0x24')](function(){_0x356ce8[_0xe1eb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c9bb1,_0x538015){return function(_0x255935){if(!_0x255935){_0x2c9bb1[_0xe1eb('0x25')](0x194);}return _0x255935;};}function handleError(_0x338679,_0x4f91e4){_0x4f91e4=_0x4f91e4||0x1f4;return function(_0x1bb1b2){logger[_0xe1eb('0x26')](_0x1bb1b2['stack']);if(_0x1bb1b2[_0xe1eb('0x27')]){delete _0x1bb1b2[_0xe1eb('0x27')];}_0x338679[_0xe1eb('0x1a')](_0x4f91e4)['send'](_0x1bb1b2);};}exports['index']=function(_0x5574e8,_0x1e5315){var _0xdea203={},_0x11c139={},_0x23bef={'count':0x0,'rows':[]};var _0x40df6a=_['map'](db[_0xe1eb('0x28')][_0xe1eb('0x29')],function(_0x5f12df){return{'name':_0x5f12df[_0xe1eb('0x2a')],'type':_0x5f12df[_0xe1eb('0x2b')][_0xe1eb('0x2c')]};});_0x11c139[_0xe1eb('0x2d')]=_[_0xe1eb('0x2e')](_0x40df6a,_0xe1eb('0x27'));_0x11c139[_0xe1eb('0x2f')]=_['keys'](_0x5574e8['query']);_0x11c139[_0xe1eb('0x30')]=_[_0xe1eb('0x31')](_0x11c139[_0xe1eb('0x2d')],_0x11c139[_0xe1eb('0x2f')]);_0xdea203[_0xe1eb('0x32')]=_[_0xe1eb('0x31')](_0x11c139[_0xe1eb('0x2d')],qs['fields'](_0x5574e8[_0xe1eb('0x2f')][_0xe1eb('0x33')]));_0xdea203[_0xe1eb('0x32')]=_0xdea203[_0xe1eb('0x32')][_0xe1eb('0x34')]?_0xdea203[_0xe1eb('0x32')]:_0x11c139[_0xe1eb('0x2d')];if(!_0x5574e8[_0xe1eb('0x2f')][_0xe1eb('0x35')](_0xe1eb('0x36'))){_0xdea203[_0xe1eb('0x37')]=qs[_0xe1eb('0x37')](_0x5574e8[_0xe1eb('0x2f')][_0xe1eb('0x37')]);_0xdea203[_0xe1eb('0x1e')]=qs[_0xe1eb('0x1e')](_0x5574e8[_0xe1eb('0x2f')]['offset']);}_0xdea203['order']=qs[_0xe1eb('0x38')](_0x5574e8[_0xe1eb('0x2f')][_0xe1eb('0x38')]);_0xdea203[_0xe1eb('0x39')]=qs[_0xe1eb('0x30')](_[_0xe1eb('0x3a')](_0x5574e8[_0xe1eb('0x2f')],_0x11c139['filters']),_0x40df6a);if(_0x5574e8['query'][_0xe1eb('0x3b')]){_0xdea203[_0xe1eb('0x39')]=_[_0xe1eb('0x3c')](_0xdea203[_0xe1eb('0x39')],{'$or':_[_0xe1eb('0x2e')](_0x40df6a,function(_0x2d00a8){if(_0x2d00a8[_0xe1eb('0x2b')]!==_0xe1eb('0x3d')){var _0x2d889a={};_0x2d889a[_0x2d00a8[_0xe1eb('0x27')]]={'$like':'%'+_0x5574e8['query']['filter']+'%'};return _0x2d889a;}})});}_0xdea203=_[_0xe1eb('0x3c')]({},_0xdea203,_0x5574e8[_0xe1eb('0x3e')]);var _0x310e7e={'where':_0xdea203[_0xe1eb('0x39')]};return db[_0xe1eb('0x28')][_0xe1eb('0x1d')](_0x310e7e)[_0xe1eb('0x24')](function(_0x182792){_0x23bef[_0xe1eb('0x1d')]=_0x182792;if(_0x5574e8[_0xe1eb('0x2f')][_0xe1eb('0x3f')]){_0xdea203[_0xe1eb('0x40')]=[{'all':!![]}];}return db[_0xe1eb('0x28')][_0xe1eb('0x41')](_0xdea203);})[_0xe1eb('0x24')](function(_0x23e89d){_0x23bef[_0xe1eb('0x42')]=_0x23e89d;return _0x23bef;})[_0xe1eb('0x24')](respondWithFilteredResult(_0x1e5315,_0xdea203))[_0xe1eb('0x43')](handleError(_0x1e5315,null));};exports[_0xe1eb('0x44')]=function(_0x945dbb,_0x558caf){var _0x4500a2={'raw':!![],'where':{'id':_0x945dbb[_0xe1eb('0x45')]['id']}},_0x412168={};_0x412168[_0xe1eb('0x2d')]=_['keys'](db[_0xe1eb('0x28')][_0xe1eb('0x29')]);_0x412168['query']=_[_0xe1eb('0x46')](_0x945dbb['query']);_0x412168[_0xe1eb('0x30')]=_[_0xe1eb('0x31')](_0x412168[_0xe1eb('0x2d')],_0x412168[_0xe1eb('0x2f')]);_0x4500a2['attributes']=_[_0xe1eb('0x31')](_0x412168[_0xe1eb('0x2d')],qs[_0xe1eb('0x33')](_0x945dbb[_0xe1eb('0x2f')][_0xe1eb('0x33')]));_0x4500a2['attributes']=_0x4500a2[_0xe1eb('0x32')]['length']?_0x4500a2[_0xe1eb('0x32')]:_0x412168[_0xe1eb('0x2d')];if(_0x945dbb[_0xe1eb('0x2f')][_0xe1eb('0x3f')]){_0x4500a2[_0xe1eb('0x40')]=[{'all':!![]}];}_0x4500a2=_[_0xe1eb('0x3c')]({},_0x4500a2,_0x945dbb[_0xe1eb('0x3e')]);return db[_0xe1eb('0x28')]['find'](_0x4500a2)[_0xe1eb('0x24')](handleEntityNotFound(_0x558caf,null))[_0xe1eb('0x24')](respondWithResult(_0x558caf,null))[_0xe1eb('0x43')](handleError(_0x558caf,null));};exports[_0xe1eb('0x47')]=function(_0x1a90b4,_0x2782a0){return db[_0xe1eb('0x28')][_0xe1eb('0x47')](_0x1a90b4[_0xe1eb('0x48')],{})[_0xe1eb('0x24')](respondWithResult(_0x2782a0,0xc9))['catch'](handleError(_0x2782a0,null));};exports[_0xe1eb('0x23')]=function(_0x22f9d4,_0x4cf143){if(_0x22f9d4[_0xe1eb('0x48')]['id']){delete _0x22f9d4['body']['id'];}return db['Cdr'][_0xe1eb('0x49')]({'where':{'id':_0x22f9d4[_0xe1eb('0x45')]['id']}})['then'](handleEntityNotFound(_0x4cf143,null))['then'](saveUpdates(_0x22f9d4['body'],null))['then'](respondWithResult(_0x4cf143,null))[_0xe1eb('0x43')](handleError(_0x4cf143,null));};exports['destroy']=function(_0x4bb891,_0x4108f2){return db[_0xe1eb('0x28')][_0xe1eb('0x49')]({'where':{'id':_0x4bb891['params']['id']}})['then'](handleEntityNotFound(_0x4108f2,null))['then'](removeEntity(_0x4108f2,null))[_0xe1eb('0x43')](handleError(_0x4108f2,null));};exports['describe']=function(_0x13e0e3,_0x45a0d5){return db['Cdr']['describe']()[_0xe1eb('0x24')](respondWithResult(_0x45a0d5,null))[_0xe1eb('0x43')](handleError(_0x45a0d5,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index f439045..cbe645b 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 _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
+var _0x8687=['../../config/logger','moment','bluebird','path','../../config/environment','./cdr.attributes','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','util'];(function(_0xba6134,_0x5281e3){var _0xbce6c2=function(_0x2841bc){while(--_0x2841bc){_0xba6134['push'](_0xba6134['shift']());}};_0xbce6c2(++_0x5281e3);}(_0x8687,0x1b1));var _0x7868=function(_0x5680ff,_0x39e7ff){_0x5680ff=_0x5680ff-0x0;var _0x91592a=_0x8687[_0x5680ff];return _0x91592a;};'use strict';var _=require(_0x7868('0x0'));var util=require(_0x7868('0x1'));var logger=require(_0x7868('0x2'))('api');var moment=require(_0x7868('0x3'));var BPromise=require(_0x7868('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7868('0x5'));var rimraf=require('rimraf');var config=require(_0x7868('0x6'));var attributes=require(_0x7868('0x7'));module['exports']=function(_0x1bccf6,_0x1b2149){return _0x1bccf6['define']('Cdr',attributes,{'tableName':_0x7868('0x8'),'paranoid':![],'indexes':[{'name':_0x7868('0x9'),'fields':[_0x7868('0x9')]},{'name':_0x7868('0xa'),'fields':[_0x7868('0xa')]},{'name':_0x7868('0xb'),'fields':[_0x7868('0xb')]},{'name':_0x7868('0xc'),'fields':[_0x7868('0xc')]},{'name':_0x7868('0xd'),'fields':['src']},{'name':'uniqueid','fields':[_0x7868('0xe')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 109ae4c..dfcbbb8 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 _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
+var _0x0dd2=['code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x44a3b0,_0x352810){var _0x39e6f6=function(_0x248002){while(--_0x248002){_0x44a3b0['push'](_0x44a3b0['shift']());}};_0x39e6f6(++_0x352810);}(_0x0dd2,0x8f));var _0x20dd=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x0dd2[_0x2a8c21];return _0x5f3061;};'use strict';var _=require(_0x20dd('0x0'));var util=require('util');var moment=require(_0x20dd('0x1'));var BPromise=require(_0x20dd('0x2'));var rs=require(_0x20dd('0x3'));var fs=require('fs');var Redis=require(_0x20dd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x20dd('0x5'));var logger=require(_0x20dd('0x6'))('rpc');var config=require(_0x20dd('0x7'));var jayson=require(_0x20dd('0x8'));var client=jayson[_0x20dd('0x9')][_0x20dd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fe98e,_0xdb16b2,_0x49aa93){return new BPromise(function(_0x1ab814,_0x1a6ac4){return client['request'](_0x2fe98e,_0x49aa93)[_0x20dd('0xb')](function(_0x2267df){logger['info'](_0x20dd('0xc'),_0xdb16b2,_0x20dd('0xd'));logger[_0x20dd('0xe')](_0x20dd('0xf'),_0xdb16b2,_0x20dd('0xd'),JSON[_0x20dd('0x10')](_0x2267df));if(_0x2267df[_0x20dd('0x11')]){if(_0x2267df[_0x20dd('0x11')][_0x20dd('0x12')]===0x1f4){logger[_0x20dd('0x11')](_0x20dd('0xc'),_0xdb16b2,_0x2267df[_0x20dd('0x11')][_0x20dd('0x13')]);return _0x1a6ac4(_0x2267df['error']['message']);}logger['error'](_0x20dd('0xc'),_0xdb16b2,_0x2267df[_0x20dd('0x11')][_0x20dd('0x13')]);return _0x1ab814(_0x2267df[_0x20dd('0x11')][_0x20dd('0x13')]);}else{logger[_0x20dd('0x14')](_0x20dd('0xc'),_0xdb16b2,_0x20dd('0xd'));_0x1ab814(_0x2267df[_0x20dd('0x15')][_0x20dd('0x13')]);}})[_0x20dd('0x16')](function(_0x552761){logger[_0x20dd('0x11')](_0x20dd('0xc'),_0xdb16b2,_0x552761);_0x1a6ac4(_0x552761);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index c511615..1c9fb3a 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 _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
+var _0x6dd1=['./cdr.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x6dd1,0x109));var _0x16dd=function(_0x4546a6,_0x16e1cb){_0x4546a6=_0x4546a6-0x0;var _0x4e0db8=_0x6dd1[_0x4546a6];return _0x4e0db8;};'use strict';var multer=require(_0x16dd('0x0'));var util=require(_0x16dd('0x1'));var path=require(_0x16dd('0x2'));var timeout=require('connect-timeout');var express=require(_0x16dd('0x3'));var router=express[_0x16dd('0x4')]();var auth=require(_0x16dd('0x5'));var interaction=require(_0x16dd('0x6'));var config=require(_0x16dd('0x7'));var controller=require(_0x16dd('0x8'));router[_0x16dd('0x9')]('/',auth[_0x16dd('0xa')](),controller['index']);router['get'](_0x16dd('0xb'),auth[_0x16dd('0xa')](),controller['describe']);router[_0x16dd('0x9')](_0x16dd('0xc'),auth[_0x16dd('0xa')](),controller[_0x16dd('0xd')]);router[_0x16dd('0xe')]('/',auth[_0x16dd('0xa')](),controller[_0x16dd('0xf')]);router[_0x16dd('0x10')]('/:id',auth[_0x16dd('0xa')](),controller[_0x16dd('0x11')]);router[_0x16dd('0x12')](_0x16dd('0xc'),auth[_0x16dd('0xa')](),controller[_0x16dd('0x13')]);module[_0x16dd('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 1b35881..cf3b3ac 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 _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
+var _0xf10d=['*,*,*,*','exports','INTEGER','STRING','TEXT'];(function(_0xf0254e,_0x1a61fc){var _0x1a6953=function(_0x369243){while(--_0x369243){_0xf0254e['push'](_0xf0254e['shift']());}};_0x1a6953(++_0x1a61fc);}(_0xf10d,0xec));var _0xdf10=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0xf10d[_0x2d61b2];return _0x12df89;};'use strict';var Sequelize=require('sequelize');module[_0xdf10('0x0')]={'priority':{'type':Sequelize[_0xdf10('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xdf10('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xdf10('0x3')]()},'description':{'type':Sequelize[_0xdf10('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xdf10('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 2abb047..16ad824 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 _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
+var _0x656f=['offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','intersection','fields','attributes','include','merge','options','find','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count'];(function(_0xb98825,_0x554182){var _0x451d90=function(_0x1e2b76){while(--_0x1e2b76){_0xb98825['push'](_0xb98825['shift']());}};_0x451d90(++_0x554182);}(_0x656f,0x17b));var _0xf656=function(_0x22bf45,_0x5d3a41){_0x22bf45=_0x22bf45-0x0;var _0x244d4a=_0x656f[_0x22bf45];return _0x244d4a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf656('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf656('0x1'));var jsonpatch=require(_0xf656('0x2'));var rp=require(_0xf656('0x3'));var moment=require(_0xf656('0x4'));var BPromise=require(_0xf656('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf656('0x6'));var csv=require('to-csv');var ejs=require(_0xf656('0x7'));var fs=require('fs');var _=require(_0xf656('0x8'));var squel=require(_0xf656('0x9'));var crypto=require(_0xf656('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf656('0xb'));var toCsv=require(_0xf656('0xc'));var querystring=require(_0xf656('0xd'));var Papa=require(_0xf656('0xe'));var Redis=require(_0xf656('0xf'));var authService=require(_0xf656('0x10'));var qs=require(_0xf656('0x11'));var as=require(_0xf656('0x12'));var hardwareService=require(_0xf656('0x13'));var logger=require('../../config/logger')(_0xf656('0x14'));var utils=require(_0xf656('0x15'));var config=require(_0xf656('0x16'));var db=require(_0xf656('0x17'))['db'];function respondWithStatusCode(_0x338057,_0x5dad8b){_0x5dad8b=_0x5dad8b||0xcc;return function(_0x46ec68){if(_0x46ec68){return _0x338057[_0xf656('0x18')](_0x5dad8b);}return _0x338057[_0xf656('0x19')](_0x5dad8b)['end']();};}function respondWithResult(_0x540b6f,_0x1a128f){_0x1a128f=_0x1a128f||0xc8;return function(_0x3b6f24){if(_0x3b6f24){return _0x540b6f[_0xf656('0x19')](_0x1a128f)['json'](_0x3b6f24);}};}function respondWithFilteredResult(_0xbe917e,_0x9a5bf1){return function(_0x4d105b){if(_0x4d105b){var _0x183f10=_0x4d105b[_0xf656('0x1a')],_0x3b8aec=_0x9a5bf1[_0xf656('0x1b')],_0x4aa1de=_0x9a5bf1[_0xf656('0x1b')]+_0x9a5bf1[_0xf656('0x1c')],_0x3a218b;if(_0x4aa1de>=_0x183f10){_0x4aa1de=_0x183f10;_0x3a218b=0xc8;}else{_0x3a218b=0xce;}_0xbe917e['status'](_0x3a218b);return _0xbe917e[_0xf656('0x1d')](_0xf656('0x1e'),_0x3b8aec+'-'+_0x4aa1de+'/'+_0x183f10)['json'](_0x4d105b);}return null;};}function patchUpdates(_0x499061){return function(_0x124c3f){try{jsonpatch[_0xf656('0x1f')](_0x124c3f,_0x499061,!![]);}catch(_0x26af19){return BPromise[_0xf656('0x20')](_0x26af19);}return _0x124c3f[_0xf656('0x21')]();};}function saveUpdates(_0x305b22,_0x4d46dd){return function(_0x2349a3){if(_0x2349a3){return _0x2349a3[_0xf656('0x22')](_0x305b22)[_0xf656('0x23')](function(_0xe4d6d4){return _0xe4d6d4;});}return null;};}function removeEntity(_0x6f1f6,_0xa004ee){return function(_0x7eb607){if(_0x7eb607){return _0x7eb607[_0xf656('0x24')]()['then'](function(){_0x6f1f6[_0xf656('0x19')](0xcc)[_0xf656('0x25')]();});}};}function handleEntityNotFound(_0x2535ae,_0x3b44dc){return function(_0x29e139){if(!_0x29e139){_0x2535ae['sendStatus'](0x194);}return _0x29e139;};}function handleError(_0x2130e4,_0xafedcc){_0xafedcc=_0xafedcc||0x1f4;return function(_0x1ce9ea){logger[_0xf656('0x26')](_0x1ce9ea[_0xf656('0x27')]);if(_0x1ce9ea[_0xf656('0x28')]){delete _0x1ce9ea[_0xf656('0x28')];}_0x2130e4[_0xf656('0x19')](_0xafedcc)[_0xf656('0x29')](_0x1ce9ea);};}exports[_0xf656('0x2a')]=function(_0x30b8a9,_0x163b60){var _0x5eace5={'raw':!![],'where':{'id':_0x30b8a9[_0xf656('0x2b')]['id']}},_0x523400={};_0x523400[_0xf656('0x2c')]=_[_0xf656('0x2d')](db[_0xf656('0x2e')]['rawAttributes']);_0x523400[_0xf656('0x2f')]=_['keys'](_0x30b8a9[_0xf656('0x2f')]);_0x523400[_0xf656('0x30')]=_[_0xf656('0x31')](_0x523400[_0xf656('0x2c')],_0x523400['query']);_0x5eace5['attributes']=_[_0xf656('0x31')](_0x523400[_0xf656('0x2c')],qs['fields'](_0x30b8a9[_0xf656('0x2f')][_0xf656('0x32')]));_0x5eace5[_0xf656('0x33')]=_0x5eace5['attributes']['length']?_0x5eace5[_0xf656('0x33')]:_0x523400[_0xf656('0x2c')];if(_0x30b8a9[_0xf656('0x2f')]['includeAll']){_0x5eace5[_0xf656('0x34')]=[{'all':!![]}];}_0x5eace5=_[_0xf656('0x35')]({},_0x5eace5,_0x30b8a9[_0xf656('0x36')]);return db['ChatApplication'][_0xf656('0x37')](_0x5eace5)['then'](handleEntityNotFound(_0x163b60,null))[_0xf656('0x23')](respondWithResult(_0x163b60,null))[_0xf656('0x38')](handleError(_0x163b60,null));};exports[_0xf656('0x22')]=function(_0x591231,_0x46d1fd){if(_0x591231['body']['id']){delete _0x591231[_0xf656('0x39')]['id'];}return db[_0xf656('0x2e')][_0xf656('0x37')]({'where':{'id':_0x591231[_0xf656('0x2b')]['id']}})[_0xf656('0x23')](handleEntityNotFound(_0x46d1fd,null))[_0xf656('0x23')](saveUpdates(_0x591231[_0xf656('0x39')],null))[_0xf656('0x23')](respondWithResult(_0x46d1fd,null))['catch'](handleError(_0x46d1fd,null));};exports[_0xf656('0x24')]=function(_0x4aae69,_0xfb1311){return db[_0xf656('0x2e')][_0xf656('0x37')]({'where':{'id':_0x4aae69['params']['id']}})[_0xf656('0x23')](handleEntityNotFound(_0xfb1311,null))['then'](removeEntity(_0xfb1311,null))[_0xf656('0x38')](handleError(_0xfb1311,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index f5b0bd8..5af407e 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 _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
+var _0xf8fa=['bluebird','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','util','../../config/logger'];(function(_0x46e523,_0xe6fccb){var _0x5da0ee=function(_0x396682){while(--_0x396682){_0x46e523['push'](_0x46e523['shift']());}};_0x5da0ee(++_0xe6fccb);}(_0xf8fa,0x152));var _0xaf8f=function(_0x2fc026,_0xdc4f7a){_0x2fc026=_0x2fc026-0x0;var _0x34d056=_0xf8fa[_0x2fc026];return _0x34d056;};'use strict';var _=require('lodash');var util=require(_0xaf8f('0x0'));var logger=require(_0xaf8f('0x1'))('api');var moment=require('moment');var BPromise=require(_0xaf8f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaf8f('0x3'));var config=require(_0xaf8f('0x4'));var attributes=require(_0xaf8f('0x5'));module[_0xaf8f('0x6')]=function(_0x3aa969,_0x41aa35){return _0x3aa969[_0xaf8f('0x7')](_0xaf8f('0x8'),attributes,{'tableName':_0xaf8f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 85d9ffa..4cd9e42 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 _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
+var _0x0f7c=['info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then'];(function(_0x1cbc43,_0x5d0f5d){var _0x3d0913=function(_0x36708f){while(--_0x36708f){_0x1cbc43['push'](_0x1cbc43['shift']());}};_0x3d0913(++_0x5d0f5d);}(_0x0f7c,0x131));var _0xc0f7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0f7c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc0f7('0x0'));var util=require(_0xc0f7('0x1'));var moment=require(_0xc0f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc0f7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc0f7('0x4'));var logger=require(_0xc0f7('0x5'))(_0xc0f7('0x6'));var config=require(_0xc0f7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc0f7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6904d2,_0x49df94,_0x403cd7){return new BPromise(function(_0xb716e7,_0x45e480){return client['request'](_0x6904d2,_0x403cd7)[_0xc0f7('0x9')](function(_0x1f968c){logger[_0xc0f7('0xa')](_0xc0f7('0xb'),_0x49df94,_0xc0f7('0xc'));logger[_0xc0f7('0xd')](_0xc0f7('0xe'),_0x49df94,_0xc0f7('0xc'),JSON[_0xc0f7('0xf')](_0x1f968c));if(_0x1f968c['error']){if(_0x1f968c[_0xc0f7('0x10')][_0xc0f7('0x11')]===0x1f4){logger[_0xc0f7('0x10')]('ChatApplication,\x20%s,\x20%s',_0x49df94,_0x1f968c[_0xc0f7('0x10')][_0xc0f7('0x12')]);return _0x45e480(_0x1f968c[_0xc0f7('0x10')][_0xc0f7('0x12')]);}logger['error'](_0xc0f7('0xb'),_0x49df94,_0x1f968c[_0xc0f7('0x10')][_0xc0f7('0x12')]);return _0xb716e7(_0x1f968c[_0xc0f7('0x10')][_0xc0f7('0x12')]);}else{logger[_0xc0f7('0xa')](_0xc0f7('0xb'),_0x49df94,_0xc0f7('0xc'));_0xb716e7(_0x1f968c[_0xc0f7('0x13')]['message']);}})[_0xc0f7('0x14')](function(_0x71dfde){logger[_0xc0f7('0x10')](_0xc0f7('0xb'),_0x49df94,_0x71dfde);_0x45e480(_0x71dfde);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 6b80533..a85b252 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 _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
+var _0xfe72=['update','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id'];(function(_0x47680e,_0x1f2270){var _0x35f749=function(_0x5a9df4){while(--_0x5a9df4){_0x47680e['push'](_0x47680e['shift']());}};_0x35f749(++_0x1f2270);}(_0xfe72,0x16a));var _0x2fe7=function(_0x34e9d1,_0x2ca32a){_0x34e9d1=_0x34e9d1-0x0;var _0x33c49e=_0xfe72[_0x34e9d1];return _0x33c49e;};'use strict';var multer=require(_0x2fe7('0x0'));var util=require(_0x2fe7('0x1'));var path=require(_0x2fe7('0x2'));var timeout=require(_0x2fe7('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x2fe7('0x4'));var interaction=require(_0x2fe7('0x5'));var config=require(_0x2fe7('0x6'));var controller=require(_0x2fe7('0x7'));router[_0x2fe7('0x8')]('/:id',auth[_0x2fe7('0x9')](),controller[_0x2fe7('0xa')]);router[_0x2fe7('0xb')](_0x2fe7('0xc'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0xd')]);router['delete'](_0x2fe7('0xc'),auth[_0x2fe7('0x9')](),controller['destroy']);module[_0x2fe7('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 27b710b..84400cd 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 _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
+var _0x4fe8=['BOOLEAN','sequelize'];(function(_0x43f084,_0xb48804){var _0x2a6dde=function(_0x1fab7f){while(--_0x1fab7f){_0x43f084['push'](_0x43f084['shift']());}};_0x2a6dde(++_0xb48804);}(_0x4fe8,0x187));var _0x84fe=function(_0x2d775a,_0x478687){_0x2d775a=_0x2d775a-0x0;var _0x26ae53=_0x4fe8[_0x2d775a];return _0x26ae53;};'use strict';var Sequelize=require(_0x84fe('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x84fe('0x1')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index f360155..3c2d371 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 _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
+var _0xd80e=['hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','intersection','find','create','body','update','describe','ChatInternalMessage','user','addMembers','ids','getMembers','findOne','User','nolimit','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','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','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','offset','limit','Content-Range','reject','save','end','stack','name','send','index','ChatGroup','rawAttributes','type','key','model','map','query','keys','filters','attributes','fields','length'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0xd80e,0x1c4));var _0xed80=function(_0x509827,_0x145dd8){_0x509827=_0x509827-0x0;var _0x336e6c=_0xd80e[_0x509827];return _0x336e6c;};'use strict';var pdf=require(_0xed80('0x0'));var emlformat=require(_0xed80('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xed80('0x2'));var jsonpatch=require(_0xed80('0x3'));var rp=require(_0xed80('0x4'));var moment=require('moment');var BPromise=require(_0xed80('0x5'));var Mustache=require(_0xed80('0x6'));var util=require(_0xed80('0x7'));var path=require('path');var sox=require(_0xed80('0x8'));var csv=require(_0xed80('0x9'));var ejs=require(_0xed80('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xed80('0xb'));var crypto=require(_0xed80('0xc'));var jsforce=require(_0xed80('0xd'));var deskjs=require(_0xed80('0xe'));var toCsv=require(_0xed80('0x9'));var querystring=require(_0xed80('0xf'));var Papa=require(_0xed80('0x10'));var Redis=require('ioredis');var authService=require(_0xed80('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xed80('0x12'));var hardwareService=require(_0xed80('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xed80('0x14'));var db=require(_0xed80('0x15'))['db'];config['redis']=_['defaults'](config[_0xed80('0x16')],{'host':_0xed80('0x17'),'port':0x18eb});var socket=require(_0xed80('0x18'))(new Redis(config['redis']));require(_0xed80('0x19'))[_0xed80('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xed80('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0xf87d67,_0x1b8d87,_0x4d7c99){if(_0x4d7c99){var _0x3e6db2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e6db2[_0xed80('0x1c')](_0x1b8d87)){return _0xf87d67;}else{throw new db[(_0xed80('0x1d'))]['ValidationError'](_0xed80('0x1e'));}}else{return _0xf87d67;}}function respondWithRpcPromise(_0x55a7fe,_0x4ce8f9,_0x441fef,_0x499a08){return new BPromise(function(_0xfcddf3,_0x29b72a){var _0x48a1ad=_0x499a08||client;return _0x48a1ad[_0xed80('0x1f')](_0x55a7fe,_0x441fef)[_0xed80('0x20')](function(_0x503f6f){logger['info'](_0xed80('0x21'),_0x4ce8f9,_0xed80('0x22'));logger[_0xed80('0x23')](_0xed80('0x24'),_0x4ce8f9,'request\x20sent',JSON[_0xed80('0x25')](_0x503f6f));if(_0x503f6f[_0xed80('0x26')]){if(_0x503f6f['error'][_0xed80('0x27')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x4ce8f9,_0x503f6f[_0xed80('0x26')][_0xed80('0x28')]);return _0x29b72a(_0x503f6f['error'][_0xed80('0x28')]);}logger[_0xed80('0x26')](_0xed80('0x21'),_0x4ce8f9,_0x503f6f[_0xed80('0x26')][_0xed80('0x28')]);return _0xfcddf3(_0x503f6f[_0xed80('0x26')][_0xed80('0x28')]);}else{logger[_0xed80('0x29')](_0xed80('0x21'),_0x4ce8f9,_0xed80('0x22'));_0xfcddf3(_0x503f6f[_0xed80('0x2a')][_0xed80('0x28')]);}})[_0xed80('0x2b')](function(_0x4d19ff){logger['error']('ChatGroup,\x20%s,\x20%s',_0x4ce8f9,_0x4d19ff);_0x29b72a(_0x4d19ff);});});}function respondWithStatusCode(_0x1bc04f,_0x108886){_0x108886=_0x108886||0xcc;return function(_0x4d1a96){if(_0x4d1a96){return _0x1bc04f[_0xed80('0x2c')](_0x108886);}return _0x1bc04f[_0xed80('0x2d')](_0x108886)['end']();};}function respondWithResult(_0x4118a5,_0x1f85af){_0x1f85af=_0x1f85af||0xc8;return function(_0x4022f8){if(_0x4022f8){return _0x4118a5[_0xed80('0x2d')](_0x1f85af)['json'](_0x4022f8);}};}function respondWithFilteredResult(_0x286286,_0x138573){return function(_0x518c09){if(_0x518c09){var _0x108d83=_0x518c09['count'],_0x4502b0=_0x138573['offset'],_0x41d70=_0x138573[_0xed80('0x2e')]+_0x138573[_0xed80('0x2f')],_0x1cadc8;if(_0x41d70>=_0x108d83){_0x41d70=_0x108d83;_0x1cadc8=0xc8;}else{_0x1cadc8=0xce;}_0x286286[_0xed80('0x2d')](_0x1cadc8);return _0x286286['set'](_0xed80('0x30'),_0x4502b0+'-'+_0x41d70+'/'+_0x108d83)['json'](_0x518c09);}return null;};}function patchUpdates(_0x4d391b){return function(_0x1c560b){try{jsonpatch['apply'](_0x1c560b,_0x4d391b,!![]);}catch(_0x51ee86){return BPromise[_0xed80('0x31')](_0x51ee86);}return _0x1c560b[_0xed80('0x32')]();};}function saveUpdates(_0x354f0c,_0x27cf41){return function(_0x2f7aac){if(_0x2f7aac){return _0x2f7aac['update'](_0x354f0c)[_0xed80('0x20')](function(_0x5887c3){return _0x5887c3;});}return null;};}function removeEntity(_0x2c0cc2,_0x5a206c){return function(_0x215f15){if(_0x215f15){return _0x215f15['destroy']()['then'](function(){_0x2c0cc2[_0xed80('0x2d')](0xcc)[_0xed80('0x33')]();});}};}function handleEntityNotFound(_0x43bfa7,_0x3f73dc){return function(_0x1b3ef2){if(!_0x1b3ef2){_0x43bfa7[_0xed80('0x2c')](0x194);}return _0x1b3ef2;};}function handleError(_0xad8ba7,_0x5a74e6){_0x5a74e6=_0x5a74e6||0x1f4;return function(_0x76232){logger[_0xed80('0x26')](_0x76232[_0xed80('0x34')]);if(_0x76232[_0xed80('0x35')]){delete _0x76232['name'];}_0xad8ba7[_0xed80('0x2d')](_0x5a74e6)[_0xed80('0x36')](_0x76232);};}exports[_0xed80('0x37')]=function(_0x16de3c,_0x3069eb){var _0x3a7074={},_0x1a77dc={},_0x342410={'count':0x0,'rows':[]};var _0x4eda48=_['map'](db[_0xed80('0x38')][_0xed80('0x39')],function(_0x5e154c){return{'name':_0x5e154c['fieldName'],'type':_0x5e154c[_0xed80('0x3a')][_0xed80('0x3b')]};});_0x1a77dc[_0xed80('0x3c')]=_[_0xed80('0x3d')](_0x4eda48,_0xed80('0x35'));_0x1a77dc[_0xed80('0x3e')]=_[_0xed80('0x3f')](_0x16de3c[_0xed80('0x3e')]);_0x1a77dc[_0xed80('0x40')]=_['intersection'](_0x1a77dc[_0xed80('0x3c')],_0x1a77dc[_0xed80('0x3e')]);_0x3a7074[_0xed80('0x41')]=_['intersection'](_0x1a77dc['model'],qs[_0xed80('0x42')](_0x16de3c[_0xed80('0x3e')][_0xed80('0x42')]));_0x3a7074[_0xed80('0x41')]=_0x3a7074['attributes'][_0xed80('0x43')]?_0x3a7074[_0xed80('0x41')]:_0x1a77dc[_0xed80('0x3c')];if(!_0x16de3c['query'][_0xed80('0x44')]('nolimit')){_0x3a7074[_0xed80('0x2f')]=qs['limit'](_0x16de3c[_0xed80('0x3e')][_0xed80('0x2f')]);_0x3a7074[_0xed80('0x2e')]=qs[_0xed80('0x2e')](_0x16de3c[_0xed80('0x3e')][_0xed80('0x2e')]);}_0x3a7074[_0xed80('0x45')]=qs[_0xed80('0x46')](_0x16de3c['query']['sort']);_0x3a7074[_0xed80('0x47')]=qs[_0xed80('0x40')](_[_0xed80('0x48')](_0x16de3c[_0xed80('0x3e')],_0x1a77dc[_0xed80('0x40')]),_0x4eda48);if(_0x16de3c[_0xed80('0x3e')][_0xed80('0x49')]){_0x3a7074['where']=_[_0xed80('0x4a')](_0x3a7074['where'],{'$or':_[_0xed80('0x3d')](_0x4eda48,function(_0xa4fe75){if(_0xa4fe75[_0xed80('0x3a')]!==_0xed80('0x4b')){var _0x24d496={};_0x24d496[_0xa4fe75[_0xed80('0x35')]]={'$like':'%'+_0x16de3c[_0xed80('0x3e')][_0xed80('0x49')]+'%'};return _0x24d496;}})});}_0x3a7074=_[_0xed80('0x4a')]({},_0x3a7074,_0x16de3c[_0xed80('0x4c')]);var _0x2811e0={'where':_0x3a7074[_0xed80('0x47')]};return db['ChatGroup'][_0xed80('0x4d')](_0x2811e0)['then'](function(_0x5fd5af){_0x342410[_0xed80('0x4d')]=_0x5fd5af;if(_0x16de3c[_0xed80('0x3e')][_0xed80('0x4e')]){_0x3a7074[_0xed80('0x4f')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x3a7074);})[_0xed80('0x20')](function(_0x7e631a){_0x342410[_0xed80('0x50')]=_0x7e631a;return _0x342410;})[_0xed80('0x20')](respondWithFilteredResult(_0x3069eb,_0x3a7074))[_0xed80('0x2b')](handleError(_0x3069eb,null));};exports[_0xed80('0x51')]=function(_0x8689a7,_0x5aecad){var _0xa097b2={'raw':!![],'where':{'id':_0x8689a7[_0xed80('0x52')]['id']}},_0x55184a={};_0x55184a[_0xed80('0x3c')]=_[_0xed80('0x3f')](db[_0xed80('0x38')][_0xed80('0x39')]);_0x55184a[_0xed80('0x3e')]=_[_0xed80('0x3f')](_0x8689a7['query']);_0x55184a['filters']=_[_0xed80('0x53')](_0x55184a['model'],_0x55184a[_0xed80('0x3e')]);_0xa097b2[_0xed80('0x41')]=_[_0xed80('0x53')](_0x55184a[_0xed80('0x3c')],qs[_0xed80('0x42')](_0x8689a7[_0xed80('0x3e')]['fields']));_0xa097b2['attributes']=_0xa097b2['attributes']['length']?_0xa097b2['attributes']:_0x55184a[_0xed80('0x3c')];if(_0x8689a7[_0xed80('0x3e')][_0xed80('0x4e')]){_0xa097b2[_0xed80('0x4f')]=[{'all':!![]}];}_0xa097b2=_['merge']({},_0xa097b2,_0x8689a7[_0xed80('0x4c')]);return db[_0xed80('0x38')][_0xed80('0x54')](_0xa097b2)[_0xed80('0x20')](handleEntityNotFound(_0x5aecad,null))[_0xed80('0x20')](respondWithResult(_0x5aecad,null))[_0xed80('0x2b')](handleError(_0x5aecad,null));};exports[_0xed80('0x55')]=function(_0x38acc0,_0x547f5b){return db[_0xed80('0x38')][_0xed80('0x55')](_0x38acc0[_0xed80('0x56')],{})[_0xed80('0x20')](respondWithResult(_0x547f5b,0xc9))[_0xed80('0x2b')](handleError(_0x547f5b,null));};exports[_0xed80('0x57')]=function(_0x94ba12,_0x21409b){if(_0x94ba12['body']['id']){delete _0x94ba12[_0xed80('0x56')]['id'];}return db[_0xed80('0x38')][_0xed80('0x54')]({'where':{'id':_0x94ba12[_0xed80('0x52')]['id']}})[_0xed80('0x20')](handleEntityNotFound(_0x21409b,null))[_0xed80('0x20')](saveUpdates(_0x94ba12[_0xed80('0x56')],null))['then'](respondWithResult(_0x21409b,null))['catch'](handleError(_0x21409b,null));};exports['destroy']=function(_0x64f112,_0x4b8f3b){return db['ChatGroup']['find']({'where':{'id':_0x64f112['params']['id']}})[_0xed80('0x20')](handleEntityNotFound(_0x4b8f3b,null))[_0xed80('0x20')](removeEntity(_0x4b8f3b,null))[_0xed80('0x2b')](handleError(_0x4b8f3b,null));};exports[_0xed80('0x58')]=function(_0x49a038,_0x5d4e82){return db[_0xed80('0x38')][_0xed80('0x58')]()['then'](respondWithResult(_0x5d4e82,null))[_0xed80('0x2b')](handleError(_0x5d4e82,null));};exports['getUnread']=function(_0x1f3e2d,_0xb3517,_0x38bf30){return db[_0xed80('0x59')][_0xed80('0x4d')]({'where':{'ChatGroupId':_0x1f3e2d[_0xed80('0x52')]['id'],'ToId':_0x1f3e2d[_0xed80('0x5a')]['id'],'read':![]}})['then'](function(_0x27f3af){return{'id':_['toInteger'](_0x1f3e2d[_0xed80('0x52')]['id']),'count':_0x27f3af};})[_0xed80('0x20')](respondWithResult(_0xb3517,null))['catch'](handleError(_0xb3517,null));};exports[_0xed80('0x5b')]=function(_0x345d3f,_0xeb77ca,_0xfbb014){return db[_0xed80('0x38')][_0xed80('0x54')]({'where':{'id':_0x345d3f[_0xed80('0x52')]['id']}})[_0xed80('0x20')](handleEntityNotFound(_0xeb77ca,null))['then'](function(_0x5b5cac){if(_0x5b5cac){return _0x5b5cac[_0xed80('0x5b')](_0x345d3f[_0xed80('0x56')][_0xed80('0x5c')],_['omit'](_0x345d3f[_0xed80('0x56')],[_0xed80('0x5c'),'id'])||{});}})['then'](respondWithResult(_0xeb77ca,null))[_0xed80('0x2b')](handleError(_0xeb77ca,null));};exports[_0xed80('0x5d')]=function(_0xbee581,_0x16505c,_0x4491c0){var _0x2a693f={};var _0x36611b={};var _0x34f285;var _0x4c31a1;return db[_0xed80('0x38')][_0xed80('0x5e')]({'where':{'id':_0xbee581[_0xed80('0x52')]['id']}})['then'](handleEntityNotFound(_0x16505c,null))[_0xed80('0x20')](function(_0xd2c8ad){if(_0xd2c8ad){_0x34f285=_0xd2c8ad;_0x36611b[_0xed80('0x3c')]=_['keys'](db[_0xed80('0x5f')][_0xed80('0x39')]);_0x36611b[_0xed80('0x3e')]=_[_0xed80('0x3f')](_0xbee581[_0xed80('0x3e')]);_0x36611b[_0xed80('0x40')]=_[_0xed80('0x53')](_0x36611b[_0xed80('0x3c')],_0x36611b[_0xed80('0x3e')]);_0x2a693f[_0xed80('0x41')]=_[_0xed80('0x53')](_0x36611b['model'],qs['fields'](_0xbee581[_0xed80('0x3e')][_0xed80('0x42')]));_0x2a693f[_0xed80('0x41')]=_0x2a693f[_0xed80('0x41')][_0xed80('0x43')]?_0x2a693f[_0xed80('0x41')]:_0x36611b[_0xed80('0x3c')];_0x2a693f[_0xed80('0x45')]=qs[_0xed80('0x46')](_0xbee581[_0xed80('0x3e')][_0xed80('0x46')]);_0x2a693f[_0xed80('0x47')]=qs[_0xed80('0x40')](_['pick'](_0xbee581['query'],_0x36611b[_0xed80('0x40')]));if(_0xbee581[_0xed80('0x3e')]['filter']){_0x2a693f[_0xed80('0x47')]=_[_0xed80('0x4a')](_0x2a693f[_0xed80('0x47')],{'$or':_[_0xed80('0x3d')](_0x2a693f[_0xed80('0x41')],function(_0x2f1b63){var _0x7d8a67={};_0x7d8a67[_0x2f1b63]={'$like':'%'+_0xbee581[_0xed80('0x3e')][_0xed80('0x49')]+'%'};return _0x7d8a67;})});}_0x2a693f=_[_0xed80('0x4a')]({},_0x2a693f,_0xbee581['options']);return _0x34f285[_0xed80('0x5d')](_0x2a693f);}})[_0xed80('0x20')](function(_0x81723f){if(_0x81723f){_0x4c31a1=_0x81723f['length'];if(!_0xbee581[_0xed80('0x3e')]['hasOwnProperty'](_0xed80('0x60'))){_0x2a693f[_0xed80('0x2f')]=qs['limit'](_0xbee581[_0xed80('0x3e')]['limit']);_0x2a693f[_0xed80('0x2e')]=qs[_0xed80('0x2e')](_0xbee581[_0xed80('0x3e')][_0xed80('0x2e')]);}return _0x34f285[_0xed80('0x5d')](_0x2a693f);}})['then'](function(_0x1c8fe1){if(_0x1c8fe1){return _0x1c8fe1?{'count':_0x4c31a1,'rows':_0x1c8fe1}:null;}})[_0xed80('0x20')](respondWithResult(_0x16505c,null))[_0xed80('0x2b')](handleError(_0x16505c,null));};exports['removeMembers']=function(_0x530592,_0x10fba2,_0x4a43c3){return db[_0xed80('0x38')]['find']({'where':{'id':_0x530592['params']['id']}})[_0xed80('0x20')](handleEntityNotFound(_0x10fba2,null))[_0xed80('0x20')](function(_0x1877df){if(_0x1877df){return _0x1877df['removeMembers'](_0x530592[_0xed80('0x3e')][_0xed80('0x5c')]);}})[_0xed80('0x20')](respondWithStatusCode(_0x10fba2,null))[_0xed80('0x2b')](handleError(_0x10fba2,null));};exports[_0xed80('0x61')]=function(_0x193b39,_0x4d739d,_0x31c0ab){if(_0x193b39['body']['id']){delete _0x193b39['body']['id'];}return db[_0xed80('0x38')]['find']({'where':{'id':_0x193b39[_0xed80('0x52')]['id']}})['then'](handleEntityNotFound(_0x4d739d,null))[_0xed80('0x20')](function(_0x53d71f){if(_0x53d71f){_0x193b39[_0xed80('0x56')][_0xed80('0x62')]=_0x53d71f['id'];return db['ChatInternalMessage'][_0xed80('0x55')](_0x193b39[_0xed80('0x56')]);}})[_0xed80('0x20')](respondWithResult(_0x4d739d,null))[_0xed80('0x2b')](handleError(_0x4d739d,null));};exports[_0xed80('0x63')]=function(_0x46a40f,_0x2da904,_0x156692){var _0xbd0503={};var _0x236f26={};var _0x565a09;var _0x3cd5a1;return db['ChatGroup'][_0xed80('0x5e')]({'where':{'id':_0x46a40f[_0xed80('0x52')]['id']}})[_0xed80('0x20')](handleEntityNotFound(_0x2da904,null))[_0xed80('0x20')](function(_0x4ab846){if(_0x4ab846){_0x565a09=_0x4ab846;_0x236f26['model']=_[_0xed80('0x3f')](db[_0xed80('0x59')]['rawAttributes']);_0x236f26[_0xed80('0x3e')]=_[_0xed80('0x3f')](_0x46a40f[_0xed80('0x3e')]);_0x236f26['filters']=_[_0xed80('0x53')](_0x236f26['model'],_0x236f26[_0xed80('0x3e')]);_0xbd0503['attributes']=_[_0xed80('0x53')](_0x236f26['model'],qs[_0xed80('0x42')](_0x46a40f['query']['fields']));_0xbd0503['attributes']=_0xbd0503['attributes'][_0xed80('0x43')]?_0xbd0503['attributes']:_0x236f26[_0xed80('0x3c')];_0xbd0503[_0xed80('0x45')]=qs[_0xed80('0x46')](_0x46a40f[_0xed80('0x3e')][_0xed80('0x46')]);_0xbd0503[_0xed80('0x47')]=qs[_0xed80('0x40')](_[_0xed80('0x48')](_0x46a40f['query'],_0x236f26[_0xed80('0x40')]));if(_0x46a40f[_0xed80('0x3e')][_0xed80('0x49')]){_0xbd0503['where']=_[_0xed80('0x4a')](_0xbd0503[_0xed80('0x47')],{'$or':_[_0xed80('0x3d')](_0xbd0503['attributes'],function(_0x18c6c4){var _0x14930f={};_0x14930f[_0x18c6c4]={'$like':'%'+_0x46a40f[_0xed80('0x3e')][_0xed80('0x49')]+'%'};return _0x14930f;})});}if(_0x46a40f[_0xed80('0x3e')][_0xed80('0x64')]){var _0x31d329=_0x46a40f['query'][_0xed80('0x64')][_0xed80('0x65')](',');var _0x5535f5={};_0x5535f5[_0x31d329[0x0]]={'$gte':moment(_0x31d329[0x1])[_0xed80('0x66')](_0xed80('0x67'))};_0xbd0503[_0xed80('0x47')]=_[_0xed80('0x4a')](_0xbd0503[_0xed80('0x47')],_0x5535f5);}_0xbd0503=_[_0xed80('0x4a')]({},_0xbd0503,_0x46a40f[_0xed80('0x4c')]);return _0x565a09[_0xed80('0x63')](_0xbd0503);}})[_0xed80('0x20')](function(_0x8e3ba3){if(_0x8e3ba3){_0x3cd5a1=_0x8e3ba3[_0xed80('0x43')];if(!_0x46a40f['query'][_0xed80('0x44')](_0xed80('0x60'))){_0xbd0503['limit']=qs['limit'](_0x46a40f['query'][_0xed80('0x2f')]);_0xbd0503[_0xed80('0x2e')]=qs[_0xed80('0x2e')](_0x46a40f[_0xed80('0x3e')][_0xed80('0x2e')]);}return _0x565a09[_0xed80('0x63')](_0xbd0503);}})[_0xed80('0x20')](function(_0x26c59e){if(_0x26c59e){return _0x26c59e?{'count':_0x3cd5a1,'rows':_0x26c59e}:null;}})['then'](respondWithResult(_0x2da904,null))[_0xed80('0x2b')](handleError(_0x2da904,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 33feed4..1cf2d5a 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 _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
+var _0xdb28=['ChatGroup','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x371a18,_0x50ae4c){var _0x59dfb4=function(_0x117c5c){while(--_0x117c5c){_0x371a18['push'](_0x371a18['shift']());}};_0x59dfb4(++_0x50ae4c);}(_0xdb28,0x106));var _0x8db2=function(_0x352e06,_0x211be4){_0x352e06=_0x352e06-0x0;var _0x2a0652=_0xdb28[_0x352e06];return _0x2a0652;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var ChatGroup=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index aa58d4b..1a765bd 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 _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
+var _0x1751=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x4ebdb8,_0x4a2ff9){var _0x3e74a4=function(_0x579898){while(--_0x579898){_0x4ebdb8['push'](_0x4ebdb8['shift']());}};_0x3e74a4(++_0x4a2ff9);}(_0x1751,0x76));var _0x1175=function(_0x1a8067,_0x1197c6){_0x1a8067=_0x1a8067-0x0;var _0x1345a2=_0x1751[_0x1a8067];return _0x1345a2;};'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':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index f730e41..c346ef6 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 _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
+var _0xcc8d=['register','request','info','ChatGroup,\x20%s,\x20%s','debug','stringify','error','request\x20sent','message','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./chatGroup.socket'];(function(_0x21403d,_0x5aad4d){var _0xde481f=function(_0x297aff){while(--_0x297aff){_0x21403d['push'](_0x21403d['shift']());}};_0xde481f(++_0x5aad4d);}(_0xcc8d,0xe5));var _0xdcc8=function(_0x591db7,_0x150445){_0x591db7=_0x591db7-0x0;var _0x4ad760=_0xcc8d[_0x591db7];return _0x4ad760;};'use strict';var _=require(_0xdcc8('0x0'));var util=require('util');var moment=require(_0xdcc8('0x1'));var BPromise=require('bluebird');var rs=require(_0xdcc8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdcc8('0x3'))['db'];var utils=require(_0xdcc8('0x4'));var logger=require(_0xdcc8('0x5'))(_0xdcc8('0x6'));var config=require(_0xdcc8('0x7'));var jayson=require(_0xdcc8('0x8'));var client=jayson[_0xdcc8('0x9')]['http']({'port':0x232a});config[_0xdcc8('0xa')]=_[_0xdcc8('0xb')](config[_0xdcc8('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdcc8('0xc'))[_0xdcc8('0xd')](socket);function respondWithRpcPromise(_0x52f616,_0x5c3813,_0x436bc6){return new BPromise(function(_0x8a4e9f,_0x25be24){return client[_0xdcc8('0xe')](_0x52f616,_0x436bc6)['then'](function(_0x18c750){logger[_0xdcc8('0xf')](_0xdcc8('0x10'),_0x5c3813,'request\x20sent');logger[_0xdcc8('0x11')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5c3813,'request\x20sent',JSON[_0xdcc8('0x12')](_0x18c750));if(_0x18c750[_0xdcc8('0x13')]){if(_0x18c750[_0xdcc8('0x13')]['code']===0x1f4){logger[_0xdcc8('0x13')](_0xdcc8('0x10'),_0x5c3813,_0x18c750[_0xdcc8('0x13')]['message']);return _0x25be24(_0x18c750[_0xdcc8('0x13')]['message']);}logger['error'](_0xdcc8('0x10'),_0x5c3813,_0x18c750[_0xdcc8('0x13')]['message']);return _0x8a4e9f(_0x18c750[_0xdcc8('0x13')]['message']);}else{logger['info'](_0xdcc8('0x10'),_0x5c3813,_0xdcc8('0x14'));_0x8a4e9f(_0x18c750['result'][_0xdcc8('0x15')]);}})['catch'](function(_0x3f6045){logger[_0xdcc8('0x13')]('ChatGroup,\x20%s,\x20%s',_0x5c3813,_0x3f6045);_0x25be24(_0x3f6045);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 8554007..6afbaef 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 _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
+var _0xafcc=['removeListener','register','length','save','remove','update','emit'];(function(_0x9464a8,_0x1dc07a){var _0x15d2cc=function(_0x22d218){while(--_0x22d218){_0x9464a8['push'](_0x9464a8['shift']());}};_0x15d2cc(++_0x1dc07a);}(_0xafcc,0xf1));var _0xcafc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xafcc[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xcafc('0x0'),_0xcafc('0x1'),_0xcafc('0x2')];function createListener(_0x14533b,_0x5f0be7){return function(_0x57cbbe){_0x5f0be7[_0xcafc('0x3')](_0x14533b,_0x57cbbe);};}function removeListener(_0x4b43f2,_0x3e582f){return function(){ChatGroupEvents[_0xcafc('0x4')](_0x4b43f2,_0x3e582f);};}exports[_0xcafc('0x5')]=function(_0x5b7f27){for(var _0x3d9b5d=0x0,_0x1abae3=events[_0xcafc('0x6')];_0x3d9b5d<_0x1abae3;_0x3d9b5d++){var _0x32cde9=events[_0x3d9b5d];var _0x14c0a9=createListener('chatGroup:'+_0x32cde9,_0x5b7f27);ChatGroupEvents['on'](_0x32cde9,_0x14c0a9);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 9370af8..9904286 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 _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
+var _0x3463=['create','addMembers','post','addMessage','put','/:id','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages'];(function(_0x445e9d,_0x653aaf){var _0x2a9360=function(_0x326689){while(--_0x326689){_0x445e9d['push'](_0x445e9d['shift']());}};_0x2a9360(++_0x653aaf);}(_0x3463,0x184));var _0x3346=function(_0x52d303,_0x26f460){_0x52d303=_0x52d303-0x0;var _0x42d1c6=_0x3463[_0x52d303];return _0x42d1c6;};'use strict';var multer=require('multer');var util=require(_0x3346('0x0'));var path=require(_0x3346('0x1'));var timeout=require(_0x3346('0x2'));var express=require(_0x3346('0x3'));var router=express['Router']();var auth=require(_0x3346('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3346('0x5'));var controller=require(_0x3346('0x6'));router['get']('/',auth[_0x3346('0x7')](),controller[_0x3346('0x8')]);router[_0x3346('0x9')](_0x3346('0xa'),auth[_0x3346('0x7')](),controller['describe']);router[_0x3346('0x9')]('/:id',auth[_0x3346('0x7')](),controller[_0x3346('0xb')]);router['get']('/:id/unread',auth[_0x3346('0x7')](),controller[_0x3346('0xc')]);router[_0x3346('0x9')](_0x3346('0xd'),auth[_0x3346('0x7')](),controller[_0x3346('0xe')]);router[_0x3346('0x9')](_0x3346('0xf'),auth['isAuthenticated'](),controller[_0x3346('0x10')]);router['post']('/',auth[_0x3346('0x7')](),controller[_0x3346('0x11')]);router['post']('/:id/members',auth['isAuthenticated'](),controller[_0x3346('0x12')]);router[_0x3346('0x13')](_0x3346('0xf'),auth[_0x3346('0x7')](),controller[_0x3346('0x14')]);router[_0x3346('0x15')](_0x3346('0x16'),auth[_0x3346('0x7')](),controller['update']);router[_0x3346('0x17')]('/:id',auth[_0x3346('0x7')](),controller[_0x3346('0x18')]);router[_0x3346('0x17')](_0x3346('0xd'),auth['isAuthenticated'](),controller[_0x3346('0x19')]);module[_0x3346('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 bc911ea..455e428 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 _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
+var _0xf74e=['DATE','exports','INTEGER','ENUM','thumb','star','TEXT','STRING','long'];(function(_0x5b39e3,_0x5b49f3){var _0xe11877=function(_0x3f7ebd){while(--_0x3f7ebd){_0x5b39e3['push'](_0x5b39e3['shift']());}};_0xe11877(++_0x5b49f3);}(_0xf74e,0xf4));var _0xef74=function(_0xafb36e,_0x538cf1){_0xafb36e=_0xafb36e-0x0;var _0x2623e3=_0xf74e[_0xafb36e];return _0x2623e3;};'use strict';var Sequelize=require('sequelize');module[_0xef74('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xef74('0x1')]},'ratingType':{'type':Sequelize[_0xef74('0x2')]('star',_0xef74('0x3')),'defaultValue':_0xef74('0x4')},'ratingMessage':{'type':Sequelize[_0xef74('0x5')]},'pathTranscript':{'type':Sequelize[_0xef74('0x5')]},'mailTranscript':{'type':Sequelize[_0xef74('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xef74('0x6')]},'note':{'type':Sequelize[_0xef74('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xef74('0x6')]},'osName':{'type':Sequelize[_0xef74('0x6')]},'osVersion':{'type':Sequelize[_0xef74('0x6')]},'deviceModel':{'type':Sequelize[_0xef74('0x6')]},'deviceVendor':{'type':Sequelize[_0xef74('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xef74('0x6')]},'formData':{'type':Sequelize[_0xef74('0x5')](_0xef74('0x7'))},'read1stAt':{'type':Sequelize[_0xef74('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xef74('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xef74('0x6')]},'customerPort':{'type':Sequelize[_0xef74('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xef74('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index f882798..16ec0c9 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 _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
+var _0x583c=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','Sequelize','ValidationError','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','set','Content-Range','reject','save','update','destroy','stack','name','send','map','fullname','TagIds','Tags','split','ChatInteraction','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','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','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','`\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','value','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','type','body','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','i.ChatWebsiteId\x20IS\x20NULL','sequelize','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','show','params','includeAll','create','describe','vidaooApiKey','vidaooEscalation','POST','MotionCWB:','follow','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','attachmentDownload','findOne','Unauthorized','Attachment','attachId','download','join','root','server/files/attachments/','basename','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','CmContact','agentAlias','customer','%s%d','Visitor','agentIdentifier','website_alias','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','getMyMessages','addTags','omit','emit','removeTags','server','files','attachments','firstName','lastName','ChatWebsite','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',' \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','Owner','N.A.','closedAt','osName','referer','customerIp','customerPort','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.html','toFile','.pdf','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs'];(function(_0x18be2c,_0x551207){var _0x6e56d3=function(_0x10df15){while(--_0x10df15){_0x18be2c['push'](_0x18be2c['shift']());}};_0x6e56d3(++_0x551207);}(_0x583c,0x12b));var _0xc583=function(_0x39106e,_0x586f3d){_0x39106e=_0x39106e-0x0;var _0x892aec=_0x583c[_0x39106e];return _0x892aec;};'use strict';var pdf=require(_0xc583('0x0'));var emlformat=require(_0xc583('0x1'));var rimraf=require(_0xc583('0x2'));var zipdir=require(_0xc583('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc583('0x4'));var moment=require(_0xc583('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc583('0x6'));var path=require(_0xc583('0x7'));var sox=require('sox');var csv=require(_0xc583('0x8'));var ejs=require(_0xc583('0x9'));var fs=require('fs');var _=require(_0xc583('0xa'));var squel=require(_0xc583('0xb'));var crypto=require('crypto');var jsforce=require(_0xc583('0xc'));var deskjs=require(_0xc583('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc583('0xe'));var Papa=require(_0xc583('0xf'));var Redis=require(_0xc583('0x10'));var authService=require(_0xc583('0x11'));var qs=require(_0xc583('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc583('0x13'));var logger=require(_0xc583('0x14'))('api');var utils=require(_0xc583('0x15'));var config=require(_0xc583('0x16'));var db=require('../../mysqldb')['db'];config[_0xc583('0x17')]=_[_0xc583('0x18')](config[_0xc583('0x17')],{'host':_0xc583('0x19'),'port':0x18eb});var socket=require(_0xc583('0x1a'))(new Redis(config[_0xc583('0x17')]));require(_0xc583('0x1b'))[_0xc583('0x1c')](socket);var jayson=require(_0xc583('0x1d'));var client=jayson['client'][_0xc583('0x1e')]({'port':0x232b});var client9004=jayson['client'][_0xc583('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x299fa1,_0x510090,_0x263552){if(_0x263552){var _0x311ad5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x311ad5['test'](_0x510090)){return _0x299fa1;}else{throw new db[(_0xc583('0x1f'))][(_0xc583('0x20'))]('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 _0x299fa1;}}function respondWithRpcPromise(_0x21cf22,_0x8a2d84,_0x12aac2,_0x36e0fd){return new BPromise(function(_0x5433ec,_0x3dd3cc){var _0x48a65a=_0x36e0fd||client;return _0x48a65a[_0xc583('0x21')](_0x21cf22,_0x12aac2)[_0xc583('0x22')](function(_0xfd9a60){logger[_0xc583('0x23')](_0xc583('0x24'),_0x8a2d84,_0xc583('0x25'));logger[_0xc583('0x26')](_0xc583('0x27'),_0x8a2d84,_0xc583('0x25'),JSON[_0xc583('0x28')](_0xfd9a60));if(_0xfd9a60[_0xc583('0x29')]){if(_0xfd9a60[_0xc583('0x29')][_0xc583('0x2a')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x8a2d84,_0xfd9a60[_0xc583('0x29')][_0xc583('0x2b')]);return _0x3dd3cc(_0xfd9a60[_0xc583('0x29')]['message']);}logger[_0xc583('0x29')](_0xc583('0x24'),_0x8a2d84,_0xfd9a60[_0xc583('0x29')][_0xc583('0x2b')]);return _0x5433ec(_0xfd9a60[_0xc583('0x29')]['message']);}else{logger['info'](_0xc583('0x24'),_0x8a2d84,'request\x20sent');_0x5433ec(_0xfd9a60[_0xc583('0x2c')][_0xc583('0x2b')]);}})[_0xc583('0x2d')](function(_0x1e7809){logger[_0xc583('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x8a2d84,_0x1e7809);_0x3dd3cc(_0x1e7809);});});}function respondWithStatusCode(_0x2dafb4,_0x44f76a){_0x44f76a=_0x44f76a||0xcc;return function(_0x4adde3){if(_0x4adde3){return _0x2dafb4[_0xc583('0x2e')](_0x44f76a);}return _0x2dafb4['status'](_0x44f76a)[_0xc583('0x2f')]();};}function respondWithResult(_0x8d4ecb,_0x1c80b1){_0x1c80b1=_0x1c80b1||0xc8;return function(_0x3ed083){if(_0x3ed083){return _0x8d4ecb[_0xc583('0x30')](_0x1c80b1)[_0xc583('0x31')](_0x3ed083);}};}function respondWithFilteredResult(_0x113b39,_0x4a87b5){return function(_0x529dbe){if(_0x529dbe){var _0x390bc3=_0x529dbe[_0xc583('0x32')],_0x23f3a4=_0x4a87b5['offset'],_0xcbf1f1=_0x4a87b5[_0xc583('0x33')]+_0x4a87b5['limit'],_0x1dd665;if(_0xcbf1f1>=_0x390bc3){_0xcbf1f1=_0x390bc3;_0x1dd665=0xc8;}else{_0x1dd665=0xce;}_0x113b39['status'](_0x1dd665);return _0x113b39[_0xc583('0x34')](_0xc583('0x35'),_0x23f3a4+'-'+_0xcbf1f1+'/'+_0x390bc3)[_0xc583('0x31')](_0x529dbe);}return null;};}function patchUpdates(_0x595ae1){return function(_0x430fe6){try{jsonpatch['apply'](_0x430fe6,_0x595ae1,!![]);}catch(_0x3e41c0){return BPromise[_0xc583('0x36')](_0x3e41c0);}return _0x430fe6[_0xc583('0x37')]();};}function saveUpdates(_0x48f00b,_0x18b097){return function(_0x55bdca){if(_0x55bdca){return _0x55bdca[_0xc583('0x38')](_0x48f00b)[_0xc583('0x22')](function(_0x473072){return _0x473072;});}return null;};}function removeEntity(_0x18a288,_0x3bd1fd){return function(_0x4d7add){if(_0x4d7add){return _0x4d7add[_0xc583('0x39')]()['then'](function(){_0x18a288[_0xc583('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e96fc,_0x3a562c){return function(_0x7d89d0){if(!_0x7d89d0){_0x2e96fc[_0xc583('0x2e')](0x194);}return _0x7d89d0;};}function handleError(_0xa44825,_0x41b466){_0x41b466=_0x41b466||0x1f4;return function(_0x54200c){logger['error'](_0x54200c[_0xc583('0x3a')]);if(_0x54200c[_0xc583('0x3b')]){delete _0x54200c['name'];}_0xa44825[_0xc583('0x30')](_0x41b466)[_0xc583('0x3c')](_0x54200c);};}function getInteractionUsers(_0x22de5a,_0xb9b427){return new BPromise(function(_0x37b8c7,_0x388a85){try{if(_0xb9b427[_0x22de5a['id']]){_0x22de5a['Users']=_[_0xc583('0x3d')](_0xb9b427[_0x22de5a['id']],function(_0x595351){return{'id':_0x595351['id'],'fullname':_0x595351[_0xc583('0x3e')]};});}}catch(_0x22cc57){_0x388a85(_0x22cc57);}_0x37b8c7(_0x22de5a);});}function getInteractionTags(_0x39bed4,_0x502b6d){return new BPromise(function(_0x51ef91,_0x518c90){try{if(_0x39bed4[_0xc583('0x3f')]){_0x39bed4[_0xc583('0x40')]=[];_0x39bed4[_0xc583('0x3f')][_0xc583('0x41')](',')['forEach'](function(_0x374196){_0x39bed4[_0xc583('0x40')]['push'](_0x502b6d[_0x374196]);});}delete _0x39bed4['TagIds'];}catch(_0x1ea5da){_0x518c90(_0x1ea5da);}_0x51ef91(_0x39bed4);});}function updateChatInteraction(_0x5ad3d8,_0x254592,_0x1ec6f9){return new BPromise(function(_0xe73752,_0x40b888){return getInteractionUsers(_0x5ad3d8,_0x1ec6f9)['then'](function(_0x44c22f){return getInteractionTags(_0x44c22f,_0x254592);})[_0xc583('0x22')](function(_0x39c5ab){_0xe73752(_0x39c5ab);})[_0xc583('0x2d')](function(_0x2c1c22){_0x40b888(_0x2c1c22);});});}exports['index']=function(_0x3ffeb7,_0x5f5a97){var _0x4b78df={},_0x2f97a4={},_0x21e231={'count':0x0,'rows':[]};var _0x5788c7=_['map'](db[_0xc583('0x42')][_0xc583('0x43')],function(_0x7d1b29){return{'name':_0x7d1b29[_0xc583('0x44')],'type':_0x7d1b29['type'][_0xc583('0x45')]};});_0x2f97a4['model']=_[_0xc583('0x3d')](_0x5788c7,'name');_0x2f97a4[_0xc583('0x46')]=_[_0xc583('0x47')](_0x3ffeb7[_0xc583('0x46')]);_0x2f97a4[_0xc583('0x48')]=_[_0xc583('0x49')](_0x2f97a4['model'],_0x2f97a4[_0xc583('0x46')]);_0x4b78df[_0xc583('0x4a')]=_[_0xc583('0x49')](_0x2f97a4['model'],qs['fields'](_0x3ffeb7['query'][_0xc583('0x4b')]));_0x4b78df['attributes']=_0x4b78df[_0xc583('0x4a')][_0xc583('0x4c')]?_0x4b78df[_0xc583('0x4a')]:_0x2f97a4[_0xc583('0x4d')];if(!_0x3ffeb7[_0xc583('0x46')][_0xc583('0x4e')](_0xc583('0x4f'))){_0x4b78df[_0xc583('0x50')]=qs[_0xc583('0x50')](_0x3ffeb7[_0xc583('0x46')][_0xc583('0x50')]);_0x4b78df['offset']=qs[_0xc583('0x33')](_0x3ffeb7[_0xc583('0x46')][_0xc583('0x33')]);}_0x4b78df[_0xc583('0x51')]=qs['sort'](_0x3ffeb7[_0xc583('0x46')][_0xc583('0x52')]);_0x4b78df[_0xc583('0x53')]=qs[_0xc583('0x48')](_[_0xc583('0x54')](_0x3ffeb7[_0xc583('0x46')],_0x2f97a4[_0xc583('0x48')]),_0x5788c7);var _0x12291c=[];var _0x32512b=squel['select']()[_0xc583('0x55')]('id')[_0xc583('0x55')](_0xc583('0x3b'))[_0xc583('0x55')](_0xc583('0x56'))[_0xc583('0x57')](_0xc583('0x58'));var _0x465c71=squel[_0xc583('0x59')]()[_0xc583('0x55')](_0xc583('0x5a'))[_0xc583('0x55')](_0xc583('0x5b'))['field'](_0xc583('0x5c'))[_0xc583('0x57')](_0xc583('0x5d'),'ui')[_0xc583('0x5e')](_0xc583('0x5f'),'u',_0xc583('0x60'));var _0x24351f=squel[_0xc583('0x59')]()[_0xc583('0x57')]('chat_interactions','i')[_0xc583('0x5e')](_0xc583('0x61'),'c',_0xc583('0x62'))['left_join']('users','o',_0xc583('0x63'))['left_join'](_0xc583('0x64'),'a',_0xc583('0x65'))['left_join']('chat_messages','me',_0xc583('0x66'))[_0xc583('0x5e')](_0xc583('0x67'),'it',_0xc583('0x68'))[_0xc583('0x5e')](_0xc583('0x58'),'t',_0xc583('0x69'));var _0x43b438=squel['expr']();var _0x1d41df=[];var _0x9bbf43=squel[_0xc583('0x6a')]();var _0x1c4921;if(_0x3ffeb7['query'][_0xc583('0x6b')]){_0x1c4921=as[_0xc583('0x6c')](_0x3ffeb7['query']['search']);var _0x12b114=_0x1c4921['sqlOperator'];for(var _0x30b1e0=0x0;_0x30b1e0<_0x1c4921[_0xc583('0x6d')][_0xc583('0x4c')];_0x30b1e0++){var _0x5ea011=_0x1c4921['conditions'][_0x30b1e0];var _0x1ea579='i';var _0x3a5033=_[_0xc583('0x6e')](_0x5788c7,[_0xc583('0x3b'),_0x5ea011['field']]);if(!_0x3a5033){switch(_0x5ea011[_0xc583('0x55')]){case _0xc583('0x6f'):if(_0x5ea011['value']==0x1){_0x24351f['having']('`'+_0x5ea011[_0xc583('0x55')]+'`\x20=\x200');}else{_0x24351f['having']('`'+_0x5ea011[_0xc583('0x55')]+_0xc583('0x70'));}break;case _0xc583('0x71'):if(_0x5ea011[_0xc583('0x72')]===_0xc583('0x73')){if(_0x5ea011['value']['split']('\x20')[_0xc583('0x4c')]>0x1){_0x43b438[_0x12b114](_0xc583('0x74'),qs['getFullTextValue'](_0x5ea011['value']),null);}else{var _0x1cfb34='%'+_0x5ea011['value']+'%';_0x43b438[_0x12b114](_0xc583('0x75'),_0x1cfb34,_0x1cfb34,_0x1cfb34);}}else{_0x3a5033=_[_0xc583('0x6e')](_0x5788c7,['name',_0xc583('0x76')]);_0x5ea011['field']=_0xc583('0x76');_0x54e331=as[_0xc583('0x77')](_0x1ea579,_0x3a5033['type'],_0x5ea011);_0x43b438[_0x12b114](_0x54e331[_0xc583('0x78')],_0x54e331[_0xc583('0x79')][_0xc583('0x7a')],_0x54e331[_0xc583('0x79')][_0xc583('0x2f')]);}break;case _0xc583('0x7b'):var _0x37613c=_0x5ea011[_0xc583('0x79')]['split'](',')['map'](function(_0x4d0f8b){return Number(_0x4d0f8b);});_0x37613c[_0xc583('0x7c')](function(_0x4d498b){_0x9bbf43['or'](_0xc583('0x7d'),'%,'+_0x4d498b+',%');});_0x1d41df=_[_0xc583('0x7e')](_0x1d41df,_0x37613c);break;case _0xc583('0x7f'):if(_0x5ea011[_0xc583('0x72')]===_0xc583('0x73')){_0x43b438[_0x12b114](_0xc583('0x80'),'%'+_0x5ea011[_0xc583('0x79')]+'%',null);}else{_0x3a5033=_[_0xc583('0x6e')](_0x5788c7,['name',_0xc583('0x81')]);_0x5ea011[_0xc583('0x55')]=_0xc583('0x81');_0x54e331=as[_0xc583('0x77')](_0x1ea579,_0x3a5033[_0xc583('0x82')],_0x5ea011);_0x43b438[_0x12b114](_0x54e331[_0xc583('0x78')],_0x54e331['value'][_0xc583('0x7a')],_0x54e331[_0xc583('0x79')][_0xc583('0x2f')]);}break;case _0xc583('0x83'):_0x54e331=as[_0xc583('0x77')]('me',null,_0x5ea011);_0x43b438[_0x12b114](_0x54e331[_0xc583('0x78')],_0x54e331['value'][_0xc583('0x7a')],_0x54e331[_0xc583('0x79')][_0xc583('0x2f')]);break;}}else{var _0x54e331=as[_0xc583('0x77')](_0x1ea579,_0x3a5033['type'],_0x5ea011);_0x43b438[_0x12b114](_0x54e331[_0xc583('0x78')],_0x54e331[_0xc583('0x79')][_0xc583('0x7a')],_0x54e331[_0xc583('0x79')][_0xc583('0x2f')]);}}}else{var _0x89f9af=_(_0x3ffeb7[_0xc583('0x46')])['keys']()['map'](function(_0x5e979d){return _['some'](_0x5788c7,[_0xc583('0x3b'),_0x5e979d])?_0x5e979d:undefined;})[_0xc583('0x84')]()[_0xc583('0x79')]();if(!_[_0xc583('0x85')](_0x89f9af)){_0x89f9af[_0xc583('0x7c')](function(_0xbb22fa){if(_0xbb22fa===_0xc583('0x86')){_0x24351f[_0xc583('0x53')](_0xc583('0x87'),[][_0xc583('0x88')](_0x3ffeb7['query'][_0xbb22fa]));}else if(_0xbb22fa===_0xc583('0x89')){var _0xc82dd5=JSON['parse'](_0x3ffeb7['query'][_0xbb22fa])['$gte'];var _0x118682=JSON[_0xc583('0x8a')](_0x3ffeb7[_0xc583('0x46')][_0xbb22fa])[_0xc583('0x8b')];_0x24351f[_0xc583('0x53')](_0xc583('0x8c'),_0xc82dd5,_0x118682);}else{if(_0x3ffeb7[_0xc583('0x46')][_0xbb22fa]===_0xc583('0x8d')){_0x24351f[_0xc583('0x53')]('i.'+_0xbb22fa+'\x20IS\x20NULL');}else{_0x24351f[_0xc583('0x53')]('i.'+_0xbb22fa+_0xc583('0x8e'),_0x3ffeb7['query'][_0xbb22fa]);}}});}if(_0x3ffeb7[_0xc583('0x46')][_0xc583('0x8f')]){if(_0x3ffeb7[_0xc583('0x46')][_0xc583('0x8f')]==0x1){_0x24351f[_0xc583('0x90')]('`unreadMessages`\x20=\x200');}else{_0x24351f[_0xc583('0x90')](_0xc583('0x91'));}}if(_0x3ffeb7[_0xc583('0x46')][_0xc583('0x92')]){_0x1d41df=_['isArray'](_0x3ffeb7['query']['tag'])?_0x3ffeb7[_0xc583('0x46')]['tag']:new Array(_0x3ffeb7['query']['tag']);_0x1d41df[_0xc583('0x7c')](function(_0x3e8319){_0x9bbf43['or'](_0xc583('0x7d'),'%,'+_0x3e8319+',%');});}if(_0x3ffeb7[_0xc583('0x46')][_0xc583('0x93')]){var _0x5150b4=_0x3ffeb7[_0xc583('0x46')][_0xc583('0x93')][_0xc583('0x94')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xc583('0x95'));if(qs[_0xc583('0x96')](_0x5150b4)){_0x43b438['or']('i.id\x20LIKE\x20?',_0x5150b4+'%');}else{_0x43b438['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc583('0x97')](_0x5150b4))['or'](_0xc583('0x98'),_0x5150b4+'%');}}}_0x24351f[_0xc583('0x53')](_0x43b438);_0x24351f[_0xc583('0x99')](_0xc583('0x9a'));var _0x10651c={'type':db[_0xc583('0x1f')][_0xc583('0x9b')]['SELECT'],'raw':!![]};var _0x288c4e=_0x24351f[_0xc583('0x9c')]();_0x288c4e[_0xc583('0x55')](_0xc583('0x9a'));_0x288c4e[_0xc583('0x55')](_0xc583('0x9d'),_0xc583('0x6f'));if(_0x4b78df[_0xc583('0x51')]){_0x4b78df[_0xc583('0x51')][_0xc583('0x7c')](function(_0x562bb6){_0x24351f[_0xc583('0x51')]('i.'+_0x562bb6[0x0],_0x562bb6[0x1]===_0xc583('0x9e')?![]:!![]);});}if(!_[_0xc583('0x85')](_0x1d41df)){_0x24351f[_0xc583('0x90')](_0x9bbf43);_0x288c4e[_0xc583('0x53')](_0xc583('0x9f'),_0x1d41df);}BPromise[_0xc583('0xa0')]()[_0xc583('0x22')](function(){if(!_0x1c4921){if(_0x3ffeb7[_0xc583('0x46')][_0xc583('0x86')]||_0x3ffeb7[_0xc583('0x46')][_0xc583('0xa1')])return;_0x288c4e[_0xc583('0x53')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x24351f['where'](_0xc583('0xa2'));return;}return _0x3ffeb7[_0xc583('0xa3')]['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x194989){if(_[_0xc583('0x85')](_0x194989)){_0x288c4e['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x24351f[_0xc583('0x53')](_0xc583('0xa4'));}else{_0x288c4e[_0xc583('0x53')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x194989,'id'));_0x24351f[_0xc583('0x53')](_0xc583('0x87'),_[_0xc583('0x3d')](_0x194989,'id'));}});})['then'](function(){db[_0xc583('0xa5')][_0xc583('0x46')](_0x288c4e['toString'](),_0x10651c)[_0xc583('0x22')](function(_0x1649ad){_0x21e231[_0xc583('0x32')]=_0x1649ad[_0xc583('0x4c')];if(_0x21e231[_0xc583('0x32')]===0x0)return[];return db[_0xc583('0xa5')][_0xc583('0x46')](_0x32512b['toString'](),_0x10651c)['then'](function(_0x5dd5c7){_0x12291c=_[_0xc583('0xa6')](_0x5dd5c7,'id');_0x10651c=_[_0xc583('0xa7')](_0x10651c,{'model':db[_0xc583('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ffeb7[_0xc583('0x46')][_0xc583('0x4b')]){_0x4b78df[_0xc583('0x4a')][_0xc583('0x7c')](function(_0x6a7877){_0x24351f['field']('i.'+_0x6a7877);});}else{_0x24351f[_0xc583('0x55')](_0xc583('0x9d'),_0xc583('0x6f'));_0x24351f[_0xc583('0x55')]('a.key','Account.key');_0x24351f['field'](_0xc583('0xa8'),_0xc583('0xa9'));_0x24351f[_0xc583('0x55')](_0xc583('0xaa'));_0x24351f[_0xc583('0x55')](_0xc583('0xab'),'Contact.firstName');_0x24351f['field'](_0xc583('0xac'),_0xc583('0xad'));_0x24351f['field'](_0xc583('0xae'),_0xc583('0xaf'));_0x24351f[_0xc583('0x55')](_0xc583('0xb0'),_0xc583('0xb1'));_0x24351f[_0xc583('0x55')]('c.mobile',_0xc583('0xb2'));_0x24351f[_0xc583('0x55')](_0xc583('0xb3'),_0xc583('0xb4'));_0x24351f[_0xc583('0x55')](_0xc583('0xb5'),_0xc583('0xb6'));_0x24351f[_0xc583('0x55')](_0xc583('0xb7'),_0xc583('0xb8'));_0x24351f['field'](_0xc583('0xb9'),_0xc583('0x3f'));}if(_0x4b78df[_0xc583('0x50')])_0x24351f['limit'](_0x4b78df[_0xc583('0x50')]);if(_0x4b78df['offset'])_0x24351f[_0xc583('0x33')](_0x4b78df[_0xc583('0x33')]);return db[_0xc583('0xa5')][_0xc583('0x46')](_0x24351f[_0xc583('0xba')](),_0x10651c);})[_0xc583('0x22')](function(_0x15e2b6){_0x465c71['where'](_0xc583('0xbb'),_['map'](_0x15e2b6,'id'));return db[_0xc583('0xa5')]['query'](_0x465c71[_0xc583('0xba')](),_0x10651c)[_0xc583('0x22')](function(_0x1d17c2){var _0x25d16e=_[_0xc583('0xbc')](_0x1d17c2,_0xc583('0xbd'));var _0x16273a=[];_0x15e2b6[_0xc583('0x7c')](function(_0x53f66a){_0x16273a[_0xc583('0xbe')](updateChatInteraction(_0x53f66a,_0x12291c,_0x25d16e));});return BPromise[_0xc583('0xbf')](_0x16273a);});});})[_0xc583('0x22')](function(_0x3ae684){_0x21e231[_0xc583('0xc0')]=_0x3ae684;return _0x21e231;})['then'](respondWithFilteredResult(_0x5f5a97,_0x4b78df));})[_0xc583('0x2d')](handleError(_0x5f5a97,null));};exports[_0xc583('0xc1')]=function(_0x1b246e,_0x5adde2){var _0x4d892c={'raw':![],'where':{'id':_0x1b246e[_0xc583('0xc2')]['id']}},_0xbbdcc4={};_0xbbdcc4[_0xc583('0x4d')]=_[_0xc583('0x47')](db[_0xc583('0x42')][_0xc583('0x43')]);_0xbbdcc4['query']=_[_0xc583('0x47')](_0x1b246e[_0xc583('0x46')]);_0xbbdcc4[_0xc583('0x48')]=_[_0xc583('0x49')](_0xbbdcc4[_0xc583('0x4d')],_0xbbdcc4['query']);_0x4d892c[_0xc583('0x4a')]=_['intersection'](_0xbbdcc4[_0xc583('0x4d')],qs['fields'](_0x1b246e[_0xc583('0x46')][_0xc583('0x4b')]));_0x4d892c['attributes']=_0x4d892c['attributes'][_0xc583('0x4c')]?_0x4d892c[_0xc583('0x4a')]:_0xbbdcc4[_0xc583('0x4d')];if(_0x1b246e[_0xc583('0x46')][_0xc583('0xc3')]){_0x4d892c['include']=[{'all':!![]}];}_0x4d892c=_[_0xc583('0xa7')]({},_0x4d892c,_0x1b246e['options']);return db[_0xc583('0x42')][_0xc583('0x6e')](_0x4d892c)[_0xc583('0x22')](handleEntityNotFound(_0x5adde2,null))[_0xc583('0x22')](respondWithResult(_0x5adde2,null))['catch'](handleError(_0x5adde2,null));};exports['create']=function(_0x54f43b,_0x1cbdea){return db[_0xc583('0x42')][_0xc583('0xc4')](_0x54f43b['body'],{})[_0xc583('0x22')](respondWithResult(_0x1cbdea,0xc9))[_0xc583('0x2d')](handleError(_0x1cbdea,null));};exports['update']=function(_0x392a65,_0x584454){if(_0x392a65[_0xc583('0x83')]['id']){delete _0x392a65[_0xc583('0x83')]['id'];}return db[_0xc583('0x42')][_0xc583('0x6e')]({'where':{'id':_0x392a65['params']['id']}})[_0xc583('0x22')](handleEntityNotFound(_0x584454,null))[_0xc583('0x22')](saveUpdates(_0x392a65[_0xc583('0x83')],null))['then'](respondWithResult(_0x584454,null))['catch'](handleError(_0x584454,null));};exports['destroy']=function(_0xa87e9d,_0x3eac6f){return db['ChatInteraction'][_0xc583('0x6e')]({'where':{'id':_0xa87e9d[_0xc583('0xc2')]['id']}})['then'](handleEntityNotFound(_0x3eac6f,null))['then'](removeEntity(_0x3eac6f,null))[_0xc583('0x2d')](handleError(_0x3eac6f,null));};exports['describe']=function(_0x790cd1,_0x3e1c5e){return db[_0xc583('0x42')][_0xc583('0xc5')]()[_0xc583('0x22')](respondWithResult(_0x3e1c5e,null))[_0xc583('0x2d')](handleError(_0x3e1c5e,null));};exports['createVidaooSession']=function(_0x3bcbce,_0x1628f4){var _0x45a609=_0x3bcbce[_0xc583('0xc2')]['id'];var _0x3fa08e;var _0x2a3ef9;var _0x4d24e7;return db[_0xc583('0x42')]['findOne']({'where':{'id':_0x45a609}})[_0xc583('0x22')](function(_0x146b9c){_0x3fa08e=_0x146b9c;return db['ChatWebsite']['findOne']({'where':{'id':_0x146b9c[_0xc583('0x86')]},'attributes':['id','vidaooApiKey','vidaooEscalation'],'raw':!![]});})[_0xc583('0x22')](function(_0x5490f5){if(_0x5490f5&&_0x5490f5[_0xc583('0xc6')]&&_0x5490f5[_0xc583('0xc7')]){_0x2a3ef9=_0x5490f5;var _0x18d8b5={'rejectUnauthorized':![],'method':_0xc583('0xc8'),'uri':'https://api-vidaoo.xcally.com/api/v1/sessions','headers':{'X-APIKEY':_0x5490f5[_0xc583('0xc6')]},'body':{'name':_0xc583('0xc9')+_0x45a609},'redirect':_0xc583('0xca'),'json':!![]};return rp(_0x18d8b5);}else{throw new db[(_0xc583('0x1f'))][(_0xc583('0x20'))](_0xc583('0xcb'));}})[_0xc583('0x22')](function(_0x63eee8){_0x4d24e7=_0x63eee8;if(_0x4d24e7['id']){var _0x2d0297={'body':_0x4d24e7[_0xc583('0xcc')],'ChatWebsiteId':_0x2a3ef9['id'],'ChatInteractionId':_0x3fa08e['id'],'direction':_0xc583('0xcd'),'UserId':_0x3bcbce[_0xc583('0xa3')]['id']};return db[_0xc583('0xce')]['create'](_0x2d0297,{});}else{throw new db[(_0xc583('0x1f'))][(_0xc583('0x20'))](_0xc583('0xcf'));}})[_0xc583('0x22')](function(){return _0x3fa08e[_0xc583('0xd0')]({'vidaooSessionId':_0x4d24e7['id']});})[_0xc583('0x22')](respondWithResult(_0x1628f4,null))[_0xc583('0x2d')](handleError(_0x1628f4,null));};exports[_0xc583('0xd1')]=function(_0x5f5b7a,_0x2324f8){if(_0x5f5b7a[_0xc583('0x83')]['id']){delete _0x5f5b7a['body']['id'];}return db['ChatInteraction'][_0xc583('0x6e')]({'where':{'id':_0x5f5b7a[_0xc583('0xc2')]['id']}})['then'](handleEntityNotFound(_0x2324f8,null))[_0xc583('0x22')](saveUpdates(_0x5f5b7a['body'],null))[_0xc583('0x22')](respondWithResult(_0x2324f8,null))[_0xc583('0x2d')](handleError(_0x2324f8,null));};exports[_0xc583('0xd2')]=function(_0x42f4ec,_0x314072,_0x112652){if(_0x42f4ec[_0xc583('0x83')]['id']){delete _0x42f4ec['body']['id'];}return db['ChatInteraction'][_0xc583('0x6e')]({'where':{'id':_0x42f4ec['params']['id']}})[_0xc583('0x22')](function(_0x5dfbd5){if(!_0x5dfbd5){logger[_0xc583('0x29')](_0xc583('0xd3'),'abandon',0x194,_0xc583('0xd4'));_0x314072[_0xc583('0x2e')](0x194);}else{if(_0x5dfbd5[_0xc583('0x81')]){throw new db[(_0xc583('0x1f'))]['ValidationError'](_0xc583('0xd5'));}}return _0x5dfbd5;})[_0xc583('0x22')](function(_0x38a4d0){if(_0x38a4d0){return _0x38a4d0['update']({'closed':_0x42f4ec[_0xc583('0x83')][_0xc583('0xd6')],'disposition':_0x42f4ec[_0xc583('0x83')][_0xc583('0xd7')]})[_0xc583('0x22')](function(_0x5db6a2){return _0x5db6a2;});}})[_0xc583('0x22')](function(_0x178eef){return respondWithRpcPromise('AbandonInteraction',_0xc583('0xd2'),_0x42f4ec['body'],client9004);})[_0xc583('0x22')](respondWithResult(_0x314072,null))[_0xc583('0x2d')](handleError(_0x314072,null));};exports[_0xc583('0xd8')]=function(_0xe45a4a,_0x91cb84,_0x46aa62){_0xe45a4a[_0xc583('0x83')][_0xc583('0x3b')]=_0xe45a4a[_0xc583('0xd9')][_0xc583('0xda')];_0xe45a4a[_0xc583('0x83')]['basename']=_0xe45a4a[_0xc583('0xd9')][_0xc583('0xdb')];_0xe45a4a[_0xc583('0x83')][_0xc583('0x82')]=_0xe45a4a[_0xc583('0xd9')][_0xc583('0xdc')];return db['Attachment'][_0xc583('0xc4')](_0xe45a4a[_0xc583('0x83')])[_0xc583('0x22')](respondWithResult(_0x91cb84,0xc9))[_0xc583('0x2d')](handleError(_0x91cb84,null));};exports[_0xc583('0xdd')]=function(_0x1f61e2,_0x291f47,_0x405709){return db[_0xc583('0x42')][_0xc583('0xde')]({'where':{'id':_0x1f61e2[_0xc583('0xc2')]['id']},'raw':!![]})[_0xc583('0x22')](handleEntityNotFound(_0x291f47,null))[_0xc583('0x22')](function(_0x4824c5){if(_0x4824c5){if(_0x4824c5[_0xc583('0xd6')]){return _0x291f47[_0xc583('0x30')](0x193)[_0xc583('0x31')]({'status':0x193,'message':_0xc583('0xdf')});}return db[_0xc583('0xe0')][_0xc583('0xde')]({'where':{'id':_0x1f61e2['query'][_0xc583('0xe1')]},'raw':!![]})['then'](handleEntityNotFound(_0x291f47,null));}})['then'](function(_0x52482e){if(_0x52482e){return _0x291f47[_0xc583('0xe2')](path[_0xc583('0xe3')](config[_0xc583('0xe4')],_0xc583('0xe5'),_0x52482e[_0xc583('0xe6')]));}})['catch'](handleError(_0x291f47,null));};exports['close']=function(_0x50f9d6,_0x1aa8a2){var _0x18a2cd=null;var _0x2785c5=null;var _0x774d90=null;var _0x486cd1=null;if(_0x50f9d6[_0xc583('0x83')]['id']){delete _0x50f9d6['body']['id'];}if(_0x50f9d6[_0xc583('0x83')]['mailTranscript']){_0x486cd1=path[_0xc583('0xe3')](config[_0xc583('0xe4')],_0xc583('0xe7'),util[_0xc583('0xe8')](_0xc583('0xe9'),Date[_0xc583('0xea')]()));_0x50f9d6[_0xc583('0x83')][_0xc583('0xeb')]=_0x486cd1;}return db[_0xc583('0x42')][_0xc583('0x6e')]({'where':{'id':_0x50f9d6[_0xc583('0xc2')]['id']},'include':[{'model':db[_0xc583('0xce')],'as':_0xc583('0xec'),'include':[{'model':db[_0xc583('0x7f')],'as':_0xc583('0x7f')}]}]})[_0xc583('0x22')](handleEntityNotFound(_0x1aa8a2,null))[_0xc583('0x22')](saveUpdates(_0x50f9d6[_0xc583('0x83')],null))[_0xc583('0x22')](function(_0x564fc0){if(_0x564fc0){_0x18a2cd=_0x564fc0;return db['ChatWebsite'][_0xc583('0x6e')]({'where':{'id':_0x18a2cd[_0xc583('0x86')]}});}})[_0xc583('0x22')](function(_0x23759e){if(_0x23759e){_0x774d90=_0x23759e;return db[_0xc583('0xed')]['find']({'where':{'id':_0x18a2cd[_0xc583('0x76')]}});}})['then'](function(_0x8d44b7){if(_0x8d44b7){_0x2785c5=_0x8d44b7;if(_0x486cd1){var _0x1b4ac0=null;for(var _0x107927=0x1;_0x107927<_0x18a2cd[_0xc583('0xec')][_0xc583('0x4c')];++_0x107927){_0x1b4ac0=_0x18a2cd[_0xc583('0xec')][_0x107927];var _0x2b720c=_0x1b4ac0[_0xc583('0x81')]?util[_0xc583('0xe8')]('%s%d',_0x774d90[_0xc583('0xee')],_0x1b4ac0[_0xc583('0x81')]):'System';var _0x36975e=_0x50f9d6[_0xc583('0x83')][_0xc583('0xef')]||util['format'](_0xc583('0xf0'),_0xc583('0xf1'),_0x1b4ac0[_0xc583('0x76')]);switch(_0x774d90[_0xc583('0xf2')]){case _0xc583('0xf3'):_0x2b720c=_0x1b4ac0[_0xc583('0x81')]?util[_0xc583('0xe8')]('%s%d',_0x774d90[_0xc583('0xee')],_0x1b4ac0[_0xc583('0x81')]):_0xc583('0xf4');break;case'agent_alias':_0x2b720c=_0x1b4ac0['UserId']?_0x1b4ac0['User'][_0xc583('0xf5')]||_0x1b4ac0[_0xc583('0x7f')]['fullname']:_0xc583('0xf4');break;case _0xc583('0xf6'):_0x2b720c=_0x1b4ac0[_0xc583('0x81')]?_0x1b4ac0[_0xc583('0x7f')][_0xc583('0x3e')]:_0xc583('0xf4');break;default:_0x2b720c=_0x1b4ac0[_0xc583('0x81')]?util[_0xc583('0xe8')](_0xc583('0xf0'),_0x774d90[_0xc583('0xee')],_0x1b4ac0['UserId']):_0xc583('0xf4');}var _0x5b8197=util[_0xc583('0xe8')](_0xc583('0xf7'),moment(_0x1b4ac0[_0xc583('0x89')])[_0xc583('0xe8')](_0xc583('0xf8')),_0x1b4ac0[_0xc583('0xf9')]==='in'?_0x36975e:_0x2b720c,_0x1b4ac0[_0xc583('0x83')]);if(!_0x1b4ac0[_0xc583('0xfa')]){fs[_0xc583('0xfb')](_0x486cd1,_0x5b8197);}}return db[_0xc583('0xfc')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xc583('0xfd'),'raw':!![]}]});}}})['then'](function(_0x45270a){if(_0x45270a&&_0x45270a[_0xc583('0xfd')]&&_0x50f9d6[_0xc583('0x83')]){var _0x44266a={'tls':{'rejectUnauthorized':![]}};if(_0x45270a['Smtp'][_0xc583('0xfe')]){_0x44266a[_0xc583('0xfe')]=_0x45270a['Smtp']['service'];}else{_0x44266a[_0xc583('0xff')]=_0x45270a[_0xc583('0xfd')][_0xc583('0xff')];_0x44266a['port']=_0x45270a['Smtp'][_0xc583('0x100')];_0x44266a['secure']=_0x45270a[_0xc583('0xfd')][_0xc583('0x101')];}if(_0x45270a[_0xc583('0xfd')]['authentication']){_0x44266a[_0xc583('0x102')]={'user':_0x45270a['Smtp']['user'],'pass':_0x45270a[_0xc583('0xfd')][_0xc583('0x103')]};}return respondWithRpcPromise(_0xc583('0x104'),_0xc583('0x105'),{'account':_0x44266a,'message':{'from':util[_0xc583('0xe8')](_0xc583('0x106'),_0x45270a[_0xc583('0x3b')],_0x45270a[_0xc583('0x107')]||_0x45270a[_0xc583('0xfd')][_0xc583('0xa3')]),'to':_0x50f9d6[_0xc583('0x83')][_0xc583('0x108')],'subject':_0xc583('0x109'),'text':util[_0xc583('0xe8')](_0xc583('0x10a'),_0x50f9d6['body'][_0xc583('0x108')]),'attachments':[{'path':_0x486cd1}]}})[_0xc583('0x22')](function(){return _0x18a2cd;})[_0xc583('0x2d')](function(_0x267c96){console[_0xc583('0x29')](_0x267c96);});}else{return _0x18a2cd;}})[_0xc583('0x22')](respondWithStatusCode(_0x1aa8a2,0xc8))[_0xc583('0x2d')](handleError(_0x1aa8a2,null));};exports[_0xc583('0x10b')]=function(_0xa21d7a,_0x3308a8,_0x270a3e){return db[_0xc583('0xce')][_0xc583('0x6e')]({'where':{'id':_0xa21d7a[_0xc583('0xc2')]['id']}})[_0xc583('0x22')](handleEntityNotFound(_0x3308a8,null))['then'](function(_0x31784f){if(_0x31784f){return _0x31784f[_0xc583('0x10b')](_0xa21d7a[_0xc583('0x83')][_0xc583('0x10c')],_['omit'](_0xa21d7a[_0xc583('0x83')],[_0xc583('0x10c'),'id'])||{});}})[_0xc583('0x22')](respondWithResult(_0x3308a8,null))['catch'](handleError(_0x3308a8,null));};exports['getMessages']=function(_0x4b37b8,_0x3f30fd,_0x15ea31){var _0x2772c7={'raw':![],'where':{}};var _0x52bed1={};var _0x1d9782={'count':0x0,'rows':[]};return db[_0xc583('0x42')][_0xc583('0xde')]({'where':{'id':_0x4b37b8['params']['id']}})[_0xc583('0x22')](handleEntityNotFound(_0x3f30fd,null))['then'](function(_0x50ff62){if(_0x50ff62){_0x52bed1[_0xc583('0x4d')]=_[_0xc583('0x47')](db[_0xc583('0xce')][_0xc583('0x43')]);_0x52bed1[_0xc583('0x46')]=_['keys'](_0x4b37b8['query']);_0x52bed1[_0xc583('0x48')]=_[_0xc583('0x49')](_0x52bed1[_0xc583('0x4d')],_0x52bed1['query']);_0x2772c7[_0xc583('0x4a')]=_[_0xc583('0x49')](_0x52bed1[_0xc583('0x4d')],qs['fields'](_0x4b37b8[_0xc583('0x46')][_0xc583('0x4b')]));_0x2772c7[_0xc583('0x4a')]=_0x2772c7[_0xc583('0x4a')][_0xc583('0x4c')]?_0x2772c7[_0xc583('0x4a')]:_0x52bed1['model'];if(!_0x4b37b8[_0xc583('0x46')]['hasOwnProperty'](_0xc583('0x4f'))){_0x2772c7['limit']=qs[_0xc583('0x50')](_0x4b37b8[_0xc583('0x46')][_0xc583('0x50')]);_0x2772c7[_0xc583('0x33')]=qs[_0xc583('0x33')](_0x4b37b8[_0xc583('0x46')][_0xc583('0x33')]);}_0x2772c7[_0xc583('0x51')]=qs[_0xc583('0x52')](_0x4b37b8[_0xc583('0x46')][_0xc583('0x52')]);_0x2772c7[_0xc583('0x53')]=qs[_0xc583('0x48')](_[_0xc583('0x54')](_0x4b37b8[_0xc583('0x46')],_0x52bed1[_0xc583('0x48')]));_0x2772c7[_0xc583('0x53')]['ChatInteractionId']=_0x50ff62['id'];if(_0x4b37b8[_0xc583('0x46')][_0xc583('0x93')]){_0x2772c7[_0xc583('0x53')]=_['merge'](_0x2772c7[_0xc583('0x53')],{'$or':_['map'](_0x2772c7[_0xc583('0x4a')],function(_0x2095f4){var _0x509ee5={};_0x509ee5[_0x2095f4]={'$like':'%'+_0x4b37b8[_0xc583('0x46')][_0xc583('0x93')]+'%'};return _0x509ee5;})});}if(_0x4b37b8[_0xc583('0x46')]['$gte']){var _0xcacf5e=_0x4b37b8[_0xc583('0x46')]['$gte']['split'](',');var _0x183571={};_0x183571[_0xcacf5e[0x0]]={'$gte':moment(_0xcacf5e[0x1])[_0xc583('0xe8')](_0xc583('0x10d'))};_0x2772c7[_0xc583('0x53')]=_['merge'](_0x2772c7['where'],_0x183571);}_0x2772c7=_['merge']({},_0x2772c7,_0x4b37b8[_0xc583('0x10e')]);return db[_0xc583('0xce')][_0xc583('0x32')]({'where':_0x2772c7[_0xc583('0x53')]})[_0xc583('0x22')](function(_0x9dad79){_0x1d9782[_0xc583('0x32')]=_0x9dad79;if(_0x4b37b8[_0xc583('0x46')][_0xc583('0xc3')]){_0x2772c7[_0xc583('0x10f')]=[{'all':!![]}];}return db[_0xc583('0xce')][_0xc583('0x110')](_0x2772c7);})[_0xc583('0x22')](function(_0x26cdcd){_0x1d9782[_0xc583('0xc0')]=_0x26cdcd;return _0x1d9782;});}})[_0xc583('0x22')](respondWithFilteredResult(_0x3f30fd,_0x2772c7))[_0xc583('0x2d')](handleError(_0x3f30fd,null));};exports[_0xc583('0x111')]=function(_0x272a27,_0x4d6f30,_0x132293){var _0x2f31ae={'where':{}},_0x5388f8={},_0x3b7fa2={'count':0x0,'rows':[]};return db[_0xc583('0x42')]['findOne']({'where':{'id':_0x272a27[_0xc583('0xc2')]['id']}})[_0xc583('0x22')](handleEntityNotFound(_0x4d6f30,null))[_0xc583('0x22')](function(_0x41764a){if(_0x41764a){_0x5388f8[_0xc583('0x4d')]=_[_0xc583('0x47')](db['ChatMessage'][_0xc583('0x43')]);_0x5388f8['query']=_[_0xc583('0x47')](_0x272a27[_0xc583('0x46')]);_0x5388f8[_0xc583('0x48')]=_[_0xc583('0x49')](_0x5388f8['model'],_0x5388f8['query']);_0x2f31ae[_0xc583('0x4a')]=_[_0xc583('0x49')](_0x5388f8['model'],qs[_0xc583('0x4b')](_0x272a27[_0xc583('0x46')][_0xc583('0x4b')]));_0x2f31ae['attributes']=_0x2f31ae[_0xc583('0x4a')][_0xc583('0x4c')]?_0x2f31ae[_0xc583('0x4a')]:_0x5388f8[_0xc583('0x4d')];if(!_0x272a27[_0xc583('0x46')][_0xc583('0x4e')](_0xc583('0x4f'))){_0x2f31ae['limit']=qs['limit'](_0x272a27[_0xc583('0x46')]['limit']);_0x2f31ae['offset']=qs[_0xc583('0x33')](_0x272a27[_0xc583('0x46')][_0xc583('0x33')]);}_0x2f31ae[_0xc583('0x51')]=qs[_0xc583('0x52')](_0x272a27[_0xc583('0x46')][_0xc583('0x52')]);_0x2f31ae[_0xc583('0x53')]=qs[_0xc583('0x48')](_[_0xc583('0x54')](_0x272a27['query'],_0x5388f8[_0xc583('0x48')]));_0x2f31ae[_0xc583('0x53')][_0xc583('0xbd')]=_0x41764a['id'];if(_0x272a27['query']['filter']){_0x2f31ae['where']=_[_0xc583('0xa7')](_0x2f31ae[_0xc583('0x53')],{'$or':_[_0xc583('0x3d')](_0x2f31ae[_0xc583('0x4a')],function(_0x421975){var _0x45f26d={};_0x45f26d[_0x421975]={'$like':'%'+_0x272a27[_0xc583('0x46')][_0xc583('0x93')]+'%'};return _0x45f26d;})});}_0x2f31ae[_0xc583('0x53')][_0xc583('0xfa')]=![];if(_0x272a27[_0xc583('0x46')]['id']){_0x2f31ae['where']['id']={'$gt':_0x272a27[_0xc583('0x46')]['id']};}_0x2f31ae=_[_0xc583('0xa7')]({},_0x2f31ae,_0x272a27[_0xc583('0x10e')]);return db[_0xc583('0xce')][_0xc583('0x32')]({'where':_0x2f31ae[_0xc583('0x53')]})[_0xc583('0x22')](function(_0x8c2492){_0x3b7fa2['count']=_0x8c2492;_0x2f31ae[_0xc583('0x10f')]=[];if(_0x272a27[_0xc583('0x46')]['includeAgent']){_0x2f31ae[_0xc583('0x10f')][_0xc583('0xbe')]({'model':db[_0xc583('0x7f')],'as':_0xc583('0x7f'),'attributes':['id',_0xc583('0x3e'),_0xc583('0xf5')]});}if(_0x272a27[_0xc583('0x46')][_0xc583('0xc3')]){_0x2f31ae[_0xc583('0x10f')]=[{'all':!![]}];}return db[_0xc583('0xce')][_0xc583('0x110')](_0x2f31ae);})[_0xc583('0x22')](function(_0x3f169f){_0x3b7fa2[_0xc583('0xc0')]=_0x3f169f;return _0x3b7fa2;});}})[_0xc583('0x22')](respondWithFilteredResult(_0x4d6f30,_0x2f31ae))[_0xc583('0x2d')](handleError(_0x4d6f30,null));};exports[_0xc583('0x112')]=function(_0x46e785,_0x1175a2,_0x585e36){return db['ChatInteraction'][_0xc583('0x6e')]({'where':{'id':_0x46e785['params']['id']}})[_0xc583('0x22')](handleEntityNotFound(_0x1175a2,null))[_0xc583('0x22')](function(_0x442dc0){if(_0x442dc0){return _0x442dc0['setTags'](_0x46e785[_0xc583('0x83')][_0xc583('0x10c')],_[_0xc583('0x113')](_0x46e785[_0xc583('0x83')],[_0xc583('0x10c'),'id'])||{})['spread'](function(){return db['Tag'][_0xc583('0x110')]({'attributes':['id',_0xc583('0x3b'),_0xc583('0x56')],'where':{'id':_0x46e785[_0xc583('0x83')][_0xc583('0x10c')]}});})[_0xc583('0x22')](function(_0x334244){socket[_0xc583('0x114')]('chatInteractionTags:save',{'id':Number(_0x46e785['params']['id']),'tags':_0x334244||[]});return{'id':Number(_0x46e785[_0xc583('0xc2')]['id']),'tags':_0x334244||[]};});}})[_0xc583('0x22')](respondWithResult(_0x1175a2,null))[_0xc583('0x2d')](handleError(_0x1175a2,null));};exports[_0xc583('0x115')]=function(_0x34403a,_0x54867b,_0xa0ef23){return db['ChatInteraction'][_0xc583('0x6e')]({'where':{'id':_0x34403a[_0xc583('0xc2')]['id']}})[_0xc583('0x22')](handleEntityNotFound(_0x54867b,null))['then'](function(_0x383d35){if(_0x383d35){return _0x383d35[_0xc583('0x115')](_0x34403a[_0xc583('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x54867b,null))[_0xc583('0x2d')](handleError(_0x54867b,null));};exports[_0xc583('0xe2')]=function(_0x5b466a,_0x47b0a3){var _0x1a6e7f=moment()['unix']()[_0xc583('0xba')]();var _0x583837=path[_0xc583('0xe3')](config[_0xc583('0xe4')],_0xc583('0x116'),_0xc583('0x117'),'tmp');var _0x3da50a=path['join'](config[_0xc583('0xe4')],_0xc583('0x116'),_0xc583('0x117'),_0xc583('0x118'));var _0x1990b0=path[_0xc583('0xe3')](_0x583837,_0x1a6e7f);var _0x558aea=util[_0xc583('0xe8')]('transcript-%d-%s.zip',_0x5b466a[_0xc583('0xc2')]['id'],_0x1a6e7f);var _0x3244be=path[_0xc583('0xe3')](_0x583837,_0x558aea);var _0x4a8088=[];_0x4a8088[_0xc583('0xbe')]({'model':db[_0xc583('0x7f')],'as':_0xc583('0x7f'),'attributes':['id',_0xc583('0x3e')],'raw':!![]});_0x4a8088[_0xc583('0xbe')]({'model':db[_0xc583('0xed')],'as':_0xc583('0x71'),'attributes':['id',_0xc583('0x119'),_0xc583('0x11a')],'raw':!![]});if(_0x5b466a[_0xc583('0x46')]['attachments']){_0x4a8088['push']({'model':db[_0xc583('0xe0')],'as':'Attachment','raw':!![]});}var _0x12217c=[{'model':db[_0xc583('0xce')],'as':_0xc583('0xec'),'attributes':['id',_0xc583('0x83'),'createdAt',_0xc583('0xf9'),_0xc583('0xfa'),_0xc583('0x8f')],'include':_0x4a8088}];_0x12217c['push']({'model':db[_0xc583('0x11b')],'as':_0xc583('0x11c'),'attributes':['id',_0xc583('0x3b')]});_0x12217c[_0xc583('0xbe')]({'model':db[_0xc583('0x7f')],'as':'Owner','attributes':['id',_0xc583('0x3e')]});return db['ChatInteraction']['find']({'where':{'id':_0x5b466a[_0xc583('0xc2')]['id']},'include':_0x12217c})[_0xc583('0x22')](handleEntityNotFound(_0x47b0a3,null))[_0xc583('0x22')](function(_0x29e600){if(_0x29e600){var _0x221112=_0x29e600[_0xc583('0x11d')]({'plain':!![]});fs[_0xc583('0x11e')](_0x1990b0);var _0x3786fd={'format':'A4','border':'10px','header':{'height':_0xc583('0x11f'),'contents':{'first':_0xc583('0x120')}},'footer':{'height':_0xc583('0x121'),'contents':{'default':util['format'](_0xc583('0x122'),util[_0xc583('0xe8')](_0xc583('0x123'),'Chat',_0x221112['id']),moment()[_0xc583('0xe8')]('YYYY-MM-DD')[_0xc583('0xba')]())}}};var _0x29a8c3={'channel':_0xc583('0x124'),'account':_0x221112['Account'][_0xc583('0x3b')],'agent':_0x221112['Owner']?_0x221112[_0xc583('0x125')][_0xc583('0x3e')]:_0xc583('0x126'),'createdAt':moment(_0x221112['createdAt'])[_0xc583('0xe8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc583('0xba')](),'closedAt':_0x221112['closed']?moment(_0x221112[_0xc583('0x127')])[_0xc583('0xe8')](_0xc583('0x10d'))['toString']():'','disposition':_0x221112[_0xc583('0xd7')],'chatInfo':{'browser':_0x221112['browserName'],'os':_0x221112[_0xc583('0x128')],'referer':_0x221112[_0xc583('0x129')],'customerIp':_0x221112[_0xc583('0x12a')],'customerPort':_0x221112[_0xc583('0x12b')]?_0x221112[_0xc583('0x12b')]:'N.A.'},'messages':_(_0x221112['Messages'])['tail']()[_0xc583('0x93')]({'secret':![]})[_0xc583('0x3d')](function(_0x27271a){if(_0x27271a[_0xc583('0xe0')]){var _0x5805ca=path['join'](_0x3da50a,_0x27271a[_0xc583('0xe0')][_0xc583('0xe6')]);if(fs['existsSync'](_0x5805ca)){fs[_0xc583('0x12c')](_0x5805ca)[_0xc583('0x12d')](fs[_0xc583('0x12e')](path[_0xc583('0xe3')](_0x1990b0,_0x27271a[_0xc583('0xe0')][_0xc583('0xe6')])));}}return{'date':moment(_0x27271a[_0xc583('0x89')])[_0xc583('0xe8')](_0xc583('0x10d'))['toString'](),'sender':_0x27271a['direction']===_0xc583('0xcd')?_0x27271a[_0xc583('0x7f')]?_0x27271a[_0xc583('0x7f')]['fullname']:_0xc583('0xf4'):_0x27271a['Contact']['firstName']+(_0x27271a[_0xc583('0x71')][_0xc583('0x11a')]?'\x20'+_0x27271a[_0xc583('0x71')][_0xc583('0x11a')]:''),'body':_0x27271a[_0xc583('0xe0')]?_0x27271a[_0xc583('0xe0')][_0xc583('0xe6')]:_0x27271a[_0xc583('0x83')],'direction':_0x27271a[_0xc583('0xf9')]===_0xc583('0xcd')?'A':'C','secret':_0x27271a[_0xc583('0xfa')],'read':_0x27271a[_0xc583('0x8f')],'attachment':_0x27271a[_0xc583('0xe0')]};})[_0xc583('0x79')]()};return ejs[_0xc583('0x12f')](path[_0xc583('0xe3')](config['root'],_0xc583('0x116'),_0xc583('0x130'),_0xc583('0x131')),{'interaction':_0x29a8c3})['then'](function(_0x14caf3){return new BPromise(function(_0x32f385,_0x41045d){pdf[_0xc583('0xc4')](_0x14caf3,_0x3786fd)[_0xc583('0x132')](path['join'](_0x1990b0,'transcript-'+_0x221112['id']+'-'+_0x1a6e7f+_0xc583('0x133')),function(_0x335b28,_0x1bddee){if(_0x335b28)return _0x41045d(_0x335b28);_0x32f385(_0x1bddee);});});})[_0xc583('0x22')](function(){return new BPromise(function(_0x258b10,_0x3fc755){zipdir(_0x1990b0,{'saveTo':_0x3244be},function(_0x4a900c,_0x2ba67d){if(_0x4a900c)return _0x3fc755(_0x4a900c);return _0x258b10(_0x2ba67d);});})[_0xc583('0x22')](function(){return new BPromise(function(_0x291a9a,_0x685f68){rimraf(_0x1990b0,function(_0x38dc1c){if(_0x38dc1c)_0x685f68(_0x38dc1c);return _0x291a9a();});});})[_0xc583('0x22')](function(){return _0x47b0a3['download'](_0x3244be,_0x558aea,function(_0x197e0f){if(_0x197e0f){console['log']('err',_0x197e0f);}else{fs[_0xc583('0x134')](_0x3244be);}});});});}else{return _0x47b0a3[_0xc583('0x2e')](0xc8);}})['catch'](handleError(_0x47b0a3,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 9f43929..f7f4a42 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 _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
+var _0x65f6=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','getUsers','then','Users','map','findAll'];(function(_0xc5a3c1,_0x1cb35f){var _0x1dbc0c=function(_0x559e94){while(--_0x559e94){_0xc5a3c1['push'](_0xc5a3c1['shift']());}};_0x1dbc0c(++_0x1cb35f);}(_0x65f6,0x170));var _0x665f=function(_0x44a522,_0x1312bb){_0x44a522=_0x44a522-0x0;var _0x61ecc1=_0x65f6[_0x44a522];return _0x61ecc1;};'use strict';var EventEmitter=require(_0x665f('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x665f('0x1')];var ChatMessage=require(_0x665f('0x2'))['db'][_0x665f('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x665f('0x4')](0x0);var events={'afterCreate':_0x665f('0x5'),'afterUpdate':_0x665f('0x6'),'afterDestroy':'remove'};function emitEvent(_0x4279d8){return function(_0x51904d,_0x173eaf,_0x174997){_0x51904d[_0x665f('0x7')]({'attributes':['id'],'raw':!![]})[_0x665f('0x8')](function(_0x3ce1bf){_0x51904d['setDataValue'](_0x665f('0x9'),_0x3ce1bf[_0x665f('0xa')](function(_0x3b3373){return{'id':_0x3b3373['id']};}));return ChatMessage[_0x665f('0xb')]({'where':{'ChatInteractionId':_0x51904d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x665f('0x8')](function(_0x3d30cb){_0x51904d['setDataValue'](_0x665f('0xc'),_0x3d30cb[_0x665f('0xd')]);ChatInteractionEvents[_0x665f('0xe')](_0x4279d8+':'+_0x51904d['id'],_0x51904d);ChatInteractionEvents[_0x665f('0xe')](_0x4279d8,_0x51904d);_0x174997(null);})[_0x665f('0xf')](_0x174997(null));};}for(var e in events){if(events[_0x665f('0x10')](e)){var event=events[e];ChatInteraction[_0x665f('0x11')](e,emitEvent(event));}}module[_0x665f('0x12')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 72020bd..942daa1 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 _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
+var _0x5040=['define','ChatInteraction','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xedde59,_0x50d9b1){var _0x4db279=function(_0xa24719){while(--_0xa24719){_0xedde59['push'](_0xedde59['shift']());}};_0x4db279(++_0x50d9b1);}(_0x5040,0xbd));var _0x0504=function(_0x47ad99,_0x44b6a3){_0x47ad99=_0x47ad99-0x0;var _0xebd3e9=_0x5040[_0x47ad99];return _0xebd3e9;};'use strict';var _=require(_0x0504('0x0'));var util=require(_0x0504('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0504('0x2'));var rp=require(_0x0504('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0504('0x4'));var config=require(_0x0504('0x5'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x242363,_0x3ee168){return _0x242363[_0x0504('0x6')](_0x0504('0x7'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x28ddc5,_0x1dc93f,_0x568ba1){if(_0x28ddc5['changed'](_0x0504('0x8'))){_0x28ddc5['closedAt']=moment()[_0x0504('0x9')](_0x0504('0xa'));}_0x568ba1(null,_0x28ddc5);}},'charset':_0x0504('0xb'),'collate':_0x0504('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index e549b25..0eb3381 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 _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
+var _0x17ce=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','debug','catch','AddTagsToChatInteraction','find','addTags','ids','AddTags','lodash','moment'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x17ce,0x154));var _0xe17c=function(_0x25e49f,_0x27681a){_0x25e49f=_0x25e49f-0x0;var _0x1a649e=_0x17ce[_0x25e49f];return _0x1a649e;};'use strict';var _=require(_0xe17c('0x0'));var util=require('util');var moment=require(_0xe17c('0x1'));var BPromise=require('bluebird');var rs=require(_0xe17c('0x2'));var fs=require('fs');var Redis=require(_0xe17c('0x3'));var db=require(_0xe17c('0x4'))['db'];var utils=require(_0xe17c('0x5'));var logger=require(_0xe17c('0x6'))(_0xe17c('0x7'));var config=require(_0xe17c('0x8'));var jayson=require(_0xe17c('0x9'));var client=jayson[_0xe17c('0xa')]['http']({'port':0x232a});config[_0xe17c('0xb')]=_[_0xe17c('0xc')](config['redis'],{'host':_0xe17c('0xd'),'port':0x18eb});var socket=require(_0xe17c('0xe'))(new Redis(config[_0xe17c('0xb')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x22104f,_0x2091cb,_0x482e17){return new BPromise(function(_0x57105c,_0xe34e4e){return client['request'](_0x22104f,_0x482e17)[_0xe17c('0xf')](function(_0x43b9d8){logger[_0xe17c('0x10')](_0xe17c('0x11'),_0x2091cb,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2091cb,_0xe17c('0x12'),JSON[_0xe17c('0x13')](_0x43b9d8));if(_0x43b9d8[_0xe17c('0x14')]){if(_0x43b9d8[_0xe17c('0x14')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2091cb,_0x43b9d8[_0xe17c('0x14')][_0xe17c('0x15')]);return _0xe34e4e(_0x43b9d8[_0xe17c('0x14')][_0xe17c('0x15')]);}logger['error'](_0xe17c('0x11'),_0x2091cb,_0x43b9d8[_0xe17c('0x14')]['message']);return _0x57105c(_0x43b9d8[_0xe17c('0x14')][_0xe17c('0x15')]);}else{logger[_0xe17c('0x10')](_0xe17c('0x11'),_0x2091cb,_0xe17c('0x12'));_0x57105c(_0x43b9d8[_0xe17c('0x16')][_0xe17c('0x15')]);}})['catch'](function(_0x7dd8b7){logger[_0xe17c('0x14')](_0xe17c('0x11'),_0x2091cb,_0x7dd8b7);_0xe34e4e(_0x7dd8b7);});});}exports[_0xe17c('0x17')]=function(_0x132f5f){var _0x27a61f=this;return new Promise(function(_0x50512d,_0x3d0d59){return db[_0xe17c('0x18')][_0xe17c('0x19')](_0x132f5f[_0xe17c('0x1a')],{'raw':_0x132f5f[_0xe17c('0x1b')]?_0x132f5f[_0xe17c('0x1b')][_0xe17c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x132f5f[_0xe17c('0x1b')]?_0x132f5f[_0xe17c('0x1b')][_0xe17c('0x1d')]||null:null,'attributes':_0x132f5f[_0xe17c('0x1b')]?_0x132f5f['options'][_0xe17c('0x1e')]||null:null,'limit':_0x132f5f[_0xe17c('0x1b')]?_0x132f5f[_0xe17c('0x1b')]['limit']||null:null})[_0xe17c('0xf')](function(_0x1d46b6){logger['info'](_0xe17c('0x17'),_0x132f5f);logger[_0xe17c('0x1f')](_0xe17c('0x17'),_0x132f5f,JSON[_0xe17c('0x13')](_0x1d46b6));_0x50512d(_0x1d46b6);})[_0xe17c('0x20')](function(_0x34fe93){logger[_0xe17c('0x14')](_0xe17c('0x17'),_0x34fe93[_0xe17c('0x15')],_0x132f5f);_0x3d0d59(_0x27a61f[_0xe17c('0x14')](0x1f4,_0x34fe93[_0xe17c('0x15')]));});});};exports[_0xe17c('0x21')]=function(_0x300c7b){return new Promise(function(_0x5c8fe1,_0x3126ca){return db['ChatInteraction'][_0xe17c('0x22')]({'where':_0x300c7b[_0xe17c('0x1b')]?_0x300c7b[_0xe17c('0x1b')]['where']||null:null})[_0xe17c('0xf')](function(_0x21006b){if(_0x21006b){return _0x21006b[_0xe17c('0x23')](_0x300c7b[_0xe17c('0x1a')]['ids'],_['omit'](_0x300c7b[_0xe17c('0x1a')],[_0xe17c('0x24'),'id'])||{});}})['spread'](function(_0x37d852){logger[_0xe17c('0x10')](_0xe17c('0x25'),_0x300c7b);logger[_0xe17c('0x1f')](_0xe17c('0x25'),_0x300c7b,JSON['stringify'](_0x37d852));_0x5c8fe1(_0x37d852);})[_0xe17c('0x20')](function(_0x3cae85){logger[_0xe17c('0x14')](_0xe17c('0x25'),_0x3cae85[_0xe17c('0x15')],_0x300c7b);_0x3126ca(_this[_0xe17c('0x14')](0x1f4,_0x3cae85[_0xe17c('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index cffa2ed..1eb2e9c 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 _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
+var _0x03f8=['update','emit','removeListener','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x565757,_0x433f97){var _0x71f8b9=function(_0x31571b){while(--_0x31571b){_0x565757['push'](_0x565757['shift']());}};_0x71f8b9(++_0x433f97);}(_0x03f8,0xf5));var _0x803f=function(_0xe455e7,_0x29fb65){_0xe455e7=_0xe455e7-0x0;var _0xfc683e=_0x03f8[_0xe455e7];return _0xfc683e;};'use strict';var ChatInteractionEvents=require(_0x803f('0x0'));var events=[_0x803f('0x1'),_0x803f('0x2'),_0x803f('0x3')];function createListener(_0x4f35fd,_0x1b881f){return function(_0x2a53d7){_0x1b881f[_0x803f('0x4')](_0x4f35fd,_0x2a53d7);};}function removeListener(_0x5d98ab,_0x21b024){return function(){ChatInteractionEvents[_0x803f('0x5')](_0x5d98ab,_0x21b024);};}exports['register']=function(_0x12cf24){for(var _0x161288=0x0,_0x3537bb=events[_0x803f('0x6')];_0x161288<_0x3537bb;_0x161288++){var _0xe83801=events[_0x161288];var _0x5f6b7e=createListener(_0x803f('0x7')+_0xe83801,_0x12cf24);ChatInteractionEvents['on'](_0xe83801,_0x5f6b7e);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index dd31430..039cae6 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 _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
+var _0x7708=['tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','multer','util','connect-timeout','../../config/environment','./chatInteraction.controller','isAuthenticated','get','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','format','%s-%s','replace','/:id/attachment_upload','single','file','addMessage'];(function(_0x62557c,_0x2beae0){var _0x26f89b=function(_0x39b9e9){while(--_0x39b9e9){_0x62557c['push'](_0x62557c['shift']());}};_0x26f89b(++_0x2beae0);}(_0x7708,0x188));var _0x8770=function(_0x427352,_0x1bce61){_0x427352=_0x427352-0x0;var _0x23e0e6=_0x7708[_0x427352];return _0x23e0e6;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8770('0x3'));var controller=require(_0x8770('0x4'));router['get']('/',auth[_0x8770('0x5')](),controller['index']);router[_0x8770('0x6')](_0x8770('0x7'),auth[_0x8770('0x5')](),controller[_0x8770('0x8')]);router[_0x8770('0x6')](_0x8770('0x9'),auth[_0x8770('0xa')](),controller['show']);router[_0x8770('0x6')](_0x8770('0xb'),auth[_0x8770('0xa')](),controller['attachmentDownload']);router[_0x8770('0x6')](_0x8770('0xc'),auth[_0x8770('0x5')](),controller[_0x8770('0xd')]);router['get'](_0x8770('0xe'),auth[_0x8770('0xa')](),controller[_0x8770('0xf')]);router['get'](_0x8770('0x10'),auth[_0x8770('0x5')](),controller[_0x8770('0x11')]);router[_0x8770('0x12')]('/',auth[_0x8770('0x5')](),controller[_0x8770('0x13')]);router[_0x8770('0x12')](_0x8770('0x14'),auth['isAuthenticated'](),controller[_0x8770('0x15')]);var upload=multer({'storage':multer[_0x8770('0x16')]({'destination':function(_0x5dd4e7,_0x2f7918,_0x52254f){_0x52254f(null,path[_0x8770('0x17')](config['root'],'server/files/attachments/'));},'filename':function(_0x50ff57,_0x155e83,_0x3b459a){_0x3b459a(null,util[_0x8770('0x18')](_0x8770('0x19'),Date['now'](),_0x155e83['originalname'][_0x8770('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8770('0x12')](_0x8770('0x1b'),upload[_0x8770('0x1c')](_0x8770('0x1d')),controller['attachmentUpload']);router[_0x8770('0x12')](_0x8770('0xc'),auth[_0x8770('0xa')](),controller[_0x8770('0x1e')]);router['post']('/:id/tags',auth[_0x8770('0x5')](),interaction[_0x8770('0x1f')](_0x8770('0x20'),_0x8770('0x21')),controller[_0x8770('0x22')]);router[_0x8770('0x23')]('/:id',auth[_0x8770('0x5')](),interaction[_0x8770('0x1f')](_0x8770('0x20'),_0x8770('0x24')),controller['update']);router[_0x8770('0x23')]('/:id/custom_update',controller[_0x8770('0x25')]);router[_0x8770('0x23')](_0x8770('0x26'),auth[_0x8770('0xa')](),controller[_0x8770('0x27')]);router[_0x8770('0x23')](_0x8770('0x28'),controller[_0x8770('0x29')]);router[_0x8770('0x2a')](_0x8770('0x9'),auth['isAuthenticated'](),interaction[_0x8770('0x1f')](_0x8770('0x20'),_0x8770('0x2b')),controller[_0x8770('0x2c')]);router[_0x8770('0x2a')](_0x8770('0x2d'),auth['isAuthenticated'](),controller['removeTags']);module[_0x8770('0x2e')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 63037b8..5c59896 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 _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
+var _0xda2d=['medium','BOOLEAN','INTEGER','exports','TEXT'];(function(_0x4deefb,_0x33f98f){var _0x50d9cb=function(_0x3cb37f){while(--_0x3cb37f){_0x4deefb['push'](_0x4deefb['shift']());}};_0x50d9cb(++_0x33f98f);}(_0xda2d,0x102));var _0xdda2=function(_0x1adb3a,_0x508c05){_0x1adb3a=_0x1adb3a-0x0;var _0x1d836d=_0xda2d[_0x1adb3a];return _0x1d836d;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'body':{'type':Sequelize[_0xdda2('0x1')](_0xdda2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdda2('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index f579820..69203b4 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 _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
+var _0x35dd=['read','all','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','error','name','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','ChatInternalMessage','findAll','catch','show','params','length','find','create','body','describe','get','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','messages','FromId','ToId'];(function(_0x13f144,_0x2e439b){var _0x15d228=function(_0x5d3a42){while(--_0x5d3a42){_0x13f144['push'](_0x13f144['shift']());}};_0x15d228(++_0x2e439b);}(_0x35dd,0x1b6));var _0xd35d=function(_0x213de5,_0x3bdb5e){_0x213de5=_0x213de5-0x0;var _0x175a33=_0x35dd[_0x213de5];return _0x175a33;};'use strict';var pdf=require(_0xd35d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd35d('0x1'));var zipdir=require(_0xd35d('0x2'));var jsonpatch=require(_0xd35d('0x3'));var rp=require(_0xd35d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd35d('0x5'));var util=require(_0xd35d('0x6'));var path=require(_0xd35d('0x7'));var sox=require(_0xd35d('0x8'));var csv=require(_0xd35d('0x9'));var ejs=require(_0xd35d('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd35d('0xb'));var crypto=require(_0xd35d('0xc'));var jsforce=require(_0xd35d('0xd'));var deskjs=require(_0xd35d('0xe'));var toCsv=require(_0xd35d('0x9'));var querystring=require(_0xd35d('0xf'));var Papa=require(_0xd35d('0x10'));var Redis=require(_0xd35d('0x11'));var authService=require(_0xd35d('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd35d('0x13'));var logger=require(_0xd35d('0x14'))(_0xd35d('0x15'));var utils=require(_0xd35d('0x16'));var config=require(_0xd35d('0x17'));var db=require(_0xd35d('0x18'))['db'];config['redis']=_[_0xd35d('0x19')](config[_0xd35d('0x1a')],{'host':_0xd35d('0x1b'),'port':0x18eb});var socket=require(_0xd35d('0x1c'))(new Redis(config[_0xd35d('0x1a')]));require('./chatInternalMessage.socket')[_0xd35d('0x1d')](socket);function respondWithStatusCode(_0x5c3982,_0x3c006a){_0x3c006a=_0x3c006a||0xcc;return function(_0x1dc75d){if(_0x1dc75d){return _0x5c3982[_0xd35d('0x1e')](_0x3c006a);}return _0x5c3982[_0xd35d('0x1f')](_0x3c006a)[_0xd35d('0x20')]();};}function respondWithResult(_0x8dafb7,_0x42be4c){_0x42be4c=_0x42be4c||0xc8;return function(_0x34d38e){if(_0x34d38e){return _0x8dafb7[_0xd35d('0x1f')](_0x42be4c)[_0xd35d('0x21')](_0x34d38e);}};}function respondWithFilteredResult(_0x122d0f,_0xc5eba7){return function(_0x3f6b01){if(_0x3f6b01){var _0x245f6f=_0x3f6b01[_0xd35d('0x22')],_0x13fd18=_0xc5eba7[_0xd35d('0x23')],_0x192aa2=_0xc5eba7[_0xd35d('0x23')]+_0xc5eba7[_0xd35d('0x24')],_0x56b071;if(_0x192aa2>=_0x245f6f){_0x192aa2=_0x245f6f;_0x56b071=0xc8;}else{_0x56b071=0xce;}_0x122d0f[_0xd35d('0x1f')](_0x56b071);return _0x122d0f[_0xd35d('0x25')](_0xd35d('0x26'),_0x13fd18+'-'+_0x192aa2+'/'+_0x245f6f)[_0xd35d('0x21')](_0x3f6b01);}return null;};}function patchUpdates(_0xf75fb1){return function(_0x36bb7f){try{jsonpatch['apply'](_0x36bb7f,_0xf75fb1,!![]);}catch(_0xba9407){return BPromise[_0xd35d('0x27')](_0xba9407);}return _0x36bb7f['save']();};}function saveUpdates(_0x4506be,_0x13efc9){return function(_0x2c67d3){if(_0x2c67d3){return _0x2c67d3[_0xd35d('0x28')](_0x4506be)[_0xd35d('0x29')](function(_0x194599){return _0x194599;});}return null;};}function removeEntity(_0xad2304,_0x35bf35){return function(_0x3362b9){if(_0x3362b9){return _0x3362b9[_0xd35d('0x2a')]()[_0xd35d('0x29')](function(){_0xad2304[_0xd35d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59e1ba,_0x442781){return function(_0x1bdfa6){if(!_0x1bdfa6){_0x59e1ba[_0xd35d('0x1e')](0x194);}return _0x1bdfa6;};}function handleError(_0x326156,_0x27eb2c){_0x27eb2c=_0x27eb2c||0x1f4;return function(_0x25e1c4){logger[_0xd35d('0x2b')](_0x25e1c4['stack']);if(_0x25e1c4['name']){delete _0x25e1c4[_0xd35d('0x2c')];}_0x326156['status'](_0x27eb2c)['send'](_0x25e1c4);};}exports['index']=function(_0x1893dc,_0x4e0562){var _0x2063d3={},_0x2662a0={},_0x5d34e0={'count':0x0,'rows':[]};var _0x4c1ee0=_[_0xd35d('0x2d')](db['ChatInternalMessage'][_0xd35d('0x2e')],function(_0x1cb806){return{'name':_0x1cb806['fieldName'],'type':_0x1cb806[_0xd35d('0x2f')][_0xd35d('0x30')]};});_0x2662a0[_0xd35d('0x31')]=_[_0xd35d('0x2d')](_0x4c1ee0,_0xd35d('0x2c'));_0x2662a0[_0xd35d('0x32')]=_[_0xd35d('0x33')](_0x1893dc[_0xd35d('0x32')]);_0x2662a0[_0xd35d('0x34')]=_[_0xd35d('0x35')](_0x2662a0[_0xd35d('0x31')],_0x2662a0[_0xd35d('0x32')]);_0x2063d3[_0xd35d('0x36')]=_[_0xd35d('0x35')](_0x2662a0[_0xd35d('0x31')],qs[_0xd35d('0x37')](_0x1893dc[_0xd35d('0x32')][_0xd35d('0x37')]));_0x2063d3[_0xd35d('0x36')]=_0x2063d3[_0xd35d('0x36')]['length']?_0x2063d3[_0xd35d('0x36')]:_0x2662a0[_0xd35d('0x31')];if(!_0x1893dc[_0xd35d('0x32')][_0xd35d('0x38')]('nolimit')){_0x2063d3[_0xd35d('0x24')]=qs[_0xd35d('0x24')](_0x1893dc[_0xd35d('0x32')][_0xd35d('0x24')]);_0x2063d3[_0xd35d('0x23')]=qs[_0xd35d('0x23')](_0x1893dc[_0xd35d('0x32')][_0xd35d('0x23')]);}_0x2063d3['order']=qs[_0xd35d('0x39')](_0x1893dc[_0xd35d('0x32')][_0xd35d('0x39')]);_0x2063d3['where']=qs[_0xd35d('0x34')](_[_0xd35d('0x3a')](_0x1893dc[_0xd35d('0x32')],_0x2662a0[_0xd35d('0x34')]),_0x4c1ee0);if(_0x1893dc['query'][_0xd35d('0x3b')]){_0x2063d3[_0xd35d('0x3c')]=_[_0xd35d('0x3d')](_0x2063d3[_0xd35d('0x3c')],{'$or':_[_0xd35d('0x2d')](_0x4c1ee0,function(_0x6d0919){if(_0x6d0919[_0xd35d('0x2f')]!==_0xd35d('0x3e')){var _0x551fe5={};_0x551fe5[_0x6d0919[_0xd35d('0x2c')]]={'$like':'%'+_0x1893dc[_0xd35d('0x32')][_0xd35d('0x3b')]+'%'};return _0x551fe5;}})});}_0x2063d3=_[_0xd35d('0x3d')]({},_0x2063d3,_0x1893dc[_0xd35d('0x3f')]);var _0x4d6c37={'where':_0x2063d3[_0xd35d('0x3c')]};return db['ChatInternalMessage'][_0xd35d('0x22')](_0x4d6c37)['then'](function(_0x420b5a){_0x5d34e0['count']=_0x420b5a;if(_0x1893dc['query'][_0xd35d('0x40')]){_0x2063d3[_0xd35d('0x41')]=[{'all':!![]}];}return db[_0xd35d('0x42')][_0xd35d('0x43')](_0x2063d3);})[_0xd35d('0x29')](function(_0x38cbe4){_0x5d34e0['rows']=_0x38cbe4;return _0x5d34e0;})[_0xd35d('0x29')](respondWithFilteredResult(_0x4e0562,_0x2063d3))[_0xd35d('0x44')](handleError(_0x4e0562,null));};exports[_0xd35d('0x45')]=function(_0x5552fa,_0x4f99b4){var _0x29125d={'raw':!![],'where':{'id':_0x5552fa[_0xd35d('0x46')]['id']}},_0x404fd2={};_0x404fd2[_0xd35d('0x31')]=_['keys'](db[_0xd35d('0x42')][_0xd35d('0x2e')]);_0x404fd2['query']=_[_0xd35d('0x33')](_0x5552fa[_0xd35d('0x32')]);_0x404fd2[_0xd35d('0x34')]=_[_0xd35d('0x35')](_0x404fd2['model'],_0x404fd2['query']);_0x29125d['attributes']=_[_0xd35d('0x35')](_0x404fd2['model'],qs[_0xd35d('0x37')](_0x5552fa[_0xd35d('0x32')][_0xd35d('0x37')]));_0x29125d['attributes']=_0x29125d[_0xd35d('0x36')][_0xd35d('0x47')]?_0x29125d[_0xd35d('0x36')]:_0x404fd2[_0xd35d('0x31')];if(_0x5552fa[_0xd35d('0x32')][_0xd35d('0x40')]){_0x29125d[_0xd35d('0x41')]=[{'all':!![]}];}_0x29125d=_[_0xd35d('0x3d')]({},_0x29125d,_0x5552fa[_0xd35d('0x3f')]);return db[_0xd35d('0x42')][_0xd35d('0x48')](_0x29125d)['then'](handleEntityNotFound(_0x4f99b4,null))['then'](respondWithResult(_0x4f99b4,null))[_0xd35d('0x44')](handleError(_0x4f99b4,null));};exports[_0xd35d('0x49')]=function(_0x5e9216,_0x76ed66){return db[_0xd35d('0x42')][_0xd35d('0x49')](_0x5e9216[_0xd35d('0x4a')],{})[_0xd35d('0x29')](respondWithResult(_0x76ed66,0xc9))[_0xd35d('0x44')](handleError(_0x76ed66,null));};exports['update']=function(_0x534ee1,_0x4a1201){if(_0x534ee1[_0xd35d('0x4a')]['id']){delete _0x534ee1['body']['id'];}return db[_0xd35d('0x42')][_0xd35d('0x48')]({'where':{'id':_0x534ee1[_0xd35d('0x46')]['id']}})[_0xd35d('0x29')](handleEntityNotFound(_0x4a1201,null))[_0xd35d('0x29')](saveUpdates(_0x534ee1[_0xd35d('0x4a')],null))[_0xd35d('0x29')](respondWithResult(_0x4a1201,null))[_0xd35d('0x44')](handleError(_0x4a1201,null));};exports[_0xd35d('0x2a')]=function(_0x13f53d,_0x401ff6){return db[_0xd35d('0x42')]['find']({'where':{'id':_0x13f53d['params']['id']}})['then'](handleEntityNotFound(_0x401ff6,null))[_0xd35d('0x29')](removeEntity(_0x401ff6,null))['catch'](handleError(_0x401ff6,null));};exports[_0xd35d('0x4b')]=function(_0x3d6bd6,_0x49f7fe){return db[_0xd35d('0x42')]['describe']()[_0xd35d('0x29')](respondWithResult(_0x49f7fe,null))[_0xd35d('0x44')](handleError(_0x49f7fe,null));};function wrapUser(_0x1776ca){return function(_0x9fbc5a){var _0x231dfd=_0x1776ca[_0xd35d('0x4c')]({'plain':!![]});_0x231dfd['messages']=[];if(_0x9fbc5a){_0x231dfd[_0xd35d('0x4d')]=_0x9fbc5a[_0xd35d('0x4e')];_0x231dfd['lastMessage']=_0x9fbc5a;}else{_0x231dfd[_0xd35d('0x4d')]=moment(0x0)[_0xd35d('0x4f')](_0xd35d('0x50'));_0x231dfd[_0xd35d('0x51')]={};}return _0x231dfd;};}exports[_0xd35d('0x52')]=function(_0x3282f7,_0x1547fd,_0x461e65){var _0x55cd15=[];return db[_0xd35d('0x53')][_0xd35d('0x43')]({'where':{'role':[_0xd35d('0x54'),_0xd35d('0x55'),_0xd35d('0x56')]},'attributes':['id',_0xd35d('0x57'),_0xd35d('0x2c'),_0xd35d('0x58'),_0xd35d('0x59'),_0xd35d('0x5a'),_0xd35d('0x5b'),_0xd35d('0x5c'),_0xd35d('0x5d'),_0xd35d('0x5e')],'order':qs['sort']('-online'),'include':[{'model':db[_0xd35d('0x5f')],'as':'VoiceQueues','attributes':['id','name',_0xd35d('0x2f')],'through':{'attributes':[]}}]})[_0xd35d('0x29')](function(_0x389164){if(_0x389164){var _0x1dc0f9=_0x3282f7[_0xd35d('0x56')][_0xd35d('0x4c')]({'plain':!![]});if(!_0x1dc0f9)throw new Error(_0xd35d('0x60'));if(_0x1dc0f9[_0xd35d('0x58')]===_0xd35d('0x56')){return db[_0xd35d('0x61')][_0xd35d('0x48')]({'where':{'name':_0xd35d('0x62'),'userProfileId':_0x1dc0f9[_0xd35d('0x63')]},'raw':!![]})[_0xd35d('0x29')](function(_0x363ac7){if(_0x363ac7){if(_0x363ac7[_0xd35d('0x64')]===0x0){return db[_0xd35d('0x65')][_0xd35d('0x43')]({'where':{'sectionId':_0x363ac7['id']},'raw':!![]})[_0xd35d('0x29')](function(_0x40fef5){var _0x49f887=[];if(_[_0xd35d('0x66')](_0x40fef5)){_0x49f887=_[_0xd35d('0x3b')](_0x389164,function(_0x21ca25){if(_0x21ca25[_0xd35d('0x58')]!==_0xd35d('0x54')){return _0x21ca25;}});return _0x49f887;}else{for(var _0x1840fb=0x0;_0x1840fb<_0x389164[_0xd35d('0x47')];_0x1840fb++){var _0x596c01=_0x389164[_0x1840fb];if(_0x596c01['role']===_0xd35d('0x54')){var _0x3c43d5=_[_0xd35d('0x48')](_0x40fef5,function(_0x913f9d){return _0x913f9d['resourceId']===_0x596c01['id'];});if(_0x3c43d5)_0x49f887[_0xd35d('0x67')](_0x596c01);}else{_0x49f887[_0xd35d('0x67')](_0x596c01);}}return _0x49f887;}});}else{return _0x389164;}}else{var _0x4c9d18=_[_0xd35d('0x3b')](_0x389164,function(_0x5e4e9b){if(_0x5e4e9b[_0xd35d('0x58')]!=='agent'){return _0x5e4e9b;}});return _0x4c9d18;}});}else{return _0x389164;}}})[_0xd35d('0x29')](function(_0x35b51c){var _0x50d207=[];if(_0x35b51c){_0x55cd15=_0x35b51c;for(var _0x223d76=0x0;_0x223d76<_0x35b51c[_0xd35d('0x47')];_0x223d76+=0x1){_0x55cd15[_0x223d76][_0xd35d('0x68')]=[];_0x50d207[_0xd35d('0x67')](db[_0xd35d('0x42')]['find']({'where':{'FromId':[_0x3282f7['user']['id'],_0x35b51c[_0x223d76]['id']],'ToId':[_0x3282f7[_0xd35d('0x56')]['id'],_0x35b51c[_0x223d76]['id']],'ChatGroupId':null},'attributes':['id',_0xd35d('0x4e'),_0xd35d('0x69'),_0xd35d('0x6a'),_0xd35d('0x6b'),'body'],'order':qs[_0xd35d('0x39')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd35d('0x29')](wrapUser(_0x35b51c[_0x223d76])));}return BPromise[_0xd35d('0x6c')](_0x50d207);}return[];})[_0xd35d('0x29')](function(_0x201cdd){return{'rows':_0x201cdd,'count':_0x201cdd[_0xd35d('0x47')]};})['then'](respondWithResult(_0x1547fd,null))['catch'](handleError(_0x1547fd,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 8eba9ab..fcfe46d 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 _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
+var _0xa87e=['hook','exports','events','../../mysqldb','ChatInternalMessage','save','update','remove','emit'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xa87e,0x185));var _0xea87=function(_0x469628,_0x5da725){_0x469628=_0x469628-0x0;var _0x62c76d=_0xa87e[_0x469628];return _0x62c76d;};'use strict';var EventEmitter=require(_0xea87('0x0'));var ChatInternalMessage=require(_0xea87('0x1'))['db'][_0xea87('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xea87('0x3'),'afterUpdate':_0xea87('0x4'),'afterDestroy':_0xea87('0x5')};function emitEvent(_0x55c317){return function(_0x28fe92,_0x3c1913,_0x42ca61){ChatInternalMessageEvents[_0xea87('0x6')](_0x55c317+':'+_0x28fe92['id'],_0x28fe92);ChatInternalMessageEvents[_0xea87('0x6')](_0x55c317,_0x28fe92);_0x42ca61(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xea87('0x7')](e,emitEvent(event));}}module[_0xea87('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 ea5682c..f43f869 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 _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
+var _0x27e4=['ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x363643,_0x33f7af){var _0x48b910=function(_0x1da513){while(--_0x1da513){_0x363643['push'](_0x363643['shift']());}};_0x48b910(++_0x33f7af);}(_0x27e4,0x153));var _0x427e=function(_0x79d46c,_0x289444){_0x79d46c=_0x79d46c-0x0;var _0x3f9f4b=_0x27e4[_0x79d46c];return _0x3f9f4b;};'use strict';var _=require(_0x427e('0x0'));var util=require(_0x427e('0x1'));var logger=require('../../config/logger')(_0x427e('0x2'));var moment=require('moment');var BPromise=require(_0x427e('0x3'));var rp=require(_0x427e('0x4'));var fs=require('fs');var path=require(_0x427e('0x5'));var rimraf=require(_0x427e('0x6'));var config=require(_0x427e('0x7'));var attributes=require(_0x427e('0x8'));module['exports']=function(_0x4f032a,_0x289e5b){return _0x4f032a['define'](_0x427e('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x427e('0xa'),'collate':_0x427e('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 24a6b5c..5694f68 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 _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
+var _0xd11f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird'];(function(_0x1c8228,_0x15fa1c){var _0x121041=function(_0x3a71c1){while(--_0x3a71c1){_0x1c8228['push'](_0x1c8228['shift']());}};_0x121041(++_0x15fa1c);}(_0xd11f,0xa4));var _0xfd11=function(_0x2ef8c1,_0x2f72f4){_0x2ef8c1=_0x2ef8c1-0x0;var _0x288305=_0xd11f[_0x2ef8c1];return _0x288305;};'use strict';var _=require(_0xfd11('0x0'));var util=require(_0xfd11('0x1'));var moment=require(_0xfd11('0x2'));var BPromise=require(_0xfd11('0x3'));var rs=require(_0xfd11('0x4'));var fs=require('fs');var Redis=require(_0xfd11('0x5'));var db=require(_0xfd11('0x6'))['db'];var utils=require(_0xfd11('0x7'));var logger=require(_0xfd11('0x8'))('rpc');var config=require(_0xfd11('0x9'));var jayson=require(_0xfd11('0xa'));var client=jayson[_0xfd11('0xb')][_0xfd11('0xc')]({'port':0x232a});config[_0xfd11('0xd')]=_[_0xfd11('0xe')](config['redis'],{'host':_0xfd11('0xf'),'port':0x18eb});var socket=require(_0xfd11('0x10'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x197797,_0x3754cf,_0x41a9f9){return new BPromise(function(_0x4d9567,_0x431b21){return client[_0xfd11('0x11')](_0x197797,_0x41a9f9)['then'](function(_0x53de22){logger[_0xfd11('0x12')](_0xfd11('0x13'),_0x3754cf,'request\x20sent');logger[_0xfd11('0x14')](_0xfd11('0x15'),_0x3754cf,'request\x20sent',JSON[_0xfd11('0x16')](_0x53de22));if(_0x53de22[_0xfd11('0x17')]){if(_0x53de22[_0xfd11('0x17')]['code']===0x1f4){logger[_0xfd11('0x17')](_0xfd11('0x13'),_0x3754cf,_0x53de22[_0xfd11('0x17')][_0xfd11('0x18')]);return _0x431b21(_0x53de22[_0xfd11('0x17')]['message']);}logger[_0xfd11('0x17')](_0xfd11('0x13'),_0x3754cf,_0x53de22[_0xfd11('0x17')]['message']);return _0x4d9567(_0x53de22[_0xfd11('0x17')][_0xfd11('0x18')]);}else{logger[_0xfd11('0x12')](_0xfd11('0x13'),_0x3754cf,_0xfd11('0x19'));_0x4d9567(_0x53de22[_0xfd11('0x1a')][_0xfd11('0x18')]);}})[_0xfd11('0x1b')](function(_0x445457){logger[_0xfd11('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x3754cf,_0x445457);_0x431b21(_0x445457);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 7067360..851f88c 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 _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
+var _0x0eaa=['emit','removeListener','register','./chatInternalMessage.events','save'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x4c2fad,_0x1eb609){_0x4c2fad=_0x4c2fad-0x0;var _0x1a4825=_0x0eaa[_0x4c2fad];return _0x1a4825;};'use strict';var ChatInternalMessageEvents=require(_0xa0ea('0x0'));var events=[_0xa0ea('0x1'),'remove','update'];function createListener(_0x17efb8,_0x1fe195){return function(_0x5800e9){_0x1fe195[_0xa0ea('0x2')](_0x17efb8,_0x5800e9);};}function removeListener(_0x1c74b8,_0x30dd52){return function(){ChatInternalMessageEvents[_0xa0ea('0x3')](_0x1c74b8,_0x30dd52);};}exports[_0xa0ea('0x4')]=function(_0x5636ed){for(var _0x3c6586=0x0,_0x521881=events['length'];_0x3c6586<_0x521881;_0x3c6586++){var _0x361178=events[_0x3c6586];var _0x8632a1=createListener('chatInternalMessage:'+_0x361178,_0x5636ed);ChatInternalMessageEvents['on'](_0x361178,_0x8632a1);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 2fbdbaa..89bd955 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 _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
+var _0xe706=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x3ea9c4,_0x6891a4){var _0x36e3da=function(_0x3a2502){while(--_0x3a2502){_0x3ea9c4['push'](_0x3ea9c4['shift']());}};_0x36e3da(++_0x6891a4);}(_0xe706,0xa3));var _0x6e70=function(_0x209cc0,_0x59bb37){_0x209cc0=_0x209cc0-0x0;var _0x3c5029=_0xe706[_0x209cc0];return _0x3c5029;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x9')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x9')](_0x6e70('0x10'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x12')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);router['put']('/:id',controller[_0x6e70('0x14')]);router[_0x6e70('0x15')](_0x6e70('0x10'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x16')]);module[_0x6e70('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index b196270..99c2fe2 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 _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
+var _0xfa7b=['sequelize','TEXT','medium','BOOLEAN','DATE'];(function(_0x3b2e0a,_0x49a3f9){var _0x4a84bd=function(_0x3aa487){while(--_0x3aa487){_0x3b2e0a['push'](_0x3b2e0a['shift']());}};_0x4a84bd(++_0x49a3f9);}(_0xfa7b,0x15e));var _0xbfa7=function(_0x34264f,_0x203e13){_0x34264f=_0x34264f-0x0;var _0xeb8135=_0xfa7b[_0x34264f];return _0xeb8135;};'use strict';var Sequelize=require(_0xbfa7('0x0'));module['exports']={'body':{'type':Sequelize[_0xbfa7('0x1')](_0xbfa7('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xbfa7('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbfa7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xbfa7('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index fad458e..419895b 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 _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
+var _0x435b=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','localhost','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','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','stack','name','map','ChatMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','include','findAll','show','params','fields','find','create','body','update','../../config/logger','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','EventManager','parse','formData','agent','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0xca1091,_0x539dbf){var _0xd3019c=function(_0xd629e0){while(--_0xd629e0){_0xca1091['push'](_0xca1091['shift']());}};_0xd3019c(++_0x539dbf);}(_0x435b,0x15a));var _0xb435=function(_0x257742,_0x65f38a){_0x257742=_0x257742-0x0;var _0x57583a=_0x435b[_0x257742];return _0x57583a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb435('0x0'));var zipdir=require(_0xb435('0x1'));var jsonpatch=require(_0xb435('0x2'));var rp=require(_0xb435('0x3'));var moment=require(_0xb435('0x4'));var BPromise=require(_0xb435('0x5'));var Mustache=require('mustache');var util=require(_0xb435('0x6'));var path=require(_0xb435('0x7'));var sox=require(_0xb435('0x8'));var csv=require(_0xb435('0x9'));var ejs=require(_0xb435('0xa'));var fs=require('fs');var _=require(_0xb435('0xb'));var squel=require(_0xb435('0xc'));var crypto=require(_0xb435('0xd'));var jsforce=require(_0xb435('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb435('0x9'));var querystring=require(_0xb435('0xf'));var Papa=require(_0xb435('0x10'));var Redis=require(_0xb435('0x11'));var authService=require(_0xb435('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb435('0x13'));var hardwareService=require(_0xb435('0x14'));var logger=require('../../config/logger')(_0xb435('0x15'));var utils=require(_0xb435('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xb435('0x17')]=_['defaults'](config[_0xb435('0x17')],{'host':_0xb435('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0xb435('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb435('0x1a')][_0xb435('0x1b')]({'port':0x232c});var client9002=jayson[_0xb435('0x1a')][_0xb435('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x5423d1,_0x6b0c28,_0x376c77){if(_0x376c77){var _0x234c30=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x234c30[_0xb435('0x1c')](_0x6b0c28)){return _0x5423d1;}else{throw new db[(_0xb435('0x1d'))][(_0xb435('0x1e'))](_0xb435('0x1f'));}}else{return _0x5423d1;}}function respondWithRpcPromise(_0x5ca572,_0x4836d5,_0x5505af,_0x4b2d5c){return new BPromise(function(_0x47a521,_0x1ffa00){var _0x5f095d=_0x4b2d5c||client;return _0x5f095d[_0xb435('0x20')](_0x5ca572,_0x5505af)[_0xb435('0x21')](function(_0x57d95b){logger['info'](_0xb435('0x22'),_0x4836d5,_0xb435('0x23'));logger[_0xb435('0x24')](_0xb435('0x25'),_0x4836d5,_0xb435('0x23'),JSON[_0xb435('0x26')](_0x57d95b));if(_0x57d95b['error']){if(_0x57d95b[_0xb435('0x27')][_0xb435('0x28')]===0x1f4){logger[_0xb435('0x27')]('ChatMessage,\x20%s,\x20%s',_0x4836d5,_0x57d95b[_0xb435('0x27')][_0xb435('0x29')]);return _0x1ffa00(_0x57d95b[_0xb435('0x27')]['message']);}logger[_0xb435('0x27')]('ChatMessage,\x20%s,\x20%s',_0x4836d5,_0x57d95b[_0xb435('0x27')][_0xb435('0x29')]);return _0x47a521(_0x57d95b[_0xb435('0x27')][_0xb435('0x29')]);}else{logger[_0xb435('0x2a')](_0xb435('0x22'),_0x4836d5,'request\x20sent');_0x47a521(_0x57d95b[_0xb435('0x2b')][_0xb435('0x29')]);}})[_0xb435('0x2c')](function(_0x2ee704){logger['error'](_0xb435('0x22'),_0x4836d5,_0x2ee704);_0x1ffa00(_0x2ee704);});});}function respondWithStatusCode(_0x1b022d,_0x44040b){_0x44040b=_0x44040b||0xcc;return function(_0x28272a){if(_0x28272a){return _0x1b022d[_0xb435('0x2d')](_0x44040b);}return _0x1b022d[_0xb435('0x2e')](_0x44040b)[_0xb435('0x2f')]();};}function respondWithResult(_0x41be87,_0x1a1090){_0x1a1090=_0x1a1090||0xc8;return function(_0x2c8766){if(_0x2c8766){return _0x41be87['status'](_0x1a1090)[_0xb435('0x30')](_0x2c8766);}};}function respondWithFilteredResult(_0x50b51b,_0x3b75d5){return function(_0x5ad3d1){if(_0x5ad3d1){var _0x3525e5=_0x5ad3d1[_0xb435('0x31')],_0x44321f=_0x3b75d5[_0xb435('0x32')],_0x38243b=_0x3b75d5[_0xb435('0x32')]+_0x3b75d5[_0xb435('0x33')],_0x18d5ad;if(_0x38243b>=_0x3525e5){_0x38243b=_0x3525e5;_0x18d5ad=0xc8;}else{_0x18d5ad=0xce;}_0x50b51b[_0xb435('0x2e')](_0x18d5ad);return _0x50b51b[_0xb435('0x34')](_0xb435('0x35'),_0x44321f+'-'+_0x38243b+'/'+_0x3525e5)['json'](_0x5ad3d1);}return null;};}function patchUpdates(_0x5a5d04){return function(_0x52716f){try{jsonpatch['apply'](_0x52716f,_0x5a5d04,!![]);}catch(_0x363b1e){return BPromise[_0xb435('0x36')](_0x363b1e);}return _0x52716f[_0xb435('0x37')]();};}function saveUpdates(_0x1a7fbd,_0x48e3af){return function(_0x50d98){if(_0x50d98){return _0x50d98['update'](_0x1a7fbd)[_0xb435('0x21')](function(_0x529d1e){return _0x529d1e;});}return null;};}function removeEntity(_0xad957d,_0xd8c93a){return function(_0x1c84f2){if(_0x1c84f2){return _0x1c84f2[_0xb435('0x38')]()[_0xb435('0x21')](function(){_0xad957d[_0xb435('0x2e')](0xcc)[_0xb435('0x2f')]();});}};}function handleEntityNotFound(_0x51e5eb,_0xb9138){return function(_0x194dae){if(!_0x194dae){_0x51e5eb[_0xb435('0x2d')](0x194);}return _0x194dae;};}function handleError(_0x5331cc,_0xb1bf24){_0xb1bf24=_0xb1bf24||0x1f4;return function(_0x276ba9){logger[_0xb435('0x27')](_0x276ba9[_0xb435('0x39')]);if(_0x276ba9[_0xb435('0x3a')]){delete _0x276ba9['name'];}_0x5331cc[_0xb435('0x2e')](_0xb1bf24)['send'](_0x276ba9);};}exports['index']=function(_0x493591,_0x2015d4){var _0x5106ce={},_0x3dd594={},_0x5e38f2={'count':0x0,'rows':[]};var _0x24094f=_[_0xb435('0x3b')](db[_0xb435('0x3c')][_0xb435('0x3d')],function(_0x149f14){return{'name':_0x149f14[_0xb435('0x3e')],'type':_0x149f14[_0xb435('0x3f')]['key']};});_0x3dd594[_0xb435('0x40')]=_['map'](_0x24094f,'name');_0x3dd594[_0xb435('0x41')]=_[_0xb435('0x42')](_0x493591['query']);_0x3dd594[_0xb435('0x43')]=_[_0xb435('0x44')](_0x3dd594[_0xb435('0x40')],_0x3dd594[_0xb435('0x41')]);_0x5106ce['attributes']=_[_0xb435('0x44')](_0x3dd594[_0xb435('0x40')],qs['fields'](_0x493591[_0xb435('0x41')]['fields']));_0x5106ce[_0xb435('0x45')]=_0x5106ce[_0xb435('0x45')][_0xb435('0x46')]?_0x5106ce[_0xb435('0x45')]:_0x3dd594[_0xb435('0x40')];if(!_0x493591[_0xb435('0x41')][_0xb435('0x47')](_0xb435('0x48'))){_0x5106ce[_0xb435('0x33')]=qs[_0xb435('0x33')](_0x493591['query'][_0xb435('0x33')]);_0x5106ce[_0xb435('0x32')]=qs[_0xb435('0x32')](_0x493591[_0xb435('0x41')]['offset']);}_0x5106ce[_0xb435('0x49')]=qs[_0xb435('0x4a')](_0x493591[_0xb435('0x41')][_0xb435('0x4a')]);_0x5106ce[_0xb435('0x4b')]=qs[_0xb435('0x43')](_['pick'](_0x493591['query'],_0x3dd594[_0xb435('0x43')]),_0x24094f);if(_0x493591['query']['filter']){_0x5106ce[_0xb435('0x4b')]=_[_0xb435('0x4c')](_0x5106ce[_0xb435('0x4b')],{'$or':_[_0xb435('0x3b')](_0x24094f,function(_0xfcdcc6){if(_0xfcdcc6[_0xb435('0x3f')]!=='VIRTUAL'){var _0x5944a9={};_0x5944a9[_0xfcdcc6[_0xb435('0x3a')]]={'$like':'%'+_0x493591[_0xb435('0x41')][_0xb435('0x4d')]+'%'};return _0x5944a9;}})});}_0x5106ce=_['merge']({},_0x5106ce,_0x493591[_0xb435('0x4e')]);var _0xe45e64={'where':_0x5106ce['where']};return db[_0xb435('0x3c')][_0xb435('0x31')](_0xe45e64)[_0xb435('0x21')](function(_0x107b79){_0x5e38f2['count']=_0x107b79;if(_0x493591[_0xb435('0x41')]['includeAll']){_0x5106ce[_0xb435('0x4f')]=[{'all':!![]}];}return db[_0xb435('0x3c')][_0xb435('0x50')](_0x5106ce);})['then'](function(_0x2d8fab){_0x5e38f2['rows']=_0x2d8fab;return _0x5e38f2;})[_0xb435('0x21')](respondWithFilteredResult(_0x2015d4,_0x5106ce))[_0xb435('0x2c')](handleError(_0x2015d4,null));};exports[_0xb435('0x51')]=function(_0x5dc4b7,_0x3efb7d){var _0x56f68a={'raw':!![],'where':{'id':_0x5dc4b7[_0xb435('0x52')]['id']}},_0x13c229={};_0x13c229['model']=_[_0xb435('0x42')](db['ChatMessage'][_0xb435('0x3d')]);_0x13c229[_0xb435('0x41')]=_[_0xb435('0x42')](_0x5dc4b7[_0xb435('0x41')]);_0x13c229[_0xb435('0x43')]=_[_0xb435('0x44')](_0x13c229[_0xb435('0x40')],_0x13c229[_0xb435('0x41')]);_0x56f68a[_0xb435('0x45')]=_['intersection'](_0x13c229[_0xb435('0x40')],qs[_0xb435('0x53')](_0x5dc4b7[_0xb435('0x41')][_0xb435('0x53')]));_0x56f68a[_0xb435('0x45')]=_0x56f68a[_0xb435('0x45')][_0xb435('0x46')]?_0x56f68a[_0xb435('0x45')]:_0x13c229[_0xb435('0x40')];if(_0x5dc4b7[_0xb435('0x41')]['includeAll']){_0x56f68a[_0xb435('0x4f')]=[{'all':!![]}];}_0x56f68a=_[_0xb435('0x4c')]({},_0x56f68a,_0x5dc4b7[_0xb435('0x4e')]);return db[_0xb435('0x3c')][_0xb435('0x54')](_0x56f68a)['then'](handleEntityNotFound(_0x3efb7d,null))[_0xb435('0x21')](respondWithResult(_0x3efb7d,null))[_0xb435('0x2c')](handleError(_0x3efb7d,null));};exports[_0xb435('0x55')]=function(_0x1298aa,_0x131a5f){return db[_0xb435('0x3c')][_0xb435('0x55')](_0x1298aa[_0xb435('0x56')],{})[_0xb435('0x21')](respondWithResult(_0x131a5f,0xc9))[_0xb435('0x2c')](handleError(_0x131a5f,null));};exports[_0xb435('0x57')]=function(_0x16da65,_0x2aa774){if(_0x16da65[_0xb435('0x56')]['id']){delete _0x16da65[_0xb435('0x56')]['id'];}return db[_0xb435('0x3c')][_0xb435('0x54')]({'where':{'id':_0x16da65[_0xb435('0x52')]['id']}})['then'](handleEntityNotFound(_0x2aa774,null))['then'](saveUpdates(_0x16da65[_0xb435('0x56')],null))['then'](respondWithResult(_0x2aa774,null))[_0xb435('0x2c')](handleError(_0x2aa774,null));};exports[_0xb435('0x38')]=function(_0x34a0d1,_0x3c41bb){return db[_0xb435('0x3c')][_0xb435('0x54')]({'where':{'id':_0x34a0d1[_0xb435('0x52')]['id']}})[_0xb435('0x21')](handleEntityNotFound(_0x3c41bb,null))[_0xb435('0x21')](removeEntity(_0x3c41bb,null))[_0xb435('0x2c')](handleError(_0x3c41bb,null));};exports['describe']=function(_0x439fa8,_0x52d80a){return db[_0xb435('0x3c')]['describe']()[_0xb435('0x21')](respondWithResult(_0x52d80a,null))['catch'](handleError(_0x52d80a,null));};var interaction_log=require(_0xb435('0x58'))(_0xb435('0x59'));exports[_0xb435('0x5a')]=function(_0x100fdd,_0x53e5ab,_0x3180af){var _0x3a5809={'channel':_0xb435('0x5b')};if(_0x100fdd[_0xb435('0x56')]['id']){delete _0x100fdd[_0xb435('0x56')]['id'];}_0x100fdd[_0xb435('0x56')][_0xb435('0x5c')]=!![];_0x100fdd[_0xb435('0x56')][_0xb435('0x5d')]=moment()[_0xb435('0x5e')](_0xb435('0x5f'));_0x100fdd[_0xb435('0x56')]['UserId']=_0x100fdd[_0xb435('0x56')][_0xb435('0x60')]||_0x100fdd[_0xb435('0x61')]['id'];return db[_0xb435('0x3c')]['find']({'where':{'id':_0x100fdd[_0xb435('0x52')]['id'],'UserId':null},'include':[{'model':db[_0xb435('0x62')],'as':_0xb435('0x63')}]})[_0xb435('0x21')](handleEntityNotFound(_0x53e5ab,null))['then'](saveUpdates(_0x100fdd[_0xb435('0x56')],null))['then'](function(_0xb9a20c){if(_0xb9a20c){_0x3a5809['message']=_0xb9a20c[_0xb435('0x64')]({'plain':!![]});return db[_0xb435('0x65')][_0xb435('0x54')]({'where':{'id':_0xb9a20c[_0xb435('0x66')]}});}return null;})[_0xb435('0x21')](handleEntityNotFound(_0x53e5ab,null))[_0xb435('0x21')](function(_0x29a31b){if(_0x29a31b){return _0x29a31b['update']({'UserId':_0x100fdd[_0xb435('0x56')]['UserId'],'read1stAt':_[_0xb435('0x67')](_0x29a31b[_0xb435('0x68')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x371d8c){if(_0x371d8c){_0x3a5809[_0xb435('0x69')]=_0x371d8c[_0xb435('0x64')]({'plain':!![]});interaction_log['info'](_0xb435('0x6a'),_0x100fdd[_0xb435('0x61')]['id'],_0x100fdd[_0xb435('0x61')]['name'],_0x100fdd[_0xb435('0x61')][_0xb435('0x6b')],_0x3a5809[_0xb435('0x69')]['id'],_0x100fdd['body']?JSON[_0xb435('0x26')](_0x100fdd[_0xb435('0x56')]):_0xb435('0x6c'));return respondWithRpcPromise(_0xb435('0x6d'),_0xb435('0x6e'),_0x3a5809);}return null;})['then'](function(_0x166b42){if(_0x166b42){if(_0x100fdd[_0xb435('0x56')]['manual']){_0x3a5809[_0xb435('0x29')][_0xb435('0x6f')]=util[_0xb435('0x5e')](_0xb435('0x70'),_0x100fdd[_0xb435('0x61')][_0xb435('0x3a')]);_0x3a5809['message'][_0xb435('0x71')]=_0x3a5809[_0xb435('0x71')];_0x3a5809[_0xb435('0x29')]['event']=_0xb435('0x5a');return respondWithRpcPromise(_0xb435('0x72'),_0xb435('0x72'),{'event':'acceptmessage','message':_[_0xb435('0x4c')](_0x3a5809[_0xb435('0x29')],JSON[_0xb435('0x73')](_0x3a5809[_0xb435('0x69')][_0xb435('0x74')]))},client9002)['then'](function(){return _0x3a5809;});}return _0x3a5809;}return null;})['then'](respondWithResult(_0x53e5ab,null))[_0xb435('0x2c')](handleError(_0x53e5ab,null));};var interaction_log=require(_0xb435('0x58'))(_0xb435('0x59'));exports[_0xb435('0x36')]=function(_0x2fef16,_0x13337a,_0x460f44){var _0x5cf2ba={'agent':{},'channel':'chat'};if(_0x2fef16[_0xb435('0x56')]['id']){delete _0x2fef16[_0xb435('0x56')]['id'];}_0x2fef16[_0xb435('0x56')][_0xb435('0x60')]=_0x2fef16[_0xb435('0x56')][_0xb435('0x60')]||_0x2fef16[_0xb435('0x61')]['id'];_0x5cf2ba[_0xb435('0x75')]['id']=_0x2fef16[_0xb435('0x56')]['UserId'];return db[_0xb435('0x3c')][_0xb435('0x54')]({'where':{'id':_0x2fef16[_0xb435('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x13337a,null))[_0xb435('0x21')](function(_0x210d5d){if(_0x210d5d){_0x5cf2ba[_0xb435('0x29')]=_0x210d5d[_0xb435('0x64')]({'plain':!![]});return db[_0xb435('0x65')]['find']({'where':{'id':_0x210d5d[_0xb435('0x66')]}});}return null;})[_0xb435('0x21')](handleEntityNotFound(_0x13337a,null))[_0xb435('0x21')](function(_0x42e837){if(_0x42e837){_0x5cf2ba[_0xb435('0x69')]=_0x42e837[_0xb435('0x64')]({'plain':!![]});interaction_log[_0xb435('0x2a')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2fef16['user']['id'],_0x2fef16[_0xb435('0x61')][_0xb435('0x3a')],_0x2fef16[_0xb435('0x61')][_0xb435('0x6b')],_0x5cf2ba['interaction']['id'],_0x2fef16[_0xb435('0x56')]?JSON[_0xb435('0x26')](_0x2fef16[_0xb435('0x56')]):_0xb435('0x6c'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5cf2ba);}return null;})[_0xb435('0x21')](function(_0x3bf5c0){if(_0x3bf5c0){_0x3bf5c0[_0xb435('0x29')][_0xb435('0x6f')]=util['format'](_0xb435('0x70'),_0x2fef16[_0xb435('0x61')]['name']);_0x3bf5c0[_0xb435('0x29')][_0xb435('0x71')]=_0x5cf2ba['channel'];_0x3bf5c0[_0xb435('0x29')]['event']=_0xb435('0x36');respondWithRpcPromise(_0xb435('0x72'),_0xb435('0x72'),{'event':'rejectmessage','message':_0x3bf5c0['message']},client9002);return _0x5cf2ba;}return null;})[_0xb435('0x21')](respondWithResult(_0x13337a,null))[_0xb435('0x2c')](handleError(_0x13337a,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 422cffd..5ac9a42 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 _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
+var _0x2eb6=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x45aac6,_0x13dafe){var _0x535760=function(_0x3dfb4d){while(--_0x3dfb4d){_0x45aac6['push'](_0x45aac6['shift']());}};_0x535760(++_0x13dafe);}(_0x2eb6,0x16d));var _0x62eb=function(_0x52b6ec,_0x22c21f){_0x52b6ec=_0x52b6ec-0x0;var _0x4efe59=_0x2eb6[_0x52b6ec];return _0x4efe59;};'use strict';var EventEmitter=require(_0x62eb('0x0'));var ChatMessage=require(_0x62eb('0x1'))['db'][_0x62eb('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x62eb('0x3')](0x0);var events={'afterCreate':_0x62eb('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1307ec){return function(_0x34ea67,_0x3ede35,_0x57f090){ChatMessageEvents[_0x62eb('0x5')](_0x1307ec+':'+_0x34ea67['id'],_0x34ea67);ChatMessageEvents[_0x62eb('0x5')](_0x1307ec,_0x34ea67);_0x57f090(null);};}for(var e in events){if(events[_0x62eb('0x6')](e)){var event=events[e];ChatMessage[_0x62eb('0x7')](e,emitEvent(event));}}module[_0x62eb('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 2eff45c..cada6f6 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 _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
+var _0xaa4e=['exports','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes'];(function(_0x3736f1,_0x1d0421){var _0x584168=function(_0x35709a){while(--_0x35709a){_0x3736f1['push'](_0x3736f1['shift']());}};_0x584168(++_0x1d0421);}(_0xaa4e,0x8d));var _0xeaa4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa4e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xeaa4('0x0'));var util=require(_0xeaa4('0x1'));var logger=require(_0xeaa4('0x2'))(_0xeaa4('0x3'));var moment=require('moment');var BPromise=require(_0xeaa4('0x4'));var rp=require(_0xeaa4('0x5'));var fs=require('fs');var path=require(_0xeaa4('0x6'));var rimraf=require('rimraf');var config=require(_0xeaa4('0x7'));var attributes=require(_0xeaa4('0x8'));module[_0xeaa4('0x9')]=function(_0x1da911,_0x237dcf){return _0x1da911['define'](_0xeaa4('0xa'),attributes,{'tableName':_0xeaa4('0xb'),'paranoid':![],'indexes':[{'name':_0xeaa4('0xc'),'fields':['body'],'type':_0xeaa4('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x34bf32,_0x4e05f0,_0x1568b3){var _0x5d7ae7=_0x1da911[_0xeaa4('0xe')];var _0x312c3d=_0x34bf32[_0xeaa4('0xf')]({'plain':!![]});if(_0x312c3d[_0xeaa4('0x10')][_0xeaa4('0x11')]()==='in'||_0x312c3d[_0xeaa4('0x10')][_0xeaa4('0x11')]()===_0xeaa4('0x12')&&!_0x312c3d[_0xeaa4('0x13')]&&!_[_0xeaa4('0x14')](_0x312c3d['UserId'])){_0x5d7ae7[_0xeaa4('0x15')][_0xeaa4('0x16')]({'where':{'id':_0x312c3d['ChatInteractionId']}})[_0xeaa4('0x17')](function(_0x33e001){if(_0x33e001){_0x33e001[_0xeaa4('0x18')]({'lastMsgAt':_0x312c3d[_0xeaa4('0x19')],'lastMsgDirection':_0x312c3d[_0xeaa4('0x10')]['toLowerCase']()});}})[_0xeaa4('0x1a')](function(_0x4f7249){console[_0xeaa4('0x1b')](_0x4f7249);});}_0x1568b3();}},'charset':_0xeaa4('0x1c'),'collate':_0xeaa4('0x1d')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 4be50bc..9ee1560 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 _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
+var _0x52b5=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','then','info','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','error','message','result','ChatMessage','body','options','raw','CreateChatMessage','stringify','catch','util','bluebird'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x52b5,0xe6));var _0x552b=function(_0x515283,_0x813dea){_0x515283=_0x515283-0x0;var _0x38f836=_0x52b5[_0x515283];return _0x38f836;};'use strict';var _=require('lodash');var util=require(_0x552b('0x0'));var moment=require('moment');var BPromise=require(_0x552b('0x1'));var rs=require(_0x552b('0x2'));var fs=require('fs');var Redis=require(_0x552b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x552b('0x4'));var logger=require(_0x552b('0x5'))(_0x552b('0x6'));var config=require(_0x552b('0x7'));var jayson=require(_0x552b('0x8'));var client=jayson['client'][_0x552b('0x9')]({'port':0x232a});config[_0x552b('0xa')]=_['defaults'](config[_0x552b('0xa')],{'host':_0x552b('0xb'),'port':0x18eb});var socket=require(_0x552b('0xc'))(new Redis(config[_0x552b('0xa')]));require('./chatMessage.socket')[_0x552b('0xd')](socket);function respondWithRpcPromise(_0x3dc6f0,_0x41eb80,_0x429346){return new BPromise(function(_0x55a31c,_0xba6665){return client['request'](_0x3dc6f0,_0x429346)[_0x552b('0xe')](function(_0x1c52b6){logger[_0x552b('0xf')](_0x552b('0x10'),_0x41eb80,'request\x20sent');logger[_0x552b('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x41eb80,_0x552b('0x12'),JSON['stringify'](_0x1c52b6));if(_0x1c52b6[_0x552b('0x13')]){if(_0x1c52b6[_0x552b('0x13')]['code']===0x1f4){logger['error'](_0x552b('0x10'),_0x41eb80,_0x1c52b6[_0x552b('0x13')][_0x552b('0x14')]);return _0xba6665(_0x1c52b6[_0x552b('0x13')][_0x552b('0x14')]);}logger['error'](_0x552b('0x10'),_0x41eb80,_0x1c52b6[_0x552b('0x13')][_0x552b('0x14')]);return _0x55a31c(_0x1c52b6[_0x552b('0x13')][_0x552b('0x14')]);}else{logger[_0x552b('0xf')](_0x552b('0x10'),_0x41eb80,_0x552b('0x12'));_0x55a31c(_0x1c52b6[_0x552b('0x15')][_0x552b('0x14')]);}})['catch'](function(_0x3993cc){logger['error'](_0x552b('0x10'),_0x41eb80,_0x3993cc);_0xba6665(_0x3993cc);});});}exports['CreateChatMessage']=function(_0x5e5299){var _0x1649e4=this;return new Promise(function(_0x3d3235,_0x103e49){return db[_0x552b('0x16')]['create'](_0x5e5299[_0x552b('0x17')],{'raw':_0x5e5299['options']?_0x5e5299[_0x552b('0x18')][_0x552b('0x19')]===undefined?!![]:![]:!![]})[_0x552b('0xe')](function(_0x363d92){logger[_0x552b('0xf')](_0x552b('0x1a'),_0x5e5299);logger[_0x552b('0x11')](_0x552b('0x1a'),_0x5e5299,JSON[_0x552b('0x1b')](_0x363d92));_0x3d3235(_0x363d92);})[_0x552b('0x1c')](function(_0x3584df){logger[_0x552b('0x13')]('CreateChatMessage',_0x3584df[_0x552b('0x14')],_0x5e5299);_0x103e49(_0x1649e4['error'](0x1f4,_0x3584df['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 4b1f549..00bd4b9 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 _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
+var _0x4c60=['chatMessage:','./chatMessage.events','save','remove','update','removeListener','register','length'];(function(_0x4b54ec,_0x12ce1d){var _0x24416c=function(_0x2d69f8){while(--_0x2d69f8){_0x4b54ec['push'](_0x4b54ec['shift']());}};_0x24416c(++_0x12ce1d);}(_0x4c60,0xc1));var _0x04c6=function(_0x5d04e5,_0x4af72e){_0x5d04e5=_0x5d04e5-0x0;var _0x3bdc1a=_0x4c60[_0x5d04e5];return _0x3bdc1a;};'use strict';var ChatMessageEvents=require(_0x04c6('0x0'));var events=[_0x04c6('0x1'),_0x04c6('0x2'),_0x04c6('0x3')];function createListener(_0x5ba768,_0x2a1d36){return function(_0x5d9fa3){_0x2a1d36['emit'](_0x5ba768,_0x5d9fa3);};}function removeListener(_0x4ad4f1,_0x53ca7a){return function(){ChatMessageEvents[_0x04c6('0x4')](_0x4ad4f1,_0x53ca7a);};}exports[_0x04c6('0x5')]=function(_0x2054da){for(var _0x12bd5d=0x0,_0x2b9041=events[_0x04c6('0x6')];_0x12bd5d<_0x2b9041;_0x12bd5d++){var _0x8f9b13=events[_0x12bd5d];var _0x530a48=createListener(_0x04c6('0x7')+_0x8f9b13,_0x2054da);ChatMessageEvents['on'](_0x8f9b13,_0x530a48);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 0d8caed..1f998f1 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 _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
+var _0x74aa=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','chat','put','update','/:id/accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x2c7780,_0x100f4a){var _0x580bc8=function(_0x3d435c){while(--_0x3d435c){_0x2c7780['push'](_0x2c7780['shift']());}};_0x580bc8(++_0x100f4a);}(_0x74aa,0x18b));var _0xa74a=function(_0x2ecfd0,_0x44948c){_0x2ecfd0=_0x2ecfd0-0x0;var _0x10c4fc=_0x74aa[_0x2ecfd0];return _0x10c4fc;};'use strict';var multer=require('multer');var util=require(_0xa74a('0x0'));var path=require(_0xa74a('0x1'));var timeout=require(_0xa74a('0x2'));var express=require(_0xa74a('0x3'));var router=express[_0xa74a('0x4')]();var auth=require(_0xa74a('0x5'));var interaction=require(_0xa74a('0x6'));var config=require(_0xa74a('0x7'));var controller=require(_0xa74a('0x8'));router[_0xa74a('0x9')]('/',auth[_0xa74a('0xa')](),controller[_0xa74a('0xb')]);router[_0xa74a('0x9')](_0xa74a('0xc'),auth[_0xa74a('0xa')](),controller[_0xa74a('0xd')]);router[_0xa74a('0x9')](_0xa74a('0xe'),auth[_0xa74a('0xa')](),controller[_0xa74a('0xf')]);router['post']('/',auth[_0xa74a('0xa')](),interaction[_0xa74a('0x10')](_0xa74a('0x11'),'chatmessage:create'),controller['create']);router[_0xa74a('0x12')](_0xa74a('0xe'),controller[_0xa74a('0x13')]);router['put'](_0xa74a('0x14'),auth['isAuthenticated'](),controller['accept']);router[_0xa74a('0x12')](_0xa74a('0x15'),auth[_0xa74a('0xa')](),controller['reject']);router[_0xa74a('0x16')]('/:id',auth[_0xa74a('0xa')](),controller[_0xa74a('0x17')]);module[_0xa74a('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index defa6ba..a156f1c 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 _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
+var _0x4c54=['sequelize','exports','medium'];(function(_0x60cfa1,_0x411cdf){var _0x2be6bb=function(_0x3ff769){while(--_0x3ff769){_0x60cfa1['push'](_0x60cfa1['shift']());}};_0x2be6bb(++_0x411cdf);}(_0x4c54,0x1e0));var _0x44c5=function(_0x4dc5d3,_0x2f1811){_0x4dc5d3=_0x4dc5d3-0x0;var _0x559c10=_0x4c54[_0x4dc5d3];return _0x559c10;};'use strict';var Sequelize=require(_0x44c5('0x0'));module[_0x44c5('0x1')]={'body':{'type':Sequelize['TEXT'](_0x44c5('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 fbb8d4e..6e72372 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 _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
+var _0x4745=['api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','then','destroy','error','name','send','map','ChatOfflineMessage','key','model','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','query','order','sort','where','filter','type','merge','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x33593e,_0x22ddd3){var _0x53db1a=function(_0x499ee5){while(--_0x499ee5){_0x33593e['push'](_0x33593e['shift']());}};_0x53db1a(++_0x22ddd3);}(_0x4745,0x1e7));var _0x5474=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x4745[_0x5783f4];return _0x28e380;};'use strict';var pdf=require(_0x5474('0x0'));var emlformat=require(_0x5474('0x1'));var rimraf=require(_0x5474('0x2'));var zipdir=require(_0x5474('0x3'));var jsonpatch=require(_0x5474('0x4'));var rp=require(_0x5474('0x5'));var moment=require(_0x5474('0x6'));var BPromise=require(_0x5474('0x7'));var Mustache=require(_0x5474('0x8'));var util=require(_0x5474('0x9'));var path=require(_0x5474('0xa'));var sox=require(_0x5474('0xb'));var csv=require('to-csv');var ejs=require(_0x5474('0xc'));var fs=require('fs');var _=require(_0x5474('0xd'));var squel=require('squel');var crypto=require(_0x5474('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5474('0xf'));var toCsv=require(_0x5474('0x10'));var querystring=require('querystring');var Papa=require(_0x5474('0x11'));var Redis=require(_0x5474('0x12'));var authService=require(_0x5474('0x13'));var qs=require(_0x5474('0x14'));var as=require(_0x5474('0x15'));var hardwareService=require(_0x5474('0x16'));var logger=require(_0x5474('0x17'))(_0x5474('0x18'));var utils=require('../../config/utils');var config=require(_0x5474('0x19'));var db=require(_0x5474('0x1a'))['db'];function respondWithStatusCode(_0xdc4c23,_0x12cd7f){_0x12cd7f=_0x12cd7f||0xcc;return function(_0x10eac7){if(_0x10eac7){return _0xdc4c23[_0x5474('0x1b')](_0x12cd7f);}return _0xdc4c23[_0x5474('0x1c')](_0x12cd7f)[_0x5474('0x1d')]();};}function respondWithResult(_0x25262c,_0x4a8db0){_0x4a8db0=_0x4a8db0||0xc8;return function(_0xb828fe){if(_0xb828fe){return _0x25262c[_0x5474('0x1c')](_0x4a8db0)[_0x5474('0x1e')](_0xb828fe);}};}function respondWithFilteredResult(_0x1790eb,_0x5a6353){return function(_0x540e31){if(_0x540e31){var _0x50b949=_0x540e31[_0x5474('0x1f')],_0x50eb42=_0x5a6353['offset'],_0x32f0e4=_0x5a6353[_0x5474('0x20')]+_0x5a6353[_0x5474('0x21')],_0x172bcb;if(_0x32f0e4>=_0x50b949){_0x32f0e4=_0x50b949;_0x172bcb=0xc8;}else{_0x172bcb=0xce;}_0x1790eb['status'](_0x172bcb);return _0x1790eb[_0x5474('0x22')](_0x5474('0x23'),_0x50eb42+'-'+_0x32f0e4+'/'+_0x50b949)[_0x5474('0x1e')](_0x540e31);}return null;};}function patchUpdates(_0x469d62){return function(_0x327684){try{jsonpatch['apply'](_0x327684,_0x469d62,!![]);}catch(_0x207b5f){return BPromise['reject'](_0x207b5f);}return _0x327684[_0x5474('0x24')]();};}function saveUpdates(_0x178e5c,_0x50d3a1){return function(_0x504826){if(_0x504826){return _0x504826['update'](_0x178e5c)[_0x5474('0x25')](function(_0x2c7593){return _0x2c7593;});}return null;};}function removeEntity(_0x475374,_0x401dd8){return function(_0x36b389){if(_0x36b389){return _0x36b389[_0x5474('0x26')]()[_0x5474('0x25')](function(){_0x475374[_0x5474('0x1c')](0xcc)[_0x5474('0x1d')]();});}};}function handleEntityNotFound(_0x9c80cc,_0x542d1f){return function(_0x5f065d){if(!_0x5f065d){_0x9c80cc[_0x5474('0x1b')](0x194);}return _0x5f065d;};}function handleError(_0x266465,_0x40151a){_0x40151a=_0x40151a||0x1f4;return function(_0x4b40e0){logger[_0x5474('0x27')](_0x4b40e0['stack']);if(_0x4b40e0[_0x5474('0x28')]){delete _0x4b40e0[_0x5474('0x28')];}_0x266465['status'](_0x40151a)[_0x5474('0x29')](_0x4b40e0);};}exports['index']=function(_0x385f91,_0x5efa8d){var _0xe9dcbf={},_0x1384e4={},_0x2a8730={'count':0x0,'rows':[]};var _0x5865fe=_[_0x5474('0x2a')](db[_0x5474('0x2b')]['rawAttributes'],function(_0x57731b){return{'name':_0x57731b['fieldName'],'type':_0x57731b['type'][_0x5474('0x2c')]};});_0x1384e4[_0x5474('0x2d')]=_['map'](_0x5865fe,_0x5474('0x28'));_0x1384e4['query']=_[_0x5474('0x2e')](_0x385f91['query']);_0x1384e4[_0x5474('0x2f')]=_['intersection'](_0x1384e4[_0x5474('0x2d')],_0x1384e4['query']);_0xe9dcbf[_0x5474('0x30')]=_[_0x5474('0x31')](_0x1384e4[_0x5474('0x2d')],qs[_0x5474('0x32')](_0x385f91['query']['fields']));_0xe9dcbf[_0x5474('0x30')]=_0xe9dcbf[_0x5474('0x30')][_0x5474('0x33')]?_0xe9dcbf[_0x5474('0x30')]:_0x1384e4['model'];if(!_0x385f91['query'][_0x5474('0x34')](_0x5474('0x35'))){_0xe9dcbf['limit']=qs[_0x5474('0x21')](_0x385f91[_0x5474('0x36')][_0x5474('0x21')]);_0xe9dcbf[_0x5474('0x20')]=qs['offset'](_0x385f91[_0x5474('0x36')][_0x5474('0x20')]);}_0xe9dcbf[_0x5474('0x37')]=qs['sort'](_0x385f91[_0x5474('0x36')][_0x5474('0x38')]);_0xe9dcbf[_0x5474('0x39')]=qs[_0x5474('0x2f')](_['pick'](_0x385f91['query'],_0x1384e4[_0x5474('0x2f')]),_0x5865fe);if(_0x385f91[_0x5474('0x36')][_0x5474('0x3a')]){_0xe9dcbf[_0x5474('0x39')]=_['merge'](_0xe9dcbf[_0x5474('0x39')],{'$or':_[_0x5474('0x2a')](_0x5865fe,function(_0x13b56b){if(_0x13b56b[_0x5474('0x3b')]!=='VIRTUAL'){var _0x5b1b70={};_0x5b1b70[_0x13b56b['name']]={'$like':'%'+_0x385f91[_0x5474('0x36')]['filter']+'%'};return _0x5b1b70;}})});}_0xe9dcbf=_[_0x5474('0x3c')]({},_0xe9dcbf,_0x385f91[_0x5474('0x3d')]);var _0x4491eb={'where':_0xe9dcbf[_0x5474('0x39')]};return db[_0x5474('0x2b')][_0x5474('0x1f')](_0x4491eb)[_0x5474('0x25')](function(_0x1adfa5){_0x2a8730[_0x5474('0x1f')]=_0x1adfa5;if(_0x385f91['query'][_0x5474('0x3e')]){_0xe9dcbf[_0x5474('0x3f')]=[{'all':!![]}];}return db[_0x5474('0x2b')][_0x5474('0x40')](_0xe9dcbf);})['then'](function(_0x158172){_0x2a8730['rows']=_0x158172;return _0x2a8730;})[_0x5474('0x25')](respondWithFilteredResult(_0x5efa8d,_0xe9dcbf))[_0x5474('0x41')](handleError(_0x5efa8d,null));};exports['show']=function(_0x1f64fb,_0x2df4e8){var _0x5690a0={'raw':!![],'where':{'id':_0x1f64fb[_0x5474('0x42')]['id']}},_0x2d4b11={};_0x2d4b11['model']=_[_0x5474('0x2e')](db['ChatOfflineMessage'][_0x5474('0x43')]);_0x2d4b11[_0x5474('0x36')]=_['keys'](_0x1f64fb[_0x5474('0x36')]);_0x2d4b11[_0x5474('0x2f')]=_[_0x5474('0x31')](_0x2d4b11['model'],_0x2d4b11[_0x5474('0x36')]);_0x5690a0[_0x5474('0x30')]=_[_0x5474('0x31')](_0x2d4b11[_0x5474('0x2d')],qs['fields'](_0x1f64fb['query'][_0x5474('0x32')]));_0x5690a0['attributes']=_0x5690a0[_0x5474('0x30')][_0x5474('0x33')]?_0x5690a0['attributes']:_0x2d4b11[_0x5474('0x2d')];if(_0x1f64fb[_0x5474('0x36')]['includeAll']){_0x5690a0[_0x5474('0x3f')]=[{'all':!![]}];}_0x5690a0=_[_0x5474('0x3c')]({},_0x5690a0,_0x1f64fb['options']);return db['ChatOfflineMessage'][_0x5474('0x44')](_0x5690a0)[_0x5474('0x25')](handleEntityNotFound(_0x2df4e8,null))['then'](respondWithResult(_0x2df4e8,null))[_0x5474('0x41')](handleError(_0x2df4e8,null));};exports[_0x5474('0x45')]=function(_0x14f4d3,_0x46bde7){return db['ChatOfflineMessage'][_0x5474('0x45')](_0x14f4d3[_0x5474('0x46')],{})['then'](respondWithResult(_0x46bde7,0xc9))[_0x5474('0x41')](handleError(_0x46bde7,null));};exports[_0x5474('0x47')]=function(_0x3c59bb,_0x3a64de){if(_0x3c59bb[_0x5474('0x46')]['id']){delete _0x3c59bb[_0x5474('0x46')]['id'];}return db[_0x5474('0x2b')][_0x5474('0x44')]({'where':{'id':_0x3c59bb[_0x5474('0x42')]['id']}})[_0x5474('0x25')](handleEntityNotFound(_0x3a64de,null))[_0x5474('0x25')](saveUpdates(_0x3c59bb[_0x5474('0x46')],null))['then'](respondWithResult(_0x3a64de,null))[_0x5474('0x41')](handleError(_0x3a64de,null));};exports[_0x5474('0x26')]=function(_0x3d3444,_0x2163ce){return db['ChatOfflineMessage'][_0x5474('0x44')]({'where':{'id':_0x3d3444[_0x5474('0x42')]['id']}})[_0x5474('0x25')](handleEntityNotFound(_0x2163ce,null))[_0x5474('0x25')](removeEntity(_0x2163ce,null))[_0x5474('0x41')](handleError(_0x2163ce,null));};exports[_0x5474('0x48')]=function(_0x1edb7b,_0x364b3b){return db[_0x5474('0x2b')][_0x5474('0x48')]()[_0x5474('0x25')](respondWithResult(_0x364b3b,null))[_0x5474('0x41')](handleError(_0x364b3b,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 1c61368..8973bbf 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 _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
+var _0x3df6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','util','../../config/logger','api'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x3df6,0x165));var _0x63df=function(_0x1cb73b,_0x28b0a9){_0x1cb73b=_0x1cb73b-0x0;var _0x763578=_0x3df6[_0x1cb73b];return _0x763578;};'use strict';var _=require('lodash');var util=require(_0x63df('0x0'));var logger=require(_0x63df('0x1'))(_0x63df('0x2'));var moment=require(_0x63df('0x3'));var BPromise=require(_0x63df('0x4'));var rp=require(_0x63df('0x5'));var fs=require('fs');var path=require(_0x63df('0x6'));var rimraf=require(_0x63df('0x7'));var config=require(_0x63df('0x8'));var attributes=require(_0x63df('0x9'));module[_0x63df('0xa')]=function(_0x1bdae5,_0x4b7a35){return _0x1bdae5['define'](_0x63df('0xb'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index bb258a5..687d1cc 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 _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
+var _0x4d25=['then','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x32f657,_0x3bcd12){var _0x2dd60e=function(_0xcb6863){while(--_0xcb6863){_0x32f657['push'](_0x32f657['shift']());}};_0x2dd60e(++_0x3bcd12);}(_0x4d25,0x182));var _0x54d2=function(_0x270a02,_0x223adb){_0x270a02=_0x270a02-0x0;var _0x3cd07b=_0x4d25[_0x270a02];return _0x3cd07b;};'use strict';var _=require(_0x54d2('0x0'));var util=require(_0x54d2('0x1'));var moment=require(_0x54d2('0x2'));var BPromise=require(_0x54d2('0x3'));var rs=require(_0x54d2('0x4'));var fs=require('fs');var Redis=require(_0x54d2('0x5'));var db=require(_0x54d2('0x6'))['db'];var utils=require(_0x54d2('0x7'));var logger=require(_0x54d2('0x8'))(_0x54d2('0x9'));var config=require(_0x54d2('0xa'));var jayson=require(_0x54d2('0xb'));var client=jayson[_0x54d2('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35bf89,_0x42d96e,_0x1ae1f0){return new BPromise(function(_0x308916,_0x5e0334){return client[_0x54d2('0xd')](_0x35bf89,_0x1ae1f0)[_0x54d2('0xe')](function(_0x1daa3f){logger[_0x54d2('0xf')](_0x54d2('0x10'),_0x42d96e,'request\x20sent');logger['debug'](_0x54d2('0x11'),_0x42d96e,_0x54d2('0x12'),JSON[_0x54d2('0x13')](_0x1daa3f));if(_0x1daa3f['error']){if(_0x1daa3f['error'][_0x54d2('0x14')]===0x1f4){logger[_0x54d2('0x15')](_0x54d2('0x10'),_0x42d96e,_0x1daa3f['error']['message']);return _0x5e0334(_0x1daa3f[_0x54d2('0x15')]['message']);}logger[_0x54d2('0x15')]('ChatOfflineMessage,\x20%s,\x20%s',_0x42d96e,_0x1daa3f[_0x54d2('0x15')][_0x54d2('0x16')]);return _0x308916(_0x1daa3f[_0x54d2('0x15')][_0x54d2('0x16')]);}else{logger['info'](_0x54d2('0x10'),_0x42d96e,_0x54d2('0x12'));_0x308916(_0x1daa3f[_0x54d2('0x17')][_0x54d2('0x16')]);}})[_0x54d2('0x18')](function(_0xdec44d){logger['error'](_0x54d2('0x10'),_0x42d96e,_0xdec44d);_0x5e0334(_0xdec44d);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index d36d213..54837a2 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 _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
+var _0xcae9=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','get','/describe','/:id','show','post','create','delete','destroy','exports'];(function(_0x22a682,_0x2394b0){var _0xb7f3a2=function(_0x1b59eb){while(--_0x1b59eb){_0x22a682['push'](_0x22a682['shift']());}};_0xb7f3a2(++_0x2394b0);}(_0xcae9,0x1b5));var _0x9cae=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xcae9[_0x2d8fc2];return _0x3a9e53;};'use strict';var multer=require(_0x9cae('0x0'));var util=require(_0x9cae('0x1'));var path=require(_0x9cae('0x2'));var timeout=require('connect-timeout');var express=require(_0x9cae('0x3'));var router=express[_0x9cae('0x4')]();var auth=require(_0x9cae('0x5'));var interaction=require(_0x9cae('0x6'));var config=require(_0x9cae('0x7'));var controller=require(_0x9cae('0x8'));router['get']('/',auth[_0x9cae('0x9')](),controller['index']);router[_0x9cae('0xa')](_0x9cae('0xb'),auth[_0x9cae('0x9')](),controller['describe']);router[_0x9cae('0xa')](_0x9cae('0xc'),auth[_0x9cae('0x9')](),controller[_0x9cae('0xd')]);router[_0x9cae('0xe')]('/',auth['isAuthenticated'](),controller[_0x9cae('0xf')]);router['put']('/:id',auth[_0x9cae('0x9')](),controller['update']);router[_0x9cae('0x10')](_0x9cae('0xc'),auth[_0x9cae('0x9')](),controller[_0x9cae('0x11')]);module[_0x9cae('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 390eb09..2b5e050 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 _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
+var _0xc9d7=['exports','STRING','ENUM','mouseOver','timeout','sequelize'];(function(_0x4737b9,_0xda6545){var _0x22a941=function(_0x1d8d2c){while(--_0x1d8d2c){_0x4737b9['push'](_0x4737b9['shift']());}};_0x22a941(++_0xda6545);}(_0xc9d7,0x1af));var _0x7c9d=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0xc9d7[_0x291d3f];return _0x242080;};'use strict';var Sequelize=require(_0x7c9d('0x0'));module[_0x7c9d('0x1')]={'name':{'type':Sequelize[_0x7c9d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7c9d('0x3')](_0x7c9d('0x4'),_0x7c9d('0x5')),'defaultValue':_0x7c9d('0x4')},'selector':{'type':Sequelize[_0x7c9d('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 6a18b30..0c5cf08 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 _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
+var _0xa9e0=['keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','include','options','find','create','body','catch','params','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','show','model'];(function(_0xb7b878,_0x5c3b92){var _0x3c84b9=function(_0x21d5a2){while(--_0x21d5a2){_0xb7b878['push'](_0xb7b878['shift']());}};_0x3c84b9(++_0x5c3b92);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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={'raw':!![],'where':{'id':_0x526cf3['params']['id']}},_0x45a1e7={};_0x45a1e7[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x45a1e7[_0x0a9e('0x2a')]=_[_0x0a9e('0x27')](_0x526cf3[_0x0a9e('0x2a')]);_0x45a1e7[_0x0a9e('0x2b')]=_['intersection'](_0x45a1e7[_0x0a9e('0x26')],_0x45a1e7[_0x0a9e('0x2a')]);_0x479bc4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x45a1e7['model'],qs[_0x0a9e('0x2e')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x479bc4[_0x0a9e('0x2c')]=_0x479bc4[_0x0a9e('0x2c')][_0x0a9e('0x2f')]?_0x479bc4[_0x0a9e('0x2c')]:_0x45a1e7[_0x0a9e('0x26')];if(_0x526cf3[_0x0a9e('0x2a')]['includeAll']){_0x479bc4[_0x0a9e('0x30')]=[{'all':!![]}];}_0x479bc4=_['merge']({},_0x479bc4,_0x526cf3[_0x0a9e('0x31')]);return db[_0x0a9e('0x28')][_0x0a9e('0x32')](_0x479bc4)[_0x0a9e('0x1f')](handleEntityNotFound(_0x384319,null))[_0x0a9e('0x1f')](respondWithResult(_0x384319,null))['catch'](handleError(_0x384319,null));};exports[_0x0a9e('0x33')]=function(_0x46f0a5,_0x40cb85){return db[_0x0a9e('0x28')][_0x0a9e('0x33')](_0x46f0a5[_0x0a9e('0x34')],{})[_0x0a9e('0x1f')](respondWithResult(_0x40cb85,0xc9))[_0x0a9e('0x35')](handleError(_0x40cb85,null));};exports['update']=function(_0x44295a,_0x5e7238){if(_0x44295a[_0x0a9e('0x34')]['id']){delete _0x44295a[_0x0a9e('0x34')]['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x32')]({'where':{'id':_0x44295a['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5e7238,null))[_0x0a9e('0x1f')](saveUpdates(_0x44295a[_0x0a9e('0x34')],null))[_0x0a9e('0x1f')](respondWithResult(_0x5e7238,null))['catch'](handleError(_0x5e7238,null));};exports['destroy']=function(_0x1e8694,_0x5640eb){return db[_0x0a9e('0x28')][_0x0a9e('0x32')]({'where':{'id':_0x1e8694[_0x0a9e('0x36')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5640eb,null))['then'](removeEntity(_0x5640eb,null))[_0x0a9e('0x35')](handleError(_0x5640eb,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 25c9a2d..0f02fbc 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 _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
+var _0x3fa5=['define','ChatProactiveAction','chat_proactive_actions','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x3fa5,0xfd));var _0x53fa=function(_0x392ff0,_0x20a5f9){_0x392ff0=_0x392ff0-0x0;var _0x54e13a=_0x3fa5[_0x392ff0];return _0x54e13a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x53fa('0x0'))(_0x53fa('0x1'));var moment=require(_0x53fa('0x2'));var BPromise=require('bluebird');var rp=require(_0x53fa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53fa('0x4'));var config=require(_0x53fa('0x5'));var attributes=require(_0x53fa('0x6'));module['exports']=function(_0x579811,_0x4413d5){return _0x579811[_0x53fa('0x7')](_0x53fa('0x8'),attributes,{'tableName':_0x53fa('0x9'),'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 962d101..f52a91c 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 _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
+var _0x12a5=['client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x31ed6c,_0x376750){var _0xb5ca62=function(_0x4eb5f2){while(--_0x4eb5f2){_0x31ed6c['push'](_0x31ed6c['shift']());}};_0xb5ca62(++_0x376750);}(_0x12a5,0x6f));var _0x512a=function(_0x313e77,_0x137b9f){_0x313e77=_0x313e77-0x0;var _0x1adb33=_0x12a5[_0x313e77];return _0x1adb33;};'use strict';var _=require(_0x512a('0x0'));var util=require(_0x512a('0x1'));var moment=require(_0x512a('0x2'));var BPromise=require(_0x512a('0x3'));var rs=require(_0x512a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x512a('0x5'));var logger=require(_0x512a('0x6'))('rpc');var config=require(_0x512a('0x7'));var jayson=require(_0x512a('0x8'));var client=jayson[_0x512a('0x9')][_0x512a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d9b1d,_0x135e08,_0x49a242){return new BPromise(function(_0x221e66,_0x517293){return client[_0x512a('0xb')](_0x2d9b1d,_0x49a242)[_0x512a('0xc')](function(_0x4eac6b){logger['info'](_0x512a('0xd'),_0x135e08,'request\x20sent');logger[_0x512a('0xe')](_0x512a('0xf'),_0x135e08,_0x512a('0x10'),JSON[_0x512a('0x11')](_0x4eac6b));if(_0x4eac6b[_0x512a('0x12')]){if(_0x4eac6b[_0x512a('0x12')][_0x512a('0x13')]===0x1f4){logger[_0x512a('0x12')](_0x512a('0xd'),_0x135e08,_0x4eac6b[_0x512a('0x12')][_0x512a('0x14')]);return _0x517293(_0x4eac6b['error']['message']);}logger[_0x512a('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x135e08,_0x4eac6b[_0x512a('0x12')][_0x512a('0x14')]);return _0x221e66(_0x4eac6b['error'][_0x512a('0x14')]);}else{logger[_0x512a('0x15')](_0x512a('0xd'),_0x135e08,_0x512a('0x10'));_0x221e66(_0x4eac6b[_0x512a('0x16')][_0x512a('0x14')]);}})[_0x512a('0x17')](function(_0x17a9d9){logger[_0x512a('0x12')](_0x512a('0xd'),_0x135e08,_0x17a9d9);_0x517293(_0x17a9d9);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 7181d8c..0ba257f 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 _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
+var _0x4c6c=['isAuthenticated','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./chatProactiveAction.controller','/:id'];(function(_0x35a33c,_0x7975e){var _0x3b238d=function(_0x337552){while(--_0x337552){_0x35a33c['push'](_0x35a33c['shift']());}};_0x3b238d(++_0x7975e);}(_0x4c6c,0xb7));var _0xc4c6=function(_0x35ce3b,_0xa1b23d){_0x35ce3b=_0x35ce3b-0x0;var _0x5498ff=_0x4c6c[_0x35ce3b];return _0x5498ff;};'use strict';var multer=require(_0xc4c6('0x0'));var util=require(_0xc4c6('0x1'));var path=require(_0xc4c6('0x2'));var timeout=require(_0xc4c6('0x3'));var express=require(_0xc4c6('0x4'));var router=express[_0xc4c6('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc4c6('0x6'));var config=require('../../config/environment');var controller=require(_0xc4c6('0x7'));router['get'](_0xc4c6('0x8'),auth[_0xc4c6('0x9')](),controller['show']);router[_0xc4c6('0xa')]('/',auth['isAuthenticated'](),controller[_0xc4c6('0xb')]);router[_0xc4c6('0xc')](_0xc4c6('0x8'),auth[_0xc4c6('0x9')](),controller['update']);router[_0xc4c6('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xc4c6('0xe')]);module[_0xc4c6('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 93b1d64..8b0e571 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 _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
+var _0xc8c4=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc8c4,0x141));var _0x4c8c=function(_0x567703,_0x4b1cfa){_0x567703=_0x567703-0x0;var _0x1cd94a=_0xc8c4[_0x567703];return _0x1cd94a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4c8c('0x0')],'unique':_0x4c8c('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4c8c('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4c8c('0x3')](_0x4c8c('0x4'),_0x4c8c('0x5'),_0x4c8c('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 1a71d96..97e3cfb 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 _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
+var _0x43b1=['tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatQueue.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','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','pick','merge','VIRTUAL','filter','options','ChatQueue','count','include','params','keys','includeAll','find','create','user','role','ChatQueues','autoAssociation','body','describe','getMembers','findOne','rawAttributes','length','order','ChatQueueId','UserChatQueue','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','findOrCreate','forEach','userChatQueue:save','removeTeams','field'];(function(_0xaa2791,_0x468419){var _0x569690=function(_0x31a04c){while(--_0x31a04c){_0xaa2791['push'](_0xaa2791['shift']());}};_0x569690(++_0x468419);}(_0x43b1,0x155));var _0x143b=function(_0xbc6a31,_0x1dd0ce){_0xbc6a31=_0xbc6a31-0x0;var _0x3e5ea0=_0x43b1[_0xbc6a31];return _0x3e5ea0;};'use strict';var pdf=require(_0x143b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x143b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x143b('0x2'));var rp=require('request-promise');var moment=require(_0x143b('0x3'));var BPromise=require(_0x143b('0x4'));var Mustache=require(_0x143b('0x5'));var util=require(_0x143b('0x6'));var path=require(_0x143b('0x7'));var sox=require(_0x143b('0x8'));var csv=require(_0x143b('0x9'));var ejs=require(_0x143b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x143b('0xb'));var crypto=require(_0x143b('0xc'));var jsforce=require(_0x143b('0xd'));var deskjs=require(_0x143b('0xe'));var toCsv=require(_0x143b('0x9'));var querystring=require(_0x143b('0xf'));var Papa=require(_0x143b('0x10'));var Redis=require('ioredis');var authService=require(_0x143b('0x11'));var qs=require(_0x143b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x143b('0x13'));var logger=require(_0x143b('0x14'))(_0x143b('0x15'));var utils=require(_0x143b('0x16'));var config=require(_0x143b('0x17'));var db=require(_0x143b('0x18'))['db'];config['redis']=_[_0x143b('0x19')](config[_0x143b('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x143b('0x1b'))(new Redis(config[_0x143b('0x1a')]));require(_0x143b('0x1c'))['register'](socket);var jayson=require(_0x143b('0x1d'));var client=jayson[_0x143b('0x1e')][_0x143b('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x106a07,_0x18680b,_0x4b4f45){if(_0x4b4f45){var _0x599d14=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x599d14[_0x143b('0x20')](_0x18680b)){return _0x106a07;}else{throw new db[(_0x143b('0x21'))][(_0x143b('0x22'))](_0x143b('0x23'));}}else{return _0x106a07;}}function respondWithRpcPromise(_0x392931,_0x12aa96,_0x12b789,_0xcbfb77){return new BPromise(function(_0x6869d1,_0x2abff2){var _0x5d02e1=_0xcbfb77||client;return _0x5d02e1[_0x143b('0x24')](_0x392931,_0x12b789)['then'](function(_0x5433b1){logger[_0x143b('0x25')](_0x143b('0x26'),_0x12aa96,_0x143b('0x27'));logger[_0x143b('0x28')](_0x143b('0x29'),_0x12aa96,'request\x20sent',JSON[_0x143b('0x2a')](_0x5433b1));if(_0x5433b1[_0x143b('0x2b')]){if(_0x5433b1['error'][_0x143b('0x2c')]===0x1f4){logger[_0x143b('0x2b')]('ChatQueue,\x20%s,\x20%s',_0x12aa96,_0x5433b1['error'][_0x143b('0x2d')]);return _0x2abff2(_0x5433b1[_0x143b('0x2b')][_0x143b('0x2d')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x12aa96,_0x5433b1[_0x143b('0x2b')][_0x143b('0x2d')]);return _0x6869d1(_0x5433b1[_0x143b('0x2b')][_0x143b('0x2d')]);}else{logger[_0x143b('0x25')](_0x143b('0x26'),_0x12aa96,_0x143b('0x27'));_0x6869d1(_0x5433b1[_0x143b('0x2e')][_0x143b('0x2d')]);}})[_0x143b('0x2f')](function(_0x3baa0e){logger[_0x143b('0x2b')](_0x143b('0x26'),_0x12aa96,_0x3baa0e);_0x2abff2(_0x3baa0e);});});}function respondWithStatusCode(_0x9b4f81,_0x5c9182){_0x5c9182=_0x5c9182||0xcc;return function(_0x360c43){if(_0x360c43){return _0x9b4f81[_0x143b('0x30')](_0x5c9182);}return _0x9b4f81[_0x143b('0x31')](_0x5c9182)[_0x143b('0x32')]();};}function respondWithResult(_0x3c4de6,_0x3600bf){_0x3600bf=_0x3600bf||0xc8;return function(_0x4c160a){if(_0x4c160a){return _0x3c4de6[_0x143b('0x31')](_0x3600bf)['json'](_0x4c160a);}};}function respondWithFilteredResult(_0x479a48,_0x3509c2){return function(_0x526aab){if(_0x526aab){var _0x1a68dd=_0x526aab['count'],_0x53a233=_0x3509c2['offset'],_0x4af8db=_0x3509c2['offset']+_0x3509c2[_0x143b('0x33')],_0x1bfef5;if(_0x4af8db>=_0x1a68dd){_0x4af8db=_0x1a68dd;_0x1bfef5=0xc8;}else{_0x1bfef5=0xce;}_0x479a48[_0x143b('0x31')](_0x1bfef5);return _0x479a48[_0x143b('0x34')](_0x143b('0x35'),_0x53a233+'-'+_0x4af8db+'/'+_0x1a68dd)[_0x143b('0x36')](_0x526aab);}return null;};}function patchUpdates(_0x54bdfd){return function(_0x29a341){try{jsonpatch[_0x143b('0x37')](_0x29a341,_0x54bdfd,!![]);}catch(_0x3b2fbe){return BPromise[_0x143b('0x38')](_0x3b2fbe);}return _0x29a341[_0x143b('0x39')]();};}function saveUpdates(_0x5dcb34,_0x5e5a5b){return function(_0x1728e2){if(_0x1728e2){return _0x1728e2[_0x143b('0x3a')](_0x5dcb34)[_0x143b('0x3b')](function(_0x3958e8){return _0x3958e8;});}return null;};}function removeEntity(_0x2f4ce4,_0x214f58){return function(_0x538664){if(_0x538664){return _0x538664[_0x143b('0x3c')]()['then'](function(){var _0x5f42eb=_0x538664[_0x143b('0x3d')]({'plain':!![]});var _0x40ea9a='ChatQueues';return db[_0x143b('0x3e')]['destroy']({'where':{'type':_0x40ea9a,'resourceId':_0x5f42eb['id']}})[_0x143b('0x3b')](function(){return _0x538664;});})[_0x143b('0x3b')](function(){_0x2f4ce4[_0x143b('0x31')](0xcc)[_0x143b('0x32')]();});}};}function handleEntityNotFound(_0x3bc679,_0x153b6d){return function(_0x5a7f33){if(!_0x5a7f33){_0x3bc679['sendStatus'](0x194);}return _0x5a7f33;};}function handleError(_0x5b5d05,_0x141e6d){_0x141e6d=_0x141e6d||0x1f4;return function(_0x2f7a2a){logger['error'](_0x2f7a2a[_0x143b('0x3f')]);if(_0x2f7a2a['name']){delete _0x2f7a2a[_0x143b('0x40')];}_0x5b5d05['status'](_0x141e6d)[_0x143b('0x41')](_0x2f7a2a);};}exports['index']=function(_0x6f95e0,_0x1737dd){var _0x4fba26={},_0x3d3388={},_0x5d7293={'count':0x0,'rows':[]};var _0x1ecbb2=_['map'](db['ChatQueue']['rawAttributes'],function(_0x214f35){return{'name':_0x214f35[_0x143b('0x42')],'type':_0x214f35[_0x143b('0x43')][_0x143b('0x44')]};});_0x3d3388[_0x143b('0x45')]=_[_0x143b('0x46')](_0x1ecbb2,_0x143b('0x40'));_0x3d3388[_0x143b('0x47')]=_['keys'](_0x6f95e0[_0x143b('0x47')]);_0x3d3388[_0x143b('0x48')]=_[_0x143b('0x49')](_0x3d3388[_0x143b('0x45')],_0x3d3388[_0x143b('0x47')]);_0x4fba26[_0x143b('0x4a')]=_['intersection'](_0x3d3388[_0x143b('0x45')],qs['fields'](_0x6f95e0['query'][_0x143b('0x4b')]));_0x4fba26[_0x143b('0x4a')]=_0x4fba26[_0x143b('0x4a')]['length']?_0x4fba26[_0x143b('0x4a')]:_0x3d3388[_0x143b('0x45')];if(!_0x6f95e0['query'][_0x143b('0x4c')](_0x143b('0x4d'))){_0x4fba26[_0x143b('0x33')]=qs[_0x143b('0x33')](_0x6f95e0['query'][_0x143b('0x33')]);_0x4fba26['offset']=qs['offset'](_0x6f95e0[_0x143b('0x47')][_0x143b('0x4e')]);}_0x4fba26['order']=qs[_0x143b('0x4f')](_0x6f95e0[_0x143b('0x47')][_0x143b('0x4f')]);_0x4fba26[_0x143b('0x50')]=qs[_0x143b('0x48')](_[_0x143b('0x51')](_0x6f95e0[_0x143b('0x47')],_0x3d3388[_0x143b('0x48')]),_0x1ecbb2);if(_0x6f95e0[_0x143b('0x47')]['filter']){_0x4fba26[_0x143b('0x50')]=_[_0x143b('0x52')](_0x4fba26[_0x143b('0x50')],{'$or':_[_0x143b('0x46')](_0x1ecbb2,function(_0x3a479d){if(_0x3a479d['type']!==_0x143b('0x53')){var _0x199efc={};_0x199efc[_0x3a479d[_0x143b('0x40')]]={'$like':'%'+_0x6f95e0[_0x143b('0x47')][_0x143b('0x54')]+'%'};return _0x199efc;}})});}_0x4fba26=_['merge']({},_0x4fba26,_0x6f95e0[_0x143b('0x55')]);var _0x5b6a5c={'where':_0x4fba26[_0x143b('0x50')]};return db[_0x143b('0x56')][_0x143b('0x57')](_0x5b6a5c)[_0x143b('0x3b')](function(_0x515421){_0x5d7293[_0x143b('0x57')]=_0x515421;if(_0x6f95e0[_0x143b('0x47')]['includeAll']){_0x4fba26[_0x143b('0x58')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x4fba26);})['then'](function(_0x46705e){_0x5d7293['rows']=_0x46705e;return _0x5d7293;})[_0x143b('0x3b')](respondWithFilteredResult(_0x1737dd,_0x4fba26))[_0x143b('0x2f')](handleError(_0x1737dd,null));};exports['show']=function(_0x386fdc,_0x57c930){var _0x1ce4f6={'raw':!![],'where':{'id':_0x386fdc[_0x143b('0x59')]['id']}},_0x5a6233={};_0x5a6233[_0x143b('0x45')]=_[_0x143b('0x5a')](db[_0x143b('0x56')]['rawAttributes']);_0x5a6233[_0x143b('0x47')]=_[_0x143b('0x5a')](_0x386fdc[_0x143b('0x47')]);_0x5a6233['filters']=_[_0x143b('0x49')](_0x5a6233['model'],_0x5a6233[_0x143b('0x47')]);_0x1ce4f6[_0x143b('0x4a')]=_[_0x143b('0x49')](_0x5a6233[_0x143b('0x45')],qs[_0x143b('0x4b')](_0x386fdc['query']['fields']));_0x1ce4f6[_0x143b('0x4a')]=_0x1ce4f6['attributes']['length']?_0x1ce4f6[_0x143b('0x4a')]:_0x5a6233[_0x143b('0x45')];if(_0x386fdc[_0x143b('0x47')][_0x143b('0x5b')]){_0x1ce4f6[_0x143b('0x58')]=[{'all':!![]}];}_0x1ce4f6=_[_0x143b('0x52')]({},_0x1ce4f6,_0x386fdc[_0x143b('0x55')]);return db[_0x143b('0x56')][_0x143b('0x5c')](_0x1ce4f6)[_0x143b('0x3b')](handleEntityNotFound(_0x57c930,null))[_0x143b('0x3b')](respondWithResult(_0x57c930,null))[_0x143b('0x2f')](handleError(_0x57c930,null));};exports[_0x143b('0x5d')]=function(_0x5aeb5a,_0x4e8690){return db['ChatQueue'][_0x143b('0x5d')](_0x5aeb5a['body'],{})[_0x143b('0x3b')](function(_0x123ddf){var _0x3c3ffc=_0x5aeb5a[_0x143b('0x5e')][_0x143b('0x3d')]({'plain':!![]});if(!_0x3c3ffc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c3ffc[_0x143b('0x5f')]===_0x143b('0x5e')){var _0x13a1cd=_0x123ddf[_0x143b('0x3d')]({'plain':!![]});var _0x273cfa=_0x143b('0x60');return db['UserProfileSection']['find']({'where':{'name':_0x273cfa,'userProfileId':_0x3c3ffc['userProfileId']},'raw':!![]})['then'](function(_0x3219d0){if(_0x3219d0&&_0x3219d0[_0x143b('0x61')]===0x0){return db[_0x143b('0x3e')][_0x143b('0x5d')]({'name':_0x13a1cd[_0x143b('0x40')],'resourceId':_0x13a1cd['id'],'type':_0x3219d0['name'],'sectionId':_0x3219d0['id']},{})[_0x143b('0x3b')](function(){return _0x123ddf;});}else{return _0x123ddf;}})[_0x143b('0x2f')](function(_0x2c4436){logger[_0x143b('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c4436);throw _0x2c4436;});}return _0x123ddf;})['then'](respondWithResult(_0x4e8690,0xc9))['catch'](handleError(_0x4e8690,null));};exports['update']=function(_0x2ae08e,_0x3dcf28){if(_0x2ae08e[_0x143b('0x62')]['id']){delete _0x2ae08e[_0x143b('0x62')]['id'];}return db[_0x143b('0x56')][_0x143b('0x5c')]({'where':{'id':_0x2ae08e[_0x143b('0x59')]['id']}})[_0x143b('0x3b')](handleEntityNotFound(_0x3dcf28,null))['then'](saveUpdates(_0x2ae08e[_0x143b('0x62')],null))[_0x143b('0x3b')](respondWithResult(_0x3dcf28,null))[_0x143b('0x2f')](handleError(_0x3dcf28,null));};exports['destroy']=function(_0x4ddfe1,_0x17fa77){return db[_0x143b('0x56')][_0x143b('0x5c')]({'where':{'id':_0x4ddfe1[_0x143b('0x59')]['id']}})['then'](handleEntityNotFound(_0x17fa77,null))[_0x143b('0x3b')](removeEntity(_0x17fa77,null))[_0x143b('0x2f')](handleError(_0x17fa77,null));};exports['describe']=function(_0x147794,_0x11215e){return db['ChatQueue'][_0x143b('0x63')]()[_0x143b('0x3b')](respondWithResult(_0x11215e,null))[_0x143b('0x2f')](handleError(_0x11215e,null));};exports[_0x143b('0x64')]=function(_0x33eae1,_0xddff3c,_0x5957a4){var _0x34ec5e={'raw':!![],'where':{}},_0x18dc07={},_0x395cf7;return db[_0x143b('0x56')][_0x143b('0x65')]({'where':{'id':_0x33eae1['params']['id']}})['then'](handleEntityNotFound(_0xddff3c,null))[_0x143b('0x3b')](function(_0x1ba975){if(_0x1ba975){_0x395cf7=_0x1ba975[_0x143b('0x3d')]({'plain':!![]});_0x18dc07[_0x143b('0x45')]=_[_0x143b('0x5a')](db['UserChatQueue'][_0x143b('0x66')]);_0x18dc07[_0x143b('0x47')]=_[_0x143b('0x5a')](_0x33eae1[_0x143b('0x47')]);_0x18dc07['filters']=_[_0x143b('0x49')](_0x18dc07[_0x143b('0x45')],_0x18dc07[_0x143b('0x47')]);_0x34ec5e[_0x143b('0x4a')]=_['intersection'](_0x18dc07[_0x143b('0x45')],qs[_0x143b('0x4b')](_0x33eae1['query'][_0x143b('0x4b')]));_0x34ec5e[_0x143b('0x4a')]=_0x34ec5e[_0x143b('0x4a')][_0x143b('0x67')]?_0x34ec5e[_0x143b('0x4a')]:_0x18dc07['model'];if(!_0x33eae1[_0x143b('0x47')][_0x143b('0x4c')](_0x143b('0x4d'))){_0x34ec5e['limit']=qs[_0x143b('0x33')](_0x33eae1['query'][_0x143b('0x33')]);_0x34ec5e['offset']=qs[_0x143b('0x4e')](_0x33eae1[_0x143b('0x47')][_0x143b('0x4e')]);}_0x34ec5e[_0x143b('0x68')]=qs[_0x143b('0x4f')](_0x33eae1[_0x143b('0x47')]['sort']);_0x34ec5e['where']=qs[_0x143b('0x48')](_[_0x143b('0x51')](_0x33eae1['query'],_0x18dc07[_0x143b('0x48')]));_0x34ec5e[_0x143b('0x50')][_0x143b('0x69')]=_0x1ba975['id'];if(_0x33eae1[_0x143b('0x47')]['filter']){_0x34ec5e[_0x143b('0x50')]=_[_0x143b('0x52')](_0x34ec5e[_0x143b('0x50')],{'$or':_['map'](_0x34ec5e[_0x143b('0x4a')],function(_0x585ae9){var _0xa6556e={};_0xa6556e[_0x585ae9]={'$like':'%'+_0x33eae1['query'][_0x143b('0x54')]+'%'};return _0xa6556e;})});}_0x34ec5e=_[_0x143b('0x52')]({},_0x34ec5e,_0x33eae1['options']);return db[_0x143b('0x6a')][_0x143b('0x6b')](_0x34ec5e);}})['then'](function(_0x5c6c46){if(_0x5c6c46){return db[_0x143b('0x6c')][_0x143b('0x6d')]({'where':{'id':_['map'](_0x5c6c46,_0x143b('0x6e')),'role':_0x143b('0x6f')},'attributes':['id',_0x143b('0x40'),_0x143b('0x70'),_0x143b('0x71'),_0x143b('0x72')]});}})['then'](function(_0x47dc69){if(_0x47dc69){return{'count':_0x47dc69[_0x143b('0x57')],'rows':_[_0x143b('0x46')](_0x47dc69[_0x143b('0x73')],function(_0x46ec77){return{'membername':_0x46ec77[_0x143b('0x40')],'UserId':_0x46ec77['id'],'queue_name':_0x395cf7[_0x143b('0x40')],'ChatQueueId':_0x395cf7['id'],'interface':util[_0x143b('0x74')]('%s/%s',_0x143b('0x75'),_0x46ec77['name']),'penalty':0x0,'paused':_0x46ec77['chatPause'],'createdAt':_0x46ec77[_0x143b('0x72')],'updatedAt':_0x46ec77[_0x143b('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x143b('0x3b')](respondWithFilteredResult(_0xddff3c,_0x34ec5e))[_0x143b('0x2f')](handleError(_0xddff3c,null));};exports[_0x143b('0x76')]=function(_0x202e7a,_0x52e49e,_0x41cabb){var _0x4df430={};var _0x4e908d={};var _0x1bcc8c;var _0x3c666e;return db[_0x143b('0x56')]['findOne']({'where':{'id':_0x202e7a[_0x143b('0x59')]['id']}})[_0x143b('0x3b')](handleEntityNotFound(_0x52e49e,null))[_0x143b('0x3b')](function(_0x5f2506){if(_0x5f2506){_0x1bcc8c=_0x5f2506;_0x4e908d['model']=_[_0x143b('0x5a')](db[_0x143b('0x77')]['rawAttributes']);_0x4e908d[_0x143b('0x47')]=_[_0x143b('0x5a')](_0x202e7a['query']);_0x4e908d[_0x143b('0x48')]=_[_0x143b('0x49')](_0x4e908d[_0x143b('0x45')],_0x4e908d['query']);_0x4df430[_0x143b('0x4a')]=_['intersection'](_0x4e908d[_0x143b('0x45')],qs[_0x143b('0x4b')](_0x202e7a['query'][_0x143b('0x4b')]));_0x4df430[_0x143b('0x4a')]=_0x4df430[_0x143b('0x4a')]['length']?_0x4df430[_0x143b('0x4a')]:_0x4e908d['model'];_0x4df430['order']=qs[_0x143b('0x4f')](_0x202e7a['query']['sort']);_0x4df430[_0x143b('0x50')]=qs['filters'](_[_0x143b('0x51')](_0x202e7a['query'],_0x4e908d[_0x143b('0x48')]));if(_0x202e7a['query'][_0x143b('0x54')]){_0x4df430[_0x143b('0x50')]=_['merge'](_0x4df430[_0x143b('0x50')],{'$or':_[_0x143b('0x46')](_0x4df430[_0x143b('0x4a')],function(_0x1bc89e){var _0xacaa64={};_0xacaa64[_0x1bc89e]={'$like':'%'+_0x202e7a['query']['filter']+'%'};return _0xacaa64;})});}_0x4df430=_[_0x143b('0x52')]({},_0x4df430,_0x202e7a[_0x143b('0x55')]);return _0x1bcc8c[_0x143b('0x76')](_0x4df430);}})[_0x143b('0x3b')](function(_0x9f9872){if(_0x9f9872){_0x3c666e=_0x9f9872[_0x143b('0x67')];if(!_0x202e7a[_0x143b('0x47')][_0x143b('0x4c')](_0x143b('0x4d'))){_0x4df430[_0x143b('0x33')]=qs[_0x143b('0x33')](_0x202e7a[_0x143b('0x47')][_0x143b('0x33')]);_0x4df430[_0x143b('0x4e')]=qs['offset'](_0x202e7a[_0x143b('0x47')][_0x143b('0x4e')]);}return _0x1bcc8c[_0x143b('0x76')](_0x4df430);}})[_0x143b('0x3b')](function(_0x24a1cc){if(_0x24a1cc){return _0x24a1cc?{'count':_0x3c666e,'rows':_0x24a1cc}:null;}})[_0x143b('0x3b')](respondWithResult(_0x52e49e,null))[_0x143b('0x2f')](handleError(_0x52e49e,null));};exports[_0x143b('0x78')]=function(_0x96fae9,_0x11ed93,_0x497fee){var _0x500c81=_0x96fae9[_0x143b('0x62')][_0x143b('0x79')];return db['Team'][_0x143b('0x6b')]({'where':{'id':_0x500c81},'attributes':['id'],'include':[{'model':db[_0x143b('0x6c')],'as':_0x143b('0x7a'),'attributes':['id',_0x143b('0x40'),_0x143b('0x7b'),_0x143b('0x7c'),_0x143b('0x7d')],'raw':!![]}]})[_0x143b('0x3b')](function(_0x49b297){if(_0x49b297){var _0x43d355=_['flatMap'](_0x49b297,function(_0xd876d0){var _0x56d414=_0xd876d0[_0x143b('0x3d')]({'plain':!![]});return _0x56d414[_0x143b('0x7a')];});return db[_0x143b('0x56')][_0x143b('0x5c')]({'where':{'id':_0x96fae9[_0x143b('0x59')]['id']}})['then'](function(_0x2db893){return db[_0x143b('0x7e')][_0x143b('0x7f')](function(_0x3a16c9){return _0x2db893['addTeams'](_0x500c81,{'transaction':_0x3a16c9})[_0x143b('0x3b')](function(){return BPromise['each'](_0x43d355,function(_0x4854d7){return db[_0x143b('0x6a')][_0x143b('0x80')]({'where':{'UserId':_0x4854d7['id'],'ChatQueueId':_0x96fae9[_0x143b('0x59')]['id']},'transaction':_0x3a16c9});});})['then'](function(){_0x43d355[_0x143b('0x81')](function(_0x5afd73){socket['emit'](_0x143b('0x82'),{'UserId':_0x5afd73['id'],'ChatQueueId':_0x2db893['id']});});});});});}})[_0x143b('0x3b')](respondWithStatusCode(_0x11ed93,null))['catch'](handleError(_0x11ed93,null));};exports[_0x143b('0x83')]=function(_0x5f51d4,_0xb6169e,_0x2a6322){return db[_0x143b('0x77')][_0x143b('0x6b')]({'where':{'id':_0x5f51d4['query'][_0x143b('0x79')]},'attributes':['id'],'include':[{'model':db[_0x143b('0x6c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x143b('0x3b')](handleEntityNotFound(_0xb6169e,null))['then'](function(_0x4c2afa){var _0x3e650c=_[_0x143b('0x46')](_0x4c2afa,'id');var _0x33b6df=[];var _0x5d96d7=[];var _0x5918d4=squel['select']();_0x5918d4[_0x143b('0x84')](_0x143b('0x85'))['from'](_0x143b('0x86'),'tq')[_0x143b('0x87')](_0x143b('0x88'),'ut',_0x143b('0x89'))[_0x143b('0x50')]('ChatQueueId\x20=\x20?',_0x5f51d4[_0x143b('0x59')]['id']);for(var _0x5a1b6c=0x0;_0x5a1b6c<_0x4c2afa[_0x143b('0x67')];_0x5a1b6c+=0x1){let _0x5d4bf3=_0x4c2afa[_0x5a1b6c];for(var _0x480904=0x0;_0x480904<_0x5d4bf3['Agents'][_0x143b('0x67')];_0x480904+=0x1){let _0x5254e3=_0x5d4bf3[_0x143b('0x7a')][_0x480904];var _0x362d05=_0x5918d4['clone']();_0x362d05[_0x143b('0x50')](_0x143b('0x8a'),_0x5254e3['id']);_0x5d96d7[_0x143b('0x8b')](db[_0x143b('0x7e')]['query'](_0x362d05[_0x143b('0x8c')](),{'type':db['sequelize'][_0x143b('0x8d')][_0x143b('0x8e')]})[_0x143b('0x3b')](function(_0x253696){if(_0x253696['length']===0x1){return _0x5254e3['id'];}else{var _0x462c39=_[_0x143b('0x8f')](_[_0x143b('0x46')](_0x253696,_0x143b('0x90')),function(_0x19c125){return _[_0x143b('0x91')](_0x3e650c,_0x19c125);});if(_0x462c39){return _0x5254e3['id'];}}}));}}return BPromise[_0x143b('0x92')](_0x5d96d7)[_0x143b('0x3b')](function(_0x2aae02){_0x33b6df=_(_0x33b6df)['union'](_0x2aae02)[_0x143b('0x93')]()[_0x143b('0x94')]();return db[_0x143b('0x56')][_0x143b('0x5c')]({'where':{'id':_0x5f51d4['params']['id']}})[_0x143b('0x3b')](function(_0x1e1e6c){return db[_0x143b('0x7e')][_0x143b('0x7f')](function(_0x5ef51e){return _0x1e1e6c[_0x143b('0x83')](_0x5f51d4[_0x143b('0x47')][_0x143b('0x79')],{'transaction':_0x5ef51e})[_0x143b('0x3b')](function(){if(!_[_0x143b('0x95')](_0x33b6df)){return _0x1e1e6c[_0x143b('0x96')](_0x33b6df,{'transaction':_0x5ef51e});}})['then'](function(){_0x33b6df[_0x143b('0x81')](function(_0x22b252){socket[_0x143b('0x97')](_0x143b('0x98'),{'UserId':_0x22b252,'ChatQueueId':_0x1e1e6c['id']});});});});});});})['then'](respondWithStatusCode(_0xb6169e,null))[_0x143b('0x2f')](handleError(_0xb6169e,null));};exports['addAgents']=function(_0x2a8aeb,_0x548f0a,_0x222ce4){return db['ChatQueue'][_0x143b('0x5c')]({'where':{'id':_0x2a8aeb[_0x143b('0x59')]['id']}})[_0x143b('0x3b')](handleEntityNotFound(_0x548f0a,null))[_0x143b('0x3b')](function(_0x24c4d2){if(_0x24c4d2){return _0x24c4d2[_0x143b('0x99')](_0x2a8aeb['body'][_0x143b('0x79')],_[_0x143b('0x9a')](_0x2a8aeb[_0x143b('0x62')],[_0x143b('0x79'),'id'])||{})[_0x143b('0x9b')](function(_0x523617){for(var _0x313a5f=0x0;_0x313a5f<_0x2a8aeb[_0x143b('0x62')][_0x143b('0x79')][_0x143b('0x67')];_0x313a5f+=0x1){socket[_0x143b('0x97')]('userChatQueue:save',{'UserId':_0x2a8aeb[_0x143b('0x62')][_0x143b('0x79')][_0x313a5f],'ChatQueueId':_0x2a8aeb[_0x143b('0x59')]['id']});}return _0x523617;});}})['then'](respondWithResult(_0x548f0a,null))[_0x143b('0x2f')](handleError(_0x548f0a,null));};exports[_0x143b('0x96')]=function(_0x26c6b2,_0x103f6b,_0x514474){return db[_0x143b('0x56')][_0x143b('0x5c')]({'where':{'id':_0x26c6b2[_0x143b('0x59')]['id']}})[_0x143b('0x3b')](handleEntityNotFound(_0x103f6b,null))['then'](function(_0x1f61ee){if(_0x1f61ee){return _0x1f61ee['removeAgents'](_0x26c6b2[_0x143b('0x47')][_0x143b('0x79')])[_0x143b('0x3b')](function(){if(_[_0x143b('0x9c')](_0x26c6b2['query'][_0x143b('0x79')])){for(var _0x340f99=0x0;_0x340f99<_0x26c6b2[_0x143b('0x47')][_0x143b('0x79')][_0x143b('0x67')];_0x340f99+=0x1){socket['emit'](_0x143b('0x98'),{'UserId':Number(_0x26c6b2['query']['ids'][_0x340f99]),'ChatQueueId':Number(_0x26c6b2[_0x143b('0x59')]['id'])});}}else{socket[_0x143b('0x97')](_0x143b('0x98'),{'UserId':Number(_0x26c6b2['query'][_0x143b('0x79')]),'ChatQueueId':Number(_0x26c6b2['params']['id'])});}});}})[_0x143b('0x3b')](respondWithStatusCode(_0x103f6b,null))[_0x143b('0x2f')](handleError(_0x103f6b,null));};exports[_0x143b('0x9d')]=function(_0x422c93,_0x30b1da,_0x4bbe2e){var _0x129ec6={};var _0x31fe0e={};var _0x79fc8d;var _0x3d637f;return db[_0x143b('0x56')][_0x143b('0x65')]({'where':{'id':_0x422c93[_0x143b('0x59')]['id']}})['then'](handleEntityNotFound(_0x30b1da,null))['then'](function(_0x3f403a){if(_0x3f403a){_0x79fc8d=_0x3f403a;_0x31fe0e[_0x143b('0x45')]=_[_0x143b('0x5a')](db[_0x143b('0x6c')]['rawAttributes']);_0x31fe0e[_0x143b('0x47')]=_['keys'](_0x422c93['query']);_0x31fe0e[_0x143b('0x48')]=_[_0x143b('0x49')](_0x31fe0e[_0x143b('0x45')],_0x31fe0e['query']);_0x129ec6[_0x143b('0x4a')]=_['intersection'](_0x31fe0e[_0x143b('0x45')],qs['fields'](_0x422c93['query'][_0x143b('0x4b')]));_0x129ec6[_0x143b('0x4a')]=_0x129ec6[_0x143b('0x4a')][_0x143b('0x67')]?_0x129ec6[_0x143b('0x4a')]:_0x31fe0e[_0x143b('0x45')];_0x129ec6[_0x143b('0x68')]=qs[_0x143b('0x4f')](_0x422c93['query'][_0x143b('0x4f')]);_0x129ec6[_0x143b('0x50')]=qs[_0x143b('0x48')](_[_0x143b('0x51')](_0x422c93[_0x143b('0x47')],_0x31fe0e[_0x143b('0x48')]));if(_0x422c93[_0x143b('0x47')][_0x143b('0x54')]){_0x129ec6[_0x143b('0x50')]=_[_0x143b('0x52')](_0x129ec6[_0x143b('0x50')],{'$or':_[_0x143b('0x46')](_0x129ec6[_0x143b('0x4a')],function(_0x3f4110){var _0x2303b9={};_0x2303b9[_0x3f4110]={'$like':'%'+_0x422c93[_0x143b('0x47')]['filter']+'%'};return _0x2303b9;})});}_0x129ec6=_[_0x143b('0x52')]({},_0x129ec6,_0x422c93[_0x143b('0x55')]);return _0x79fc8d[_0x143b('0x9d')](_0x129ec6);}})['then'](function(_0x3741f6){if(_0x3741f6){_0x3d637f=_0x3741f6[_0x143b('0x67')];if(!_0x422c93['query']['hasOwnProperty']('nolimit')){_0x129ec6[_0x143b('0x33')]=qs[_0x143b('0x33')](_0x422c93['query'][_0x143b('0x33')]);_0x129ec6[_0x143b('0x4e')]=qs[_0x143b('0x4e')](_0x422c93[_0x143b('0x47')]['offset']);}return _0x79fc8d[_0x143b('0x9d')](_0x129ec6);}})[_0x143b('0x3b')](function(_0xae0a4f){if(_0xae0a4f){return _0xae0a4f?{'count':_0x3d637f,'rows':_0xae0a4f}:null;}})[_0x143b('0x3b')](respondWithResult(_0x30b1da,null))[_0x143b('0x2f')](handleError(_0x30b1da,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 7dfaecd..f3fd9ac 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 _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
+var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x5c3223,_0x52c819){var _0x54ac69=function(_0x12d440){while(--_0x12d440){_0x5c3223['push'](_0x5c3223['shift']());}};_0x54ac69(++_0x52c819);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5ade3b,_0x5210f3){_0x5ade3b=_0x5ade3b-0x0;var _0x4c61ea=_0x5f2f[_0x5ade3b];return _0x4c61ea;};'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
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 48d7afc..de2bb73 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 _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
+var _0xa8dd=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','chat_queues','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8dd,0x11e));var _0xda8d=function(_0x4330ec,_0x3f4522){_0x4330ec=_0x4330ec-0x0;var _0x5aa853=_0xa8dd[_0x4330ec];return _0x5aa853;};'use strict';var _=require('lodash');var util=require(_0xda8d('0x0'));var logger=require(_0xda8d('0x1'))(_0xda8d('0x2'));var moment=require(_0xda8d('0x3'));var BPromise=require(_0xda8d('0x4'));var rp=require(_0xda8d('0x5'));var fs=require('fs');var path=require(_0xda8d('0x6'));var rimraf=require(_0xda8d('0x7'));var config=require(_0xda8d('0x8'));var attributes=require('./chatQueue.attributes');module[_0xda8d('0x9')]=function(_0x263ce1,_0x2eddc5){return _0x263ce1[_0xda8d('0xa')]('ChatQueue',attributes,{'tableName':_0xda8d('0xb'),'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 e410279..6d7342f 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 _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
+var _0xb0ca=['info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueue','findAll','options','where','limit','include','model','attributes','map','GetChatQueue','ShowChatQueue','find','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xb0ca,0x1b2));var _0xab0c=function(_0x3261ed,_0x1f06ad){_0x3261ed=_0x3261ed-0x0;var _0xbea3c3=_0xb0ca[_0x3261ed];return _0xbea3c3;};'use strict';var _=require('lodash');var util=require(_0xab0c('0x0'));var moment=require('moment');var BPromise=require(_0xab0c('0x1'));var rs=require(_0xab0c('0x2'));var fs=require('fs');var Redis=require(_0xab0c('0x3'));var db=require(_0xab0c('0x4'))['db'];var utils=require(_0xab0c('0x5'));var logger=require(_0xab0c('0x6'))(_0xab0c('0x7'));var config=require('../../config/environment');var jayson=require(_0xab0c('0x8'));var client=jayson[_0xab0c('0x9')][_0xab0c('0xa')]({'port':0x232a});config[_0xab0c('0xb')]=_[_0xab0c('0xc')](config[_0xab0c('0xb')],{'host':_0xab0c('0xd'),'port':0x18eb});var socket=require(_0xab0c('0xe'))(new Redis(config[_0xab0c('0xb')]));require('./chatQueue.socket')[_0xab0c('0xf')](socket);function respondWithRpcPromise(_0x15db71,_0x52df38,_0xb79b41){return new BPromise(function(_0x17bff7,_0x11a4ae){return client['request'](_0x15db71,_0xb79b41)[_0xab0c('0x10')](function(_0x53a944){logger[_0xab0c('0x11')](_0xab0c('0x12'),_0x52df38,_0xab0c('0x13'));logger[_0xab0c('0x14')](_0xab0c('0x15'),_0x52df38,_0xab0c('0x13'),JSON[_0xab0c('0x16')](_0x53a944));if(_0x53a944[_0xab0c('0x17')]){if(_0x53a944[_0xab0c('0x17')][_0xab0c('0x18')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x52df38,_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);return _0x11a4ae(_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);}logger[_0xab0c('0x17')](_0xab0c('0x12'),_0x52df38,_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);return _0x17bff7(_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);}else{logger[_0xab0c('0x11')](_0xab0c('0x12'),_0x52df38,_0xab0c('0x13'));_0x17bff7(_0x53a944[_0xab0c('0x1a')][_0xab0c('0x19')]);}})[_0xab0c('0x1b')](function(_0x44c6f4){logger[_0xab0c('0x17')](_0xab0c('0x12'),_0x52df38,_0x44c6f4);_0x11a4ae(_0x44c6f4);});});}exports['GetChatQueue']=function(_0x29b873){var _0x4ad10e=this;return new Promise(function(_0x36794d,_0x870902){return db[_0xab0c('0x1c')][_0xab0c('0x1d')]({'raw':_0x29b873[_0xab0c('0x1e')]?_0x29b873[_0xab0c('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x29b873[_0xab0c('0x1e')]?_0x29b873[_0xab0c('0x1e')][_0xab0c('0x1f')]||null:null,'attributes':_0x29b873['options']?_0x29b873[_0xab0c('0x1e')]['attributes']||null:null,'limit':_0x29b873[_0xab0c('0x1e')]?_0x29b873[_0xab0c('0x1e')][_0xab0c('0x20')]||null:null,'include':_0x29b873['options']?_0x29b873[_0xab0c('0x1e')][_0xab0c('0x21')]?_['map'](_0x29b873[_0xab0c('0x1e')][_0xab0c('0x21')],function(_0xfe7099){return{'model':db[_0xfe7099[_0xab0c('0x22')]],'as':_0xfe7099['as'],'attributes':_0xfe7099[_0xab0c('0x23')],'include':_0xfe7099[_0xab0c('0x21')]?_[_0xab0c('0x24')](_0xfe7099[_0xab0c('0x21')],function(_0x3ce281){return{'model':db[_0x3ce281[_0xab0c('0x22')]],'as':_0x3ce281['as'],'attributes':_0x3ce281[_0xab0c('0x23')],'include':_0x3ce281[_0xab0c('0x21')]?_[_0xab0c('0x24')](_0x3ce281['include'],function(_0x70f07f){return{'model':db[_0x70f07f[_0xab0c('0x22')]],'as':_0x70f07f['as'],'attributes':_0x70f07f[_0xab0c('0x23')]};}):[]};}):[]};}):[]:[]})[_0xab0c('0x10')](function(_0x47a239){logger['info']('GetChatQueue',_0x29b873);logger['debug'](_0xab0c('0x25'),_0x29b873,JSON[_0xab0c('0x16')](_0x47a239));_0x36794d(_0x47a239);})[_0xab0c('0x1b')](function(_0x3e6b6e){logger[_0xab0c('0x17')]('GetChatQueue',_0x3e6b6e['message'],_0x29b873);_0x870902(_0x4ad10e[_0xab0c('0x17')](0x1f4,_0x3e6b6e[_0xab0c('0x19')]));});});};exports[_0xab0c('0x26')]=function(_0xe36cea){var _0x2bccdb=this;return new Promise(function(_0x577c31,_0x582536){return db['ChatQueue'][_0xab0c('0x27')]({'raw':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x28')]===undefined?!![]:![]:!![],'where':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x1f')]||null:null,'attributes':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x23')]||null:null,'include':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x21')]?_['map'](_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x21')],function(_0x366ade){return{'model':db[_0x366ade[_0xab0c('0x22')]],'as':_0x366ade['as'],'attributes':_0x366ade[_0xab0c('0x23')],'include':_0x366ade['include']?_['map'](_0x366ade['include'],function(_0x4c5f21){return{'model':db[_0x4c5f21[_0xab0c('0x22')]],'as':_0x4c5f21['as'],'attributes':_0x4c5f21['attributes'],'include':_0x4c5f21['include']?_[_0xab0c('0x24')](_0x4c5f21[_0xab0c('0x21')],function(_0xd1a5fb){return{'model':db[_0xd1a5fb[_0xab0c('0x22')]],'as':_0xd1a5fb['as'],'attributes':_0xd1a5fb['attributes']};}):[]};}):[]};}):[]:[]})[_0xab0c('0x10')](function(_0x16048c){logger[_0xab0c('0x11')](_0xab0c('0x26'),_0xe36cea);logger['debug'](_0xab0c('0x26'),_0xe36cea,JSON[_0xab0c('0x16')](_0x16048c));_0x577c31(_0x16048c);})[_0xab0c('0x1b')](function(_0x2dbd55){logger[_0xab0c('0x17')](_0xab0c('0x26'),_0x2dbd55[_0xab0c('0x19')],_0xe36cea);_0x582536(_0x2bccdb['error'](0x1f4,_0x2dbd55[_0xab0c('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index d08ecae..5ffc352 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 _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
+var _0x5f2f=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x28ad8b,_0x47975a){var _0x30d0b9=function(_0xa859a5){while(--_0xa859a5){_0x28ad8b['push'](_0x28ad8b['shift']());}};_0x30d0b9(++_0x47975a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x42817d,_0x17482f){_0x42817d=_0x42817d-0x0;var _0x2edeb1=_0x5f2f[_0x42817d];return _0x2edeb1;};'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
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 1742462..e5d53a8 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 _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
+var _0x99a1=['getTeams','/:id/users','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','/describe','describe','/:id','isAuthenticated','show','getMembers','/:id/teams'];(function(_0x3f2375,_0x592da7){var _0x540804=function(_0x3890cb){while(--_0x3890cb){_0x3f2375['push'](_0x3f2375['shift']());}};_0x540804(++_0x592da7);}(_0x99a1,0xd0));var _0x199a=function(_0x530f66,_0xc43240){_0x530f66=_0x530f66-0x0;var _0x3c576d=_0x99a1[_0x530f66];return _0x3c576d;};'use strict';var multer=require('multer');var util=require(_0x199a('0x0'));var path=require(_0x199a('0x1'));var timeout=require(_0x199a('0x2'));var express=require(_0x199a('0x3'));var router=express[_0x199a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x199a('0x5'));var config=require(_0x199a('0x6'));var controller=require(_0x199a('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x199a('0x8')](_0x199a('0x9'),auth['isAuthenticated'](),controller[_0x199a('0xa')]);router[_0x199a('0x8')](_0x199a('0xb'),auth[_0x199a('0xc')](),controller[_0x199a('0xd')]);router[_0x199a('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0x199a('0xe')]);router['get'](_0x199a('0xf'),auth[_0x199a('0xc')](),controller[_0x199a('0x10')]);router[_0x199a('0x8')](_0x199a('0x11'),auth[_0x199a('0xc')](),controller['getAgents']);router[_0x199a('0x12')]('/',auth[_0x199a('0xc')](),controller['create']);router[_0x199a('0x12')]('/:id/teams',auth[_0x199a('0xc')](),controller[_0x199a('0x13')]);router[_0x199a('0x12')](_0x199a('0x11'),auth['isAuthenticated'](),controller[_0x199a('0x14')]);router[_0x199a('0x15')]('/:id',auth[_0x199a('0xc')](),controller[_0x199a('0x16')]);router[_0x199a('0x17')](_0x199a('0xb'),auth[_0x199a('0xc')](),controller[_0x199a('0x18')]);router[_0x199a('0x17')](_0x199a('0xf'),auth['isAuthenticated'](),controller[_0x199a('0x19')]);router[_0x199a('0x17')](_0x199a('0x11'),auth[_0x199a('0xc')](),controller[_0x199a('0x1a')]);module[_0x199a('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 9755047..540661f 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 _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
+var _0xe59e=['STRING','DATE'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xe59e,0xd4));var _0xee59=function(_0x1c6208,_0x3e79a2){_0x1c6208=_0x1c6208-0x0;var _0xe996a3=_0xe59e[_0x1c6208];return _0xe996a3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xee59('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0xee59('0x0')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xee59('0x1')]},'acceptAt':{'type':Sequelize[_0xee59('0x1')]},'exitAt':{'type':Sequelize[_0xee59('0x1')]},'reason':{'type':Sequelize[_0xee59('0x0')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 9a1d19b..24cb3c9 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 _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
+var _0xb7e7=['desk.js','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','destroy','end','name','send','index','ChatQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','create','body','describe','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','jsforce'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xb7e7[_0x3ea913];return _0x2b4f28;};'use strict';var pdf=require(_0x7b7e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7b7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b7e('0x2'));var rp=require('request-promise');var moment=require(_0x7b7e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7b7e('0x4'));var util=require(_0x7b7e('0x5'));var path=require(_0x7b7e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b7e('0x7'));var fs=require('fs');var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var db=require(_0x7b7e('0x17'))['db'];function respondWithStatusCode(_0x55620b,_0xaadda){_0xaadda=_0xaadda||0xcc;return function(_0x54d8ce){if(_0x54d8ce){return _0x55620b[_0x7b7e('0x18')](_0xaadda);}return _0x55620b[_0x7b7e('0x19')](_0xaadda)['end']();};}function respondWithResult(_0x422d3a,_0x5976ac){_0x5976ac=_0x5976ac||0xc8;return function(_0x4c6011){if(_0x4c6011){return _0x422d3a[_0x7b7e('0x19')](_0x5976ac)[_0x7b7e('0x1a')](_0x4c6011);}};}function respondWithFilteredResult(_0xf067da,_0x457ec5){return function(_0x3d2fb2){if(_0x3d2fb2){var _0x5703fd=_0x3d2fb2[_0x7b7e('0x1b')],_0x51baf6=_0x457ec5[_0x7b7e('0x1c')],_0xc7f087=_0x457ec5[_0x7b7e('0x1c')]+_0x457ec5[_0x7b7e('0x1d')],_0x36444d;if(_0xc7f087>=_0x5703fd){_0xc7f087=_0x5703fd;_0x36444d=0xc8;}else{_0x36444d=0xce;}_0xf067da[_0x7b7e('0x19')](_0x36444d);return _0xf067da[_0x7b7e('0x1e')](_0x7b7e('0x1f'),_0x51baf6+'-'+_0xc7f087+'/'+_0x5703fd)[_0x7b7e('0x1a')](_0x3d2fb2);}return null;};}function patchUpdates(_0x12e8e9){return function(_0x14f4fe){try{jsonpatch[_0x7b7e('0x20')](_0x14f4fe,_0x12e8e9,!![]);}catch(_0x3bec7d){return BPromise[_0x7b7e('0x21')](_0x3bec7d);}return _0x14f4fe[_0x7b7e('0x22')]();};}function saveUpdates(_0x3a7b8b,_0x49eddb){return function(_0x69262b){if(_0x69262b){return _0x69262b[_0x7b7e('0x23')](_0x3a7b8b)[_0x7b7e('0x24')](function(_0x4c0647){return _0x4c0647;});}return null;};}function removeEntity(_0x313122,_0xbf0cb3){return function(_0x14243b){if(_0x14243b){return _0x14243b[_0x7b7e('0x25')]()[_0x7b7e('0x24')](function(){_0x313122[_0x7b7e('0x19')](0xcc)[_0x7b7e('0x26')]();});}};}function handleEntityNotFound(_0x10a66a,_0x53bbb3){return function(_0x5d6215){if(!_0x5d6215){_0x10a66a['sendStatus'](0x194);}return _0x5d6215;};}function handleError(_0x26ee14,_0x22598e){_0x22598e=_0x22598e||0x1f4;return function(_0x23bfa3){logger['error'](_0x23bfa3['stack']);if(_0x23bfa3['name']){delete _0x23bfa3[_0x7b7e('0x27')];}_0x26ee14[_0x7b7e('0x19')](_0x22598e)[_0x7b7e('0x28')](_0x23bfa3);};}exports[_0x7b7e('0x29')]=function(_0x3ceaf5,_0x48fad1){var _0x6a1e71={},_0x21a15={},_0x4c46b8={'count':0x0,'rows':[]};var _0x57b9da=_['map'](db[_0x7b7e('0x2a')][_0x7b7e('0x2b')],function(_0x503625){return{'name':_0x503625[_0x7b7e('0x2c')],'type':_0x503625['type'][_0x7b7e('0x2d')]};});_0x21a15[_0x7b7e('0x2e')]=_[_0x7b7e('0x2f')](_0x57b9da,'name');_0x21a15[_0x7b7e('0x30')]=_[_0x7b7e('0x31')](_0x3ceaf5[_0x7b7e('0x30')]);_0x21a15[_0x7b7e('0x32')]=_[_0x7b7e('0x33')](_0x21a15['model'],_0x21a15[_0x7b7e('0x30')]);_0x6a1e71['attributes']=_[_0x7b7e('0x33')](_0x21a15[_0x7b7e('0x2e')],qs[_0x7b7e('0x34')](_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x34')]));_0x6a1e71[_0x7b7e('0x35')]=_0x6a1e71[_0x7b7e('0x35')]['length']?_0x6a1e71['attributes']:_0x21a15[_0x7b7e('0x2e')];if(!_0x3ceaf5[_0x7b7e('0x30')]['hasOwnProperty'](_0x7b7e('0x36'))){_0x6a1e71[_0x7b7e('0x1d')]=qs[_0x7b7e('0x1d')](_0x3ceaf5['query'][_0x7b7e('0x1d')]);_0x6a1e71[_0x7b7e('0x1c')]=qs[_0x7b7e('0x1c')](_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x1c')]);}_0x6a1e71[_0x7b7e('0x37')]=qs[_0x7b7e('0x38')](_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x38')]);_0x6a1e71[_0x7b7e('0x39')]=qs[_0x7b7e('0x32')](_[_0x7b7e('0x3a')](_0x3ceaf5[_0x7b7e('0x30')],_0x21a15[_0x7b7e('0x32')]),_0x57b9da);if(_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x3b')]){_0x6a1e71['where']=_[_0x7b7e('0x3c')](_0x6a1e71[_0x7b7e('0x39')],{'$or':_[_0x7b7e('0x2f')](_0x57b9da,function(_0x242609){if(_0x242609[_0x7b7e('0x3d')]!==_0x7b7e('0x3e')){var _0x7f15={};_0x7f15[_0x242609[_0x7b7e('0x27')]]={'$like':'%'+_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x3b')]+'%'};return _0x7f15;}})});}_0x6a1e71=_['merge']({},_0x6a1e71,_0x3ceaf5[_0x7b7e('0x3f')]);var _0x1fa75b={'where':_0x6a1e71[_0x7b7e('0x39')]};return db[_0x7b7e('0x2a')]['count'](_0x1fa75b)[_0x7b7e('0x24')](function(_0x35b31a){_0x4c46b8[_0x7b7e('0x1b')]=_0x35b31a;if(_0x3ceaf5['query']['includeAll']){_0x6a1e71[_0x7b7e('0x40')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x7b7e('0x41')](_0x6a1e71);})[_0x7b7e('0x24')](function(_0x4de331){_0x4c46b8[_0x7b7e('0x42')]=_0x4de331;return _0x4c46b8;})[_0x7b7e('0x24')](respondWithFilteredResult(_0x48fad1,_0x6a1e71))[_0x7b7e('0x43')](handleError(_0x48fad1,null));};exports[_0x7b7e('0x44')]=function(_0x38d32f,_0x435de5){var _0xc888e4={'raw':!![],'where':{'id':_0x38d32f[_0x7b7e('0x45')]['id']}},_0x1d9bb9={};_0x1d9bb9['model']=_['keys'](db[_0x7b7e('0x2a')]['rawAttributes']);_0x1d9bb9[_0x7b7e('0x30')]=_['keys'](_0x38d32f['query']);_0x1d9bb9[_0x7b7e('0x32')]=_['intersection'](_0x1d9bb9[_0x7b7e('0x2e')],_0x1d9bb9['query']);_0xc888e4[_0x7b7e('0x35')]=_[_0x7b7e('0x33')](_0x1d9bb9[_0x7b7e('0x2e')],qs[_0x7b7e('0x34')](_0x38d32f['query'][_0x7b7e('0x34')]));_0xc888e4[_0x7b7e('0x35')]=_0xc888e4[_0x7b7e('0x35')][_0x7b7e('0x46')]?_0xc888e4[_0x7b7e('0x35')]:_0x1d9bb9[_0x7b7e('0x2e')];if(_0x38d32f['query']['includeAll']){_0xc888e4['include']=[{'all':!![]}];}_0xc888e4=_[_0x7b7e('0x3c')]({},_0xc888e4,_0x38d32f[_0x7b7e('0x3f')]);return db[_0x7b7e('0x2a')][_0x7b7e('0x47')](_0xc888e4)[_0x7b7e('0x24')](handleEntityNotFound(_0x435de5,null))[_0x7b7e('0x24')](respondWithResult(_0x435de5,null))['catch'](handleError(_0x435de5,null));};exports[_0x7b7e('0x48')]=function(_0x42e560,_0x5a0832){return db['ChatQueueReport'][_0x7b7e('0x48')](_0x42e560[_0x7b7e('0x49')],{})[_0x7b7e('0x24')](respondWithResult(_0x5a0832,0xc9))[_0x7b7e('0x43')](handleError(_0x5a0832,null));};exports[_0x7b7e('0x23')]=function(_0xb46776,_0x590154){if(_0xb46776[_0x7b7e('0x49')]['id']){delete _0xb46776['body']['id'];}return db[_0x7b7e('0x2a')][_0x7b7e('0x47')]({'where':{'id':_0xb46776[_0x7b7e('0x45')]['id']}})[_0x7b7e('0x24')](handleEntityNotFound(_0x590154,null))['then'](saveUpdates(_0xb46776[_0x7b7e('0x49')],null))[_0x7b7e('0x24')](respondWithResult(_0x590154,null))[_0x7b7e('0x43')](handleError(_0x590154,null));};exports[_0x7b7e('0x25')]=function(_0x1f9d0f,_0x5cce7c){return db[_0x7b7e('0x2a')][_0x7b7e('0x47')]({'where':{'id':_0x1f9d0f[_0x7b7e('0x45')]['id']}})[_0x7b7e('0x24')](handleEntityNotFound(_0x5cce7c,null))[_0x7b7e('0x24')](removeEntity(_0x5cce7c,null))['catch'](handleError(_0x5cce7c,null));};exports[_0x7b7e('0x4a')]=function(_0x29024e,_0x46d4ee){return db[_0x7b7e('0x2a')][_0x7b7e('0x4a')]()[_0x7b7e('0x24')](respondWithResult(_0x46d4ee,null))[_0x7b7e('0x43')](handleError(_0x46d4ee,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index e270026..b36a7df 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 _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
+var _0x99ed=['bluebird','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash','util'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x99ed,0xa3));var _0xd99e=function(_0x3c3a4d,_0x309438){_0x3c3a4d=_0x3c3a4d-0x0;var _0x251598=_0x99ed[_0x3c3a4d];return _0x251598;};'use strict';var _=require(_0xd99e('0x0'));var util=require(_0xd99e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd99e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd99e('0x3'));var rimraf=require(_0xd99e('0x4'));var config=require(_0xd99e('0x5'));var attributes=require(_0xd99e('0x6'));module[_0xd99e('0x7')]=function(_0xde7d4c,_0x225b08){return _0xde7d4c[_0xd99e('0x8')]('ChatQueueReport',attributes,{'tableName':_0xd99e('0x9'),'paranoid':![],'indexes':[{'name':_0xd99e('0xa'),'fields':[_0xd99e('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 56bc70d..da9df1a 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 _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
+var _0x15da=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','debug','UpdateChatQueueReport','where','limit','util'];(function(_0x351705,_0x3a916d){var _0xf1e79c=function(_0xa2e7fc){while(--_0xa2e7fc){_0x351705['push'](_0x351705['shift']());}};_0xf1e79c(++_0x3a916d);}(_0x15da,0xd8));var _0xa15d=function(_0xa72e3a,_0x4d3bd1){_0xa72e3a=_0xa72e3a-0x0;var _0x41cff3=_0x15da[_0xa72e3a];return _0x41cff3;};'use strict';var _=require('lodash');var util=require(_0xa15d('0x0'));var moment=require(_0xa15d('0x1'));var BPromise=require(_0xa15d('0x2'));var rs=require(_0xa15d('0x3'));var fs=require('fs');var Redis=require(_0xa15d('0x4'));var db=require(_0xa15d('0x5'))['db'];var utils=require(_0xa15d('0x6'));var logger=require(_0xa15d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa15d('0x8'));var client=jayson[_0xa15d('0x9')][_0xa15d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ce297,_0x1cbcc3,_0x2a0e82){return new BPromise(function(_0x3d6d10,_0x5dc97f){return client['request'](_0x1ce297,_0x2a0e82)[_0xa15d('0xb')](function(_0x42ff2e){logger[_0xa15d('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x1cbcc3,_0xa15d('0xd'));logger['debug'](_0xa15d('0xe'),_0x1cbcc3,_0xa15d('0xd'),JSON[_0xa15d('0xf')](_0x42ff2e));if(_0x42ff2e[_0xa15d('0x10')]){if(_0x42ff2e['error']['code']===0x1f4){logger[_0xa15d('0x10')](_0xa15d('0x11'),_0x1cbcc3,_0x42ff2e[_0xa15d('0x10')]['message']);return _0x5dc97f(_0x42ff2e[_0xa15d('0x10')][_0xa15d('0x12')]);}logger['error'](_0xa15d('0x11'),_0x1cbcc3,_0x42ff2e[_0xa15d('0x10')][_0xa15d('0x12')]);return _0x3d6d10(_0x42ff2e[_0xa15d('0x10')]['message']);}else{logger[_0xa15d('0xc')](_0xa15d('0x11'),_0x1cbcc3,_0xa15d('0xd'));_0x3d6d10(_0x42ff2e[_0xa15d('0x13')][_0xa15d('0x12')]);}})[_0xa15d('0x14')](function(_0x44cabd){logger[_0xa15d('0x10')](_0xa15d('0x11'),_0x1cbcc3,_0x44cabd);_0x5dc97f(_0x44cabd);});});}exports['CreateChatQueueReport']=function(_0xd2a3f9){var _0x45b3bf=this;return new Promise(function(_0x40b199,_0x333eb3){return db[_0xa15d('0x15')][_0xa15d('0x16')](_0xd2a3f9[_0xa15d('0x17')],{'raw':_0xd2a3f9[_0xa15d('0x18')]?_0xd2a3f9[_0xa15d('0x18')][_0xa15d('0x19')]===undefined?!![]:![]:!![]})[_0xa15d('0xb')](function(_0x47929a){logger[_0xa15d('0xc')](_0xa15d('0x1a'),_0xd2a3f9);logger[_0xa15d('0x1b')](_0xa15d('0x1a'),_0xd2a3f9,JSON[_0xa15d('0xf')](_0x47929a));_0x40b199(_0x47929a);})[_0xa15d('0x14')](function(_0x4e8d4c){logger[_0xa15d('0x10')]('CreateChatQueueReport',_0x4e8d4c[_0xa15d('0x12')],_0xd2a3f9);_0x333eb3(_0x45b3bf[_0xa15d('0x10')](0x1f4,_0x4e8d4c[_0xa15d('0x12')]));});});};exports[_0xa15d('0x1c')]=function(_0x540dad){var _0x48d008=this;return new Promise(function(_0xda6b7d,_0x3af16f){return db[_0xa15d('0x15')]['update'](_0x540dad[_0xa15d('0x17')],{'raw':_0x540dad[_0xa15d('0x18')]?_0x540dad['options'][_0xa15d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x540dad[_0xa15d('0x18')]?_0x540dad[_0xa15d('0x18')][_0xa15d('0x1d')]||null:null,'attributes':_0x540dad[_0xa15d('0x18')]?_0x540dad[_0xa15d('0x18')]['attributes']||null:null,'limit':_0x540dad[_0xa15d('0x18')]?_0x540dad[_0xa15d('0x18')][_0xa15d('0x1e')]||null:null})[_0xa15d('0xb')](function(_0x5079ab){logger[_0xa15d('0xc')](_0xa15d('0x1c'),_0x540dad);logger['debug'](_0xa15d('0x1c'),_0x540dad,JSON['stringify'](_0x5079ab));_0xda6b7d(_0x5079ab);})[_0xa15d('0x14')](function(_0x3df8fb){logger[_0xa15d('0x10')](_0xa15d('0x1c'),_0x3df8fb[_0xa15d('0x12')],_0x540dad);_0x3af16f(_0x48d008[_0xa15d('0x10')](0x1f4,_0x3df8fb[_0xa15d('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index c706cb0..d336760 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 _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
+var _0xb0e5=['path','express','../../components/auth/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x537dd7,_0x39dc6b){var _0x36ab74=function(_0x486e72){while(--_0x486e72){_0x537dd7['push'](_0x537dd7['shift']());}};_0x36ab74(++_0x39dc6b);}(_0xb0e5,0x71));var _0x5b0e=function(_0x4e7162,_0x318933){_0x4e7162=_0x4e7162-0x0;var _0x26030f=_0xb0e5[_0x4e7162];return _0x26030f;};'use strict';var multer=require('multer');var util=require(_0x5b0e('0x0'));var path=require(_0x5b0e('0x1'));var timeout=require('connect-timeout');var express=require(_0x5b0e('0x2'));var router=express['Router']();var auth=require(_0x5b0e('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5b0e('0x4'));router[_0x5b0e('0x5')]('/',auth[_0x5b0e('0x6')](),controller[_0x5b0e('0x7')]);router[_0x5b0e('0x5')](_0x5b0e('0x8'),auth[_0x5b0e('0x6')](),controller[_0x5b0e('0x9')]);router[_0x5b0e('0x5')](_0x5b0e('0xa'),auth[_0x5b0e('0x6')](),controller[_0x5b0e('0xb')]);router[_0x5b0e('0xc')]('/',auth[_0x5b0e('0x6')](),controller[_0x5b0e('0xd')]);router[_0x5b0e('0xe')](_0x5b0e('0xa'),auth[_0x5b0e('0x6')](),controller[_0x5b0e('0xf')]);router[_0x5b0e('0x10')]('/:id',auth[_0x5b0e('0x6')](),controller[_0x5b0e('0x11')]);module[_0x5b0e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 78846f7..e15e0c8 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 _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
+var _0x647b=['DATE','NOW','moment','sequelize','exports','STRING','ENUM','account','agent','queue'];(function(_0x5e2ca6,_0x17a84b){var _0x2f03df=function(_0x31210d){while(--_0x31210d){_0x5e2ca6['push'](_0x5e2ca6['shift']());}};_0x2f03df(++_0x17a84b);}(_0x647b,0xac));var _0xb647=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x647b[_0x18ab2a];return _0x16dcee;};'use strict';var moment=require(_0xb647('0x0'));var Sequelize=require(_0xb647('0x1'));module[_0xb647('0x2')]={'uniqueid':{'type':Sequelize[_0xb647('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb647('0x4')](_0xb647('0x5'),_0xb647('0x6'),_0xb647('0x7')),'allowNull':![],'defaultValue':_0xb647('0x7')},'transferredAt':{'type':Sequelize[_0xb647('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xb647('0x9')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 98749f6..74b62d4 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 _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
+var _0x9d89=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus','status','end','count','offset','set','apply','reject','destroy','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','options','then','includeAll','include','catch','params','keys','length','find','create','body','update','describe','eml-format'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0x9d89,0x1d4));var _0x99d8=function(_0x5f0785,_0x58495b){_0x5f0785=_0x5f0785-0x0;var _0xa46050=_0x9d89[_0x5f0785];return _0xa46050;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x99d8('0x0'));var rimraf=require(_0x99d8('0x1'));var zipdir=require(_0x99d8('0x2'));var jsonpatch=require(_0x99d8('0x3'));var rp=require('request-promise');var moment=require(_0x99d8('0x4'));var BPromise=require(_0x99d8('0x5'));var Mustache=require(_0x99d8('0x6'));var util=require(_0x99d8('0x7'));var path=require('path');var sox=require(_0x99d8('0x8'));var csv=require(_0x99d8('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x99d8('0xa'));var squel=require(_0x99d8('0xb'));var crypto=require(_0x99d8('0xc'));var jsforce=require(_0x99d8('0xd'));var deskjs=require(_0x99d8('0xe'));var toCsv=require(_0x99d8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99d8('0xf'));var authService=require(_0x99d8('0x10'));var qs=require(_0x99d8('0x11'));var as=require(_0x99d8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x99d8('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x99d8('0x14'))['db'];function respondWithStatusCode(_0x217bff,_0x2dc63d){_0x2dc63d=_0x2dc63d||0xcc;return function(_0x25070a){if(_0x25070a){return _0x217bff[_0x99d8('0x15')](_0x2dc63d);}return _0x217bff[_0x99d8('0x16')](_0x2dc63d)[_0x99d8('0x17')]();};}function respondWithResult(_0x259ace,_0x1c8695){_0x1c8695=_0x1c8695||0xc8;return function(_0x279533){if(_0x279533){return _0x259ace[_0x99d8('0x16')](_0x1c8695)['json'](_0x279533);}};}function respondWithFilteredResult(_0x14967c,_0x3c8799){return function(_0x2ce595){if(_0x2ce595){var _0x3fe294=_0x2ce595[_0x99d8('0x18')],_0x51e892=_0x3c8799[_0x99d8('0x19')],_0x25eee0=_0x3c8799['offset']+_0x3c8799['limit'],_0x470979;if(_0x25eee0>=_0x3fe294){_0x25eee0=_0x3fe294;_0x470979=0xc8;}else{_0x470979=0xce;}_0x14967c[_0x99d8('0x16')](_0x470979);return _0x14967c[_0x99d8('0x1a')]('Content-Range',_0x51e892+'-'+_0x25eee0+'/'+_0x3fe294)['json'](_0x2ce595);}return null;};}function patchUpdates(_0x13e72e){return function(_0x34be3f){try{jsonpatch[_0x99d8('0x1b')](_0x34be3f,_0x13e72e,!![]);}catch(_0x187a13){return BPromise[_0x99d8('0x1c')](_0x187a13);}return _0x34be3f['save']();};}function saveUpdates(_0xbde9b7,_0x3d88e7){return function(_0x2c7412){if(_0x2c7412){return _0x2c7412['update'](_0xbde9b7)['then'](function(_0x1c2521){return _0x1c2521;});}return null;};}function removeEntity(_0x503798,_0x419a98){return function(_0x4457ba){if(_0x4457ba){return _0x4457ba[_0x99d8('0x1d')]()['then'](function(){_0x503798[_0x99d8('0x16')](0xcc)[_0x99d8('0x17')]();});}};}function handleEntityNotFound(_0x4d62ca,_0x34f112){return function(_0x4bbdcb){if(!_0x4bbdcb){_0x4d62ca[_0x99d8('0x15')](0x194);}return _0x4bbdcb;};}function handleError(_0x157681,_0x14b4a6){_0x14b4a6=_0x14b4a6||0x1f4;return function(_0x37f901){logger[_0x99d8('0x1e')](_0x37f901['stack']);if(_0x37f901[_0x99d8('0x1f')]){delete _0x37f901['name'];}_0x157681[_0x99d8('0x16')](_0x14b4a6)[_0x99d8('0x20')](_0x37f901);};}exports[_0x99d8('0x21')]=function(_0x37e956,_0x28f09a){var _0x4b2a4a={},_0x2d9c6c={},_0x3be06a={'count':0x0,'rows':[]};var _0x405003=_[_0x99d8('0x22')](db[_0x99d8('0x23')][_0x99d8('0x24')],function(_0x5c71ae){return{'name':_0x5c71ae[_0x99d8('0x25')],'type':_0x5c71ae[_0x99d8('0x26')][_0x99d8('0x27')]};});_0x2d9c6c[_0x99d8('0x28')]=_['map'](_0x405003,'name');_0x2d9c6c['query']=_['keys'](_0x37e956[_0x99d8('0x29')]);_0x2d9c6c[_0x99d8('0x2a')]=_['intersection'](_0x2d9c6c[_0x99d8('0x28')],_0x2d9c6c[_0x99d8('0x29')]);_0x4b2a4a[_0x99d8('0x2b')]=_[_0x99d8('0x2c')](_0x2d9c6c['model'],qs[_0x99d8('0x2d')](_0x37e956[_0x99d8('0x29')][_0x99d8('0x2d')]));_0x4b2a4a[_0x99d8('0x2b')]=_0x4b2a4a[_0x99d8('0x2b')]['length']?_0x4b2a4a[_0x99d8('0x2b')]:_0x2d9c6c[_0x99d8('0x28')];if(!_0x37e956[_0x99d8('0x29')]['hasOwnProperty'](_0x99d8('0x2e'))){_0x4b2a4a[_0x99d8('0x2f')]=qs['limit'](_0x37e956['query'][_0x99d8('0x2f')]);_0x4b2a4a[_0x99d8('0x19')]=qs['offset'](_0x37e956[_0x99d8('0x29')]['offset']);}_0x4b2a4a[_0x99d8('0x30')]=qs[_0x99d8('0x31')](_0x37e956['query'][_0x99d8('0x31')]);_0x4b2a4a[_0x99d8('0x32')]=qs[_0x99d8('0x2a')](_['pick'](_0x37e956['query'],_0x2d9c6c[_0x99d8('0x2a')]),_0x405003);if(_0x37e956['query'][_0x99d8('0x33')]){_0x4b2a4a[_0x99d8('0x32')]=_['merge'](_0x4b2a4a[_0x99d8('0x32')],{'$or':_[_0x99d8('0x22')](_0x405003,function(_0x3b6e93){if(_0x3b6e93[_0x99d8('0x26')]!==_0x99d8('0x34')){var _0x3a4fad={};_0x3a4fad[_0x3b6e93[_0x99d8('0x1f')]]={'$like':'%'+_0x37e956['query']['filter']+'%'};return _0x3a4fad;}})});}_0x4b2a4a=_[_0x99d8('0x35')]({},_0x4b2a4a,_0x37e956[_0x99d8('0x36')]);var _0x22becb={'where':_0x4b2a4a['where']};return db[_0x99d8('0x23')]['count'](_0x22becb)[_0x99d8('0x37')](function(_0x567f82){_0x3be06a[_0x99d8('0x18')]=_0x567f82;if(_0x37e956['query'][_0x99d8('0x38')]){_0x4b2a4a[_0x99d8('0x39')]=[{'all':!![]}];}return db[_0x99d8('0x23')]['findAll'](_0x4b2a4a);})[_0x99d8('0x37')](function(_0xeacc86){_0x3be06a['rows']=_0xeacc86;return _0x3be06a;})[_0x99d8('0x37')](respondWithFilteredResult(_0x28f09a,_0x4b2a4a))[_0x99d8('0x3a')](handleError(_0x28f09a,null));};exports['show']=function(_0x5aa341,_0x365f4b){var _0x2a45f4={'raw':!![],'where':{'id':_0x5aa341[_0x99d8('0x3b')]['id']}},_0x52883d={};_0x52883d['model']=_[_0x99d8('0x3c')](db[_0x99d8('0x23')][_0x99d8('0x24')]);_0x52883d[_0x99d8('0x29')]=_[_0x99d8('0x3c')](_0x5aa341[_0x99d8('0x29')]);_0x52883d['filters']=_[_0x99d8('0x2c')](_0x52883d[_0x99d8('0x28')],_0x52883d[_0x99d8('0x29')]);_0x2a45f4[_0x99d8('0x2b')]=_['intersection'](_0x52883d['model'],qs['fields'](_0x5aa341['query']['fields']));_0x2a45f4[_0x99d8('0x2b')]=_0x2a45f4[_0x99d8('0x2b')][_0x99d8('0x3d')]?_0x2a45f4[_0x99d8('0x2b')]:_0x52883d[_0x99d8('0x28')];if(_0x5aa341[_0x99d8('0x29')]['includeAll']){_0x2a45f4[_0x99d8('0x39')]=[{'all':!![]}];}_0x2a45f4=_[_0x99d8('0x35')]({},_0x2a45f4,_0x5aa341[_0x99d8('0x36')]);return db['ChatTransferReport'][_0x99d8('0x3e')](_0x2a45f4)[_0x99d8('0x37')](handleEntityNotFound(_0x365f4b,null))[_0x99d8('0x37')](respondWithResult(_0x365f4b,null))[_0x99d8('0x3a')](handleError(_0x365f4b,null));};exports[_0x99d8('0x3f')]=function(_0x1d5cf7,_0x516dd3){return db[_0x99d8('0x23')]['create'](_0x1d5cf7[_0x99d8('0x40')],{})[_0x99d8('0x37')](respondWithResult(_0x516dd3,0xc9))['catch'](handleError(_0x516dd3,null));};exports[_0x99d8('0x41')]=function(_0x5e789f,_0x34836a){if(_0x5e789f[_0x99d8('0x40')]['id']){delete _0x5e789f[_0x99d8('0x40')]['id'];}return db['ChatTransferReport'][_0x99d8('0x3e')]({'where':{'id':_0x5e789f[_0x99d8('0x3b')]['id']}})['then'](handleEntityNotFound(_0x34836a,null))[_0x99d8('0x37')](saveUpdates(_0x5e789f[_0x99d8('0x40')],null))['then'](respondWithResult(_0x34836a,null))['catch'](handleError(_0x34836a,null));};exports[_0x99d8('0x1d')]=function(_0x1d0a33,_0x2d0877){return db[_0x99d8('0x23')][_0x99d8('0x3e')]({'where':{'id':_0x1d0a33[_0x99d8('0x3b')]['id']}})[_0x99d8('0x37')](handleEntityNotFound(_0x2d0877,null))[_0x99d8('0x37')](removeEntity(_0x2d0877,null))[_0x99d8('0x3a')](handleError(_0x2d0877,null));};exports[_0x99d8('0x42')]=function(_0x40416b,_0xf51b05){return db[_0x99d8('0x23')]['describe']()[_0x99d8('0x37')](respondWithResult(_0xf51b05,null))['catch'](handleError(_0xf51b05,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 784da34..90ad686 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 _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
+var _0xa41a=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','report_chat_transfer','uniqueid','lodash'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0xa41a,0x6b));var _0xaa41=function(_0x4a715b,_0x5df303){_0x4a715b=_0x4a715b-0x0;var _0x36a3c2=_0xa41a[_0x4a715b];return _0x36a3c2;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('ChatTransferReport',attributes,{'tableName':_0xaa41('0xa'),'paranoid':![],'indexes':[{'name':_0xaa41('0xb'),'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 fc60db6..d0eb2eb 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 _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
+var _0x8ea9=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','ChatTransferReport,\x20%s,\x20%s'];(function(_0x5ddb67,_0x3beaac){var _0xc01a30=function(_0x5d6291){while(--_0x5d6291){_0x5ddb67['push'](_0x5ddb67['shift']());}};_0xc01a30(++_0x3beaac);}(_0x8ea9,0x112));var _0x98ea=function(_0x1c5876,_0x19aa5c){_0x1c5876=_0x1c5876-0x0;var _0x2b3068=_0x8ea9[_0x1c5876];return _0x2b3068;};'use strict';var _=require(_0x98ea('0x0'));var util=require(_0x98ea('0x1'));var moment=require(_0x98ea('0x2'));var BPromise=require(_0x98ea('0x3'));var rs=require(_0x98ea('0x4'));var fs=require('fs');var Redis=require(_0x98ea('0x5'));var db=require(_0x98ea('0x6'))['db'];var utils=require(_0x98ea('0x7'));var logger=require(_0x98ea('0x8'))(_0x98ea('0x9'));var config=require(_0x98ea('0xa'));var jayson=require(_0x98ea('0xb'));var client=jayson[_0x98ea('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16ef9f,_0x234cf5,_0x3f8761){return new BPromise(function(_0x2f9026,_0x4fa0fc){return client['request'](_0x16ef9f,_0x3f8761)['then'](function(_0x2f2f79){logger['info'](_0x98ea('0xd'),_0x234cf5,'request\x20sent');logger[_0x98ea('0xe')](_0x98ea('0xf'),_0x234cf5,_0x98ea('0x10'),JSON[_0x98ea('0x11')](_0x2f2f79));if(_0x2f2f79[_0x98ea('0x12')]){if(_0x2f2f79[_0x98ea('0x12')][_0x98ea('0x13')]===0x1f4){logger[_0x98ea('0x12')](_0x98ea('0xd'),_0x234cf5,_0x2f2f79[_0x98ea('0x12')]['message']);return _0x4fa0fc(_0x2f2f79[_0x98ea('0x12')]['message']);}logger['error'](_0x98ea('0xd'),_0x234cf5,_0x2f2f79[_0x98ea('0x12')][_0x98ea('0x14')]);return _0x2f9026(_0x2f2f79[_0x98ea('0x12')][_0x98ea('0x14')]);}else{logger[_0x98ea('0x15')](_0x98ea('0xd'),_0x234cf5,_0x98ea('0x10'));_0x2f9026(_0x2f2f79[_0x98ea('0x16')][_0x98ea('0x14')]);}})[_0x98ea('0x17')](function(_0x8eb702){logger['error'](_0x98ea('0xd'),_0x234cf5,_0x8eb702);_0x4fa0fc(_0x8eb702);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 35fb5ac..a9b43d4 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 _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
+var _0xbaf0=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','util','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),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 83747bc..1c2d7fa 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 _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
+var _0xf350=['alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','STRING','address','email','Agent','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','thumb','stringify','input','name','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','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.','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right'];(function(_0x12d034,_0x430f51){var _0x39d6e5=function(_0x579248){while(--_0x579248){_0x12d034['push'](_0x12d034['shift']());}};_0x39d6e5(++_0x430f51);}(_0xf350,0x105));var _0x0f35=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf350[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x0f35('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x0f35('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x0f35('0x1')],'allowNull':![],'unique':_0x0f35('0x2')},'description':{'type':Sequelize[_0x0f35('0x1')]},'mapKey':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':_0x0f35('0x3')},'mapKeyOffline':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x0f35('0x4')},'customerAlias':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x0f35('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0f35('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0f35('0x5')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0f35('0x1')]},'animation':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0f35('0x7')](_0x0f35('0x8'),_0x0f35('0x9')),'defaultValue':_0x0f35('0x8')},'header_online':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':_0x0f35('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x0f35('0xb')},'offline_chat_button':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x0f35('0xc')},'defaultWhiteLabel':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0f35('0xd')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x0f35('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':_0x0f35('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':_0x0f35('0x10')},'noteTitle':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':_0x0f35('0x11')},'placeholderMessage':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':_0x0f35('0x12')},'closingMessage':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':_0x0f35('0x13')},'closingMessageButton':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':_0x0f35('0x14')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x0f35('0x15')},'conditionAgreement':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':_0x0f35('0x16')},'ratingType':{'type':Sequelize[_0x0f35('0x7')](_0x0f35('0x17'),_0x0f35('0x18')),'defaultValue':_0x0f35('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x0f35('0x5')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0f35('0xd')],'defaultValue':function(){return JSON[_0x0f35('0x19')]({'items':[{'type':_0x0f35('0x1a'),'variable':null,'config':{'placeholder':_0x0f35('0x1b'),'type':'text','required':!![]},'props':{'title':_0x0f35('0x1b'),'helpText':''}},{'type':_0x0f35('0x1a'),'props':{'title':_0x0f35('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0f35('0x1c')]('onlineForm')?JSON[_0x0f35('0x1d')](this[_0x0f35('0x1c')](_0x0f35('0x1e'))):{};},'set':function(_0x494140){return this[_0x0f35('0x1f')](_0x0f35('0x1e'),JSON[_0x0f35('0x19')](_0x494140));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x0f35('0x1a'),'props':{'title':_0x0f35('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x0f35('0x3')},'variable':null},{'type':_0x0f35('0x20'),'config':{'placeholder':_0x0f35('0x21')},'props':{'title':_0x0f35('0x21'),'helpText':_0x0f35('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x0f35('0x1c')](_0x0f35('0x23'))?JSON['parse'](this[_0x0f35('0x1c')](_0x0f35('0x23'))):{};},'set':function(_0x5cdf8){return this['setDataValue'](_0x0f35('0x23'),JSON[_0x0f35('0x19')](_0x5cdf8));}},'token':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':function(){return rs[_0x0f35('0x24')]();}},'autoclose':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x0f35('0x1')]},'forwardOffline':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0f35('0x1')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x0f35('0x25')},'waitingMessage':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':_0x0f35('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x0f35('0x27')},'offlineMessageBody':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':_0x0f35('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0f35('0x29')},'skipUnmanaged':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':_0x0f35('0x15')},'sendUnmanaged':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':_0x0f35('0x14')},'enableCustomerAttachment':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0f35('0xd')]},'showAgentAvatar':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0f35('0x1')]},'notificationTemplate':{'type':Sequelize[_0x0f35('0xd')],'defaultValue':function(){return _0x0f35('0x2a');}},'notificationSound':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':_0x0f35('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x0f35('0x2c')},'verticalAlignment':{'type':Sequelize[_0x0f35('0x5')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x0f35('0x2d')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x0f35('0xd')]},'showCustomerAvatar':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0f35('0x5')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0f35('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0f35('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0f35('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':_0x0f35('0x2f')},'systemAvatar':{'type':Sequelize[_0x0f35('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0f35('0x5')],'comment':_0x0f35('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':![],'comment':_0x0f35('0x31'),'set':function(_0x24ed44){if(!_0x24ed44)this[_0x0f35('0x1f')](_0x0f35('0x32'),null);this['setDataValue']('mandatoryDisposition',_0x24ed44);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 8661598..363d695 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 _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
+var _0xb361=['server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','sitepic','join','server/files/images/logos/','download','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','headers','first','x-forwarded-for','split','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','ContactId','interaction','firstName','created','autoclose','push','close','unmanaged','ChatMessage','UserId','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','Start','notify','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','addInteraction','omit','getInteractions','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','utf8','x-real-ip','connection','replace','alignment','verticalAlignment','addApplications','sequelize','transaction','bulkCreate','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','emit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','Sequelize','ValidationError','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','count','offset','set','Content-Range','json','save','then','destroy','ChatWebsites','UserProfileResource','end','name','send','index','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','filter','include','findAll','show','params','mandatoryDispositionPause','keys','length','includeAll','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','rows','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addLogo','file','addAvatar','agentAvatar','addCustomerAvatar','filename','addSystemAvatar','systemAvatar','getLogo','root'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0xb361,0x1c2));var _0x1b36=function(_0x8c95e8,_0x4e195d){_0x8c95e8=_0x8c95e8-0x0;var _0x8c1e0b=_0xb361[_0x8c95e8];return _0x8c1e0b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1b36('0x0'));var rimraf=require(_0x1b36('0x1'));var zipdir=require(_0x1b36('0x2'));var jsonpatch=require(_0x1b36('0x3'));var rp=require('request-promise');var moment=require(_0x1b36('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b36('0x5'));var path=require(_0x1b36('0x6'));var sox=require(_0x1b36('0x7'));var csv=require(_0x1b36('0x8'));var ejs=require(_0x1b36('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1b36('0xa'));var crypto=require(_0x1b36('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1b36('0xc'));var toCsv=require(_0x1b36('0x8'));var querystring=require(_0x1b36('0xd'));var Papa=require(_0x1b36('0xe'));var Redis=require(_0x1b36('0xf'));var authService=require(_0x1b36('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b36('0x11'));var logger=require('../../config/logger')(_0x1b36('0x12'));var utils=require(_0x1b36('0x13'));var config=require('../../config/environment');var db=require(_0x1b36('0x14'))['db'];config[_0x1b36('0x15')]=_[_0x1b36('0x16')](config[_0x1b36('0x15')],{'host':_0x1b36('0x17'),'port':0x18eb});var socket=require(_0x1b36('0x18'))(new Redis(config[_0x1b36('0x15')]));require('./chatWebsite.socket')[_0x1b36('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1b36('0x1a')][_0x1b36('0x1b')]({'port':0x232c});var client9002=jayson[_0x1b36('0x1a')][_0x1b36('0x1b')]({'port':0x232a});var client9003=jayson[_0x1b36('0x1a')][_0x1b36('0x1b')]({'port':0x232b});function checkPasswordPattern(_0x480b3c,_0x2e290d,_0x3cdcc0){if(_0x3cdcc0){var _0x7df18c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x7df18c['test'](_0x2e290d)){return _0x480b3c;}else{throw new db[(_0x1b36('0x1c'))][(_0x1b36('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 _0x480b3c;}}function respondWithRpcPromise(_0x12b414,_0x484d8f,_0x252544,_0x5d36a6){return new BPromise(function(_0x50e954,_0xa2ca88){var _0x3068ed=_0x5d36a6||client;return _0x3068ed[_0x1b36('0x1e')](_0x12b414,_0x252544)['then'](function(_0x3241cf){logger[_0x1b36('0x1f')](_0x1b36('0x20'),_0x484d8f,_0x1b36('0x21'));logger[_0x1b36('0x22')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x484d8f,_0x1b36('0x21'),JSON[_0x1b36('0x23')](_0x3241cf));if(_0x3241cf[_0x1b36('0x24')]){if(_0x3241cf['error']['code']===0x1f4){logger['error'](_0x1b36('0x20'),_0x484d8f,_0x3241cf['error'][_0x1b36('0x25')]);return _0xa2ca88(_0x3241cf['error']['message']);}logger[_0x1b36('0x24')](_0x1b36('0x20'),_0x484d8f,_0x3241cf[_0x1b36('0x24')]['message']);return _0x50e954(_0x3241cf[_0x1b36('0x24')][_0x1b36('0x25')]);}else{logger[_0x1b36('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x484d8f,_0x1b36('0x21'));_0x50e954(_0x3241cf[_0x1b36('0x26')][_0x1b36('0x25')]);}})[_0x1b36('0x27')](function(_0x250c51){logger[_0x1b36('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x484d8f,_0x250c51);_0xa2ca88(_0x250c51);});});}function respondWithStatusCode(_0x21c794,_0x5111d1){_0x5111d1=_0x5111d1||0xcc;return function(_0x16b56c){if(_0x16b56c){return _0x21c794[_0x1b36('0x28')](_0x5111d1);}return _0x21c794[_0x1b36('0x29')](_0x5111d1)['end']();};}function respondWithResult(_0x2c11b8,_0x1d4496){_0x1d4496=_0x1d4496||0xc8;return function(_0x50760c){if(_0x50760c){return _0x2c11b8[_0x1b36('0x29')](_0x1d4496)['json'](_0x50760c);}};}function respondWithFilteredResult(_0x32646,_0x2fd461){return function(_0x872957){if(_0x872957){var _0x35d503=_0x872957[_0x1b36('0x2a')],_0x13ea63=_0x2fd461[_0x1b36('0x2b')],_0x2df3a1=_0x2fd461[_0x1b36('0x2b')]+_0x2fd461['limit'],_0x2db3b2;if(_0x2df3a1>=_0x35d503){_0x2df3a1=_0x35d503;_0x2db3b2=0xc8;}else{_0x2db3b2=0xce;}_0x32646[_0x1b36('0x29')](_0x2db3b2);return _0x32646[_0x1b36('0x2c')](_0x1b36('0x2d'),_0x13ea63+'-'+_0x2df3a1+'/'+_0x35d503)[_0x1b36('0x2e')](_0x872957);}return null;};}function patchUpdates(_0x3b6339){return function(_0x30ea90){try{jsonpatch['apply'](_0x30ea90,_0x3b6339,!![]);}catch(_0x460a28){return BPromise['reject'](_0x460a28);}return _0x30ea90[_0x1b36('0x2f')]();};}function saveUpdates(_0x4e2043,_0x396f9b){return function(_0x3f9bda){if(_0x3f9bda){return _0x3f9bda['update'](_0x4e2043)[_0x1b36('0x30')](function(_0x1657dc){return _0x1657dc;});}return null;};}function removeEntity(_0x4b0b1e,_0x4446bf){return function(_0xd4f2fb){if(_0xd4f2fb){return _0xd4f2fb[_0x1b36('0x31')]()[_0x1b36('0x30')](function(){var _0x191944=_0xd4f2fb['get']({'plain':!![]});var _0x31d083=_0x1b36('0x32');return db[_0x1b36('0x33')][_0x1b36('0x31')]({'where':{'type':_0x31d083,'resourceId':_0x191944['id']}})[_0x1b36('0x30')](function(){return _0xd4f2fb;});})[_0x1b36('0x30')](function(){_0x4b0b1e[_0x1b36('0x29')](0xcc)[_0x1b36('0x34')]();});}};}function handleEntityNotFound(_0x5ca54a,_0x3860c1){return function(_0x2402af){if(!_0x2402af){_0x5ca54a['sendStatus'](0x194);}return _0x2402af;};}function handleError(_0x21b1a0,_0x48c0cf){_0x48c0cf=_0x48c0cf||0x1f4;return function(_0x1731c0){logger[_0x1b36('0x24')](_0x1731c0['stack']);if(_0x1731c0[_0x1b36('0x35')]){delete _0x1731c0[_0x1b36('0x35')];}_0x21b1a0[_0x1b36('0x29')](_0x48c0cf)[_0x1b36('0x36')](_0x1731c0);};}exports[_0x1b36('0x37')]=function(_0x4f0d7e,_0x83020d){var _0x169160={'include':[{'model':db[_0x1b36('0x38')],'as':'mandatoryDispositionPause'}]},_0x362fe0={},_0x8ca7a7={'count':0x0,'rows':[]};var _0x255ffe=_[_0x1b36('0x39')](db[_0x1b36('0x3a')][_0x1b36('0x3b')],function(_0x3a369a){return{'name':_0x3a369a[_0x1b36('0x3c')],'type':_0x3a369a[_0x1b36('0x3d')][_0x1b36('0x3e')]};});_0x362fe0[_0x1b36('0x3f')]=_[_0x1b36('0x39')](_0x255ffe,_0x1b36('0x35'));_0x362fe0[_0x1b36('0x40')]=_['keys'](_0x4f0d7e['query']);_0x362fe0[_0x1b36('0x41')]=_['intersection'](_0x362fe0['model'],_0x362fe0[_0x1b36('0x40')]);_0x169160[_0x1b36('0x42')]=_[_0x1b36('0x43')](_0x362fe0[_0x1b36('0x3f')],qs[_0x1b36('0x44')](_0x4f0d7e[_0x1b36('0x40')][_0x1b36('0x44')]));_0x169160[_0x1b36('0x42')]=_0x169160[_0x1b36('0x42')]['length']?_0x169160[_0x1b36('0x42')]:_0x362fe0[_0x1b36('0x3f')];if(!_0x4f0d7e[_0x1b36('0x40')][_0x1b36('0x45')](_0x1b36('0x46'))){_0x169160['limit']=qs[_0x1b36('0x47')](_0x4f0d7e[_0x1b36('0x40')][_0x1b36('0x47')]);_0x169160[_0x1b36('0x2b')]=qs[_0x1b36('0x2b')](_0x4f0d7e['query'][_0x1b36('0x2b')]);}_0x169160[_0x1b36('0x48')]=qs[_0x1b36('0x49')](_0x4f0d7e[_0x1b36('0x40')][_0x1b36('0x49')]);_0x169160['where']=qs[_0x1b36('0x41')](_[_0x1b36('0x4a')](_0x4f0d7e[_0x1b36('0x40')],_0x362fe0['filters']),_0x255ffe);if(_0x4f0d7e[_0x1b36('0x40')]['filter']){_0x169160[_0x1b36('0x4b')]=_[_0x1b36('0x4c')](_0x169160[_0x1b36('0x4b')],{'$or':_['map'](_0x255ffe,function(_0x2c9f15){if(_0x2c9f15[_0x1b36('0x3d')]!==_0x1b36('0x4d')){var _0x29c977={};_0x29c977[_0x2c9f15['name']]={'$like':'%'+_0x4f0d7e[_0x1b36('0x40')][_0x1b36('0x4e')]+'%'};return _0x29c977;}})});}_0x169160=_[_0x1b36('0x4c')]({},_0x169160,_0x4f0d7e['options']);var _0x32db54={'where':_0x169160['where']};return db[_0x1b36('0x3a')][_0x1b36('0x2a')](_0x32db54)[_0x1b36('0x30')](function(_0xcc98c3){_0x8ca7a7[_0x1b36('0x2a')]=_0xcc98c3;if(_0x4f0d7e[_0x1b36('0x40')]['includeAll']){_0x169160[_0x1b36('0x4f')]=[{'all':!![]}];}return db['ChatWebsite'][_0x1b36('0x50')](_0x169160);})[_0x1b36('0x30')](function(_0xff78fa){_0x8ca7a7['rows']=_0xff78fa;return _0x8ca7a7;})[_0x1b36('0x30')](respondWithFilteredResult(_0x83020d,_0x169160))[_0x1b36('0x27')](handleError(_0x83020d,null));};exports[_0x1b36('0x51')]=function(_0x11ae17,_0x5f03fd){var _0x4358ee={'raw':![],'where':{'id':_0x11ae17[_0x1b36('0x52')]['id']},'include':[{'model':db[_0x1b36('0x38')],'as':_0x1b36('0x53')}]},_0x2976d5={};_0x2976d5[_0x1b36('0x3f')]=_[_0x1b36('0x54')](db[_0x1b36('0x3a')][_0x1b36('0x3b')]);_0x2976d5[_0x1b36('0x40')]=_[_0x1b36('0x54')](_0x11ae17['query']);_0x2976d5[_0x1b36('0x41')]=_[_0x1b36('0x43')](_0x2976d5['model'],_0x2976d5[_0x1b36('0x40')]);_0x4358ee['attributes']=_[_0x1b36('0x43')](_0x2976d5['model'],qs['fields'](_0x11ae17[_0x1b36('0x40')][_0x1b36('0x44')]));_0x4358ee[_0x1b36('0x42')]=_0x4358ee[_0x1b36('0x42')][_0x1b36('0x55')]?_0x4358ee['attributes']:_0x2976d5['model'];if(_0x11ae17[_0x1b36('0x40')][_0x1b36('0x56')]){_0x4358ee[_0x1b36('0x4f')]=[{'all':!![]}];}_0x4358ee=_['merge']({},_0x4358ee,_0x11ae17[_0x1b36('0x57')]);return db[_0x1b36('0x3a')][_0x1b36('0x58')](_0x4358ee)[_0x1b36('0x30')](handleEntityNotFound(_0x5f03fd,null))[_0x1b36('0x30')](respondWithResult(_0x5f03fd,null))['catch'](handleError(_0x5f03fd,null));};exports[_0x1b36('0x59')]=function(_0x3a239,_0x32274c){return db[_0x1b36('0x3a')][_0x1b36('0x59')](_0x3a239[_0x1b36('0x5a')],{})[_0x1b36('0x30')](function(_0x414e19){var _0x358e85=_0x3a239[_0x1b36('0x5b')][_0x1b36('0x5c')]({'plain':!![]});if(!_0x358e85)throw new Error(_0x1b36('0x5d'));if(_0x358e85[_0x1b36('0x5e')]==='user'){var _0x517c89=_0x414e19['get']({'plain':!![]});var _0x869399=_0x1b36('0x32');return db[_0x1b36('0x5f')]['find']({'where':{'name':_0x869399,'userProfileId':_0x358e85['userProfileId']},'raw':!![]})[_0x1b36('0x30')](function(_0x4b992a){if(_0x4b992a&&_0x4b992a[_0x1b36('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x517c89[_0x1b36('0x35')],'resourceId':_0x517c89['id'],'type':_0x4b992a[_0x1b36('0x35')],'sectionId':_0x4b992a['id']},{})[_0x1b36('0x30')](function(){return _0x414e19;});}else{return _0x414e19;}})[_0x1b36('0x27')](function(_0x651dfb){logger[_0x1b36('0x24')](_0x1b36('0x61'),_0x651dfb);throw _0x651dfb;});}return _0x414e19;})[_0x1b36('0x30')](respondWithResult(_0x32274c,0xc9))[_0x1b36('0x27')](handleError(_0x32274c,null));};exports[_0x1b36('0x62')]=function(_0x5cb609,_0x222009){if(_0x5cb609[_0x1b36('0x5a')]['id']){delete _0x5cb609[_0x1b36('0x5a')]['id'];}return db[_0x1b36('0x3a')][_0x1b36('0x58')]({'where':{'id':_0x5cb609[_0x1b36('0x52')]['id']},'include':[{'model':db['Pause'],'as':_0x1b36('0x53')}]})[_0x1b36('0x30')](handleEntityNotFound(_0x222009,null))[_0x1b36('0x30')](saveUpdates(_0x5cb609[_0x1b36('0x5a')],null))[_0x1b36('0x30')](respondWithResult(_0x222009,null))[_0x1b36('0x27')](handleError(_0x222009,null));};exports[_0x1b36('0x31')]=function(_0x11ca41,_0x22fc57){return db[_0x1b36('0x3a')][_0x1b36('0x58')]({'where':{'id':_0x11ca41[_0x1b36('0x52')]['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0x22fc57,null))[_0x1b36('0x30')](removeEntity(_0x22fc57,null))[_0x1b36('0x27')](handleError(_0x22fc57,null));};exports['describe']=function(_0x40ed8e,_0x1311ff){return db[_0x1b36('0x3a')][_0x1b36('0x63')]()['then'](respondWithResult(_0x1311ff,null))[_0x1b36('0x27')](handleError(_0x1311ff,null));};exports[_0x1b36('0x64')]=function(_0x5713b7,_0x44fbea,_0xb985ec){if(_0x5713b7[_0x1b36('0x5a')]['id']){delete _0x5713b7['body']['id'];}return db[_0x1b36('0x3a')][_0x1b36('0x58')]({'where':{'id':_0x5713b7[_0x1b36('0x52')]['id']}})['then'](handleEntityNotFound(_0x44fbea,null))[_0x1b36('0x30')](function(_0x1ecb04){if(_0x1ecb04){_0x5713b7[_0x1b36('0x5a')][_0x1b36('0x65')]=_0x1ecb04['id'];return db[_0x1b36('0x66')][_0x1b36('0x59')](_0x5713b7['body']);}})[_0x1b36('0x30')](respondWithResult(_0x44fbea,null))[_0x1b36('0x27')](handleError(_0x44fbea,null));};exports[_0x1b36('0x67')]=function(_0x45189e,_0x4e2b7a,_0xcdd5f){var _0x4d3d41={'raw':![],'where':{}};var _0x362f9b={};var _0x3308d8={'count':0x0,'rows':[]};return db[_0x1b36('0x3a')]['findOne']({'where':{'id':_0x45189e['params']['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0x4e2b7a,null))[_0x1b36('0x30')](function(_0x197154){if(_0x197154){_0x362f9b[_0x1b36('0x3f')]=_[_0x1b36('0x54')](db[_0x1b36('0x66')][_0x1b36('0x3b')]);_0x362f9b[_0x1b36('0x40')]=_[_0x1b36('0x54')](_0x45189e['query']);_0x362f9b[_0x1b36('0x41')]=_[_0x1b36('0x43')](_0x362f9b['model'],_0x362f9b[_0x1b36('0x40')]);_0x4d3d41['attributes']=_[_0x1b36('0x43')](_0x362f9b[_0x1b36('0x3f')],qs['fields'](_0x45189e['query'][_0x1b36('0x44')]));_0x4d3d41['attributes']=_0x4d3d41[_0x1b36('0x42')][_0x1b36('0x55')]?_0x4d3d41[_0x1b36('0x42')]:_0x362f9b['model'];if(!_0x45189e[_0x1b36('0x40')][_0x1b36('0x45')](_0x1b36('0x46'))){_0x4d3d41['limit']=qs[_0x1b36('0x47')](_0x45189e['query']['limit']);_0x4d3d41[_0x1b36('0x2b')]=qs['offset'](_0x45189e[_0x1b36('0x40')][_0x1b36('0x2b')]);}_0x4d3d41['order']=qs['sort'](_0x45189e['query'][_0x1b36('0x49')]);_0x4d3d41[_0x1b36('0x4b')]=qs['filters'](_[_0x1b36('0x4a')](_0x45189e['query'],_0x362f9b[_0x1b36('0x41')]));_0x4d3d41[_0x1b36('0x4b')]['ChatWebsiteId']=_0x197154['id'];if(_0x45189e['query'][_0x1b36('0x4e')]){_0x4d3d41[_0x1b36('0x4b')]=_[_0x1b36('0x4c')](_0x4d3d41['where'],{'$or':_[_0x1b36('0x39')](_0x4d3d41['attributes'],function(_0x1a616e){var _0x3b6906={};_0x3b6906[_0x1a616e]={'$like':'%'+_0x45189e['query']['filter']+'%'};return _0x3b6906;})});}_0x4d3d41=_[_0x1b36('0x4c')]({},_0x4d3d41,_0x45189e[_0x1b36('0x57')]);return db[_0x1b36('0x66')][_0x1b36('0x2a')]({'where':_0x4d3d41['where']})[_0x1b36('0x30')](function(_0x212a56){_0x3308d8[_0x1b36('0x2a')]=_0x212a56;if(_0x45189e[_0x1b36('0x40')]['includeAll']){_0x4d3d41[_0x1b36('0x4f')]=[{'all':!![]}];}return db[_0x1b36('0x66')][_0x1b36('0x50')](_0x4d3d41);})[_0x1b36('0x30')](function(_0x5d1ba8){_0x3308d8[_0x1b36('0x68')]=_0x5d1ba8;return _0x3308d8;});}})['then'](respondWithFilteredResult(_0x4e2b7a,_0x4d3d41))[_0x1b36('0x27')](handleError(_0x4e2b7a,null));};exports['removeDispositions']=function(_0x4bb2a5,_0x3d2896,_0xe75df){return db['ChatWebsite'][_0x1b36('0x58')]({'where':{'id':_0x4bb2a5[_0x1b36('0x52')]['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0x3d2896,null))[_0x1b36('0x30')](function(_0x1aa4bc){if(_0x1aa4bc){return _0x1aa4bc[_0x1b36('0x69')](_0x4bb2a5[_0x1b36('0x40')][_0x1b36('0x6a')]);}})[_0x1b36('0x30')](respondWithStatusCode(_0x3d2896,null))[_0x1b36('0x27')](handleError(_0x3d2896,null));};exports[_0x1b36('0x6b')]=function(_0x827fcf,_0x1af400,_0x1f21e6){if(_0x827fcf['body']['id']){delete _0x827fcf['body']['id'];}return db[_0x1b36('0x3a')]['find']({'where':{'id':_0x827fcf[_0x1b36('0x52')]['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0x1af400,null))[_0x1b36('0x30')](function(_0x56f26d){if(_0x56f26d){_0x827fcf[_0x1b36('0x5a')][_0x1b36('0x65')]=_0x56f26d['id'];return db['CannedAnswer']['create'](_0x827fcf[_0x1b36('0x5a')]);}})[_0x1b36('0x30')](respondWithResult(_0x1af400,null))[_0x1b36('0x27')](handleError(_0x1af400,null));};exports[_0x1b36('0x6c')]=function(_0x4c60de,_0x12ad71,_0xcd4527){var _0x59aceb={'raw':![],'where':{}};var _0x3f88c9={};var _0x2cb41e={'count':0x0,'rows':[]};return db[_0x1b36('0x3a')][_0x1b36('0x6d')]({'where':{'id':_0x4c60de['params']['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0x12ad71,null))[_0x1b36('0x30')](function(_0x2a71a0){if(_0x2a71a0){_0x3f88c9[_0x1b36('0x3f')]=_[_0x1b36('0x54')](db['CannedAnswer'][_0x1b36('0x3b')]);_0x3f88c9[_0x1b36('0x40')]=_[_0x1b36('0x54')](_0x4c60de['query']);_0x3f88c9['filters']=_['intersection'](_0x3f88c9[_0x1b36('0x3f')],_0x3f88c9[_0x1b36('0x40')]);_0x59aceb[_0x1b36('0x42')]=_[_0x1b36('0x43')](_0x3f88c9[_0x1b36('0x3f')],qs[_0x1b36('0x44')](_0x4c60de[_0x1b36('0x40')][_0x1b36('0x44')]));_0x59aceb['attributes']=_0x59aceb[_0x1b36('0x42')][_0x1b36('0x55')]?_0x59aceb[_0x1b36('0x42')]:_0x3f88c9[_0x1b36('0x3f')];if(!_0x4c60de[_0x1b36('0x40')][_0x1b36('0x45')]('nolimit')){_0x59aceb[_0x1b36('0x47')]=qs[_0x1b36('0x47')](_0x4c60de[_0x1b36('0x40')][_0x1b36('0x47')]);_0x59aceb[_0x1b36('0x2b')]=qs[_0x1b36('0x2b')](_0x4c60de[_0x1b36('0x40')][_0x1b36('0x2b')]);}_0x59aceb[_0x1b36('0x48')]=qs[_0x1b36('0x49')](_0x4c60de[_0x1b36('0x40')][_0x1b36('0x49')]);_0x59aceb[_0x1b36('0x4b')]=qs[_0x1b36('0x41')](_[_0x1b36('0x4a')](_0x4c60de['query'],_0x3f88c9[_0x1b36('0x41')]));_0x59aceb[_0x1b36('0x4b')]['ChatWebsiteId']=_0x2a71a0['id'];if(_0x4c60de[_0x1b36('0x40')][_0x1b36('0x4e')]){_0x59aceb['where']=_['merge'](_0x59aceb[_0x1b36('0x4b')],{'$or':_[_0x1b36('0x39')](_0x59aceb['attributes'],function(_0x16f664){var _0x2dc670={};_0x2dc670[_0x16f664]={'$like':'%'+_0x4c60de[_0x1b36('0x40')][_0x1b36('0x4e')]+'%'};return _0x2dc670;})});}_0x59aceb=_['merge']({},_0x59aceb,_0x4c60de[_0x1b36('0x57')]);return db[_0x1b36('0x6e')]['count']({'where':_0x59aceb[_0x1b36('0x4b')]})[_0x1b36('0x30')](function(_0x6f0373){_0x2cb41e['count']=_0x6f0373;if(_0x4c60de[_0x1b36('0x40')]['includeAll']){_0x59aceb[_0x1b36('0x4f')]=[{'all':!![]}];}return db[_0x1b36('0x6e')][_0x1b36('0x50')](_0x59aceb);})['then'](function(_0x3a1d47){_0x2cb41e[_0x1b36('0x68')]=_0x3a1d47;return _0x2cb41e;});}})['then'](respondWithFilteredResult(_0x12ad71,_0x59aceb))['catch'](handleError(_0x12ad71,null));};exports[_0x1b36('0x6f')]=function(_0x434402,_0x48a9ae,_0x6f3cfc){return db[_0x1b36('0x3a')][_0x1b36('0x58')]({'where':{'id':_0x434402[_0x1b36('0x52')]['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0x48a9ae,null))[_0x1b36('0x30')](function(_0x2f4d31){if(_0x2f4d31){return _0x2f4d31[_0x1b36('0x6f')](_0x434402[_0x1b36('0x40')]['ids']);}})[_0x1b36('0x30')](respondWithStatusCode(_0x48a9ae,null))[_0x1b36('0x27')](handleError(_0x48a9ae,null));};exports[_0x1b36('0x70')]=function(_0x422eeb,_0x1ee704,_0x34f14f){_0x422eeb[_0x1b36('0x5a')]['sitepic']=_0x422eeb[_0x1b36('0x71')]['filename'];return db[_0x1b36('0x3a')][_0x1b36('0x58')]({'where':{'id':_0x422eeb[_0x1b36('0x52')]['id']}})['then'](handleEntityNotFound(_0x1ee704,null))[_0x1b36('0x30')](saveUpdates(_0x422eeb[_0x1b36('0x5a')],null))['then'](respondWithResult(_0x1ee704,null))[_0x1b36('0x27')](handleError(_0x1ee704,null));};exports[_0x1b36('0x72')]=function(_0x44ad80,_0x2fb628,_0x381b8c){_0x44ad80[_0x1b36('0x5a')][_0x1b36('0x73')]=_0x44ad80[_0x1b36('0x71')]['filename'];return db[_0x1b36('0x3a')][_0x1b36('0x58')]({'where':{'id':_0x44ad80[_0x1b36('0x52')]['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0x2fb628,null))[_0x1b36('0x30')](saveUpdates(_0x44ad80['body'],null))[_0x1b36('0x30')](respondWithResult(_0x2fb628,null))['catch'](handleError(_0x2fb628,null));};exports[_0x1b36('0x74')]=function(_0xfa6de9,_0x415180,_0x350778){_0xfa6de9[_0x1b36('0x5a')]['customerAvatar']=_0xfa6de9[_0x1b36('0x71')][_0x1b36('0x75')];return db[_0x1b36('0x3a')][_0x1b36('0x58')]({'where':{'id':_0xfa6de9[_0x1b36('0x52')]['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0x415180,null))[_0x1b36('0x30')](saveUpdates(_0xfa6de9[_0x1b36('0x5a')],null))[_0x1b36('0x30')](respondWithResult(_0x415180,null))[_0x1b36('0x27')](handleError(_0x415180,null));};exports[_0x1b36('0x76')]=function(_0x466371,_0x5121d5,_0x20ab89){_0x466371[_0x1b36('0x5a')][_0x1b36('0x77')]=_0x466371[_0x1b36('0x71')][_0x1b36('0x75')];return db[_0x1b36('0x3a')]['find']({'where':{'id':_0x466371[_0x1b36('0x52')]['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0x5121d5,null))[_0x1b36('0x30')](saveUpdates(_0x466371[_0x1b36('0x5a')],null))[_0x1b36('0x30')](respondWithResult(_0x5121d5,null))['catch'](handleError(_0x5121d5,null));};exports[_0x1b36('0x78')]=function(_0x88de81,_0x45ea8b,_0x123bff){var _0x845db9=path['join'](config[_0x1b36('0x79')],_0x1b36('0x7a'));var _0x4b7324={'where':{'id':_0x88de81[_0x1b36('0x52')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x35cbdb=![];return require(_0x1b36('0x7b'))[_0x1b36('0x7c')]()[_0x1b36('0x30')](function(_0x36dff4){if(_0x36dff4){_0x35cbdb=_0x36dff4[_0x1b36('0x7d')];}})[_0x1b36('0x30')](function(){return db['ChatWebsite'][_0x1b36('0x58')](_0x4b7324);})[_0x1b36('0x30')](handleEntityNotFound(_0x45ea8b,null))[_0x1b36('0x30')](function(_0x54a1fa){if(_0x54a1fa){if(!_[_0x1b36('0x7e')](_0x54a1fa[_0x1b36('0x7f')])){if(fs['existsSync'](path[_0x1b36('0x80')](config[_0x1b36('0x79')],_0x1b36('0x81'),_0x54a1fa['sitepic']))&&_0x35cbdb){_0x845db9=path[_0x1b36('0x80')](config[_0x1b36('0x79')],_0x1b36('0x81'),_0x54a1fa[_0x1b36('0x7f')]);}}return _0x45ea8b[_0x1b36('0x82')](_0x845db9);}})[_0x1b36('0x27')](handleError(_0x45ea8b,null));};exports['getAvatar']=function(_0x456557,_0x25ed60,_0x5aa874){var _0x393218=path[_0x1b36('0x80')](config[_0x1b36('0x79')],'server/files/images/avatars/default_avatar.png');var _0x16b026={'where':{'id':_0x456557[_0x1b36('0x52')]['id']},'attributes':['id',_0x1b36('0x73')],'raw':!![]};return db[_0x1b36('0x3a')]['find'](_0x16b026)[_0x1b36('0x30')](handleEntityNotFound(_0x25ed60,null))[_0x1b36('0x30')](function(_0x583541){if(_0x583541){if(!_[_0x1b36('0x7e')](_0x583541[_0x1b36('0x73')])){if(fs[_0x1b36('0x83')](path[_0x1b36('0x80')](config[_0x1b36('0x79')],_0x1b36('0x84'),_0x583541[_0x1b36('0x73')]))){_0x393218=path[_0x1b36('0x80')](config[_0x1b36('0x79')],_0x1b36('0x84'),_0x583541[_0x1b36('0x73')]);}}return _0x25ed60[_0x1b36('0x82')](_0x393218);}})[_0x1b36('0x27')](handleError(_0x25ed60,null));};exports[_0x1b36('0x85')]=function(_0xe1eda1,_0x2b24f1,_0x12d5eb){var _0x149e56=path[_0x1b36('0x80')](config[_0x1b36('0x79')],_0x1b36('0x86'));var _0x38cdf9={'where':{'id':_0xe1eda1[_0x1b36('0x52')]['id']},'attributes':['id','customerAvatar',_0x1b36('0x87')],'raw':!![]};return db[_0x1b36('0x3a')]['find'](_0x38cdf9)[_0x1b36('0x30')](handleEntityNotFound(_0x2b24f1,null))['then'](function(_0x586e1a){if(_0x586e1a){if(!_[_0x1b36('0x7e')](_0x586e1a[_0x1b36('0x88')])){if(fs[_0x1b36('0x83')](path[_0x1b36('0x80')](config[_0x1b36('0x79')],_0x1b36('0x84'),_0x586e1a[_0x1b36('0x88')]))&&_0x586e1a[_0x1b36('0x87')]){_0x149e56=path[_0x1b36('0x80')](config['root'],_0x1b36('0x84'),_0x586e1a[_0x1b36('0x88')]);}}return _0x2b24f1['download'](_0x149e56);}})[_0x1b36('0x27')](handleError(_0x2b24f1,null));};exports[_0x1b36('0x89')]=function(_0x37eee7,_0xbe2a93,_0x2c7327){var _0x3fbac1=path[_0x1b36('0x80')](config['root'],_0x1b36('0x8a'));var _0x2de932={'where':{'id':_0x37eee7['params']['id']},'attributes':['id',_0x1b36('0x77')],'raw':!![]};return db[_0x1b36('0x3a')][_0x1b36('0x58')](_0x2de932)[_0x1b36('0x30')](handleEntityNotFound(_0xbe2a93,null))['then'](function(_0x4f4c28){if(_0x4f4c28){if(!_[_0x1b36('0x7e')](_0x4f4c28['systemAvatar'])){if(fs['existsSync'](path[_0x1b36('0x80')](config[_0x1b36('0x79')],_0x1b36('0x84'),_0x4f4c28[_0x1b36('0x77')]))){_0x3fbac1=path[_0x1b36('0x80')](config[_0x1b36('0x79')],_0x1b36('0x84'),_0x4f4c28[_0x1b36('0x77')]);}}return _0xbe2a93[_0x1b36('0x82')](_0x3fbac1);}})['catch'](handleError(_0xbe2a93,null));};exports['notify']=function(_0x4ccd48,_0x3dfd69,_0x4f8f28){var _0x56497f=require(_0x1b36('0x8b'));var _0x44aa72=new _0x56497f();var _0x16a0a0=_0x44aa72[_0x1b36('0x8c')](_0x4ccd48['headers'][_0x1b36('0x8d')])[_0x1b36('0x8e')]();var _0x3f1412={'body':_0x4ccd48[_0x1b36('0x5a')],'channel':_0x1b36('0x8f')};var _0x3eb60b=[];var _0x2ec1da=[];var _0x2c0e82={};var _0x345b9c=![];return db[_0x1b36('0x90')][_0x1b36('0x63')]()[_0x1b36('0x30')](function(_0x1f8bba){if(!_0x1f8bba){throw new db['Sequelize'][(_0x1b36('0x1d'))](_0x1b36('0x91'));}_0x3eb60b=_[_0x1b36('0x92')](_[_0x1b36('0x54')](_0x1f8bba),[_0x1b36('0x93'),_0x1b36('0x94')]);_0x2ec1da=_[_0x1b36('0x92')](_[_0x1b36('0x54')](_0x1f8bba),[_0x1b36('0x93'),_0x1b36('0x94'),_0x1b36('0x95'),_0x1b36('0x96')]);if(_0x4ccd48[_0x1b36('0x5a')]['id']){delete _0x4ccd48[_0x1b36('0x5a')]['id'];}if(_[_0x1b36('0x7e')](_0x4ccd48[_0x1b36('0x5a')][_0x1b36('0x97')])){throw new db[(_0x1b36('0x1c'))][(_0x1b36('0x1d'))]('from\x20is\x20mandatory');}if(_[_0x1b36('0x7e')](_0x4ccd48[_0x1b36('0x5a')][_0x1b36('0x5a')])||_0x4ccd48[_0x1b36('0x5a')]['body']===''){throw new db[(_0x1b36('0x1c'))]['ValidationError'](_0x1b36('0x98'));}if(_[_0x1b36('0x7e')](_0x4ccd48[_0x1b36('0x5a')][_0x1b36('0x99')])){throw new db[(_0x1b36('0x1c'))][(_0x1b36('0x1d'))](_0x1b36('0x9a')+_0x2ec1da);}if(!_['includes'](_0x2ec1da,_0x4ccd48[_0x1b36('0x5a')][_0x1b36('0x99')])){throw new db['Sequelize'][(_0x1b36('0x1d'))](_0x1b36('0x9b')+_0x2ec1da);}_0x2c0e82[_0x4ccd48['body']['mapKey']]=_0x4ccd48[_0x1b36('0x5a')]['from'];})[_0x1b36('0x30')](function(){return db[_0x1b36('0x3a')][_0x1b36('0x58')]({'where':{'id':_0x4ccd48[_0x1b36('0x52')]['id']},'include':[{'model':db[_0x1b36('0x9c')],'as':_0x1b36('0x9d'),'include':[{'model':db[_0x1b36('0x90')],'as':_0x1b36('0x9e'),'where':_0x2c0e82,'limit':0x1,'order':[[_0x1b36('0x94'),_0x1b36('0x9f')]]}]},{'model':db[_0x1b36('0xa0')],'as':_0x1b36('0xa1')}]});})['then'](handleEntityNotFound(_0x3dfd69,null))[_0x1b36('0x30')](function(_0x1dbcb1){if(_0x1dbcb1&&_0x1dbcb1[_0x1b36('0x9d')]){_0x3f1412[_0x1b36('0xa2')]=_0x1dbcb1;_0x3f1412[_0x1b36('0xa3')]=_0x1dbcb1['Applications'];_0x3f1412[_0x1b36('0xa4')]=_0x1dbcb1[_0x1b36('0x9d')];_0x3f1412[_0x1b36('0xa3')]=_[_0x1b36('0xa5')](_0x3f1412[_0x1b36('0xa3')],[_0x1b36('0xa6')],[_0x1b36('0xa7')]);if(_0x3f1412[_0x1b36('0xa2')][_0x1b36('0xa1')]){delete _0x3f1412[_0x1b36('0xa2')][_0x1b36('0xa1')];}if(_0x3f1412['account']['List']&&_0x3f1412[_0x1b36('0xa2')]['List'][_0x1b36('0x9e')][_0x1b36('0x55')]){return _0x3f1412['account'][_0x1b36('0x9d')][_0x1b36('0x9e')][0x0];}var _0x5da049=_[_0x1b36('0x16')](_0x4ccd48[_0x1b36('0x5a')],{'firstName':_0x4ccd48[_0x1b36('0x5a')][_0x1b36('0x97')],'ListId':_0x1dbcb1[_0x1b36('0x96')]});_0x5da049[_0x4ccd48[_0x1b36('0x5a')][_0x1b36('0x99')]]=_0x4ccd48['body'][_0x1b36('0x97')];return db[_0x1b36('0x90')][_0x1b36('0x59')](_0x5da049,{'fields':_0x3eb60b,'raw':!![]});}})[_0x1b36('0x30')](handleEntityNotFound(_0x3dfd69,null))[_0x1b36('0x30')](function(_0x2e78fa){_0x3f1412[_0x1b36('0xa8')]=_0x2e78fa;var _0x5b515f=_0x4ccd48[_0x1b36('0x5a')][_0x1b36('0xa9')];if(_0x4ccd48['headers'][_0x1b36('0xaa')]){_0x5b515f=_0x4ccd48[_0x1b36('0xab')]['cf-connecting-ip'];}else if(_0x4ccd48['headers']['x-forwarded-for']){_0x5b515f=_[_0x1b36('0xac')](_0x4ccd48[_0x1b36('0xab')][_0x1b36('0xad')][_0x1b36('0xae')](','));}if(_0x2e78fa){var _0x23b0f7={'ContactId':_0x2e78fa['id'],'ChatWebsiteId':_0x4ccd48[_0x1b36('0x52')]['id'],'from':(_0x2e78fa['firstName']||'')+'\x20'+(_0x2e78fa[_0x1b36('0xaf')]||''),'customerIp':_0x5b515f,'customerPort':_0x4ccd48[_0x1b36('0xab')][_0x1b36('0xb0')]?_0x4ccd48[_0x1b36('0xab')][_0x1b36('0xb0')]:null,'referer':_0x4ccd48[_0x1b36('0x5a')][_0x1b36('0xb1')],'browserName':_0x16a0a0[_0x1b36('0xb2')][_0x1b36('0x35')]&&_0x16a0a0['browser'][_0x1b36('0xb3')]?util[_0x1b36('0xb4')]('%s\x20%s',_0x16a0a0[_0x1b36('0xb2')][_0x1b36('0x35')],_0x16a0a0[_0x1b36('0xb2')][_0x1b36('0xb3')]):_0x1b36('0xb5'),'browserVersion':_0x16a0a0[_0x1b36('0xb2')][_0x1b36('0xb3')]||_0x1b36('0xb5'),'osName':util[_0x1b36('0xb4')](_0x1b36('0xb6'),_0x16a0a0['os'][_0x1b36('0x35')],_0x16a0a0['os']['version']),'osVersion':_0x16a0a0['os'][_0x1b36('0xb3')],'deviceModel':_0x16a0a0[_0x1b36('0xb7')]['model']&&_0x16a0a0[_0x1b36('0xb7')][_0x1b36('0xb8')]?util['format'](_0x1b36('0xb9'),_0x16a0a0['device']['model'],_0x16a0a0[_0x1b36('0xb7')][_0x1b36('0xb8')],_0x16a0a0[_0x1b36('0xb7')]['type']):null,'deviceVendor':_0x16a0a0[_0x1b36('0xb7')][_0x1b36('0xb8')],'deviceType':_0x16a0a0['device'][_0x1b36('0x3d')],'formData':JSON['stringify'](_0x4ccd48[_0x1b36('0x5a')])};var _0x10a293={'ChatWebsiteId':_0x4ccd48[_0x1b36('0x52')]['id'],'closed':![]};if(_0x4ccd48[_0x1b36('0x5a')][_0x1b36('0xba')]){_0x10a293[_0x1b36('0xba')]=_0x4ccd48[_0x1b36('0x5a')][_0x1b36('0xba')];return db[_0x1b36('0xbb')][_0x1b36('0x58')]({'where':_0x10a293})[_0x1b36('0x30')](function(_0x27f6e7){if(_0x27f6e7){return[_0x27f6e7,![]];}_0x23b0f7['threadId']=_0x4ccd48[_0x1b36('0x5a')]['threadId'];_0x23b0f7['externalUrl']=_0x4ccd48[_0x1b36('0x5a')]['externalUrl'];return db[_0x1b36('0xbb')][_0x1b36('0x59')](_0x23b0f7)[_0x1b36('0x30')](function(_0x3d2972){return[_0x3d2972,!![]];});});}_0x10a293[_0x1b36('0xbc')]=_0x2e78fa['id'];if(_0x4ccd48[_0x1b36('0x5a')][_0x1b36('0xbd')]&&_0x4ccd48[_0x1b36('0x5a')]['interaction']['id']){_0x10a293['id']=_0x4ccd48[_0x1b36('0x5a')][_0x1b36('0xbd')]['id'];return db[_0x1b36('0xbb')][_0x1b36('0x58')]({'where':_0x10a293})[_0x1b36('0x30')](function(_0x2f41df){if(_0x2f41df){return[_0x2f41df,![]];}return db[_0x1b36('0xbb')][_0x1b36('0x59')](_0x23b0f7)['then'](function(_0x3c4615){return[_0x3c4615,!![]];});});}return db['ChatInteraction'][_0x1b36('0x59')](_0x23b0f7)[_0x1b36('0x30')](function(_0xdd29c){return[_0xdd29c,!![]];});}})['spread'](function(_0x57a39d,_0x511413){if(_0x57a39d){_0x345b9c=_0x511413;if(!_0x511413){var _0xb7b31={'from':(_0x3f1412['contact'][_0x1b36('0xbe')]||'')+'\x20'+(_0x3f1412[_0x1b36('0xa8')][_0x1b36('0xaf')]||'')};if(_0x4ccd48['body'][_0x1b36('0xba')]&&_0x4ccd48[_0x1b36('0x5a')]['messageId']&&_0x4ccd48['body'][_0x1b36('0xba')]!=_0x4ccd48[_0x1b36('0x5a')]['messageId']){_0xb7b31[_0x1b36('0xba')]=_0x4ccd48['body']['messageId'];}return _0x57a39d['update'](_0xb7b31);}else{return _0x57a39d;}}})['then'](function(_0x3e3b8d){_0x3f1412[_0x1b36('0xbd')]=_0x3e3b8d['get']({'plain':!![]});_0x3f1412['interaction']['created']=_0x345b9c;if(_0x3f1412[_0x1b36('0xbd')][_0x1b36('0xbf')]){if(_0x3f1412[_0x1b36('0xa2')][_0x1b36('0xc0')]){_0x3f1412['applications'][_0x1b36('0xc1')]({'id':0x0,'priority':_0x3f1412[_0x1b36('0xa3')][_0x1b36('0x55')]+0x1,'app':_0x1b36('0xc2'),'appdata':_0x1b36('0xc3'),'interval':'*,*,*,*'});}}return db[_0x1b36('0xc4')][_0x1b36('0x59')]({'body':_0x4ccd48[_0x1b36('0x5a')]['body'],'ChatWebsiteId':_0x4ccd48[_0x1b36('0x52')]['id'],'ChatInteractionId':_0x3e3b8d['id'],'direction':'in','ContactId':_0x3f1412['contact']['id'],'AttachmentId':_0x4ccd48[_0x1b36('0x5a')]['AttachmentId']});})[_0x1b36('0x30')](function(_0x396566){_0x3f1412[_0x1b36('0x25')]=_0x396566;if(_0x3f1412['interaction'][_0x1b36('0xc5')]){return db['User'][_0x1b36('0x58')]({'attributes':['id','name'],'where':{'id':_0x3f1412[_0x1b36('0xbd')][_0x1b36('0xc5')]}})[_0x1b36('0x30')](function(_0x11673f){if(_0x11673f){_0x3f1412[_0x1b36('0xa3')]['unshift']({'id':0x0,'priority':0x0,'app':_0x1b36('0xc6'),'appdata':_0x11673f['name']+','+(_0x3f1412[_0x1b36('0xa2')][_0x1b36('0xc7')]||0xa),'interval':_0x1b36('0xc8')});_0x3f1412[_0x1b36('0xc9')]=!![];}return respondWithRpcPromise('Start',_0x1b36('0xca'),_0x3f1412);});}return respondWithRpcPromise(_0x1b36('0xcb'),_0x1b36('0xca'),_0x3f1412);})[_0x1b36('0x30')](function(_0x1ebd50){respondWithRpcPromise('EventManager','EventManager',{'event':_0x1b36('0xcc'),'message':_0x1ebd50},client9002);return _0x1ebd50;})['then'](respondWithResult(_0x3dfd69,null))[_0x1b36('0x27')](handleError(_0x3dfd69,null));};exports[_0x1b36('0xcd')]=function(_0x1a1566,_0x2c9f28,_0x3076c9){var _0x5b3210,_0x15206a,_0x62214d;var _0x593d4d=[];var _0x5e0fa4=[];var _0x4fa1a3={};return db[_0x1b36('0x90')][_0x1b36('0x63')]()[_0x1b36('0x30')](function(_0x11446f){if(!_0x11446f){throw new db[(_0x1b36('0x1c'))][(_0x1b36('0x1d'))](_0x1b36('0x91'));}_0x5e0fa4=_[_0x1b36('0x92')](_[_0x1b36('0x54')](_0x11446f),[_0x1b36('0x93'),_0x1b36('0x94')]);_0x593d4d=_[_0x1b36('0x92')](_[_0x1b36('0x54')](_0x11446f),[_0x1b36('0x93'),'updatedAt','CompanyId',_0x1b36('0x96')]);if(_0x1a1566[_0x1b36('0x5a')]['id']){delete _0x1a1566[_0x1b36('0x5a')]['id'];}if(_[_0x1b36('0x7e')](_0x1a1566[_0x1b36('0x5a')][_0x1b36('0x97')])){throw _0x2c9f28[_0x1b36('0x29')](0x1f4)[_0x1b36('0x36')](new db[(_0x1b36('0x1c'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x1b36('0x7e')](_0x1a1566[_0x1b36('0x5a')][_0x1b36('0x5a')])||_0x1a1566[_0x1b36('0x5a')][_0x1b36('0x5a')]===''){throw _0x2c9f28[_0x1b36('0x29')](0x1f4)[_0x1b36('0x36')](new db[(_0x1b36('0x1c'))][(_0x1b36('0x1d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x1b36('0x7e')](_0x1a1566[_0x1b36('0x5a')][_0x1b36('0xce')])){throw _0x2c9f28[_0x1b36('0x29')](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0x1b36('0xcf')+_0x593d4d));}if(!_[_0x1b36('0xd0')](_0x593d4d,_0x1a1566[_0x1b36('0x5a')]['mapKeyOffline'])){throw _0x2c9f28[_0x1b36('0x29')](0x1f4)[_0x1b36('0x36')](new db[(_0x1b36('0x1c'))][(_0x1b36('0x1d'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x593d4d));}_0x4fa1a3[_0x1a1566[_0x1b36('0x5a')][_0x1b36('0xce')]]=_0x1a1566[_0x1b36('0x5a')][_0x1b36('0x97')];})[_0x1b36('0x30')](function(){return db[_0x1b36('0x3a')][_0x1b36('0x58')]({'where':{'id':_0x1a1566['params']['id']},'include':[{'model':db['CmList'],'as':'List'}]});})[_0x1b36('0x30')](handleEntityNotFound(_0x2c9f28,null))[_0x1b36('0x30')](function(_0x28708a){if(_0x28708a&&_0x28708a[_0x1b36('0x9d')]){_0x15206a=_0x28708a;var _0x391933=_[_0x1b36('0x16')](_0x1a1566[_0x1b36('0x5a')],{'firstName':_0x1a1566[_0x1b36('0x5a')][_0x1b36('0x97')],'phone':_0x1a1566[_0x1b36('0x5a')][_0x1b36('0x97')],'ListId':_0x28708a[_0x1b36('0x96')]});_0x391933[_0x1a1566[_0x1b36('0x5a')]['mapKeyOffline']]=_0x1a1566[_0x1b36('0x5a')][_0x1b36('0x97')];return db['CmContact'][_0x1b36('0xd1')]({'where':_0x4fa1a3,'defaults':_0x391933});}})[_0x1b36('0xd2')](function(_0x1b101f){if(_0x1b101f){_0x62214d=_0x1b101f;var _0x1f91f4=fs['readFileSync'](path[_0x1b36('0x80')](config[_0x1b36('0x79')],_0x1b36('0xd3')),'utf8');var _0x1dd085=ejs[_0x1b36('0xd4')](_0x1f91f4,{'body':_[_0x1b36('0xd5')](_0x1a1566[_0x1b36('0x5a')][_0x1b36('0x5a')]),'bodyTitle':_0x15206a[_0x1b36('0xd6')]});return db[_0x1b36('0xd7')][_0x1b36('0x59')]({'body':_0x1dd085,'ContactId':_0x1b101f['id'],'ChatWebsiteId':_0x15206a['id']});}})[_0x1b36('0x30')](function(_0x27bb17){if(_0x27bb17){_0x5b3210=_0x27bb17;return db['MailAccount'][_0x1b36('0x6d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1b36('0xd8'),'raw':!![]}]});}})[_0x1b36('0x30')](function(_0x1564bc){if(_0x1564bc&&_0x1564bc[_0x1b36('0xd8')]&&_0x15206a[_0x1b36('0xd9')]){var _0x30840a={'tls':{'rejectUnauthorized':![]}};if(_0x1564bc[_0x1b36('0xd8')]['service']){_0x30840a[_0x1b36('0xda')]=_0x1564bc[_0x1b36('0xd8')]['service'];}else{_0x30840a[_0x1b36('0xdb')]=_0x1564bc[_0x1b36('0xd8')][_0x1b36('0xdb')];_0x30840a['port']=_0x1564bc[_0x1b36('0xd8')][_0x1b36('0xdc')];_0x30840a[_0x1b36('0xdd')]=_0x1564bc['Smtp']['secure'];}if(_0x1564bc['Smtp'][_0x1b36('0xde')]){_0x30840a[_0x1b36('0xdf')]={'user':_0x1564bc[_0x1b36('0xd8')]['user'],'pass':_0x1564bc[_0x1b36('0xd8')][_0x1b36('0xe0')]};}return respondWithRpcPromise('SendMail',_0x1b36('0xe1'),{'account':_0x30840a,'message':{'from':util[_0x1b36('0xb4')](_0x1b36('0xe2'),_0x1564bc['name'],_0x1564bc['email']||_0x1564bc['Smtp'][_0x1b36('0x5b')]),'to':_0x15206a['forwardOfflineAddress'],'subject':_0x15206a[_0x1b36('0xe3')],'text':_0x5b3210[_0x1b36('0x5a')]}},client9003)['then'](function(){return _0x5b3210;})[_0x1b36('0x27')](function(_0x24b6c7){console[_0x1b36('0x24')](_0x24b6c7);});}})[_0x1b36('0x30')](function(){if(_0x5b3210){return _0x5b3210;}})[_0x1b36('0x30')](respondWithResult(_0x2c9f28,null))[_0x1b36('0x27')](handleError(_0x2c9f28,null));};exports[_0x1b36('0xe4')]=function(_0x4bcff5,_0xde34c7,_0x2e1893){return db['ChatInteraction'][_0x1b36('0x58')]({'where':{'id':_0x4bcff5['params']['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0xde34c7,null))[_0x1b36('0x30')](function(_0x2243ec){if(_0x2243ec){return _0x2243ec[_0x1b36('0xe4')](_0x4bcff5[_0x1b36('0x5a')][_0x1b36('0x6a')],_[_0x1b36('0xe5')](_0x4bcff5['body'],['ids','id'])||{});}})[_0x1b36('0x30')](respondWithResult(_0xde34c7,null))[_0x1b36('0x27')](handleError(_0xde34c7,null));};exports[_0x1b36('0xe6')]=function(_0x2d44b7,_0x1bbb95,_0x17a974){var _0x2b676d={'raw':![],'where':{}};var _0x4970a5={};var _0x1f34e6={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1b36('0x6d')]({'where':{'id':_0x2d44b7[_0x1b36('0x52')]['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0x1bbb95,null))[_0x1b36('0x30')](function(_0x2456fe){if(_0x2456fe){_0x4970a5[_0x1b36('0x3f')]=_[_0x1b36('0x54')](db['ChatInteraction'][_0x1b36('0x3b')]);_0x4970a5[_0x1b36('0x40')]=_[_0x1b36('0x54')](_0x2d44b7[_0x1b36('0x40')]);_0x4970a5['filters']=_[_0x1b36('0x43')](_0x4970a5[_0x1b36('0x3f')],_0x4970a5[_0x1b36('0x40')]);_0x2b676d[_0x1b36('0x42')]=_['intersection'](_0x4970a5[_0x1b36('0x3f')],qs[_0x1b36('0x44')](_0x2d44b7['query'][_0x1b36('0x44')]));_0x2b676d['attributes']=_0x2b676d[_0x1b36('0x42')][_0x1b36('0x55')]?_0x2b676d[_0x1b36('0x42')]:_0x4970a5[_0x1b36('0x3f')];if(!_0x2d44b7[_0x1b36('0x40')][_0x1b36('0x45')]('nolimit')){_0x2b676d[_0x1b36('0x47')]=qs[_0x1b36('0x47')](_0x2d44b7[_0x1b36('0x40')][_0x1b36('0x47')]);_0x2b676d['offset']=qs['offset'](_0x2d44b7['query'][_0x1b36('0x2b')]);}_0x2b676d['order']=qs[_0x1b36('0x49')](_0x2d44b7[_0x1b36('0x40')][_0x1b36('0x49')]);_0x2b676d[_0x1b36('0x4b')]=qs[_0x1b36('0x41')](_['pick'](_0x2d44b7[_0x1b36('0x40')],_0x4970a5['filters']));_0x2b676d['where']['ChatWebsiteId']=_0x2456fe['id'];if(_0x2d44b7[_0x1b36('0x40')][_0x1b36('0x4e')]){_0x2b676d[_0x1b36('0x4b')]=_['merge'](_0x2b676d['where'],{'$or':_['map'](_0x2b676d[_0x1b36('0x42')],function(_0x4c379b){var _0x192644={};_0x192644[_0x4c379b]={'$like':'%'+_0x2d44b7[_0x1b36('0x40')][_0x1b36('0x4e')]+'%'};return _0x192644;})});}_0x2b676d=_[_0x1b36('0x4c')]({},_0x2b676d,_0x2d44b7[_0x1b36('0x57')]);return db[_0x1b36('0xbb')]['count']({'where':_0x2b676d['where']})[_0x1b36('0x30')](function(_0x4233d9){_0x1f34e6[_0x1b36('0x2a')]=_0x4233d9;if(_0x2d44b7['query']['includeAll']){_0x2b676d[_0x1b36('0x4f')]=[{'model':db[_0x1b36('0x90')],'as':'Contact','required':![]},{'model':db[_0x1b36('0xe7')],'as':_0x1b36('0xe8'),'attributes':[_0x1b36('0x35'),_0x1b36('0xe9'),_0x1b36('0xea')],'required':![]},{'model':db[_0x1b36('0xeb')],'as':_0x1b36('0xec'),'attributes':['id',_0x1b36('0x35'),_0x1b36('0xed')],'where':_0x2d44b7[_0x1b36('0x40')][_0x1b36('0xee')]?{'id':_0x2d44b7[_0x1b36('0x40')][_0x1b36('0xee')]}:undefined,'required':_0x2d44b7[_0x1b36('0x40')][_0x1b36('0xee')]?!![]:![]}];}return db['ChatInteraction'][_0x1b36('0x50')](_0x2b676d);})[_0x1b36('0x30')](function(_0x480c32){_0x1f34e6['rows']=_0x480c32;return _0x1f34e6;});}})[_0x1b36('0x30')](respondWithFilteredResult(_0x1bbb95,_0x2b676d))[_0x1b36('0x27')](handleError(_0x1bbb95,null));};function iftimePromise(_0x5a0925,_0x36cafb){return respondWithRpcPromise(_0x1b36('0xef'),_0x1b36('0xf0'),{'command':_0x36cafb[_0x1b36('0xf1')]?util[_0x1b36('0xb4')](_0x1b36('0xf2'),_0x5a0925[_0x1b36('0xf3')],_0x36cafb[_0x1b36('0xf1')]):util[_0x1b36('0xb4')]('iftime\x20%s',_0x5a0925[_0x1b36('0xf3')])},client9002)[_0x1b36('0x30')](function(_0x4ec356){var _0x389d30=_0x4ec356&&_0x4ec356[_0x1b36('0xf4')](_0x1b36('0xf5'))>=0x0?!![]:![];logger['info'](_0x1b36('0xf6'),_0x36cafb['id'],_0x5a0925['id'],_0x5a0925[_0x1b36('0xf3')],_0x389d30?_0x1b36('0xf7'):_0x1b36('0xf8'),_0x36cafb[_0x1b36('0xf1')]?_0x36cafb[_0x1b36('0xf1')]:_0x1b36('0xf9'));return _0x389d30;})['catch'](function(_0x2c1576){logger[_0x1b36('0x24')](_0x1b36('0xf6'),_0x36cafb['id'],_0x5a0925['id'],_0x5a0925[_0x1b36('0xf3')],util['inspect'](_0x2c1576,{'showHidden':![],'depth':null}),_0x36cafb[_0x1b36('0xf1')]?_0x36cafb['timezone']:_0x1b36('0xf9'));return![];});}exports[_0x1b36('0xf0')]=function(_0x4e7f62,_0x11641d,_0x557ddd){var _0x235106=0x0;var _0xfa1e63=0x0;var _0x30b9aa=![];var _0x4c8019;var _0x252952;return db[_0x1b36('0x3a')][_0x1b36('0x58')]({'where':{'id':_0x4e7f62[_0x1b36('0x52')]['id']},'include':[{'model':db['Interval'],'as':_0x1b36('0xfa'),'include':[{'model':db[_0x1b36('0xfa')],'as':'Intervals','attributes':['id',_0x1b36('0xf3')],'raw':!![]}]}]})[_0x1b36('0x30')](handleEntityNotFound(_0x11641d,null))[_0x1b36('0x30')](function(_0x3c12b9){if(_0x3c12b9){_0x4c8019=_0x3c12b9;return _0x3c12b9['getProactiveActions']({'raw':!![]});}})[_0x1b36('0x30')](function(_0x4c83c6){if(_0x4c8019){if(_0x4c83c6){_0x252952=_0x4c83c6;}}return require(_0x1b36('0x7b'))[_0x1b36('0x7c')]();})['then'](function(_0x4c2059){if(_0x4c2059){_0xfa1e63=_0x4c2059[_0x1b36('0xfb')];_0x30b9aa=_0x4c2059[_0x1b36('0x7d')];}})[_0x1b36('0x30')](function(){return db[_0x1b36('0xbb')]['count']({'where':{'closed':![]}});})[_0x1b36('0x30')](function(_0x4aba2e){_0x235106=_0x4aba2e;if(_0xfa1e63&&_0x4aba2e>_0xfa1e63){return db[_0x1b36('0xfc')][_0x1b36('0x6d')]({'where':{'id':0x1}})[_0x1b36('0x30')](function(_0x17f24d){if(_0x17f24d){_0x17f24d[_0x1b36('0xfd')](_0x1b36('0xfe'));}});}})['then'](function(){if(_0x4c8019['Interval']&&_0x4c8019[_0x1b36('0xfa')][_0x1b36('0xff')]){var _0x35b383=[];for(var _0x165299=0x0;_0x165299<_0x4c8019[_0x1b36('0xfa')][_0x1b36('0xff')][_0x1b36('0x55')];_0x165299++){var _0x247e58=_0x4c8019['Interval'][_0x1b36('0xff')][_0x165299][_0x1b36('0x5c')]({'plain':!![]});_0x35b383[_0x1b36('0xc1')](iftimePromise(_0x247e58,_0x4c8019));}return BPromise[_0x1b36('0x100')](_0x35b383)[_0x1b36('0x30')](function(_0x53022a){return _[_0x1b36('0x101')](_0x53022a);});}else{return!![];}})['then'](function(_0x31af19){var _0x70b4f9=fs['readFileSync'](path['join'](config[_0x1b36('0x79')],'server/files/chat/iframe.js'),_0x1b36('0x102'));var _0x339b41={'remote':_0x4c8019['remote'],'query':querystring['stringify'](_['merge'](_0x4c8019[_0x1b36('0x5c')]({'plain':!![]}),{'customerIp':_0x4e7f62[_0x1b36('0xab')][_0x1b36('0xad')]||_0x4e7f62['headers'][_0x1b36('0x103')]||_0x4e7f62[_0x1b36('0x104')]['remoteAddress']||_0x4e7f62['ip'],'referer':_0x4e7f62[_0x1b36('0xab')][_0x1b36('0xb1')],'openedInteractions':_0x235106,'maxInteractions':_0xfa1e63,'virtual':_0x30b9aa['virtual'],'online':_0x31af19,'custom':_0x30b9aa}))[_0x1b36('0x105')](/'/g,'\x5c\x27')};_0x11641d[_0x1b36('0x36')](ejs[_0x1b36('0xd4')](Mustache[_0x1b36('0xd4')](_0x70b4f9,_0x339b41),{'proactiveActions':_0x252952,'alignment':_0x4c8019[_0x1b36('0x106')],'verticalAlignment':_0x4c8019[_0x1b36('0x107')],'div_color':_0x4c8019[_0x1b36('0xed')],'text_color':_0x4c8019['textColor']}));})[_0x1b36('0x27')](handleError(_0x11641d,null));};exports[_0x1b36('0x108')]=function(_0x16067c,_0xa8dcea,_0x1cc8dc){return db[_0x1b36('0x3a')][_0x1b36('0x6d')]({'where':{'id':_0x16067c['params']['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0xa8dcea,null))['then'](function(_0x10f554){if(_0x10f554){return db[_0x1b36('0x109')][_0x1b36('0x10a')](function(_0x9746b5){return db['ChatApplication'][_0x1b36('0x31')]({'where':{'ChatWebsiteId':_0x16067c['params']['id']},'transaction':_0x9746b5})[_0x1b36('0x30')](function(_0x3d3627){var _0x59647d=_[_0x1b36('0x39')](_0x16067c[_0x1b36('0x5a')],function(_0x27e6b4){_0x27e6b4[_0x1b36('0x65')]=_0x16067c[_0x1b36('0x52')]['id'];return _0x27e6b4;});return db['ChatApplication'][_0x1b36('0x10b')](_0x59647d,{'transaction':_0x9746b5});});})[_0x1b36('0x30')](function(){return db[_0x1b36('0xa0')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x16067c[_0x1b36('0x52')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0xa8dcea,null))['catch'](handleError(_0xa8dcea,null));};exports['getApplications']=function(_0x31f10b,_0x2b1aca,_0x3f4d19){var _0x303946={};var _0x4954b9={};var _0x2bafb4;var _0x5c2ee1;return db[_0x1b36('0x3a')][_0x1b36('0x6d')]({'where':{'id':_0x31f10b[_0x1b36('0x52')]['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0x2b1aca,null))[_0x1b36('0x30')](function(_0x438e56){if(_0x438e56){_0x2bafb4=_0x438e56;_0x4954b9[_0x1b36('0x3f')]=_[_0x1b36('0x54')](db[_0x1b36('0xa0')][_0x1b36('0x3b')]);_0x4954b9['query']=_[_0x1b36('0x54')](_0x31f10b[_0x1b36('0x40')]);_0x4954b9['filters']=_[_0x1b36('0x43')](_0x4954b9[_0x1b36('0x3f')],_0x4954b9[_0x1b36('0x40')]);_0x303946[_0x1b36('0x42')]=_[_0x1b36('0x43')](_0x4954b9[_0x1b36('0x3f')],qs[_0x1b36('0x44')](_0x31f10b[_0x1b36('0x40')]['fields']));_0x303946[_0x1b36('0x42')]=_0x303946[_0x1b36('0x42')]['length']?_0x303946['attributes']:_0x4954b9[_0x1b36('0x3f')];_0x303946[_0x1b36('0x48')]=qs['sort'](_0x31f10b[_0x1b36('0x40')][_0x1b36('0x49')]);_0x303946['where']=qs[_0x1b36('0x41')](_[_0x1b36('0x4a')](_0x31f10b[_0x1b36('0x40')],_0x4954b9['filters']));if(_0x31f10b[_0x1b36('0x40')]['filter']){_0x303946['where']=_[_0x1b36('0x4c')](_0x303946[_0x1b36('0x4b')],{'$or':_[_0x1b36('0x39')](_0x303946['attributes'],function(_0x32d277){var _0x5c851d={};_0x5c851d[_0x32d277]={'$like':'%'+_0x31f10b[_0x1b36('0x40')][_0x1b36('0x4e')]+'%'};return _0x5c851d;})});}_0x303946=_[_0x1b36('0x4c')]({},_0x303946,_0x31f10b[_0x1b36('0x57')]);return _0x2bafb4[_0x1b36('0x10c')](_0x303946);}})['then'](function(_0x26f8cc){if(_0x26f8cc){_0x5c2ee1=_0x26f8cc[_0x1b36('0x55')];if(!_0x31f10b[_0x1b36('0x40')][_0x1b36('0x45')](_0x1b36('0x46'))){_0x303946[_0x1b36('0x47')]=qs[_0x1b36('0x47')](_0x31f10b['query'][_0x1b36('0x47')]);_0x303946['offset']=qs[_0x1b36('0x2b')](_0x31f10b[_0x1b36('0x40')]['offset']);}return _0x2bafb4[_0x1b36('0x10c')](_0x303946);}})[_0x1b36('0x30')](function(_0x46e0ee){if(_0x46e0ee){return _0x46e0ee?{'count':_0x5c2ee1,'rows':_0x46e0ee}:null;}})[_0x1b36('0x30')](respondWithResult(_0x2b1aca,null))[_0x1b36('0x27')](handleError(_0x2b1aca,null));};exports[_0x1b36('0x10d')]=function(_0x912030,_0x3cc071,_0x4bcbed){return db[_0x1b36('0x10e')]['find']({'where':{'id':_0x912030['params']['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0x3cc071,null))[_0x1b36('0x30')](function(_0x259eff){if(_0x259eff){return _0x259eff[_0x1b36('0x10d')](_0x912030['body'][_0x1b36('0x6a')],_['omit'](_0x912030[_0x1b36('0x5a')],['ids','id'])||{});}})[_0x1b36('0x30')](respondWithResult(_0x3cc071,null))[_0x1b36('0x27')](handleError(_0x3cc071,null));};exports[_0x1b36('0x10f')]=function(_0xf940b1,_0x26b3b2,_0x1189bd){var _0x25b3ec={};var _0x252213={};var _0x388081;var _0x19e68d;return db[_0x1b36('0x3a')][_0x1b36('0x6d')]({'where':{'id':_0xf940b1[_0x1b36('0x52')]['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0x26b3b2,null))[_0x1b36('0x30')](function(_0x9a1ab3){if(_0x9a1ab3){_0x388081=_0x9a1ab3;_0x252213[_0x1b36('0x3f')]=_[_0x1b36('0x54')](db[_0x1b36('0x110')][_0x1b36('0x3b')]);_0x252213['query']=_[_0x1b36('0x54')](_0xf940b1[_0x1b36('0x40')]);_0x252213[_0x1b36('0x41')]=_['intersection'](_0x252213['model'],_0x252213[_0x1b36('0x40')]);_0x25b3ec[_0x1b36('0x42')]=_[_0x1b36('0x43')](_0x252213[_0x1b36('0x3f')],qs[_0x1b36('0x44')](_0xf940b1[_0x1b36('0x40')][_0x1b36('0x44')]));_0x25b3ec['attributes']=_0x25b3ec[_0x1b36('0x42')][_0x1b36('0x55')]?_0x25b3ec[_0x1b36('0x42')]:_0x252213[_0x1b36('0x3f')];_0x25b3ec[_0x1b36('0x48')]=qs[_0x1b36('0x49')](_0xf940b1['query'][_0x1b36('0x49')]);_0x25b3ec[_0x1b36('0x4b')]=qs['filters'](_[_0x1b36('0x4a')](_0xf940b1[_0x1b36('0x40')],_0x252213[_0x1b36('0x41')]));if(_0xf940b1['query'][_0x1b36('0x4e')]){_0x25b3ec[_0x1b36('0x4b')]=_[_0x1b36('0x4c')](_0x25b3ec[_0x1b36('0x4b')],{'$or':_[_0x1b36('0x39')](_0x25b3ec[_0x1b36('0x42')],function(_0x4bca56){var _0x152082={};_0x152082[_0x4bca56]={'$like':'%'+_0xf940b1[_0x1b36('0x40')][_0x1b36('0x4e')]+'%'};return _0x152082;})});}_0x25b3ec=_[_0x1b36('0x4c')]({},_0x25b3ec,_0xf940b1[_0x1b36('0x57')]);return _0x388081['getProactiveActions'](_0x25b3ec);}})[_0x1b36('0x30')](function(_0x451fd9){if(_0x451fd9){_0x19e68d=_0x451fd9[_0x1b36('0x55')];if(!_0xf940b1[_0x1b36('0x40')][_0x1b36('0x45')](_0x1b36('0x46'))){_0x25b3ec[_0x1b36('0x47')]=qs[_0x1b36('0x47')](_0xf940b1[_0x1b36('0x40')][_0x1b36('0x47')]);_0x25b3ec[_0x1b36('0x2b')]=qs[_0x1b36('0x2b')](_0xf940b1[_0x1b36('0x40')][_0x1b36('0x2b')]);}return _0x388081['getProactiveActions'](_0x25b3ec);}})[_0x1b36('0x30')](function(_0x3e8265){if(_0x3e8265){return _0x3e8265?{'count':_0x19e68d,'rows':_0x3e8265}:null;}})['then'](respondWithResult(_0x26b3b2,null))['catch'](handleError(_0x26b3b2,null));};exports['getFields']=function(_0x10448c,_0x42d3f0,_0x52d03d){var _0x5ea3ea=_0x10448c[_0x1b36('0x40')][_0x1b36('0x111')]===_0x1b36('0x112')?_0x1b36('0x113'):_0x1b36('0x114');return db[_0x1b36('0x3a')]['find']({'attributes':['id',_0x5ea3ea],'where':{'id':_0x10448c[_0x1b36('0x52')]['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0x42d3f0,null))[_0x1b36('0x30')](function(_0x36800d){if(_0x36800d){var _0x213e24=_0x36800d[_0x5ea3ea];var _0x617afa=_0x213e24&&_0x213e24[_0x1b36('0x115')]?_0x213e24[_0x1b36('0x115')]:[];_0x42d3f0[_0x1b36('0x36')]({'fromKey':_[_0x1b36('0x7e')](_0x213e24[_0x1b36('0x116')])?undefined:_0x213e24[_0x1b36('0x116')],'count':_0x617afa[_0x1b36('0x55')],'rows':_0x617afa});}})['catch'](handleError(_0x42d3f0,null));};exports[_0x1b36('0x117')]=function(_0x52a024,_0x3fc1dd,_0x23f6e9){var _0xda570d={'raw':![],'where':{}};var _0x2905d4={};var _0x501662={'count':0x0,'rows':[]};return db[_0x1b36('0x3a')]['findOne']({'where':{'id':_0x52a024['params']['id']}})['then'](handleEntityNotFound(_0x3fc1dd,null))[_0x1b36('0x30')](function(_0x126c36){if(_0x126c36){_0x2905d4[_0x1b36('0x3f')]=_[_0x1b36('0x54')](db[_0x1b36('0xd7')][_0x1b36('0x3b')]);_0x2905d4[_0x1b36('0x40')]=_[_0x1b36('0x54')](_0x52a024['query']);_0x2905d4['filters']=_[_0x1b36('0x43')](_0x2905d4[_0x1b36('0x3f')],_0x2905d4['query']);_0xda570d[_0x1b36('0x42')]=_[_0x1b36('0x43')](_0x2905d4['model'],qs['fields'](_0x52a024[_0x1b36('0x40')][_0x1b36('0x44')]));_0xda570d['attributes']=_0xda570d[_0x1b36('0x42')][_0x1b36('0x55')]?_0xda570d['attributes']:_0x2905d4[_0x1b36('0x3f')];if(!_0x52a024[_0x1b36('0x40')]['hasOwnProperty'](_0x1b36('0x46'))){_0xda570d[_0x1b36('0x47')]=qs[_0x1b36('0x47')](_0x52a024[_0x1b36('0x40')][_0x1b36('0x47')]);_0xda570d['offset']=qs[_0x1b36('0x2b')](_0x52a024['query'][_0x1b36('0x2b')]);}_0xda570d[_0x1b36('0x48')]=qs[_0x1b36('0x49')](_0x52a024[_0x1b36('0x40')][_0x1b36('0x49')]);_0xda570d[_0x1b36('0x4b')]=qs[_0x1b36('0x41')](_['pick'](_0x52a024['query'],_0x2905d4[_0x1b36('0x41')]));_0xda570d[_0x1b36('0x4b')][_0x1b36('0x65')]=_0x126c36['id'];if(_0x52a024[_0x1b36('0x40')][_0x1b36('0x4e')]){_0xda570d[_0x1b36('0x4b')]=_[_0x1b36('0x4c')](_0xda570d[_0x1b36('0x4b')],{'$or':_[_0x1b36('0x39')](_0xda570d['attributes'],function(_0x4f718e){var _0x3dfd83={};_0x3dfd83[_0x4f718e]={'$like':'%'+_0x52a024[_0x1b36('0x40')][_0x1b36('0x4e')]+'%'};return _0x3dfd83;})});}_0xda570d=_[_0x1b36('0x4c')]({},_0xda570d,_0x52a024[_0x1b36('0x57')]);return db[_0x1b36('0xd7')][_0x1b36('0x2a')]({'where':_0xda570d[_0x1b36('0x4b')]})[_0x1b36('0x30')](function(_0x4152f5){_0x501662[_0x1b36('0x2a')]=_0x4152f5;if(_0x52a024[_0x1b36('0x40')]['includeAll']){_0xda570d['include']=[{'all':!![]}];}else{_0xda570d[_0x1b36('0x4f')]=[{'model':db[_0x1b36('0x90')],'as':_0x1b36('0x118'),'required':![]}];}return db[_0x1b36('0xd7')][_0x1b36('0x50')](_0xda570d);})['then'](function(_0x48febf){_0x501662[_0x1b36('0x68')]=_0x48febf;return _0x501662;});}})[_0x1b36('0x30')](respondWithFilteredResult(_0x3fc1dd,_0xda570d))['catch'](handleError(_0x3fc1dd,null));};exports[_0x1b36('0x119')]=function(_0x20cdb0,_0x351451,_0x125a4a){return db[_0x1b36('0x3a')][_0x1b36('0x58')]({'where':{'id':_0x20cdb0['params']['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0x351451,null))[_0x1b36('0x30')](function(_0x44e4e6){if(_0x44e4e6){return _0x44e4e6[_0x1b36('0x119')](_0x20cdb0[_0x1b36('0x5a')][_0x1b36('0x6a')],_[_0x1b36('0xe5')](_0x20cdb0[_0x1b36('0x5a')],[_0x1b36('0x6a'),'id'])||{})[_0x1b36('0xd2')](function(_0x261b12){for(var _0x2bd1c2=0x0;_0x2bd1c2<_0x20cdb0[_0x1b36('0x5a')][_0x1b36('0x6a')][_0x1b36('0x55')];_0x2bd1c2+=0x1){socket[_0x1b36('0x11a')]('userChatWebsite:save',{'UserId':_0x20cdb0['body']['ids'][_0x2bd1c2],'ChatWebsiteId':_0x20cdb0['params']['id']});}return _0x261b12;});}})[_0x1b36('0x30')](respondWithResult(_0x351451,null))[_0x1b36('0x27')](handleError(_0x351451,null));};exports[_0x1b36('0x11b')]=function(_0xe34c4c,_0x2ae89c,_0x33a151){return db[_0x1b36('0x3a')]['find']({'where':{'id':_0xe34c4c['params']['id']}})[_0x1b36('0x30')](handleEntityNotFound(_0x2ae89c,null))[_0x1b36('0x30')](function(_0x1fbb74){if(_0x1fbb74){return _0x1fbb74[_0x1b36('0x11b')](_0xe34c4c[_0x1b36('0x40')][_0x1b36('0x6a')])[_0x1b36('0x30')](function(){if(_[_0x1b36('0x11c')](_0xe34c4c['query'][_0x1b36('0x6a')])){for(var _0x4a26c6=0x0;_0x4a26c6<_0xe34c4c[_0x1b36('0x40')]['ids'][_0x1b36('0x55')];_0x4a26c6+=0x1){socket[_0x1b36('0x11a')]('userChatWebsite:remove',{'UserId':Number(_0xe34c4c[_0x1b36('0x40')][_0x1b36('0x6a')][_0x4a26c6]),'ChatWebsiteId':Number(_0xe34c4c[_0x1b36('0x52')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0xe34c4c[_0x1b36('0x40')][_0x1b36('0x6a')]),'ChatWebsiteId':Number(_0xe34c4c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2ae89c,null))['catch'](handleError(_0x2ae89c,null));};exports[_0x1b36('0x11d')]=function(_0x322cc1,_0xa2f3f,_0x5eaa76){var _0x2141af={};var _0x576a3c={};var _0x26b609;var _0x517436;return db[_0x1b36('0x3a')]['findOne']({'where':{'id':_0x322cc1[_0x1b36('0x52')]['id']}})['then'](handleEntityNotFound(_0xa2f3f,null))[_0x1b36('0x30')](function(_0x10ef62){if(_0x10ef62){_0x26b609=_0x10ef62;_0x576a3c[_0x1b36('0x3f')]=_[_0x1b36('0x54')](db[_0x1b36('0xe7')]['rawAttributes']);_0x576a3c[_0x1b36('0x40')]=_['keys'](_0x322cc1['query']);_0x576a3c[_0x1b36('0x41')]=_[_0x1b36('0x43')](_0x576a3c[_0x1b36('0x3f')],_0x576a3c['query']);_0x2141af[_0x1b36('0x42')]=_[_0x1b36('0x43')](_0x576a3c['model'],qs[_0x1b36('0x44')](_0x322cc1[_0x1b36('0x40')][_0x1b36('0x44')]));_0x2141af[_0x1b36('0x42')]=_0x2141af[_0x1b36('0x42')][_0x1b36('0x55')]?_0x2141af[_0x1b36('0x42')]:_0x576a3c[_0x1b36('0x3f')];_0x2141af[_0x1b36('0x48')]=qs[_0x1b36('0x49')](_0x322cc1[_0x1b36('0x40')]['sort']);_0x2141af['where']=qs['filters'](_[_0x1b36('0x4a')](_0x322cc1[_0x1b36('0x40')],_0x576a3c[_0x1b36('0x41')]));if(_0x322cc1[_0x1b36('0x40')][_0x1b36('0x4e')]){_0x2141af[_0x1b36('0x4b')]=_[_0x1b36('0x4c')](_0x2141af['where'],{'$or':_['map'](_0x2141af[_0x1b36('0x42')],function(_0x28f371){var _0x321d3e={};_0x321d3e[_0x28f371]={'$like':'%'+_0x322cc1['query'][_0x1b36('0x4e')]+'%'};return _0x321d3e;})});}_0x2141af=_[_0x1b36('0x4c')]({},_0x2141af,_0x322cc1['options']);return _0x26b609[_0x1b36('0x11d')](_0x2141af);}})[_0x1b36('0x30')](function(_0x3ffd46){if(_0x3ffd46){_0x517436=_0x3ffd46[_0x1b36('0x55')];if(!_0x322cc1[_0x1b36('0x40')]['hasOwnProperty'](_0x1b36('0x46'))){_0x2141af[_0x1b36('0x47')]=qs['limit'](_0x322cc1['query']['limit']);_0x2141af['offset']=qs[_0x1b36('0x2b')](_0x322cc1['query'][_0x1b36('0x2b')]);}return _0x26b609[_0x1b36('0x11d')](_0x2141af);}})[_0x1b36('0x30')](function(_0x3f0bd7){if(_0x3f0bd7){return _0x3f0bd7?{'count':_0x517436,'rows':_0x3f0bd7}:null;}})['then'](respondWithResult(_0xa2f3f,null))['catch'](handleError(_0xa2f3f,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index f73b11b..4668f07 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 _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
+var _0xa991=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0xa991,0x143));var _0x1a99=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xa991[_0x51020b];return _0x371e47;};'use strict';var EventEmitter=require(_0x1a99('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x1a99('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1a99('0x2')](0x0);var events={'afterCreate':_0x1a99('0x3'),'afterUpdate':_0x1a99('0x4'),'afterDestroy':_0x1a99('0x5')};function emitEvent(_0x577db5){return function(_0x46c8c4,_0x1fe48a,_0x118756){ChatWebsiteEvents[_0x1a99('0x6')](_0x577db5+':'+_0x46c8c4['id'],_0x46c8c4);ChatWebsiteEvents[_0x1a99('0x6')](_0x577db5,_0x46c8c4);_0x118756(null);};}for(var e in events){if(events[_0x1a99('0x7')](e)){var event=events[e];ChatWebsite[_0x1a99('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 75615ed..532637a 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 _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
+var _0x4a81=['../../config/logger','api','request-promise','rimraf','../../config/environment','define','chat_websites','lodash','util'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x4a81,0x1b7));var _0x14a8=function(_0x1f145d,_0x5ae31){_0x1f145d=_0x1f145d-0x0;var _0x15fbfc=_0x4a81[_0x1f145d];return _0x15fbfc;};'use strict';var _=require(_0x14a8('0x0'));var util=require(_0x14a8('0x1'));var logger=require(_0x14a8('0x2'))(_0x14a8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x14a8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x14a8('0x5'));var config=require(_0x14a8('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x2cd6d2,_0x4aa19e){return _0x2cd6d2[_0x14a8('0x7')]('ChatWebsite',attributes,{'tableName':_0x14a8('0x8'),'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 46ec30f..342755f 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 _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
+var _0x8952=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','then','info','request\x20sent','debug','stringify','code','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0x8952,0x17e));var _0x2895=function(_0x369950,_0x40a21c){_0x369950=_0x369950-0x0;var _0x4c3d0e=_0x8952[_0x369950];return _0x4c3d0e;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2895('0xb')],{'host':_0x2895('0xc'),'port':0x18eb});var socket=require(_0x2895('0xd'))(new Redis(config[_0x2895('0xb')]));require(_0x2895('0xe'))['register'](socket);function respondWithRpcPromise(_0x14fb67,_0x5f2632,_0x428772){return new BPromise(function(_0x5af454,_0x5e66fc){return client['request'](_0x14fb67,_0x428772)[_0x2895('0xf')](function(_0x1829a2){logger[_0x2895('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'));logger[_0x2895('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'),JSON[_0x2895('0x13')](_0x1829a2));if(_0x1829a2['error']){if(_0x1829a2['error'][_0x2895('0x14')]===0x1f4){logger[_0x2895('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5e66fc(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}logger[_0x2895('0x15')](_0x2895('0x17'),_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5af454(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}else{logger[_0x2895('0x10')](_0x2895('0x17'),_0x5f2632,_0x2895('0x11'));_0x5af454(_0x1829a2[_0x2895('0x18')][_0x2895('0x16')]);}})[_0x2895('0x19')](function(_0x2fe8fe){logger[_0x2895('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x5f2632,_0x2fe8fe);_0x5e66fc(_0x2fe8fe);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index fa1d533..af684f4 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(_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
+var _0x7a54=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x3c3b27,_0x343d00){var _0x14173c=function(_0x2458f7){while(--_0x2458f7){_0x3c3b27['push'](_0x3c3b27['shift']());}};_0x14173c(++_0x343d00);}(_0x7a54,0x106));var _0x47a5=function(_0x5e847e,_0x5ce3f2){_0x5e847e=_0x5e847e-0x0;var _0x7a3862=_0x7a54[_0x5e847e];return _0x7a3862;};'use strict';var ChatWebsiteEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){ChatWebsiteEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);ChatWebsiteEvents['on'](_0x30e405,_0x506eda);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index dbed8d0..897d27e 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 _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
+var _0x1a6c=['/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','create','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','addAvatar','/:id/customer_avatar','addCustomerAvatar','server/files/images/avatars/','/:id/system_avatar','/:id/notify','notify','offline','addApplications','/:id/users','addAgents','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions'];(function(_0x24a88e,_0x22a0b8){var _0x232cbb=function(_0x50b7a4){while(--_0x50b7a4){_0x24a88e['push'](_0x24a88e['shift']());}};_0x232cbb(++_0x22a0b8);}(_0x1a6c,0xeb));var _0xc1a6=function(_0x5237df,_0x54a1b2){_0x5237df=_0x5237df-0x0;var _0xe8cd5c=_0x1a6c[_0x5237df];return _0xe8cd5c;};'use strict';var multer=require(_0xc1a6('0x0'));var util=require(_0xc1a6('0x1'));var path=require(_0xc1a6('0x2'));var timeout=require('connect-timeout');var express=require(_0xc1a6('0x3'));var router=express[_0xc1a6('0x4')]();var auth=require(_0xc1a6('0x5'));var interaction=require(_0xc1a6('0x6'));var config=require(_0xc1a6('0x7'));var controller=require(_0xc1a6('0x8'));router['get']('/',auth[_0xc1a6('0x9')](),controller[_0xc1a6('0xa')]);router[_0xc1a6('0xb')](_0xc1a6('0xc'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xc1a6('0x9')](),controller[_0xc1a6('0xd')]);router[_0xc1a6('0xb')](_0xc1a6('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xc1a6('0xb')](_0xc1a6('0xf'),auth[_0xc1a6('0x9')](),controller[_0xc1a6('0x10')]);router[_0xc1a6('0xb')](_0xc1a6('0x11'),controller[_0xc1a6('0x12')]);router['get'](_0xc1a6('0x13'),controller[_0xc1a6('0x14')]);router[_0xc1a6('0xb')]('/:id/customer_avatar',controller[_0xc1a6('0x15')]);router[_0xc1a6('0xb')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0xc1a6('0xb')](_0xc1a6('0x16'),auth[_0xc1a6('0x9')](),controller[_0xc1a6('0x17')]);router[_0xc1a6('0xb')](_0xc1a6('0x18'),controller[_0xc1a6('0x19')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller[_0xc1a6('0x1a')]);router[_0xc1a6('0xb')](_0xc1a6('0x1b'),auth[_0xc1a6('0x9')](),controller[_0xc1a6('0x1c')]);router[_0xc1a6('0xb')](_0xc1a6('0x1d'),controller[_0xc1a6('0x1e')]);router[_0xc1a6('0xb')](_0xc1a6('0x1f'),auth[_0xc1a6('0x9')](),controller[_0xc1a6('0x20')]);router[_0xc1a6('0xb')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xc1a6('0x9')](),controller[_0xc1a6('0x21')]);router[_0xc1a6('0x22')](_0xc1a6('0xe'),auth['isAuthenticated'](),controller[_0xc1a6('0x23')]);router['post'](_0xc1a6('0xf'),auth[_0xc1a6('0x9')](),controller[_0xc1a6('0x24')]);var upload=multer({'storage':multer[_0xc1a6('0x25')]({'destination':function(_0x5b76bb,_0x31aefa,_0x534dc3){_0x534dc3(null,path[_0xc1a6('0x26')](config[_0xc1a6('0x27')],_0xc1a6('0x28')));},'filename':function(_0x1bec92,_0x6ef69a,_0x5d252a){_0x5d252a(null,util[_0xc1a6('0x29')](_0xc1a6('0x2a'),Date[_0xc1a6('0x2b')](),_0x6ef69a[_0xc1a6('0x2c')]));}})});router[_0xc1a6('0x22')](_0xc1a6('0x11'),upload[_0xc1a6('0x2d')](_0xc1a6('0x2e')),controller[_0xc1a6('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb893b3,_0xdf1671,_0x3ebae7){_0x3ebae7(null,path[_0xc1a6('0x26')](config[_0xc1a6('0x27')],'server/files/images/avatars/'));},'filename':function(_0x186389,_0xfad3af,_0xb4145b){_0xb4145b(null,util[_0xc1a6('0x29')]('%s-%s',Date[_0xc1a6('0x2b')](),_0xfad3af[_0xc1a6('0x2c')]));}})});router[_0xc1a6('0x22')]('/:id/avatar',upload[_0xc1a6('0x2d')](_0xc1a6('0x2e')),controller[_0xc1a6('0x30')]);var upload=multer({'storage':multer[_0xc1a6('0x25')]({'destination':function(_0x3ea9ac,_0x451fd3,_0xa5bcae){_0xa5bcae(null,path['join'](config[_0xc1a6('0x27')],'server/files/images/avatars/'));},'filename':function(_0x28e17a,_0x2198aa,_0x1a7670){_0x1a7670(null,util[_0xc1a6('0x29')]('%s-%s',Date[_0xc1a6('0x2b')](),_0x2198aa['originalname']));}})});router[_0xc1a6('0x22')](_0xc1a6('0x31'),upload[_0xc1a6('0x2d')]('file'),controller[_0xc1a6('0x32')]);var upload=multer({'storage':multer[_0xc1a6('0x25')]({'destination':function(_0x2a6595,_0x3d5588,_0x37ac85){_0x37ac85(null,path[_0xc1a6('0x26')](config[_0xc1a6('0x27')],_0xc1a6('0x33')));},'filename':function(_0x1d9ea7,_0x5e09d0,_0x350fc2){_0x350fc2(null,util[_0xc1a6('0x29')]('%s-%s',Date[_0xc1a6('0x2b')](),_0x5e09d0[_0xc1a6('0x2c')]));}})});router[_0xc1a6('0x22')](_0xc1a6('0x34'),upload[_0xc1a6('0x2d')](_0xc1a6('0x2e')),controller['addSystemAvatar']);router[_0xc1a6('0x22')](_0xc1a6('0x35'),controller[_0xc1a6('0x36')]);router[_0xc1a6('0x22')]('/:id/offline',controller[_0xc1a6('0x37')]);router[_0xc1a6('0x22')](_0xc1a6('0x16'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xc1a6('0x22')]('/:id/applications',auth[_0xc1a6('0x9')](),controller[_0xc1a6('0x38')]);router[_0xc1a6('0x22')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router[_0xc1a6('0x22')](_0xc1a6('0x39'),auth[_0xc1a6('0x9')](),controller[_0xc1a6('0x3a')]);router['put']('/:id',auth[_0xc1a6('0x9')](),controller['update']);router[_0xc1a6('0x3b')](_0xc1a6('0x3c'),auth[_0xc1a6('0x9')](),controller[_0xc1a6('0x3d')]);router[_0xc1a6('0x3b')](_0xc1a6('0xe'),auth[_0xc1a6('0x9')](),controller[_0xc1a6('0x3e')]);router['delete'](_0xc1a6('0xf'),auth[_0xc1a6('0x9')](),controller[_0xc1a6('0x3f')]);router[_0xc1a6('0x3b')](_0xc1a6('0x39'),auth[_0xc1a6('0x9')](),controller[_0xc1a6('0x40')]);module[_0xc1a6('0x41')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 8bc39e3..5bad0ee 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 _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
+var _0xf603=['ENUM','AmazonAWS','Google','STRING','sequelize','exports'];(function(_0x3c19c7,_0x2180e3){var _0x47b01a=function(_0x122724){while(--_0x122724){_0x3c19c7['push'](_0x3c19c7['shift']());}};_0x47b01a(++_0x2180e3);}(_0xf603,0x124));var _0x3f60=function(_0x38a80f,_0x3bd80d){_0x38a80f=_0x38a80f-0x0;var _0x50f5c2=_0xf603[_0x38a80f];return _0x50f5c2;};'use strict';var Sequelize=require(_0x3f60('0x0'));module[_0x3f60('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3f60('0x2')](_0x3f60('0x3'),_0x3f60('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3f60('0x5')]},'data2':{'type':Sequelize[_0x3f60('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index b38ceb1..0490f42 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 _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
+var _0xb3bb=['filter','options','includeAll','findAll','catch','params','rawAttributes','include','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','index','map','CloudProvider','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filters','merge','type','VIRTUAL'];(function(_0xb06354,_0x464d11){var _0x44da6c=function(_0x1c900f){while(--_0x1c900f){_0xb06354['push'](_0xb06354['shift']());}};_0x44da6c(++_0x464d11);}(_0xb3bb,0x95));var _0xbb3b=function(_0x37171d,_0x52cd92){_0x37171d=_0x37171d-0x0;var _0x14faab=_0xb3bb[_0x37171d];return _0x14faab;};'use strict';var pdf=require(_0xbb3b('0x0'));var emlformat=require(_0xbb3b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbb3b('0x2'));var jsonpatch=require(_0xbb3b('0x3'));var rp=require(_0xbb3b('0x4'));var moment=require(_0xbb3b('0x5'));var BPromise=require(_0xbb3b('0x6'));var Mustache=require(_0xbb3b('0x7'));var util=require('util');var path=require(_0xbb3b('0x8'));var sox=require(_0xbb3b('0x9'));var csv=require(_0xbb3b('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbb3b('0xb'));var squel=require(_0xbb3b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbb3b('0xd'));var toCsv=require(_0xbb3b('0xa'));var querystring=require(_0xbb3b('0xe'));var Papa=require(_0xbb3b('0xf'));var Redis=require(_0xbb3b('0x10'));var authService=require(_0xbb3b('0x11'));var qs=require(_0xbb3b('0x12'));var as=require(_0xbb3b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb3b('0x14'))('api');var utils=require(_0xbb3b('0x15'));var config=require(_0xbb3b('0x16'));var db=require(_0xbb3b('0x17'))['db'];function respondWithStatusCode(_0x4c5758,_0x471b98){_0x471b98=_0x471b98||0xcc;return function(_0x40f4e5){if(_0x40f4e5){return _0x4c5758[_0xbb3b('0x18')](_0x471b98);}return _0x4c5758['status'](_0x471b98)['end']();};}function respondWithResult(_0x3106dd,_0x437078){_0x437078=_0x437078||0xc8;return function(_0x15a71f){if(_0x15a71f){return _0x3106dd[_0xbb3b('0x19')](_0x437078)['json'](_0x15a71f);}};}function respondWithFilteredResult(_0x21569d,_0x5f0f5e){return function(_0x468446){if(_0x468446){var _0x21f91a=_0x468446[_0xbb3b('0x1a')],_0x5e314c=_0x5f0f5e[_0xbb3b('0x1b')],_0x134935=_0x5f0f5e[_0xbb3b('0x1b')]+_0x5f0f5e['limit'],_0x5b3502;if(_0x134935>=_0x21f91a){_0x134935=_0x21f91a;_0x5b3502=0xc8;}else{_0x5b3502=0xce;}_0x21569d[_0xbb3b('0x19')](_0x5b3502);return _0x21569d['set'](_0xbb3b('0x1c'),_0x5e314c+'-'+_0x134935+'/'+_0x21f91a)[_0xbb3b('0x1d')](_0x468446);}return null;};}function patchUpdates(_0x2fc181){return function(_0x16789b){try{jsonpatch[_0xbb3b('0x1e')](_0x16789b,_0x2fc181,!![]);}catch(_0x5c396a){return BPromise[_0xbb3b('0x1f')](_0x5c396a);}return _0x16789b[_0xbb3b('0x20')]();};}function saveUpdates(_0x3d91fe,_0x50a823){return function(_0x54e6cd){if(_0x54e6cd){return _0x54e6cd[_0xbb3b('0x21')](_0x3d91fe)[_0xbb3b('0x22')](function(_0x34da46){return _0x34da46;});}return null;};}function removeEntity(_0x1f0ad5,_0x5e342c){return function(_0x16416f){if(_0x16416f){return _0x16416f[_0xbb3b('0x23')]()[_0xbb3b('0x22')](function(){_0x1f0ad5[_0xbb3b('0x19')](0xcc)[_0xbb3b('0x24')]();});}};}function handleEntityNotFound(_0x348187,_0x1edc5a){return function(_0xb69f8e){if(!_0xb69f8e){_0x348187[_0xbb3b('0x18')](0x194);}return _0xb69f8e;};}function handleError(_0x532748,_0x3da334){_0x3da334=_0x3da334||0x1f4;return function(_0xb36690){logger['error'](_0xb36690[_0xbb3b('0x25')]);if(_0xb36690[_0xbb3b('0x26')]){delete _0xb36690[_0xbb3b('0x26')];}_0x532748['status'](_0x3da334)['send'](_0xb36690);};}exports[_0xbb3b('0x27')]=function(_0x44ffb0,_0x9365fe){var _0xaef28d={},_0x123705={},_0x3e7b5f={'count':0x0,'rows':[]};var _0x15a458=_[_0xbb3b('0x28')](db[_0xbb3b('0x29')]['rawAttributes'],function(_0x735a09){return{'name':_0x735a09[_0xbb3b('0x2a')],'type':_0x735a09['type']['key']};});_0x123705[_0xbb3b('0x2b')]=_[_0xbb3b('0x28')](_0x15a458,_0xbb3b('0x26'));_0x123705[_0xbb3b('0x2c')]=_[_0xbb3b('0x2d')](_0x44ffb0[_0xbb3b('0x2c')]);_0x123705['filters']=_[_0xbb3b('0x2e')](_0x123705[_0xbb3b('0x2b')],_0x123705['query']);_0xaef28d[_0xbb3b('0x2f')]=_[_0xbb3b('0x2e')](_0x123705[_0xbb3b('0x2b')],qs[_0xbb3b('0x30')](_0x44ffb0[_0xbb3b('0x2c')]['fields']));_0xaef28d[_0xbb3b('0x2f')]=_0xaef28d[_0xbb3b('0x2f')]['length']?_0xaef28d[_0xbb3b('0x2f')]:_0x123705[_0xbb3b('0x2b')];if(!_0x44ffb0[_0xbb3b('0x2c')][_0xbb3b('0x31')]('nolimit')){_0xaef28d[_0xbb3b('0x32')]=qs[_0xbb3b('0x32')](_0x44ffb0[_0xbb3b('0x2c')]['limit']);_0xaef28d[_0xbb3b('0x1b')]=qs[_0xbb3b('0x1b')](_0x44ffb0['query']['offset']);}_0xaef28d['order']=qs['sort'](_0x44ffb0[_0xbb3b('0x2c')][_0xbb3b('0x33')]);_0xaef28d[_0xbb3b('0x34')]=qs['filters'](_[_0xbb3b('0x35')](_0x44ffb0[_0xbb3b('0x2c')],_0x123705[_0xbb3b('0x36')]),_0x15a458);if(_0x44ffb0[_0xbb3b('0x2c')]['filter']){_0xaef28d[_0xbb3b('0x34')]=_[_0xbb3b('0x37')](_0xaef28d['where'],{'$or':_[_0xbb3b('0x28')](_0x15a458,function(_0x3d3ae1){if(_0x3d3ae1[_0xbb3b('0x38')]!==_0xbb3b('0x39')){var _0x234c23={};_0x234c23[_0x3d3ae1['name']]={'$like':'%'+_0x44ffb0[_0xbb3b('0x2c')][_0xbb3b('0x3a')]+'%'};return _0x234c23;}})});}_0xaef28d=_[_0xbb3b('0x37')]({},_0xaef28d,_0x44ffb0[_0xbb3b('0x3b')]);var _0x3a1612={'where':_0xaef28d['where']};return db[_0xbb3b('0x29')][_0xbb3b('0x1a')](_0x3a1612)[_0xbb3b('0x22')](function(_0x4b931b){_0x3e7b5f['count']=_0x4b931b;if(_0x44ffb0[_0xbb3b('0x2c')][_0xbb3b('0x3c')]){_0xaef28d['include']=[{'all':!![]}];}return db[_0xbb3b('0x29')][_0xbb3b('0x3d')](_0xaef28d);})['then'](function(_0x390698){_0x3e7b5f['rows']=_0x390698;return _0x3e7b5f;})['then'](respondWithFilteredResult(_0x9365fe,_0xaef28d))[_0xbb3b('0x3e')](handleError(_0x9365fe,null));};exports['show']=function(_0x473304,_0x31c7de){var _0x2082d0={'raw':!![],'where':{'id':_0x473304[_0xbb3b('0x3f')]['id']}},_0x370971={};_0x370971['model']=_[_0xbb3b('0x2d')](db['CloudProvider'][_0xbb3b('0x40')]);_0x370971['query']=_['keys'](_0x473304['query']);_0x370971['filters']=_['intersection'](_0x370971['model'],_0x370971['query']);_0x2082d0[_0xbb3b('0x2f')]=_[_0xbb3b('0x2e')](_0x370971[_0xbb3b('0x2b')],qs['fields'](_0x473304[_0xbb3b('0x2c')]['fields']));_0x2082d0[_0xbb3b('0x2f')]=_0x2082d0[_0xbb3b('0x2f')]['length']?_0x2082d0['attributes']:_0x370971[_0xbb3b('0x2b')];if(_0x473304[_0xbb3b('0x2c')][_0xbb3b('0x3c')]){_0x2082d0[_0xbb3b('0x41')]=[{'all':!![]}];}_0x2082d0=_['merge']({},_0x2082d0,_0x473304[_0xbb3b('0x3b')]);return db[_0xbb3b('0x29')][_0xbb3b('0x42')](_0x2082d0)[_0xbb3b('0x22')](handleEntityNotFound(_0x31c7de,null))[_0xbb3b('0x22')](respondWithResult(_0x31c7de,null))[_0xbb3b('0x3e')](handleError(_0x31c7de,null));};exports[_0xbb3b('0x43')]=function(_0x21f20d,_0x1120f3){return db['CloudProvider']['create'](_0x21f20d[_0xbb3b('0x44')],{})[_0xbb3b('0x22')](respondWithResult(_0x1120f3,0xc9))[_0xbb3b('0x3e')](handleError(_0x1120f3,null));};exports[_0xbb3b('0x21')]=function(_0x13ae60,_0x695936){if(_0x13ae60[_0xbb3b('0x44')]['id']){delete _0x13ae60['body']['id'];}return db[_0xbb3b('0x29')][_0xbb3b('0x42')]({'where':{'id':_0x13ae60['params']['id']}})[_0xbb3b('0x22')](handleEntityNotFound(_0x695936,null))[_0xbb3b('0x22')](saveUpdates(_0x13ae60['body'],null))['then'](respondWithResult(_0x695936,null))['catch'](handleError(_0x695936,null));};exports[_0xbb3b('0x23')]=function(_0x78079a,_0x4c3328){return db[_0xbb3b('0x29')][_0xbb3b('0x42')]({'where':{'id':_0x78079a[_0xbb3b('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4c3328,null))[_0xbb3b('0x22')](removeEntity(_0x4c3328,null))['catch'](handleError(_0x4c3328,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 1ff6a5e..85e312e 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 _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
+var _0xf49b=['exports','define','CloudProvider','cloud_providers','lodash','api','moment','bluebird','rimraf','../../config/environment','./cloudProvider.attributes'];(function(_0x5742c4,_0x5d94fc){var _0x3eecc9=function(_0x1a8a56){while(--_0x1a8a56){_0x5742c4['push'](_0x5742c4['shift']());}};_0x3eecc9(++_0x5d94fc);}(_0xf49b,0x9e));var _0xbf49=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf49b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xbf49('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbf49('0x1'));var moment=require(_0xbf49('0x2'));var BPromise=require(_0xbf49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf49('0x4'));var config=require(_0xbf49('0x5'));var attributes=require(_0xbf49('0x6'));module[_0xbf49('0x7')]=function(_0x4576c3,_0x2d7529){return _0x4576c3[_0xbf49('0x8')](_0xbf49('0x9'),attributes,{'tableName':_0xbf49('0xa'),'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 13d33c8..d08f9af 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 _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
+var _0xa1be=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa1be,0x158));var _0xea1b=function(_0x3d5976,_0x1e4c7c){_0x3d5976=_0x3d5976-0x0;var _0x29df50=_0xa1be[_0x3d5976];return _0x29df50;};'use strict';var _=require(_0xea1b('0x0'));var util=require(_0xea1b('0x1'));var moment=require(_0xea1b('0x2'));var BPromise=require(_0xea1b('0x3'));var rs=require(_0xea1b('0x4'));var fs=require('fs');var Redis=require(_0xea1b('0x5'));var db=require(_0xea1b('0x6'))['db'];var utils=require(_0xea1b('0x7'));var logger=require(_0xea1b('0x8'))(_0xea1b('0x9'));var config=require(_0xea1b('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xea1b('0xb')][_0xea1b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc992ef,_0x1e2000,_0x2673ac){return new BPromise(function(_0x2f9ea1,_0x4590a8){return client[_0xea1b('0xd')](_0xc992ef,_0x2673ac)[_0xea1b('0xe')](function(_0x30fac8){logger[_0xea1b('0xf')](_0xea1b('0x10'),_0x1e2000,_0xea1b('0x11'));logger[_0xea1b('0x12')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x1e2000,_0xea1b('0x11'),JSON['stringify'](_0x30fac8));if(_0x30fac8[_0xea1b('0x13')]){if(_0x30fac8[_0xea1b('0x13')][_0xea1b('0x14')]===0x1f4){logger[_0xea1b('0x13')](_0xea1b('0x10'),_0x1e2000,_0x30fac8['error'][_0xea1b('0x15')]);return _0x4590a8(_0x30fac8[_0xea1b('0x13')][_0xea1b('0x15')]);}logger[_0xea1b('0x13')](_0xea1b('0x10'),_0x1e2000,_0x30fac8['error'][_0xea1b('0x15')]);return _0x2f9ea1(_0x30fac8[_0xea1b('0x13')][_0xea1b('0x15')]);}else{logger[_0xea1b('0xf')]('CloudProvider,\x20%s,\x20%s',_0x1e2000,_0xea1b('0x11'));_0x2f9ea1(_0x30fac8[_0xea1b('0x16')][_0xea1b('0x15')]);}})[_0xea1b('0x17')](function(_0x3f5dca){logger[_0xea1b('0x13')](_0xea1b('0x10'),_0x1e2000,_0x3f5dca);_0x4590a8(_0x3f5dca);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index c8df668..bbb3c89 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 _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
+var _0xb086=['index','get','show','create','put','/:id','update','delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x484d46,_0x573649){var _0x5482ba=function(_0x408482){while(--_0x408482){_0x484d46['push'](_0x484d46['shift']());}};_0x5482ba(++_0x573649);}(_0xb086,0x80));var _0x6b08=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb086[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x6b08('0x0'));var util=require(_0x6b08('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b08('0x2'));var router=express[_0x6b08('0x3')]();var auth=require(_0x6b08('0x4'));var interaction=require(_0x6b08('0x5'));var config=require(_0x6b08('0x6'));var controller=require('./cloudProvider.controller');router['get']('/',auth[_0x6b08('0x7')](),controller[_0x6b08('0x8')]);router[_0x6b08('0x9')]('/:id',auth[_0x6b08('0x7')](),controller[_0x6b08('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6b08('0xb')]);router[_0x6b08('0xc')](_0x6b08('0xd'),auth[_0x6b08('0x7')](),controller[_0x6b08('0xe')]);router[_0x6b08('0xf')](_0x6b08('0xd'),auth[_0x6b08('0x7')](),controller[_0x6b08('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index ed59986..71e45d9 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 _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
+var _0x81d4=['STRING','name','sequelize','exports'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x81d4,0xa2));var _0x481d=function(_0x1b3ef4,_0x1e581a){_0x1b3ef4=_0x1b3ef4-0x0;var _0x59f974=_0x81d4[_0x1b3ef4];return _0x59f974;};'use strict';var Sequelize=require(_0x481d('0x0'));module[_0x481d('0x1')]={'name':{'type':Sequelize[_0x481d('0x2')],'unique':_0x481d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x481d('0x2')]},'website':{'type':Sequelize[_0x481d('0x2')]},'phone':{'type':Sequelize[_0x481d('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x481d('0x2')]},'postalCode':{'type':Sequelize[_0x481d('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x481d('0x2')]},'email':{'type':Sequelize[_0x481d('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x481d('0x2')]},'sStreet':{'type':Sequelize[_0x481d('0x2')]},'sPostalCode':{'type':Sequelize[_0x481d('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x481d('0x2')]},'description':{'type':Sequelize[_0x481d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index f74cccf..77ac570 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 _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
+var _0x183b=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','describe','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','map','CmCompany','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','user','role','Companies','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','omit','sort','getContacts','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service'];(function(_0x59de2a,_0x264f62){var _0x1d18d2=function(_0x5c1a5a){while(--_0x5c1a5a){_0x59de2a['push'](_0x59de2a['shift']());}};_0x1d18d2(++_0x264f62);}(_0x183b,0xf5));var _0xb183=function(_0x13ebc2,_0x45c866){_0x13ebc2=_0x13ebc2-0x0;var _0x7335af=_0x183b[_0x13ebc2];return _0x7335af;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb183('0x0'));var rimraf=require(_0xb183('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb183('0x2'));var moment=require(_0xb183('0x3'));var BPromise=require(_0xb183('0x4'));var Mustache=require(_0xb183('0x5'));var util=require('util');var path=require(_0xb183('0x6'));var sox=require('sox');var csv=require(_0xb183('0x7'));var ejs=require(_0xb183('0x8'));var fs=require('fs');var _=require(_0xb183('0x9'));var squel=require(_0xb183('0xa'));var crypto=require(_0xb183('0xb'));var jsforce=require(_0xb183('0xc'));var deskjs=require(_0xb183('0xd'));var toCsv=require(_0xb183('0x7'));var querystring=require(_0xb183('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb183('0xf'));var qs=require(_0xb183('0x10'));var as=require(_0xb183('0x11'));var hardwareService=require(_0xb183('0x12'));var logger=require(_0xb183('0x13'))(_0xb183('0x14'));var utils=require('../../config/utils');var config=require(_0xb183('0x15'));var db=require(_0xb183('0x16'))['db'];function respondWithStatusCode(_0x452e26,_0x531a97){_0x531a97=_0x531a97||0xcc;return function(_0x46b168){if(_0x46b168){return _0x452e26[_0xb183('0x17')](_0x531a97);}return _0x452e26[_0xb183('0x18')](_0x531a97)[_0xb183('0x19')]();};}function respondWithResult(_0x2acf47,_0x4ad380){_0x4ad380=_0x4ad380||0xc8;return function(_0x126b5d){if(_0x126b5d){return _0x2acf47['status'](_0x4ad380)['json'](_0x126b5d);}};}function respondWithFilteredResult(_0x196f9e,_0x2f281e){return function(_0x411a0c){if(_0x411a0c){var _0x3ef580=_0x411a0c[_0xb183('0x1a')],_0x34be2d=_0x2f281e['offset'],_0x279d50=_0x2f281e[_0xb183('0x1b')]+_0x2f281e['limit'],_0x29d8d2;if(_0x279d50>=_0x3ef580){_0x279d50=_0x3ef580;_0x29d8d2=0xc8;}else{_0x29d8d2=0xce;}_0x196f9e['status'](_0x29d8d2);return _0x196f9e[_0xb183('0x1c')](_0xb183('0x1d'),_0x34be2d+'-'+_0x279d50+'/'+_0x3ef580)[_0xb183('0x1e')](_0x411a0c);}return null;};}function patchUpdates(_0x5c2f41){return function(_0x19d764){try{jsonpatch[_0xb183('0x1f')](_0x19d764,_0x5c2f41,!![]);}catch(_0x57cd28){return BPromise[_0xb183('0x20')](_0x57cd28);}return _0x19d764[_0xb183('0x21')]();};}function saveUpdates(_0x531109,_0x29a1f1){return function(_0x352d19){if(_0x352d19){return _0x352d19[_0xb183('0x22')](_0x531109)[_0xb183('0x23')](function(_0x9c047f){return _0x9c047f;});}return null;};}function removeEntity(_0x3cdfa2,_0x5974b5){return function(_0xa7e6f3){if(_0xa7e6f3){return _0xa7e6f3[_0xb183('0x24')]()['then'](function(){var _0x13ced5=_0xa7e6f3[_0xb183('0x25')]({'plain':!![]});var _0x443017='Companies';return db[_0xb183('0x26')]['destroy']({'where':{'type':_0x443017,'resourceId':_0x13ced5['id']}})['then'](function(){return _0xa7e6f3;});})['then'](function(){_0x3cdfa2[_0xb183('0x18')](0xcc)[_0xb183('0x19')]();});}};}function handleEntityNotFound(_0x3fe8d7,_0x4d0634){return function(_0x5ddf0c){if(!_0x5ddf0c){_0x3fe8d7[_0xb183('0x17')](0x194);}return _0x5ddf0c;};}function handleError(_0x43273b,_0x5ee604){_0x5ee604=_0x5ee604||0x1f4;return function(_0x29857f){logger[_0xb183('0x27')](_0x29857f[_0xb183('0x28')]);if(_0x29857f[_0xb183('0x29')]){delete _0x29857f[_0xb183('0x29')];}_0x43273b[_0xb183('0x18')](_0x5ee604)[_0xb183('0x2a')](_0x29857f);};}exports[_0xb183('0x2b')]=function(_0x2abf95,_0x5afda4){var _0x5c6d79={},_0x5bcf22={},_0x5a7358={'count':0x0,'rows':[]};return db['CmCompany'][_0xb183('0x2c')]()['then'](function(_0x2db6ee){_0x5bcf22[_0xb183('0x2d')]=_[_0xb183('0x2e')](_0x2db6ee);_0x5bcf22[_0xb183('0x2f')]=_['keys'](_0x2abf95[_0xb183('0x2f')]);_0x5bcf22[_0xb183('0x30')]=_[_0xb183('0x31')](_0x5bcf22['model'],_0x5bcf22['query']);_0x5c6d79[_0xb183('0x32')]=_[_0xb183('0x31')](_0x5bcf22[_0xb183('0x2d')],qs[_0xb183('0x33')](_0x2abf95['query'][_0xb183('0x33')]));_0x5c6d79['attributes']=_0x5c6d79['attributes']['length']?_0x5c6d79[_0xb183('0x32')]:_0x5bcf22['model'];if(!_0x2abf95[_0xb183('0x2f')][_0xb183('0x34')](_0xb183('0x35'))){_0x5c6d79[_0xb183('0x36')]=qs[_0xb183('0x36')](_0x2abf95['query'][_0xb183('0x36')]);_0x5c6d79[_0xb183('0x1b')]=qs[_0xb183('0x1b')](_0x2abf95[_0xb183('0x2f')][_0xb183('0x1b')]);}_0x5c6d79[_0xb183('0x37')]=qs['sort'](_0x2abf95[_0xb183('0x2f')]['sort']);_0x5c6d79[_0xb183('0x38')]=qs[_0xb183('0x30')](_[_0xb183('0x39')](_0x2abf95['query'],_0x5bcf22[_0xb183('0x30')]),_0x2db6ee);if(_0x2abf95['query'][_0xb183('0x3a')]){_0x5c6d79[_0xb183('0x38')]=_[_0xb183('0x3b')](_0x5c6d79[_0xb183('0x38')],{'$or':_[_0xb183('0x3c')](_0x5c6d79[_0xb183('0x32')],function(_0x15db18){var _0x575e03={};_0x575e03[_0x15db18]={'$like':'%'+_0x2abf95[_0xb183('0x2f')][_0xb183('0x3a')]+'%'};return _0x575e03;})});}_0x5c6d79=_[_0xb183('0x3b')]({},_0x5c6d79,_0x2abf95['options']);var _0x68d23d={'where':_0x5c6d79['where']};return db[_0xb183('0x3d')][_0xb183('0x1a')](_0x68d23d)[_0xb183('0x23')](function(_0x1fee01){_0x5a7358[_0xb183('0x1a')]=_0x1fee01;if(_0x2abf95['query'][_0xb183('0x3e')]){_0x5c6d79[_0xb183('0x3f')]=[{'all':!![]}];}return db['CmCompany'][_0xb183('0x40')](_0x5c6d79);})[_0xb183('0x23')](function(_0x3683b3){_0x5a7358[_0xb183('0x41')]=_0x3683b3;return _0x5a7358;})[_0xb183('0x23')](respondWithFilteredResult(_0x5afda4,_0x5c6d79))[_0xb183('0x42')](handleError(_0x5afda4,null));})['catch'](handleError(_0x5afda4,null));};exports[_0xb183('0x43')]=function(_0x5e9cb8,_0x1c3c73){var _0x56ad7d={'raw':![],'where':{'id':_0x5e9cb8[_0xb183('0x44')]['id']}},_0x37e533={};_0x37e533[_0xb183('0x2d')]=_['keys'](db[_0xb183('0x3d')][_0xb183('0x45')]);_0x37e533[_0xb183('0x2f')]=_[_0xb183('0x2e')](_0x5e9cb8[_0xb183('0x2f')]);_0x37e533[_0xb183('0x30')]=_[_0xb183('0x31')](_0x37e533['model'],_0x37e533[_0xb183('0x2f')]);_0x56ad7d[_0xb183('0x32')]=_['intersection'](_0x37e533['model'],qs[_0xb183('0x33')](_0x5e9cb8[_0xb183('0x2f')][_0xb183('0x33')]));_0x56ad7d[_0xb183('0x32')]=_0x56ad7d[_0xb183('0x32')][_0xb183('0x46')]?_0x56ad7d[_0xb183('0x32')]:_0x37e533[_0xb183('0x2d')];if(_0x5e9cb8[_0xb183('0x2f')][_0xb183('0x3e')]){_0x56ad7d[_0xb183('0x3f')]=[{'all':!![]}];}_0x56ad7d=_[_0xb183('0x3b')]({},_0x56ad7d,_0x5e9cb8[_0xb183('0x47')]);return db['CmCompany'][_0xb183('0x48')](_0x56ad7d)[_0xb183('0x23')](handleEntityNotFound(_0x1c3c73,null))[_0xb183('0x23')](respondWithResult(_0x1c3c73,null))['catch'](handleError(_0x1c3c73,null));};exports[_0xb183('0x49')]=function(_0x3b28d4,_0x42b797){return db[_0xb183('0x3d')][_0xb183('0x49')](_0x3b28d4['body'],{})[_0xb183('0x23')](function(_0x4549f3){var _0x5af262=_0x3b28d4[_0xb183('0x4a')]['get']({'plain':!![]});if(!_0x5af262)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5af262[_0xb183('0x4b')]===_0xb183('0x4a')){var _0xb85648=_0x4549f3[_0xb183('0x25')]({'plain':!![]});var _0x3df907=_0xb183('0x4c');return db[_0xb183('0x4d')]['find']({'where':{'name':_0x3df907,'userProfileId':_0x5af262[_0xb183('0x4e')]},'raw':!![]})[_0xb183('0x23')](function(_0x2ad8eb){if(_0x2ad8eb&&_0x2ad8eb['autoAssociation']===0x0){return db[_0xb183('0x26')][_0xb183('0x49')]({'name':_0xb85648[_0xb183('0x29')],'resourceId':_0xb85648['id'],'type':_0x2ad8eb[_0xb183('0x29')],'sectionId':_0x2ad8eb['id']},{})['then'](function(){return _0x4549f3;});}else{return _0x4549f3;}})[_0xb183('0x42')](function(_0x5b8758){logger['error'](_0xb183('0x4f'),_0x5b8758);throw _0x5b8758;});}return _0x4549f3;})[_0xb183('0x23')](respondWithResult(_0x42b797,0xc9))[_0xb183('0x42')](handleError(_0x42b797,null));};exports[_0xb183('0x22')]=function(_0x566204,_0x126c0b){if(_0x566204[_0xb183('0x50')]['id']){delete _0x566204[_0xb183('0x50')]['id'];}return db[_0xb183('0x3d')][_0xb183('0x48')]({'where':{'id':_0x566204[_0xb183('0x44')]['id']}})[_0xb183('0x23')](handleEntityNotFound(_0x126c0b,null))['then'](saveUpdates(_0x566204['body'],null))[_0xb183('0x23')](respondWithResult(_0x126c0b,null))[_0xb183('0x42')](handleError(_0x126c0b,null));};exports[_0xb183('0x24')]=function(_0x20a76e,_0xf43766){return db[_0xb183('0x3d')]['find']({'where':{'id':_0x20a76e['params']['id']}})[_0xb183('0x23')](handleEntityNotFound(_0xf43766,null))[_0xb183('0x23')](removeEntity(_0xf43766,null))['catch'](handleError(_0xf43766,null));};exports['describe']=function(_0x4f4ec8,_0x1bc3b2){return db[_0xb183('0x3d')][_0xb183('0x2c')]()[_0xb183('0x23')](respondWithResult(_0x1bc3b2,null))[_0xb183('0x42')](handleError(_0x1bc3b2,null));};exports[_0xb183('0x51')]=function(_0x4852d6,_0x511a48,_0x2cb343){return db[_0xb183('0x52')][_0xb183('0x48')]({'where':{'id':_0x4852d6[_0xb183('0x44')]['id']}})[_0xb183('0x23')](handleEntityNotFound(_0x511a48,null))[_0xb183('0x23')](function(_0x1e54c8){if(_0x1e54c8){return _0x1e54c8[_0xb183('0x51')](_0x4852d6[_0xb183('0x50')][_0xb183('0x53')],_[_0xb183('0x54')](_0x4852d6[_0xb183('0x50')],['ids','id'])||{});}})[_0xb183('0x23')](respondWithResult(_0x511a48,null))[_0xb183('0x42')](handleError(_0x511a48,null));};exports['getContacts']=function(_0x2af312,_0x3e6174,_0x5d7954){var _0x4000bd={};var _0x492cde={};var _0x2500c0;var _0x306c66;return db[_0xb183('0x3d')]['findOne']({'where':{'id':_0x2af312[_0xb183('0x44')]['id']}})[_0xb183('0x23')](handleEntityNotFound(_0x3e6174,null))[_0xb183('0x23')](function(_0x20ff25){if(_0x20ff25){_0x2500c0=_0x20ff25;_0x492cde[_0xb183('0x2d')]=_[_0xb183('0x2e')](db['CmContact']['rawAttributes']);_0x492cde[_0xb183('0x2f')]=_[_0xb183('0x2e')](_0x2af312[_0xb183('0x2f')]);_0x492cde[_0xb183('0x30')]=_[_0xb183('0x31')](_0x492cde[_0xb183('0x2d')],_0x492cde[_0xb183('0x2f')]);_0x4000bd[_0xb183('0x32')]=_[_0xb183('0x31')](_0x492cde[_0xb183('0x2d')],qs['fields'](_0x2af312[_0xb183('0x2f')][_0xb183('0x33')]));_0x4000bd[_0xb183('0x32')]=_0x4000bd[_0xb183('0x32')][_0xb183('0x46')]?_0x4000bd[_0xb183('0x32')]:_0x492cde[_0xb183('0x2d')];_0x4000bd[_0xb183('0x37')]=qs['sort'](_0x2af312[_0xb183('0x2f')][_0xb183('0x55')]);_0x4000bd[_0xb183('0x38')]=qs['filters'](_[_0xb183('0x39')](_0x2af312[_0xb183('0x2f')],_0x492cde[_0xb183('0x30')]));if(_0x2af312[_0xb183('0x2f')][_0xb183('0x3a')]){_0x4000bd[_0xb183('0x38')]=_[_0xb183('0x3b')](_0x4000bd['where'],{'$or':_[_0xb183('0x3c')](_0x4000bd['attributes'],function(_0x4ef9f4){var _0x5b77c7={};_0x5b77c7[_0x4ef9f4]={'$like':'%'+_0x2af312[_0xb183('0x2f')][_0xb183('0x3a')]+'%'};return _0x5b77c7;})});}_0x4000bd=_[_0xb183('0x3b')]({},_0x4000bd,_0x2af312[_0xb183('0x47')]);return _0x2500c0[_0xb183('0x56')](_0x4000bd);}})[_0xb183('0x23')](function(_0x5a41cf){if(_0x5a41cf){_0x306c66=_0x5a41cf[_0xb183('0x46')];if(!_0x2af312['query'][_0xb183('0x34')](_0xb183('0x35'))){_0x4000bd[_0xb183('0x36')]=qs[_0xb183('0x36')](_0x2af312[_0xb183('0x2f')][_0xb183('0x36')]);_0x4000bd[_0xb183('0x1b')]=qs[_0xb183('0x1b')](_0x2af312[_0xb183('0x2f')]['offset']);}return _0x2500c0['getContacts'](_0x4000bd);}})[_0xb183('0x23')](function(_0x3fd6a7){if(_0x3fd6a7){return _0x3fd6a7?{'count':_0x306c66,'rows':_0x3fd6a7}:null;}})[_0xb183('0x23')](respondWithResult(_0x3e6174,null))['catch'](handleError(_0x3e6174,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 8e5bcd9..5ef4498 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 _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
+var _0x9d21=['rimraf','./cmCompany.attributes','define','CmCompany','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9d21,0x1d0));var _0x19d2=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0x9d21[_0x2d2ca2];return _0x48489d;};'use strict';var _=require(_0x19d2('0x0'));var util=require(_0x19d2('0x1'));var logger=require(_0x19d2('0x2'))('api');var moment=require(_0x19d2('0x3'));var BPromise=require(_0x19d2('0x4'));var rp=require(_0x19d2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x19d2('0x6'));var config=require('../../config/environment');var attributes=require(_0x19d2('0x7'));module['exports']=function(_0x2abb81,_0x85b7a9){return _0x2abb81[_0x19d2('0x8')](_0x19d2('0x9'),attributes,{'tableName':'cm_companies','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 7e94abc..fefc770 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 _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
+var _0x53b1=['../../mysqldb','../../config/utils','../../config/logger','client','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCompany,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x53b1,0xa3));var _0x153b=function(_0xaac590,_0x17fb75){_0xaac590=_0xaac590-0x0;var _0xd3039b=_0x53b1[_0xaac590];return _0xd3039b;};'use strict';var _=require(_0x153b('0x0'));var util=require(_0x153b('0x1'));var moment=require('moment');var BPromise=require(_0x153b('0x2'));var rs=require(_0x153b('0x3'));var fs=require('fs');var Redis=require(_0x153b('0x4'));var db=require(_0x153b('0x5'))['db'];var utils=require(_0x153b('0x6'));var logger=require(_0x153b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x153b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x248aae,_0x5343cf,_0x4c29b1){return new BPromise(function(_0x194802,_0x5c19cc){return client['request'](_0x248aae,_0x4c29b1)[_0x153b('0x9')](function(_0x1e838c){logger[_0x153b('0xa')]('CmCompany,\x20%s,\x20%s',_0x5343cf,_0x153b('0xb'));logger[_0x153b('0xc')](_0x153b('0xd'),_0x5343cf,_0x153b('0xb'),JSON[_0x153b('0xe')](_0x1e838c));if(_0x1e838c['error']){if(_0x1e838c[_0x153b('0xf')][_0x153b('0x10')]===0x1f4){logger[_0x153b('0xf')]('CmCompany,\x20%s,\x20%s',_0x5343cf,_0x1e838c['error']['message']);return _0x5c19cc(_0x1e838c['error'][_0x153b('0x11')]);}logger[_0x153b('0xf')](_0x153b('0x12'),_0x5343cf,_0x1e838c[_0x153b('0xf')][_0x153b('0x11')]);return _0x194802(_0x1e838c[_0x153b('0xf')][_0x153b('0x11')]);}else{logger['info'](_0x153b('0x12'),_0x5343cf,_0x153b('0xb'));_0x194802(_0x1e838c[_0x153b('0x13')][_0x153b('0x11')]);}})[_0x153b('0x14')](function(_0xd60967){logger[_0x153b('0xf')](_0x153b('0x12'),_0x5343cf,_0xd60967);_0x5c19cc(_0xd60967);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 74a968b..bac2b96 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(_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
+var _0x9957=['../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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('./cmCompany.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0x10')](_0x7995('0xe'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index fb23582..057bad1 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 _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
+var _0x9779=['INTEGER','UNSIGNED','DATE','lodash','exports','STRING','TEXT'];(function(_0x334b0d,_0x33f2f1){var _0x5bbe11=function(_0x1413f0){while(--_0x1413f0){_0x334b0d['push'](_0x334b0d['shift']());}};_0x5bbe11(++_0x33f2f1);}(_0x9779,0x1ed));var _0x9977=function(_0x28c7c0,_0x3d8b68){_0x28c7c0=_0x28c7c0-0x0;var _0x13a553=_0x9779[_0x28c7c0];return _0x13a553;};'use strict';var _=require(_0x9977('0x0'));var Sequelize=require('sequelize');module[_0x9977('0x1')]={'firstName':{'type':Sequelize[_0x9977('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9977('0x2')]},'street':{'type':Sequelize[_0x9977('0x2')]},'postalCode':{'type':Sequelize[_0x9977('0x2')]},'city':{'type':Sequelize[_0x9977('0x2')]},'country':{'type':Sequelize[_0x9977('0x2')]},'dateOfBirth':{'type':Sequelize[_0x9977('0x2')]},'description':{'type':Sequelize[_0x9977('0x3')]},'phone':{'type':Sequelize[_0x9977('0x2')]},'mobile':{'type':Sequelize[_0x9977('0x2')]},'fax':{'type':Sequelize[_0x9977('0x2')]},'email':{'type':Sequelize[_0x9977('0x2')]},'url':{'type':Sequelize[_0x9977('0x2')]},'facebook':{'type':Sequelize[_0x9977('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x9977('0x2')]},'teams':{'type':Sequelize[_0x9977('0x2')]},'viber':{'type':Sequelize[_0x9977('0x2')]},'line':{'type':Sequelize[_0x9977('0x2')]},'wechat':{'type':Sequelize[_0x9977('0x2')]},'telegram':{'type':Sequelize[_0x9977('0x2')]},'UserId':{'type':Sequelize[_0x9977('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x9977('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9977('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x9977('0x2')]},'utcOffset':{'type':Sequelize[_0x9977('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 40a4e20..dabece3 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 _0xc4a6=['zip-dir','fast-json-patch','request-promise','moment','util','to-csv','lodash','squel','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','describe','keys','cf_','findOne','trimStart','all','length','fieldType','type','query','filters','intersection','attributes','model','fields','nolimit','limit','order','sort','where','select','field','color','from','cm_user_has_contacts','left_join','tools_tags','expr','parseSearch','search','sqlOperator','conditions','find','Tag','value','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','dateOfBirth','datetime','castTo','DATE','text','start','map','filter','Contact','push','ListId','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','isArray','tag','replace','\x27\x27\x27\x27','split','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','clone','DESC','isEmpty','t.id\x20IN\x20?','resolve','some','user','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','keyBy','merge','c.firstName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','TagIds','Tags','catch','params','CmContact','startsWith','columnName','displayName','findAll','alias','values','hasOwnProperty','body','get','mergeWith','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','info','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxMessage','CmHopperFinal','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','show','omit','cf_%d','$and','pickBy','format','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','pick','options','setTags','ids','includeAll','include','rows','getHopperHistories','CmHopperHistory','getHopperFinals','ContactId','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','child_process','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','send','createReadStream','path','file','User','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','html-pdf','eml-format','rimraf'];(function(_0x4a2841,_0x272a54){var _0x440853=function(_0x10c364){while(--_0x10c364){_0x4a2841['push'](_0x4a2841['shift']());}};_0x440853(++_0x272a54);}(_0xc4a6,0x1c5));var _0x6c4a=function(_0x3ab0ac,_0x1ea9cf){_0x3ab0ac=_0x3ab0ac-0x0;var _0x1f743d=_0xc4a6[_0x3ab0ac];return _0x1f743d;};'use strict';var pdf=require(_0x6c4a('0x0'));var emlformat=require(_0x6c4a('0x1'));var rimraf=require(_0x6c4a('0x2'));var zipdir=require(_0x6c4a('0x3'));var jsonpatch=require(_0x6c4a('0x4'));var rp=require(_0x6c4a('0x5'));var moment=require(_0x6c4a('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6c4a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6c4a('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6c4a('0x9'));var squel=require(_0x6c4a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6c4a('0x8'));var querystring=require(_0x6c4a('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6c4a('0xc'));var qs=require(_0x6c4a('0xd'));var as=require(_0x6c4a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6c4a('0xf'));var db=require(_0x6c4a('0x10'))['db'];config[_0x6c4a('0x11')]=_[_0x6c4a('0x12')](config['redis'],{'host':_0x6c4a('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6c4a('0x11')]));require(_0x6c4a('0x14'))[_0x6c4a('0x15')](socket);function respondWithStatusCode(_0x1d2070,_0x31c8b7){_0x31c8b7=_0x31c8b7||0xcc;return function(_0x14ef9e){if(_0x14ef9e){return _0x1d2070[_0x6c4a('0x16')](_0x31c8b7);}return _0x1d2070[_0x6c4a('0x17')](_0x31c8b7)[_0x6c4a('0x18')]();};}function respondWithResult(_0x208f95,_0x3f9207){_0x3f9207=_0x3f9207||0xc8;return function(_0x315a95){if(_0x315a95){return _0x208f95[_0x6c4a('0x17')](_0x3f9207)[_0x6c4a('0x19')](_0x315a95);}};}function respondWithFilteredResult(_0x2932f4,_0x188a5b){return function(_0x398b95){if(_0x398b95){var _0x223790=_0x398b95[_0x6c4a('0x1a')],_0x1a539a=_0x188a5b[_0x6c4a('0x1b')],_0x5c8428=_0x188a5b[_0x6c4a('0x1b')]+_0x188a5b['limit'],_0x2bb0fd;if(_0x5c8428>=_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=_0x54bc60){_0x5341c7=_0x54bc60;_0x2c3917=0xc8;}else{_0x2c3917=0xce;}_0x17b2eb['status'](_0x2c3917);return _0x17b2eb[_0xf44e('0x24')](_0xf44e('0x25'),_0x5cd8e3+'-'+_0x5341c7+'/'+_0x54bc60)['json'](_0x186eef);}return null;};}function patchUpdates(_0x432289){return function(_0x7986df){try{jsonpatch[_0xf44e('0x26')](_0x7986df,_0x432289,!![]);}catch(_0x1090a0){return BPromise[_0xf44e('0x27')](_0x1090a0);}return _0x7986df['save']();};}function saveUpdates(_0xabf0b2,_0x7f85e){return function(_0x47ebe9){if(_0x47ebe9){return _0x47ebe9['update'](_0xabf0b2)[_0xf44e('0x28')](function(_0x3cee8a){return _0x3cee8a;});}return null;};}function removeEntity(_0x2ef46e,_0x1d7dab){return function(_0xd7e639){if(_0xd7e639){return _0xd7e639[_0xf44e('0x29')]()[_0xf44e('0x28')](function(){_0x2ef46e[_0xf44e('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33e615,_0x49fd39){return function(_0x299fbf){if(!_0x299fbf){_0x33e615['sendStatus'](0x194);}return _0x299fbf;};}function handleError(_0x5ebd64,_0x5a62ef){_0x5a62ef=_0x5a62ef||0x1f4;return function(_0x6ae284){logger['error'](_0x6ae284['stack']);if(_0x6ae284[_0xf44e('0x2a')]){delete _0x6ae284[_0xf44e('0x2a')];}_0x5ebd64[_0xf44e('0x20')](_0x5a62ef)[_0xf44e('0x2b')](_0x6ae284);};}exports['index']=function(_0x1d2505,_0x28fab4){var _0x416c29={},_0x43b345={},_0x99530b={'count':0x0,'rows':[]};return db[_0xf44e('0x2c')]['describe']()[_0xf44e('0x28')](function(_0x4c34e1){var _0xa4c808=[];for(var _0x171ffa=0x0;_0x171ffa0x1){_0x366805['or'](_0xf44e('0x66'),qs['getFullTextValue'](_0x448559),null);}else{if(qs[_0xf44e('0x67')](_0x448559)){_0x366805['or'](_0xf44e('0x68'),_0x448559+'%');_0x366805['or'](_0xf44e('0x69'),_0x448559+'%');_0x366805['or'](_0xf44e('0x6a'),_0x448559+'%');_0x366805['or']('c.fax\x20LIKE\x20?',_0x448559+'%');}else if(qs['isEmail'](_0x448559)){_0x366805['or'](_0xf44e('0x6b'),_0x448559+'%');}else{_0x366805['or']('c.firstName\x20LIKE\x20?','%'+_0x448559+'%');_0x366805['or'](_0xf44e('0x6c'),'%'+_0x448559+'%');_0x366805['or'](_0xf44e('0x6b'),'%'+_0x448559+'%');}}}}_0x16f4ab[_0xf44e('0x3c')](_0x366805);_0x16f4ab[_0xf44e('0x6d')](_0xf44e('0x6e'));var _0x1ae5ac={'type':db[_0xf44e('0x6f')][_0xf44e('0x70')][_0xf44e('0x71')],'raw':!![]};var _0x5d7799=_0x16f4ab['clone']()[_0xf44e('0x3e')]('c.id');if(_0x416c29[_0xf44e('0x72')]){_0x416c29[_0xf44e('0x72')][_0xf44e('0x50')](function(_0x24ac58){_0x16f4ab[_0xf44e('0x72')]('c.'+_0x24ac58[0x0],_0x24ac58[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0xf4fcbd)){_0x16f4ab[_0xf44e('0x73')](_0x55a683);_0x5d7799[_0xf44e('0x3c')](_0xf44e('0x74'),_0xf4fcbd);}BPromise[_0xf44e('0x75')]()['then'](function(){if(_0x63c3bf&&!_[_0xf44e('0x76')](_0x63c3bf[_0xf44e('0x4c')],[_0xf44e('0x3e'),_0xf44e('0x77')])){return _0x1d2505[_0xf44e('0x78')][_0xf44e('0x79')]({'attributes':['id'],'raw':!![]})[_0xf44e('0x28')](function(_0xb7bc9b){if(_[_0xf44e('0x5f')](_0xb7bc9b)){_0x5d7799[_0xf44e('0x3c')](_0xf44e('0x7a'));_0x16f4ab[_0xf44e('0x3c')](_0xf44e('0x7a'));}else{_0x5d7799['where'](_0xf44e('0x7b'),_[_0xf44e('0x4f')](_0xb7bc9b,'id'));_0x16f4ab['where'](_0xf44e('0x7b'),_['map'](_0xb7bc9b,'id'));}});}else{return;}})[_0xf44e('0x28')](function(){db[_0xf44e('0x7c')][_0xf44e('0x34')](_0x5d7799['toString'](),_0x1ae5ac)[_0xf44e('0x28')](function(_0x5407f8){_0x99530b[_0xf44e('0x21')]=_0x5407f8[_0xf44e('0x2e')];if(_0x99530b[_0xf44e('0x21')]===0x0)return[];return db['sequelize'][_0xf44e('0x34')](_0x7b1658[_0xf44e('0x7d')](),_0x1ae5ac);})[_0xf44e('0x28')](function(_0x5790cb){_0x3466b4=_[_0xf44e('0x7e')](_0x5790cb,'id');_0x1ae5ac=_[_0xf44e('0x7f')](_0x1ae5ac,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1d2505[_0xf44e('0x34')][_0xf44e('0x37')]){_0x416c29[_0xf44e('0x38')][_0xf44e('0x50')](function(_0x46553c){_0x16f4ab[_0xf44e('0x3e')]('c.'+_0x46553c);});}else{_0x16f4ab[_0xf44e('0x3e')]('c.id');_0x16f4ab[_0xf44e('0x3e')](_0xf44e('0x80'));_0x16f4ab[_0xf44e('0x3e')]('c.lastName');_0x16f4ab['field'](_0xf44e('0x81'));_0x16f4ab[_0xf44e('0x3e')](_0xf44e('0x82'));_0x16f4ab['field'](_0xf44e('0x83'));_0x16f4ab['field'](_0xf44e('0x84'));_0x16f4ab[_0xf44e('0x3e')]('c.ListId');_0x16f4ab[_0xf44e('0x3e')]('c.deletedAt');_0x16f4ab['field'](_0xf44e('0x85'),'TagIds');}if(_0x416c29[_0xf44e('0x23')])_0x16f4ab[_0xf44e('0x23')](_0x416c29[_0xf44e('0x23')]);if(_0x416c29[_0xf44e('0x22')])_0x16f4ab['offset'](_0x416c29[_0xf44e('0x22')]);return db[_0xf44e('0x7c')][_0xf44e('0x34')](_0x16f4ab[_0xf44e('0x7d')](),_0x1ae5ac);})[_0xf44e('0x28')](function(_0x221cf6){_0x221cf6[_0xf44e('0x50')](function(_0x3aeae9){if(_0x3aeae9[_0xf44e('0x86')]){_0x3aeae9['Tags']=[];_0x3aeae9[_0xf44e('0x86')]['split'](',')[_0xf44e('0x50')](function(_0x3444ff){_0x3aeae9['Tags'][_0xf44e('0x30')](_0x3466b4[_0x3444ff]);});}delete _0x3aeae9['TagIds'];});_0x99530b['rows']=_0x221cf6;return _0x99530b;})[_0xf44e('0x28')](respondWithFilteredResult(_0x28fab4,_0x416c29));});})[_0xf44e('0x87')](handleError(_0x28fab4,null));};exports[_0xf44e('0x29')]=function(_0x2768c2,_0x2427ac){return db['CmContact']['find']({'where':{'id':_0x2768c2['params']['id']}})[_0xf44e('0x28')](handleEntityNotFound(_0x2427ac,null))['then'](removeEntity(_0x2427ac,null))['catch'](handleError(_0x2427ac,null));};exports[_0xf44e('0x88')]=function(_0x1f3eac,_0x4b0771){return db['CmContact'][_0xf44e('0x88')]()['then'](function(_0x16b822){delete _0x16b822['tags'];for(var _0x3282c9=0x0;_0x3282c9{}\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
+var _0xb138=['file','upload','/upload/:id','import','put','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmContact.controller','get','index','isAuthenticated','describe','show','getTags','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/jscripty_sessions','/merge','merge','post','/create_many','bulkCreate','/:id/tags','setTags','join','root','server/files/tmp','originalname','%s-%s%s','basename','extname','now','/csv','single','uploadCsv','format','/upload'];(function(_0x13606d,_0x30f265){var _0x1b85b0=function(_0x285c1b){while(--_0x285c1b){_0x13606d['push'](_0x13606d['shift']());}};_0x1b85b0(++_0x30f265);}(_0xb138,0x1dd));var _0x8b13=function(_0x4b8d6b,_0x31483c){_0x4b8d6b=_0x4b8d6b-0x0;var _0x41e647=_0xb138[_0x4b8d6b];return _0x41e647;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var auth=require(_0x8b13('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8b13('0x7'));var controller=require(_0x8b13('0x8'));router[_0x8b13('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b13('0xa')]);router[_0x8b13('0x9')]('/describe',auth[_0x8b13('0xb')](),controller[_0x8b13('0xc')]);router[_0x8b13('0x9')]('/:id',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['get']('/:id/tags',auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);router[_0x8b13('0x9')](_0x8b13('0xf'),auth[_0x8b13('0xb')](),controller['getHoppers']);router[_0x8b13('0x9')](_0x8b13('0x10'),auth[_0x8b13('0xb')](),controller[_0x8b13('0x11')]);router[_0x8b13('0x9')](_0x8b13('0x12'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x8b13('0x9')](_0x8b13('0x13'),auth['isAuthenticated'](),controller['getJscriptySessions']);router['post'](_0x8b13('0x14'),auth[_0x8b13('0xb')](),controller[_0x8b13('0x15')]);router[_0x8b13('0x16')]('/',auth[_0x8b13('0xb')](),controller['create']);router[_0x8b13('0x16')](_0x8b13('0x17'),auth[_0x8b13('0xb')](),controller[_0x8b13('0x18')]);router[_0x8b13('0x16')](_0x8b13('0x19'),auth[_0x8b13('0xb')](),controller[_0x8b13('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4dac71,_0xae4966,_0x335709){_0x335709(null,path[_0x8b13('0x1b')](config[_0x8b13('0x1c')],_0x8b13('0x1d')));},'filename':function(_0x3cc9a0,_0x559442,_0x1e8a48){_0x559442[_0x8b13('0x1e')]=_0x559442[_0x8b13('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1e8a48(null,util['format'](_0x8b13('0x1f'),path[_0x8b13('0x20')](_0x559442['originalname'],path[_0x8b13('0x21')](_0x559442[_0x8b13('0x1e')])),Date[_0x8b13('0x22')](),path[_0x8b13('0x21')](_0x559442[_0x8b13('0x1e')])));}})});router['post'](_0x8b13('0x23'),upload[_0x8b13('0x24')]('file'),controller[_0x8b13('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x420772,_0x325d68,_0x54786a){_0x54786a(null,path[_0x8b13('0x1b')](config[_0x8b13('0x1c')],'server/files/tmp'));},'filename':function(_0x134c5e,_0x14a739,_0x410122){_0x14a739[_0x8b13('0x1e')]=_0x14a739[_0x8b13('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x410122(null,util[_0x8b13('0x26')](_0x8b13('0x1f'),path[_0x8b13('0x20')](_0x14a739[_0x8b13('0x1e')],path[_0x8b13('0x21')](_0x14a739[_0x8b13('0x1e')])),Date['now'](),path[_0x8b13('0x21')](_0x14a739[_0x8b13('0x1e')])));}})});router[_0x8b13('0x16')](_0x8b13('0x27'),upload[_0x8b13('0x24')](_0x8b13('0x28')),controller[_0x8b13('0x29')]);router[_0x8b13('0x16')](_0x8b13('0x2a'),auth['isAuthenticated'](),controller[_0x8b13('0x2b')]);router[_0x8b13('0x2c')](_0x8b13('0x2d'),auth[_0x8b13('0xb')](),controller['update']);router['delete'](_0x8b13('0x2d'),auth['isAuthenticated'](),controller['destroy']);module[_0x8b13('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 3a56e37..98b1b57 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 _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
+var _0x812d=['STRING','PHONE','exports','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x812d,0x6e));var _0xd812=function(_0x1d0195,_0x3bf133){_0x1d0195=_0x1d0195-0x0;var _0x3ccc06=_0x812d[_0x1d0195];return _0x3ccc06;};'use strict';var Sequelize=require('sequelize');module[_0xd812('0x0')]={'CmContactId':{'type':Sequelize[_0xd812('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xd812('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xd812('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xd812('0x2')],'defaultValue':_0xd812('0x3')},'OrderBy':{'type':Sequelize[_0xd812('0x1')],'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 94eeaaf..2929897 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 _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
+var _0x12e0=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','offset','limit','set','reject','save','update','destroy','get','CmContactHasItems','UserProfileResource','then','error','stack','name','send','index','map','CmContactHasItem','fieldName','key','model','query','attributes','length','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','fields','find','create'];(function(_0x4bbe4f,_0x5013e3){var _0x4292d1=function(_0xba4361){while(--_0xba4361){_0x4bbe4f['push'](_0x4bbe4f['shift']());}};_0x4292d1(++_0x5013e3);}(_0x12e0,0xa7));var _0x012e=function(_0x2d1cf6,_0x3864fe){_0x2d1cf6=_0x2d1cf6-0x0;var _0x3d4d16=_0x12e0[_0x2d1cf6];return _0x3d4d16;};'use strict';var pdf=require(_0x012e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x012e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x012e('0x2'));var moment=require(_0x012e('0x3'));var BPromise=require(_0x012e('0x4'));var Mustache=require(_0x012e('0x5'));var util=require(_0x012e('0x6'));var path=require('path');var sox=require(_0x012e('0x7'));var csv=require(_0x012e('0x8'));var ejs=require(_0x012e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x012e('0xa'));var jsforce=require(_0x012e('0xb'));var deskjs=require(_0x012e('0xc'));var toCsv=require(_0x012e('0x8'));var querystring=require('querystring');var Papa=require(_0x012e('0xd'));var Redis=require(_0x012e('0xe'));var authService=require(_0x012e('0xf'));var qs=require(_0x012e('0x10'));var as=require(_0x012e('0x11'));var hardwareService=require(_0x012e('0x12'));var logger=require(_0x012e('0x13'))(_0x012e('0x14'));var utils=require(_0x012e('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37fb30,_0x589ec5){_0x589ec5=_0x589ec5||0xcc;return function(_0x4d7af7){if(_0x4d7af7){return _0x37fb30['sendStatus'](_0x589ec5);}return _0x37fb30[_0x012e('0x16')](_0x589ec5)[_0x012e('0x17')]();};}function respondWithResult(_0x2f1632,_0x2b4b5f){_0x2b4b5f=_0x2b4b5f||0xc8;return function(_0x5a5d7c){if(_0x5a5d7c){return _0x2f1632[_0x012e('0x16')](_0x2b4b5f)[_0x012e('0x18')](_0x5a5d7c);}};}function respondWithFilteredResult(_0x325d72,_0x1fcfa2){return function(_0x3ecf9c){if(_0x3ecf9c){var _0x4a1948=_0x3ecf9c['count'],_0x14fdc5=_0x1fcfa2[_0x012e('0x19')],_0x182359=_0x1fcfa2[_0x012e('0x19')]+_0x1fcfa2[_0x012e('0x1a')],_0x9492dd;if(_0x182359>=_0x4a1948){_0x182359=_0x4a1948;_0x9492dd=0xc8;}else{_0x9492dd=0xce;}_0x325d72[_0x012e('0x16')](_0x9492dd);return _0x325d72[_0x012e('0x1b')]('Content-Range',_0x14fdc5+'-'+_0x182359+'/'+_0x4a1948)[_0x012e('0x18')](_0x3ecf9c);}return null;};}function patchUpdates(_0x589b79){return function(_0x344ee0){try{jsonpatch['apply'](_0x344ee0,_0x589b79,!![]);}catch(_0x3a641f){return BPromise[_0x012e('0x1c')](_0x3a641f);}return _0x344ee0[_0x012e('0x1d')]();};}function saveUpdates(_0x12f330,_0x419d4b){return function(_0x22120c){if(_0x22120c){return _0x22120c[_0x012e('0x1e')](_0x12f330)['then'](function(_0x18c0b5){return _0x18c0b5;});}return null;};}function removeEntity(_0x2ff04e,_0x2771c3){return function(_0x81bdc3){if(_0x81bdc3){return _0x81bdc3[_0x012e('0x1f')]()['then'](function(){var _0x470c05=_0x81bdc3[_0x012e('0x20')]({'plain':!![]});var _0x4098f2=_0x012e('0x21');return db[_0x012e('0x22')][_0x012e('0x1f')]({'where':{'type':_0x4098f2,'resourceId':_0x470c05['id']}})[_0x012e('0x23')](function(){return _0x81bdc3;});})['then'](function(){_0x2ff04e[_0x012e('0x16')](0xcc)[_0x012e('0x17')]();});}};}function handleEntityNotFound(_0x29ff03,_0x15cf1f){return function(_0x449e9b){if(!_0x449e9b){_0x29ff03['sendStatus'](0x194);}return _0x449e9b;};}function handleError(_0x50404a,_0x38b50b){_0x38b50b=_0x38b50b||0x1f4;return function(_0xd1f20c){logger[_0x012e('0x24')](_0xd1f20c[_0x012e('0x25')]);if(_0xd1f20c[_0x012e('0x26')]){delete _0xd1f20c['name'];}_0x50404a['status'](_0x38b50b)[_0x012e('0x27')](_0xd1f20c);};}exports[_0x012e('0x28')]=function(_0x56cb3e,_0x38910e){var _0x2884bf={},_0x2c05af={},_0x30927c={'count':0x0,'rows':[]};var _0x20f5d9=_[_0x012e('0x29')](db[_0x012e('0x2a')]['rawAttributes'],function(_0x2f78dc){return{'name':_0x2f78dc[_0x012e('0x2b')],'type':_0x2f78dc['type'][_0x012e('0x2c')]};});_0x2c05af[_0x012e('0x2d')]=_[_0x012e('0x29')](_0x20f5d9,_0x012e('0x26'));_0x2c05af[_0x012e('0x2e')]=_['keys'](_0x56cb3e[_0x012e('0x2e')]);_0x2c05af['filters']=_['intersection'](_0x2c05af['model'],_0x2c05af[_0x012e('0x2e')]);_0x2884bf[_0x012e('0x2f')]=_['intersection'](_0x2c05af['model'],qs['fields'](_0x56cb3e[_0x012e('0x2e')]['fields']));_0x2884bf[_0x012e('0x2f')]=_0x2884bf[_0x012e('0x2f')][_0x012e('0x30')]?_0x2884bf[_0x012e('0x2f')]:_0x2c05af[_0x012e('0x2d')];if(!_0x56cb3e[_0x012e('0x2e')]['hasOwnProperty'](_0x012e('0x31'))){_0x2884bf['limit']=qs['limit'](_0x56cb3e[_0x012e('0x2e')]['limit']);_0x2884bf[_0x012e('0x19')]=qs[_0x012e('0x19')](_0x56cb3e[_0x012e('0x2e')]['offset']);}_0x2884bf['order']=qs[_0x012e('0x32')](_0x56cb3e[_0x012e('0x2e')]['sort']);_0x2884bf[_0x012e('0x33')]=qs[_0x012e('0x34')](_[_0x012e('0x35')](_0x56cb3e[_0x012e('0x2e')],_0x2c05af[_0x012e('0x34')]),_0x20f5d9);if(_0x56cb3e[_0x012e('0x2e')][_0x012e('0x36')]){_0x2884bf[_0x012e('0x33')]=_[_0x012e('0x37')](_0x2884bf[_0x012e('0x33')],{'$or':_['map'](_0x20f5d9,function(_0x4c3343){if(_0x4c3343[_0x012e('0x38')]!==_0x012e('0x39')){var _0xe69ae4={};_0xe69ae4[_0x4c3343['name']]={'$like':'%'+_0x56cb3e[_0x012e('0x2e')][_0x012e('0x36')]+'%'};return _0xe69ae4;}})});}_0x2884bf=_['merge']({},_0x2884bf,_0x56cb3e[_0x012e('0x3a')]);var _0x2fbfdd={'where':_0x2884bf[_0x012e('0x33')]};return db[_0x012e('0x2a')]['count'](_0x2fbfdd)['then'](function(_0x3e228e){_0x30927c[_0x012e('0x3b')]=_0x3e228e;if(_0x56cb3e['query'][_0x012e('0x3c')]){_0x2884bf[_0x012e('0x3d')]=[{'all':!![]}];}return db[_0x012e('0x2a')][_0x012e('0x3e')](_0x2884bf);})[_0x012e('0x23')](function(_0x46a84){_0x30927c[_0x012e('0x3f')]=_0x46a84;return _0x30927c;})['then'](respondWithFilteredResult(_0x38910e,_0x2884bf))[_0x012e('0x40')](handleError(_0x38910e,null));};exports[_0x012e('0x41')]=function(_0x405c59,_0x577977){var _0x16d7f4={'raw':!![],'where':{'id':_0x405c59[_0x012e('0x42')]['id']}},_0x182463={};_0x182463[_0x012e('0x2d')]=_[_0x012e('0x43')](db[_0x012e('0x2a')][_0x012e('0x44')]);_0x182463['query']=_[_0x012e('0x43')](_0x405c59['query']);_0x182463['filters']=_[_0x012e('0x45')](_0x182463['model'],_0x182463[_0x012e('0x2e')]);_0x16d7f4[_0x012e('0x2f')]=_[_0x012e('0x45')](_0x182463[_0x012e('0x2d')],qs[_0x012e('0x46')](_0x405c59[_0x012e('0x2e')]['fields']));_0x16d7f4['attributes']=_0x16d7f4['attributes']['length']?_0x16d7f4[_0x012e('0x2f')]:_0x182463[_0x012e('0x2d')];if(_0x405c59[_0x012e('0x2e')]['includeAll']){_0x16d7f4[_0x012e('0x3d')]=[{'all':!![]}];}_0x16d7f4=_['merge']({},_0x16d7f4,_0x405c59['options']);return db[_0x012e('0x2a')][_0x012e('0x47')](_0x16d7f4)[_0x012e('0x23')](handleEntityNotFound(_0x577977,null))[_0x012e('0x23')](respondWithResult(_0x577977,null))[_0x012e('0x40')](handleError(_0x577977,null));};exports[_0x012e('0x48')]=function(_0x466070,_0x4586c6){return db[_0x012e('0x2a')][_0x012e('0x48')](_0x466070[_0x012e('0x49')],{})['then'](function(_0x22640b){var _0x4f78ac=_0x466070[_0x012e('0x4a')][_0x012e('0x20')]({'plain':!![]});if(!_0x4f78ac)throw new Error(_0x012e('0x4b'));if(_0x4f78ac[_0x012e('0x4c')]===_0x012e('0x4a')){var _0x3389e2=_0x22640b['get']({'plain':!![]});var _0x49940c='CmContactHasItems';return db[_0x012e('0x4d')][_0x012e('0x47')]({'where':{'name':_0x49940c,'userProfileId':_0x4f78ac[_0x012e('0x4e')]},'raw':!![]})['then'](function(_0x1ded91){if(_0x1ded91&&_0x1ded91[_0x012e('0x4f')]===0x0){return db[_0x012e('0x22')]['create']({'name':_0x3389e2['name'],'resourceId':_0x3389e2['id'],'type':_0x1ded91[_0x012e('0x26')],'sectionId':_0x1ded91['id']},{})['then'](function(){return _0x22640b;});}else{return _0x22640b;}})['catch'](function(_0x4add51){logger[_0x012e('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4add51);throw _0x4add51;});}return _0x22640b;})[_0x012e('0x23')](respondWithResult(_0x4586c6,0xc9))[_0x012e('0x40')](handleError(_0x4586c6,null));};exports[_0x012e('0x1e')]=function(_0x587931,_0x313a44){if(_0x587931[_0x012e('0x49')]['id']){delete _0x587931[_0x012e('0x49')]['id'];}return db[_0x012e('0x2a')]['find']({'where':{'id':_0x587931[_0x012e('0x42')]['id']}})[_0x012e('0x23')](handleEntityNotFound(_0x313a44,null))['then'](saveUpdates(_0x587931[_0x012e('0x49')],null))[_0x012e('0x23')](respondWithResult(_0x313a44,null))[_0x012e('0x40')](handleError(_0x313a44,null));};exports[_0x012e('0x1f')]=function(_0x3a0f17,_0x5ad515){return db['CmContactHasItem']['find']({'where':{'id':_0x3a0f17[_0x012e('0x42')]['id']}})[_0x012e('0x23')](handleEntityNotFound(_0x5ad515,null))['then'](removeEntity(_0x5ad515,null))[_0x012e('0x40')](handleError(_0x5ad515,null));};
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js
index 1006063..d2799d7 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 _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
+var _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','define','cm_contact_has_items'];(function(_0x4fafc1,_0x8a9163){var _0x4611b9=function(_0x4da252){while(--_0x4da252){_0x4fafc1['push'](_0x4fafc1['shift']());}};_0x4611b9(++_0x8a9163);}(_0x1261,0x144));var _0x1126=function(_0x41b872,_0x4c4ef9){_0x41b872=_0x41b872-0x0;var _0x439768=_0x1261[_0x41b872];return _0x439768;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('CmContactHasItem',attributes,{'tableName':_0x1126('0xb'),'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 02a55f7..46ccc1e 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 _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
+var _0x91a6=['http','request','then','info','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x41bfe1,_0x2ffc83){var _0x30e883=function(_0x308ec1){while(--_0x308ec1){_0x41bfe1['push'](_0x41bfe1['shift']());}};_0x30e883(++_0x2ffc83);}(_0x91a6,0x12d));var _0x691a=function(_0x856187,_0x2418db){_0x856187=_0x856187-0x0;var _0x443e70=_0x91a6[_0x856187];return _0x443e70;};'use strict';var _=require(_0x691a('0x0'));var util=require(_0x691a('0x1'));var moment=require(_0x691a('0x2'));var BPromise=require(_0x691a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x691a('0x4'));var db=require(_0x691a('0x5'))['db'];var utils=require(_0x691a('0x6'));var logger=require(_0x691a('0x7'))(_0x691a('0x8'));var config=require('../../config/environment');var jayson=require(_0x691a('0x9'));var client=jayson[_0x691a('0xa')][_0x691a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45e12c,_0x28bb61,_0x1aec86){return new BPromise(function(_0x395efc,_0x5c7bfd){return client[_0x691a('0xc')](_0x45e12c,_0x1aec86)[_0x691a('0xd')](function(_0x5d03fe){logger[_0x691a('0xe')]('CmContactHasItem,\x20%s,\x20%s',_0x28bb61,'request\x20sent');logger[_0x691a('0xf')](_0x691a('0x10'),_0x28bb61,_0x691a('0x11'),JSON[_0x691a('0x12')](_0x5d03fe));if(_0x5d03fe[_0x691a('0x13')]){if(_0x5d03fe[_0x691a('0x13')][_0x691a('0x14')]===0x1f4){logger['error'](_0x691a('0x15'),_0x28bb61,_0x5d03fe[_0x691a('0x13')]['message']);return _0x5c7bfd(_0x5d03fe['error'][_0x691a('0x16')]);}logger['error'](_0x691a('0x15'),_0x28bb61,_0x5d03fe[_0x691a('0x13')][_0x691a('0x16')]);return _0x395efc(_0x5d03fe[_0x691a('0x13')][_0x691a('0x16')]);}else{logger['info'](_0x691a('0x15'),_0x28bb61,_0x691a('0x11'));_0x395efc(_0x5d03fe['result']['message']);}})[_0x691a('0x17')](function(_0x19929f){logger[_0x691a('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x28bb61,_0x19929f);_0x5c7bfd(_0x19929f);});});}
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js
index b7e041d..1b27af4 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 _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
+var _0x02fa=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x3792e6,_0x32bd91){var _0x441e44=function(_0x357478){while(--_0x357478){_0x3792e6['push'](_0x3792e6['shift']());}};_0x441e44(++_0x32bd91);}(_0x02fa,0x1d0));var _0xa02f=function(_0x1c700f,_0x3f7e95){_0x1c700f=_0x1c700f-0x0;var _0x5d5d0a=_0x02fa[_0x1c700f];return _0x5d5d0a;};'use strict';var multer=require(_0xa02f('0x0'));var util=require(_0xa02f('0x1'));var path=require(_0xa02f('0x2'));var timeout=require(_0xa02f('0x3'));var express=require(_0xa02f('0x4'));var router=express[_0xa02f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xa02f('0x6'));var config=require(_0xa02f('0x7'));var controller=require(_0xa02f('0x8'));router[_0xa02f('0x9')]('/',auth['isAuthenticated'](),controller[_0xa02f('0xa')]);router[_0xa02f('0x9')](_0xa02f('0xb'),auth[_0xa02f('0xc')](),controller[_0xa02f('0xd')]);router[_0xa02f('0xe')]('/',auth[_0xa02f('0xc')](),controller[_0xa02f('0xf')]);router[_0xa02f('0x10')](_0xa02f('0xb'),auth['isAuthenticated'](),controller[_0xa02f('0x11')]);router[_0xa02f('0x12')](_0xa02f('0xb'),auth[_0xa02f('0xc')](),controller['destroy']);module[_0xa02f('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js b/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js
index fc89843..86be15a 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 _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
+var _0x904c=['INTEGER','STRING','sequelize','exports'];(function(_0x100f6d,_0x36cce0){var _0x5eaa30=function(_0x3151a3){while(--_0x3151a3){_0x100f6d['push'](_0x100f6d['shift']());}};_0x5eaa30(++_0x36cce0);}(_0x904c,0x1f2));var _0xc904=function(_0x21ced1,_0xe3239a){_0x21ced1=_0x21ced1-0x0;var _0x4b06c4=_0x904c[_0x21ced1];return _0x4b06c4;};'use strict';var Sequelize=require(_0xc904('0x0'));module[_0xc904('0x1')]={'CmContactId':{'type':Sequelize[_0xc904('0x2')],'primaryKey':!![]},'phone':{'type':Sequelize[_0xc904('0x3')],'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 fc53a54..a813b1d 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 _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
+var _0xa729=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','index','map','CmContactHasPhone','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','merge','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','util','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xa729,0x129));var _0x9a72=function(_0x1bc42b,_0x5f38c0){_0x1bc42b=_0x1bc42b-0x0;var _0x193af5=_0xa729[_0x1bc42b];return _0x193af5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9a72('0x0'));var rimraf=require(_0x9a72('0x1'));var zipdir=require(_0x9a72('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9a72('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9a72('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x9a72('0x5'));var ejs=require(_0x9a72('0x6'));var fs=require('fs');var _=require(_0x9a72('0x7'));var squel=require(_0x9a72('0x8'));var crypto=require(_0x9a72('0x9'));var jsforce=require(_0x9a72('0xa'));var deskjs=require(_0x9a72('0xb'));var toCsv=require(_0x9a72('0x5'));var querystring=require(_0x9a72('0xc'));var Papa=require(_0x9a72('0xd'));var Redis=require(_0x9a72('0xe'));var authService=require(_0x9a72('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a72('0x10'));var logger=require(_0x9a72('0x11'))(_0x9a72('0x12'));var utils=require(_0x9a72('0x13'));var config=require(_0x9a72('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b275b,_0x17e6da){_0x17e6da=_0x17e6da||0xcc;return function(_0x469c4e){if(_0x469c4e){return _0x5b275b[_0x9a72('0x15')](_0x17e6da);}return _0x5b275b[_0x9a72('0x16')](_0x17e6da)[_0x9a72('0x17')]();};}function respondWithResult(_0xfa7ef8,_0x292c80){_0x292c80=_0x292c80||0xc8;return function(_0x387692){if(_0x387692){return _0xfa7ef8[_0x9a72('0x16')](_0x292c80)[_0x9a72('0x18')](_0x387692);}};}function respondWithFilteredResult(_0x18b873,_0x24d913){return function(_0x163b2e){if(_0x163b2e){var _0x5ba9d6=_0x163b2e['count'],_0x7e5c36=_0x24d913[_0x9a72('0x19')],_0x59b1b3=_0x24d913['offset']+_0x24d913[_0x9a72('0x1a')],_0x50d117;if(_0x59b1b3>=_0x5ba9d6){_0x59b1b3=_0x5ba9d6;_0x50d117=0xc8;}else{_0x50d117=0xce;}_0x18b873[_0x9a72('0x16')](_0x50d117);return _0x18b873[_0x9a72('0x1b')]('Content-Range',_0x7e5c36+'-'+_0x59b1b3+'/'+_0x5ba9d6)[_0x9a72('0x18')](_0x163b2e);}return null;};}function patchUpdates(_0x152dab){return function(_0x5988ba){try{jsonpatch[_0x9a72('0x1c')](_0x5988ba,_0x152dab,!![]);}catch(_0x31aa47){return BPromise[_0x9a72('0x1d')](_0x31aa47);}return _0x5988ba[_0x9a72('0x1e')]();};}function saveUpdates(_0xff1222,_0x1026b1){return function(_0x3e6d59){if(_0x3e6d59){return _0x3e6d59[_0x9a72('0x1f')](_0xff1222)[_0x9a72('0x20')](function(_0x106b92){return _0x106b92;});}return null;};}function removeEntity(_0x35c03b,_0x1566e4){return function(_0x3b886d){if(_0x3b886d){return _0x3b886d[_0x9a72('0x21')]()[_0x9a72('0x20')](function(){var _0x12296f=_0x3b886d[_0x9a72('0x22')]({'plain':!![]});var _0x3b6fb2='CmContactHasPhones';return db[_0x9a72('0x23')][_0x9a72('0x21')]({'where':{'type':_0x3b6fb2,'resourceId':_0x12296f['id']}})['then'](function(){return _0x3b886d;});})[_0x9a72('0x20')](function(){_0x35c03b[_0x9a72('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b3821,_0x34da08){return function(_0x3e4611){if(!_0x3e4611){_0x4b3821[_0x9a72('0x15')](0x194);}return _0x3e4611;};}function handleError(_0x735955,_0x222436){_0x222436=_0x222436||0x1f4;return function(_0x319bb8){logger[_0x9a72('0x24')](_0x319bb8['stack']);if(_0x319bb8['name']){delete _0x319bb8[_0x9a72('0x25')];}_0x735955[_0x9a72('0x16')](_0x222436)['send'](_0x319bb8);};}exports[_0x9a72('0x26')]=function(_0x3a5b92,_0x321494){var _0x17c17a={},_0x20a6b8={},_0x31f617={'count':0x0,'rows':[]};var _0x1a9b54=_[_0x9a72('0x27')](db[_0x9a72('0x28')]['rawAttributes'],function(_0x12434b){return{'name':_0x12434b['fieldName'],'type':_0x12434b[_0x9a72('0x29')][_0x9a72('0x2a')]};});_0x20a6b8[_0x9a72('0x2b')]=_['map'](_0x1a9b54,_0x9a72('0x25'));_0x20a6b8[_0x9a72('0x2c')]=_[_0x9a72('0x2d')](_0x3a5b92['query']);_0x20a6b8['filters']=_[_0x9a72('0x2e')](_0x20a6b8[_0x9a72('0x2b')],_0x20a6b8[_0x9a72('0x2c')]);_0x17c17a[_0x9a72('0x2f')]=_['intersection'](_0x20a6b8[_0x9a72('0x2b')],qs[_0x9a72('0x30')](_0x3a5b92[_0x9a72('0x2c')][_0x9a72('0x30')]));_0x17c17a['attributes']=_0x17c17a[_0x9a72('0x2f')][_0x9a72('0x31')]?_0x17c17a[_0x9a72('0x2f')]:_0x20a6b8[_0x9a72('0x2b')];if(!_0x3a5b92[_0x9a72('0x2c')][_0x9a72('0x32')](_0x9a72('0x33'))){_0x17c17a[_0x9a72('0x1a')]=qs[_0x9a72('0x1a')](_0x3a5b92['query'][_0x9a72('0x1a')]);_0x17c17a[_0x9a72('0x19')]=qs['offset'](_0x3a5b92['query'][_0x9a72('0x19')]);}_0x17c17a[_0x9a72('0x34')]=qs[_0x9a72('0x35')](_0x3a5b92['query'][_0x9a72('0x35')]);_0x17c17a[_0x9a72('0x36')]=qs['filters'](_[_0x9a72('0x37')](_0x3a5b92[_0x9a72('0x2c')],_0x20a6b8[_0x9a72('0x38')]),_0x1a9b54);if(_0x3a5b92['query'][_0x9a72('0x39')]){_0x17c17a[_0x9a72('0x36')]=_['merge'](_0x17c17a[_0x9a72('0x36')],{'$or':_['map'](_0x1a9b54,function(_0x8b6f27){if(_0x8b6f27['type']!==_0x9a72('0x3a')){var _0x506a35={};_0x506a35[_0x8b6f27[_0x9a72('0x25')]]={'$like':'%'+_0x3a5b92['query'][_0x9a72('0x39')]+'%'};return _0x506a35;}})});}_0x17c17a=_['merge']({},_0x17c17a,_0x3a5b92[_0x9a72('0x3b')]);var _0x1c1da8={'where':_0x17c17a[_0x9a72('0x36')]};return db['CmContactHasPhone']['count'](_0x1c1da8)[_0x9a72('0x20')](function(_0x3d140c){_0x31f617['count']=_0x3d140c;if(_0x3a5b92['query']['includeAll']){_0x17c17a[_0x9a72('0x3c')]=[{'all':!![]}];}return db[_0x9a72('0x28')][_0x9a72('0x3d')](_0x17c17a);})['then'](function(_0x27ce34){_0x31f617[_0x9a72('0x3e')]=_0x27ce34;return _0x31f617;})[_0x9a72('0x20')](respondWithFilteredResult(_0x321494,_0x17c17a))[_0x9a72('0x3f')](handleError(_0x321494,null));};exports[_0x9a72('0x40')]=function(_0x5cc7fd,_0x4eedcd){var _0x203d01={'raw':!![],'where':{'id':_0x5cc7fd[_0x9a72('0x41')]['id']}},_0xc72048={};_0xc72048[_0x9a72('0x2b')]=_[_0x9a72('0x2d')](db['CmContactHasPhone']['rawAttributes']);_0xc72048[_0x9a72('0x2c')]=_[_0x9a72('0x2d')](_0x5cc7fd[_0x9a72('0x2c')]);_0xc72048[_0x9a72('0x38')]=_[_0x9a72('0x2e')](_0xc72048['model'],_0xc72048[_0x9a72('0x2c')]);_0x203d01[_0x9a72('0x2f')]=_[_0x9a72('0x2e')](_0xc72048[_0x9a72('0x2b')],qs[_0x9a72('0x30')](_0x5cc7fd[_0x9a72('0x2c')][_0x9a72('0x30')]));_0x203d01[_0x9a72('0x2f')]=_0x203d01[_0x9a72('0x2f')][_0x9a72('0x31')]?_0x203d01['attributes']:_0xc72048[_0x9a72('0x2b')];if(_0x5cc7fd[_0x9a72('0x2c')][_0x9a72('0x42')]){_0x203d01[_0x9a72('0x3c')]=[{'all':!![]}];}_0x203d01=_[_0x9a72('0x43')]({},_0x203d01,_0x5cc7fd[_0x9a72('0x3b')]);return db['CmContactHasPhone'][_0x9a72('0x44')](_0x203d01)[_0x9a72('0x20')](handleEntityNotFound(_0x4eedcd,null))[_0x9a72('0x20')](respondWithResult(_0x4eedcd,null))[_0x9a72('0x3f')](handleError(_0x4eedcd,null));};exports['create']=function(_0x9e8b0f,_0x36113d){return db[_0x9a72('0x28')]['create'](_0x9e8b0f[_0x9a72('0x45')],{})[_0x9a72('0x20')](function(_0x2ece98){var _0x43d3ea=_0x9e8b0f[_0x9a72('0x46')][_0x9a72('0x22')]({'plain':!![]});if(!_0x43d3ea)throw new Error(_0x9a72('0x47'));if(_0x43d3ea[_0x9a72('0x48')]===_0x9a72('0x46')){var _0x1a2c26=_0x2ece98['get']({'plain':!![]});var _0xb1724e='CmContactHasPhones';return db[_0x9a72('0x49')][_0x9a72('0x44')]({'where':{'name':_0xb1724e,'userProfileId':_0x43d3ea['userProfileId']},'raw':!![]})[_0x9a72('0x20')](function(_0x411f4e){if(_0x411f4e&&_0x411f4e[_0x9a72('0x4a')]===0x0){return db['UserProfileResource'][_0x9a72('0x4b')]({'name':_0x1a2c26[_0x9a72('0x25')],'resourceId':_0x1a2c26['id'],'type':_0x411f4e['name'],'sectionId':_0x411f4e['id']},{})['then'](function(){return _0x2ece98;});}else{return _0x2ece98;}})[_0x9a72('0x3f')](function(_0xaed9a4){logger[_0x9a72('0x24')](_0x9a72('0x4c'),_0xaed9a4);throw _0xaed9a4;});}return _0x2ece98;})['then'](respondWithResult(_0x36113d,0xc9))['catch'](handleError(_0x36113d,null));};exports[_0x9a72('0x1f')]=function(_0x563c67,_0x2d541e){if(_0x563c67[_0x9a72('0x45')]['id']){delete _0x563c67['body']['id'];}return db[_0x9a72('0x28')][_0x9a72('0x44')]({'where':{'id':_0x563c67[_0x9a72('0x41')]['id']}})['then'](handleEntityNotFound(_0x2d541e,null))[_0x9a72('0x20')](saveUpdates(_0x563c67[_0x9a72('0x45')],null))[_0x9a72('0x20')](respondWithResult(_0x2d541e,null))[_0x9a72('0x3f')](handleError(_0x2d541e,null));};exports['destroy']=function(_0xa95314,_0x109cfc){return db[_0x9a72('0x28')]['find']({'where':{'id':_0xa95314[_0x9a72('0x41')]['id']}})[_0x9a72('0x20')](handleEntityNotFound(_0x109cfc,null))[_0x9a72('0x20')](removeEntity(_0x109cfc,null))[_0x9a72('0x3f')](handleError(_0x109cfc,null));};
\ No newline at end of file
diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.model.js b/server/api/cmContactHasPhone/cmContactHasPhone.model.js
index 17d801d..e7fb1d6 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 _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
+var _0xc3b5=['define','CmContactHasPhone','cm_contact_has_phones','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x118a4d,_0x4f8a9b){_0x118a4d=_0x118a4d-0x0;var _0x1db339=_0xc3b5[_0x118a4d];return _0x1db339;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5c3b('0x0'))(_0x5c3b('0x1'));var moment=require(_0x5c3b('0x2'));var BPromise=require(_0x5c3b('0x3'));var rp=require(_0x5c3b('0x4'));var fs=require('fs');var path=require(_0x5c3b('0x5'));var rimraf=require(_0x5c3b('0x6'));var config=require(_0x5c3b('0x7'));var attributes=require('./cmContactHasPhone.attributes');module[_0x5c3b('0x8')]=function(_0x6b8a1e,_0x56345e){return _0x6b8a1e[_0x5c3b('0x9')](_0x5c3b('0xa'),attributes,{'tableName':_0x5c3b('0xb'),'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 f998db9..e16f09b 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 _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
+var _0xf96b=['../../config/environment','jayson/promise','client','request','then','info','CmContactHasPhone,\x20%s,\x20%s','request\x20sent','debug','CmContactHasPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3ba5e4,_0x52418e){var _0x2e4feb=function(_0x33ae9a){while(--_0x33ae9a){_0x3ba5e4['push'](_0x3ba5e4['shift']());}};_0x2e4feb(++_0x52418e);}(_0xf96b,0x109));var _0xbf96=function(_0x5d337c,_0x59ffc9){_0x5d337c=_0x5d337c-0x0;var _0x55be38=_0xf96b[_0x5d337c];return _0x55be38;};'use strict';var _=require(_0xbf96('0x0'));var util=require(_0xbf96('0x1'));var moment=require(_0xbf96('0x2'));var BPromise=require(_0xbf96('0x3'));var rs=require(_0xbf96('0x4'));var fs=require('fs');var Redis=require(_0xbf96('0x5'));var db=require(_0xbf96('0x6'))['db'];var utils=require(_0xbf96('0x7'));var logger=require(_0xbf96('0x8'))(_0xbf96('0x9'));var config=require(_0xbf96('0xa'));var jayson=require(_0xbf96('0xb'));var client=jayson[_0xbf96('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e8271,_0x9270ca,_0x260da0){return new BPromise(function(_0x88b9fa,_0x56d77d){return client[_0xbf96('0xd')](_0x3e8271,_0x260da0)[_0xbf96('0xe')](function(_0x1ffe6b){logger[_0xbf96('0xf')](_0xbf96('0x10'),_0x9270ca,_0xbf96('0x11'));logger[_0xbf96('0x12')](_0xbf96('0x13'),_0x9270ca,'request\x20sent',JSON[_0xbf96('0x14')](_0x1ffe6b));if(_0x1ffe6b[_0xbf96('0x15')]){if(_0x1ffe6b['error'][_0xbf96('0x16')]===0x1f4){logger[_0xbf96('0x15')](_0xbf96('0x10'),_0x9270ca,_0x1ffe6b['error'][_0xbf96('0x17')]);return _0x56d77d(_0x1ffe6b[_0xbf96('0x15')][_0xbf96('0x17')]);}logger[_0xbf96('0x15')](_0xbf96('0x10'),_0x9270ca,_0x1ffe6b[_0xbf96('0x15')]['message']);return _0x88b9fa(_0x1ffe6b[_0xbf96('0x15')][_0xbf96('0x17')]);}else{logger[_0xbf96('0xf')](_0xbf96('0x10'),_0x9270ca,_0xbf96('0x11'));_0x88b9fa(_0x1ffe6b[_0xbf96('0x18')][_0xbf96('0x17')]);}})['catch'](function(_0x3296a7){logger['error'](_0xbf96('0x10'),_0x9270ca,_0x3296a7);_0x56d77d(_0x3296a7);});});}
\ No newline at end of file
diff --git a/server/api/cmContactHasPhone/index.js b/server/api/cmContactHasPhone/index.js
index f5fa541..f3f74eb 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 _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
+var _0x2024=['delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./cmContactHasPhone.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0x2024,0x192));var _0x4202=function(_0xbca48f,_0xaaf54a){_0xbca48f=_0xbca48f-0x0;var _0x454a43=_0x2024[_0xbca48f];return _0x454a43;};'use strict';var multer=require(_0x4202('0x0'));var util=require(_0x4202('0x1'));var path=require(_0x4202('0x2'));var timeout=require(_0x4202('0x3'));var express=require('express');var router=express[_0x4202('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4202('0x5'));var config=require(_0x4202('0x6'));var controller=require(_0x4202('0x7'));router[_0x4202('0x8')]('/',auth[_0x4202('0x9')](),controller[_0x4202('0xa')]);router[_0x4202('0x8')](_0x4202('0xb'),auth[_0x4202('0x9')](),controller[_0x4202('0xc')]);router[_0x4202('0xd')]('/',auth[_0x4202('0x9')](),controller['create']);router['put'](_0x4202('0xb'),auth[_0x4202('0x9')](),controller['update']);router[_0x4202('0xe')](_0x4202('0xb'),auth[_0x4202('0x9')](),controller['destroy']);module[_0x4202('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js
index 876e8d1..2676346 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 _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
+var _0x877f=['parse','values','isArray','stringify','sequelize','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','type','select'];(function(_0x444f6a,_0x37dc05){var _0xa8059d=function(_0x2db79d){while(--_0x2db79d){_0x444f6a['push'](_0x444f6a['shift']());}};_0xa8059d(++_0x37dc05);}(_0x877f,0x9a));var _0xf877=function(_0x27f649,_0x5f518c){_0x27f649=_0x27f649-0x0;var _0x2c9e85=_0x877f[_0x27f649];return _0x2c9e85;};'use strict';var Sequelize=require(_0xf877('0x0'));var _=require('lodash');module[_0xf877('0x1')]={'name':{'type':Sequelize[_0xf877('0x2')],'get':function(_0x21dda2){return this[_0xf877('0x3')](_0xf877('0x4'));}},'alias':{'type':Sequelize[_0xf877('0x5')],'allowNull':![],'set':function(_0x999ed7){this[_0xf877('0x6')](_0xf877('0x4'),_0x999ed7?_0x999ed7:this[_0xf877('0x3')](_0xf877('0x7')));}},'type':{'type':Sequelize[_0xf877('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xf877('0x8')]('long'),'get':function(){if(this[_0xf877('0x3')](_0xf877('0x9'))===_0xf877('0xa')){return JSON[_0xf877('0xb')](this[_0xf877('0x3')](_0xf877('0xc')));}else{return this[_0xf877('0x3')](_0xf877('0xc'));}},'set':function(_0x57bdba){if(Array[_0xf877('0xd')](_0x57bdba)){this[_0xf877('0x6')]('values',JSON[_0xf877('0xe')](_0x57bdba));}else{this[_0xf877('0x6')](_0xf877('0xc'),_0x57bdba);}}},'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 3024823..80d6b7a 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 _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
+var _0x30cd=['show','rawAttributes','fields','includeAll','find','body','params','create','sequelize','transaction','Sequelize','number','INTEGER','BOOLEAN','queryInterface','format','cf_%d','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','CmCustomField','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch'];(function(_0x4cce3e,_0x4a1349){var _0x391e08=function(_0x4b6708){while(--_0x4b6708){_0x4cce3e['push'](_0x4cce3e['shift']());}};_0x391e08(++_0x4a1349);}(_0x30cd,0x66));var _0xd30c=function(_0x2f0ec8,_0x2049da){_0x2f0ec8=_0x2f0ec8-0x0;var _0x4d0694=_0x30cd[_0x2f0ec8];return _0x4d0694;};'use strict';var pdf=require(_0xd30c('0x0'));var emlformat=require(_0xd30c('0x1'));var rimraf=require(_0xd30c('0x2'));var zipdir=require(_0xd30c('0x3'));var jsonpatch=require(_0xd30c('0x4'));var rp=require('request-promise');var moment=require(_0xd30c('0x5'));var BPromise=require(_0xd30c('0x6'));var Mustache=require(_0xd30c('0x7'));var util=require(_0xd30c('0x8'));var path=require('path');var sox=require(_0xd30c('0x9'));var csv=require(_0xd30c('0xa'));var ejs=require(_0xd30c('0xb'));var fs=require('fs');var _=require(_0xd30c('0xc'));var squel=require(_0xd30c('0xd'));var crypto=require(_0xd30c('0xe'));var jsforce=require(_0xd30c('0xf'));var deskjs=require(_0xd30c('0x10'));var toCsv=require(_0xd30c('0xa'));var querystring=require(_0xd30c('0x11'));var Papa=require(_0xd30c('0x12'));var Redis=require(_0xd30c('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd30c('0x14'));var hardwareService=require(_0xd30c('0x15'));var logger=require(_0xd30c('0x16'))(_0xd30c('0x17'));var utils=require(_0xd30c('0x18'));var config=require('../../config/environment');var db=require(_0xd30c('0x19'))['db'];function respondWithStatusCode(_0x7b8e6,_0x2cfe08){_0x2cfe08=_0x2cfe08||0xcc;return function(_0x33989f){if(_0x33989f){return _0x7b8e6['sendStatus'](_0x2cfe08);}return _0x7b8e6['status'](_0x2cfe08)[_0xd30c('0x1a')]();};}function respondWithResult(_0x42bcb1,_0x1b8ee6){_0x1b8ee6=_0x1b8ee6||0xc8;return function(_0x18f1bd){if(_0x18f1bd){return _0x42bcb1[_0xd30c('0x1b')](_0x1b8ee6)[_0xd30c('0x1c')](_0x18f1bd);}};}function respondWithFilteredResult(_0x3b4d8e,_0x3fb01d){return function(_0x5cc320){if(_0x5cc320){var _0x53a3bd=_0x5cc320[_0xd30c('0x1d')],_0x423b12=_0x3fb01d[_0xd30c('0x1e')],_0x2634cc=_0x3fb01d[_0xd30c('0x1e')]+_0x3fb01d[_0xd30c('0x1f')],_0x2099bd;if(_0x2634cc>=_0x53a3bd){_0x2634cc=_0x53a3bd;_0x2099bd=0xc8;}else{_0x2099bd=0xce;}_0x3b4d8e['status'](_0x2099bd);return _0x3b4d8e['set'](_0xd30c('0x20'),_0x423b12+'-'+_0x2634cc+'/'+_0x53a3bd)[_0xd30c('0x1c')](_0x5cc320);}return null;};}function patchUpdates(_0x5f2ec8){return function(_0x36edba){try{jsonpatch[_0xd30c('0x21')](_0x36edba,_0x5f2ec8,!![]);}catch(_0x3d2d8a){return BPromise[_0xd30c('0x22')](_0x3d2d8a);}return _0x36edba[_0xd30c('0x23')]();};}function saveUpdates(_0x21df6f,_0x33a01b){return function(_0xadfd10){if(_0xadfd10){return _0xadfd10[_0xd30c('0x24')](_0x21df6f)['then'](function(_0x4a657b){return _0x4a657b;});}return null;};}function removeEntity(_0x1850b1,_0x2b8925){return function(_0xe71865){if(_0xe71865){return _0xe71865[_0xd30c('0x25')]()[_0xd30c('0x26')](function(){_0x1850b1['status'](0xcc)[_0xd30c('0x1a')]();});}};}function handleEntityNotFound(_0x510075,_0x365dd6){return function(_0x19dbdf){if(!_0x19dbdf){_0x510075[_0xd30c('0x27')](0x194);}return _0x19dbdf;};}function handleError(_0x3a8ea2,_0x2d7630){_0x2d7630=_0x2d7630||0x1f4;return function(_0x5ee252){logger[_0xd30c('0x28')](_0x5ee252[_0xd30c('0x29')]);if(_0x5ee252[_0xd30c('0x2a')]){delete _0x5ee252['name'];}_0x3a8ea2['status'](_0x2d7630)[_0xd30c('0x2b')](_0x5ee252);};}exports['index']=function(_0x1927bc,_0x41edce){var _0x524f39={},_0x432902={},_0x422edd={'count':0x0,'rows':[]};var _0x4b8078=_[_0xd30c('0x2c')](db[_0xd30c('0x2d')]['rawAttributes'],function(_0x122713){return{'name':_0x122713[_0xd30c('0x2e')],'type':_0x122713[_0xd30c('0x2f')][_0xd30c('0x30')]};});_0x432902[_0xd30c('0x31')]=_['differenceBy'](_[_0xd30c('0x2c')](_0x4b8078,_0xd30c('0x2a')),[_0xd30c('0x2a')]);_0x432902[_0xd30c('0x32')]=_[_0xd30c('0x33')](_0x1927bc['query']);_0x432902[_0xd30c('0x34')]=_[_0xd30c('0x35')](_0x432902[_0xd30c('0x31')],_0x432902[_0xd30c('0x32')]);_0x524f39[_0xd30c('0x36')]=_[_0xd30c('0x35')](_0x432902['model'],qs['fields'](_0x1927bc['query']['fields']));_0x524f39[_0xd30c('0x36')]=_0x524f39['attributes'][_0xd30c('0x37')]?_0x524f39[_0xd30c('0x36')]:_0x432902[_0xd30c('0x31')];if(!_0x1927bc[_0xd30c('0x32')][_0xd30c('0x38')](_0xd30c('0x39'))){_0x524f39['limit']=qs[_0xd30c('0x1f')](_0x1927bc[_0xd30c('0x32')][_0xd30c('0x1f')]);_0x524f39['offset']=qs['offset'](_0x1927bc[_0xd30c('0x32')][_0xd30c('0x1e')]);}_0x524f39['order']=qs['sort'](_0x1927bc[_0xd30c('0x32')][_0xd30c('0x3a')]);_0x524f39[_0xd30c('0x3b')]=qs[_0xd30c('0x34')](_['pick'](_0x1927bc[_0xd30c('0x32')],_0x432902['filters']),_0x4b8078);if(_0x1927bc['query'][_0xd30c('0x3c')]){_0x524f39[_0xd30c('0x3b')]=_['merge'](_0x524f39[_0xd30c('0x3b')],{'$or':_[_0xd30c('0x2c')](_0x4b8078,function(_0x58b893){if(_0x58b893[_0xd30c('0x2f')]!==_0xd30c('0x3d')){var _0x1b14a2={};_0x1b14a2[_0x58b893[_0xd30c('0x2a')]]={'$like':'%'+_0x1927bc['query'][_0xd30c('0x3c')]+'%'};return _0x1b14a2;}})});}_0x524f39=_[_0xd30c('0x3e')]({},_0x524f39,_0x1927bc[_0xd30c('0x3f')]);var _0x3977f3={'where':_0x524f39[_0xd30c('0x3b')]};return db[_0xd30c('0x2d')]['count'](_0x3977f3)[_0xd30c('0x26')](function(_0x34c040){_0x422edd['count']=_0x34c040;if(_0x1927bc['query']['includeAll']){_0x524f39[_0xd30c('0x40')]=[{'all':!![]}];}return db[_0xd30c('0x2d')][_0xd30c('0x41')](_0x524f39);})['then'](function(_0x1316ff){_0x422edd[_0xd30c('0x42')]=_0x1316ff;return _0x422edd;})['then'](respondWithFilteredResult(_0x41edce,_0x524f39))[_0xd30c('0x43')](handleError(_0x41edce,null));};exports[_0xd30c('0x44')]=function(_0x1ecd7f,_0x493715){var _0x11ad36={'raw':!![],'where':{'id':_0x1ecd7f['params']['id']}},_0x5022c1={};_0x5022c1[_0xd30c('0x31')]=_[_0xd30c('0x33')](db[_0xd30c('0x2d')][_0xd30c('0x45')]);_0x5022c1[_0xd30c('0x32')]=_[_0xd30c('0x33')](_0x1ecd7f[_0xd30c('0x32')]);_0x5022c1['filters']=_[_0xd30c('0x35')](_0x5022c1[_0xd30c('0x31')],_0x5022c1['query']);_0x11ad36[_0xd30c('0x36')]=_['intersection'](_0x5022c1[_0xd30c('0x31')],qs[_0xd30c('0x46')](_0x1ecd7f[_0xd30c('0x32')][_0xd30c('0x46')]));_0x11ad36['attributes']=_0x11ad36[_0xd30c('0x36')][_0xd30c('0x37')]?_0x11ad36[_0xd30c('0x36')]:_0x5022c1[_0xd30c('0x31')];if(_0x1ecd7f[_0xd30c('0x32')][_0xd30c('0x47')]){_0x11ad36[_0xd30c('0x40')]=[{'all':!![]}];}_0x11ad36=_[_0xd30c('0x3e')]({},_0x11ad36,_0x1ecd7f[_0xd30c('0x3f')]);return db['CmCustomField'][_0xd30c('0x48')](_0x11ad36)[_0xd30c('0x26')](handleEntityNotFound(_0x493715,null))[_0xd30c('0x26')](respondWithResult(_0x493715,null))[_0xd30c('0x43')](handleError(_0x493715,null));};exports['update']=function(_0x5b8900,_0x1e2146){if(_0x5b8900[_0xd30c('0x49')]['id']){delete _0x5b8900['body']['id'];}return db[_0xd30c('0x2d')][_0xd30c('0x48')]({'where':{'id':_0x5b8900['params']['id']}})['then'](handleEntityNotFound(_0x1e2146,null))[_0xd30c('0x26')](saveUpdates(_0x5b8900[_0xd30c('0x49')],null))[_0xd30c('0x26')](respondWithResult(_0x1e2146,null))['catch'](handleError(_0x1e2146,null));};exports[_0xd30c('0x25')]=function(_0x2a6328,_0x496fe9){return db['CmCustomField'][_0xd30c('0x48')]({'where':{'id':_0x2a6328[_0xd30c('0x4a')]['id']}})[_0xd30c('0x26')](handleEntityNotFound(_0x496fe9,null))[_0xd30c('0x26')](removeEntity(_0x496fe9,null))[_0xd30c('0x43')](handleError(_0x496fe9,null));};exports[_0xd30c('0x4b')]=function(_0x224afa,_0x48944f){var _0x2d88c2;return db[_0xd30c('0x4c')][_0xd30c('0x4d')](function(_0x15884c){return db['CmCustomField'][_0xd30c('0x4b')](_0x224afa[_0xd30c('0x49')],{'transaction':_0x15884c})[_0xd30c('0x26')](function(_0x235596){_0x2d88c2=_0x235596;var _0x5e5d4e={'type':db[_0xd30c('0x4e')]['TEXT'],'transaction':_0x15884c};switch(_0x224afa[_0xd30c('0x49')]['type']){case'text':_0x5e5d4e[_0xd30c('0x2f')]=db[_0xd30c('0x4e')]['TEXT'];break;case _0xd30c('0x4f'):_0x5e5d4e[_0xd30c('0x2f')]=db[_0xd30c('0x4e')][_0xd30c('0x50')];break;case'switch':_0x5e5d4e[_0xd30c('0x2f')]=db[_0xd30c('0x4e')][_0xd30c('0x51')];_0x5e5d4e['defaultValue']=![];break;default:}return db['sequelize'][_0xd30c('0x52')]['addColumn']('cm_contacts',util[_0xd30c('0x53')](_0xd30c('0x54'),_0x2d88c2['id']),_0x5e5d4e);})[_0xd30c('0x26')](function(){return _0x2d88c2;});})[_0xd30c('0x26')](respondWithResult(_0x48944f,0xc9))[_0xd30c('0x43')](handleError(_0x48944f,null));};
\ No newline at end of file
diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js
index 7c6f9cf..8b27da5 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 _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
+var _0x9ccd=['cm_custom_fields','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField'];(function(_0x14d7fc,_0x5de317){var _0x4e8842=function(_0xdf0b37){while(--_0xdf0b37){_0x14d7fc['push'](_0x14d7fc['shift']());}};_0x4e8842(++_0x5de317);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ccd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd9cc('0x0'));var util=require('util');var logger=require(_0xd9cc('0x1'))(_0xd9cc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd9cc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd9cc('0x4'));var config=require(_0xd9cc('0x5'));var attributes=require(_0xd9cc('0x6'));module[_0xd9cc('0x7')]=function(_0x126f77,_0x113744){return _0x126f77[_0xd9cc('0x8')](_0xd9cc('0x9'),attributes,{'tableName':_0xd9cc('0xa'),'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 3ab9a8e..75a73b2 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 _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
+var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCustomField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2d53cd,_0x5cb506){var _0x9e4e30=function(_0x58e5fa){while(--_0x58e5fa){_0x2d53cd['push'](_0x2d53cd['shift']());}};_0x9e4e30(++_0x5cb506);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1b4f92,_0xb56718){_0x1b4f92=_0x1b4f92-0x0;var _0x3850c2=_0xb43b[_0x1b4f92];return _0x3850c2;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('CmCustomField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('CmCustomField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('CmCustomField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});}
\ No newline at end of file
diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js
index ba99ab6..2b6950f 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 _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
+var _0xa711=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','index','get','/:id','show','post','create','put','delete','isAuthenticated','destroy','multer','path','connect-timeout'];(function(_0x26b3ff,_0x52875f){var _0x2e629b=function(_0x42fbf9){while(--_0x42fbf9){_0x26b3ff['push'](_0x26b3ff['shift']());}};_0x2e629b(++_0x52875f);}(_0xa711,0xce));var _0x1a71=function(_0xfdc000,_0x678841){_0xfdc000=_0xfdc000-0x0;var _0x15a615=_0xa711[_0xfdc000];return _0x15a615;};'use strict';var multer=require(_0x1a71('0x0'));var util=require('util');var path=require(_0x1a71('0x1'));var timeout=require(_0x1a71('0x2'));var express=require(_0x1a71('0x3'));var router=express[_0x1a71('0x4')]();var auth=require(_0x1a71('0x5'));var interaction=require(_0x1a71('0x6'));var config=require(_0x1a71('0x7'));var controller=require(_0x1a71('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1a71('0x9')]);router[_0x1a71('0xa')](_0x1a71('0xb'),auth['isAuthenticated'](),controller[_0x1a71('0xc')]);router[_0x1a71('0xd')]('/',auth['isAuthenticated'](),controller[_0x1a71('0xe')]);router[_0x1a71('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1a71('0x10')](_0x1a71('0xb'),auth[_0x1a71('0x11')](),controller[_0x1a71('0x12')]);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 87ed86e..a39763e 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 _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
+var _0x5fab=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE'];(function(_0x4e3d0d,_0x4b55c2){var _0x19bbbb=function(_0x4a8892){while(--_0x4a8892){_0x4e3d0d['push'](_0x4e3d0d['shift']());}};_0x19bbbb(++_0x4b55c2);}(_0x5fab,0x177));var _0xb5fa=function(_0x1c391b,_0x331dc5){_0x1c391b=_0x1c391b-0x0;var _0x3da0c1=_0x5fab[_0x1c391b];return _0x3da0c1;};'use strict';var moment=require(_0xb5fa('0x0'));var Sequelize=require(_0xb5fa('0x1'));module['exports']={'phone':{'type':Sequelize[_0xb5fa('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xb5fa('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xb5fa('0x4')],'defaultValue':moment()[_0xb5fa('0x5')](_0xb5fa('0x6'))},'countbusyretry':{'type':Sequelize[_0xb5fa('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb5fa('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb5fa('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xb5fa('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xb5fa('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xb5fa('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xb5fa('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xb5fa('0x7')],'unique':_0xb5fa('0x9')},'UserId':{'type':Sequelize[_0xb5fa('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xb5fa('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xb5fa('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb5fa('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb5fa('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb5fa('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb5fa('0x7')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb5fa('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js
index 1ae0daa..192e650 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 _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
+var _0x60c2=['$notIn','$like','$notILike','$overlap','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','body','update','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','create','end','getPreview','getVoiceQueues','dialOrderByScheduledAt','transaction','direction','prev','hopperIds','ASC','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','findOne','scheduledat','LOCK','Contact','CmCompany','Company','List','VoiceQueue','Queue','dialActive','getOpenContacts','outbound','preview','length','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','util','path','ejs','lodash','squel','to-csv','querystring','ioredis','../../config/environment','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','CmHopper','rawAttributes','fieldName','key','model','map','query','keys','intersection','filters','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween'];(function(_0x695aef,_0x4eaa3f){var _0x5289d4=function(_0x1d1426){while(--_0x1d1426){_0x695aef['push'](_0x695aef['shift']());}};_0x5289d4(++_0x4eaa3f);}(_0x60c2,0x18f));var _0x260c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x60c2[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0x260c('0x0'));var emlformat=require(_0x260c('0x1'));var rimraf=require(_0x260c('0x2'));var zipdir=require(_0x260c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x260c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x260c('0x5'));var util=require(_0x260c('0x6'));var path=require(_0x260c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x260c('0x8'));var fs=require('fs');var _=require(_0x260c('0x9'));var squel=require(_0x260c('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x260c('0xb'));var querystring=require(_0x260c('0xc'));var Papa=require('papaparse');var Redis=require(_0x260c('0xd'));var shared=require(_0x260c('0xe'));var authService=require(_0x260c('0xf'));var qs=require(_0x260c('0x10'));var as=require(_0x260c('0x11'));var hardwareService=require(_0x260c('0x12'));var logger=require(_0x260c('0x13'))(_0x260c('0x14'));var utils=require('../../config/utils');var config=require(_0x260c('0xe'));var db=require(_0x260c('0x15'))['db'];function respondWithStatusCode(_0x59e234,_0x3d55e7){_0x3d55e7=_0x3d55e7||0xcc;return function(_0x87eecf){if(_0x87eecf){return _0x59e234[_0x260c('0x16')](_0x3d55e7);}return _0x59e234['status'](_0x3d55e7)['end']();};}function respondWithResult(_0x4b2bf2,_0xe3fdd8){_0xe3fdd8=_0xe3fdd8||0xc8;return function(_0x3ca6c0){if(_0x3ca6c0){return _0x4b2bf2[_0x260c('0x17')](_0xe3fdd8)[_0x260c('0x18')](_0x3ca6c0);}};}function respondWithFilteredResult(_0x22b2ab,_0x47f1e7){return function(_0x1630b6){if(_0x1630b6){var _0x2b5bf3=_0x1630b6[_0x260c('0x19')],_0x2f482d=_0x47f1e7[_0x260c('0x1a')],_0x4fb4ad=_0x47f1e7[_0x260c('0x1a')]+_0x47f1e7[_0x260c('0x1b')],_0x10e7e0;if(_0x4fb4ad>=_0x2b5bf3){_0x4fb4ad=_0x2b5bf3;_0x10e7e0=0xc8;}else{_0x10e7e0=0xce;}_0x22b2ab[_0x260c('0x17')](_0x10e7e0);return _0x22b2ab[_0x260c('0x1c')](_0x260c('0x1d'),_0x2f482d+'-'+_0x4fb4ad+'/'+_0x2b5bf3)[_0x260c('0x18')](_0x1630b6);}return null;};}function patchUpdates(_0x445a2f){return function(_0x137e22){try{jsonpatch[_0x260c('0x1e')](_0x137e22,_0x445a2f,!![]);}catch(_0x34c03a){return BPromise[_0x260c('0x1f')](_0x34c03a);}return _0x137e22[_0x260c('0x20')]();};}function saveUpdates(_0x1a3231,_0x51fe8f){return function(_0x50d473){if(_0x50d473){return _0x50d473['update'](_0x1a3231)[_0x260c('0x21')](function(_0x3f86c7){return _0x3f86c7;});}return null;};}function removeEntity(_0x24cde5,_0x29ac73){return function(_0x213419){if(_0x213419){return _0x213419['destroy']()[_0x260c('0x21')](function(){_0x24cde5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xad6761,_0x126e68){return function(_0x4d60a9){if(!_0x4d60a9){_0xad6761['sendStatus'](0x194);}return _0x4d60a9;};}function handleError(_0x31ac22,_0x48f3a0){_0x48f3a0=_0x48f3a0||0x1f4;return function(_0x27d691){logger[_0x260c('0x22')](_0x27d691[_0x260c('0x23')]);if(_0x27d691[_0x260c('0x24')]){delete _0x27d691[_0x260c('0x24')];}_0x31ac22['status'](_0x48f3a0)[_0x260c('0x25')](_0x27d691);};}exports[_0x260c('0x26')]=function(_0x153f1f,_0x290f45){var _0x2ad90a={},_0xfd5ae0={},_0x36f843={'count':0x0,'rows':[]};var _0x56e43c=_['map'](db[_0x260c('0x27')][_0x260c('0x28')],function(_0x5e2f4f){return{'name':_0x5e2f4f[_0x260c('0x29')],'type':_0x5e2f4f['type'][_0x260c('0x2a')]};});_0xfd5ae0[_0x260c('0x2b')]=_[_0x260c('0x2c')](_0x56e43c,'name');_0xfd5ae0[_0x260c('0x2d')]=_[_0x260c('0x2e')](_0x153f1f[_0x260c('0x2d')]);_0xfd5ae0['filters']=_[_0x260c('0x2f')](_0xfd5ae0[_0x260c('0x2b')],_0xfd5ae0[_0x260c('0x2d')]);_0xfd5ae0[_0x260c('0x30')]=_['concat'](_0xfd5ae0[_0x260c('0x30')],[_0x260c('0x31'),_0x260c('0x32'),_0x260c('0x33'),_0x260c('0x34'),_0x260c('0x35'),_0x260c('0x36'),_0x260c('0x37'),_0x260c('0x38'),_0x260c('0x39'),_0x260c('0x3a'),_0x260c('0x3b'),'$in',_0x260c('0x3c'),_0x260c('0x3d'),'$notLike','$iLike',_0x260c('0x3e'),_0x260c('0x3d'),_0x260c('0x3f'),_0x260c('0x40'),_0x260c('0x41'),_0x260c('0x42')]);_0x2ad90a[_0x260c('0x43')]=_[_0x260c('0x2f')](_0xfd5ae0[_0x260c('0x2b')],qs[_0x260c('0x44')](_0x153f1f[_0x260c('0x2d')][_0x260c('0x44')]));_0x2ad90a[_0x260c('0x43')]=_0x2ad90a[_0x260c('0x43')]['length']?_0x2ad90a[_0x260c('0x43')]:_0xfd5ae0[_0x260c('0x2b')];if(!_0x153f1f['query'][_0x260c('0x45')](_0x260c('0x46'))){_0x2ad90a[_0x260c('0x1b')]=qs['limit'](_0x153f1f[_0x260c('0x2d')]['limit']);_0x2ad90a[_0x260c('0x1a')]=qs['offset'](_0x153f1f[_0x260c('0x2d')]['offset']);}_0x2ad90a['order']=qs[_0x260c('0x47')](_0x153f1f[_0x260c('0x2d')][_0x260c('0x47')]);_0x2ad90a[_0x260c('0x48')]=qs[_0x260c('0x30')](_[_0x260c('0x49')](_0x153f1f[_0x260c('0x2d')],_0xfd5ae0[_0x260c('0x30')]),_0x56e43c);if(_0x153f1f[_0x260c('0x2d')][_0x260c('0x4a')]){_0x2ad90a['where']=_[_0x260c('0x4b')](_0x2ad90a[_0x260c('0x48')],{'$or':_[_0x260c('0x2c')](_0x56e43c,function(_0x14b242){if(_0x14b242[_0x260c('0x4c')]!==_0x260c('0x4d')){var _0x30ccf0={};_0x30ccf0[_0x14b242[_0x260c('0x24')]]={'$like':'%'+_0x153f1f[_0x260c('0x2d')][_0x260c('0x4a')]+'%'};return _0x30ccf0;}})});}_0x2ad90a=_['merge']({},_0x2ad90a,_0x153f1f['options']);var _0x44df4b={'where':_0x2ad90a[_0x260c('0x48')]};return db['CmHopper'][_0x260c('0x19')](_0x44df4b)['then'](function(_0xbd4b7d){_0x36f843['count']=_0xbd4b7d;if(_0x153f1f[_0x260c('0x2d')]['includeAll']){_0x2ad90a[_0x260c('0x4e')]=[{'all':!![]}];}return db['CmHopper'][_0x260c('0x4f')](_0x2ad90a);})[_0x260c('0x21')](function(_0x551261){_0x36f843[_0x260c('0x50')]=_0x551261;return _0x36f843;})[_0x260c('0x21')](respondWithFilteredResult(_0x290f45,_0x2ad90a))[_0x260c('0x51')](handleError(_0x290f45,null));};exports[_0x260c('0x52')]=function(_0x4eacb1,_0x411204){var _0x36e633={'raw':!![],'where':{'id':_0x4eacb1[_0x260c('0x53')]['id']}},_0x50eacc={};_0x50eacc[_0x260c('0x2b')]=_['keys'](db['CmHopper'][_0x260c('0x28')]);_0x50eacc[_0x260c('0x2d')]=_[_0x260c('0x2e')](_0x4eacb1['query']);_0x50eacc['filters']=_[_0x260c('0x2f')](_0x50eacc[_0x260c('0x2b')],_0x50eacc[_0x260c('0x2d')]);_0x36e633[_0x260c('0x43')]=_[_0x260c('0x2f')](_0x50eacc[_0x260c('0x2b')],qs['fields'](_0x4eacb1[_0x260c('0x2d')][_0x260c('0x44')]));_0x36e633[_0x260c('0x43')]=_0x36e633[_0x260c('0x43')]['length']?_0x36e633['attributes']:_0x50eacc[_0x260c('0x2b')];if(_0x4eacb1[_0x260c('0x2d')][_0x260c('0x54')]){_0x36e633[_0x260c('0x4e')]=[{'all':!![]}];}_0x36e633=_['merge']({},_0x36e633,_0x4eacb1[_0x260c('0x55')]);return db[_0x260c('0x27')][_0x260c('0x56')](_0x36e633)['then'](handleEntityNotFound(_0x411204,null))[_0x260c('0x21')](respondWithResult(_0x411204,null))[_0x260c('0x51')](handleError(_0x411204,null));};exports['create']=function(_0x16effd,_0x3272a2){return db[_0x260c('0x27')]['create'](_0x16effd[_0x260c('0x57')],{})[_0x260c('0x21')](respondWithResult(_0x3272a2,0xc9))['catch'](handleError(_0x3272a2,null));};exports[_0x260c('0x58')]=function(_0xf29d10,_0x5a10e1){if(_0xf29d10[_0x260c('0x57')]['id']){delete _0xf29d10[_0x260c('0x57')]['id'];}return db[_0x260c('0x27')][_0x260c('0x56')]({'where':{'id':_0xf29d10[_0x260c('0x53')]['id']}})[_0x260c('0x21')](handleEntityNotFound(_0x5a10e1,null))[_0x260c('0x21')](saveUpdates(_0xf29d10[_0x260c('0x57')],null))[_0x260c('0x21')](respondWithResult(_0x5a10e1,null))[_0x260c('0x51')](handleError(_0x5a10e1,null));};exports[_0x260c('0x59')]=function(_0x4f1025,_0x311630){return db[_0x260c('0x27')]['describe']()[_0x260c('0x21')](respondWithResult(_0x311630,null))[_0x260c('0x51')](handleError(_0x311630,null));};exports[_0x260c('0x5a')]=function(_0x490139,_0x5bfcc6){var _0x2e904d;return db[_0x260c('0x27')]['find']({'where':{'id':_0x490139[_0x260c('0x53')]['id']}})['then'](handleEntityNotFound(_0x5bfcc6,null))[_0x260c('0x21')](function(_0x9cc117){if(_0x9cc117){return _0x9cc117[_0x260c('0x5a')]()[_0x260c('0x21')](function(_0x505119){return _0x505119;});}})[_0x260c('0x21')](function(_0xb72430){_0x2e904d=_0xb72430;if(_0xb72430){if(_0xb72430[_0x260c('0x5b')]||_0xb72430[_0x260c('0x5c')]){return db[_0xb72430[_0x260c('0x5b')]?'VoiceQueue':_0x260c('0x5d')][_0x260c('0x56')]({'where':{'id':_0xb72430['VoiceQueueId']?_0xb72430[_0x260c('0x5b')]:_0xb72430['CampaignId']},'attributes':['id',_0x260c('0x24')],'raw':!![]});}}})[_0x260c('0x21')](function(_0x589305){var _0x325a32={};if(_0x589305){_['merge'](_0x325a32,_[_0x260c('0x5e')](_0x2e904d[_0x260c('0x5f')],[_0x260c('0x60'),_0x260c('0x61'),'id']));_0x325a32[_0x260c('0x62')]=0x15;_0x325a32[_0x260c('0x63')]=_0x260c('0x64');_0x325a32[_0x260c('0x65')]=_0x589305[_0x260c('0x24')];_0x325a32[_0x260c('0x66')]=_0x490139['user'][_0x260c('0x24')];_0x325a32[_0x260c('0x67')]=_0x490139[_0x260c('0x68')]['id'];_0x325a32[_0x260c('0x64')]=!![];_0x325a32[_0x260c('0x69')]=moment()[_0x260c('0x6a')](_0x260c('0x6b'));_0x325a32['calleridnum']=_0x2e904d[_0x260c('0x6c')];_0x325a32['campaigntype']=_0x2e904d[_0x260c('0x5b')]?'queue':'ivr';return db[_0x260c('0x6d')][_0x260c('0x56')]({'where':{'id':_0x325a32[_0x260c('0x6e')]},'attributes':['firstName',_0x260c('0x6f')]})[_0x260c('0x21')](function(_0x4d6281){if(!_['isNil'](_0x5bfcc6)&&!_[_0x260c('0x70')](_0x4d6281[_0x260c('0x71')])){_0x325a32[_0x260c('0x72')]=_0x4d6281[_0x260c('0x71')];if(!_['isNil'](_0x4d6281[_0x260c('0x6f')])){_0x325a32[_0x260c('0x72')]+='\x20'+_0x4d6281[_0x260c('0x6f')];}}})[_0x260c('0x73')](function(){return db['CmHopperFinal'][_0x260c('0x74')](_0x325a32);});}})[_0x260c('0x21')](function(){return _0x5bfcc6['status'](0xcc)[_0x260c('0x75')]();})[_0x260c('0x51')](handleError(_0x5bfcc6,null));};exports[_0x260c('0x76')]=function(_0x1291aa,_0x576935,_0x2c89a9){var _0x2defc1=[];return db[_0x260c('0x6d')]['describe']()['then'](function(_0x57c7af){_0x2defc1=_[_0x260c('0x2e')](_0x57c7af);return _0x1291aa[_0x260c('0x68')][_0x260c('0x77')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x260c('0x78')],'raw':!![]});})[_0x260c('0x21')](function(_0x4fc039){if(_0x4fc039&&_0x4fc039['length']){return db['sequelize'][_0x260c('0x79')](function(_0x1ac7be){var _0x158593={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x260c('0x6a')](_0x260c('0x6b'))},'VoiceQueueId':{'$in':_['map'](_0x4fc039,'id')},'$or':[{'UserId':null},{'UserId':_0x1291aa[_0x260c('0x68')]['id']}]};var _0x4ca728=[];if(_0x1291aa[_0x260c('0x57')]['direction']&&_0x1291aa[_0x260c('0x57')][_0x260c('0x7a')]===_0x260c('0x7b')){if(!_['isEmpty'](_0x1291aa[_0x260c('0x57')]['hopperIds'])){_0x158593['id']={'$in':_0x1291aa[_0x260c('0x57')][_0x260c('0x7c')]};}_0x4ca728=[['priority','ASC'],['scheduledAt',_0x4fc039[0x0][_0x260c('0x78')]===_0x260c('0x7d')?_0x260c('0x7e'):_0x260c('0x7d')],db[_0x260c('0x7f')][_0x260c('0x80')](_0x260c('0x81')),['id',_0x260c('0x7e')]];}else{if(!_['isEmpty'](_0x1291aa[_0x260c('0x57')]['hopperIds'])){_0x158593['id']={'$notIn':_0x1291aa['body'][_0x260c('0x7c')]};}_0x4ca728=[[_0x260c('0x82'),_0x260c('0x7e')],['scheduledAt',_0x4fc039[0x0][_0x260c('0x78')]],db[_0x260c('0x7f')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x260c('0x7d')]];}return db[_0x260c('0x27')][_0x260c('0x83')]({'attributes':['id',_0x260c('0x84')],'where':_0x158593,'order':_0x4ca728,'transaction':_0x1ac7be,'lock':_0x1ac7be[_0x260c('0x85')]['UPDATE'],'include':[{'model':db[_0x260c('0x6d')],'as':_0x260c('0x86'),'attributes':_0x2defc1,'include':[{'model':db[_0x260c('0x87')],'as':_0x260c('0x88'),'attributes':['id',_0x260c('0x24')]}]},{'model':db['CmList'],'as':_0x260c('0x89'),'attributes':['id',_0x260c('0x24')]},{'model':db[_0x260c('0x8a')],'as':_0x260c('0x8b'),'attributes':['id',_0x260c('0x24'),_0x260c('0x8c')]}]})[_0x260c('0x21')](function(_0x4780fe){if(_0x4780fe){return _0x4780fe[_0x260c('0x58')]({'UserId':_0x1291aa[_0x260c('0x68')]['id']},{'transaction':_0x1ac7be});}});});}})['then'](handleEntityNotFound(_0x576935,null))[_0x260c('0x21')](respondWithResult(_0x576935,null))[_0x260c('0x51')](handleError(_0x576935,null));};exports[_0x260c('0x8d')]=function(_0x192d2e,_0x2dcf35,_0x44393c){return _0x192d2e[_0x260c('0x68')][_0x260c('0x77')]({'where':{'type':_0x260c('0x8e'),'dialActive':!![],'dialMethod':_0x260c('0x8f')},'attributes':['id'],'raw':!![]})['then'](function(_0x258d69){if(_0x258d69&&_0x258d69[_0x260c('0x90')]){return db[_0x260c('0x27')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x260c('0x2c')](_0x258d69,'id')},'$or':[{'UserId':null},{'UserId':_0x192d2e[_0x260c('0x68')]['id']}]}});}return 0x0;})[_0x260c('0x21')](function(_0x3034d2){if(!_['isNil'](_0x3034d2)&&_[_0x260c('0x91')](_0x3034d2)){return _0x2dcf35['status'](0xc8)[_0x260c('0x18')]({'contacts':_0x3034d2});}else{logger[_0x260c('0x22')](_0x260c('0x92'),_0x260c('0x8d'),0x194,_0x260c('0x93'));_0x2dcf35[_0x260c('0x16')](0x194);}})[_0x260c('0x51')](handleError(_0x2dcf35,null));};exports[_0x260c('0x94')]=function(_0x21f9a3,_0x5b7dbe,_0x1c7854){var _0x5df2d6=shared[_0x260c('0x95')];var _0x3ff4a4=[];_['map'](_0x5df2d6,function(_0x3f551e){_0x3ff4a4[_0x260c('0x96')]({'id':_0x3f551e[_0x260c('0x24')],'name':_0x3f551e[_0x260c('0x24')],'utcOffset':_0x3f551e[_0x260c('0x97')]});});return _0x5b7dbe[_0x260c('0x17')](0xc8)[_0x260c('0x18')]({'tz':_0x3ff4a4});};exports[_0x260c('0x98')]=function(_0x2364a2,_0x3d580b,_0x130130){var _0x3026ec=shared['timezones'];var _0x2810c4={};if(!_['isNil'](_0x3026ec[_0x2364a2['body']['id']]))_0x2810c4=_0x3026ec[_0x2364a2[_0x260c('0x57')]['id']];return _0x3d580b[_0x260c('0x17')](0xc8)[_0x260c('0x18')](_0x2810c4);};
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js
index 8c6e23a..cc83057 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 _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
+var _0xc5c0=['./cmHopper.attributes','exports','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4599b6,_0x40c254){var _0x2e014c=function(_0x3c4d90){while(--_0x3c4d90){_0x4599b6['push'](_0x4599b6['shift']());}};_0x2e014c(++_0x40c254);}(_0xc5c0,0xa0));var _0x0c5c=function(_0x245144,_0x1ed4d2){_0x245144=_0x245144-0x0;var _0x592903=_0xc5c0[_0x245144];return _0x592903;};'use strict';var _=require(_0x0c5c('0x0'));var util=require(_0x0c5c('0x1'));var logger=require(_0x0c5c('0x2'))('api');var moment=require(_0x0c5c('0x3'));var BPromise=require(_0x0c5c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c5c('0x5'));var rimraf=require(_0x0c5c('0x6'));var config=require(_0x0c5c('0x7'));var attributes=require(_0x0c5c('0x8'));module[_0x0c5c('0x9')]=function(_0x50dab0,_0x17e6be){return _0x50dab0['define'](_0x0c5c('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x0c5c('0xb'),'fields':[_0x0c5c('0xb')]},{'name':_0x0c5c('0xc'),'fields':[_0x0c5c('0xc')]},{'name':'priority','fields':[_0x0c5c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js
index c988381..6b3c3a8 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 _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
+var _0x074a=['raw','then','stringify','create','body','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','destroy','CmContact','describe','sequelize','order','LOCK','Contact','keys','User','name','voicePause','length','includes','UserId','push','all','GetContactDialer','transaction','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UPDATE','GetCmHopperPreview','GetContactByPhone','log','req\x20value','phone\x20value','phone','findOne','dialTimezone','DESC','getcontactbyohone','getContactByPhone','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','message','catch','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','include','map','model','ShowCmHopper','find'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x074a,0x175));var _0xa074=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x074a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa074('0x0'));var util=require(_0xa074('0x1'));var moment=require(_0xa074('0x2'));var BPromise=require(_0xa074('0x3'));var rs=require(_0xa074('0x4'));var fs=require('fs');var Redis=require(_0xa074('0x5'));var db=require(_0xa074('0x6'))['db'];var utils=require(_0xa074('0x7'));var logger=require(_0xa074('0x8'))('rpc');var config=require(_0xa074('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa074('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d8385,_0x34d052,_0x331338){return new BPromise(function(_0x1993be,_0x410cba){return client[_0xa074('0xb')](_0x5d8385,_0x331338)['then'](function(_0x1b9225){logger[_0xa074('0xc')](_0xa074('0xd'),_0x34d052,_0xa074('0xe'));logger[_0xa074('0xf')](_0xa074('0x10'),_0x34d052,'request\x20sent',JSON['stringify'](_0x1b9225));if(_0x1b9225[_0xa074('0x11')]){if(_0x1b9225['error']['code']===0x1f4){logger[_0xa074('0x11')](_0xa074('0xd'),_0x34d052,_0x1b9225[_0xa074('0x11')][_0xa074('0x12')]);return _0x410cba(_0x1b9225['error'][_0xa074('0x12')]);}logger[_0xa074('0x11')](_0xa074('0xd'),_0x34d052,_0x1b9225['error'][_0xa074('0x12')]);return _0x1993be(_0x1b9225[_0xa074('0x11')][_0xa074('0x12')]);}else{logger['info'](_0xa074('0xd'),_0x34d052,_0xa074('0xe'));_0x1993be(_0x1b9225['result'][_0xa074('0x12')]);}})[_0xa074('0x13')](function(_0x13475e){logger['error'](_0xa074('0xd'),_0x34d052,_0x13475e);_0x410cba(_0x13475e);});});}exports[_0xa074('0x14')]=function(_0x540f77){var _0x13641a=this;return new Promise(function(_0x237e2b,_0x12abd9){return db[_0xa074('0x15')][_0xa074('0x16')]({'raw':_0x540f77[_0xa074('0x17')]?_0x540f77[_0xa074('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x540f77[_0xa074('0x17')]?_0x540f77['options'][_0xa074('0x18')]||null:null,'attributes':_0x540f77[_0xa074('0x17')]?_0x540f77[_0xa074('0x17')][_0xa074('0x19')]||null:null,'limit':_0x540f77[_0xa074('0x17')]?_0x540f77[_0xa074('0x17')][_0xa074('0x1a')]||null:null,'include':_0x540f77[_0xa074('0x17')]?_0x540f77[_0xa074('0x17')]['include']?_['map'](_0x540f77[_0xa074('0x17')][_0xa074('0x1b')],function(_0x248f56){return{'model':db[_0x248f56['model']],'as':_0x248f56['as'],'attributes':_0x248f56['attributes'],'include':_0x248f56[_0xa074('0x1b')]?_[_0xa074('0x1c')](_0x248f56[_0xa074('0x1b')],function(_0x1f1089){return{'model':db[_0x1f1089[_0xa074('0x1d')]],'as':_0x1f1089['as'],'attributes':_0x1f1089[_0xa074('0x19')],'include':_0x1f1089[_0xa074('0x1b')]?_['map'](_0x1f1089['include'],function(_0x48105a){return{'model':db[_0x48105a['model']],'as':_0x48105a['as'],'attributes':_0x48105a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xc3bed5){logger[_0xa074('0xc')](_0xa074('0x14'),_0x540f77);logger[_0xa074('0xf')]('GetCmHopper',_0x540f77,JSON['stringify'](_0xc3bed5));_0x237e2b(_0xc3bed5);})[_0xa074('0x13')](function(_0x3f856c){logger['error'](_0xa074('0x14'),_0x3f856c['message'],_0x540f77);_0x12abd9(_0x13641a[_0xa074('0x11')](0x1f4,_0x3f856c[_0xa074('0x12')]));});});};exports[_0xa074('0x1e')]=function(_0xae3d93){var _0x2a4a16=this;return new Promise(function(_0x2d111a,_0x2a77f4){return db['CmHopper'][_0xa074('0x1f')]({'raw':_0xae3d93['options']?_0xae3d93[_0xa074('0x17')][_0xa074('0x20')]===undefined?!![]:![]:!![],'where':_0xae3d93[_0xa074('0x17')]?_0xae3d93['options'][_0xa074('0x18')]||null:null,'attributes':_0xae3d93[_0xa074('0x17')]?_0xae3d93[_0xa074('0x17')][_0xa074('0x19')]||null:null,'include':_0xae3d93[_0xa074('0x17')]?_0xae3d93[_0xa074('0x17')][_0xa074('0x1b')]?_[_0xa074('0x1c')](_0xae3d93['options'][_0xa074('0x1b')],function(_0x4c327e){return{'model':db[_0x4c327e[_0xa074('0x1d')]],'as':_0x4c327e['as'],'attributes':_0x4c327e[_0xa074('0x19')],'include':_0x4c327e[_0xa074('0x1b')]?_[_0xa074('0x1c')](_0x4c327e[_0xa074('0x1b')],function(_0x37bf5d){return{'model':db[_0x37bf5d[_0xa074('0x1d')]],'as':_0x37bf5d['as'],'attributes':_0x37bf5d[_0xa074('0x19')],'include':_0x37bf5d['include']?_['map'](_0x37bf5d['include'],function(_0x1663cf){return{'model':db[_0x1663cf[_0xa074('0x1d')]],'as':_0x1663cf['as'],'attributes':_0x1663cf[_0xa074('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa074('0x21')](function(_0x4e39dc){logger['info'](_0xa074('0x1e'),_0xae3d93);logger['debug'](_0xa074('0x1e'),_0xae3d93,JSON[_0xa074('0x22')](_0x4e39dc));_0x2d111a(_0x4e39dc);})['catch'](function(_0x3fecd0){logger['error']('ShowCmHopper',_0x3fecd0['message'],_0xae3d93);_0x2a77f4(_0x2a4a16[_0xa074('0x11')](0x1f4,_0x3fecd0[_0xa074('0x12')]));});});};exports['CreateCmHopper']=function(_0x3b0288){var _0x36bd33=this;return new Promise(function(_0x4ba475,_0xe84c11){return db[_0xa074('0x15')][_0xa074('0x23')](_0x3b0288[_0xa074('0x24')],{'raw':_0x3b0288[_0xa074('0x17')]?_0x3b0288[_0xa074('0x17')][_0xa074('0x20')]===undefined?!![]:![]:!![]})[_0xa074('0x21')](function(_0x2c6545){logger[_0xa074('0xc')](_0xa074('0x25'),_0x3b0288);logger['debug']('CreateCmHopper',_0x3b0288,JSON['stringify'](_0x2c6545));_0x4ba475(_0x2c6545);})['catch'](function(_0x5f4b64){logger[_0xa074('0x11')](_0xa074('0x25'),_0x5f4b64[_0xa074('0x12')],_0x3b0288);_0xe84c11(_0x36bd33[_0xa074('0x11')](0x1f4,_0x5f4b64['message']));});});};exports[_0xa074('0x26')]=function(_0x372882){var _0x261b37=this;return new Promise(function(_0x49d879,_0xe47f75){return db['CmHopper'][_0xa074('0x27')](_0x372882[_0xa074('0x24')],{'raw':_0x372882[_0xa074('0x17')]?_0x372882['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x372882[_0xa074('0x17')]?_0x372882['options'][_0xa074('0x18')]||null:null,'attributes':_0x372882[_0xa074('0x17')]?_0x372882[_0xa074('0x17')][_0xa074('0x19')]||null:null,'limit':_0x372882[_0xa074('0x17')]?_0x372882[_0xa074('0x17')][_0xa074('0x1a')]||null:null})[_0xa074('0x21')](function(_0x4582b3){logger[_0xa074('0xc')](_0xa074('0x26'),_0x372882);logger[_0xa074('0xf')](_0xa074('0x26'),_0x372882,JSON[_0xa074('0x22')](_0x4582b3));_0x49d879(_0x4582b3);})[_0xa074('0x13')](function(_0x2a4020){logger['error'](_0xa074('0x26'),_0x2a4020[_0xa074('0x12')],_0x372882);_0xe47f75(_0x261b37[_0xa074('0x11')](0x1f4,_0x2a4020[_0xa074('0x12')]));});});};exports[_0xa074('0x28')]=function(_0x223714){var _0x20ac57=this;return new Promise(function(_0x461f07,_0x1945e0){return db[_0xa074('0x15')][_0xa074('0x29')]({'where':_0x223714['options']?_0x223714[_0xa074('0x17')][_0xa074('0x18')]||null:null})[_0xa074('0x21')](function(_0x475105){logger[_0xa074('0xc')](_0xa074('0x28'),_0x223714);logger['debug'](_0xa074('0x28'),_0x223714,JSON[_0xa074('0x22')](_0x475105));_0x461f07(_0x475105);})['catch'](function(_0x164244){logger[_0xa074('0x11')](_0xa074('0x28'),_0x164244[_0xa074('0x12')],_0x223714);_0x1945e0(_0x20ac57[_0xa074('0x11')](0x1f4,_0x164244[_0xa074('0x12')]));});});};exports['GetContactDialer']=function(_0x14a81f){var _0x5d09ef=this;return new Promise(function(_0x5dd7a9,_0x58cfcb){return db[_0xa074('0x2a')][_0xa074('0x2b')]()[_0xa074('0x21')](function(_0x3d92da){return db[_0xa074('0x2c')]['transaction'](function(_0x303042){return db[_0xa074('0x15')]['findAll']({'where':_0x14a81f['options']?_0x14a81f[_0xa074('0x17')][_0xa074('0x18')]||null:null,'attributes':_0x14a81f[_0xa074('0x17')]?_0x14a81f[_0xa074('0x17')]['attributes']||null:null,'limit':_0x14a81f[_0xa074('0x17')]?_0x14a81f[_0xa074('0x17')]['limit']||null:null,'order':_0x14a81f[_0xa074('0x17')]?_0x14a81f[_0xa074('0x17')][_0xa074('0x2d')]||null:null,'transaction':_0x303042,'lock':_0x303042[_0xa074('0x2e')]['UPDATE'],'include':[{'model':db[_0xa074('0x2a')],'as':_0xa074('0x2f'),'attributes':_[_0xa074('0x30')](_0x3d92da)},{'model':db[_0xa074('0x31')],'as':'Agent','attributes':['id',_0xa074('0x32'),_0xa074('0x33')]}]})[_0xa074('0x21')](function(_0x23a2a0){var _0x4c1cbd=[];var _0x383c60=[];for(var _0x1b97ba=0x0;_0x1b97ba<_0x23a2a0[_0xa074('0x34')];_0x1b97ba+=0x1){if(!_0x383c60[_0xa074('0x35')](_0x23a2a0[_0x1b97ba][_0xa074('0x36')])){_0x383c60['push'](_0x23a2a0[_0x1b97ba]['UserId']);_0x4c1cbd[_0xa074('0x37')](_0x23a2a0[_0x1b97ba][_0xa074('0x27')](_0x14a81f[_0xa074('0x24')],{'transaction':_0x303042}));}}return BPromise[_0xa074('0x38')](_0x4c1cbd);});})[_0xa074('0x21')](function(_0x2a8c04){logger[_0xa074('0xc')]('GetContactDialer',_0x14a81f);logger[_0xa074('0xf')](_0xa074('0x39'),_0x14a81f,JSON['stringify'](_0x2a8c04));_0x5dd7a9(_0x2a8c04);})[_0xa074('0x13')](function(_0x2755d7){logger[_0xa074('0x11')]('GetContactDialer',_0x2755d7['message'],_0x14a81f);_0x58cfcb(_0x5d09ef[_0xa074('0x11')](0x1f4,_0x2755d7['message']));});});});};exports['MoveContactManagedDialer']=function(_0x116d2e){var _0x1b8b34=this;return new Promise(function(_0x5a2d7d,_0x5d71fe){return db[_0xa074('0x2c')][_0xa074('0x3a')](function(_0x325b0a){return db['CmHopperFinal']['create'](_0x116d2e[_0xa074('0x24')],{'raw':_0x116d2e['options']?_0x116d2e[_0xa074('0x17')][_0xa074('0x20')]===undefined?!![]:![]:!![],'transaction':_0x325b0a})[_0xa074('0x21')](function(){return db[_0xa074('0x15')][_0xa074('0x29')]({'where':_0x116d2e['options']?_0x116d2e[_0xa074('0x17')]['where']||null:null,'transaction':_0x325b0a});});})['then'](function(_0x15c2a2){logger[_0xa074('0xc')](_0xa074('0x3b'),_0x116d2e);logger[_0xa074('0xf')]('MoveContactManagedDialer',_0x116d2e,JSON[_0xa074('0x22')](_0x15c2a2));_0x5a2d7d(_0x15c2a2);})[_0xa074('0x13')](function(_0x7e343c){logger[_0xa074('0x11')](_0xa074('0x3b'),_0x7e343c['message'],_0x116d2e);_0x5d71fe(_0x1b8b34['error'](0x1f4,_0x7e343c[_0xa074('0x12')]));});});};exports[_0xa074('0x3c')]=function(_0x2867e2){var _0x965010=this;return new Promise(function(_0x29bed0,_0x36a068){return db[_0xa074('0x15')][_0xa074('0x16')]({'raw':_0x2867e2[_0xa074('0x17')]?_0x2867e2[_0xa074('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2867e2[_0xa074('0x17')]?_0x2867e2[_0xa074('0x17')][_0xa074('0x18')]||null:null,'attributes':[[db[_0xa074('0x2c')]['fn'](_0xa074('0x3d'),db['sequelize']['fn']('IF',db[_0xa074('0x2c')][_0xa074('0x3e')](_0xa074('0x3f')+util[_0xa074('0x40')]('\x22%s\x22',moment()[_0xa074('0x40')](_0xa074('0x41')))+_0xa074('0x42')))),_0xa074('0x43')]]})[_0xa074('0x21')](function(_0x154195){logger[_0xa074('0xc')]('CountReScheduled',_0x2867e2);logger[_0xa074('0xf')](_0xa074('0x3c'),_0x2867e2,JSON[_0xa074('0x22')](_0x154195));_0x29bed0(_0x154195);})[_0xa074('0x13')](function(_0x5e5b73){logger[_0xa074('0x11')](_0xa074('0x3c'),_0x5e5b73[_0xa074('0x12')],_0x2867e2);_0x36a068(_0x965010[_0xa074('0x11')](0x1f4,_0x5e5b73['message']));});});};exports[_0xa074('0x44')]=function(_0x47c0c2){var _0x24dffb=this;return new Promise(function(_0x29b437,_0x2ebdd7){return db[_0xa074('0x2a')][_0xa074('0x2b')]()['then'](function(_0x2aa47d){return db[_0xa074('0x2c')][_0xa074('0x3a')](function(_0x3e0003){return db[_0xa074('0x15')][_0xa074('0x16')]({'where':_0x47c0c2[_0xa074('0x17')]?_0x47c0c2[_0xa074('0x17')][_0xa074('0x18')]||null:null,'attributes':_0x47c0c2[_0xa074('0x17')]?_0x47c0c2[_0xa074('0x17')]['attributes']||null:null,'limit':0x1,'order':_0x47c0c2[_0xa074('0x17')]?_0x47c0c2['options'][_0xa074('0x2d')]||null:null,'group':db[_0xa074('0x15')][_0xa074('0x36')],'transaction':_0x3e0003,'lock':_0x3e0003['LOCK'][_0xa074('0x45')],'include':_0x47c0c2['options']?_0x47c0c2['options']['include']?_['map'](_0x47c0c2[_0xa074('0x17')][_0xa074('0x1b')],function(_0x864a09){return{'model':db[_0x864a09[_0xa074('0x1d')]],'as':_0x864a09['as'],'attributes':_0x864a09[_0xa074('0x19')],'include':_0x864a09['include']?_[_0xa074('0x1c')](_0x864a09[_0xa074('0x1b')],function(_0x4968fa){return{'model':db[_0x4968fa['model']],'as':_0x4968fa['as'],'attributes':_0x4968fa[_0xa074('0x19')],'include':_0x4968fa[_0xa074('0x1b')]?_[_0xa074('0x1c')](_0x4968fa[_0xa074('0x1b')],function(_0x834ac9){return{'model':db[_0x834ac9['model']],'as':_0x834ac9['as'],'attributes':_0x834ac9['attributes']};}):[]};}):[]};}):[]:[]})[_0xa074('0x21')](function(_0x33a49e){var _0x1b28f3=[];for(var _0x260543=0x0;_0x260543<_0x33a49e[_0xa074('0x34')];_0x260543+=0x1){_0x1b28f3['push'](_0x33a49e[_0x260543][_0xa074('0x27')](_0x47c0c2['body'],{'transaction':_0x3e0003}));}return BPromise[_0xa074('0x38')](_0x1b28f3);});})[_0xa074('0x21')](function(_0x5e9693){logger[_0xa074('0xc')](_0xa074('0x44'),_0x47c0c2);logger[_0xa074('0xf')](_0xa074('0x44'),_0x47c0c2,JSON[_0xa074('0x22')](_0x5e9693));_0x29b437(_0x5e9693);})[_0xa074('0x13')](function(_0x448eb4){logger[_0xa074('0x11')](_0xa074('0x44'),_0x448eb4['message'],_0x47c0c2);_0x2ebdd7(_0x24dffb['error'](0x1f4,_0x448eb4['message']));});});});};exports[_0xa074('0x46')]=function(_0x31cb4f){var _0x517f05=this;return new Promise(function(_0x21ff5c,_0x50ae9a){db[_0xa074('0x2a')][_0xa074('0x2b')]()[_0xa074('0x21')](function(_0x2005e5){return db[_0xa074('0x15')][_0xa074('0x16')]({'raw':_0x31cb4f['options']?_0x31cb4f['options'][_0xa074('0x20')]===undefined?!![]:![]:!![],'where':_0x31cb4f[_0xa074('0x17')]?_0x31cb4f[_0xa074('0x17')][_0xa074('0x18')]||null:null,'attributes':_0x31cb4f['options']?_0x31cb4f[_0xa074('0x17')]['attributes']||null:null,'limit':_0x31cb4f[_0xa074('0x17')]?_0x31cb4f[_0xa074('0x17')][_0xa074('0x1a')]||null:null,'include':_0x31cb4f['options']?_0x31cb4f['options'][_0xa074('0x1b')]?_[_0xa074('0x1c')](_0x31cb4f[_0xa074('0x17')]['include'],function(_0x19a1fb){return{'model':db[_0x19a1fb[_0xa074('0x1d')]],'as':_0x19a1fb['as'],'attributes':_0x19a1fb['as']===_0xa074('0x2f')?_['keys'](_0x2005e5):_0x19a1fb[_0xa074('0x19')],'include':_0x19a1fb[_0xa074('0x1b')]?_[_0xa074('0x1c')](_0x19a1fb[_0xa074('0x1b')],function(_0x24b2ae){return{'model':db[_0x24b2ae[_0xa074('0x1d')]],'as':_0x24b2ae['as'],'attributes':_0x24b2ae[_0xa074('0x19')],'include':_0x24b2ae[_0xa074('0x1b')]?_[_0xa074('0x1c')](_0x24b2ae[_0xa074('0x1b')],function(_0x52b042){return{'model':db[_0x52b042[_0xa074('0x1d')]],'as':_0x52b042['as'],'attributes':_0x52b042[_0xa074('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa074('0x21')](function(_0x2c929b){logger[_0xa074('0xc')](_0xa074('0x14'),_0x31cb4f);logger['debug'](_0xa074('0x14'),_0x31cb4f,JSON[_0xa074('0x22')](_0x2c929b));_0x21ff5c(_0x2c929b);})[_0xa074('0x13')](function(_0x371cc8){logger[_0xa074('0x11')](_0xa074('0x14'),_0x371cc8[_0xa074('0x12')],_0x31cb4f);_0x50ae9a(_0x517f05[_0xa074('0x11')](0x1f4,_0x371cc8[_0xa074('0x12')]));});});});};exports[_0xa074('0x47')]=function(_0x195086){console[_0xa074('0x48')](_0xa074('0x49'),_0x195086);console['log'](_0xa074('0x4a'),_0x195086[_0xa074('0x17')]['where'][_0xa074('0x4b')]);_this=this;return new Promise(function(_0x3ad60d,_0x287e72){return db[_0xa074('0x2a')][_0xa074('0x4c')]({'raw':!![],'where':{'phone':_0x195086[_0xa074('0x17')]['where'][_0xa074('0x4b')]},'attributes':['id',_0xa074('0x4d')],'order':[['id',_0xa074('0x4e')]]})['then'](function(_0xec34fe){console[_0xa074('0x48')](_0xa074('0x4f'),_0xec34fe);logger['info'](_0xa074('0x50'),_0x195086);logger['debug'](_0xa074('0x50'),_0x195086,JSON['stringify'](_0xec34fe));_0x3ad60d(_0xec34fe);})[_0xa074('0x13')](function(_0x5b2372){logger[_0xa074('0x11')]('getContactByPhone',_0x5b2372['message'],_0x195086);_0x287e72(_this[_0xa074('0x11')](0x1f4,_0x5b2372['message']));});});};
\ No newline at end of file
diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js
index 3083816..18b7332 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 _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
+var _0x2eb2=['/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','post','/preview','getPreview','/timezone','getTimezone','/:id','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x2eb2,0x19f));var _0x22eb=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x2eb2[_0x1ac595];return _0x455fff;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var auth=require(_0x22eb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x22eb('0x6'));var controller=require('./cmHopper.controller');router['get']('/',auth[_0x22eb('0x7')](),controller[_0x22eb('0x8')]);router[_0x22eb('0x9')](_0x22eb('0xa'),auth[_0x22eb('0x7')](),controller[_0x22eb('0xb')]);router[_0x22eb('0x9')](_0x22eb('0xc'),auth[_0x22eb('0x7')](),controller[_0x22eb('0xd')]);router[_0x22eb('0x9')](_0x22eb('0xe'),auth['isAuthenticated'](),controller[_0x22eb('0xf')]);router['get']('/:id',auth[_0x22eb('0x7')](),controller['show']);router[_0x22eb('0x10')]('/',auth[_0x22eb('0x7')](),controller['create']);router['post'](_0x22eb('0x11'),auth[_0x22eb('0x7')](),controller[_0x22eb('0x12')]);router[_0x22eb('0x10')](_0x22eb('0x13'),auth['isAuthenticated'](),controller[_0x22eb('0x14')]);router['put'](_0x22eb('0x15'),auth['isAuthenticated'](),controller[_0x22eb('0x16')]);router[_0x22eb('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x22eb('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js
index 91761cb..5bf1e07 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 _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
+var _0xf056=['STRING','moment','sequelize','exports','INTEGER'];(function(_0x2073da,_0x94a8c3){var _0x551f56=function(_0x43047e){while(--_0x43047e){_0x2073da['push'](_0x2073da['shift']());}};_0x551f56(++_0x94a8c3);}(_0xf056,0x1c8));var _0x6f05=function(_0x4ee634,_0x3c4e6b){_0x4ee634=_0x4ee634-0x0;var _0x55189a=_0xf056[_0x4ee634];return _0x55189a;};'use strict';var moment=require(_0x6f05('0x0'));var Sequelize=require(_0x6f05('0x1'));module[_0x6f05('0x2')]={'CmHopperId':{'type':Sequelize[_0x6f05('0x3')]},'phone':{'type':Sequelize[_0x6f05('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x6f05('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x6f05('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6f05('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6f05('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x6f05('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6f05('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6f05('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6f05('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6f05('0x3')],'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 7cf0bf2..16143d5 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 _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
+var _0x8af4=['../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','CmHopperAdditionalPhones','destroy','error','stack','name','send','index','map','CmHopperAdditionalPhone','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x15f3c0,_0x165a64){var _0x1adfe0=function(_0x212cfc){while(--_0x212cfc){_0x15f3c0['push'](_0x15f3c0['shift']());}};_0x1adfe0(++_0x165a64);}(_0x8af4,0xe9));var _0x48af=function(_0x493b70,_0x168e73){_0x493b70=_0x493b70-0x0;var _0x4c2355=_0x8af4[_0x493b70];return _0x4c2355;};'use strict';var pdf=require(_0x48af('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x48af('0x1'));var zipdir=require(_0x48af('0x2'));var jsonpatch=require(_0x48af('0x3'));var rp=require('request-promise');var moment=require(_0x48af('0x4'));var BPromise=require(_0x48af('0x5'));var Mustache=require(_0x48af('0x6'));var util=require(_0x48af('0x7'));var path=require(_0x48af('0x8'));var sox=require(_0x48af('0x9'));var csv=require(_0x48af('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x48af('0xb'));var crypto=require('crypto');var jsforce=require(_0x48af('0xc'));var deskjs=require(_0x48af('0xd'));var toCsv=require(_0x48af('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x48af('0xe'));var authService=require(_0x48af('0xf'));var qs=require(_0x48af('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x48af('0x11'));var logger=require(_0x48af('0x12'))(_0x48af('0x13'));var utils=require(_0x48af('0x14'));var config=require(_0x48af('0x15'));var db=require(_0x48af('0x16'))['db'];function respondWithStatusCode(_0x53f77f,_0x176e3e){_0x176e3e=_0x176e3e||0xcc;return function(_0x450334){if(_0x450334){return _0x53f77f[_0x48af('0x17')](_0x176e3e);}return _0x53f77f[_0x48af('0x18')](_0x176e3e)[_0x48af('0x19')]();};}function respondWithResult(_0x30c124,_0x1042ff){_0x1042ff=_0x1042ff||0xc8;return function(_0x333c5e){if(_0x333c5e){return _0x30c124[_0x48af('0x18')](_0x1042ff)[_0x48af('0x1a')](_0x333c5e);}};}function respondWithFilteredResult(_0x674ec4,_0xd508d8){return function(_0x9c030f){if(_0x9c030f){var _0x4561f1=_0x9c030f[_0x48af('0x1b')],_0x1db611=_0xd508d8[_0x48af('0x1c')],_0x45a3c8=_0xd508d8[_0x48af('0x1c')]+_0xd508d8[_0x48af('0x1d')],_0x331c78;if(_0x45a3c8>=_0x4561f1){_0x45a3c8=_0x4561f1;_0x331c78=0xc8;}else{_0x331c78=0xce;}_0x674ec4[_0x48af('0x18')](_0x331c78);return _0x674ec4[_0x48af('0x1e')](_0x48af('0x1f'),_0x1db611+'-'+_0x45a3c8+'/'+_0x4561f1)[_0x48af('0x1a')](_0x9c030f);}return null;};}function patchUpdates(_0x5c32f6){return function(_0x153d4a){try{jsonpatch['apply'](_0x153d4a,_0x5c32f6,!![]);}catch(_0x29a8aa){return BPromise[_0x48af('0x20')](_0x29a8aa);}return _0x153d4a[_0x48af('0x21')]();};}function saveUpdates(_0x47cf86,_0x1728bd){return function(_0x2b7396){if(_0x2b7396){return _0x2b7396[_0x48af('0x22')](_0x47cf86)[_0x48af('0x23')](function(_0x5b369b){return _0x5b369b;});}return null;};}function removeEntity(_0x3208fa,_0x54d1f7){return function(_0x264f48){if(_0x264f48){return _0x264f48['destroy']()['then'](function(){var _0x50466d=_0x264f48['get']({'plain':!![]});var _0x42a446=_0x48af('0x24');return db['UserProfileResource'][_0x48af('0x25')]({'where':{'type':_0x42a446,'resourceId':_0x50466d['id']}})['then'](function(){return _0x264f48;});})['then'](function(){_0x3208fa[_0x48af('0x18')](0xcc)[_0x48af('0x19')]();});}};}function handleEntityNotFound(_0x8bc62e,_0x48ee6d){return function(_0x446524){if(!_0x446524){_0x8bc62e[_0x48af('0x17')](0x194);}return _0x446524;};}function handleError(_0x5dac88,_0x251c64){_0x251c64=_0x251c64||0x1f4;return function(_0x653694){logger[_0x48af('0x26')](_0x653694[_0x48af('0x27')]);if(_0x653694[_0x48af('0x28')]){delete _0x653694['name'];}_0x5dac88[_0x48af('0x18')](_0x251c64)[_0x48af('0x29')](_0x653694);};}exports[_0x48af('0x2a')]=function(_0x9a49c3,_0x10718b){var _0x140cc9={},_0x388f91={},_0x31a378={'count':0x0,'rows':[]};var _0x59d692=_[_0x48af('0x2b')](db[_0x48af('0x2c')]['rawAttributes'],function(_0x3ef8a4){return{'name':_0x3ef8a4['fieldName'],'type':_0x3ef8a4[_0x48af('0x2d')][_0x48af('0x2e')]};});_0x388f91[_0x48af('0x2f')]=_[_0x48af('0x2b')](_0x59d692,_0x48af('0x28'));_0x388f91['query']=_[_0x48af('0x30')](_0x9a49c3[_0x48af('0x31')]);_0x388f91[_0x48af('0x32')]=_['intersection'](_0x388f91['model'],_0x388f91[_0x48af('0x31')]);_0x140cc9['attributes']=_['intersection'](_0x388f91[_0x48af('0x2f')],qs[_0x48af('0x33')](_0x9a49c3[_0x48af('0x31')]['fields']));_0x140cc9[_0x48af('0x34')]=_0x140cc9['attributes'][_0x48af('0x35')]?_0x140cc9['attributes']:_0x388f91[_0x48af('0x2f')];if(!_0x9a49c3[_0x48af('0x31')][_0x48af('0x36')](_0x48af('0x37'))){_0x140cc9[_0x48af('0x1d')]=qs['limit'](_0x9a49c3[_0x48af('0x31')]['limit']);_0x140cc9[_0x48af('0x1c')]=qs[_0x48af('0x1c')](_0x9a49c3[_0x48af('0x31')][_0x48af('0x1c')]);}_0x140cc9[_0x48af('0x38')]=qs[_0x48af('0x39')](_0x9a49c3['query'][_0x48af('0x39')]);_0x140cc9[_0x48af('0x3a')]=qs[_0x48af('0x32')](_[_0x48af('0x3b')](_0x9a49c3[_0x48af('0x31')],_0x388f91[_0x48af('0x32')]),_0x59d692);if(_0x9a49c3[_0x48af('0x31')][_0x48af('0x3c')]){_0x140cc9[_0x48af('0x3a')]=_['merge'](_0x140cc9[_0x48af('0x3a')],{'$or':_[_0x48af('0x2b')](_0x59d692,function(_0x534abb){if(_0x534abb['type']!==_0x48af('0x3d')){var _0x11afe4={};_0x11afe4[_0x534abb[_0x48af('0x28')]]={'$like':'%'+_0x9a49c3[_0x48af('0x31')][_0x48af('0x3c')]+'%'};return _0x11afe4;}})});}_0x140cc9=_[_0x48af('0x3e')]({},_0x140cc9,_0x9a49c3[_0x48af('0x3f')]);var _0x2cdbb5={'where':_0x140cc9[_0x48af('0x3a')]};return db['CmHopperAdditionalPhone'][_0x48af('0x1b')](_0x2cdbb5)['then'](function(_0x1e6134){_0x31a378[_0x48af('0x1b')]=_0x1e6134;if(_0x9a49c3[_0x48af('0x31')]['includeAll']){_0x140cc9[_0x48af('0x40')]=[{'all':!![]}];}return db[_0x48af('0x2c')][_0x48af('0x41')](_0x140cc9);})[_0x48af('0x23')](function(_0x14de8c){_0x31a378[_0x48af('0x42')]=_0x14de8c;return _0x31a378;})[_0x48af('0x23')](respondWithFilteredResult(_0x10718b,_0x140cc9))[_0x48af('0x43')](handleError(_0x10718b,null));};exports[_0x48af('0x44')]=function(_0x5795b6,_0x5d0f45){var _0x585c0b={'raw':!![],'where':{'id':_0x5795b6[_0x48af('0x45')]['id']}},_0x558763={};_0x558763[_0x48af('0x2f')]=_[_0x48af('0x30')](db[_0x48af('0x2c')][_0x48af('0x46')]);_0x558763[_0x48af('0x31')]=_[_0x48af('0x30')](_0x5795b6[_0x48af('0x31')]);_0x558763[_0x48af('0x32')]=_[_0x48af('0x47')](_0x558763[_0x48af('0x2f')],_0x558763[_0x48af('0x31')]);_0x585c0b['attributes']=_[_0x48af('0x47')](_0x558763['model'],qs[_0x48af('0x33')](_0x5795b6[_0x48af('0x31')][_0x48af('0x33')]));_0x585c0b[_0x48af('0x34')]=_0x585c0b[_0x48af('0x34')][_0x48af('0x35')]?_0x585c0b[_0x48af('0x34')]:_0x558763['model'];if(_0x5795b6[_0x48af('0x31')][_0x48af('0x48')]){_0x585c0b[_0x48af('0x40')]=[{'all':!![]}];}_0x585c0b=_[_0x48af('0x3e')]({},_0x585c0b,_0x5795b6[_0x48af('0x3f')]);return db[_0x48af('0x2c')][_0x48af('0x49')](_0x585c0b)['then'](handleEntityNotFound(_0x5d0f45,null))[_0x48af('0x23')](respondWithResult(_0x5d0f45,null))[_0x48af('0x43')](handleError(_0x5d0f45,null));};exports['create']=function(_0x4065df,_0x15eece){return db['CmHopperAdditionalPhone'][_0x48af('0x4a')](_0x4065df['body'],{})[_0x48af('0x23')](function(_0x146a74){var _0x1b6b2c=_0x4065df[_0x48af('0x4b')][_0x48af('0x4c')]({'plain':!![]});if(!_0x1b6b2c)throw new Error(_0x48af('0x4d'));if(_0x1b6b2c[_0x48af('0x4e')]===_0x48af('0x4b')){var _0x3dc3b0=_0x146a74['get']({'plain':!![]});var _0x1471a4=_0x48af('0x24');return db[_0x48af('0x4f')][_0x48af('0x49')]({'where':{'name':_0x1471a4,'userProfileId':_0x1b6b2c[_0x48af('0x50')]},'raw':!![]})[_0x48af('0x23')](function(_0x20a58d){if(_0x20a58d&&_0x20a58d[_0x48af('0x51')]===0x0){return db[_0x48af('0x52')][_0x48af('0x4a')]({'name':_0x3dc3b0['name'],'resourceId':_0x3dc3b0['id'],'type':_0x20a58d[_0x48af('0x28')],'sectionId':_0x20a58d['id']},{})['then'](function(){return _0x146a74;});}else{return _0x146a74;}})['catch'](function(_0x46ca28){logger['error'](_0x48af('0x53'),_0x46ca28);throw _0x46ca28;});}return _0x146a74;})['then'](respondWithResult(_0x15eece,0xc9))[_0x48af('0x43')](handleError(_0x15eece,null));};exports['update']=function(_0x2f077e,_0x549bbd){if(_0x2f077e[_0x48af('0x54')]['id']){delete _0x2f077e[_0x48af('0x54')]['id'];}return db['CmHopperAdditionalPhone'][_0x48af('0x49')]({'where':{'id':_0x2f077e[_0x48af('0x45')]['id']}})['then'](handleEntityNotFound(_0x549bbd,null))[_0x48af('0x23')](saveUpdates(_0x2f077e['body'],null))[_0x48af('0x23')](respondWithResult(_0x549bbd,null))[_0x48af('0x43')](handleError(_0x549bbd,null));};exports[_0x48af('0x25')]=function(_0x5a7be0,_0x3df90d){return db[_0x48af('0x2c')][_0x48af('0x49')]({'where':{'id':_0x5a7be0[_0x48af('0x45')]['id']}})[_0x48af('0x23')](handleEntityNotFound(_0x3df90d,null))['then'](removeEntity(_0x3df90d,null))[_0x48af('0x43')](handleError(_0x3df90d,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js
index 67e0ceb..f3e063e 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 _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
+var _0x400d=['define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes'];(function(_0x4acb7a,_0x31c109){var _0x385fa5=function(_0x929870){while(--_0x929870){_0x4acb7a['push'](_0x4acb7a['shift']());}};_0x385fa5(++_0x31c109);}(_0x400d,0x184));var _0xd400=function(_0x19bf9c,_0xa5ef2){_0x19bf9c=_0x19bf9c-0x0;var _0x2fd6a6=_0x400d[_0x19bf9c];return _0x2fd6a6;};'use strict';var _=require(_0xd400('0x0'));var util=require('util');var logger=require(_0xd400('0x1'))(_0xd400('0x2'));var moment=require(_0xd400('0x3'));var BPromise=require('bluebird');var rp=require(_0xd400('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd400('0x5'));var config=require(_0xd400('0x6'));var attributes=require(_0xd400('0x7'));module['exports']=function(_0x24af88,_0x2251ec){return _0x24af88[_0xd400('0x8')](_0xd400('0x9'),attributes,{'tableName':_0xd400('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 6124b46..5a016db 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 _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
+var _0x20f2=['CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CmHopper','findOne','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','ASC','countcongestionretry','VerifyAdditionalPhones','SwapAdditionalPhones','ContactId','duration','waitTime','scheduledat','add','minutes','phone','isNil','createdAt','updatedAt','hopperToAdd','transaction','update','IncrementPreviewCounters','field','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20f2,0x9c));var _0x220f=function(_0x11b9b5,_0x2a35e7){_0x11b9b5=_0x11b9b5-0x0;var _0x41ebcd=_0x20f2[_0x11b9b5];return _0x41ebcd;};'use strict';var _=require(_0x220f('0x0'));var util=require(_0x220f('0x1'));var moment=require(_0x220f('0x2'));var BPromise=require('bluebird');var rs=require(_0x220f('0x3'));var fs=require('fs');var Redis=require(_0x220f('0x4'));var db=require(_0x220f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x220f('0x6'))('rpc');var config=require(_0x220f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x220f('0x8')][_0x220f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26799,_0x8a4b81,_0x45badc){return new BPromise(function(_0x5061a4,_0xf2fb87){return client['request'](_0x26799,_0x45badc)[_0x220f('0xa')](function(_0x53f76e){logger[_0x220f('0xb')](_0x220f('0xc'),_0x8a4b81,_0x220f('0xd'));logger[_0x220f('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x8a4b81,_0x220f('0xd'),JSON[_0x220f('0xf')](_0x53f76e));if(_0x53f76e[_0x220f('0x10')]){if(_0x53f76e[_0x220f('0x10')][_0x220f('0x11')]===0x1f4){logger[_0x220f('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x8a4b81,_0x53f76e['error'][_0x220f('0x12')]);return _0xf2fb87(_0x53f76e[_0x220f('0x10')][_0x220f('0x12')]);}logger[_0x220f('0x10')](_0x220f('0xc'),_0x8a4b81,_0x53f76e[_0x220f('0x10')][_0x220f('0x12')]);return _0x5061a4(_0x53f76e['error'][_0x220f('0x12')]);}else{logger['info'](_0x220f('0xc'),_0x8a4b81,_0x220f('0xd'));_0x5061a4(_0x53f76e[_0x220f('0x13')][_0x220f('0x12')]);}})[_0x220f('0x14')](function(_0x15652f){logger[_0x220f('0x10')](_0x220f('0xc'),_0x8a4b81,_0x15652f);_0xf2fb87(_0x15652f);});});}exports['VerifyAdditionalPhones']=function(_0x19ac7e){var _0x5d967c=this;return new Promise(function(_0x13e19c,_0x137d6d){return db[_0x220f('0x15')][_0x220f('0x16')]({'raw':!![],'where':{'ContactId':_0x19ac7e[_0x220f('0x17')]['ContactId'],'ListId':_0x19ac7e['body'][_0x220f('0x18')],'VoiceQueueId':_0x19ac7e[_0x220f('0x17')][_0x220f('0x19')]===undefined?null:_0x19ac7e[_0x220f('0x17')]['VoiceQueueId'],'CampaignId':_0x19ac7e[_0x220f('0x17')][_0x220f('0x1a')]===undefined?null:_0x19ac7e[_0x220f('0x17')][_0x220f('0x1a')]}})[_0x220f('0xa')](function(_0x30e9c8){if(_0x30e9c8!=null){return db[_0x220f('0x1b')][_0x220f('0x16')]({'raw':!![],'where':{'CmHopperId':_0x30e9c8['id'],'OrderBy':{'$gt':_0x30e9c8[_0x220f('0x1c')]}},'order':[['OrderBy','ASC']]})[_0x220f('0xa')](function(_0x32e49c){var _0x526823=0x0;if(_0x32e49c){if(_0x32e49c[_0x220f('0x1d')]+_0x32e49c['countcongestionretry']+_0x32e49c[_0x220f('0x1e')]+_0x32e49c[_0x220f('0x1f')]+_0x32e49c[_0x220f('0x20')]+_0x32e49c[_0x220f('0x21')]+_0x32e49c[_0x220f('0x22')]+_0x32e49c[_0x220f('0x23')]<_0x19ac7e[_0x220f('0x24')]['dialGlobalMaxRetry'])_0x526823=0x1;_0x13e19c({'additional':_0x526823});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x30e9c8['id']},'order':[[_0x220f('0x1c'),_0x220f('0x25')]]})[_0x220f('0xa')](function(_0x2815fb){var _0x5aa9e0=0x0;if(_0x2815fb){if(_0x2815fb[_0x220f('0x1d')]+_0x2815fb[_0x220f('0x26')]+_0x2815fb[_0x220f('0x1e')]+_0x2815fb[_0x220f('0x1f')]+_0x2815fb[_0x220f('0x20')]+_0x2815fb[_0x220f('0x21')]+_0x2815fb[_0x220f('0x22')]+_0x2815fb[_0x220f('0x23')]<_0x19ac7e[_0x220f('0x24')]['dialGlobalMaxRetry'])_0x5aa9e0=0x1;_0x13e19c({'additional':_0x5aa9e0});}else{_0x13e19c({'additional':0x0});}})[_0x220f('0x14')](function(_0x1e95c9){logger[_0x220f('0x10')]('VerifyAdditionalPhones',_0x1e95c9[_0x220f('0x12')],_0x19ac7e);_0x137d6d(_0x5d967c[_0x220f('0x10')](0x1f4,_0x1e95c9[_0x220f('0x12')]));});}})[_0x220f('0x14')](function(_0x5b038d){logger[_0x220f('0x10')](_0x220f('0x27'),_0x5b038d[_0x220f('0x12')],_0x19ac7e);_0x137d6d(_0x5d967c['error'](0x1f4,_0x5b038d[_0x220f('0x12')]));});}else _0x13e19c({'additional':0x0});});});};exports[_0x220f('0x28')]=function(_0x3a707d){var _0x1db525=this;return new Promise(function(_0xa62917,_0x5a542d){return db[_0x220f('0x15')][_0x220f('0x16')]({'raw':!![],'where':{'ContactId':_0x3a707d[_0x220f('0x17')][_0x220f('0x29')],'ListId':_0x3a707d[_0x220f('0x17')][_0x220f('0x18')],'VoiceQueueId':_0x3a707d[_0x220f('0x17')][_0x220f('0x19')]===undefined?null:_0x3a707d[_0x220f('0x17')][_0x220f('0x19')],'CampaignId':_0x3a707d[_0x220f('0x17')][_0x220f('0x1a')]===undefined?null:_0x3a707d[_0x220f('0x17')][_0x220f('0x1a')]}})[_0x220f('0xa')](function(_0x275bf3){if(_0x275bf3!=null){return db[_0x220f('0x1b')][_0x220f('0x16')]({'raw':!![],'where':{'CmHopperId':_0x275bf3['id'],'OrderBy':{'$gt':_0x275bf3['OrderBy']}},'order':[['OrderBy','ASC']]})[_0x220f('0xa')](function(_0x40676d){if(_0x40676d)return activateAdditionalPhone(_0x275bf3,_0x3a707d[_0x220f('0x17')],_0x40676d,_0x3a707d[_0x220f('0x2a')],_0x3a707d['waitTime'])[_0x220f('0xa')](function(_0x17030f){_0xa62917(_0x17030f);});else{return db[_0x220f('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x275bf3['id']},'order':[['OrderBy','ASC']]})[_0x220f('0xa')](function(_0x4bdcef){if(_0x4bdcef)return activateAdditionalPhone(_0x275bf3,_0x3a707d[_0x220f('0x17')],_0x4bdcef,_0x3a707d['duration'],_0x3a707d[_0x220f('0x2b')])[_0x220f('0xa')](function(_0x1b81ad){_0xa62917(_0x1b81ad);});else{_0xa62917({'id':_0x275bf3['id'],'phone':''});}})[_0x220f('0x14')](function(_0x318843){logger[_0x220f('0x10')](_0x220f('0x27'),_0x318843[_0x220f('0x12')],_0x3a707d);_0x5a542d(_0x1db525[_0x220f('0x10')](0x1f4,_0x318843[_0x220f('0x12')]));});}})[_0x220f('0x14')](function(_0x1dded8){logger[_0x220f('0x10')]('VerifyAdditionalPhones',_0x1dded8[_0x220f('0x12')],_0x3a707d);_0x5a542d(_0x1db525[_0x220f('0x10')](0x1f4,_0x1dded8['message']));});}else _0xa62917(0x1);});});};function activateAdditionalPhone(_0x22cde8,_0x42d7de,_0x1f9da0,_0x4ab504,_0x26c691){return new Promise(function(_0x5758bf,_0x47274b){logger[_0x220f('0xb')]('VerifyAdditionalPhones',_0x1f9da0);var _0x4f24aa;if(moment()>moment(_0x1f9da0[_0x220f('0x2c')])){_0x4f24aa=moment()[_0x220f('0x2d')](_0x26c691||0x3,_0x220f('0x2e'));}else{if(_0x1f9da0[_0x220f('0x1c')]==0x0){_0x4f24aa=moment(_0x1f9da0['scheduledat']);}else{_0x4f24aa=moment()['add'](_0x26c691||0x3,_0x220f('0x2e'));}}var _0x47672d={'phone':_0x22cde8[_0x220f('0x2f')],'active':0x0,'OrderBy':_[_0x220f('0x30')](_0x22cde8['OrderBy'])?0x0:_0x22cde8[_0x220f('0x1c')],'scheduledat':moment()[_0x220f('0x2d')](_0x4ab504||0x1,'minutes'),'countbusyretry':_0x42d7de['countbusyretry'],'countcongestionretry':_0x42d7de[_0x220f('0x26')],'countnoanswerretry':_0x42d7de['countnoanswerretry'],'countnosuchnumberretry':_0x42d7de[_0x220f('0x1f')],'countdropretry':_0x42d7de[_0x220f('0x20')],'countabandonedretry':_0x42d7de['countabandonedretry'],'countmachineretry':_0x42d7de[_0x220f('0x22')],'countagentrejectretry':_0x42d7de[_0x220f('0x23')],'createdAt':_0x42d7de[_0x220f('0x31')],'updatedAt':_0x42d7de['updatedAt']};var _0x297d27={'CmHopperId':_0x22cde8['id'],'phone':_0x1f9da0[_0x220f('0x2f')],'active':0x0,'OrderBy':_[_0x220f('0x30')](_0x1f9da0[_0x220f('0x1c')])?0x0:_0x1f9da0[_0x220f('0x1c')],'scheduledat':_0x4f24aa,'countbusyretry':_0x1f9da0[_0x220f('0x1d')],'countcongestionretry':_0x1f9da0[_0x220f('0x26')],'countnoanswerretry':_0x1f9da0[_0x220f('0x1e')],'countnosuchnumberretry':_0x42d7de[_0x220f('0x1f')],'countdropretry':_0x42d7de[_0x220f('0x20')],'countabandonedretry':_0x42d7de[_0x220f('0x21')],'countmachineretry':_0x42d7de['countmachineretry'],'countagentrejectretry':_0x42d7de['countagentrejectretry'],'createdAt':_0x1f9da0[_0x220f('0x31')],'updatedAt':_0x1f9da0[_0x220f('0x32')]};logger[_0x220f('0xb')](_0x220f('0x33'),_0x47672d);logger[_0x220f('0xb')]('additionalToHop',_0x297d27);return db['sequelize'][_0x220f('0x34')](function(_0x5e6f63){return db[_0x220f('0x1b')][_0x220f('0x35')](_0x47672d,{'where':{'id':_0x1f9da0['id']}},{'transaction':_0x5e6f63})[_0x220f('0xa')](function(){return db[_0x220f('0x15')][_0x220f('0x35')](_0x297d27,{'where':{'id':_0x22cde8['id']}},{'transaction':_0x5e6f63});});})[_0x220f('0xa')](function(_0x3c4e5e){_0x5758bf({'id':_0x22cde8['id'],'phone':_0x1f9da0[_0x220f('0x2f')]});})[_0x220f('0x14')](function(_0xf85c95){logger[_0x220f('0x10')](_0x220f('0x27'),_0xf85c95['message'],req);_0x47274b(_this['error'](0x1f4,_0xf85c95['message']));});});}exports[_0x220f('0x36')]=function(_0x332cc6){var _0x8f45ba=this;return new Promise(function(_0x4ab917,_0x33f02c){return db['CmHopper'][_0x220f('0x35')](_0x332cc6['body'][_0x220f('0x37')],{'where':{'id':_0x332cc6['body']['id']}})[_0x220f('0xa')](function(_0xe4828b){_0x4ab917(_0xe4828b);})['catch'](function(_0x98145a){logger[_0x220f('0x10')](_0x220f('0x36'),_0x98145a[_0x220f('0x12')],_0x332cc6);_0x33f02c(_0x8f45ba[_0x220f('0x10')](0x1f4,_0x98145a[_0x220f('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js
index 8ced8a8..b3cde7d 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 _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
+var _0x02a4=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','/:id','show','post','put'];(function(_0x1c0134,_0x5528c0){var _0x420558=function(_0x313e7d){while(--_0x313e7d){_0x1c0134['push'](_0x1c0134['shift']());}};_0x420558(++_0x5528c0);}(_0x02a4,0x146));var _0x402a=function(_0x56f781,_0x590d7a){_0x56f781=_0x56f781-0x0;var _0xb708bf=_0x02a4[_0x56f781];return _0xb708bf;};'use strict';var multer=require(_0x402a('0x0'));var util=require(_0x402a('0x1'));var path=require(_0x402a('0x2'));var timeout=require(_0x402a('0x3'));var express=require(_0x402a('0x4'));var router=express[_0x402a('0x5')]();var auth=require(_0x402a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x402a('0x7'));var controller=require(_0x402a('0x8'));router['get']('/',auth[_0x402a('0x9')](),controller[_0x402a('0xa')]);router[_0x402a('0xb')](_0x402a('0xc'),auth[_0x402a('0x9')](),controller[_0x402a('0xd')]);router[_0x402a('0xe')]('/',auth[_0x402a('0x9')](),controller['create']);router[_0x402a('0xf')]('/:id',auth[_0x402a('0x9')](),controller['update']);router[_0x402a('0x10')](_0x402a('0xc'),auth[_0x402a('0x9')](),controller['destroy']);module[_0x402a('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js
index e566327..9ee6c3f 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 _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
+var _0x0f43=['contactListQueue','moment','sequelize','exports','INTEGER'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0f43,0xf1));var _0x30f4=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x0f43[_0x413feb];return _0x40ee88;};'use strict';var moment=require(_0x30f4('0x0'));var Sequelize=require(_0x30f4('0x1'));module[_0x30f4('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x30f4('0x3')],'unique':_0x30f4('0x4')},'VoiceQueueId':{'type':Sequelize[_0x30f4('0x3')],'unique':_0x30f4('0x4')}};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js
index cb70332..b336605 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(_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
+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(_0x5cd436,_0x33e380){var _0x1e63af=function(_0x43bee3){while(--_0x43bee3){_0x5cd436['push'](_0x5cd436['shift']());}};_0x1e63af(++_0x33e380);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 870373d..513afd4 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(_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
+var _0x70e0=['cm_hopper_black','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes'];(function(_0xe924a5,_0x1bf7f2){var _0x5e464f=function(_0x4fbeb5){while(--_0x4fbeb5){_0xe924a5['push'](_0xe924a5['shift']());}};_0x5e464f(++_0x1bf7f2);}(_0x70e0,0x17b));var _0x070e=function(_0x2536fb,_0xe3f3d0){_0x2536fb=_0x2536fb-0x0;var _0x3994e8=_0x70e0[_0x2536fb];return _0x3994e8;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('CmHopperBlack',attributes,{'tableName':_0x070e('0x8'),'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 5d87405..3b510b2 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 _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
+var _0x8821=['info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','include','map','model','then','UpdateCmHopperBlack','update','body','limit','debug','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x34170b,_0x3b9cd9){var _0x176483=function(_0xe81c94){while(--_0xe81c94){_0x34170b['push'](_0x34170b['shift']());}};_0x176483(++_0x3b9cd9);}(_0x8821,0x115));var _0x1882=function(_0x400b43,_0x55da4e){_0x400b43=_0x400b43-0x0;var _0x3c330f=_0x8821[_0x400b43];return _0x3c330f;};'use strict';var _=require(_0x1882('0x0'));var util=require('util');var moment=require(_0x1882('0x1'));var BPromise=require(_0x1882('0x2'));var rs=require(_0x1882('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1882('0x4'));var logger=require(_0x1882('0x5'))(_0x1882('0x6'));var config=require(_0x1882('0x7'));var jayson=require(_0x1882('0x8'));var client=jayson[_0x1882('0x9')][_0x1882('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x145495,_0x350bba,_0x51a1bb){return new BPromise(function(_0x1e4e6c,_0x57f52d){return client['request'](_0x145495,_0x51a1bb)['then'](function(_0x407a34){logger[_0x1882('0xb')](_0x1882('0xc'),_0x350bba,_0x1882('0xd'));logger['debug'](_0x1882('0xe'),_0x350bba,'request\x20sent',JSON[_0x1882('0xf')](_0x407a34));if(_0x407a34[_0x1882('0x10')]){if(_0x407a34[_0x1882('0x10')]['code']===0x1f4){logger['error'](_0x1882('0xc'),_0x350bba,_0x407a34[_0x1882('0x10')][_0x1882('0x11')]);return _0x57f52d(_0x407a34[_0x1882('0x10')][_0x1882('0x11')]);}logger[_0x1882('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x350bba,_0x407a34[_0x1882('0x10')][_0x1882('0x11')]);return _0x1e4e6c(_0x407a34['error'][_0x1882('0x11')]);}else{logger[_0x1882('0xb')](_0x1882('0xc'),_0x350bba,_0x1882('0xd'));_0x1e4e6c(_0x407a34['result'][_0x1882('0x11')]);}})[_0x1882('0x12')](function(_0x1c4d9c){logger[_0x1882('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x350bba,_0x1c4d9c);_0x57f52d(_0x1c4d9c);});});}exports[_0x1882('0x13')]=function(_0x59f655){var _0x35c7bf=this;return new Promise(function(_0x15b22f,_0x106da0){return db[_0x1882('0x14')]['findAll']({'raw':_0x59f655[_0x1882('0x15')]?_0x59f655[_0x1882('0x15')][_0x1882('0x16')]===undefined?!![]:![]:!![],'where':_0x59f655[_0x1882('0x15')]?_0x59f655['options'][_0x1882('0x17')]||null:null,'attributes':_0x59f655[_0x1882('0x15')]?_0x59f655['options'][_0x1882('0x18')]||null:null,'limit':_0x59f655[_0x1882('0x15')]?_0x59f655[_0x1882('0x15')]['limit']||null:null,'include':_0x59f655['options']?_0x59f655['options'][_0x1882('0x19')]?_[_0x1882('0x1a')](_0x59f655[_0x1882('0x15')][_0x1882('0x19')],function(_0x105dbd){return{'model':db[_0x105dbd[_0x1882('0x1b')]],'as':_0x105dbd['as'],'attributes':_0x105dbd[_0x1882('0x18')],'include':_0x105dbd[_0x1882('0x19')]?_[_0x1882('0x1a')](_0x105dbd['include'],function(_0x349cde){return{'model':db[_0x349cde[_0x1882('0x1b')]],'as':_0x349cde['as'],'attributes':_0x349cde['attributes'],'include':_0x349cde[_0x1882('0x19')]?_[_0x1882('0x1a')](_0x349cde[_0x1882('0x19')],function(_0x5f574a){return{'model':db[_0x5f574a[_0x1882('0x1b')]],'as':_0x5f574a['as'],'attributes':_0x5f574a[_0x1882('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1882('0x1c')](function(_0x50a58d){logger['info'](_0x1882('0x13'),_0x59f655);logger['debug'](_0x1882('0x13'),_0x59f655,JSON[_0x1882('0xf')](_0x50a58d));_0x15b22f(_0x50a58d);})[_0x1882('0x12')](function(_0x8f7e02){logger[_0x1882('0x10')](_0x1882('0x13'),_0x8f7e02['message'],_0x59f655);_0x106da0(_0x35c7bf[_0x1882('0x10')](0x1f4,_0x8f7e02['message']));});});};exports[_0x1882('0x1d')]=function(_0x2ed195){var _0x2e1ecf=this;return new Promise(function(_0x5c9e0d,_0xe3f84e){return db[_0x1882('0x14')][_0x1882('0x1e')](_0x2ed195[_0x1882('0x1f')],{'raw':_0x2ed195[_0x1882('0x15')]?_0x2ed195[_0x1882('0x15')][_0x1882('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ed195[_0x1882('0x15')]?_0x2ed195['options'][_0x1882('0x17')]||null:null,'attributes':_0x2ed195[_0x1882('0x15')]?_0x2ed195[_0x1882('0x15')][_0x1882('0x18')]||null:null,'limit':_0x2ed195[_0x1882('0x15')]?_0x2ed195[_0x1882('0x15')][_0x1882('0x20')]||null:null})[_0x1882('0x1c')](function(_0x2a522f){logger[_0x1882('0xb')](_0x1882('0x1d'),_0x2ed195);logger[_0x1882('0x21')](_0x1882('0x1d'),_0x2ed195,JSON['stringify'](_0x2a522f));_0x5c9e0d(_0x2a522f);})['catch'](function(_0x33eaab){logger[_0x1882('0x10')](_0x1882('0x1d'),_0x33eaab['message'],_0x2ed195);_0xe3f84e(_0x2e1ecf[_0x1882('0x10')](0x1f4,_0x33eaab[_0x1882('0x11')]));});});};exports[_0x1882('0x22')]=function(_0x24f840){var _0xe7c35b=this;return new Promise(function(_0x1967f5,_0x1998ce){return db[_0x1882('0x14')][_0x1882('0x23')]({'where':_0x24f840[_0x1882('0x15')]?_0x24f840['options'][_0x1882('0x17')]||null:null})[_0x1882('0x1c')](function(_0x4f2dc8){logger['info']('DestroyCmHopperBlack',_0x24f840);logger['debug'](_0x1882('0x22'),_0x24f840,JSON[_0x1882('0xf')](_0x4f2dc8));_0x1967f5(_0x4f2dc8);})['catch'](function(_0xf267b2){logger[_0x1882('0x10')](_0x1882('0x22'),_0xf267b2[_0x1882('0x11')],_0x24f840);_0x1998ce(_0xe7c35b[_0x1882('0x10')](0x1f4,_0xf267b2[_0x1882('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js
index 9649d84..5984219 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 _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
+var _0x5fd1=['/:id','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe'];(function(_0x41dd75,_0x4707ef){var _0x2c492b=function(_0x2f58fb){while(--_0x2f58fb){_0x41dd75['push'](_0x41dd75['shift']());}};_0x2c492b(++_0x4707ef);}(_0x5fd1,0x155));var _0x15fd=function(_0x3449d7,_0x2796e8){_0x3449d7=_0x3449d7-0x0;var _0x2b6a01=_0x5fd1[_0x3449d7];return _0x2b6a01;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x15fd('0x4'));var config=require(_0x15fd('0x5'));var controller=require(_0x15fd('0x6'));router['get']('/',auth[_0x15fd('0x7')](),controller[_0x15fd('0x8')]);router[_0x15fd('0x9')](_0x15fd('0xa'),auth[_0x15fd('0x7')](),controller['describe']);router[_0x15fd('0x9')](_0x15fd('0xb'),auth[_0x15fd('0x7')](),controller['show']);router[_0x15fd('0xc')]('/:id',auth[_0x15fd('0x7')](),controller[_0x15fd('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x15fd('0xe')]);module[_0x15fd('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js
index 157cca5..eac975e 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 _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
+var _0xd01a=['exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','diff','dispositionat','BOOLEAN','moment'];(function(_0x1f58a9,_0x5ded2a){var _0x3d11b3=function(_0x5ddc6b){while(--_0x5ddc6b){_0x1f58a9['push'](_0x1f58a9['shift']());}};_0x3d11b3(++_0x5ded2a);}(_0xd01a,0xa4));var _0xad01=function(_0x169bda,_0x58d36f){_0x169bda=_0x169bda-0x0;var _0x3c6701=_0xd01a[_0x169bda];return _0x3c6701;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xad01('0x0'));module[_0xad01('0x1')]={'state':{'type':Sequelize[_0xad01('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xad01('0x3')]},'scheduledat':{'type':Sequelize[_0xad01('0x4')]},'countbusyretry':{'type':Sequelize[_0xad01('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xad01('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xad01('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xad01('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xad01('0x3')]},'originatecalleridname':{'type':Sequelize[_0xad01('0x3')]},'calleridnum':{'type':Sequelize[_0xad01('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xad01('0x4')]},'responsetime':{'type':Sequelize[_0xad01('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xad01('0x4')]},'endtime':{'type':Sequelize[_0xad01('0x4')]},'ringtime':{'type':Sequelize[_0xad01('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xad01('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xad01('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xad01('0x3')]},'membername':{'type':Sequelize[_0xad01('0x3')]},'reason':{'type':Sequelize[_0xad01('0x3')]},'disposition':{'type':Sequelize[_0xad01('0x3')]},'dispositionat':{'type':Sequelize[_0xad01('0x4')],'set':function(_0x3b1b30){var _0x2ba0c1=this[_0xad01('0x5')]('endtime');if(_0x2ba0c1&&_0x3b1b30){this[_0xad01('0x6')](_0xad01('0x7'),moment(_0x3b1b30)[_0xad01('0x8')](moment(_0x2ba0c1),'seconds'));}return this['setDataValue'](_0xad01('0x9'),_0x3b1b30);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xad01('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xad01('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xad01('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xad01('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xad01('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xad01('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xad01('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xad01('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xad01('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xad01('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xad01('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xad01('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xad01('0x2')],'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 a529a9b..7b34c93 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 _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
+var _0x6b1b=['squel','jsforce','querystring','ioredis','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','apply','reject','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','CmHopperFinal','includeAll','include','findAll','rows','show','params','keys','length','find','describe','catch','update','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','updatedAt','select','NOW()','field','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','phone','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','ANY_VALUE(calleridnum)','CampaignId','createdAt','CampaignId\x20=\x20?','calleridnum','checkContactHopper','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x336e69,_0x5bdb2e){var _0x11392a=function(_0x41032b){while(--_0x41032b){_0x336e69['push'](_0x336e69['shift']());}};_0x11392a(++_0x5bdb2e);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x6b1b[_0x934425];return _0x31d596;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb6b1('0x0'));var rimraf=require(_0xb6b1('0x1'));var zipdir=require(_0xb6b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6b1('0x3'));var moment=require(_0xb6b1('0x4'));var BPromise=require(_0xb6b1('0x5'));var Mustache=require(_0xb6b1('0x6'));var util=require(_0xb6b1('0x7'));var path=require(_0xb6b1('0x8'));var sox=require(_0xb6b1('0x9'));var csv=require(_0xb6b1('0xa'));var ejs=require(_0xb6b1('0xb'));var fs=require('fs');var _=require(_0xb6b1('0xc'));var squel=require(_0xb6b1('0xd'));var crypto=require('crypto');var jsforce=require(_0xb6b1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb6b1('0xf'));var Papa=require('papaparse');var Redis=require(_0xb6b1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6b1('0x11'))(_0xb6b1('0x12'));var utils=require('../../config/utils');var config=require(_0xb6b1('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c5837,_0x406dce){_0x406dce=_0x406dce||0xcc;return function(_0x2e5256){if(_0x2e5256){return _0x5c5837[_0xb6b1('0x14')](_0x406dce);}return _0x5c5837[_0xb6b1('0x15')](_0x406dce)[_0xb6b1('0x16')]();};}function respondWithResult(_0x18f6b5,_0x360fc7){_0x360fc7=_0x360fc7||0xc8;return function(_0x429d0d){if(_0x429d0d){return _0x18f6b5[_0xb6b1('0x15')](_0x360fc7)[_0xb6b1('0x17')](_0x429d0d);}};}function respondWithFilteredResult(_0x2629db,_0x14fef6){return function(_0x4f770a){if(_0x4f770a){var _0x57572a=_0x4f770a[_0xb6b1('0x18')],_0x513207=_0x14fef6[_0xb6b1('0x19')],_0x51f25f=_0x14fef6[_0xb6b1('0x19')]+_0x14fef6[_0xb6b1('0x1a')],_0xee229d;if(_0x51f25f>=_0x57572a){_0x51f25f=_0x57572a;_0xee229d=0xc8;}else{_0xee229d=0xce;}_0x2629db[_0xb6b1('0x15')](_0xee229d);return _0x2629db['set']('Content-Range',_0x513207+'-'+_0x51f25f+'/'+_0x57572a)[_0xb6b1('0x17')](_0x4f770a);}return null;};}function patchUpdates(_0x15456d){return function(_0x16d969){try{jsonpatch[_0xb6b1('0x1b')](_0x16d969,_0x15456d,!![]);}catch(_0x45d9e6){return BPromise[_0xb6b1('0x1c')](_0x45d9e6);}return _0x16d969['save']();};}function saveUpdates(_0x4e132a,_0x43312e){return function(_0x1067ea){if(_0x1067ea){return _0x1067ea['update'](_0x4e132a)['then'](function(_0xfc247a){return _0xfc247a;});}return null;};}function removeEntity(_0x5c8529,_0x509c55){return function(_0x232157){if(_0x232157){return _0x232157[_0xb6b1('0x1d')]()[_0xb6b1('0x1e')](function(){_0x5c8529[_0xb6b1('0x15')](0xcc)[_0xb6b1('0x16')]();});}};}function handleEntityNotFound(_0x3d0864,_0x1eb1b2){return function(_0x3b1ff7){if(!_0x3b1ff7){_0x3d0864[_0xb6b1('0x14')](0x194);}return _0x3b1ff7;};}function handleError(_0x20066f,_0x5069cd){_0x5069cd=_0x5069cd||0x1f4;return function(_0x214cd0){logger['error'](_0x214cd0[_0xb6b1('0x1f')]);if(_0x214cd0['name']){delete _0x214cd0[_0xb6b1('0x20')];}_0x20066f['status'](_0x5069cd)[_0xb6b1('0x21')](_0x214cd0);};}exports[_0xb6b1('0x22')]=function(_0xac4256,_0x178401){var _0x13e841={},_0x188627={},_0x3e0915={'count':0x0,'rows':[]};var _0xd3c6da=_[_0xb6b1('0x23')](db['CmHopperFinal'][_0xb6b1('0x24')],function(_0x548f3f){return{'name':_0x548f3f[_0xb6b1('0x25')],'type':_0x548f3f[_0xb6b1('0x26')][_0xb6b1('0x27')]};});_0x188627[_0xb6b1('0x28')]=_[_0xb6b1('0x23')](_0xd3c6da,_0xb6b1('0x20'));_0x188627[_0xb6b1('0x29')]=_['keys'](_0xac4256[_0xb6b1('0x29')]);_0x188627[_0xb6b1('0x2a')]=_[_0xb6b1('0x2b')](_0x188627['model'],_0x188627[_0xb6b1('0x29')]);_0x13e841[_0xb6b1('0x2c')]=_['intersection'](_0x188627[_0xb6b1('0x28')],qs[_0xb6b1('0x2d')](_0xac4256[_0xb6b1('0x29')][_0xb6b1('0x2d')]));_0x13e841[_0xb6b1('0x2c')]=_0x13e841[_0xb6b1('0x2c')]['length']?_0x13e841[_0xb6b1('0x2c')]:_0x188627[_0xb6b1('0x28')];if(!_0xac4256['query'][_0xb6b1('0x2e')]('nolimit')){_0x13e841[_0xb6b1('0x1a')]=qs[_0xb6b1('0x1a')](_0xac4256[_0xb6b1('0x29')][_0xb6b1('0x1a')]);_0x13e841[_0xb6b1('0x19')]=qs[_0xb6b1('0x19')](_0xac4256['query'][_0xb6b1('0x19')]);}_0x13e841[_0xb6b1('0x2f')]=qs[_0xb6b1('0x30')](_0xac4256[_0xb6b1('0x29')]['sort']);_0x13e841['where']=qs['filters'](_[_0xb6b1('0x31')](_0xac4256[_0xb6b1('0x29')],_0x188627[_0xb6b1('0x2a')]),_0xd3c6da);if(_0xac4256[_0xb6b1('0x29')][_0xb6b1('0x32')]){_0x13e841[_0xb6b1('0x33')]=_[_0xb6b1('0x34')](_0x13e841[_0xb6b1('0x33')],{'$or':_[_0xb6b1('0x23')](_0xd3c6da,function(_0x25d6a2){if(_0x25d6a2[_0xb6b1('0x26')]!==_0xb6b1('0x35')){var _0x5b8a57={};_0x5b8a57[_0x25d6a2[_0xb6b1('0x20')]]={'$like':'%'+_0xac4256[_0xb6b1('0x29')][_0xb6b1('0x32')]+'%'};return _0x5b8a57;}})});}_0x13e841=_[_0xb6b1('0x34')]({},_0x13e841,_0xac4256[_0xb6b1('0x36')]);var _0x1dc258={'where':_0x13e841[_0xb6b1('0x33')]};return db[_0xb6b1('0x37')][_0xb6b1('0x18')](_0x1dc258)[_0xb6b1('0x1e')](function(_0x44a61a){_0x3e0915['count']=_0x44a61a;if(_0xac4256[_0xb6b1('0x29')][_0xb6b1('0x38')]){_0x13e841[_0xb6b1('0x39')]=[{'all':!![]}];}return db[_0xb6b1('0x37')][_0xb6b1('0x3a')](_0x13e841);})[_0xb6b1('0x1e')](function(_0x27808b){_0x3e0915[_0xb6b1('0x3b')]=_0x27808b;return _0x3e0915;})['then'](respondWithFilteredResult(_0x178401,_0x13e841))['catch'](handleError(_0x178401,null));};exports[_0xb6b1('0x3c')]=function(_0x19853f,_0x1f43fe){var _0x541eb5={'raw':!![],'where':{'id':_0x19853f[_0xb6b1('0x3d')]['id']}},_0x8d1ba8={};_0x8d1ba8[_0xb6b1('0x28')]=_[_0xb6b1('0x3e')](db[_0xb6b1('0x37')][_0xb6b1('0x24')]);_0x8d1ba8[_0xb6b1('0x29')]=_[_0xb6b1('0x3e')](_0x19853f['query']);_0x8d1ba8[_0xb6b1('0x2a')]=_['intersection'](_0x8d1ba8[_0xb6b1('0x28')],_0x8d1ba8[_0xb6b1('0x29')]);_0x541eb5[_0xb6b1('0x2c')]=_[_0xb6b1('0x2b')](_0x8d1ba8[_0xb6b1('0x28')],qs[_0xb6b1('0x2d')](_0x19853f['query'][_0xb6b1('0x2d')]));_0x541eb5[_0xb6b1('0x2c')]=_0x541eb5['attributes'][_0xb6b1('0x3f')]?_0x541eb5['attributes']:_0x8d1ba8[_0xb6b1('0x28')];if(_0x19853f[_0xb6b1('0x29')][_0xb6b1('0x38')]){_0x541eb5[_0xb6b1('0x39')]=[{'all':!![]}];}_0x541eb5=_[_0xb6b1('0x34')]({},_0x541eb5,_0x19853f[_0xb6b1('0x36')]);return db[_0xb6b1('0x37')][_0xb6b1('0x40')](_0x541eb5)[_0xb6b1('0x1e')](handleEntityNotFound(_0x1f43fe,null))['then'](respondWithResult(_0x1f43fe,null))['catch'](handleError(_0x1f43fe,null));};exports[_0xb6b1('0x41')]=function(_0x2c00fb,_0x5959ca){return db[_0xb6b1('0x37')][_0xb6b1('0x41')]()[_0xb6b1('0x1e')](respondWithResult(_0x5959ca,null))[_0xb6b1('0x42')](handleError(_0x5959ca,null));};exports[_0xb6b1('0x43')]=function(_0x505a80,_0x28f353){if(_0x505a80[_0xb6b1('0x44')][_0xb6b1('0x45')]){delete _0x505a80[_0xb6b1('0x44')]['uniqueid'];}return db['CmHopperFinal'][_0xb6b1('0x40')]({'where':{'uniqueid':_0x505a80['params']['id']}})[_0xb6b1('0x1e')](handleEntityNotFound(_0x28f353,null))[_0xb6b1('0x1e')](saveUpdates(_0x505a80['body'],null))[_0xb6b1('0x1e')](respondWithResult(_0x28f353,null))['catch'](handleError(_0x28f353,null));};exports[_0xb6b1('0x46')]=function(_0x7d4763,_0xbd7cec,_0x1b41bb){return db[_0xb6b1('0x37')][_0xb6b1('0x3a')]({'raw':![],'where':{'VoiceQueueId':_0x7d4763[_0xb6b1('0x3d')]['id']},'attributes':[[db[_0xb6b1('0x47')]['fn'](_0xb6b1('0x48'),db[_0xb6b1('0x47')]['fn']('IF',db['sequelize'][_0xb6b1('0x49')](_0xb6b1('0x4a')))),_0xb6b1('0x4b')],[db[_0xb6b1('0x47')]['fn'](_0xb6b1('0x48'),db[_0xb6b1('0x47')]['fn']('IF',db[_0xb6b1('0x47')][_0xb6b1('0x49')](_0xb6b1('0x4c')))),'noAnswerContacts'],[db[_0xb6b1('0x47')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb6b1('0x47')][_0xb6b1('0x49')]('`state`\x20=\x205,\x201,\x20null'))),_0xb6b1('0x4d')],[db[_0xb6b1('0x47')]['fn'](_0xb6b1('0x48'),db['sequelize']['fn']('IF',db[_0xb6b1('0x47')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xb6b1('0x4e')],[db[_0xb6b1('0x47')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xb6b1('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'dropContacts'],[db['sequelize']['fn'](_0xb6b1('0x48'),db[_0xb6b1('0x47')]['fn']('IF',db[_0xb6b1('0x47')][_0xb6b1('0x49')](_0xb6b1('0x4f')))),_0xb6b1('0x50')],[db['sequelize']['fn'](_0xb6b1('0x48'),db[_0xb6b1('0x47')]['fn']('IF',db['sequelize']['literal'](_0xb6b1('0x51')))),_0xb6b1('0x52')],[db['sequelize']['fn']('COUNT',db[_0xb6b1('0x47')]['fn']('IF',db['sequelize'][_0xb6b1('0x49')](_0xb6b1('0x53')))),'answeringMachine']]})[_0xb6b1('0x1e')](handleEntityNotFound(_0xbd7cec,null))[_0xb6b1('0x1e')](respondWithResult(_0xbd7cec,null))[_0xb6b1('0x42')](handleError(_0xbd7cec,null));};exports[_0xb6b1('0x54')]=function(_0x1fb86b,_0x1296f6,_0x29839d){return db[_0xb6b1('0x37')][_0xb6b1('0x3a')]({'raw':![],'where':{'CampaignId':_0x1fb86b[_0xb6b1('0x3d')]['id']},'attributes':[[db['sequelize']['fn'](_0xb6b1('0x48'),db[_0xb6b1('0x47')]['fn']('IF',db[_0xb6b1('0x47')][_0xb6b1('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0xb6b1('0x4b')],[db[_0xb6b1('0x47')]['fn'](_0xb6b1('0x48'),db[_0xb6b1('0x47')]['fn']('IF',db[_0xb6b1('0x47')][_0xb6b1('0x49')](_0xb6b1('0x4c')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xb6b1('0x48'),db['sequelize']['fn']('IF',db[_0xb6b1('0x47')][_0xb6b1('0x49')](_0xb6b1('0x55')))),'busyContacts'],[db[_0xb6b1('0x47')]['fn'](_0xb6b1('0x48'),db[_0xb6b1('0x47')]['fn']('IF',db[_0xb6b1('0x47')][_0xb6b1('0x49')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0xb6b1('0x47')]['fn'](_0xb6b1('0x48'),db[_0xb6b1('0x47')]['fn']('IF',db[_0xb6b1('0x47')][_0xb6b1('0x49')](_0xb6b1('0x56')))),_0xb6b1('0x57')],[db[_0xb6b1('0x47')]['fn'](_0xb6b1('0x48'),db[_0xb6b1('0x47')]['fn']('IF',db[_0xb6b1('0x47')][_0xb6b1('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xb6b1('0x50')],[db['sequelize']['fn'](_0xb6b1('0x48'),db[_0xb6b1('0x47')]['fn']('IF',db[_0xb6b1('0x47')]['literal'](_0xb6b1('0x51')))),'reCallContacts'],[db['sequelize']['fn'](_0xb6b1('0x48'),db['sequelize']['fn']('IF',db[_0xb6b1('0x47')][_0xb6b1('0x49')]('`state`\x20=\x2019,\x201,\x20null'))),_0xb6b1('0x58')]]})['then'](handleEntityNotFound(_0x1296f6,null))[_0xb6b1('0x1e')](respondWithResult(_0x1296f6,null))[_0xb6b1('0x42')](handleError(_0x1296f6,null));};exports[_0xb6b1('0x59')]=function(_0x53a85e,_0x309982,_0x4ef26a){return db[_0xb6b1('0x5a')][_0xb6b1('0x40')]({'where':{'id':_0x53a85e[_0xb6b1('0x3d')]['id']}})[_0xb6b1('0x1e')](handleEntityNotFound(_0x309982,null))['then'](function(_0x3b1036){var _0x410fe6;if(_0x3b1036){_0x410fe6=squel[_0xb6b1('0x5b')]()[_0xb6b1('0x5c')](_0xb6b1('0x5d'))[_0xb6b1('0x5e')](['phone',_0xb6b1('0x5f'),_0xb6b1('0x60'),_0xb6b1('0x61'),_0xb6b1('0x62'),'createdAt',_0xb6b1('0x63')],squel[_0xb6b1('0x64')]()['field']('ANY_VALUE(calleridnum)','phone')['field'](_0xb6b1('0x65'),_0xb6b1('0x5f'))[_0xb6b1('0x66')](_0xb6b1('0x67'),_0xb6b1('0x60'))[_0xb6b1('0x66')](_0xb6b1('0x68'),'ListId')[_0xb6b1('0x66')]('ANY_VALUE(VoiceQueueId)','VoiceQueueId')[_0xb6b1('0x66')](_0xb6b1('0x65'),'createdAt')[_0xb6b1('0x66')](_0xb6b1('0x65'),_0xb6b1('0x63'))[_0xb6b1('0x69')](_0xb6b1('0x6a'))['where'](_0xb6b1('0x6b'),_0x53a85e[_0xb6b1('0x3d')]['id']['toString']())['where'](_0xb6b1('0x6c'),_0x53a85e[_0xb6b1('0x44')][_0xb6b1('0x6d')][_0xb6b1('0x6e')]())[_0xb6b1('0x33')](_0xb6b1('0x6f'))[_0xb6b1('0x33')](_0xb6b1('0x70'),squel[_0xb6b1('0x64')]()['field'](_0xb6b1('0x71'))['from'](_0xb6b1('0x5d'))[_0xb6b1('0x33')](_0xb6b1('0x6b'),_0x53a85e['params']['id'][_0xb6b1('0x6e')]()))[_0xb6b1('0x33')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb6b1('0x64')]()[_0xb6b1('0x66')]('calleridnum')[_0xb6b1('0x69')]('cm_hopper_final')[_0xb6b1('0x33')]('VoiceQueueId\x20=\x20?',_0x53a85e[_0xb6b1('0x3d')]['id'][_0xb6b1('0x6e')]())[_0xb6b1('0x33')](_0xb6b1('0x72')))[_0xb6b1('0x73')]('ContactId'))[_0xb6b1('0x6e')]();return db[_0xb6b1('0x47')][_0xb6b1('0x29')](_0x410fe6);}return[];})[_0xb6b1('0x1e')](respondWithResult(_0x309982,null))[_0xb6b1('0x42')](handleError(_0x309982,null));};exports[_0xb6b1('0x74')]=function(_0x19415a,_0x1936d4,_0x8e1139){return db[_0xb6b1('0x75')][_0xb6b1('0x40')]({'where':{'id':_0x19415a[_0xb6b1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1936d4,null))[_0xb6b1('0x1e')](function(_0x385fd7){var _0x5446ef;if(_0x385fd7){_0x5446ef=squel[_0xb6b1('0x5b')]()[_0xb6b1('0x5c')]('cm_hopper')[_0xb6b1('0x5e')](['phone',_0xb6b1('0x5f'),'ContactId',_0xb6b1('0x61'),'CampaignId','createdAt',_0xb6b1('0x63')],squel[_0xb6b1('0x64')]()['field'](_0xb6b1('0x76'),_0xb6b1('0x71'))[_0xb6b1('0x66')](_0xb6b1('0x65'),_0xb6b1('0x5f'))[_0xb6b1('0x66')](_0xb6b1('0x67'),_0xb6b1('0x60'))[_0xb6b1('0x66')](_0xb6b1('0x68'),_0xb6b1('0x61'))[_0xb6b1('0x66')]('ANY_VALUE(CampaignId)',_0xb6b1('0x77'))[_0xb6b1('0x66')](_0xb6b1('0x65'),_0xb6b1('0x78'))['field'](_0xb6b1('0x65'),_0xb6b1('0x63'))[_0xb6b1('0x69')](_0xb6b1('0x6a'))[_0xb6b1('0x33')](_0xb6b1('0x79'),_0x19415a['params']['id'][_0xb6b1('0x6e')]())[_0xb6b1('0x33')](_0xb6b1('0x6c'),_0x19415a[_0xb6b1('0x44')][_0xb6b1('0x6d')][_0xb6b1('0x6e')]())[_0xb6b1('0x33')](_0xb6b1('0x6f'))[_0xb6b1('0x33')](_0xb6b1('0x70'),squel[_0xb6b1('0x64')]()[_0xb6b1('0x66')]('phone')[_0xb6b1('0x69')](_0xb6b1('0x5d'))[_0xb6b1('0x33')](_0xb6b1('0x79'),_0x19415a[_0xb6b1('0x3d')]['id'][_0xb6b1('0x6e')]()))[_0xb6b1('0x33')](_0xb6b1('0x70'),squel['select']()[_0xb6b1('0x66')](_0xb6b1('0x7a'))[_0xb6b1('0x69')]('cm_hopper_final')[_0xb6b1('0x33')]('CampaignId\x20=\x20?',_0x19415a['params']['id'][_0xb6b1('0x6e')]())[_0xb6b1('0x33')](_0xb6b1('0x72')))[_0xb6b1('0x73')](_0xb6b1('0x60')))[_0xb6b1('0x6e')]();return db['sequelize'][_0xb6b1('0x29')](_0x5446ef);}return[];})[_0xb6b1('0x1e')](respondWithResult(_0x1936d4,null))[_0xb6b1('0x42')](handleError(_0x1936d4,null));};exports[_0xb6b1('0x7b')]=function(_0x5712df,_0x4ea394,_0xdeaa28){return db['CmHopper'][_0xb6b1('0x7c')]({'where':{'VoiceQueueId':_0x5712df['body'][_0xb6b1('0x62')],'CampaignId':_0x5712df['body']['CampaignId'],'ContactId':_0x5712df[_0xb6b1('0x44')][_0xb6b1('0x60')]}})[_0xb6b1('0x1e')](handleEntityNotFound(_0x4ea394,null))[_0xb6b1('0x1e')](function(_0x3929e1){if(_0x3929e1){return _0x3929e1;}return null;})['then'](respondWithResult(_0x4ea394,null))[_0xb6b1('0x42')](handleError(_0x4ea394,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js
index f9870c2..c23ff86 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 _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
+var _0x7dc2=['exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','../../config/logger','api','moment','bluebird','path','rimraf','./cmHopperFinal.attributes'];(function(_0xd5219c,_0x57e31c){var _0x3ea9a=function(_0x4cb47a){while(--_0x4cb47a){_0xd5219c['push'](_0xd5219c['shift']());}};_0x3ea9a(++_0x57e31c);}(_0x7dc2,0x19d));var _0x27dc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7dc2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x27dc('0x0'))(_0x27dc('0x1'));var moment=require(_0x27dc('0x2'));var BPromise=require(_0x27dc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27dc('0x4'));var rimraf=require(_0x27dc('0x5'));var config=require('../../config/environment');var attributes=require(_0x27dc('0x6'));module[_0x27dc('0x7')]=function(_0x5a442a,_0x29eaac){return _0x5a442a['define'](_0x27dc('0x8'),attributes,{'tableName':_0x27dc('0x9'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x27dc('0xa')]},{'name':_0x27dc('0xb'),'fields':[_0x27dc('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 f3b8d9f..b5c4193 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 _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
+var _0x8b3b=['CmHopperFinal,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','options','raw','then','CreateCmHopperFinal','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0x8b3b,0x6e));var _0xb8b3=function(_0x1fde53,_0x4e8b6c){_0x1fde53=_0x1fde53-0x0;var _0x987cce=_0x8b3b[_0x1fde53];return _0x987cce;};'use strict';var _=require('lodash');var util=require(_0xb8b3('0x0'));var moment=require('moment');var BPromise=require(_0xb8b3('0x1'));var rs=require(_0xb8b3('0x2'));var fs=require('fs');var Redis=require(_0xb8b3('0x3'));var db=require(_0xb8b3('0x4'))['db'];var utils=require(_0xb8b3('0x5'));var logger=require(_0xb8b3('0x6'))(_0xb8b3('0x7'));var config=require(_0xb8b3('0x8'));var jayson=require(_0xb8b3('0x9'));var client=jayson['client'][_0xb8b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1be041,_0x1528ef,_0x5366e4){return new BPromise(function(_0x5ade72,_0x198e83){return client[_0xb8b3('0xb')](_0x1be041,_0x5366e4)['then'](function(_0x5ca7fb){logger['info'](_0xb8b3('0xc'),_0x1528ef,_0xb8b3('0xd'));logger[_0xb8b3('0xe')](_0xb8b3('0xf'),_0x1528ef,_0xb8b3('0xd'),JSON['stringify'](_0x5ca7fb));if(_0x5ca7fb[_0xb8b3('0x10')]){if(_0x5ca7fb[_0xb8b3('0x10')]['code']===0x1f4){logger[_0xb8b3('0x10')](_0xb8b3('0xc'),_0x1528ef,_0x5ca7fb[_0xb8b3('0x10')][_0xb8b3('0x11')]);return _0x198e83(_0x5ca7fb[_0xb8b3('0x10')][_0xb8b3('0x11')]);}logger['error'](_0xb8b3('0xc'),_0x1528ef,_0x5ca7fb[_0xb8b3('0x10')][_0xb8b3('0x11')]);return _0x5ade72(_0x5ca7fb[_0xb8b3('0x10')][_0xb8b3('0x11')]);}else{logger[_0xb8b3('0x12')](_0xb8b3('0xc'),_0x1528ef,_0xb8b3('0xd'));_0x5ade72(_0x5ca7fb[_0xb8b3('0x13')][_0xb8b3('0x11')]);}})[_0xb8b3('0x14')](function(_0x432be5){logger[_0xb8b3('0x10')](_0xb8b3('0xc'),_0x1528ef,_0x432be5);_0x198e83(_0x432be5);});});}exports['CreateCmHopperFinal']=function(_0x53d5c2){var _0x57e588=this;return new Promise(function(_0x4f7638,_0x474aea){return db['CmHopperFinal']['create'](_0x53d5c2['body'],{'raw':_0x53d5c2[_0xb8b3('0x15')]?_0x53d5c2['options'][_0xb8b3('0x16')]===undefined?!![]:![]:!![]})[_0xb8b3('0x17')](function(_0x201039){logger[_0xb8b3('0x12')]('CreateCmHopperFinal',_0x53d5c2);logger[_0xb8b3('0xe')]('CreateCmHopperFinal',_0x53d5c2,JSON['stringify'](_0x201039));_0x4f7638(_0x201039);})[_0xb8b3('0x14')](function(_0x4836a2){logger[_0xb8b3('0x10')](_0xb8b3('0x18'),_0x4836a2[_0xb8b3('0x11')],_0x53d5c2);_0x474aea(_0x57e588[_0xb8b3('0x10')](0x1f4,_0x4836a2[_0xb8b3('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js
index bfe4762..cd309f6 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 _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
+var _0x813f=['describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/checkContactHopper','checkContactHopper','put','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','/describe','isAuthenticated'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x813f,0x109));var _0xf813=function(_0x2c5581,_0x1b6304){_0x2c5581=_0x2c5581-0x0;var _0x5c21b8=_0x813f[_0x2c5581];return _0x5c21b8;};'use strict';var multer=require(_0xf813('0x0'));var util=require(_0xf813('0x1'));var path=require(_0xf813('0x2'));var timeout=require(_0xf813('0x3'));var express=require('express');var router=express[_0xf813('0x4')]();var auth=require(_0xf813('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf813('0x6'));var controller=require(_0xf813('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf813('0x8')](_0xf813('0x9'),auth[_0xf813('0xa')](),controller[_0xf813('0xb')]);router[_0xf813('0x8')](_0xf813('0xc'),auth[_0xf813('0xa')](),controller[_0xf813('0xd')]);router['get'](_0xf813('0xe'),auth[_0xf813('0xa')](),controller[_0xf813('0xf')]);router[_0xf813('0x8')]('/campaign/countAttributes/:id',auth[_0xf813('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0xf813('0x10'),auth[_0xf813('0xa')](),controller[_0xf813('0x11')]);router[_0xf813('0x12')]('/voice/campaign/moveContacts/:id',auth[_0xf813('0xa')](),controller['moveContactsIvrCampaignHopperFinal']);router['post'](_0xf813('0x13'),auth[_0xf813('0xa')](),controller[_0xf813('0x14')]);router[_0xf813('0x15')]('/:id',auth[_0xf813('0xa')](),controller['update']);module[_0xf813('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js
index 99ac2fd..b05f9f3 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 _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
+var _0x2164=['DATE','BOOLEAN','sequelize','INTEGER','STRING'];(function(_0x54a154,_0x1e6a06){var _0x25d7ca=function(_0x14aa1b){while(--_0x14aa1b){_0x54a154['push'](_0x54a154['shift']());}};_0x25d7ca(++_0x1e6a06);}(_0x2164,0x197));var _0x4216=function(_0x162080,_0xb26805){_0x162080=_0x162080-0x0;var _0x4db3d0=_0x2164[_0x162080];return _0x4db3d0;};'use strict';var Sequelize=require(_0x4216('0x0'));module['exports']={'state':{'type':Sequelize[_0x4216('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x4216('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x4216('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4216('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4216('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4216('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4216('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x4216('0x2')]},'originatecalleridname':{'type':Sequelize[_0x4216('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4216('0x2')]},'starttime':{'type':Sequelize[_0x4216('0x3')]},'responsetime':{'type':Sequelize[_0x4216('0x3')]},'answertime':{'type':Sequelize[_0x4216('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x4216('0x3')]},'ringtime':{'type':Sequelize[_0x4216('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4216('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4216('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x4216('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x4216('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x4216('0x2')]},'membername':{'type':Sequelize[_0x4216('0x2')]},'reason':{'type':Sequelize[_0x4216('0x2')]},'amd':{'type':Sequelize[_0x4216('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x4216('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x4216('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4216('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4216('0x3')]},'recallme':{'type':Sequelize[_0x4216('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x4216('0x3')]},'edited':{'type':Sequelize[_0x4216('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4216('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4216('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4216('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x4216('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js
index 5b8ff24..755d6f6 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 _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
+var _0xbc34=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','sendStatus','status','end','count','offset','set','Content-Range','reject','save','update','then','error','stack','send','index','CmHopperHistory','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','includeAll','find','create','describe','body','uniqueid','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service'];(function(_0x8c7980,_0x5088af){var _0xdbd55=function(_0x11bd8e){while(--_0x11bd8e){_0x8c7980['push'](_0x8c7980['shift']());}};_0xdbd55(++_0x5088af);}(_0xbc34,0x116));var _0x4bc3=function(_0x475703,_0x189bdf){_0x475703=_0x475703-0x0;var _0x32e41f=_0xbc34[_0x475703];return _0x32e41f;};'use strict';var pdf=require(_0x4bc3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4bc3('0x1'));var zipdir=require(_0x4bc3('0x2'));var jsonpatch=require(_0x4bc3('0x3'));var rp=require(_0x4bc3('0x4'));var moment=require(_0x4bc3('0x5'));var BPromise=require(_0x4bc3('0x6'));var Mustache=require('mustache');var util=require(_0x4bc3('0x7'));var path=require('path');var sox=require(_0x4bc3('0x8'));var csv=require(_0x4bc3('0x9'));var ejs=require(_0x4bc3('0xa'));var fs=require('fs');var _=require(_0x4bc3('0xb'));var squel=require(_0x4bc3('0xc'));var crypto=require(_0x4bc3('0xd'));var jsforce=require(_0x4bc3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4bc3('0x9'));var querystring=require(_0x4bc3('0xf'));var Papa=require('papaparse');var Redis=require(_0x4bc3('0x10'));var authService=require(_0x4bc3('0x11'));var qs=require(_0x4bc3('0x12'));var as=require(_0x4bc3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4bc3('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x4bc3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bc583,_0x2f61b5){_0x2f61b5=_0x2f61b5||0xcc;return function(_0x4c49c0){if(_0x4c49c0){return _0x5bc583[_0x4bc3('0x16')](_0x2f61b5);}return _0x5bc583[_0x4bc3('0x17')](_0x2f61b5)[_0x4bc3('0x18')]();};}function respondWithResult(_0x4cf839,_0x4c8b68){_0x4c8b68=_0x4c8b68||0xc8;return function(_0x1ef111){if(_0x1ef111){return _0x4cf839[_0x4bc3('0x17')](_0x4c8b68)['json'](_0x1ef111);}};}function respondWithFilteredResult(_0x56f7eb,_0x4ad515){return function(_0x199295){if(_0x199295){var _0x3cfa14=_0x199295[_0x4bc3('0x19')],_0x27609b=_0x4ad515[_0x4bc3('0x1a')],_0x145d59=_0x4ad515['offset']+_0x4ad515['limit'],_0x153843;if(_0x145d59>=_0x3cfa14){_0x145d59=_0x3cfa14;_0x153843=0xc8;}else{_0x153843=0xce;}_0x56f7eb[_0x4bc3('0x17')](_0x153843);return _0x56f7eb[_0x4bc3('0x1b')](_0x4bc3('0x1c'),_0x27609b+'-'+_0x145d59+'/'+_0x3cfa14)['json'](_0x199295);}return null;};}function patchUpdates(_0x251175){return function(_0x13d351){try{jsonpatch['apply'](_0x13d351,_0x251175,!![]);}catch(_0x36afba){return BPromise[_0x4bc3('0x1d')](_0x36afba);}return _0x13d351[_0x4bc3('0x1e')]();};}function saveUpdates(_0xf2fad8,_0x2620b1){return function(_0x5c03e){if(_0x5c03e){return _0x5c03e[_0x4bc3('0x1f')](_0xf2fad8)[_0x4bc3('0x20')](function(_0x2c9f3f){return _0x2c9f3f;});}return null;};}function removeEntity(_0x328284,_0x5ac47b){return function(_0x4b33f7){if(_0x4b33f7){return _0x4b33f7['destroy']()[_0x4bc3('0x20')](function(){_0x328284[_0x4bc3('0x17')](0xcc)[_0x4bc3('0x18')]();});}};}function handleEntityNotFound(_0x3ef299,_0x333916){return function(_0x1f0671){if(!_0x1f0671){_0x3ef299[_0x4bc3('0x16')](0x194);}return _0x1f0671;};}function handleError(_0x38f82c,_0x3f72fe){_0x3f72fe=_0x3f72fe||0x1f4;return function(_0x1fa6d9){logger[_0x4bc3('0x21')](_0x1fa6d9[_0x4bc3('0x22')]);if(_0x1fa6d9['name']){delete _0x1fa6d9['name'];}_0x38f82c[_0x4bc3('0x17')](_0x3f72fe)[_0x4bc3('0x23')](_0x1fa6d9);};}exports[_0x4bc3('0x24')]=function(_0x392e00,_0x1ce219){var _0x454ff7={},_0x5786df={},_0x56922d={'count':0x0,'rows':[]};var _0x1c5c26=_['map'](db[_0x4bc3('0x25')][_0x4bc3('0x26')],function(_0x130f9a){return{'name':_0x130f9a[_0x4bc3('0x27')],'type':_0x130f9a[_0x4bc3('0x28')][_0x4bc3('0x29')]};});_0x5786df[_0x4bc3('0x2a')]=_[_0x4bc3('0x2b')](_0x1c5c26,_0x4bc3('0x2c'));_0x5786df[_0x4bc3('0x2d')]=_[_0x4bc3('0x2e')](_0x392e00[_0x4bc3('0x2d')]);_0x5786df[_0x4bc3('0x2f')]=_[_0x4bc3('0x30')](_0x5786df[_0x4bc3('0x2a')],_0x5786df[_0x4bc3('0x2d')]);_0x454ff7[_0x4bc3('0x31')]=_[_0x4bc3('0x30')](_0x5786df[_0x4bc3('0x2a')],qs[_0x4bc3('0x32')](_0x392e00['query']['fields']));_0x454ff7[_0x4bc3('0x31')]=_0x454ff7[_0x4bc3('0x31')][_0x4bc3('0x33')]?_0x454ff7[_0x4bc3('0x31')]:_0x5786df[_0x4bc3('0x2a')];if(!_0x392e00[_0x4bc3('0x2d')][_0x4bc3('0x34')](_0x4bc3('0x35'))){_0x454ff7[_0x4bc3('0x36')]=qs[_0x4bc3('0x36')](_0x392e00['query'][_0x4bc3('0x36')]);_0x454ff7[_0x4bc3('0x1a')]=qs['offset'](_0x392e00[_0x4bc3('0x2d')][_0x4bc3('0x1a')]);}_0x454ff7[_0x4bc3('0x37')]=qs['sort'](_0x392e00[_0x4bc3('0x2d')][_0x4bc3('0x38')]);_0x454ff7[_0x4bc3('0x39')]=qs[_0x4bc3('0x2f')](_[_0x4bc3('0x3a')](_0x392e00[_0x4bc3('0x2d')],_0x5786df['filters']),_0x1c5c26);if(_0x392e00[_0x4bc3('0x2d')]['filter']){_0x454ff7[_0x4bc3('0x39')]=_[_0x4bc3('0x3b')](_0x454ff7[_0x4bc3('0x39')],{'$or':_[_0x4bc3('0x2b')](_0x1c5c26,function(_0x32e1bf){if(_0x32e1bf[_0x4bc3('0x28')]!==_0x4bc3('0x3c')){var _0x50dc59={};_0x50dc59[_0x32e1bf[_0x4bc3('0x2c')]]={'$like':'%'+_0x392e00[_0x4bc3('0x2d')][_0x4bc3('0x3d')]+'%'};return _0x50dc59;}})});}_0x454ff7=_[_0x4bc3('0x3b')]({},_0x454ff7,_0x392e00[_0x4bc3('0x3e')]);var _0x46fb42={'where':_0x454ff7[_0x4bc3('0x39')]};return db['CmHopperHistory'][_0x4bc3('0x19')](_0x46fb42)[_0x4bc3('0x20')](function(_0x36980a){_0x56922d[_0x4bc3('0x19')]=_0x36980a;if(_0x392e00['query']['includeAll']){_0x454ff7[_0x4bc3('0x3f')]=[{'all':!![]}];}return db[_0x4bc3('0x25')][_0x4bc3('0x40')](_0x454ff7);})['then'](function(_0x528239){_0x56922d[_0x4bc3('0x41')]=_0x528239;return _0x56922d;})[_0x4bc3('0x20')](respondWithFilteredResult(_0x1ce219,_0x454ff7))[_0x4bc3('0x42')](handleError(_0x1ce219,null));};exports['show']=function(_0x4b52c0,_0x24cc4e){var _0x50e8ce={'raw':!![],'where':{'id':_0x4b52c0[_0x4bc3('0x43')]['id']}},_0x43bcb8={};_0x43bcb8[_0x4bc3('0x2a')]=_[_0x4bc3('0x2e')](db['CmHopperHistory'][_0x4bc3('0x26')]);_0x43bcb8[_0x4bc3('0x2d')]=_[_0x4bc3('0x2e')](_0x4b52c0['query']);_0x43bcb8['filters']=_[_0x4bc3('0x30')](_0x43bcb8[_0x4bc3('0x2a')],_0x43bcb8[_0x4bc3('0x2d')]);_0x50e8ce[_0x4bc3('0x31')]=_[_0x4bc3('0x30')](_0x43bcb8[_0x4bc3('0x2a')],qs['fields'](_0x4b52c0[_0x4bc3('0x2d')][_0x4bc3('0x32')]));_0x50e8ce[_0x4bc3('0x31')]=_0x50e8ce['attributes'][_0x4bc3('0x33')]?_0x50e8ce[_0x4bc3('0x31')]:_0x43bcb8['model'];if(_0x4b52c0['query'][_0x4bc3('0x44')]){_0x50e8ce['include']=[{'all':!![]}];}_0x50e8ce=_[_0x4bc3('0x3b')]({},_0x50e8ce,_0x4b52c0['options']);return db[_0x4bc3('0x25')][_0x4bc3('0x45')](_0x50e8ce)['then'](handleEntityNotFound(_0x24cc4e,null))['then'](respondWithResult(_0x24cc4e,null))[_0x4bc3('0x42')](handleError(_0x24cc4e,null));};exports[_0x4bc3('0x46')]=function(_0x1fbee2,_0x4efd10){return db['CmHopperHistory'][_0x4bc3('0x46')](_0x1fbee2['body'],{})[_0x4bc3('0x20')](respondWithResult(_0x4efd10,0xc9))['catch'](handleError(_0x4efd10,null));};exports[_0x4bc3('0x47')]=function(_0xe7f062,_0x2ba6c7){return db[_0x4bc3('0x25')]['describe']()[_0x4bc3('0x20')](respondWithResult(_0x2ba6c7,null))[_0x4bc3('0x42')](handleError(_0x2ba6c7,null));};exports[_0x4bc3('0x1f')]=function(_0x3e5472,_0x6d1c59){if(_0x3e5472[_0x4bc3('0x48')][_0x4bc3('0x49')]){delete _0x3e5472[_0x4bc3('0x48')][_0x4bc3('0x49')];}return db[_0x4bc3('0x25')][_0x4bc3('0x45')]({'where':{'uniqueid':_0x3e5472[_0x4bc3('0x43')]['id']}})[_0x4bc3('0x20')](handleEntityNotFound(_0x6d1c59,null))['then'](saveUpdates(_0x3e5472[_0x4bc3('0x48')],null))['then'](respondWithResult(_0x6d1c59,null))[_0x4bc3('0x42')](handleError(_0x6d1c59,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js
index c0b2006..e663d60 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 _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
+var _0xe0e8=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0xf1c51,_0xc31d7d){var _0x36acf6=function(_0xd1c4a4){while(--_0xd1c4a4){_0xf1c51['push'](_0xf1c51['shift']());}};_0x36acf6(++_0xc31d7d);}(_0xe0e8,0xe9));var _0x8e0e=function(_0x3df248,_0x3fb9cc){_0x3df248=_0x3df248-0x0;var _0x3509c5=_0xe0e8[_0x3df248];return _0x3509c5;};'use strict';var _=require(_0x8e0e('0x0'));var util=require('util');var logger=require(_0x8e0e('0x1'))('api');var moment=require(_0x8e0e('0x2'));var BPromise=require(_0x8e0e('0x3'));var rp=require(_0x8e0e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e0e('0x5'));var config=require(_0x8e0e('0x6'));var attributes=require(_0x8e0e('0x7'));module[_0x8e0e('0x8')]=function(_0x449b27,_0x221f0b){return _0x449b27[_0x8e0e('0x9')]('CmHopperHistory',attributes,{'tableName':_0x8e0e('0xa'),'paranoid':![],'indexes':[{'name':_0x8e0e('0xb'),'fields':[_0x8e0e('0xb')]},{'name':_0x8e0e('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js
index cd42754..8786dbf 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 _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
+var _0xb688=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory','AvgHandleTime','findAll','where','sequelize','predictiveIntervalAnsweredCalls','COUNT','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','stringify','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x484609,_0x209f3c){var _0x464eac=function(_0x177e7b){while(--_0x177e7b){_0x484609['push'](_0x484609['shift']());}};_0x464eac(++_0x209f3c);}(_0xb688,0xcf));var _0x8b68=function(_0x5c595a,_0x582302){_0x5c595a=_0x5c595a-0x0;var _0x17d798=_0xb688[_0x5c595a];return _0x17d798;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var moment=require(_0x8b68('0x1'));var BPromise=require(_0x8b68('0x2'));var rs=require(_0x8b68('0x3'));var fs=require('fs');var Redis=require(_0x8b68('0x4'));var db=require(_0x8b68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var config=require(_0x8b68('0x8'));var jayson=require(_0x8b68('0x9'));var client=jayson['client'][_0x8b68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ee56,_0x37677d,_0x2bbffd){return new BPromise(function(_0x130892,_0xa5571b){return client[_0x8b68('0xb')](_0x57ee56,_0x2bbffd)[_0x8b68('0xc')](function(_0x261753){logger[_0x8b68('0xd')](_0x8b68('0xe'),_0x37677d,_0x8b68('0xf'));logger[_0x8b68('0x10')](_0x8b68('0x11'),_0x37677d,_0x8b68('0xf'),JSON['stringify'](_0x261753));if(_0x261753[_0x8b68('0x12')]){if(_0x261753[_0x8b68('0x12')][_0x8b68('0x13')]===0x1f4){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);return _0xa5571b(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}logger['error'](_0x8b68('0xe'),_0x37677d,_0x261753['error']['message']);return _0x130892(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}else{logger[_0x8b68('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x37677d,'request\x20sent');_0x130892(_0x261753[_0x8b68('0x15')]['message']);}})[_0x8b68('0x16')](function(_0xb44923){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0xb44923);_0xa5571b(_0xb44923);});});}exports['CreateCmHopperHistory']=function(_0xd17693){var _0x203dd4=this;return new Promise(function(_0x4a68c7,_0x42b3bd){return db[_0x8b68('0x17')][_0x8b68('0x18')](_0xd17693[_0x8b68('0x19')],{'raw':_0xd17693[_0x8b68('0x1a')]?_0xd17693['options'][_0x8b68('0x1b')]===undefined?!![]:![]:!![]})[_0x8b68('0xc')](function(_0x59e9b1){logger[_0x8b68('0xd')](_0x8b68('0x1c'),_0xd17693);logger[_0x8b68('0x10')]('CreateCmHopperHistory',_0xd17693,JSON['stringify'](_0x59e9b1));_0x4a68c7(_0x59e9b1);})[_0x8b68('0x16')](function(_0x59cb26){logger[_0x8b68('0x12')](_0x8b68('0x1c'),_0x59cb26[_0x8b68('0x14')],_0xd17693);_0x42b3bd(_0x203dd4[_0x8b68('0x12')](0x1f4,_0x59cb26[_0x8b68('0x14')]));});});};exports[_0x8b68('0x1d')]=function(_0x59bb8a){var _0x1a6fe8=this;return new Promise(function(_0x46e827,_0x4ca77d){return db[_0x8b68('0x17')][_0x8b68('0x1e')]({'raw':_0x59bb8a[_0x8b68('0x1a')]?_0x59bb8a['options']['raw']===undefined?!![]:![]:!![],'where':_0x59bb8a['options']?_0x59bb8a[_0x8b68('0x1a')][_0x8b68('0x1f')]||null:null,'attributes':[[db[_0x8b68('0x20')]['fn']('COUNT',db[_0x8b68('0x20')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x8b68('0x20')]['fn']('COUNT',db[_0x8b68('0x20')]['fn']('IF',db[_0x8b68('0x20')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x8b68('0x21')],[db[_0x8b68('0x20')]['fn'](_0x8b68('0x22'),db[_0x8b68('0x20')]['fn']('IF',db[_0x8b68('0x20')][_0x8b68('0x23')](_0x8b68('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x8b68('0x20')]['fn']('COUNT',db[_0x8b68('0x20')]['fn']('IF',db[_0x8b68('0x20')]['literal'](_0x8b68('0x25')))),_0x8b68('0x26')],[db[_0x8b68('0x20')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x8b68('0x20')][_0x8b68('0x23')](_0x8b68('0x27')))),_0x8b68('0x28')],[db[_0x8b68('0x20')]['fn'](_0x8b68('0x29'),db[_0x8b68('0x20')]['fn']('IF',db[_0x8b68('0x20')][_0x8b68('0x23')](_0x8b68('0x2a')))),_0x8b68('0x2b')]]})[_0x8b68('0xc')](function(_0x232fa9){logger[_0x8b68('0xd')](_0x8b68('0x1d'),_0x59bb8a);logger[_0x8b68('0x10')](_0x8b68('0x1d'),_0x59bb8a,JSON[_0x8b68('0x2c')](_0x232fa9));_0x46e827(_0x232fa9);})[_0x8b68('0x16')](function(_0x18dfae){logger[_0x8b68('0x12')](_0x8b68('0x1d'),_0x18dfae['message'],_0x59bb8a);_0x4ca77d(_0x1a6fe8['error'](0x1f4,_0x18dfae[_0x8b68('0x14')]));});});};exports[_0x8b68('0x2d')]=function(_0x23554d){var _0xb9b5b1=this;return new Promise(function(_0xf2154f,_0xce486c){return db[_0x8b68('0x17')][_0x8b68('0x1e')]({'raw':_0x23554d['options']?_0x23554d[_0x8b68('0x1a')][_0x8b68('0x1b')]===undefined?!![]:![]:!![],'where':_0x23554d[_0x8b68('0x1a')]?_0x23554d[_0x8b68('0x1a')][_0x8b68('0x1f')]||null:null,'attributes':[[_0x8b68('0x2e'),_0x8b68('0x2f')],[db[_0x8b68('0x20')]['fn']('COUNT',db[_0x8b68('0x20')]['fn']('IF',db[_0x8b68('0x20')][_0x8b68('0x23')](_0x8b68('0x30')))),_0x8b68('0x31')],[db[_0x8b68('0x20')]['fn'](_0x8b68('0x22'),db['sequelize']['fn']('IF',db[_0x8b68('0x20')][_0x8b68('0x23')]('`state`\x20=\x203,\x201,\x20null'))),_0x8b68('0x32')],[db[_0x8b68('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x8b68('0x33')))),_0x8b68('0x34')],[db['sequelize']['fn'](_0x8b68('0x22'),db['sequelize']['fn']('IF',db[_0x8b68('0x20')][_0x8b68('0x23')]('`state`\x20=\x205,\x201,\x20null'))),_0x8b68('0x35')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8b68('0x20')][_0x8b68('0x23')](_0x8b68('0x36')))),_0x8b68('0x37')],[db['sequelize']['fn'](_0x8b68('0x22'),db['sequelize']['fn']('IF',db[_0x8b68('0x20')][_0x8b68('0x23')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x8b68('0x38')],[db[_0x8b68('0x20')]['fn'](_0x8b68('0x22'),db[_0x8b68('0x20')]['fn']('IF',db['sequelize'][_0x8b68('0x23')](_0x8b68('0x39')))),_0x8b68('0x3a')],[db[_0x8b68('0x20')]['fn'](_0x8b68('0x22'),db[_0x8b68('0x20')]['fn']('IF',db[_0x8b68('0x20')][_0x8b68('0x23')](_0x8b68('0x3b')))),_0x8b68('0x3c')],[db[_0x8b68('0x20')]['fn'](_0x8b68('0x22'),db[_0x8b68('0x20')]['fn']('IF',db[_0x8b68('0x20')][_0x8b68('0x23')](_0x8b68('0x3d')))),'outboundBlacklistCallsDay'],[db[_0x8b68('0x20')]['fn'](_0x8b68('0x22'),db['sequelize']['fn']('IF',db[_0x8b68('0x20')]['literal']('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db[_0x8b68('0x20')]['fn'](_0x8b68('0x22'),db[_0x8b68('0x20')]['fn']('IF',db[_0x8b68('0x20')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),_0x8b68('0x3e')],[db[_0x8b68('0x20')]['fn'](_0x8b68('0x22'),db['sequelize']['fn']('IF',db[_0x8b68('0x20')][_0x8b68('0x23')]('`state`\x20=\x2016,\x201,\x20null'))),_0x8b68('0x3f')],[db[_0x8b68('0x20')]['fn']('COUNT',db[_0x8b68('0x20')]['fn']('IF',db[_0x8b68('0x20')]['literal'](_0x8b68('0x40')))),_0x8b68('0x3e')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8b68('0x20')][_0x8b68('0x23')](_0x8b68('0x41')))),_0x8b68('0x42')]],'group':['campaign']})['then'](function(_0x4492fd){logger[_0x8b68('0xd')](_0x8b68('0x2d'),_0x23554d);logger['debug'](_0x8b68('0x2d'),_0x23554d,JSON[_0x8b68('0x2c')](_0x4492fd));_0xf2154f(_0x4492fd);})[_0x8b68('0x16')](function(_0x4dda69){logger[_0x8b68('0x12')]('GetVoiceQueueHopperHistory',_0x4dda69[_0x8b68('0x14')],_0x23554d);_0xce486c(_0xb9b5b1[_0x8b68('0x12')](0x1f4,_0x4dda69['message']));});});};exports[_0x8b68('0x43')]=function(_0x25842e){var _0x6ac18=this;return new Promise(function(_0xcd88b4,_0x8cc614){return db['CmHopperHistory'][_0x8b68('0x1e')]({'raw':_0x25842e[_0x8b68('0x1a')]?_0x25842e[_0x8b68('0x1a')][_0x8b68('0x1b')]===undefined?!![]:![]:!![],'where':_0x25842e[_0x8b68('0x1a')]?_0x25842e[_0x8b68('0x1a')][_0x8b68('0x1f')]||null:null,'attributes':[[_0x8b68('0x2e'),'name'],[db[_0x8b68('0x20')]['fn'](_0x8b68('0x22'),db[_0x8b68('0x20')][_0x8b68('0x44')]('id')),_0x8b68('0x45')],[db[_0x8b68('0x20')]['fn'](_0x8b68('0x22'),db[_0x8b68('0x20')]['fn']('IF',db[_0x8b68('0x20')][_0x8b68('0x23')](_0x8b68('0x33')))),_0x8b68('0x46')]],'group':[_0x8b68('0x2e')]})[_0x8b68('0xc')](function(_0x28e7aa){logger[_0x8b68('0xd')](_0x8b68('0x43'),_0x25842e);logger[_0x8b68('0x10')](_0x8b68('0x43'),_0x25842e,JSON[_0x8b68('0x2c')](_0x28e7aa));_0xcd88b4(_0x28e7aa);})['catch'](function(_0xaac776){logger['error']('GetCampaignHopperHistory',_0xaac776[_0x8b68('0x14')],_0x25842e);_0x8cc614(_0x6ac18['error'](0x1f4,_0xaac776[_0x8b68('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js
index 2317088..0929d75 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 _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
+var _0x86bc=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','show','create','put','/:id','multer'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x86bc,0x19f));var _0xc86b=function(_0x3f2cfe,_0x16fd1c){_0x3f2cfe=_0x3f2cfe-0x0;var _0x36c4ae=_0x86bc[_0x3f2cfe];return _0x36c4ae;};'use strict';var multer=require(_0xc86b('0x0'));var util=require('util');var path=require(_0xc86b('0x1'));var timeout=require(_0xc86b('0x2'));var express=require('express');var router=express[_0xc86b('0x3')]();var auth=require(_0xc86b('0x4'));var interaction=require(_0xc86b('0x5'));var config=require(_0xc86b('0x6'));var controller=require(_0xc86b('0x7'));router[_0xc86b('0x8')]('/',auth[_0xc86b('0x9')](),controller['index']);router['get'](_0xc86b('0xa'),auth['isAuthenticated'](),controller[_0xc86b('0xb')]);router[_0xc86b('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xc86b('0xc')]);router['post']('/',auth[_0xc86b('0x9')](),controller[_0xc86b('0xd')]);router[_0xc86b('0xe')](_0xc86b('0xf'),auth[_0xc86b('0x9')](),controller['update']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js
index 43ba458..aed1473 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 _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
+var _0xea20=['STRING','name','sequelize'];(function(_0x1d2ee3,_0x6d212a){var _0x5b801f=function(_0x80312e){while(--_0x80312e){_0x1d2ee3['push'](_0x1d2ee3['shift']());}};_0x5b801f(++_0x6d212a);}(_0xea20,0x152));var _0x0ea2=function(_0x5f15aa,_0x247a80){_0x5f15aa=_0x5f15aa-0x0;var _0x230d52=_0xea20[_0x5f15aa];return _0x230d52;};'use strict';var Sequelize=require(_0x0ea2('0x0'));module['exports']={'name':{'type':Sequelize[_0x0ea2('0x1')],'unique':_0x0ea2('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0ea2('0x1')]},'dialPrefix':{'type':Sequelize[_0x0ea2('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js
index 7f60ac6..c7c64ff 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 _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
+var _0x1ff7=['setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','end','status','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','get','Lists','UserProfileResource','sendStatus','error','name','send','index','CmList','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ListId','getDispositions','findOne','Disposition','removeDispositions','ids','addContacts','tags','isArray','each','CmContact','omit','success','dataValues','errors','push','getContacts','CmCustomField','CustomFields','concat','cf_%d','nolimit','order','raw','getContactsCsv','format','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv'];(function(_0x291086,_0x5b7274){var _0xe42533=function(_0x573f4a){while(--_0x573f4a){_0x291086['push'](_0x291086['shift']());}};_0xe42533(++_0x5b7274);}(_0x1ff7,0xb1));var _0x71ff=function(_0x2395f3,_0x4d9e56){_0x2395f3=_0x2395f3-0x0;var _0x43bcfe=_0x1ff7[_0x2395f3];return _0x43bcfe;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x71ff('0x0'));var rimraf=require(_0x71ff('0x1'));var zipdir=require(_0x71ff('0x2'));var jsonpatch=require(_0x71ff('0x3'));var rp=require(_0x71ff('0x4'));var moment=require(_0x71ff('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x71ff('0x6'));var path=require(_0x71ff('0x7'));var sox=require('sox');var csv=require(_0x71ff('0x8'));var ejs=require(_0x71ff('0x9'));var fs=require('fs');var _=require(_0x71ff('0xa'));var squel=require(_0x71ff('0xb'));var crypto=require('crypto');var jsforce=require(_0x71ff('0xc'));var deskjs=require(_0x71ff('0xd'));var toCsv=require(_0x71ff('0x8'));var querystring=require('querystring');var Papa=require(_0x71ff('0xe'));var Redis=require('ioredis');var authService=require(_0x71ff('0xf'));var qs=require(_0x71ff('0x10'));var as=require(_0x71ff('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x71ff('0x12'));var utils=require(_0x71ff('0x13'));var config=require(_0x71ff('0x14'));var db=require('../../mysqldb')['db'];config[_0x71ff('0x15')]=_[_0x71ff('0x16')](config[_0x71ff('0x15')],{'host':_0x71ff('0x17'),'port':0x18eb});var socket=require(_0x71ff('0x18'))(new Redis(config[_0x71ff('0x15')]));require(_0x71ff('0x19'))[_0x71ff('0x1a')](socket);function respondWithStatusCode(_0x5ac732,_0x47505a){_0x47505a=_0x47505a||0xcc;return function(_0x5d32bf){if(_0x5d32bf){return _0x5ac732['sendStatus'](_0x47505a);}return _0x5ac732['status'](_0x47505a)[_0x71ff('0x1b')]();};}function respondWithResult(_0x38b4e3,_0x5531db){_0x5531db=_0x5531db||0xc8;return function(_0x3f0fbc){if(_0x3f0fbc){return _0x38b4e3[_0x71ff('0x1c')](_0x5531db)['json'](_0x3f0fbc);}};}function respondWithFilteredResult(_0x5e4be9,_0x8a4b7d){return function(_0x4b1ba4){if(_0x4b1ba4){var _0x32d499=_0x4b1ba4[_0x71ff('0x1d')],_0x3e179c=_0x8a4b7d[_0x71ff('0x1e')],_0x55b2c8=_0x8a4b7d[_0x71ff('0x1e')]+_0x8a4b7d[_0x71ff('0x1f')],_0xa71b20;if(_0x55b2c8>=_0x32d499){_0x55b2c8=_0x32d499;_0xa71b20=0xc8;}else{_0xa71b20=0xce;}_0x5e4be9[_0x71ff('0x1c')](_0xa71b20);return _0x5e4be9['set'](_0x71ff('0x20'),_0x3e179c+'-'+_0x55b2c8+'/'+_0x32d499)[_0x71ff('0x21')](_0x4b1ba4);}return null;};}function patchUpdates(_0x2be71d){return function(_0x21c839){try{jsonpatch[_0x71ff('0x22')](_0x21c839,_0x2be71d,!![]);}catch(_0x3b867c){return BPromise['reject'](_0x3b867c);}return _0x21c839[_0x71ff('0x23')]();};}function saveUpdates(_0x477245,_0xbd093e){return function(_0x355e44){if(_0x355e44){return _0x355e44[_0x71ff('0x24')](_0x477245)[_0x71ff('0x25')](function(_0x4adc12){return _0x4adc12;});}return null;};}function removeEntity(_0x2cecd3,_0x4cbd82){return function(_0x531a66){if(_0x531a66){return _0x531a66[_0x71ff('0x26')]()[_0x71ff('0x25')](function(){var _0x3bb80d=_0x531a66[_0x71ff('0x27')]({'plain':!![]});var _0x54a821=_0x71ff('0x28');return db[_0x71ff('0x29')][_0x71ff('0x26')]({'where':{'type':_0x54a821,'resourceId':_0x3bb80d['id']}})[_0x71ff('0x25')](function(){return _0x531a66;});})['then'](function(){_0x2cecd3[_0x71ff('0x1c')](0xcc)[_0x71ff('0x1b')]();});}};}function handleEntityNotFound(_0x184301,_0x33ef88){return function(_0x44841e){if(!_0x44841e){_0x184301[_0x71ff('0x2a')](0x194);}return _0x44841e;};}function handleError(_0x5e64f3,_0x5acb70){_0x5acb70=_0x5acb70||0x1f4;return function(_0x4b05d8){logger[_0x71ff('0x2b')](_0x4b05d8['stack']);if(_0x4b05d8[_0x71ff('0x2c')]){delete _0x4b05d8[_0x71ff('0x2c')];}_0x5e64f3[_0x71ff('0x1c')](_0x5acb70)[_0x71ff('0x2d')](_0x4b05d8);};}exports[_0x71ff('0x2e')]=function(_0x5229b6,_0x562f08){var _0x4bdb75={},_0x10d6d3={},_0x1d8a92={'count':0x0,'rows':[]};var _0x3332be=_['map'](db[_0x71ff('0x2f')]['rawAttributes'],function(_0x16cac6){return{'name':_0x16cac6['fieldName'],'type':_0x16cac6[_0x71ff('0x30')][_0x71ff('0x31')]};});_0x10d6d3[_0x71ff('0x32')]=_[_0x71ff('0x33')](_0x3332be,'name');_0x10d6d3['query']=_['keys'](_0x5229b6[_0x71ff('0x34')]);_0x10d6d3[_0x71ff('0x35')]=_[_0x71ff('0x36')](_0x10d6d3['model'],_0x10d6d3[_0x71ff('0x34')]);_0x4bdb75['attributes']=_[_0x71ff('0x36')](_0x10d6d3['model'],qs[_0x71ff('0x37')](_0x5229b6[_0x71ff('0x34')][_0x71ff('0x37')]));_0x4bdb75[_0x71ff('0x38')]=_0x4bdb75[_0x71ff('0x38')][_0x71ff('0x39')]?_0x4bdb75[_0x71ff('0x38')]:_0x10d6d3[_0x71ff('0x32')];if(!_0x5229b6[_0x71ff('0x34')][_0x71ff('0x3a')]('nolimit')){_0x4bdb75['limit']=qs[_0x71ff('0x1f')](_0x5229b6[_0x71ff('0x34')]['limit']);_0x4bdb75[_0x71ff('0x1e')]=qs[_0x71ff('0x1e')](_0x5229b6['query'][_0x71ff('0x1e')]);}_0x4bdb75['order']=qs[_0x71ff('0x3b')](_0x5229b6[_0x71ff('0x34')][_0x71ff('0x3b')]);_0x4bdb75['where']=qs['filters'](_[_0x71ff('0x3c')](_0x5229b6[_0x71ff('0x34')],_0x10d6d3[_0x71ff('0x35')]),_0x3332be);if(_0x5229b6['query'][_0x71ff('0x3d')]){_0x4bdb75[_0x71ff('0x3e')]=_[_0x71ff('0x3f')](_0x4bdb75[_0x71ff('0x3e')],{'$or':_['map'](_0x3332be,function(_0x4fc589){if(_0x4fc589[_0x71ff('0x30')]!==_0x71ff('0x40')){var _0x2353c7={};_0x2353c7[_0x4fc589['name']]={'$like':'%'+_0x5229b6[_0x71ff('0x34')]['filter']+'%'};return _0x2353c7;}})});}_0x4bdb75=_['merge']({},_0x4bdb75,_0x5229b6[_0x71ff('0x41')]);var _0x2d6e58={'where':_0x4bdb75[_0x71ff('0x3e')]};return db[_0x71ff('0x2f')][_0x71ff('0x1d')](_0x2d6e58)[_0x71ff('0x25')](function(_0x3dcb8e){_0x1d8a92[_0x71ff('0x1d')]=_0x3dcb8e;if(_0x5229b6['query']['includeAll']){_0x4bdb75[_0x71ff('0x42')]=[{'all':!![]}];}return db[_0x71ff('0x2f')][_0x71ff('0x43')](_0x4bdb75);})[_0x71ff('0x25')](function(_0x3bb0cf){_0x1d8a92[_0x71ff('0x44')]=_0x3bb0cf;return _0x1d8a92;})['then'](respondWithFilteredResult(_0x562f08,_0x4bdb75))[_0x71ff('0x45')](handleError(_0x562f08,null));};exports[_0x71ff('0x46')]=function(_0x14f721,_0x573ce3){var _0x43da76={'raw':![],'where':{'id':_0x14f721[_0x71ff('0x47')]['id']}},_0x486c12={};_0x486c12[_0x71ff('0x32')]=_[_0x71ff('0x48')](db[_0x71ff('0x2f')][_0x71ff('0x49')]);_0x486c12[_0x71ff('0x34')]=_['keys'](_0x14f721['query']);_0x486c12[_0x71ff('0x35')]=_[_0x71ff('0x36')](_0x486c12[_0x71ff('0x32')],_0x486c12[_0x71ff('0x34')]);_0x43da76[_0x71ff('0x38')]=_[_0x71ff('0x36')](_0x486c12['model'],qs[_0x71ff('0x37')](_0x14f721[_0x71ff('0x34')][_0x71ff('0x37')]));_0x43da76['attributes']=_0x43da76[_0x71ff('0x38')][_0x71ff('0x39')]?_0x43da76['attributes']:_0x486c12[_0x71ff('0x32')];if(_0x14f721['query'][_0x71ff('0x4a')]){_0x43da76[_0x71ff('0x42')]=[{'all':!![]}];}_0x43da76=_[_0x71ff('0x3f')]({},_0x43da76,_0x14f721[_0x71ff('0x41')]);return db['CmList'][_0x71ff('0x4b')](_0x43da76)[_0x71ff('0x25')](handleEntityNotFound(_0x573ce3,null))[_0x71ff('0x25')](respondWithResult(_0x573ce3,null))[_0x71ff('0x45')](handleError(_0x573ce3,null));};exports[_0x71ff('0x4c')]=function(_0x3a5bfe,_0x488923){return db[_0x71ff('0x2f')]['create'](_0x3a5bfe['body'],{})[_0x71ff('0x25')](function(_0x35b39a){var _0x5a0887=_0x3a5bfe[_0x71ff('0x4d')]['get']({'plain':!![]});if(!_0x5a0887)throw new Error(_0x71ff('0x4e'));if(_0x5a0887[_0x71ff('0x4f')]==='user'){var _0x332596=_0x35b39a[_0x71ff('0x27')]({'plain':!![]});var _0x257879='Lists';return db['UserProfileSection'][_0x71ff('0x4b')]({'where':{'name':_0x257879,'userProfileId':_0x5a0887[_0x71ff('0x50')]},'raw':!![]})['then'](function(_0x324ffb){if(_0x324ffb&&_0x324ffb[_0x71ff('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x332596['name'],'resourceId':_0x332596['id'],'type':_0x324ffb['name'],'sectionId':_0x324ffb['id']},{})[_0x71ff('0x25')](function(){return _0x35b39a;});}else{return _0x35b39a;}})[_0x71ff('0x45')](function(_0x524baf){logger[_0x71ff('0x2b')](_0x71ff('0x52'),_0x524baf);throw _0x524baf;});}return _0x35b39a;})[_0x71ff('0x25')](respondWithResult(_0x488923,0xc9))[_0x71ff('0x45')](handleError(_0x488923,null));};exports[_0x71ff('0x24')]=function(_0x5d36e2,_0x16cb0b){if(_0x5d36e2[_0x71ff('0x53')]['id']){delete _0x5d36e2[_0x71ff('0x53')]['id'];}return db[_0x71ff('0x2f')][_0x71ff('0x4b')]({'where':{'id':_0x5d36e2[_0x71ff('0x47')]['id']}})[_0x71ff('0x25')](handleEntityNotFound(_0x16cb0b,null))[_0x71ff('0x25')](saveUpdates(_0x5d36e2[_0x71ff('0x53')],null))['then'](respondWithResult(_0x16cb0b,null))[_0x71ff('0x45')](handleError(_0x16cb0b,null));};exports['destroy']=function(_0x1b394e,_0x27e20a){return db['CmList'][_0x71ff('0x4b')]({'where':{'id':_0x1b394e['params']['id']}})[_0x71ff('0x25')](handleEntityNotFound(_0x27e20a,null))[_0x71ff('0x25')](removeEntity(_0x27e20a,null))[_0x71ff('0x45')](handleError(_0x27e20a,null));};exports[_0x71ff('0x54')]=function(_0x71341e,_0x1af93d){return db[_0x71ff('0x2f')][_0x71ff('0x54')]()['then'](respondWithResult(_0x1af93d,null))[_0x71ff('0x45')](handleError(_0x1af93d,null));};exports['addDisposition']=function(_0x52df6c,_0xd4bab0,_0x57eb0f){if(_0x52df6c['body']['id']){delete _0x52df6c[_0x71ff('0x53')]['id'];}return db[_0x71ff('0x2f')][_0x71ff('0x4b')]({'where':{'id':_0x52df6c[_0x71ff('0x47')]['id']}})[_0x71ff('0x25')](handleEntityNotFound(_0xd4bab0,null))['then'](function(_0x344de7){if(_0x344de7){_0x52df6c[_0x71ff('0x53')][_0x71ff('0x55')]=_0x344de7['id'];return db['Disposition'][_0x71ff('0x4c')](_0x52df6c['body']);}})[_0x71ff('0x25')](respondWithResult(_0xd4bab0,null))['catch'](handleError(_0xd4bab0,null));};exports[_0x71ff('0x56')]=function(_0x4e7427,_0x3a7f84,_0x13dd44){var _0x403a07={'raw':![],'where':{}};var _0x18cfdf={};var _0x397fa5={'count':0x0,'rows':[]};return db['CmList'][_0x71ff('0x57')]({'where':{'id':_0x4e7427[_0x71ff('0x47')]['id']}})[_0x71ff('0x25')](handleEntityNotFound(_0x3a7f84,null))[_0x71ff('0x25')](function(_0x30c4de){if(_0x30c4de){_0x18cfdf[_0x71ff('0x32')]=_['keys'](db[_0x71ff('0x58')][_0x71ff('0x49')]);_0x18cfdf[_0x71ff('0x34')]=_[_0x71ff('0x48')](_0x4e7427[_0x71ff('0x34')]);_0x18cfdf['filters']=_[_0x71ff('0x36')](_0x18cfdf[_0x71ff('0x32')],_0x18cfdf[_0x71ff('0x34')]);_0x403a07[_0x71ff('0x38')]=_[_0x71ff('0x36')](_0x18cfdf[_0x71ff('0x32')],qs[_0x71ff('0x37')](_0x4e7427['query'][_0x71ff('0x37')]));_0x403a07['attributes']=_0x403a07['attributes'][_0x71ff('0x39')]?_0x403a07[_0x71ff('0x38')]:_0x18cfdf[_0x71ff('0x32')];if(!_0x4e7427[_0x71ff('0x34')][_0x71ff('0x3a')]('nolimit')){_0x403a07[_0x71ff('0x1f')]=qs['limit'](_0x4e7427[_0x71ff('0x34')][_0x71ff('0x1f')]);_0x403a07[_0x71ff('0x1e')]=qs[_0x71ff('0x1e')](_0x4e7427[_0x71ff('0x34')][_0x71ff('0x1e')]);}_0x403a07['order']=qs[_0x71ff('0x3b')](_0x4e7427[_0x71ff('0x34')]['sort']);_0x403a07[_0x71ff('0x3e')]=qs['filters'](_[_0x71ff('0x3c')](_0x4e7427[_0x71ff('0x34')],_0x18cfdf['filters']));_0x403a07['where'][_0x71ff('0x55')]=_0x30c4de['id'];if(_0x4e7427[_0x71ff('0x34')]['filter']){_0x403a07[_0x71ff('0x3e')]=_['merge'](_0x403a07['where'],{'$or':_[_0x71ff('0x33')](_0x403a07['attributes'],function(_0x3734e3){var _0x291455={};_0x291455[_0x3734e3]={'$like':'%'+_0x4e7427['query'][_0x71ff('0x3d')]+'%'};return _0x291455;})});}_0x403a07=_[_0x71ff('0x3f')]({},_0x403a07,_0x4e7427[_0x71ff('0x41')]);return db[_0x71ff('0x58')][_0x71ff('0x1d')]({'where':_0x403a07[_0x71ff('0x3e')]})[_0x71ff('0x25')](function(_0x12c323){_0x397fa5[_0x71ff('0x1d')]=_0x12c323;if(_0x4e7427[_0x71ff('0x34')]['includeAll']){_0x403a07['include']=[{'all':!![]}];}return db[_0x71ff('0x58')][_0x71ff('0x43')](_0x403a07);})[_0x71ff('0x25')](function(_0x4d971a){_0x397fa5[_0x71ff('0x44')]=_0x4d971a;return _0x397fa5;});}})[_0x71ff('0x25')](respondWithFilteredResult(_0x3a7f84,_0x403a07))[_0x71ff('0x45')](handleError(_0x3a7f84,null));};exports[_0x71ff('0x59')]=function(_0x5f5233,_0x19f16e,_0x2d129f){return db[_0x71ff('0x2f')][_0x71ff('0x4b')]({'where':{'id':_0x5f5233[_0x71ff('0x47')]['id']}})[_0x71ff('0x25')](handleEntityNotFound(_0x19f16e,null))[_0x71ff('0x25')](function(_0x2bd1a1){if(_0x2bd1a1){return _0x2bd1a1['removeDispositions'](_0x5f5233['query'][_0x71ff('0x5a')]);}})['then'](respondWithStatusCode(_0x19f16e,null))['catch'](handleError(_0x19f16e,null));};exports[_0x71ff('0x5b')]=function(_0x2a9299,_0x48c917,_0x5652bc){return db['CmList']['find']({'where':{'id':_0x2a9299['params']['id']}})[_0x71ff('0x25')](handleEntityNotFound(_0x48c917,null))[_0x71ff('0x25')](function(_0x57287b){if(_0x57287b){var _0x13c0f3=[];var _0x3feb76={'success':[],'errors':[]};return db['CmContact'][_0x71ff('0x54')]()['then'](function(_0x22822a){if(_0x2a9299['body'][_0x71ff('0x5c')]&&_['isArray'](_0x2a9299[_0x71ff('0x53')][_0x71ff('0x5c')])){if(_0x2a9299[_0x71ff('0x53')][_0x71ff('0x5c')][_0x71ff('0x39')]){_0x2a9299[_0x71ff('0x53')]['tags']=_0x2a9299[_0x71ff('0x53')]['tags']['join'](';')+';';}else{_0x2a9299[_0x71ff('0x53')][_0x71ff('0x5c')]=null;}}else{_0x2a9299[_0x71ff('0x53')][_0x71ff('0x5c')]=null;}if(_0x2a9299[_0x71ff('0x53')]&&_[_0x71ff('0x5d')](_0x2a9299[_0x71ff('0x53')])){for(var _0xba695d=0x0;_0xba695d<_0x2a9299['body'][_0x71ff('0x39')];_0xba695d+=0x1){_0x2a9299['body'][_0xba695d][_0x71ff('0x55')]=_0x2a9299[_0x71ff('0x47')]['id'];_0x13c0f3['push'](_0x2a9299['body'][_0xba695d]);}return BPromise[_0x71ff('0x5e')](_0x13c0f3,function(_0x5cfaeb){return db[_0x71ff('0x5f')][_0x71ff('0x4c')](_[_0x71ff('0x60')](_0x5cfaeb,[_0x71ff('0x5a'),'id'])||{},{'fields':_['keys'](_0x22822a),'raw':!![]})[_0x71ff('0x25')](function(_0xac050e){_0x3feb76[_0x71ff('0x61')]['push'](_0xac050e[_0x71ff('0x62')]);})[_0x71ff('0x45')](function(_0x24edb4){_0x3feb76[_0x71ff('0x63')][_0x71ff('0x64')]({'data':_0x5cfaeb,'error':_0x24edb4['message']});});})[_0x71ff('0x25')](function(_0x1a9798){return _0x3feb76;})[_0x71ff('0x45')](function(_0x189afc){return _0x189afc;});}else{_0x48c917[_0x71ff('0x1c')](0x190)[_0x71ff('0x21')]({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0x48c917,null))[_0x71ff('0x45')](handleError(_0x48c917,null));};exports[_0x71ff('0x65')]=function(_0x15c7b5,_0x372e72,_0x3fc419){var _0x3f5ae1;return db['CmList'][_0x71ff('0x4b')]({'where':{'id':_0x15c7b5[_0x71ff('0x47')]['id']},'include':[{'model':db[_0x71ff('0x66')],'as':_0x71ff('0x67')}]})['then'](handleEntityNotFound(_0x372e72,null))['then'](function(_0x41fce3){if(_0x41fce3){_0x3f5ae1=_0x41fce3;return db['CmContact'][_0x71ff('0x49')];}})['then'](function(_0x40e4aa){if(_0x40e4aa){var _0x546aa6={};var _0x3ff165={};_0x3ff165[_0x71ff('0x32')]=_[_0x71ff('0x68')](_[_0x71ff('0x48')](_0x40e4aa),_[_0x71ff('0x33')](_0x3f5ae1[_0x71ff('0x67')],function(_0x48c539){return util['format'](_0x71ff('0x69'),_0x48c539['id']);}));_0x3ff165[_0x71ff('0x34')]=_[_0x71ff('0x48')](_0x15c7b5[_0x71ff('0x34')]);_0x3ff165[_0x71ff('0x35')]=_['intersection'](_0x3ff165['model'],_0x3ff165['query']);_0x546aa6[_0x71ff('0x38')]=_[_0x71ff('0x36')](_0x3ff165[_0x71ff('0x32')],qs[_0x71ff('0x37')](_0x15c7b5[_0x71ff('0x34')][_0x71ff('0x37')]));_0x546aa6[_0x71ff('0x38')]=_0x546aa6[_0x71ff('0x38')]['length']?_0x546aa6['attributes']:_0x3ff165[_0x71ff('0x32')];if(!_0x15c7b5['query']['hasOwnProperty'](_0x71ff('0x6a'))){_0x546aa6[_0x71ff('0x1f')]=qs[_0x71ff('0x1f')](_0x15c7b5['query'][_0x71ff('0x1f')]);_0x546aa6[_0x71ff('0x1e')]=qs[_0x71ff('0x1e')](_0x15c7b5[_0x71ff('0x34')][_0x71ff('0x1e')]);}_0x546aa6[_0x71ff('0x6b')]=qs['sort'](_0x15c7b5['query'][_0x71ff('0x3b')]);_0x546aa6[_0x71ff('0x3e')]=qs['filters'](_[_0x71ff('0x3c')](_0x15c7b5[_0x71ff('0x34')],_0x3ff165[_0x71ff('0x35')]));_0x546aa6[_0x71ff('0x6c')]=!![];if(_0x15c7b5[_0x71ff('0x34')][_0x71ff('0x3d')]){_0x546aa6[_0x71ff('0x3e')]=_[_0x71ff('0x3f')](_0x546aa6['where'],{'$or':_[_0x71ff('0x33')](_0x546aa6[_0x71ff('0x38')],function(_0x520540){var _0x5bf46a={};_0x5bf46a[_0x520540]={'$like':'%'+_0x15c7b5['query'][_0x71ff('0x3d')]+'%'};return _0x5bf46a;})});}_0x546aa6=_[_0x71ff('0x3f')]({},_0x546aa6,_0x15c7b5[_0x71ff('0x41')]);return _0x3f5ae1[_0x71ff('0x65')](_0x546aa6);}})[_0x71ff('0x25')](respondWithResult(_0x372e72,null))[_0x71ff('0x45')](handleError(_0x372e72,null));};exports[_0x71ff('0x6d')]=function(_0x300718,_0x41c11b,_0x4a883c){var _0x54a7cc;return db['CmList'][_0x71ff('0x4b')]({'where':{'id':_0x300718[_0x71ff('0x47')]['id']},'include':[{'model':db[_0x71ff('0x66')],'as':_0x71ff('0x67')}]})[_0x71ff('0x25')](handleEntityNotFound(_0x41c11b,null))['then'](function(_0x39ee1a){if(_0x39ee1a){_0x54a7cc=_0x39ee1a;return db['CmContact']['rawAttributes'];}})[_0x71ff('0x25')](function(_0x24e279){if(_0x24e279){var _0x46271c={};var _0x2c27bb={};_0x2c27bb['model']=_['concat'](_[_0x71ff('0x48')](_0x24e279),_[_0x71ff('0x33')](_0x54a7cc[_0x71ff('0x67')],function(_0x49217c){return util[_0x71ff('0x6e')](_0x71ff('0x69'),_0x49217c['id']);}));_0x2c27bb[_0x71ff('0x34')]=_[_0x71ff('0x48')](_0x300718[_0x71ff('0x34')]);_0x2c27bb[_0x71ff('0x35')]=_['intersection'](_0x2c27bb[_0x71ff('0x32')],_0x2c27bb[_0x71ff('0x34')]);_0x46271c[_0x71ff('0x38')]=_[_0x71ff('0x36')](_0x2c27bb[_0x71ff('0x32')],qs['fields'](_0x300718[_0x71ff('0x34')]['fields']));_0x46271c['attributes']=_0x46271c['attributes'][_0x71ff('0x39')]?_0x46271c['attributes']:_0x2c27bb[_0x71ff('0x32')];if(!_0x300718[_0x71ff('0x34')]['hasOwnProperty'](_0x71ff('0x6a'))){_0x46271c[_0x71ff('0x1f')]=qs[_0x71ff('0x1f')](_0x300718[_0x71ff('0x34')][_0x71ff('0x1f')]);_0x46271c[_0x71ff('0x1e')]=qs[_0x71ff('0x1e')](_0x300718[_0x71ff('0x34')][_0x71ff('0x1e')]);}_0x46271c[_0x71ff('0x6b')]=qs[_0x71ff('0x3b')](_0x300718[_0x71ff('0x34')][_0x71ff('0x3b')]);_0x46271c['where']=qs[_0x71ff('0x35')](_[_0x71ff('0x3c')](_0x300718[_0x71ff('0x34')],_0x2c27bb[_0x71ff('0x35')]));_0x46271c['raw']=!![];if(_0x300718[_0x71ff('0x34')][_0x71ff('0x3d')]){_0x46271c['where']=_['merge'](_0x46271c[_0x71ff('0x3e')],{'$or':_['map'](_0x46271c[_0x71ff('0x38')],function(_0x264639){var _0x5d70e3={};_0x5d70e3[_0x264639]={'$like':'%'+_0x300718['query'][_0x71ff('0x3d')]+'%'};return _0x5d70e3;})});}_0x46271c=_['merge']({},_0x46271c,_0x300718[_0x71ff('0x41')]);return _0x54a7cc['getContacts'](_0x46271c);}})[_0x71ff('0x25')](function(_0x781ad7){if(!_[_0x71ff('0x6f')](_0x781ad7)){var _0x13fffa=toCsv(_0x781ad7);var _0x1356ef=Date[_0x71ff('0x70')]();fs[_0x71ff('0x71')](util[_0x71ff('0x6e')](_0x71ff('0x72'),_0x54a7cc['id'],_0x1356ef),_0x13fffa);_0x41c11b[_0x71ff('0x73')](_0x71ff('0x74'),_0x71ff('0x75')+util[_0x71ff('0x6e')](_0x71ff('0x76'),_0x54a7cc['id'],_0x1356ef));_0x41c11b[_0x71ff('0x73')](_0x71ff('0x77'),_0x71ff('0x78'));return _0x41c11b[_0x71ff('0x79')](util[_0x71ff('0x6e')](_0x71ff('0x72'),_0x54a7cc['id'],_0x1356ef));}else{return _0x41c11b['sendStatus'](0xcc);}})[_0x71ff('0x45')](handleError(_0x41c11b,null));};exports[_0x71ff('0x7a')]=function(_0x42c62c,_0x3955a3,_0x5e5eb3){var _0xc1d2d3;delete _0x42c62c[_0x71ff('0x53')]['id'];return db[_0x71ff('0x2f')][_0x71ff('0x57')]({'where':{'id':_0x42c62c[_0x71ff('0x47')]['id']}})[_0x71ff('0x25')](handleEntityNotFound(_0x3955a3,null))['then'](function(_0x37f638){if(_0x37f638){return db[_0x71ff('0x7b')][_0x71ff('0x7c')](function(_0x4c50b1){return db['CmCustomField'][_0x71ff('0x4c')](_0x42c62c[_0x71ff('0x53')],{'transaction':_0x4c50b1})[_0x71ff('0x25')](function(_0x5e50b8){_0xc1d2d3=_0x5e50b8;return _0x37f638[_0x71ff('0x7d')](_0x5e50b8,{'transaction':_0x4c50b1});})[_0x71ff('0x25')](function(){var _0x17cee7={'type':db['Sequelize'][_0x71ff('0x7e')],'transaction':_0x4c50b1};switch(_0x42c62c[_0x71ff('0x53')][_0x71ff('0x30')]){case _0x71ff('0x7f'):_0x17cee7[_0x71ff('0x30')]=db[_0x71ff('0x80')][_0x71ff('0x7e')];break;case _0x71ff('0x81'):_0x17cee7[_0x71ff('0x30')]=db[_0x71ff('0x80')][_0x71ff('0x82')];break;case _0x71ff('0x83'):_0x17cee7[_0x71ff('0x30')]=db['Sequelize']['BOOLEAN'];_0x17cee7[_0x71ff('0x84')]=![];break;default:}return db[_0x71ff('0x7b')][_0x71ff('0x85')][_0x71ff('0x86')](_0x71ff('0x87'),util[_0x71ff('0x6e')](_0x71ff('0x88'),_0xc1d2d3['id']),_0x17cee7);})[_0x71ff('0x25')](function(){return _0xc1d2d3;});});}})[_0x71ff('0x25')](respondWithResult(_0x3955a3,null))[_0x71ff('0x45')](handleError(_0x3955a3,null));};exports[_0x71ff('0x89')]=function(_0x8a6d10,_0x3235e4,_0x161273){var _0x3b2711={};var _0x1fc8c2={};var _0x376a66;var _0x8a997b;return db[_0x71ff('0x2f')]['findOne']({'where':{'id':_0x8a6d10[_0x71ff('0x47')]['id']}})[_0x71ff('0x25')](handleEntityNotFound(_0x3235e4,null))['then'](function(_0x138af6){if(_0x138af6){_0x376a66=_0x138af6;_0x1fc8c2[_0x71ff('0x32')]=_[_0x71ff('0x48')](db[_0x71ff('0x66')]['rawAttributes']);_0x1fc8c2[_0x71ff('0x34')]=_[_0x71ff('0x48')](_0x8a6d10[_0x71ff('0x34')]);_0x1fc8c2['filters']=_['intersection'](_0x1fc8c2[_0x71ff('0x32')],_0x1fc8c2[_0x71ff('0x34')]);_0x3b2711[_0x71ff('0x38')]=_[_0x71ff('0x36')](_0x1fc8c2[_0x71ff('0x32')],qs['fields'](_0x8a6d10[_0x71ff('0x34')][_0x71ff('0x37')]));_0x3b2711[_0x71ff('0x38')]=_0x3b2711[_0x71ff('0x38')][_0x71ff('0x39')]?_0x3b2711[_0x71ff('0x38')]:_0x1fc8c2[_0x71ff('0x32')];_0x3b2711['order']=qs[_0x71ff('0x3b')](_0x8a6d10[_0x71ff('0x34')]['sort']);_0x3b2711['where']=qs[_0x71ff('0x35')](_['pick'](_0x8a6d10[_0x71ff('0x34')],_0x1fc8c2[_0x71ff('0x35')]));_0x3b2711[_0x71ff('0x3e')]=_[_0x71ff('0x3f')](_0x3b2711[_0x71ff('0x3e')],{'$or':[{'ListId':_0x138af6['id']},{'ListId':null}]});if(_0x8a6d10[_0x71ff('0x34')]['filter']){_0x3b2711['where']=_[_0x71ff('0x3f')](_0x3b2711[_0x71ff('0x3e')],{'$or':_[_0x71ff('0x33')](_0x3b2711['attributes'],function(_0x893e48){var _0x7dcac9={};_0x7dcac9[_0x893e48]={'$like':'%'+_0x8a6d10[_0x71ff('0x34')][_0x71ff('0x3d')]+'%'};return _0x7dcac9;})});}_0x3b2711=_[_0x71ff('0x3f')]({},_0x3b2711,_0x8a6d10['options']);return db[_0x71ff('0x66')][_0x71ff('0x8a')](_0x3b2711);}})[_0x71ff('0x25')](respondWithResult(_0x3235e4,null))[_0x71ff('0x45')](handleError(_0x3235e4,null));};exports['addAgents']=function(_0x353472,_0x2b6e9d,_0x12c8a1){return db[_0x71ff('0x2f')][_0x71ff('0x4b')]({'where':{'id':_0x353472['params']['id']}})['then'](handleEntityNotFound(_0x2b6e9d,null))[_0x71ff('0x25')](function(_0x1b244f){if(_0x1b244f){return _0x1b244f[_0x71ff('0x8b')](_0x353472[_0x71ff('0x53')][_0x71ff('0x5a')],_[_0x71ff('0x60')](_0x353472[_0x71ff('0x53')],[_0x71ff('0x5a'),'id'])||{})[_0x71ff('0x8c')](function(_0x4f4ca7){for(var _0xa2ed14=0x0;_0xa2ed14<_0x353472[_0x71ff('0x53')][_0x71ff('0x5a')]['length'];_0xa2ed14+=0x1){socket['emit'](_0x71ff('0x8d'),{'UserId':_0x353472[_0x71ff('0x53')][_0x71ff('0x5a')][_0xa2ed14],'CmListId':_0x353472[_0x71ff('0x47')]['id']});}return _0x4f4ca7;});}})[_0x71ff('0x25')](respondWithResult(_0x2b6e9d,null))['catch'](handleError(_0x2b6e9d,null));};exports['removeAgents']=function(_0x53726f,_0x2773b5,_0x45c92e){return db[_0x71ff('0x2f')][_0x71ff('0x4b')]({'where':{'id':_0x53726f['params']['id']}})['then'](handleEntityNotFound(_0x2773b5,null))[_0x71ff('0x25')](function(_0xb2cb64){if(_0xb2cb64){return _0xb2cb64[_0x71ff('0x8e')](_0x53726f[_0x71ff('0x34')]['ids'])[_0x71ff('0x25')](function(){if(_['isArray'](_0x53726f[_0x71ff('0x34')][_0x71ff('0x5a')])){for(var _0xe6ae78=0x0;_0xe6ae78<_0x53726f[_0x71ff('0x34')][_0x71ff('0x5a')][_0x71ff('0x39')];_0xe6ae78+=0x1){socket[_0x71ff('0x8f')](_0x71ff('0x90'),{'UserId':Number(_0x53726f[_0x71ff('0x34')][_0x71ff('0x5a')][_0xe6ae78]),'CmListId':Number(_0x53726f[_0x71ff('0x47')]['id'])});}}else{socket['emit'](_0x71ff('0x90'),{'UserId':Number(_0x53726f[_0x71ff('0x34')][_0x71ff('0x5a')]),'CmListId':Number(_0x53726f[_0x71ff('0x47')]['id'])});}});}})[_0x71ff('0x25')](respondWithStatusCode(_0x2773b5,null))[_0x71ff('0x45')](handleError(_0x2773b5,null));};exports['getAgents']=function(_0x3d16f1,_0x2213cb,_0x2862b0){var _0x59454f={};var _0x5a67d6={};var _0x4e7184;var _0x3bb73c;return db['CmList'][_0x71ff('0x57')]({'where':{'id':_0x3d16f1[_0x71ff('0x47')]['id']}})[_0x71ff('0x25')](handleEntityNotFound(_0x2213cb,null))[_0x71ff('0x25')](function(_0x2360da){if(_0x2360da){_0x4e7184=_0x2360da;_0x5a67d6[_0x71ff('0x32')]=_[_0x71ff('0x48')](db['User'][_0x71ff('0x49')]);_0x5a67d6[_0x71ff('0x34')]=_['keys'](_0x3d16f1[_0x71ff('0x34')]);_0x5a67d6[_0x71ff('0x35')]=_[_0x71ff('0x36')](_0x5a67d6['model'],_0x5a67d6[_0x71ff('0x34')]);_0x59454f[_0x71ff('0x38')]=_[_0x71ff('0x36')](_0x5a67d6[_0x71ff('0x32')],qs[_0x71ff('0x37')](_0x3d16f1[_0x71ff('0x34')][_0x71ff('0x37')]));_0x59454f[_0x71ff('0x38')]=_0x59454f['attributes']['length']?_0x59454f[_0x71ff('0x38')]:_0x5a67d6['model'];_0x59454f[_0x71ff('0x6b')]=qs[_0x71ff('0x3b')](_0x3d16f1['query']['sort']);_0x59454f[_0x71ff('0x3e')]=qs[_0x71ff('0x35')](_[_0x71ff('0x3c')](_0x3d16f1[_0x71ff('0x34')],_0x5a67d6['filters']));if(_0x3d16f1[_0x71ff('0x34')][_0x71ff('0x3d')]){_0x59454f['where']=_[_0x71ff('0x3f')](_0x59454f[_0x71ff('0x3e')],{'$or':_[_0x71ff('0x33')](_0x59454f[_0x71ff('0x38')],function(_0x3b557b){var _0x517639={};_0x517639[_0x3b557b]={'$like':'%'+_0x3d16f1[_0x71ff('0x34')][_0x71ff('0x3d')]+'%'};return _0x517639;})});}_0x59454f=_[_0x71ff('0x3f')]({},_0x59454f,_0x3d16f1[_0x71ff('0x41')]);return _0x4e7184['getAgents'](_0x59454f);}})[_0x71ff('0x25')](function(_0x456a0c){if(_0x456a0c){_0x3bb73c=_0x456a0c[_0x71ff('0x39')];if(!_0x3d16f1['query']['hasOwnProperty']('nolimit')){_0x59454f[_0x71ff('0x1f')]=qs['limit'](_0x3d16f1['query'][_0x71ff('0x1f')]);_0x59454f[_0x71ff('0x1e')]=qs[_0x71ff('0x1e')](_0x3d16f1[_0x71ff('0x34')][_0x71ff('0x1e')]);}return _0x4e7184[_0x71ff('0x91')](_0x59454f);}})[_0x71ff('0x25')](function(_0x22991f){if(_0x22991f){return _0x22991f?{'count':_0x3bb73c,'rows':_0x22991f}:null;}})[_0x71ff('0x25')](respondWithResult(_0x2213cb,null))[_0x71ff('0x45')](handleError(_0x2213cb,null));};
\ No newline at end of file
diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js
index 70382b0..1e91eb5 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 _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
+var _0x61f7=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList','save','update','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x61f7,0x11c));var _0x761f=function(_0x40d541,_0x353bc9){_0x40d541=_0x40d541-0x0;var _0x897b57=_0x61f7[_0x40d541];return _0x897b57;};'use strict';var EventEmitter=require(_0x761f('0x0'));var CmList=require(_0x761f('0x1'))['db'][_0x761f('0x2')];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x761f('0x3'),'afterUpdate':_0x761f('0x4'),'afterDestroy':_0x761f('0x5')};function emitEvent(_0x1587a2){return function(_0xf494b0,_0x30b89b,_0x31b1a0){CmListEvents[_0x761f('0x6')](_0x1587a2+':'+_0xf494b0['id'],_0xf494b0);CmListEvents[_0x761f('0x6')](_0x1587a2,_0xf494b0);_0x31b1a0(null);};}for(var e in events){if(events[_0x761f('0x7')](e)){var event=events[e];CmList[_0x761f('0x8')](e,emitEvent(event));}}module[_0x761f('0x9')]=CmListEvents;
\ No newline at end of file
diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js
index 8f47da0..a90d655 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 _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
+var _0x5cc9=['exports','define','cm_lists','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./cmList.attributes'];(function(_0xaad33,_0x34a032){var _0x4847f3=function(_0x256af9){while(--_0x256af9){_0xaad33['push'](_0xaad33['shift']());}};_0x4847f3(++_0x34a032);}(_0x5cc9,0x13b));var _0x95cc=function(_0xa763e4,_0x4fcd7a){_0xa763e4=_0xa763e4-0x0;var _0x4e75c8=_0x5cc9[_0xa763e4];return _0x4e75c8;};'use strict';var _=require(_0x95cc('0x0'));var util=require(_0x95cc('0x1'));var logger=require(_0x95cc('0x2'))(_0x95cc('0x3'));var moment=require(_0x95cc('0x4'));var BPromise=require(_0x95cc('0x5'));var rp=require(_0x95cc('0x6'));var fs=require('fs');var path=require(_0x95cc('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x95cc('0x8'));module[_0x95cc('0x9')]=function(_0x387fca,_0x15ac49){return _0x387fca[_0x95cc('0xa')]('CmList',attributes,{'tableName':_0x95cc('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 b37d0a7..482e9dc 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 _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
+var _0xfc8c=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','request','info','request\x20sent','debug','stringify','error','code','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xfc8c,0x6b));var _0xcfc8=function(_0xdd9f41,_0x23cdfa){_0xdd9f41=_0xdd9f41-0x0;var _0xa6425c=_0xfc8c[_0xdd9f41];return _0xa6425c;};'use strict';var _=require(_0xcfc8('0x0'));var util=require(_0xcfc8('0x1'));var moment=require(_0xcfc8('0x2'));var BPromise=require(_0xcfc8('0x3'));var rs=require(_0xcfc8('0x4'));var fs=require('fs');var Redis=require(_0xcfc8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcfc8('0x6'));var logger=require(_0xcfc8('0x7'))(_0xcfc8('0x8'));var config=require(_0xcfc8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcfc8('0xa')]({'port':0x232a});config['redis']=_[_0xcfc8('0xb')](config[_0xcfc8('0xc')],{'host':_0xcfc8('0xd'),'port':0x18eb});var socket=require(_0xcfc8('0xe'))(new Redis(config[_0xcfc8('0xc')]));require(_0xcfc8('0xf'))[_0xcfc8('0x10')](socket);function respondWithRpcPromise(_0x17f0e9,_0x3a4156,_0x273d){return new BPromise(function(_0x5c7d50,_0x43c32c){return client[_0xcfc8('0x11')](_0x17f0e9,_0x273d)['then'](function(_0x1d120c){logger[_0xcfc8('0x12')]('CmList,\x20%s,\x20%s',_0x3a4156,_0xcfc8('0x13'));logger[_0xcfc8('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x3a4156,_0xcfc8('0x13'),JSON[_0xcfc8('0x15')](_0x1d120c));if(_0x1d120c[_0xcfc8('0x16')]){if(_0x1d120c[_0xcfc8('0x16')][_0xcfc8('0x17')]===0x1f4){logger[_0xcfc8('0x16')](_0xcfc8('0x18'),_0x3a4156,_0x1d120c['error'][_0xcfc8('0x19')]);return _0x43c32c(_0x1d120c[_0xcfc8('0x16')]['message']);}logger[_0xcfc8('0x16')](_0xcfc8('0x18'),_0x3a4156,_0x1d120c[_0xcfc8('0x16')][_0xcfc8('0x19')]);return _0x5c7d50(_0x1d120c[_0xcfc8('0x16')]['message']);}else{logger['info']('CmList,\x20%s,\x20%s',_0x3a4156,_0xcfc8('0x13'));_0x5c7d50(_0x1d120c[_0xcfc8('0x1a')][_0xcfc8('0x19')]);}})[_0xcfc8('0x1b')](function(_0x3ea9e5){logger[_0xcfc8('0x16')](_0xcfc8('0x18'),_0x3a4156,_0x3ea9e5);_0x43c32c(_0x3ea9e5);});});}
\ No newline at end of file
diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js
index 9af537d..44cba41 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 _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
+var _0x36b2=['save','remove','register','length','cmList:','./cmList.events'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x36b2,0x6b));var _0x236b=function(_0x25baf0,_0x4d945b){_0x25baf0=_0x25baf0-0x0;var _0xe0f91a=_0x36b2[_0x25baf0];return _0xe0f91a;};'use strict';var CmListEvents=require(_0x236b('0x0'));var events=[_0x236b('0x1'),_0x236b('0x2'),'update'];function createListener(_0x17977e,_0x2aa6b5){return function(_0x45d0d4){_0x2aa6b5['emit'](_0x17977e,_0x45d0d4);};}function removeListener(_0x1dc22b,_0x1a135b){return function(){CmListEvents['removeListener'](_0x1dc22b,_0x1a135b);};}exports[_0x236b('0x3')]=function(_0x27c095){for(var _0x37867a=0x0,_0x9e1345=events[_0x236b('0x4')];_0x37867a<_0x9e1345;_0x37867a++){var _0x2ff02e=events[_0x37867a];var _0x52b043=createListener(_0x236b('0x5')+_0x2ff02e,_0x27c095);CmListEvents['on'](_0x2ff02e,_0x52b043);}};
\ No newline at end of file
diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js
index 5d9f652..67e9fc8 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 _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
+var _0xaa90=['show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','addAgents','update','delete','destroy','removeAgents','exports','multer','path','connect-timeout','Router','../../components/auth/service','./cmList.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x404604,_0x1d2a24){var _0x51f897=function(_0x3eee27){while(--_0x3eee27){_0x404604['push'](_0x404604['shift']());}};_0x51f897(++_0x1d2a24);}(_0xaa90,0xce));var _0x0aa9=function(_0x3d68e4,_0x39c820){_0x3d68e4=_0x3d68e4-0x0;var _0x3f4f5d=_0xaa90[_0x3d68e4];return _0x3f4f5d;};'use strict';var multer=require(_0x0aa9('0x0'));var util=require('util');var path=require(_0x0aa9('0x1'));var timeout=require(_0x0aa9('0x2'));var express=require('express');var router=express[_0x0aa9('0x3')]();var auth=require(_0x0aa9('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0aa9('0x5'));router[_0x0aa9('0x6')]('/',auth[_0x0aa9('0x7')](),controller[_0x0aa9('0x8')]);router[_0x0aa9('0x6')]('/describe',auth[_0x0aa9('0x7')](),controller[_0x0aa9('0x9')]);router[_0x0aa9('0x6')](_0x0aa9('0xa'),auth['isAuthenticated'](),controller[_0x0aa9('0xb')]);router['get'](_0x0aa9('0xc'),auth[_0x0aa9('0x7')](),controller['getDispositions']);router[_0x0aa9('0x6')](_0x0aa9('0xd'),auth[_0x0aa9('0x7')](),controller[_0x0aa9('0xe')]);router[_0x0aa9('0x6')](_0x0aa9('0xf'),auth[_0x0aa9('0x7')](),controller['getContactsCsv']);router['get'](_0x0aa9('0x10'),auth[_0x0aa9('0x7')](),controller[_0x0aa9('0x11')]);router[_0x0aa9('0x6')](_0x0aa9('0x12'),auth[_0x0aa9('0x7')](),controller[_0x0aa9('0x13')]);router[_0x0aa9('0x14')]('/',auth['isAuthenticated'](),controller[_0x0aa9('0x15')]);router[_0x0aa9('0x14')](_0x0aa9('0xc'),auth['isAuthenticated'](),controller[_0x0aa9('0x16')]);router[_0x0aa9('0x14')](_0x0aa9('0xd'),auth[_0x0aa9('0x7')](),controller[_0x0aa9('0x17')]);router['post']('/:id/fields',auth['isAuthenticated'](),controller[_0x0aa9('0x18')]);router[_0x0aa9('0x14')](_0x0aa9('0x12'),auth[_0x0aa9('0x7')](),controller[_0x0aa9('0x19')]);router['put'](_0x0aa9('0xa'),auth[_0x0aa9('0x7')](),controller[_0x0aa9('0x1a')]);router[_0x0aa9('0x1b')](_0x0aa9('0xa'),auth[_0x0aa9('0x7')](),controller[_0x0aa9('0x1c')]);router[_0x0aa9('0x1b')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x0aa9('0x1b')](_0x0aa9('0x12'),auth[_0x0aa9('0x7')](),controller[_0x0aa9('0x1d')]);module[_0x0aa9('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js
index 0ff8d87..8927029 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(_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
+var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x1af9a5,_0x2f954d){var _0x1d1dac=function(_0x5afc27){while(--_0x5afc27){_0x1af9a5['push'](_0x1af9a5['shift']());}};_0x1d1dac(++_0x2f954d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 f709c6f..48e4346 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 _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
+var _0xf3b1=['find','params','catch','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','save','then','destroy','error','stack','name','send','update','body','Condition'];(function(_0x38dcfe,_0x1b9f72){var _0x1964d8=function(_0x7225a2){while(--_0x7225a2){_0x38dcfe['push'](_0x38dcfe['shift']());}};_0x1964d8(++_0x1b9f72);}(_0xf3b1,0x1b1));var _0x1f3b=function(_0x14b201,_0x1f9e39){_0x14b201=_0x14b201-0x0;var _0x84949c=_0xf3b1[_0x14b201];return _0x84949c;};'use strict';var pdf=require(_0x1f3b('0x0'));var emlformat=require(_0x1f3b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1f3b('0x2'));var jsonpatch=require(_0x1f3b('0x3'));var rp=require('request-promise');var moment=require(_0x1f3b('0x4'));var BPromise=require(_0x1f3b('0x5'));var Mustache=require(_0x1f3b('0x6'));var util=require('util');var path=require(_0x1f3b('0x7'));var sox=require(_0x1f3b('0x8'));var csv=require('to-csv');var ejs=require(_0x1f3b('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1f3b('0xa'));var crypto=require('crypto');var jsforce=require(_0x1f3b('0xb'));var deskjs=require(_0x1f3b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1f3b('0xd'));var Papa=require('papaparse');var Redis=require(_0x1f3b('0xe'));var authService=require(_0x1f3b('0xf'));var qs=require(_0x1f3b('0x10'));var as=require(_0x1f3b('0x11'));var hardwareService=require(_0x1f3b('0x12'));var logger=require('../../config/logger')(_0x1f3b('0x13'));var utils=require('../../config/utils');var config=require(_0x1f3b('0x14'));var db=require(_0x1f3b('0x15'))['db'];function respondWithStatusCode(_0x4db1cd,_0x1c1058){_0x1c1058=_0x1c1058||0xcc;return function(_0x7aed35){if(_0x7aed35){return _0x4db1cd[_0x1f3b('0x16')](_0x1c1058);}return _0x4db1cd[_0x1f3b('0x17')](_0x1c1058)[_0x1f3b('0x18')]();};}function respondWithResult(_0x52b869,_0x4a25ea){_0x4a25ea=_0x4a25ea||0xc8;return function(_0x38fc33){if(_0x38fc33){return _0x52b869[_0x1f3b('0x17')](_0x4a25ea)[_0x1f3b('0x19')](_0x38fc33);}};}function respondWithFilteredResult(_0x53b530,_0x3b5a4f){return function(_0x5ca321){if(_0x5ca321){var _0x2ea6c3=_0x5ca321[_0x1f3b('0x1a')],_0x1c6e92=_0x3b5a4f['offset'],_0x5b0386=_0x3b5a4f[_0x1f3b('0x1b')]+_0x3b5a4f['limit'],_0x3f28ce;if(_0x5b0386>=_0x2ea6c3){_0x5b0386=_0x2ea6c3;_0x3f28ce=0xc8;}else{_0x3f28ce=0xce;}_0x53b530[_0x1f3b('0x17')](_0x3f28ce);return _0x53b530[_0x1f3b('0x1c')]('Content-Range',_0x1c6e92+'-'+_0x5b0386+'/'+_0x2ea6c3)[_0x1f3b('0x19')](_0x5ca321);}return null;};}function patchUpdates(_0x55feb5){return function(_0x1ac28c){try{jsonpatch[_0x1f3b('0x1d')](_0x1ac28c,_0x55feb5,!![]);}catch(_0x2a27df){return BPromise['reject'](_0x2a27df);}return _0x1ac28c[_0x1f3b('0x1e')]();};}function saveUpdates(_0x54df4f,_0x5bf4e0){return function(_0x1314a){if(_0x1314a){return _0x1314a['update'](_0x54df4f)[_0x1f3b('0x1f')](function(_0x5bd8e8){return _0x5bd8e8;});}return null;};}function removeEntity(_0x2fc74d,_0x29dc9e){return function(_0x53a657){if(_0x53a657){return _0x53a657[_0x1f3b('0x20')]()[_0x1f3b('0x1f')](function(){_0x2fc74d[_0x1f3b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x585384,_0x280063){return function(_0x469f21){if(!_0x469f21){_0x585384[_0x1f3b('0x16')](0x194);}return _0x469f21;};}function handleError(_0x4ef439,_0x26aefa){_0x26aefa=_0x26aefa||0x1f4;return function(_0x4abf8c){logger[_0x1f3b('0x21')](_0x4abf8c[_0x1f3b('0x22')]);if(_0x4abf8c[_0x1f3b('0x23')]){delete _0x4abf8c[_0x1f3b('0x23')];}_0x4ef439['status'](_0x26aefa)[_0x1f3b('0x24')](_0x4abf8c);};}exports[_0x1f3b('0x25')]=function(_0x4b398b,_0x5f5b46){if(_0x4b398b[_0x1f3b('0x26')]['id']){delete _0x4b398b[_0x1f3b('0x26')]['id'];}return db[_0x1f3b('0x27')][_0x1f3b('0x28')]({'where':{'id':_0x4b398b[_0x1f3b('0x29')]['id']}})[_0x1f3b('0x1f')](handleEntityNotFound(_0x5f5b46,null))[_0x1f3b('0x1f')](saveUpdates(_0x4b398b[_0x1f3b('0x26')],null))[_0x1f3b('0x1f')](respondWithResult(_0x5f5b46,null))[_0x1f3b('0x2a')](handleError(_0x5f5b46,null));};exports['destroy']=function(_0x27e83e,_0x52bed3){return db['Condition'][_0x1f3b('0x28')]({'where':{'id':_0x27e83e[_0x1f3b('0x29')]['id']}})[_0x1f3b('0x1f')](handleEntityNotFound(_0x52bed3,null))['then'](removeEntity(_0x52bed3,null))[_0x1f3b('0x2a')](handleError(_0x52bed3,null));};
\ No newline at end of file
diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js
index 9b8d1b6..2882dcb 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 _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
+var _0x7c74=['request-promise','path','rimraf','../../config/environment','exports','Condition','tools_conditions','util','moment','bluebird'];(function(_0x4e346a,_0x1ba060){var _0x12ac3a=function(_0xbf09f5){while(--_0xbf09f5){_0x4e346a['push'](_0x4e346a['shift']());}};_0x12ac3a(++_0x1ba060);}(_0x7c74,0x165));var _0x47c7=function(_0x54f322,_0x24a660){_0x54f322=_0x54f322-0x0;var _0xb0a1d5=_0x7c74[_0x54f322];return _0xb0a1d5;};'use strict';var _=require('lodash');var util=require(_0x47c7('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x47c7('0x1'));var BPromise=require(_0x47c7('0x2'));var rp=require(_0x47c7('0x3'));var fs=require('fs');var path=require(_0x47c7('0x4'));var rimraf=require(_0x47c7('0x5'));var config=require(_0x47c7('0x6'));var attributes=require('./condition.attributes');module[_0x47c7('0x7')]=function(_0x145dd3,_0x25365b){return _0x145dd3['define'](_0x47c7('0x8'),attributes,{'tableName':_0x47c7('0x9'),'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 fca6ae2..67dc3d2 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 _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
+var _0x9fe3=['stringify','error','Condition,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','Condition,\x20%s,\x20%s,\x20%s'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9fe3,0x12b));var _0x39fe=function(_0x413727,_0x17adb1){_0x413727=_0x413727-0x0;var _0x5f46d7=_0x9fe3[_0x413727];return _0x5f46d7;};'use strict';var _=require(_0x39fe('0x0'));var util=require('util');var moment=require(_0x39fe('0x1'));var BPromise=require(_0x39fe('0x2'));var rs=require(_0x39fe('0x3'));var fs=require('fs');var Redis=require(_0x39fe('0x4'));var db=require(_0x39fe('0x5'))['db'];var utils=require(_0x39fe('0x6'));var logger=require(_0x39fe('0x7'))(_0x39fe('0x8'));var config=require(_0x39fe('0x9'));var jayson=require(_0x39fe('0xa'));var client=jayson[_0x39fe('0xb')][_0x39fe('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x427ce9,_0x4adc8b,_0x298335){return new BPromise(function(_0x517a32,_0xb9745a){return client[_0x39fe('0xd')](_0x427ce9,_0x298335)['then'](function(_0x4f2685){logger['info']('Condition,\x20%s,\x20%s',_0x4adc8b,_0x39fe('0xe'));logger['debug'](_0x39fe('0xf'),_0x4adc8b,_0x39fe('0xe'),JSON[_0x39fe('0x10')](_0x4f2685));if(_0x4f2685['error']){if(_0x4f2685['error']['code']===0x1f4){logger[_0x39fe('0x11')](_0x39fe('0x12'),_0x4adc8b,_0x4f2685[_0x39fe('0x11')][_0x39fe('0x13')]);return _0xb9745a(_0x4f2685[_0x39fe('0x11')][_0x39fe('0x13')]);}logger[_0x39fe('0x11')](_0x39fe('0x12'),_0x4adc8b,_0x4f2685['error'][_0x39fe('0x13')]);return _0x517a32(_0x4f2685['error']['message']);}else{logger['info']('Condition,\x20%s,\x20%s',_0x4adc8b,_0x39fe('0xe'));_0x517a32(_0x4f2685[_0x39fe('0x14')]['message']);}})['catch'](function(_0xf9888a){logger[_0x39fe('0x11')]('Condition,\x20%s,\x20%s',_0x4adc8b,_0xf9888a);_0xb9745a(_0xf9888a);});});}
\ No newline at end of file
diff --git a/server/api/condition/index.js b/server/api/condition/index.js
index 4168f61..5fc6300 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 _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
+var _0x3fe3=['put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./condition.controller'];(function(_0x3fe71b,_0x291d3f){var _0x546ccf=function(_0x116255){while(--_0x116255){_0x3fe71b['push'](_0x3fe71b['shift']());}};_0x546ccf(++_0x291d3f);}(_0x3fe3,0x1f0));var _0x33fe=function(_0x34c3bb,_0x3e7d16){_0x34c3bb=_0x34c3bb-0x0;var _0x1fbac4=_0x3fe3[_0x34c3bb];return _0x1fbac4;};'use strict';var multer=require(_0x33fe('0x0'));var util=require('util');var path=require(_0x33fe('0x1'));var timeout=require(_0x33fe('0x2'));var express=require(_0x33fe('0x3'));var router=express[_0x33fe('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x33fe('0x5'));var config=require(_0x33fe('0x6'));var controller=require(_0x33fe('0x7'));router[_0x33fe('0x8')](_0x33fe('0x9'),auth['isAuthenticated'](),controller[_0x33fe('0xa')]);router[_0x33fe('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x33fe('0xc')]);module[_0x33fe('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js
index e0576df..2617d97 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 _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
+var _0x9957=['exports','STRING','name','sequelize'];(function(_0x3aaae4,_0x5f3e6b){var _0x903d58=function(_0x9d8f8b){while(--_0x9d8f8b){_0x3aaae4['push'](_0x3aaae4['shift']());}};_0x903d58(++_0x5f3e6b);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![],'unique':_0x7995('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x7995('0x2')],'allowNull':!![]}};
\ No newline at end of file
diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js
index db6fe1a..d6d2d5f 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 _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
+var _0x00bb=['limit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','ContactItemTypes','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','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','get','UserProfileResource','error','stack','name','send','index','ContactItemType','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x1bbf32,_0x3b785a){var _0x1a58ae=function(_0x597a3d){while(--_0x597a3d){_0x1bbf32['push'](_0x1bbf32['shift']());}};_0x1a58ae(++_0x3b785a);}(_0x00bb,0x1d8));var _0xb00b=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x00bb[_0x550d12];return _0x12103d;};'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(){var _0x51b841=_0x4df284[_0xb00b('0x1f')]({'plain':!![]});var _0x2896d1='ContactItemTypes';return db[_0xb00b('0x20')][_0xb00b('0x1e')]({'where':{'type':_0x2896d1,'resourceId':_0x51b841['id']}})['then'](function(){return _0x4df284;});})[_0xb00b('0x1d')](function(){_0x56c189[_0xb00b('0x15')](0xcc)[_0xb00b('0x16')]();});}};}function handleEntityNotFound(_0x8caadf,_0x520e55){return function(_0x50be6c){if(!_0x50be6c){_0x8caadf[_0xb00b('0x14')](0x194);}return _0x50be6c;};}function handleError(_0x490380,_0x550587){_0x550587=_0x550587||0x1f4;return function(_0x4a635e){logger[_0xb00b('0x21')](_0x4a635e[_0xb00b('0x22')]);if(_0x4a635e[_0xb00b('0x23')]){delete _0x4a635e[_0xb00b('0x23')];}_0x490380[_0xb00b('0x15')](_0x550587)[_0xb00b('0x24')](_0x4a635e);};}exports[_0xb00b('0x25')]=function(_0x4a8d2b,_0x22c22d){var _0x503c9c={},_0x450129={},_0x348165={'count':0x0,'rows':[]};var _0x5424ca=_['map'](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x16fbd5){return{'name':_0x16fbd5[_0xb00b('0x28')],'type':_0x16fbd5[_0xb00b('0x29')][_0xb00b('0x2a')]};});_0x450129[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x5424ca,_0xb00b('0x23'));_0x450129['query']=_[_0xb00b('0x2d')](_0x4a8d2b[_0xb00b('0x2e')]);_0x450129['filters']=_[_0xb00b('0x2f')](_0x450129[_0xb00b('0x2b')],_0x450129['query']);_0x503c9c[_0xb00b('0x30')]=_['intersection'](_0x450129[_0xb00b('0x2b')],qs[_0xb00b('0x31')](_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x31')]));_0x503c9c[_0xb00b('0x30')]=_0x503c9c[_0xb00b('0x30')][_0xb00b('0x32')]?_0x503c9c['attributes']:_0x450129['model'];if(!_0x4a8d2b['query'][_0xb00b('0x33')](_0xb00b('0x34'))){_0x503c9c[_0xb00b('0x35')]=qs[_0xb00b('0x35')](_0x4a8d2b['query'][_0xb00b('0x35')]);_0x503c9c[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x19')]);}_0x503c9c[_0xb00b('0x36')]=qs[_0xb00b('0x37')](_0x4a8d2b[_0xb00b('0x2e')]['sort']);_0x503c9c['where']=qs[_0xb00b('0x38')](_['pick'](_0x4a8d2b[_0xb00b('0x2e')],_0x450129[_0xb00b('0x38')]),_0x5424ca);if(_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x39')]){_0x503c9c[_0xb00b('0x3a')]=_[_0xb00b('0x3b')](_0x503c9c[_0xb00b('0x3a')],{'$or':_['map'](_0x5424ca,function(_0x35f1ca){if(_0x35f1ca[_0xb00b('0x29')]!==_0xb00b('0x3c')){var _0xd9c03f={};_0xd9c03f[_0x35f1ca[_0xb00b('0x23')]]={'$like':'%'+_0x4a8d2b[_0xb00b('0x2e')]['filter']+'%'};return _0xd9c03f;}})});}_0x503c9c=_[_0xb00b('0x3b')]({},_0x503c9c,_0x4a8d2b[_0xb00b('0x3d')]);var _0x4801e7={'where':_0x503c9c[_0xb00b('0x3a')]};return db[_0xb00b('0x26')][_0xb00b('0x18')](_0x4801e7)[_0xb00b('0x1d')](function(_0x2954e8){_0x348165['count']=_0x2954e8;if(_0x4a8d2b[_0xb00b('0x2e')][_0xb00b('0x3e')]){_0x503c9c[_0xb00b('0x3f')]=[{'all':!![]}];}return db[_0xb00b('0x26')]['findAll'](_0x503c9c);})['then'](function(_0x43f834){_0x348165[_0xb00b('0x40')]=_0x43f834;return _0x348165;})[_0xb00b('0x1d')](respondWithFilteredResult(_0x22c22d,_0x503c9c))[_0xb00b('0x41')](handleError(_0x22c22d,null));};exports[_0xb00b('0x42')]=function(_0x26f17b,_0x275664){var _0x493841={'raw':!![],'where':{'id':_0x26f17b[_0xb00b('0x43')]['id']}},_0x36200d={};_0x36200d[_0xb00b('0x2b')]=_[_0xb00b('0x2d')](db[_0xb00b('0x26')][_0xb00b('0x27')]);_0x36200d[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x26f17b[_0xb00b('0x2e')]);_0x36200d[_0xb00b('0x38')]=_[_0xb00b('0x2f')](_0x36200d[_0xb00b('0x2b')],_0x36200d['query']);_0x493841[_0xb00b('0x30')]=_[_0xb00b('0x2f')](_0x36200d[_0xb00b('0x2b')],qs[_0xb00b('0x31')](_0x26f17b[_0xb00b('0x2e')][_0xb00b('0x31')]));_0x493841[_0xb00b('0x30')]=_0x493841[_0xb00b('0x30')][_0xb00b('0x32')]?_0x493841[_0xb00b('0x30')]:_0x36200d[_0xb00b('0x2b')];if(_0x26f17b[_0xb00b('0x2e')]['includeAll']){_0x493841['include']=[{'all':!![]}];}_0x493841=_['merge']({},_0x493841,_0x26f17b[_0xb00b('0x3d')]);return db[_0xb00b('0x26')]['find'](_0x493841)[_0xb00b('0x1d')](handleEntityNotFound(_0x275664,null))[_0xb00b('0x1d')](respondWithResult(_0x275664,null))[_0xb00b('0x41')](handleError(_0x275664,null));};exports[_0xb00b('0x44')]=function(_0x4b62b3,_0x58e9cb){return db[_0xb00b('0x26')][_0xb00b('0x44')](_0x4b62b3['body'],{})['then'](function(_0x154759){var _0x3a205d=_0x4b62b3['user'][_0xb00b('0x1f')]({'plain':!![]});if(!_0x3a205d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a205d['role']==='user'){var _0x465d90=_0x154759['get']({'plain':!![]});var _0x1f7b86=_0xb00b('0x45');return db[_0xb00b('0x46')][_0xb00b('0x47')]({'where':{'name':_0x1f7b86,'userProfileId':_0x3a205d[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x1d')](function(_0x4846c9){if(_0x4846c9&&_0x4846c9['autoAssociation']===0x0){return db[_0xb00b('0x20')][_0xb00b('0x44')]({'name':_0x465d90['name'],'resourceId':_0x465d90['id'],'type':_0x4846c9[_0xb00b('0x23')],'sectionId':_0x4846c9['id']},{})[_0xb00b('0x1d')](function(){return _0x154759;});}else{return _0x154759;}})['catch'](function(_0x15dcbf){logger[_0xb00b('0x21')](_0xb00b('0x49'),_0x15dcbf);throw _0x15dcbf;});}return _0x154759;})['then'](respondWithResult(_0x58e9cb,0xc9))['catch'](handleError(_0x58e9cb,null));};exports[_0xb00b('0x1c')]=function(_0x398deb,_0x12737d){if(_0x398deb[_0xb00b('0x4a')]['id']){delete _0x398deb['body']['id'];}return db[_0xb00b('0x26')][_0xb00b('0x47')]({'where':{'id':_0x398deb['params']['id']}})['then'](handleEntityNotFound(_0x12737d,null))[_0xb00b('0x1d')](saveUpdates(_0x398deb['body'],null))[_0xb00b('0x1d')](respondWithResult(_0x12737d,null))[_0xb00b('0x41')](handleError(_0x12737d,null));};exports[_0xb00b('0x1e')]=function(_0x222459,_0x450ce7){return db[_0xb00b('0x26')]['find']({'where':{'id':_0x222459[_0xb00b('0x43')]['id']}})['then'](handleEntityNotFound(_0x450ce7,null))[_0xb00b('0x1d')](removeEntity(_0x450ce7,null))[_0xb00b('0x41')](handleError(_0x450ce7,null));};
\ No newline at end of file
diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js
index abc0791..9099d65 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 _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
+var _0x9206=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','ContactItemType','tools_contact_item_types'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9206,0x176));var _0x6920=function(_0x2a396b,_0x2918d7){_0x2a396b=_0x2a396b-0x0;var _0x2c0250=_0x9206[_0x2a396b];return _0x2c0250;};'use strict';var _=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var logger=require(_0x6920('0x2'))(_0x6920('0x3'));var moment=require(_0x6920('0x4'));var BPromise=require(_0x6920('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6920('0x6'));var config=require(_0x6920('0x7'));var attributes=require('./contactItemType.attributes');module['exports']=function(_0x41c8c4,_0x4d67d7){return _0x41c8c4[_0x6920('0x8')](_0x6920('0x9'),attributes,{'tableName':_0x6920('0xa'),'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 48d599f..4322809 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 _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
+var _0x0bb5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x483a78,_0x33de1f){var _0x263d88=function(_0xa8b8ec){while(--_0xa8b8ec){_0x483a78['push'](_0x483a78['shift']());}};_0x263d88(++_0x33de1f);}(_0x0bb5,0x148));var _0x50bb=function(_0x2f17c4,_0x31ddd6){_0x2f17c4=_0x2f17c4-0x0;var _0xdfca7c=_0x0bb5[_0x2f17c4];return _0xdfca7c;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50bb('0x2'));var fs=require('fs');var Redis=require(_0x50bb('0x3'));var db=require(_0x50bb('0x4'))['db'];var utils=require(_0x50bb('0x5'));var logger=require(_0x50bb('0x6'))(_0x50bb('0x7'));var config=require(_0x50bb('0x8'));var jayson=require(_0x50bb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfd7aeb,_0x35de5d,_0x2e5463){return new BPromise(function(_0x33ff54,_0x4f9172){return client['request'](_0xfd7aeb,_0x2e5463)[_0x50bb('0xa')](function(_0x1c2174){logger[_0x50bb('0xb')](_0x50bb('0xc'),_0x35de5d,'request\x20sent');logger[_0x50bb('0xd')](_0x50bb('0xe'),_0x35de5d,_0x50bb('0xf'),JSON[_0x50bb('0x10')](_0x1c2174));if(_0x1c2174[_0x50bb('0x11')]){if(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x12')]===0x1f4){logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174['error'][_0x50bb('0x13')]);return _0x4f9172(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);}logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);return _0x33ff54(_0x1c2174['error'][_0x50bb('0x13')]);}else{logger['info'](_0x50bb('0xc'),_0x35de5d,_0x50bb('0xf'));_0x33ff54(_0x1c2174[_0x50bb('0x14')][_0x50bb('0x13')]);}})[_0x50bb('0x15')](function(_0x4f2897){logger[_0x50bb('0x11')](_0x50bb('0xc'),_0x35de5d,_0x4f2897);_0x4f9172(_0x4f2897);});});}
\ No newline at end of file
diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js
index 51ff74a..8f02010 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 _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
+var _0xa094=['index','/:id','show','create','update','exports','multer','util','path','express','Router','../../components/auth/service','./contactItemType.controller','get','isAuthenticated'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0xa094,0x8d));var _0x4a09=function(_0x32d26b,_0x1f6ad2){_0x32d26b=_0x32d26b-0x0;var _0x5334e5=_0xa094[_0x32d26b];return _0x5334e5;};'use strict';var multer=require(_0x4a09('0x0'));var util=require(_0x4a09('0x1'));var path=require(_0x4a09('0x2'));var timeout=require('connect-timeout');var express=require(_0x4a09('0x3'));var router=express[_0x4a09('0x4')]();var auth=require(_0x4a09('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4a09('0x6'));router[_0x4a09('0x7')]('/',auth[_0x4a09('0x8')](),controller[_0x4a09('0x9')]);router[_0x4a09('0x7')](_0x4a09('0xa'),auth['isAuthenticated'](),controller[_0x4a09('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4a09('0xc')]);router['put'](_0x4a09('0xa'),auth['isAuthenticated'](),controller[_0x4a09('0xd')]);router['delete'](_0x4a09('0xa'),auth[_0x4a09('0x8')](),controller['destroy']);module[_0x4a09('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js
index 39bbd58..9bad5fc 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 _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
+var _0x1560=['STRING','name','sequelize'];(function(_0x49b0ed,_0x5317b0){var _0x5d9240=function(_0x50d7c6){while(--_0x50d7c6){_0x49b0ed['push'](_0x49b0ed['shift']());}};_0x5d9240(++_0x5317b0);}(_0x1560,0x155));var _0x0156=function(_0x520b9e,_0x512957){_0x520b9e=_0x520b9e-0x0;var _0x4da7d4=_0x1560[_0x520b9e];return _0x4da7d4;};'use strict';var Sequelize=require(_0x0156('0x0'));module['exports']={'name':{'type':Sequelize[_0x0156('0x1')],'allowNull':![],'unique':_0x0156('0x2')},'description':{'type':Sequelize[_0x0156('0x1')]}};
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js
index 405968c..8f94ec1 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 _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
+var _0x4e5e=['attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','hasOwnProperty','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','count','offset','limit','set','reject','update','then','get','CustomDashboards','destroy','error','name','send','index','Dashboard','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','order','sort','pick','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','body','updatedAt','role','iframe','attrUrl','attrs','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2'];(function(_0x4cce65,_0x40021e){var _0x4d1b45=function(_0x54d290){while(--_0x54d290){_0x4cce65['push'](_0x4cce65['shift']());}};_0x4d1b45(++_0x40021e);}(_0x4e5e,0x179));var _0xe4e5=function(_0x4f8fc4,_0x483e4d){_0x4f8fc4=_0x4f8fc4-0x0;var _0x106eaa=_0x4e5e[_0x4f8fc4];return _0x106eaa;};'use strict';var pdf=require(_0xe4e5('0x0'));var emlformat=require(_0xe4e5('0x1'));var rimraf=require(_0xe4e5('0x2'));var zipdir=require(_0xe4e5('0x3'));var jsonpatch=require(_0xe4e5('0x4'));var rp=require(_0xe4e5('0x5'));var moment=require(_0xe4e5('0x6'));var BPromise=require(_0xe4e5('0x7'));var Mustache=require(_0xe4e5('0x8'));var util=require(_0xe4e5('0x9'));var path=require(_0xe4e5('0xa'));var sox=require(_0xe4e5('0xb'));var csv=require(_0xe4e5('0xc'));var ejs=require(_0xe4e5('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe4e5('0xe'));var crypto=require(_0xe4e5('0xf'));var jsforce=require(_0xe4e5('0x10'));var deskjs=require(_0xe4e5('0x11'));var toCsv=require(_0xe4e5('0xc'));var querystring=require(_0xe4e5('0x12'));var Papa=require('papaparse');var Redis=require(_0xe4e5('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe4e5('0x14'));var hardwareService=require(_0xe4e5('0x15'));var logger=require(_0xe4e5('0x16'))(_0xe4e5('0x17'));var utils=require(_0xe4e5('0x18'));var config=require(_0xe4e5('0x19'));var db=require(_0xe4e5('0x1a'))['db'];config[_0xe4e5('0x1b')]=_[_0xe4e5('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe4e5('0x1d'))(new Redis(config[_0xe4e5('0x1b')]));require('./dashboard.socket')[_0xe4e5('0x1e')](socket);function respondWithStatusCode(_0x33a1f3,_0x2fe9f0){_0x2fe9f0=_0x2fe9f0||0xcc;return function(_0x1b1b64){if(_0x1b1b64){return _0x33a1f3[_0xe4e5('0x1f')](_0x2fe9f0);}return _0x33a1f3[_0xe4e5('0x20')](_0x2fe9f0)[_0xe4e5('0x21')]();};}function respondWithResult(_0x4ae919,_0x439220){_0x439220=_0x439220||0xc8;return function(_0x9f9695){if(_0x9f9695){return _0x4ae919[_0xe4e5('0x20')](_0x439220)['json'](_0x9f9695);}};}function respondWithFilteredResult(_0x168496,_0x108376){return function(_0x355b3d){if(_0x355b3d){var _0x3e8918=_0x355b3d[_0xe4e5('0x22')],_0x34d102=_0x108376[_0xe4e5('0x23')],_0x1166fb=_0x108376[_0xe4e5('0x23')]+_0x108376[_0xe4e5('0x24')],_0x146fa2;if(_0x1166fb>=_0x3e8918){_0x1166fb=_0x3e8918;_0x146fa2=0xc8;}else{_0x146fa2=0xce;}_0x168496[_0xe4e5('0x20')](_0x146fa2);return _0x168496[_0xe4e5('0x25')]('Content-Range',_0x34d102+'-'+_0x1166fb+'/'+_0x3e8918)['json'](_0x355b3d);}return null;};}function patchUpdates(_0x3c0367){return function(_0x371491){try{jsonpatch['apply'](_0x371491,_0x3c0367,!![]);}catch(_0xfa04f7){return BPromise[_0xe4e5('0x26')](_0xfa04f7);}return _0x371491['save']();};}function saveUpdates(_0x3c5876,_0x1dd7c4){return function(_0x4111af){if(_0x4111af){return _0x4111af[_0xe4e5('0x27')](_0x3c5876)[_0xe4e5('0x28')](function(_0x1b2f2b){return _0x1b2f2b;});}return null;};}function removeEntity(_0x219a27,_0x1f1582){return function(_0x1674f3){if(_0x1674f3){return _0x1674f3['destroy']()['then'](function(){var _0x46b202=_0x1674f3[_0xe4e5('0x29')]({'plain':!![]});var _0x4e8e79=_0xe4e5('0x2a');return db['UserProfileResource'][_0xe4e5('0x2b')]({'where':{'type':_0x4e8e79,'resourceId':_0x46b202['id']}})[_0xe4e5('0x28')](function(){return _0x1674f3;});})[_0xe4e5('0x28')](function(){_0x219a27[_0xe4e5('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47b250,_0x11a240){return function(_0x36b2f6){if(!_0x36b2f6){_0x47b250[_0xe4e5('0x1f')](0x194);}return _0x36b2f6;};}function handleError(_0x1de203,_0x3ed6f0){_0x3ed6f0=_0x3ed6f0||0x1f4;return function(_0x437bc1){logger[_0xe4e5('0x2c')](_0x437bc1['stack']);if(_0x437bc1[_0xe4e5('0x2d')]){delete _0x437bc1[_0xe4e5('0x2d')];}_0x1de203[_0xe4e5('0x20')](_0x3ed6f0)[_0xe4e5('0x2e')](_0x437bc1);};}exports[_0xe4e5('0x2f')]=function(_0x3f2455,_0x56df2f){var _0x12b8c3={},_0x13c174={},_0x41be2b={'count':0x0,'rows':[]};var _0x5c1e85=_['map'](db[_0xe4e5('0x30')][_0xe4e5('0x31')],function(_0x10b5c6){return{'name':_0x10b5c6[_0xe4e5('0x32')],'type':_0x10b5c6[_0xe4e5('0x33')][_0xe4e5('0x34')]};});_0x13c174[_0xe4e5('0x35')]=_['map'](_0x5c1e85,'name');_0x13c174[_0xe4e5('0x36')]=_['keys'](_0x3f2455[_0xe4e5('0x36')]);_0x13c174[_0xe4e5('0x37')]=_['intersection'](_0x13c174['model'],_0x13c174['query']);_0x12b8c3[_0xe4e5('0x38')]=_[_0xe4e5('0x39')](_0x13c174[_0xe4e5('0x35')],qs['fields'](_0x3f2455[_0xe4e5('0x36')][_0xe4e5('0x3a')]));_0x12b8c3[_0xe4e5('0x38')]=_0x12b8c3[_0xe4e5('0x38')][_0xe4e5('0x3b')]?_0x12b8c3[_0xe4e5('0x38')]:_0x13c174[_0xe4e5('0x35')];if(!_0x3f2455[_0xe4e5('0x36')]['hasOwnProperty']('nolimit')){_0x12b8c3[_0xe4e5('0x24')]=qs['limit'](_0x3f2455[_0xe4e5('0x36')]['limit']);_0x12b8c3[_0xe4e5('0x23')]=qs['offset'](_0x3f2455['query'][_0xe4e5('0x23')]);}_0x12b8c3[_0xe4e5('0x3c')]=qs[_0xe4e5('0x3d')](_0x3f2455[_0xe4e5('0x36')]['sort']);_0x12b8c3['where']=qs[_0xe4e5('0x37')](_[_0xe4e5('0x3e')](_0x3f2455[_0xe4e5('0x36')],_0x13c174[_0xe4e5('0x37')]),_0x5c1e85);if(_0x3f2455['query']['filter']){_0x12b8c3[_0xe4e5('0x3f')]=_[_0xe4e5('0x40')](_0x12b8c3[_0xe4e5('0x3f')],{'$or':_[_0xe4e5('0x41')](_0x5c1e85,function(_0x2e03cf){if(_0x2e03cf[_0xe4e5('0x33')]!==_0xe4e5('0x42')){var _0x3b3c53={};_0x3b3c53[_0x2e03cf[_0xe4e5('0x2d')]]={'$like':'%'+_0x3f2455['query'][_0xe4e5('0x43')]+'%'};return _0x3b3c53;}})});}_0x12b8c3=_[_0xe4e5('0x40')]({},_0x12b8c3,_0x3f2455[_0xe4e5('0x44')]);var _0xe17725={'where':_0x12b8c3[_0xe4e5('0x3f')]};return db[_0xe4e5('0x30')][_0xe4e5('0x22')](_0xe17725)[_0xe4e5('0x28')](function(_0x112380){_0x41be2b['count']=_0x112380;if(_0x3f2455[_0xe4e5('0x36')][_0xe4e5('0x45')]){_0x12b8c3[_0xe4e5('0x46')]=[{'all':!![]}];}return db[_0xe4e5('0x30')][_0xe4e5('0x47')](_0x12b8c3);})[_0xe4e5('0x28')](function(_0x771894){_0x41be2b[_0xe4e5('0x48')]=_0x771894;return _0x41be2b;})[_0xe4e5('0x28')](respondWithFilteredResult(_0x56df2f,_0x12b8c3))[_0xe4e5('0x49')](handleError(_0x56df2f,null));};exports['show']=function(_0x31fa26,_0x57dafc){var _0x502956={'raw':![],'where':{'id':_0x31fa26[_0xe4e5('0x4a')]['id']}},_0x54bdc7={};_0x54bdc7[_0xe4e5('0x35')]=_[_0xe4e5('0x4b')](db[_0xe4e5('0x30')][_0xe4e5('0x31')]);_0x54bdc7[_0xe4e5('0x36')]=_[_0xe4e5('0x4b')](_0x31fa26[_0xe4e5('0x36')]);_0x54bdc7[_0xe4e5('0x37')]=_[_0xe4e5('0x39')](_0x54bdc7[_0xe4e5('0x35')],_0x54bdc7[_0xe4e5('0x36')]);_0x502956[_0xe4e5('0x38')]=_['intersection'](_0x54bdc7[_0xe4e5('0x35')],qs[_0xe4e5('0x3a')](_0x31fa26[_0xe4e5('0x36')][_0xe4e5('0x3a')]));_0x502956[_0xe4e5('0x38')]=_0x502956['attributes'][_0xe4e5('0x3b')]?_0x502956[_0xe4e5('0x38')]:_0x54bdc7['model'];if(_0x31fa26[_0xe4e5('0x36')][_0xe4e5('0x45')]){_0x502956[_0xe4e5('0x46')]=[{'all':!![]}];}_0x502956=_[_0xe4e5('0x40')]({},_0x502956,_0x31fa26[_0xe4e5('0x44')]);return db[_0xe4e5('0x30')][_0xe4e5('0x4c')](_0x502956)[_0xe4e5('0x28')](handleEntityNotFound(_0x57dafc,null))[_0xe4e5('0x28')](respondWithResult(_0x57dafc,null))[_0xe4e5('0x49')](handleError(_0x57dafc,null));};exports[_0xe4e5('0x4d')]=function(_0x21a13a,_0x257640){return db[_0xe4e5('0x30')][_0xe4e5('0x4d')](_0x21a13a['body'],{})['then'](function(_0x478956){var _0x55cc0e=_0x21a13a[_0xe4e5('0x4e')]['get']({'plain':!![]});if(!_0x55cc0e)throw new Error(_0xe4e5('0x4f'));if(_0x55cc0e['role']===_0xe4e5('0x4e')){var _0x4e594c=_0x478956[_0xe4e5('0x29')]({'plain':!![]});var _0x51a1fc=_0xe4e5('0x2a');return db[_0xe4e5('0x50')][_0xe4e5('0x4c')]({'where':{'name':_0x51a1fc,'userProfileId':_0x55cc0e[_0xe4e5('0x51')]},'raw':!![]})['then'](function(_0x529194){if(_0x529194&&_0x529194[_0xe4e5('0x52')]===0x0){return db[_0xe4e5('0x53')][_0xe4e5('0x4d')]({'name':_0x4e594c[_0xe4e5('0x2d')],'resourceId':_0x4e594c['id'],'type':_0x529194[_0xe4e5('0x2d')],'sectionId':_0x529194['id']},{})[_0xe4e5('0x28')](function(){return _0x478956;});}else{return _0x478956;}})[_0xe4e5('0x49')](function(_0x65fbf4){logger['error'](_0xe4e5('0x54'),_0x65fbf4);throw _0x65fbf4;});}return _0x478956;})[_0xe4e5('0x28')](respondWithResult(_0x257640,0xc9))[_0xe4e5('0x49')](handleError(_0x257640,null));};exports[_0xe4e5('0x55')]=function(_0x11ada0,_0x4ed318){var _0x52a7a3={'where':{'id':_0x11ada0[_0xe4e5('0x4a')]['id']}},_0x566a5e={};_0x566a5e[_0xe4e5('0x35')]=_[_0xe4e5('0x4b')](db[_0xe4e5('0x30')][_0xe4e5('0x31')]);_0x52a7a3[_0xe4e5('0x38')]=_[_0xe4e5('0x39')](_0x566a5e[_0xe4e5('0x35')],qs[_0xe4e5('0x3a')](_0x11ada0['query']['fields']));_0x52a7a3['attributes']=_0x52a7a3[_0xe4e5('0x38')][_0xe4e5('0x3b')]?_0x52a7a3['attributes']:_0x566a5e[_0xe4e5('0x35')];if(_0x11ada0[_0xe4e5('0x36')][_0xe4e5('0x45')]){_0x52a7a3[_0xe4e5('0x46')]=[{'all':!![]}];}_0x52a7a3=_['merge']({},_0x52a7a3,_0x11ada0[_0xe4e5('0x44')]);return db[_0xe4e5('0x30')]['find'](_0x52a7a3)['then'](handleEntityNotFound(_0x4ed318,null))['then'](function(_0x583b0e){if(_0x583b0e){var _0x23ca50=_0x583b0e[_0xe4e5('0x29')]({'plain':!![]});_0x23ca50=qs[_0xe4e5('0x56')](_0x23ca50,['id','createdAt','updatedAt']);_0x11ada0['body']=_[_0xe4e5('0x56')](_0x11ada0[_0xe4e5('0x57')],['id','createdAt',_0xe4e5('0x58')]);return db['Dashboard'][_0xe4e5('0x4d')](_[_0xe4e5('0x40')](_0x23ca50,_0x11ada0[_0xe4e5('0x57')]),{'include':_0x11ada0[_0xe4e5('0x36')][_0xe4e5('0x45')]?[{'all':!![]}]:undefined})['then'](function(_0x268b29){var _0x4dcb8f=_0x11ada0[_0xe4e5('0x4e')]['get']({'plain':!![]});if(!_0x4dcb8f)throw new Error(_0xe4e5('0x4f'));if(_0x4dcb8f[_0xe4e5('0x59')]===_0xe4e5('0x4e')){var _0x3e25e4=_0x268b29[_0xe4e5('0x29')]({'plain':!![]});var _0x476982=_0xe4e5('0x2a');return db[_0xe4e5('0x50')][_0xe4e5('0x4c')]({'where':{'name':_0x476982,'userProfileId':_0x4dcb8f[_0xe4e5('0x51')]},'raw':!![]})[_0xe4e5('0x28')](function(_0x4dd586){if(_0x4dd586&&_0x4dd586[_0xe4e5('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x3e25e4[_0xe4e5('0x2d')],'resourceId':_0x3e25e4['id'],'type':_0x4dd586['name'],'sectionId':_0x4dd586['id']},{})[_0xe4e5('0x28')](function(){return _0x268b29;});}else{return _0x268b29;}})[_0xe4e5('0x49')](function(_0x3a1ad5){logger[_0xe4e5('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a1ad5);throw _0x3a1ad5;});}return _0x268b29;});}})['then'](respondWithResult(_0x4ed318,0xc9))[_0xe4e5('0x49')](handleError(_0x4ed318,null));};exports[_0xe4e5('0x27')]=function(_0x66c9c0,_0x30f5d1){if(_0x66c9c0[_0xe4e5('0x57')]['id']){delete _0x66c9c0[_0xe4e5('0x57')]['id'];}return db[_0xe4e5('0x30')][_0xe4e5('0x4c')]({'where':{'id':_0x66c9c0[_0xe4e5('0x4a')]['id']}})[_0xe4e5('0x28')](handleEntityNotFound(_0x30f5d1,null))['then'](saveUpdates(_0x66c9c0[_0xe4e5('0x57')],null))[_0xe4e5('0x28')](respondWithResult(_0x30f5d1,null))[_0xe4e5('0x49')](handleError(_0x30f5d1,null));};exports[_0xe4e5('0x2b')]=function(_0x3fd219,_0x5af729){return db[_0xe4e5('0x30')][_0xe4e5('0x4c')]({'where':{'id':_0x3fd219[_0xe4e5('0x4a')]['id']}})[_0xe4e5('0x28')](handleEntityNotFound(_0x5af729,null))['then'](removeEntity(_0x5af729,null))['catch'](handleError(_0x5af729,null));};function widgetAttributes(_0x5ec823){try{switch(_0x5ec823[_0xe4e5('0x33')]){case _0xe4e5('0x5a'):return[{'name':_0xe4e5('0x5b'),'value':_0x5ec823[_0xe4e5('0x5b')]||(_0x5ec823[_0xe4e5('0x5c')]&&_0x5ec823[_0xe4e5('0x5c')][0x0]?_0x5ec823[_0xe4e5('0x5c')][0x0][_0xe4e5('0x5d')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x5ec823['attrPath']||(_0x5ec823[_0xe4e5('0x5c')]&&_0x5ec823[_0xe4e5('0x5c')][0x0]?_0x5ec823[_0xe4e5('0x5c')][0x0]['value']:undefined)||''}];case _0xe4e5('0x5e'):return[{'name':_0xe4e5('0x5f'),'value':_0x5ec823[_0xe4e5('0x5f')]||(_0x5ec823['attrs']&&_0x5ec823[_0xe4e5('0x5c')][0x0]?_0x5ec823[_0xe4e5('0x5c')][0x0][_0xe4e5('0x5d')]:undefined)||_0xe4e5('0x60')},{'name':_0xe4e5('0x61'),'value':_0x5ec823['attrTimezone']||(_0x5ec823['attrs']&&_0x5ec823['attrs'][0x1]?_0x5ec823[_0xe4e5('0x5c')][0x1]['value']:undefined)||'0.00'},{'name':_0xe4e5('0x62'),'value':_0x5ec823[_0xe4e5('0x62')]||(_0x5ec823[_0xe4e5('0x5c')]&&_0x5ec823['attrs'][0x2]?_0x5ec823[_0xe4e5('0x5c')][0x2][_0xe4e5('0x5d')]:undefined)||0xc}];case _0xe4e5('0x63'):return[{'name':_0xe4e5('0x64'),'value':_0x5ec823[_0xe4e5('0x64')]||(_0x5ec823[_0xe4e5('0x5c')]&&_0x5ec823[_0xe4e5('0x5c')][0x0]?_0x5ec823[_0xe4e5('0x5c')][0x0]['value']:undefined)||'total'},{'name':_0xe4e5('0x65'),'value':_0x5ec823[_0xe4e5('0x65')]||(_0x5ec823[_0xe4e5('0x5c')]&&_0x5ec823['attrs'][0x1]?_0x5ec823[_0xe4e5('0x5c')][0x1][_0xe4e5('0x5d')]:undefined)||[]},{'name':_0xe4e5('0x62'),'value':_0x5ec823[_0xe4e5('0x62')]||(_0x5ec823[_0xe4e5('0x5c')]&&_0x5ec823[_0xe4e5('0x5c')][0x2]?_0x5ec823[_0xe4e5('0x5c')][0x2]['value']:undefined)||0x14}];case _0xe4e5('0x66'):case _0xe4e5('0x67'):return[{'name':_0xe4e5('0x68'),'value':_0x5ec823[_0xe4e5('0x68')]||(_0x5ec823['attrs']&&_0x5ec823[_0xe4e5('0x5c')][0x0]?_0x5ec823[_0xe4e5('0x5c')][0x0]['value']:undefined)||_0xe4e5('0x69')},{'name':_0xe4e5('0x6a'),'value':_0x5ec823[_0xe4e5('0x6a')]||(_0x5ec823['attrs']&&_0x5ec823['attrs'][0x1]?_0x5ec823[_0xe4e5('0x5c')][0x1]['value']:undefined)||null},{'name':_0xe4e5('0x6b'),'value':_0x5ec823[_0xe4e5('0x6b')]||(_0x5ec823[_0xe4e5('0x5c')]&&_0x5ec823[_0xe4e5('0x5c')][0x2]?_0x5ec823[_0xe4e5('0x5c')][0x2][_0xe4e5('0x5d')]:undefined)||null},{'name':_0xe4e5('0x65'),'value':_0x5ec823[_0xe4e5('0x65')]||(_0x5ec823['attrs']&&_0x5ec823['attrs'][0x3]?_0x5ec823[_0xe4e5('0x5c')][0x3][_0xe4e5('0x5d')]:undefined)||[]}];case _0xe4e5('0x6c'):return[{'name':_0xe4e5('0x6d'),'type':_0x5ec823[_0xe4e5('0x6e')]||(_0x5ec823[_0xe4e5('0x5c')]&&_0x5ec823[_0xe4e5('0x5c')][0x0]?_0x5ec823['attrs'][0x0][_0xe4e5('0x33')]:undefined)||null,'value':_0x5ec823[_0xe4e5('0x6d')]||(_0x5ec823[_0xe4e5('0x5c')]&&_0x5ec823['attrs'][0x0]?_0x5ec823[_0xe4e5('0x5c')][0x0]['value']:undefined)||null},{'name':_0xe4e5('0x6f'),'value':_0x5ec823[_0xe4e5('0x6f')]||(_0x5ec823['attrs']&&_0x5ec823['attrs'][0x1]?_0x5ec823[_0xe4e5('0x5c')][0x1][_0xe4e5('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x47a500){logger[_0xe4e5('0x2c')](_0xe4e5('0x70'),JSON[_0xe4e5('0x71')](_0x47a500));return[];}}exports[_0xe4e5('0x72')]=function(_0x5bc166,_0xa32631,_0x2e9bc4){if(_0x5bc166[_0xe4e5('0x57')]['id']){delete _0x5bc166[_0xe4e5('0x57')]['id'];}return db[_0xe4e5('0x30')][_0xe4e5('0x4c')]({'where':{'id':_0x5bc166[_0xe4e5('0x4a')]['id']}})[_0xe4e5('0x28')](handleEntityNotFound(_0xa32631,null))[_0xe4e5('0x28')](function(_0x4da111){if(_0x4da111){_0x5bc166[_0xe4e5('0x57')][_0xe4e5('0x73')]=_0x4da111['id'];_0x5bc166[_0xe4e5('0x57')]['attrs']=widgetAttributes(_0x5bc166[_0xe4e5('0x57')]);return db[_0xe4e5('0x74')][_0xe4e5('0x4d')](_0x5bc166['body']);}})[_0xe4e5('0x28')](respondWithResult(_0xa32631,null))[_0xe4e5('0x49')](handleError(_0xa32631,null));};exports[_0xe4e5('0x75')]=function(_0x12f4b4,_0x525083,_0x2b0fb2){var _0x278475={};var _0x21a438={};var _0x2920c1;var _0x473eed;return db[_0xe4e5('0x30')][_0xe4e5('0x76')]({'where':{'id':_0x12f4b4[_0xe4e5('0x4a')]['id']}})[_0xe4e5('0x28')](handleEntityNotFound(_0x525083,null))['then'](function(_0x5291fa){if(_0x5291fa){_0x2920c1=_0x5291fa;_0x21a438[_0xe4e5('0x35')]=_[_0xe4e5('0x4b')](db[_0xe4e5('0x74')][_0xe4e5('0x31')]);_0x21a438['query']=_[_0xe4e5('0x4b')](_0x12f4b4['query']);_0x21a438['filters']=_[_0xe4e5('0x39')](_0x21a438[_0xe4e5('0x35')],_0x21a438[_0xe4e5('0x36')]);_0x278475['attributes']=_['intersection'](_0x21a438[_0xe4e5('0x35')],qs['fields'](_0x12f4b4[_0xe4e5('0x36')][_0xe4e5('0x3a')]));_0x278475['attributes']=_0x278475[_0xe4e5('0x38')][_0xe4e5('0x3b')]?_0x278475[_0xe4e5('0x38')]:_0x21a438[_0xe4e5('0x35')];_0x278475['order']=qs['sort'](_0x12f4b4['query'][_0xe4e5('0x3d')]);_0x278475[_0xe4e5('0x3f')]=qs[_0xe4e5('0x37')](_[_0xe4e5('0x3e')](_0x12f4b4[_0xe4e5('0x36')],_0x21a438[_0xe4e5('0x37')]));if(_0x12f4b4[_0xe4e5('0x36')]['filter']){_0x278475['where']=_[_0xe4e5('0x40')](_0x278475[_0xe4e5('0x3f')],{'$or':_[_0xe4e5('0x41')](_0x278475[_0xe4e5('0x38')],function(_0x24d3ee){var _0x2f4d0f={};_0x2f4d0f[_0x24d3ee]={'$like':'%'+_0x12f4b4['query'][_0xe4e5('0x43')]+'%'};return _0x2f4d0f;})});}_0x278475=_[_0xe4e5('0x40')]({},_0x278475,_0x12f4b4[_0xe4e5('0x44')]);return _0x2920c1['getItems'](_0x278475);}})[_0xe4e5('0x28')](function(_0x84d4e4){if(_0x84d4e4){_0x473eed=_0x84d4e4[_0xe4e5('0x3b')];if(!_0x12f4b4[_0xe4e5('0x36')][_0xe4e5('0x77')](_0xe4e5('0x78'))){_0x278475[_0xe4e5('0x24')]=qs[_0xe4e5('0x24')](_0x12f4b4[_0xe4e5('0x36')]['limit']);_0x278475[_0xe4e5('0x23')]=qs[_0xe4e5('0x23')](_0x12f4b4[_0xe4e5('0x36')][_0xe4e5('0x23')]);}return _0x2920c1['getItems'](_0x278475);}})[_0xe4e5('0x28')](function(_0x1a28ab){if(_0x1a28ab){return _0x1a28ab?{'count':_0x473eed,'rows':_0x1a28ab}:null;}})[_0xe4e5('0x28')](respondWithResult(_0x525083,null))['catch'](handleError(_0x525083,null));};
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js
index 911e344..1c76274 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 _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
+var _0xa91f=['hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x4f1999,_0x1fa4ce){var _0x22323f=function(_0x380f8d){while(--_0x380f8d){_0x4f1999['push'](_0x4f1999['shift']());}};_0x22323f(++_0x1fa4ce);}(_0xa91f,0x128));var _0xfa91=function(_0x128c7e,_0xcbdf6a){_0x128c7e=_0x128c7e-0x0;var _0x28681c=_0xa91f[_0x128c7e];return _0x28681c;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xfa91('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xfa91('0x1')](0x0);var events={'afterCreate':_0xfa91('0x2'),'afterUpdate':'update','afterDestroy':_0xfa91('0x3')};function emitEvent(_0x2cfd70){return function(_0x4f060b,_0x3de506,_0x433b44){DashboardEvents[_0xfa91('0x4')](_0x2cfd70+':'+_0x4f060b['id'],_0x4f060b);DashboardEvents[_0xfa91('0x4')](_0x2cfd70,_0x4f060b);_0x433b44(null);};}for(var e in events){if(events[_0xfa91('0x5')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xfa91('0x6')]=DashboardEvents;
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js
index 05ce707..b711169 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 _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
+var _0x496a=['moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','api'];(function(_0x2d46b0,_0x2e28d1){var _0x34910b=function(_0xa90418){while(--_0xa90418){_0x2d46b0['push'](_0x2d46b0['shift']());}};_0x34910b(++_0x2e28d1);}(_0x496a,0x8c));var _0xa496=function(_0x38d93c,_0x379b1b){_0x38d93c=_0x38d93c-0x0;var _0x2d3449=_0x496a[_0x38d93c];return _0x2d3449;};'use strict';var _=require(_0xa496('0x0'));var util=require(_0xa496('0x1'));var logger=require('../../config/logger')(_0xa496('0x2'));var moment=require(_0xa496('0x3'));var BPromise=require(_0xa496('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa496('0x5'));var rimraf=require(_0xa496('0x6'));var config=require(_0xa496('0x7'));var attributes=require(_0xa496('0x8'));module[_0xa496('0x9')]=function(_0x5afd18,_0x25312a){return _0x5afd18[_0xa496('0xa')](_0xa496('0xb'),attributes,{'tableName':_0xa496('0xc'),'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 640dd8f..72a396a 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 _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
+var _0x563f=['code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error'];(function(_0x256a80,_0xfbf882){var _0x931887=function(_0x155ecb){while(--_0x155ecb){_0x256a80['push'](_0x256a80['shift']());}};_0x931887(++_0xfbf882);}(_0x563f,0x1cf));var _0xf563=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x563f[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf563('0x0'));var BPromise=require(_0xf563('0x1'));var rs=require(_0xf563('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf563('0x3'))['db'];var utils=require(_0xf563('0x4'));var logger=require(_0xf563('0x5'))(_0xf563('0x6'));var config=require(_0xf563('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf563('0x8')][_0xf563('0x9')]({'port':0x232a});config[_0xf563('0xa')]=_[_0xf563('0xb')](config[_0xf563('0xa')],{'host':_0xf563('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf563('0xa')]));require(_0xf563('0xd'))[_0xf563('0xe')](socket);function respondWithRpcPromise(_0x2ee5de,_0x5bf566,_0x5d4792){return new BPromise(function(_0x433926,_0x85e697){return client[_0xf563('0xf')](_0x2ee5de,_0x5d4792)[_0xf563('0x10')](function(_0x11ecbb){logger[_0xf563('0x11')](_0xf563('0x12'),_0x5bf566,_0xf563('0x13'));logger[_0xf563('0x14')](_0xf563('0x15'),_0x5bf566,_0xf563('0x13'),JSON['stringify'](_0x11ecbb));if(_0x11ecbb['error']){if(_0x11ecbb[_0xf563('0x16')][_0xf563('0x17')]===0x1f4){logger['error'](_0xf563('0x12'),_0x5bf566,_0x11ecbb[_0xf563('0x16')][_0xf563('0x18')]);return _0x85e697(_0x11ecbb[_0xf563('0x16')][_0xf563('0x18')]);}logger[_0xf563('0x16')](_0xf563('0x12'),_0x5bf566,_0x11ecbb['error']['message']);return _0x433926(_0x11ecbb[_0xf563('0x16')][_0xf563('0x18')]);}else{logger[_0xf563('0x11')]('Dashboard,\x20%s,\x20%s',_0x5bf566,_0xf563('0x13'));_0x433926(_0x11ecbb[_0xf563('0x19')][_0xf563('0x18')]);}})[_0xf563('0x1a')](function(_0x21ce0e){logger['error']('Dashboard,\x20%s,\x20%s',_0x5bf566,_0x21ce0e);_0x85e697(_0x21ce0e);});});}
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js
index 75c48b0..fbea4b1 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 _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
+var _0x2416=['dashboard:','./dashboard.events','save','remove','emit','length'];(function(_0x3ccc20,_0x1ea690){var _0x4fbb0d=function(_0x5d4d9a){while(--_0x5d4d9a){_0x3ccc20['push'](_0x3ccc20['shift']());}};_0x4fbb0d(++_0x1ea690);}(_0x2416,0xf1));var _0x6241=function(_0x41e3b3,_0x2fcd48){_0x41e3b3=_0x41e3b3-0x0;var _0x39f664=_0x2416[_0x41e3b3];return _0x39f664;};'use strict';var DashboardEvents=require(_0x6241('0x0'));var events=[_0x6241('0x1'),_0x6241('0x2'),'update'];function createListener(_0x5e4b32,_0x2bff71){return function(_0x19923f){_0x2bff71[_0x6241('0x3')](_0x5e4b32,_0x19923f);};}function removeListener(_0x318e36,_0x4699bf){return function(){DashboardEvents['removeListener'](_0x318e36,_0x4699bf);};}exports['register']=function(_0x711f59){for(var _0x308f36=0x0,_0x528263=events[_0x6241('0x4')];_0x308f36<_0x528263;_0x308f36++){var _0x41e60d=events[_0x308f36];var _0x56f0d6=createListener(_0x6241('0x5')+_0x41e60d,_0x711f59);DashboardEvents['on'](_0x41e60d,_0x56f0d6);}};
\ No newline at end of file
diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js
index 1d3085b..b5462f1 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 _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
+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(_0x253bea,_0x32f64c){var _0x20c1fd=function(_0x3df492){while(--_0x3df492){_0x253bea['push'](_0x253bea['shift']());}};_0x20c1fd(++_0x32f64c);}(_0x70e0,0x17b));var _0x070e=function(_0xc851c2,_0x4d3e7b){_0xc851c2=_0xc851c2-0x0;var _0x52fb66=_0x70e0[_0xc851c2];return _0x52fb66;};'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 9f1b130..cd7bb31 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 _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
+var _0xdc2c=['setDataValue','stringify','INTEGER','#2196f3','sequelize','squel','lodash','STRING','long','parse','getDataValue','attrs'];(function(_0x431f26,_0x414bb4){var _0x27a623=function(_0x3b1e88){while(--_0x3b1e88){_0x431f26['push'](_0x431f26['shift']());}};_0x27a623(++_0x414bb4);}(_0xdc2c,0xd0));var _0xcdc2=function(_0x11fc92,_0x4b1a76){_0x11fc92=_0x11fc92-0x0;var _0xc7373f=_0xdc2c[_0x11fc92];return _0xc7373f;};'use strict';var Sequelize=require(_0xcdc2('0x0'));var squel=require(_0xcdc2('0x1'));var _=require(_0xcdc2('0x2'));module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xcdc2('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xcdc2('0x4')),'get':function(){try{return JSON[_0xcdc2('0x5')](this[_0xcdc2('0x6')](_0xcdc2('0x7')));}catch(_0x1eff6a){return[];}},'set':function(_0x53ffe4){try{this[_0xcdc2('0x8')](_0xcdc2('0x7'),JSON[_0xcdc2('0x9')](_0x53ffe4));}catch(_0x39366f){this[_0xcdc2('0x8')](_0xcdc2('0x7'),JSON[_0xcdc2('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xcdc2('0xa')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xcdc2('0x3')],'allowNull':![],'defaultValue':_0xcdc2('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js
index 20610c2..00b1467 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 _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
+var _0x8ee8=['0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./dashboardItem.socket','status','end','json','count','offset','limit','apply','reject','save','destroy','sendStatus','error','name','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','then','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone'];(function(_0x2c2980,_0x34282a){var _0x2a20a9=function(_0x537b18){while(--_0x537b18){_0x2c2980['push'](_0x2c2980['shift']());}};_0x2a20a9(++_0x34282a);}(_0x8ee8,0x1c2));var _0x88ee=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0x8ee8[_0x2d91c6];return _0x3a8d19;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x88ee('0x0'));var zipdir=require(_0x88ee('0x1'));var jsonpatch=require(_0x88ee('0x2'));var rp=require(_0x88ee('0x3'));var moment=require(_0x88ee('0x4'));var BPromise=require(_0x88ee('0x5'));var Mustache=require(_0x88ee('0x6'));var util=require('util');var path=require('path');var sox=require(_0x88ee('0x7'));var csv=require(_0x88ee('0x8'));var ejs=require(_0x88ee('0x9'));var fs=require('fs');var _=require(_0x88ee('0xa'));var squel=require('squel');var crypto=require(_0x88ee('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x88ee('0xc'));var toCsv=require(_0x88ee('0x8'));var querystring=require(_0x88ee('0xd'));var Papa=require(_0x88ee('0xe'));var Redis=require(_0x88ee('0xf'));var authService=require(_0x88ee('0x10'));var qs=require(_0x88ee('0x11'));var as=require(_0x88ee('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x88ee('0x13'))('api');var utils=require(_0x88ee('0x14'));var config=require(_0x88ee('0x15'));var db=require(_0x88ee('0x16'))['db'];config[_0x88ee('0x17')]=_[_0x88ee('0x18')](config[_0x88ee('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x88ee('0x19'))['register'](socket);function respondWithStatusCode(_0x3bc76b,_0x29ef49){_0x29ef49=_0x29ef49||0xcc;return function(_0x231f0f){if(_0x231f0f){return _0x3bc76b['sendStatus'](_0x29ef49);}return _0x3bc76b[_0x88ee('0x1a')](_0x29ef49)[_0x88ee('0x1b')]();};}function respondWithResult(_0x6e74ad,_0x3eea9a){_0x3eea9a=_0x3eea9a||0xc8;return function(_0x5ecc6f){if(_0x5ecc6f){return _0x6e74ad['status'](_0x3eea9a)[_0x88ee('0x1c')](_0x5ecc6f);}};}function respondWithFilteredResult(_0x598287,_0x4b2abb){return function(_0x38e58f){if(_0x38e58f){var _0x4ab4cc=_0x38e58f[_0x88ee('0x1d')],_0x2381b4=_0x4b2abb[_0x88ee('0x1e')],_0xe605df=_0x4b2abb[_0x88ee('0x1e')]+_0x4b2abb[_0x88ee('0x1f')],_0x17f45a;if(_0xe605df>=_0x4ab4cc){_0xe605df=_0x4ab4cc;_0x17f45a=0xc8;}else{_0x17f45a=0xce;}_0x598287[_0x88ee('0x1a')](_0x17f45a);return _0x598287['set']('Content-Range',_0x2381b4+'-'+_0xe605df+'/'+_0x4ab4cc)[_0x88ee('0x1c')](_0x38e58f);}return null;};}function patchUpdates(_0xd884d3){return function(_0x3cb7d0){try{jsonpatch[_0x88ee('0x20')](_0x3cb7d0,_0xd884d3,!![]);}catch(_0xdb5c59){return BPromise[_0x88ee('0x21')](_0xdb5c59);}return _0x3cb7d0[_0x88ee('0x22')]();};}function saveUpdates(_0x6c13d8,_0x458288){return function(_0x506f0a){if(_0x506f0a){return _0x506f0a['update'](_0x6c13d8)['then'](function(_0x1262ff){return _0x1262ff;});}return null;};}function removeEntity(_0x1d1fbc,_0x28299a){return function(_0x384eda){if(_0x384eda){return _0x384eda[_0x88ee('0x23')]()['then'](function(){_0x1d1fbc[_0x88ee('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d89ba,_0x5b0622){return function(_0x3d75f0){if(!_0x3d75f0){_0x4d89ba[_0x88ee('0x24')](0x194);}return _0x3d75f0;};}function handleError(_0x381beb,_0x8295d2){_0x8295d2=_0x8295d2||0x1f4;return function(_0x1ae8b8){logger[_0x88ee('0x25')](_0x1ae8b8['stack']);if(_0x1ae8b8['name']){delete _0x1ae8b8[_0x88ee('0x26')];}_0x381beb[_0x88ee('0x1a')](_0x8295d2)['send'](_0x1ae8b8);};}exports['show']=function(_0x590a9f,_0x16bafa){var _0x303ac7={'raw':![],'where':{'id':_0x590a9f[_0x88ee('0x27')]['id']}},_0x39cf50={};_0x39cf50[_0x88ee('0x28')]=_[_0x88ee('0x29')](db[_0x88ee('0x2a')][_0x88ee('0x2b')]);_0x39cf50[_0x88ee('0x2c')]=_[_0x88ee('0x29')](_0x590a9f[_0x88ee('0x2c')]);_0x39cf50[_0x88ee('0x2d')]=_[_0x88ee('0x2e')](_0x39cf50['model'],_0x39cf50['query']);_0x303ac7['attributes']=_[_0x88ee('0x2e')](_0x39cf50[_0x88ee('0x28')],qs[_0x88ee('0x2f')](_0x590a9f['query']['fields']));_0x303ac7[_0x88ee('0x30')]=_0x303ac7[_0x88ee('0x30')]['length']?_0x303ac7[_0x88ee('0x30')]:_0x39cf50['model'];if(_0x590a9f['query'][_0x88ee('0x31')]){_0x303ac7[_0x88ee('0x32')]=[{'all':!![]}];}_0x303ac7=_[_0x88ee('0x33')]({},_0x303ac7,_0x590a9f[_0x88ee('0x34')]);return db[_0x88ee('0x2a')][_0x88ee('0x35')](_0x303ac7)[_0x88ee('0x36')](handleEntityNotFound(_0x16bafa,null))[_0x88ee('0x36')](respondWithResult(_0x16bafa,null))[_0x88ee('0x37')](handleError(_0x16bafa,null));};exports[_0x88ee('0x23')]=function(_0x4dda76,_0x1f9c24){return db[_0x88ee('0x2a')][_0x88ee('0x35')]({'where':{'id':_0x4dda76['params']['id']}})[_0x88ee('0x36')](handleEntityNotFound(_0x1f9c24,null))['then'](removeEntity(_0x1f9c24,null))[_0x88ee('0x37')](handleError(_0x1f9c24,null));};function widgetAttributes(_0x5567da){try{switch(_0x5567da[_0x88ee('0x38')]){case _0x88ee('0x39'):return[{'name':'attrUrl','value':_0x5567da[_0x88ee('0x3a')]||(_0x5567da[_0x88ee('0x3b')]&&_0x5567da['attrs'][0x0]?_0x5567da[_0x88ee('0x3b')][0x0][_0x88ee('0x3c')]:undefined)||'https://'}];case _0x88ee('0x3d'):return[{'name':_0x88ee('0x3e'),'value':_0x5567da[_0x88ee('0x3e')]||(_0x5567da[_0x88ee('0x3b')]&&_0x5567da[_0x88ee('0x3b')][0x0]?_0x5567da[_0x88ee('0x3b')][0x0][_0x88ee('0x3c')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x5567da[_0x88ee('0x3f')]||(_0x5567da['attrs']&&_0x5567da[_0x88ee('0x3b')][0x0]?_0x5567da[_0x88ee('0x3b')][0x0][_0x88ee('0x3c')]:undefined)||_0x88ee('0x40')},{'name':_0x88ee('0x41'),'value':_0x5567da[_0x88ee('0x41')]||(_0x5567da[_0x88ee('0x3b')]&&_0x5567da[_0x88ee('0x3b')][0x1]?_0x5567da[_0x88ee('0x3b')][0x1][_0x88ee('0x3c')]:undefined)||_0x88ee('0x42')},{'name':_0x88ee('0x43'),'value':_0x5567da[_0x88ee('0x43')]||(_0x5567da[_0x88ee('0x3b')]&&_0x5567da[_0x88ee('0x3b')][0x2]?_0x5567da[_0x88ee('0x3b')][0x2][_0x88ee('0x3c')]:undefined)||0xc}];case _0x88ee('0x44'):return[{'name':'attrMetric','value':_0x5567da[_0x88ee('0x45')]||(_0x5567da[_0x88ee('0x3b')]&&_0x5567da['attrs'][0x0]?_0x5567da[_0x88ee('0x3b')][0x0][_0x88ee('0x3c')]:undefined)||_0x88ee('0x46')},{'name':_0x88ee('0x47'),'value':_0x5567da[_0x88ee('0x47')]||(_0x5567da[_0x88ee('0x3b')]&&_0x5567da[_0x88ee('0x3b')][0x1]?_0x5567da[_0x88ee('0x3b')][0x1]['value']:undefined)||[]},{'name':_0x88ee('0x43'),'value':_0x5567da[_0x88ee('0x43')]||(_0x5567da[_0x88ee('0x3b')]&&_0x5567da[_0x88ee('0x3b')][0x2]?_0x5567da[_0x88ee('0x3b')][0x2]['value']:undefined)||0x14}];case _0x88ee('0x48'):case _0x88ee('0x49'):return[{'name':_0x88ee('0x4a'),'value':_0x5567da['attrSerie1']||(_0x5567da['attrs']&&_0x5567da['attrs'][0x0]?_0x5567da[_0x88ee('0x3b')][0x0][_0x88ee('0x3c')]:undefined)||_0x88ee('0x46')},{'name':_0x88ee('0x4b'),'value':_0x5567da['attrSerie2']||(_0x5567da[_0x88ee('0x3b')]&&_0x5567da[_0x88ee('0x3b')][0x1]?_0x5567da[_0x88ee('0x3b')][0x1][_0x88ee('0x3c')]:undefined)||null},{'name':_0x88ee('0x4c'),'value':_0x5567da[_0x88ee('0x4c')]||(_0x5567da[_0x88ee('0x3b')]&&_0x5567da[_0x88ee('0x3b')][0x2]?_0x5567da[_0x88ee('0x3b')][0x2][_0x88ee('0x3c')]:undefined)||null},{'name':_0x88ee('0x47'),'value':_0x5567da['attrVoiceQueues']||(_0x5567da[_0x88ee('0x3b')]&&_0x5567da[_0x88ee('0x3b')][0x3]?_0x5567da[_0x88ee('0x3b')][0x3]['value']:undefined)||[]}];case _0x88ee('0x4d'):return[{'name':'attrReport','type':_0x5567da[_0x88ee('0x4e')]||(_0x5567da['attrs']&&_0x5567da[_0x88ee('0x3b')][0x0]?_0x5567da['attrs'][0x0][_0x88ee('0x38')]:undefined)||null,'value':_0x5567da[_0x88ee('0x4f')]||(_0x5567da[_0x88ee('0x3b')]&&_0x5567da[_0x88ee('0x3b')][0x0]?_0x5567da[_0x88ee('0x3b')][0x0][_0x88ee('0x3c')]:undefined)||null},{'name':_0x88ee('0x50'),'value':_0x5567da[_0x88ee('0x50')]||(_0x5567da[_0x88ee('0x3b')]&&_0x5567da[_0x88ee('0x3b')][0x1]?_0x5567da[_0x88ee('0x3b')][0x1][_0x88ee('0x3c')]:undefined)||0x0}];default:return[];}}catch(_0x360bf4){logger[_0x88ee('0x25')](_0x88ee('0x51'),JSON[_0x88ee('0x52')](_0x360bf4));return[];}}exports[_0x88ee('0x53')]=function(_0x463f08,_0x353e11){if(_0x463f08[_0x88ee('0x54')]){_0x463f08[_0x88ee('0x54')][_0x88ee('0x3b')]=widgetAttributes(_0x463f08[_0x88ee('0x54')]);}return db['DashboardItem'][_0x88ee('0x53')](_0x463f08[_0x88ee('0x54')],{})[_0x88ee('0x36')](respondWithResult(_0x353e11,0xc9))[_0x88ee('0x37')](handleError(_0x353e11,null));};exports[_0x88ee('0x55')]=function(_0x2df035,_0x382a7c){if(_0x2df035[_0x88ee('0x54')]['id']){delete _0x2df035[_0x88ee('0x54')]['id'];}_0x2df035['body'][_0x88ee('0x3b')]=widgetAttributes(_0x2df035[_0x88ee('0x54')]);return db[_0x88ee('0x2a')][_0x88ee('0x35')]({'where':{'id':_0x2df035[_0x88ee('0x27')]['id']}})[_0x88ee('0x36')](handleEntityNotFound(_0x382a7c,null))['then'](saveUpdates(_0x2df035[_0x88ee('0x54')],null))[_0x88ee('0x36')](respondWithResult(_0x382a7c,null))[_0x88ee('0x37')](handleError(_0x382a7c,null));};
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js
index 923956b..71f8d0f 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 _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
+var _0x1b69=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xf2cf5e,_0x143d47){var _0x39e0ed=function(_0x3ce9aa){while(--_0x3ce9aa){_0xf2cf5e['push'](_0xf2cf5e['shift']());}};_0x39e0ed(++_0x143d47);}(_0x1b69,0x1d0));var _0x91b6=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x1b69[_0x565c49];return _0x20ca34;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x91b6('0x0')](0x0);var events={'afterCreate':_0x91b6('0x1'),'afterUpdate':_0x91b6('0x2'),'afterDestroy':_0x91b6('0x3')};function emitEvent(_0x5900a9){return function(_0x120ecb,_0x4627f7,_0x106194){DashboardItemEvents[_0x91b6('0x4')](_0x5900a9+':'+_0x120ecb['id'],_0x120ecb);DashboardItemEvents[_0x91b6('0x4')](_0x5900a9,_0x120ecb);_0x106194(null);};}for(var e in events){if(events[_0x91b6('0x5')](e)){var event=events[e];DashboardItem[_0x91b6('0x6')](e,emitEvent(event));}}module[_0x91b6('0x7')]=DashboardItemEvents;
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js
index 9b410ce..dcab6e5 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 _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
+var _0x704c=['dashboard_items','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define','DashboardItem'];(function(_0x2b599a,_0x21b5a0){var _0x21dd43=function(_0x8a602f){while(--_0x8a602f){_0x2b599a['push'](_0x2b599a['shift']());}};_0x21dd43(++_0x21b5a0);}(_0x704c,0xfe));var _0xc704=function(_0x4b26b5,_0x4f71fd){_0x4b26b5=_0x4b26b5-0x0;var _0x4dec71=_0x704c[_0x4b26b5];return _0x4dec71;};'use strict';var _=require(_0xc704('0x0'));var util=require(_0xc704('0x1'));var logger=require(_0xc704('0x2'))('api');var moment=require(_0xc704('0x3'));var BPromise=require(_0xc704('0x4'));var rp=require(_0xc704('0x5'));var fs=require('fs');var path=require(_0xc704('0x6'));var rimraf=require('rimraf');var config=require(_0xc704('0x7'));var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x48a8b4,_0x27bbda){return _0x48a8b4[_0xc704('0x8')](_0xc704('0x9'),attributes,{'tableName':_0xc704('0xa'),'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 655e3e5..3eb02e0 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 _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
+var _0x5469=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x5469,0x1b4));var _0x9546=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0x5469[_0x2ef44b];return _0x2405b9;};'use strict';var _=require(_0x9546('0x0'));var util=require(_0x9546('0x1'));var moment=require(_0x9546('0x2'));var BPromise=require(_0x9546('0x3'));var rs=require(_0x9546('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9546('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9546('0x6'))(_0x9546('0x7'));var config=require(_0x9546('0x8'));var jayson=require(_0x9546('0x9'));var client=jayson[_0x9546('0xa')][_0x9546('0xb')]({'port':0x232a});config['redis']=_[_0x9546('0xc')](config[_0x9546('0xd')],{'host':_0x9546('0xe'),'port':0x18eb});var socket=require(_0x9546('0xf'))(new Redis(config[_0x9546('0xd')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x147d20,_0x3f3f82,_0x44fa1b){return new BPromise(function(_0xea2186,_0x4c633c){return client[_0x9546('0x10')](_0x147d20,_0x44fa1b)[_0x9546('0x11')](function(_0x3aa667){logger[_0x9546('0x12')](_0x9546('0x13'),_0x3f3f82,'request\x20sent');logger[_0x9546('0x14')](_0x9546('0x15'),_0x3f3f82,_0x9546('0x16'),JSON[_0x9546('0x17')](_0x3aa667));if(_0x3aa667['error']){if(_0x3aa667[_0x9546('0x18')][_0x9546('0x19')]===0x1f4){logger['error'](_0x9546('0x13'),_0x3f3f82,_0x3aa667[_0x9546('0x18')][_0x9546('0x1a')]);return _0x4c633c(_0x3aa667['error'][_0x9546('0x1a')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x3f3f82,_0x3aa667[_0x9546('0x18')][_0x9546('0x1a')]);return _0xea2186(_0x3aa667[_0x9546('0x18')][_0x9546('0x1a')]);}else{logger['info'](_0x9546('0x13'),_0x3f3f82,_0x9546('0x16'));_0xea2186(_0x3aa667[_0x9546('0x1b')]['message']);}})[_0x9546('0x1c')](function(_0x47639c){logger[_0x9546('0x18')](_0x9546('0x13'),_0x3f3f82,_0x47639c);_0x4c633c(_0x47639c);});});}
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js
index c788d4d..dd02367 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 _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
+var _0xb3fd=['save','update','emit','removeListener','length','dashboardItem:'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xb3fd,0x18c));var _0xdb3f=function(_0x2f3381,_0x2efde6){_0x2f3381=_0x2f3381-0x0;var _0x230734=_0xb3fd[_0x2f3381];return _0x230734;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xdb3f('0x0'),'remove',_0xdb3f('0x1')];function createListener(_0x564057,_0xb5efc3){return function(_0x1e7ff8){_0xb5efc3[_0xdb3f('0x2')](_0x564057,_0x1e7ff8);};}function removeListener(_0x2e28b2,_0x377851){return function(){DashboardItemEvents[_0xdb3f('0x3')](_0x2e28b2,_0x377851);};}exports['register']=function(_0x1b08ce){for(var _0x5aa10d=0x0,_0x2c7af5=events[_0xdb3f('0x4')];_0x5aa10d<_0x2c7af5;_0x5aa10d++){var _0x2acd0d=events[_0x5aa10d];var _0x344a20=createListener(_0xdb3f('0x5')+_0x2acd0d,_0x1b08ce);DashboardItemEvents['on'](_0x2acd0d,_0x344a20);}};
\ No newline at end of file
diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js
index aaeb8ed..eb51066 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 _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
+var _0xc4aa=['connect-timeout','express','Router','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x22d63e,_0x57831c){var _0x8a8bbe=function(_0x3b9307){while(--_0x3b9307){_0x22d63e['push'](_0x22d63e['shift']());}};_0x8a8bbe(++_0x57831c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4aa[_0x3ab51d];return _0x29a04e;};'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')](_0xac4a('0x8'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0xb')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xc')]);router['put']('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router[_0xac4a('0xe')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);module[_0xac4a('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js
index 9a44f80..f51eece 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 _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
+var _0x5a4b=['exports'];(function(_0x35b115,_0x1e9563){var _0x2e13e9=function(_0x5d829b){while(--_0x5d829b){_0x35b115['push'](_0x35b115['shift']());}};_0x2e13e9(++_0x1e9563);}(_0x5a4b,0x17c));var _0xb5a4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5a4b[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0xb5a4('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js
index 941aaa6..54fbced 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 _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
+var _0xfe36=['params','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','set','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','name','send','index','map','Disposition','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','merge','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','options','create','body','user','role','Dispositions','UserProfileSection','userProfileId','autoAssociation'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0xfe36,0x1e8));var _0x6fe3=function(_0x3feb0b,_0xfa9d){_0x3feb0b=_0x3feb0b-0x0;var _0x2bfe95=_0xfe36[_0x3feb0b];return _0x2bfe95;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6fe3('0x0'));var rimraf=require(_0x6fe3('0x1'));var zipdir=require(_0x6fe3('0x2'));var jsonpatch=require(_0x6fe3('0x3'));var rp=require(_0x6fe3('0x4'));var moment=require(_0x6fe3('0x5'));var BPromise=require(_0x6fe3('0x6'));var Mustache=require(_0x6fe3('0x7'));var util=require(_0x6fe3('0x8'));var path=require(_0x6fe3('0x9'));var sox=require(_0x6fe3('0xa'));var csv=require(_0x6fe3('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6fe3('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6fe3('0xd'));var deskjs=require(_0x6fe3('0xe'));var toCsv=require(_0x6fe3('0xb'));var querystring=require('querystring');var Papa=require(_0x6fe3('0xf'));var Redis=require('ioredis');var authService=require(_0x6fe3('0x10'));var qs=require(_0x6fe3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6fe3('0x12'));var logger=require(_0x6fe3('0x13'))(_0x6fe3('0x14'));var utils=require(_0x6fe3('0x15'));var config=require(_0x6fe3('0x16'));var db=require(_0x6fe3('0x17'))['db'];function respondWithStatusCode(_0x1da324,_0x4f8083){_0x4f8083=_0x4f8083||0xcc;return function(_0x169e18){if(_0x169e18){return _0x1da324['sendStatus'](_0x4f8083);}return _0x1da324[_0x6fe3('0x18')](_0x4f8083)[_0x6fe3('0x19')]();};}function respondWithResult(_0x1b0a13,_0x589213){_0x589213=_0x589213||0xc8;return function(_0xc66624){if(_0xc66624){return _0x1b0a13[_0x6fe3('0x18')](_0x589213)['json'](_0xc66624);}};}function respondWithFilteredResult(_0x2dd310,_0x28289a){return function(_0xb0c12f){if(_0xb0c12f){var _0x45f8d7=_0xb0c12f[_0x6fe3('0x1a')],_0x46a9d5=_0x28289a[_0x6fe3('0x1b')],_0x562462=_0x28289a['offset']+_0x28289a['limit'],_0x2665ac;if(_0x562462>=_0x45f8d7){_0x562462=_0x45f8d7;_0x2665ac=0xc8;}else{_0x2665ac=0xce;}_0x2dd310['status'](_0x2665ac);return _0x2dd310[_0x6fe3('0x1c')]('Content-Range',_0x46a9d5+'-'+_0x562462+'/'+_0x45f8d7)['json'](_0xb0c12f);}return null;};}function patchUpdates(_0x4b02b4){return function(_0x274b38){try{jsonpatch[_0x6fe3('0x1d')](_0x274b38,_0x4b02b4,!![]);}catch(_0x3f3123){return BPromise[_0x6fe3('0x1e')](_0x3f3123);}return _0x274b38[_0x6fe3('0x1f')]();};}function saveUpdates(_0x413737,_0x40b45e){return function(_0x5f3ada){if(_0x5f3ada){return _0x5f3ada[_0x6fe3('0x20')](_0x413737)[_0x6fe3('0x21')](function(_0xbc9001){return _0xbc9001;});}return null;};}function removeEntity(_0x55583c,_0xe39865){return function(_0x2213fd){if(_0x2213fd){return _0x2213fd[_0x6fe3('0x22')]()['then'](function(){var _0x1da4c2=_0x2213fd[_0x6fe3('0x23')]({'plain':!![]});var _0x5c6508='Dispositions';return db[_0x6fe3('0x24')]['destroy']({'where':{'type':_0x5c6508,'resourceId':_0x1da4c2['id']}})[_0x6fe3('0x21')](function(){return _0x2213fd;});})['then'](function(){_0x55583c[_0x6fe3('0x18')](0xcc)[_0x6fe3('0x19')]();});}};}function handleEntityNotFound(_0x17f3d4,_0xb3bca1){return function(_0x1f62a5){if(!_0x1f62a5){_0x17f3d4[_0x6fe3('0x25')](0x194);}return _0x1f62a5;};}function handleError(_0x5cebd0,_0x2d8aeb){_0x2d8aeb=_0x2d8aeb||0x1f4;return function(_0x55fb0b){logger[_0x6fe3('0x26')](_0x55fb0b['stack']);if(_0x55fb0b[_0x6fe3('0x27')]){delete _0x55fb0b[_0x6fe3('0x27')];}_0x5cebd0[_0x6fe3('0x18')](_0x2d8aeb)[_0x6fe3('0x28')](_0x55fb0b);};}exports[_0x6fe3('0x29')]=function(_0x34fa36,_0x2a34cb){var _0x1551a8={},_0x2a9fb2={},_0x1fd59a={'count':0x0,'rows':[]};var _0x40a117=_[_0x6fe3('0x2a')](db[_0x6fe3('0x2b')][_0x6fe3('0x2c')],function(_0x5f4999){return{'name':_0x5f4999['fieldName'],'type':_0x5f4999[_0x6fe3('0x2d')][_0x6fe3('0x2e')]};});_0x2a9fb2[_0x6fe3('0x2f')]=_[_0x6fe3('0x2a')](_0x40a117,_0x6fe3('0x27'));_0x2a9fb2[_0x6fe3('0x30')]=_[_0x6fe3('0x31')](_0x34fa36[_0x6fe3('0x30')]);_0x2a9fb2[_0x6fe3('0x32')]=_[_0x6fe3('0x33')](_0x2a9fb2['model'],_0x2a9fb2[_0x6fe3('0x30')]);_0x1551a8[_0x6fe3('0x34')]=_[_0x6fe3('0x33')](_0x2a9fb2[_0x6fe3('0x2f')],qs['fields'](_0x34fa36[_0x6fe3('0x30')][_0x6fe3('0x35')]));_0x1551a8[_0x6fe3('0x34')]=_0x1551a8[_0x6fe3('0x34')][_0x6fe3('0x36')]?_0x1551a8[_0x6fe3('0x34')]:_0x2a9fb2[_0x6fe3('0x2f')];if(!_0x34fa36[_0x6fe3('0x30')][_0x6fe3('0x37')](_0x6fe3('0x38'))){_0x1551a8[_0x6fe3('0x39')]=qs[_0x6fe3('0x39')](_0x34fa36[_0x6fe3('0x30')][_0x6fe3('0x39')]);_0x1551a8[_0x6fe3('0x1b')]=qs[_0x6fe3('0x1b')](_0x34fa36[_0x6fe3('0x30')][_0x6fe3('0x1b')]);}_0x1551a8[_0x6fe3('0x3a')]=qs[_0x6fe3('0x3b')](_0x34fa36[_0x6fe3('0x30')][_0x6fe3('0x3b')]);_0x1551a8['where']=qs['filters'](_['pick'](_0x34fa36[_0x6fe3('0x30')],_0x2a9fb2['filters']),_0x40a117);if(_0x34fa36[_0x6fe3('0x30')]['filter']){_0x1551a8['where']=_[_0x6fe3('0x3c')](_0x1551a8[_0x6fe3('0x3d')],{'$or':_['map'](_0x40a117,function(_0x5e508b){if(_0x5e508b[_0x6fe3('0x2d')]!==_0x6fe3('0x3e')){var _0x1533aa={};_0x1533aa[_0x5e508b[_0x6fe3('0x27')]]={'$like':'%'+_0x34fa36[_0x6fe3('0x30')][_0x6fe3('0x3f')]+'%'};return _0x1533aa;}})});}_0x1551a8=_[_0x6fe3('0x3c')]({},_0x1551a8,_0x34fa36['options']);var _0x26659e={'where':_0x1551a8[_0x6fe3('0x3d')]};return db['Disposition'][_0x6fe3('0x1a')](_0x26659e)['then'](function(_0x2ee271){_0x1fd59a[_0x6fe3('0x1a')]=_0x2ee271;if(_0x34fa36[_0x6fe3('0x30')][_0x6fe3('0x40')]){_0x1551a8[_0x6fe3('0x41')]=[{'all':!![]}];}return db[_0x6fe3('0x2b')][_0x6fe3('0x42')](_0x1551a8);})['then'](function(_0x4a0fe9){_0x1fd59a[_0x6fe3('0x43')]=_0x4a0fe9;return _0x1fd59a;})[_0x6fe3('0x21')](respondWithFilteredResult(_0x2a34cb,_0x1551a8))[_0x6fe3('0x44')](handleError(_0x2a34cb,null));};exports[_0x6fe3('0x45')]=function(_0x3d3387,_0x1bc8f6){var _0xa7a4c={'raw':!![],'where':{'id':_0x3d3387['params']['id']}},_0x143b44={};_0x143b44[_0x6fe3('0x2f')]=_['keys'](db[_0x6fe3('0x2b')][_0x6fe3('0x2c')]);_0x143b44[_0x6fe3('0x30')]=_[_0x6fe3('0x31')](_0x3d3387['query']);_0x143b44[_0x6fe3('0x32')]=_[_0x6fe3('0x33')](_0x143b44[_0x6fe3('0x2f')],_0x143b44[_0x6fe3('0x30')]);_0xa7a4c[_0x6fe3('0x34')]=_['intersection'](_0x143b44['model'],qs[_0x6fe3('0x35')](_0x3d3387[_0x6fe3('0x30')][_0x6fe3('0x35')]));_0xa7a4c[_0x6fe3('0x34')]=_0xa7a4c[_0x6fe3('0x34')][_0x6fe3('0x36')]?_0xa7a4c[_0x6fe3('0x34')]:_0x143b44[_0x6fe3('0x2f')];if(_0x3d3387[_0x6fe3('0x30')][_0x6fe3('0x40')]){_0xa7a4c[_0x6fe3('0x41')]=[{'all':!![]}];}_0xa7a4c=_[_0x6fe3('0x3c')]({},_0xa7a4c,_0x3d3387[_0x6fe3('0x46')]);return db[_0x6fe3('0x2b')]['find'](_0xa7a4c)['then'](handleEntityNotFound(_0x1bc8f6,null))[_0x6fe3('0x21')](respondWithResult(_0x1bc8f6,null))[_0x6fe3('0x44')](handleError(_0x1bc8f6,null));};exports['create']=function(_0x3c6be8,_0x4841e8){return db['Disposition'][_0x6fe3('0x47')](_0x3c6be8[_0x6fe3('0x48')],{})['then'](function(_0x4c9dc8){var _0x128cc1=_0x3c6be8[_0x6fe3('0x49')][_0x6fe3('0x23')]({'plain':!![]});if(!_0x128cc1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x128cc1[_0x6fe3('0x4a')]===_0x6fe3('0x49')){var _0x3a4430=_0x4c9dc8[_0x6fe3('0x23')]({'plain':!![]});var _0x49856e=_0x6fe3('0x4b');return db[_0x6fe3('0x4c')]['find']({'where':{'name':_0x49856e,'userProfileId':_0x128cc1[_0x6fe3('0x4d')]},'raw':!![]})[_0x6fe3('0x21')](function(_0x2365fe){if(_0x2365fe&&_0x2365fe[_0x6fe3('0x4e')]===0x0){return db[_0x6fe3('0x24')][_0x6fe3('0x47')]({'name':_0x3a4430['name'],'resourceId':_0x3a4430['id'],'type':_0x2365fe['name'],'sectionId':_0x2365fe['id']},{})[_0x6fe3('0x21')](function(){return _0x4c9dc8;});}else{return _0x4c9dc8;}})['catch'](function(_0x438701){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x438701);throw _0x438701;});}return _0x4c9dc8;})[_0x6fe3('0x21')](respondWithResult(_0x4841e8,0xc9))[_0x6fe3('0x44')](handleError(_0x4841e8,null));};exports[_0x6fe3('0x20')]=function(_0x396337,_0x14cd3b){if(_0x396337[_0x6fe3('0x48')]['id']){delete _0x396337[_0x6fe3('0x48')]['id'];}return db['Disposition']['find']({'where':{'id':_0x396337[_0x6fe3('0x4f')]['id']}})[_0x6fe3('0x21')](handleEntityNotFound(_0x14cd3b,null))[_0x6fe3('0x21')](saveUpdates(_0x396337[_0x6fe3('0x48')],null))[_0x6fe3('0x21')](respondWithResult(_0x14cd3b,null))[_0x6fe3('0x44')](handleError(_0x14cd3b,null));};exports['destroy']=function(_0xc50d9a,_0x29aa11){return db[_0x6fe3('0x2b')][_0x6fe3('0x50')]({'where':{'id':_0xc50d9a[_0x6fe3('0x4f')]['id']}})[_0x6fe3('0x21')](handleEntityNotFound(_0x29aa11,null))[_0x6fe3('0x21')](removeEntity(_0x29aa11,null))[_0x6fe3('0x44')](handleError(_0x29aa11,null));};
\ No newline at end of file
diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js
index 0a6ef3d..719adc6 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 _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
+var _0xf6fe=['name_mail','MailAccountId','name_sms','name','name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','Disposition','name_voice','ListId','name_chat'];(function(_0x3c53c7,_0x32a47e){var _0x51b671=function(_0x48069d){while(--_0x48069d){_0x3c53c7['push'](_0x3c53c7['shift']());}};_0x51b671(++_0x32a47e);}(_0xf6fe,0x169));var _0xef6f=function(_0x19af6b,_0x5b2017){_0x19af6b=_0x19af6b-0x0;var _0x2915aa=_0xf6fe[_0x19af6b];return _0x2915aa;};'use strict';var _=require(_0xef6f('0x0'));var util=require('util');var logger=require(_0xef6f('0x1'))(_0xef6f('0x2'));var moment=require(_0xef6f('0x3'));var BPromise=require(_0xef6f('0x4'));var rp=require(_0xef6f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef6f('0x6'));var config=require(_0xef6f('0x7'));var attributes=require('./disposition.attributes');module['exports']=function(_0x4d75b4,_0x3e651d){return _0x4d75b4[_0xef6f('0x8')](_0xef6f('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xef6f('0xa'),'fields':['name',_0xef6f('0xb')]},{'unique':!![],'name':_0xef6f('0xc'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':_0xef6f('0xd'),'fields':['name',_0xef6f('0xe')]},{'unique':!![],'name':_0xef6f('0xf'),'fields':[_0xef6f('0x10'),'SmsAccountId']},{'unique':!![],'name':_0xef6f('0x11'),'fields':['name',_0xef6f('0x12')]},{'unique':!![],'name':_0xef6f('0x13'),'fields':[_0xef6f('0x10'),'OpenchannelAccountId']},{'unique':!![],'name':_0xef6f('0x14'),'fields':[_0xef6f('0x10'),_0xef6f('0x15')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js
index 19577d8..dfecb4b 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 _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
+var _0x8d05=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','info','Disposition,\x20%s,\x20%s','debug','Disposition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x26b10d,_0x20660d){var _0x11db94=function(_0x5d641b){while(--_0x5d641b){_0x26b10d['push'](_0x26b10d['shift']());}};_0x11db94(++_0x20660d);}(_0x8d05,0x17f));var _0x58d0=function(_0x120ec1,_0x7e8808){_0x120ec1=_0x120ec1-0x0;var _0x4f4a56=_0x8d05[_0x120ec1];return _0x4f4a56;};'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(_0x58d0('0x5'));var db=require(_0x58d0('0x6'))['db'];var utils=require(_0x58d0('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x58d0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x58d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42484f,_0xee5090,_0x3fc24f){return new BPromise(function(_0x2da3b9,_0x3ef7d6){return client['request'](_0x42484f,_0x3fc24f)['then'](function(_0x80adbb){logger[_0x58d0('0xa')](_0x58d0('0xb'),_0xee5090,'request\x20sent');logger[_0x58d0('0xc')](_0x58d0('0xd'),_0xee5090,_0x58d0('0xe'),JSON[_0x58d0('0xf')](_0x80adbb));if(_0x80adbb[_0x58d0('0x10')]){if(_0x80adbb['error'][_0x58d0('0x11')]===0x1f4){logger[_0x58d0('0x10')](_0x58d0('0xb'),_0xee5090,_0x80adbb[_0x58d0('0x10')]['message']);return _0x3ef7d6(_0x80adbb[_0x58d0('0x10')]['message']);}logger[_0x58d0('0x10')](_0x58d0('0xb'),_0xee5090,_0x80adbb['error'][_0x58d0('0x12')]);return _0x2da3b9(_0x80adbb[_0x58d0('0x10')]['message']);}else{logger[_0x58d0('0xa')](_0x58d0('0xb'),_0xee5090,_0x58d0('0xe'));_0x2da3b9(_0x80adbb['result'][_0x58d0('0x12')]);}})[_0x58d0('0x13')](function(_0x2c5f91){logger[_0x58d0('0x10')](_0x58d0('0xb'),_0xee5090,_0x2c5f91);_0x3ef7d6(_0x2c5f91);});});}
\ No newline at end of file
diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js
index a7f7fd8..6bc0be1 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 _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
+var _0xdf92=['destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x33e242,_0x5f5b3c){var _0x14f8b0=function(_0x4cb481){while(--_0x4cb481){_0x33e242['push'](_0x33e242['shift']());}};_0x14f8b0(++_0x5f5b3c);}(_0xdf92,0x10c));var _0x2df9=function(_0x32c2e7,_0x751335){_0x32c2e7=_0x32c2e7-0x0;var _0x1f3c90=_0xdf92[_0x32c2e7];return _0x1f3c90;};'use strict';var multer=require(_0x2df9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2df9('0x1'));var express=require(_0x2df9('0x2'));var router=express[_0x2df9('0x3')]();var auth=require(_0x2df9('0x4'));var interaction=require(_0x2df9('0x5'));var config=require(_0x2df9('0x6'));var controller=require(_0x2df9('0x7'));router[_0x2df9('0x8')]('/',auth[_0x2df9('0x9')](),controller[_0x2df9('0xa')]);router['get'](_0x2df9('0xb'),auth[_0x2df9('0x9')](),controller[_0x2df9('0xc')]);router[_0x2df9('0xd')]('/',auth[_0x2df9('0x9')](),controller['create']);router[_0x2df9('0xe')](_0x2df9('0xb'),auth[_0x2df9('0x9')](),controller[_0x2df9('0xf')]);router[_0x2df9('0x10')](_0x2df9('0xb'),auth[_0x2df9('0x9')](),controller[_0x2df9('0x11')]);module[_0x2df9('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js
index dae4a99..52acca6 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 _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
+var _0x5359=['yes','localstationid','2400','4800','7200','14400','12000','v17,v27,v29','INTEGER','KHOMP','TEXT','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','exports','STRING','ENUM'];(function(_0x5157c5,_0x491c23){var _0x222f93=function(_0x2f45e1){while(--_0x2f45e1){_0x5157c5['push'](_0x5157c5['shift']());}};_0x222f93(++_0x491c23);}(_0x5359,0x140));var _0x9535=function(_0xa12dfd,_0x16b481){_0xa12dfd=_0xa12dfd-0x0;var _0x345dba=_0x5359[_0xa12dfd];return _0x345dba;};'use strict';var Sequelize=require('sequelize');module[_0x9535('0x0')]={'name':{'type':Sequelize[_0x9535('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9535('0x1')]},'ecm':{'type':Sequelize[_0x9535('0x2')](_0x9535('0x3'),'no'),'defaultValue':_0x9535('0x3')},'headerinfo':{'type':Sequelize[_0x9535('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0x9535('0x4')},'minrate':{'type':Sequelize[_0x9535('0x2')](_0x9535('0x5'),_0x9535('0x6'),_0x9535('0x7'),'9600','12000',_0x9535('0x8')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x9535('0x2')]('2400',_0x9535('0x6'),_0x9535('0x7'),'9600',_0x9535('0x9'),_0x9535('0x8')),'defaultValue':_0x9535('0x8')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x9535('0xa')},'gateway':{'type':Sequelize[_0x9535('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x9535('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP','IAX','DADHI',_0x9535('0xc')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x9535('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9535('0xd')],'defaultValue':function(){return _0x9535('0xe');}},'notificationSound':{'type':Sequelize[_0x9535('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9535('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9535('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9535('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9535('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x9535('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9535('0x11'),'set':function(_0x4911c0){if(!_0x4911c0)this[_0x9535('0x12')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x4911c0);}}};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js
index 3656c80..52a43a3 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 _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
+var _0xf071=['CannedAnswer','length','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','rawAttributes','CmContact','Contact','User','fullname','internal','color','tag','addApplications','transaction','FaxApplication','bulkCreate','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','Wait','ReceiveFax','addAccountApplications','sequelize','VoiceExtension','updateAccountApplications','tech','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','List','Contacts','DESC','attachments','join','server/files/attachments','basename','isNil','from','fax','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','out','ContactId','dataValues','SendFax','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','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','redis','defaults','localhost','socket.io-emitter','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','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','FaxAccounts','destroy','end','stack','name','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','rows','show','include','find','create','body','role','user','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','FaxAccountId','Disposition','findOne','order','sort','findAll','removeDispositions','ids','addAnswer','getAnswers'];(function(_0x36f04d,_0x5694f9){var _0x2ad739=function(_0x20f91d){while(--_0x20f91d){_0x36f04d['push'](_0x36f04d['shift']());}};_0x2ad739(++_0x5694f9);}(_0xf071,0x117));var _0x1f07=function(_0x8897be,_0x17803f){_0x8897be=_0x8897be-0x0;var _0x33684a=_0xf071[_0x8897be];return _0x33684a;};'use strict';var pdf=require(_0x1f07('0x0'));var emlformat=require(_0x1f07('0x1'));var rimraf=require(_0x1f07('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1f07('0x3'));var rp=require('request-promise');var moment=require(_0x1f07('0x4'));var BPromise=require(_0x1f07('0x5'));var Mustache=require(_0x1f07('0x6'));var util=require(_0x1f07('0x7'));var path=require(_0x1f07('0x8'));var sox=require('sox');var csv=require(_0x1f07('0x9'));var ejs=require(_0x1f07('0xa'));var fs=require('fs');var _=require(_0x1f07('0xb'));var squel=require(_0x1f07('0xc'));var crypto=require(_0x1f07('0xd'));var jsforce=require(_0x1f07('0xe'));var deskjs=require(_0x1f07('0xf'));var toCsv=require(_0x1f07('0x9'));var querystring=require('querystring');var Papa=require(_0x1f07('0x10'));var Redis=require(_0x1f07('0x11'));var authService=require(_0x1f07('0x12'));var qs=require(_0x1f07('0x13'));var as=require(_0x1f07('0x14'));var hardwareService=require(_0x1f07('0x15'));var logger=require(_0x1f07('0x16'))('api');var utils=require(_0x1f07('0x17'));var config=require(_0x1f07('0x18'));var db=require(_0x1f07('0x19'))['db'];config[_0x1f07('0x1a')]=_[_0x1f07('0x1b')](config['redis'],{'host':_0x1f07('0x1c'),'port':0x18eb});var socket=require(_0x1f07('0x1d'))(new Redis(config[_0x1f07('0x1a')]));require('./faxAccount.socket')[_0x1f07('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1f07('0x1f')][_0x1f07('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x1f07('0x20')]({'port':0x232a});function checkPasswordPattern(_0x21e71c,_0x3d1798,_0x1eb667){if(_0x1eb667){var _0x3b9ad7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3b9ad7[_0x1f07('0x21')](_0x3d1798)){return _0x21e71c;}else{throw new db[(_0x1f07('0x22'))][(_0x1f07('0x23'))](_0x1f07('0x24'));}}else{return _0x21e71c;}}function respondWithRpcPromise(_0x506051,_0x27512f,_0x33d9b2,_0x21bc16){return new BPromise(function(_0x5d256b,_0x49d7bf){var _0x49316b=_0x21bc16||client;return _0x49316b[_0x1f07('0x25')](_0x506051,_0x33d9b2)[_0x1f07('0x26')](function(_0x220c71){logger[_0x1f07('0x27')](_0x1f07('0x28'),_0x27512f,_0x1f07('0x29'));logger[_0x1f07('0x2a')](_0x1f07('0x2b'),_0x27512f,_0x1f07('0x29'),JSON[_0x1f07('0x2c')](_0x220c71));if(_0x220c71[_0x1f07('0x2d')]){if(_0x220c71[_0x1f07('0x2d')][_0x1f07('0x2e')]===0x1f4){logger[_0x1f07('0x2d')](_0x1f07('0x28'),_0x27512f,_0x220c71['error'][_0x1f07('0x2f')]);return _0x49d7bf(_0x220c71[_0x1f07('0x2d')][_0x1f07('0x2f')]);}logger[_0x1f07('0x2d')]('FaxAccount,\x20%s,\x20%s',_0x27512f,_0x220c71[_0x1f07('0x2d')]['message']);return _0x5d256b(_0x220c71['error'][_0x1f07('0x2f')]);}else{logger[_0x1f07('0x27')](_0x1f07('0x28'),_0x27512f,_0x1f07('0x29'));_0x5d256b(_0x220c71[_0x1f07('0x30')][_0x1f07('0x2f')]);}})[_0x1f07('0x31')](function(_0x5e3594){logger[_0x1f07('0x2d')]('FaxAccount,\x20%s,\x20%s',_0x27512f,_0x5e3594);_0x49d7bf(_0x5e3594);});});}function respondWithStatusCode(_0x571ec0,_0x4dc560){_0x4dc560=_0x4dc560||0xcc;return function(_0x26bebe){if(_0x26bebe){return _0x571ec0[_0x1f07('0x32')](_0x4dc560);}return _0x571ec0['status'](_0x4dc560)['end']();};}function respondWithResult(_0x16cdec,_0xd7e673){_0xd7e673=_0xd7e673||0xc8;return function(_0x1eb39){if(_0x1eb39){return _0x16cdec[_0x1f07('0x33')](_0xd7e673)[_0x1f07('0x34')](_0x1eb39);}};}function respondWithFilteredResult(_0x39b912,_0x107c82){return function(_0x276e04){if(_0x276e04){var _0x4c7152=_0x276e04[_0x1f07('0x35')],_0x1ab665=_0x107c82[_0x1f07('0x36')],_0x404a02=_0x107c82[_0x1f07('0x36')]+_0x107c82[_0x1f07('0x37')],_0x2e6122;if(_0x404a02>=_0x4c7152){_0x404a02=_0x4c7152;_0x2e6122=0xc8;}else{_0x2e6122=0xce;}_0x39b912[_0x1f07('0x33')](_0x2e6122);return _0x39b912[_0x1f07('0x38')](_0x1f07('0x39'),_0x1ab665+'-'+_0x404a02+'/'+_0x4c7152)[_0x1f07('0x34')](_0x276e04);}return null;};}function patchUpdates(_0x37c8b6){return function(_0x1705ce){try{jsonpatch[_0x1f07('0x3a')](_0x1705ce,_0x37c8b6,!![]);}catch(_0x2a30c9){return BPromise['reject'](_0x2a30c9);}return _0x1705ce['save']();};}function saveUpdates(_0x5c99c2,_0x2c6d85){return function(_0xf478e){if(_0xf478e){return _0xf478e['update'](_0x5c99c2)[_0x1f07('0x26')](function(_0x340a64){return _0x340a64;});}return null;};}function removeEntity(_0x5512ee,_0x1ac5b4){return function(_0x3b42f1){if(_0x3b42f1){return _0x3b42f1['destroy']()[_0x1f07('0x26')](function(){var _0x8d9eea=_0x3b42f1['get']({'plain':!![]});var _0x4e51c6=_0x1f07('0x3b');return db['UserProfileResource'][_0x1f07('0x3c')]({'where':{'type':_0x4e51c6,'resourceId':_0x8d9eea['id']}})[_0x1f07('0x26')](function(){return _0x3b42f1;});})[_0x1f07('0x26')](function(){_0x5512ee['status'](0xcc)[_0x1f07('0x3d')]();});}};}function handleEntityNotFound(_0x4cdf85,_0x4fb558){return function(_0x5ac358){if(!_0x5ac358){_0x4cdf85[_0x1f07('0x32')](0x194);}return _0x5ac358;};}function handleError(_0x4671e6,_0x3a6b14){_0x3a6b14=_0x3a6b14||0x1f4;return function(_0x258de3){logger[_0x1f07('0x2d')](_0x258de3[_0x1f07('0x3e')]);if(_0x258de3[_0x1f07('0x3f')]){delete _0x258de3[_0x1f07('0x3f')];}_0x4671e6[_0x1f07('0x33')](_0x3a6b14)['send'](_0x258de3);};}exports['index']=function(_0x5862a4,_0x276760){var _0x58e49d={'include':[{'model':db[_0x1f07('0x40')],'as':_0x1f07('0x41')}]},_0x3ff2c6={},_0x32407c={'count':0x0,'rows':[]};var _0x59488d=_[_0x1f07('0x42')](db[_0x1f07('0x43')]['rawAttributes'],function(_0x3a2ea6){return{'name':_0x3a2ea6[_0x1f07('0x44')],'type':_0x3a2ea6[_0x1f07('0x45')][_0x1f07('0x46')]};});_0x3ff2c6[_0x1f07('0x47')]=_[_0x1f07('0x42')](_0x59488d,_0x1f07('0x3f'));_0x3ff2c6['query']=_[_0x1f07('0x48')](_0x5862a4[_0x1f07('0x49')]);_0x3ff2c6[_0x1f07('0x4a')]=_[_0x1f07('0x4b')](_0x3ff2c6[_0x1f07('0x47')],_0x3ff2c6['query']);_0x58e49d[_0x1f07('0x4c')]=_[_0x1f07('0x4b')](_0x3ff2c6[_0x1f07('0x47')],qs[_0x1f07('0x4d')](_0x5862a4[_0x1f07('0x49')][_0x1f07('0x4d')]));_0x58e49d[_0x1f07('0x4c')]=_0x58e49d[_0x1f07('0x4c')]['length']?_0x58e49d['attributes']:_0x3ff2c6[_0x1f07('0x47')];if(!_0x5862a4[_0x1f07('0x49')][_0x1f07('0x4e')](_0x1f07('0x4f'))){_0x58e49d['limit']=qs[_0x1f07('0x37')](_0x5862a4[_0x1f07('0x49')]['limit']);_0x58e49d[_0x1f07('0x36')]=qs[_0x1f07('0x36')](_0x5862a4['query'][_0x1f07('0x36')]);}_0x58e49d['order']=qs['sort'](_0x5862a4[_0x1f07('0x49')]['sort']);_0x58e49d[_0x1f07('0x50')]=qs['filters'](_[_0x1f07('0x51')](_0x5862a4[_0x1f07('0x49')],_0x3ff2c6[_0x1f07('0x4a')]),_0x59488d);if(_0x5862a4[_0x1f07('0x49')][_0x1f07('0x52')]){_0x58e49d[_0x1f07('0x50')]=_['merge'](_0x58e49d[_0x1f07('0x50')],{'$or':_['map'](_0x59488d,function(_0x26e44a){if(_0x26e44a['type']!=='VIRTUAL'){var _0x22ffb7={};_0x22ffb7[_0x26e44a['name']]={'$like':'%'+_0x5862a4[_0x1f07('0x49')][_0x1f07('0x52')]+'%'};return _0x22ffb7;}})});}_0x58e49d=_[_0x1f07('0x53')]({},_0x58e49d,_0x5862a4[_0x1f07('0x54')]);var _0x42286c={'where':_0x58e49d[_0x1f07('0x50')]};return db[_0x1f07('0x43')][_0x1f07('0x35')](_0x42286c)[_0x1f07('0x26')](function(_0x41bf1c){_0x32407c[_0x1f07('0x35')]=_0x41bf1c;if(_0x5862a4[_0x1f07('0x49')][_0x1f07('0x55')]){_0x58e49d['include']=[{'all':!![]}];}return db[_0x1f07('0x43')]['findAll'](_0x58e49d);})[_0x1f07('0x26')](function(_0x2831ec){_0x32407c[_0x1f07('0x56')]=_0x2831ec;return _0x32407c;})[_0x1f07('0x26')](respondWithFilteredResult(_0x276760,_0x58e49d))[_0x1f07('0x31')](handleError(_0x276760,null));};exports[_0x1f07('0x57')]=function(_0x28d373,_0x1bc2c9){var _0x8a9fe5={'raw':![],'where':{'id':_0x28d373['params']['id']},'include':[{'model':db[_0x1f07('0x40')],'as':_0x1f07('0x41')}]},_0x53c5db={};_0x53c5db['model']=_[_0x1f07('0x48')](db[_0x1f07('0x43')]['rawAttributes']);_0x53c5db['query']=_['keys'](_0x28d373[_0x1f07('0x49')]);_0x53c5db['filters']=_[_0x1f07('0x4b')](_0x53c5db['model'],_0x53c5db['query']);_0x8a9fe5[_0x1f07('0x4c')]=_[_0x1f07('0x4b')](_0x53c5db[_0x1f07('0x47')],qs['fields'](_0x28d373[_0x1f07('0x49')][_0x1f07('0x4d')]));_0x8a9fe5[_0x1f07('0x4c')]=_0x8a9fe5[_0x1f07('0x4c')]['length']?_0x8a9fe5['attributes']:_0x53c5db['model'];if(_0x28d373[_0x1f07('0x49')][_0x1f07('0x55')]){_0x8a9fe5[_0x1f07('0x58')]=[{'all':!![]}];}_0x8a9fe5=_[_0x1f07('0x53')]({},_0x8a9fe5,_0x28d373['options']);return db[_0x1f07('0x43')][_0x1f07('0x59')](_0x8a9fe5)[_0x1f07('0x26')](handleEntityNotFound(_0x1bc2c9,null))['then'](respondWithResult(_0x1bc2c9,null))[_0x1f07('0x31')](handleError(_0x1bc2c9,null));};exports[_0x1f07('0x5a')]=function(_0x51d657,_0xdfb8a1){return db['FaxAccount']['create'](_0x51d657[_0x1f07('0x5b')],{})[_0x1f07('0x26')](function(_0x16c8b3){var _0x363fe2=_0x51d657['user']['get']({'plain':!![]});if(!_0x363fe2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x363fe2[_0x1f07('0x5c')]===_0x1f07('0x5d')){var _0x154681=_0x16c8b3[_0x1f07('0x5e')]({'plain':!![]});var _0x5ebeac=_0x1f07('0x3b');return db[_0x1f07('0x5f')]['find']({'where':{'name':_0x5ebeac,'userProfileId':_0x363fe2['userProfileId']},'raw':!![]})[_0x1f07('0x26')](function(_0x329956){if(_0x329956&&_0x329956[_0x1f07('0x60')]===0x0){return db[_0x1f07('0x61')][_0x1f07('0x5a')]({'name':_0x154681[_0x1f07('0x3f')],'resourceId':_0x154681['id'],'type':_0x329956['name'],'sectionId':_0x329956['id']},{})['then'](function(){return _0x16c8b3;});}else{return _0x16c8b3;}})[_0x1f07('0x31')](function(_0x3a0eef){logger[_0x1f07('0x2d')](_0x1f07('0x62'),_0x3a0eef);throw _0x3a0eef;});}return _0x16c8b3;})[_0x1f07('0x26')](respondWithResult(_0xdfb8a1,0xc9))[_0x1f07('0x31')](handleError(_0xdfb8a1,null));};exports[_0x1f07('0x63')]=function(_0x2b7599,_0x19305c){if(_0x2b7599[_0x1f07('0x5b')]['id']){delete _0x2b7599['body']['id'];}return db[_0x1f07('0x43')][_0x1f07('0x59')]({'where':{'id':_0x2b7599[_0x1f07('0x64')]['id']},'include':[{'model':db[_0x1f07('0x40')],'as':_0x1f07('0x41')}]})[_0x1f07('0x26')](handleEntityNotFound(_0x19305c,null))[_0x1f07('0x26')](saveUpdates(_0x2b7599[_0x1f07('0x5b')],null))[_0x1f07('0x26')](respondWithResult(_0x19305c,null))[_0x1f07('0x31')](handleError(_0x19305c,null));};exports['destroy']=function(_0x8b933b,_0x4c5d05){return db['FaxAccount'][_0x1f07('0x59')]({'where':{'id':_0x8b933b[_0x1f07('0x64')]['id']}})[_0x1f07('0x26')](handleEntityNotFound(_0x4c5d05,null))[_0x1f07('0x26')](removeEntity(_0x4c5d05,null))[_0x1f07('0x31')](handleError(_0x4c5d05,null));};exports[_0x1f07('0x65')]=function(_0x49e7fd,_0x251ddd){return db[_0x1f07('0x43')]['describe']()[_0x1f07('0x26')](respondWithResult(_0x251ddd,null))[_0x1f07('0x31')](handleError(_0x251ddd,null));};exports[_0x1f07('0x66')]=function(_0x3cf721,_0x51e634,_0x199b4e){if(_0x3cf721[_0x1f07('0x5b')]['id']){delete _0x3cf721[_0x1f07('0x5b')]['id'];}return db[_0x1f07('0x43')]['find']({'where':{'id':_0x3cf721[_0x1f07('0x64')]['id']}})['then'](handleEntityNotFound(_0x51e634,null))['then'](function(_0x5017f4){if(_0x5017f4){_0x3cf721[_0x1f07('0x5b')][_0x1f07('0x67')]=_0x5017f4['id'];return db[_0x1f07('0x68')][_0x1f07('0x5a')](_0x3cf721[_0x1f07('0x5b')]);}})['then'](respondWithResult(_0x51e634,null))[_0x1f07('0x31')](handleError(_0x51e634,null));};exports['getDispositions']=function(_0x12740c,_0xdcb70c,_0x177305){var _0x2c33eb={'raw':![],'where':{}};var _0x41742d={};var _0x441bdb={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1f07('0x69')]({'where':{'id':_0x12740c[_0x1f07('0x64')]['id']}})[_0x1f07('0x26')](handleEntityNotFound(_0xdcb70c,null))['then'](function(_0x3b1766){if(_0x3b1766){_0x41742d[_0x1f07('0x47')]=_[_0x1f07('0x48')](db[_0x1f07('0x68')]['rawAttributes']);_0x41742d['query']=_['keys'](_0x12740c[_0x1f07('0x49')]);_0x41742d['filters']=_[_0x1f07('0x4b')](_0x41742d['model'],_0x41742d['query']);_0x2c33eb[_0x1f07('0x4c')]=_[_0x1f07('0x4b')](_0x41742d[_0x1f07('0x47')],qs[_0x1f07('0x4d')](_0x12740c['query'][_0x1f07('0x4d')]));_0x2c33eb['attributes']=_0x2c33eb[_0x1f07('0x4c')]['length']?_0x2c33eb[_0x1f07('0x4c')]:_0x41742d[_0x1f07('0x47')];if(!_0x12740c[_0x1f07('0x49')][_0x1f07('0x4e')]('nolimit')){_0x2c33eb[_0x1f07('0x37')]=qs['limit'](_0x12740c[_0x1f07('0x49')][_0x1f07('0x37')]);_0x2c33eb['offset']=qs[_0x1f07('0x36')](_0x12740c[_0x1f07('0x49')][_0x1f07('0x36')]);}_0x2c33eb[_0x1f07('0x6a')]=qs[_0x1f07('0x6b')](_0x12740c['query'][_0x1f07('0x6b')]);_0x2c33eb[_0x1f07('0x50')]=qs[_0x1f07('0x4a')](_[_0x1f07('0x51')](_0x12740c[_0x1f07('0x49')],_0x41742d['filters']));_0x2c33eb['where'][_0x1f07('0x67')]=_0x3b1766['id'];if(_0x12740c[_0x1f07('0x49')][_0x1f07('0x52')]){_0x2c33eb[_0x1f07('0x50')]=_[_0x1f07('0x53')](_0x2c33eb[_0x1f07('0x50')],{'$or':_[_0x1f07('0x42')](_0x2c33eb[_0x1f07('0x4c')],function(_0x57b69f){var _0x4abba5={};_0x4abba5[_0x57b69f]={'$like':'%'+_0x12740c[_0x1f07('0x49')]['filter']+'%'};return _0x4abba5;})});}_0x2c33eb=_[_0x1f07('0x53')]({},_0x2c33eb,_0x12740c[_0x1f07('0x54')]);return db[_0x1f07('0x68')][_0x1f07('0x35')]({'where':_0x2c33eb[_0x1f07('0x50')]})[_0x1f07('0x26')](function(_0x5a0f59){_0x441bdb[_0x1f07('0x35')]=_0x5a0f59;if(_0x12740c[_0x1f07('0x49')]['includeAll']){_0x2c33eb[_0x1f07('0x58')]=[{'all':!![]}];}return db[_0x1f07('0x68')][_0x1f07('0x6c')](_0x2c33eb);})[_0x1f07('0x26')](function(_0x15a51b){_0x441bdb[_0x1f07('0x56')]=_0x15a51b;return _0x441bdb;});}})[_0x1f07('0x26')](respondWithFilteredResult(_0xdcb70c,_0x2c33eb))['catch'](handleError(_0xdcb70c,null));};exports[_0x1f07('0x6d')]=function(_0x49a544,_0xe466b3,_0xaea92f){return db[_0x1f07('0x43')][_0x1f07('0x59')]({'where':{'id':_0x49a544[_0x1f07('0x64')]['id']}})['then'](handleEntityNotFound(_0xe466b3,null))['then'](function(_0x368f57){if(_0x368f57){return _0x368f57[_0x1f07('0x6d')](_0x49a544[_0x1f07('0x49')][_0x1f07('0x6e')]);}})[_0x1f07('0x26')](respondWithStatusCode(_0xe466b3,null))[_0x1f07('0x31')](handleError(_0xe466b3,null));};exports[_0x1f07('0x6f')]=function(_0x184b4d,_0x46a4fa,_0x1f7d0c){if(_0x184b4d[_0x1f07('0x5b')]['id']){delete _0x184b4d[_0x1f07('0x5b')]['id'];}return db[_0x1f07('0x43')][_0x1f07('0x59')]({'where':{'id':_0x184b4d['params']['id']}})[_0x1f07('0x26')](handleEntityNotFound(_0x46a4fa,null))[_0x1f07('0x26')](function(_0x2d54fe){if(_0x2d54fe){_0x184b4d['body'][_0x1f07('0x67')]=_0x2d54fe['id'];return db['CannedAnswer'][_0x1f07('0x5a')](_0x184b4d[_0x1f07('0x5b')]);}})['then'](respondWithResult(_0x46a4fa,null))[_0x1f07('0x31')](handleError(_0x46a4fa,null));};exports[_0x1f07('0x70')]=function(_0x4cad64,_0x43674e,_0x449da7){var _0x739855={'raw':![],'where':{}};var _0x3dcd47={};var _0x5f5837={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x4cad64[_0x1f07('0x64')]['id']}})[_0x1f07('0x26')](handleEntityNotFound(_0x43674e,null))[_0x1f07('0x26')](function(_0x1da940){if(_0x1da940){_0x3dcd47[_0x1f07('0x47')]=_[_0x1f07('0x48')](db[_0x1f07('0x71')]['rawAttributes']);_0x3dcd47[_0x1f07('0x49')]=_[_0x1f07('0x48')](_0x4cad64['query']);_0x3dcd47[_0x1f07('0x4a')]=_[_0x1f07('0x4b')](_0x3dcd47['model'],_0x3dcd47['query']);_0x739855[_0x1f07('0x4c')]=_[_0x1f07('0x4b')](_0x3dcd47[_0x1f07('0x47')],qs[_0x1f07('0x4d')](_0x4cad64['query'][_0x1f07('0x4d')]));_0x739855[_0x1f07('0x4c')]=_0x739855[_0x1f07('0x4c')][_0x1f07('0x72')]?_0x739855[_0x1f07('0x4c')]:_0x3dcd47[_0x1f07('0x47')];if(!_0x4cad64[_0x1f07('0x49')][_0x1f07('0x4e')]('nolimit')){_0x739855[_0x1f07('0x37')]=qs[_0x1f07('0x37')](_0x4cad64[_0x1f07('0x49')][_0x1f07('0x37')]);_0x739855['offset']=qs['offset'](_0x4cad64[_0x1f07('0x49')]['offset']);}_0x739855[_0x1f07('0x6a')]=qs[_0x1f07('0x6b')](_0x4cad64[_0x1f07('0x49')]['sort']);_0x739855['where']=qs[_0x1f07('0x4a')](_[_0x1f07('0x51')](_0x4cad64['query'],_0x3dcd47[_0x1f07('0x4a')]));_0x739855[_0x1f07('0x50')][_0x1f07('0x67')]=_0x1da940['id'];if(_0x4cad64['query']['filter']){_0x739855[_0x1f07('0x50')]=_[_0x1f07('0x53')](_0x739855[_0x1f07('0x50')],{'$or':_[_0x1f07('0x42')](_0x739855['attributes'],function(_0x201b88){var _0xe4afcb={};_0xe4afcb[_0x201b88]={'$like':'%'+_0x4cad64[_0x1f07('0x49')]['filter']+'%'};return _0xe4afcb;})});}_0x739855=_[_0x1f07('0x53')]({},_0x739855,_0x4cad64[_0x1f07('0x54')]);return db[_0x1f07('0x71')][_0x1f07('0x35')]({'where':_0x739855[_0x1f07('0x50')]})['then'](function(_0x3423cb){_0x5f5837['count']=_0x3423cb;if(_0x4cad64[_0x1f07('0x49')][_0x1f07('0x55')]){_0x739855[_0x1f07('0x58')]=[{'all':!![]}];}return db[_0x1f07('0x71')][_0x1f07('0x6c')](_0x739855);})[_0x1f07('0x26')](function(_0x5acb44){_0x5f5837[_0x1f07('0x56')]=_0x5acb44;return _0x5f5837;});}})[_0x1f07('0x26')](respondWithFilteredResult(_0x43674e,_0x739855))[_0x1f07('0x31')](handleError(_0x43674e,null));};exports[_0x1f07('0x73')]=function(_0x1de185,_0x1622c4,_0x36d4da){return db[_0x1f07('0x43')]['find']({'where':{'id':_0x1de185[_0x1f07('0x64')]['id']}})['then'](handleEntityNotFound(_0x1622c4,null))[_0x1f07('0x26')](function(_0x54dda5){if(_0x54dda5){return _0x54dda5[_0x1f07('0x73')](_0x1de185[_0x1f07('0x49')][_0x1f07('0x6e')]);}})[_0x1f07('0x26')](respondWithStatusCode(_0x1622c4,null))[_0x1f07('0x31')](handleError(_0x1622c4,null));};exports[_0x1f07('0x74')]=function(_0x312805,_0x5b215d,_0x5ee1a4){return db[_0x1f07('0x75')]['find']({'where':{'id':_0x312805[_0x1f07('0x64')]['id']}})[_0x1f07('0x26')](handleEntityNotFound(_0x5b215d,null))[_0x1f07('0x26')](function(_0x3f7b51){if(_0x3f7b51){return _0x3f7b51[_0x1f07('0x74')](_0x312805[_0x1f07('0x5b')][_0x1f07('0x6e')],_[_0x1f07('0x76')](_0x312805['body'],[_0x1f07('0x6e'),'id'])||{});}})[_0x1f07('0x26')](respondWithResult(_0x5b215d,null))[_0x1f07('0x31')](handleError(_0x5b215d,null));};exports[_0x1f07('0x77')]=function(_0x2cfead,_0x56cd96,_0x1a9f64){var _0x50d592={'raw':![],'where':{}};var _0x2f909e={};var _0x11133f={'count':0x0,'rows':[]};return db[_0x1f07('0x43')]['findOne']({'where':{'id':_0x2cfead[_0x1f07('0x64')]['id']}})[_0x1f07('0x26')](handleEntityNotFound(_0x56cd96,null))[_0x1f07('0x26')](function(_0x42aee1){if(_0x42aee1){_0x2f909e[_0x1f07('0x47')]=_[_0x1f07('0x48')](db[_0x1f07('0x75')][_0x1f07('0x78')]);_0x2f909e[_0x1f07('0x49')]=_[_0x1f07('0x48')](_0x2cfead[_0x1f07('0x49')]);_0x2f909e[_0x1f07('0x4a')]=_[_0x1f07('0x4b')](_0x2f909e[_0x1f07('0x47')],_0x2f909e[_0x1f07('0x49')]);_0x50d592[_0x1f07('0x4c')]=_['intersection'](_0x2f909e[_0x1f07('0x47')],qs['fields'](_0x2cfead[_0x1f07('0x49')][_0x1f07('0x4d')]));_0x50d592[_0x1f07('0x4c')]=_0x50d592[_0x1f07('0x4c')][_0x1f07('0x72')]?_0x50d592[_0x1f07('0x4c')]:_0x2f909e[_0x1f07('0x47')];if(!_0x2cfead[_0x1f07('0x49')][_0x1f07('0x4e')]('nolimit')){_0x50d592['limit']=qs[_0x1f07('0x37')](_0x2cfead[_0x1f07('0x49')]['limit']);_0x50d592['offset']=qs[_0x1f07('0x36')](_0x2cfead['query'][_0x1f07('0x36')]);}_0x50d592[_0x1f07('0x6a')]=qs['sort'](_0x2cfead[_0x1f07('0x49')][_0x1f07('0x6b')]);_0x50d592[_0x1f07('0x50')]=qs[_0x1f07('0x4a')](_['pick'](_0x2cfead[_0x1f07('0x49')],_0x2f909e['filters']));_0x50d592[_0x1f07('0x50')]['FaxAccountId']=_0x42aee1['id'];if(_0x2cfead[_0x1f07('0x49')][_0x1f07('0x52')]){_0x50d592[_0x1f07('0x50')]=_[_0x1f07('0x53')](_0x50d592['where'],{'$or':_[_0x1f07('0x42')](_0x50d592[_0x1f07('0x4c')],function(_0x20176c){var _0x2030d8={};_0x2030d8[_0x20176c]={'$like':'%'+_0x2cfead[_0x1f07('0x49')][_0x1f07('0x52')]+'%'};return _0x2030d8;})});}_0x50d592=_['merge']({},_0x50d592,_0x2cfead[_0x1f07('0x54')]);return db[_0x1f07('0x75')][_0x1f07('0x35')]({'where':_0x50d592[_0x1f07('0x50')]})[_0x1f07('0x26')](function(_0x2e2ba7){_0x11133f[_0x1f07('0x35')]=_0x2e2ba7;if(_0x2cfead['query']['includeAll']){_0x50d592[_0x1f07('0x58')]=[{'model':db[_0x1f07('0x79')],'as':_0x1f07('0x7a'),'required':![]},{'model':db[_0x1f07('0x7b')],'as':'Owner','attributes':[_0x1f07('0x3f'),_0x1f07('0x7c'),_0x1f07('0x7d')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x1f07('0x3f'),_0x1f07('0x7e')],'where':_0x2cfead[_0x1f07('0x49')][_0x1f07('0x7f')]?{'id':_0x2cfead['query'][_0x1f07('0x7f')]}:undefined,'required':_0x2cfead[_0x1f07('0x49')][_0x1f07('0x7f')]?!![]:![]}];}return db[_0x1f07('0x75')][_0x1f07('0x6c')](_0x50d592);})[_0x1f07('0x26')](function(_0x4221cb){_0x11133f['rows']=_0x4221cb;return _0x11133f;});}})[_0x1f07('0x26')](respondWithFilteredResult(_0x56cd96,_0x50d592))[_0x1f07('0x31')](handleError(_0x56cd96,null));};exports[_0x1f07('0x80')]=function(_0x220830,_0x59d2d1,_0x40a175){return db[_0x1f07('0x43')][_0x1f07('0x69')]({'where':{'id':_0x220830[_0x1f07('0x64')]['id']}})[_0x1f07('0x26')](handleEntityNotFound(_0x59d2d1,null))[_0x1f07('0x26')](function(_0x291687){if(_0x291687){return db['sequelize'][_0x1f07('0x81')](function(_0x32432c){return db[_0x1f07('0x82')][_0x1f07('0x3c')]({'where':{'FaxAccountId':_0x220830['params']['id']},'transaction':_0x32432c})[_0x1f07('0x26')](function(_0x150fd7){var _0x5bf6d0=_[_0x1f07('0x42')](_0x220830[_0x1f07('0x5b')],function(_0x491735){_0x491735['FaxAccountId']=_0x220830[_0x1f07('0x64')]['id'];return _0x491735;});return db[_0x1f07('0x82')][_0x1f07('0x83')](_0x5bf6d0,{'transaction':_0x32432c});});})[_0x1f07('0x26')](function(){return db[_0x1f07('0x82')]['findAndCountAll']({'where':{'FaxAccountId':_0x220830[_0x1f07('0x64')]['id']},'order':_0x1f07('0x84')});});}})[_0x1f07('0x26')](respondWithResult(_0x59d2d1,null))[_0x1f07('0x31')](handleError(_0x59d2d1,null));};exports[_0x1f07('0x85')]=function(_0x2a1092,_0x295b88,_0x526237){var _0x5dab13={};var _0x1e21a6={};var _0x3cc5fd;var _0x93ab93;return db[_0x1f07('0x43')][_0x1f07('0x69')]({'where':{'id':_0x2a1092[_0x1f07('0x64')]['id']}})[_0x1f07('0x26')](handleEntityNotFound(_0x295b88,null))[_0x1f07('0x26')](function(_0x505a9f){if(_0x505a9f){_0x3cc5fd=_0x505a9f;_0x1e21a6[_0x1f07('0x47')]=_[_0x1f07('0x48')](db[_0x1f07('0x82')][_0x1f07('0x78')]);_0x1e21a6[_0x1f07('0x49')]=_[_0x1f07('0x48')](_0x2a1092[_0x1f07('0x49')]);_0x1e21a6[_0x1f07('0x4a')]=_[_0x1f07('0x4b')](_0x1e21a6[_0x1f07('0x47')],_0x1e21a6['query']);_0x5dab13[_0x1f07('0x4c')]=_[_0x1f07('0x4b')](_0x1e21a6[_0x1f07('0x47')],qs['fields'](_0x2a1092[_0x1f07('0x49')][_0x1f07('0x4d')]));_0x5dab13[_0x1f07('0x4c')]=_0x5dab13[_0x1f07('0x4c')]['length']?_0x5dab13[_0x1f07('0x4c')]:_0x1e21a6[_0x1f07('0x47')];_0x5dab13[_0x1f07('0x6a')]=qs[_0x1f07('0x6b')](_0x2a1092[_0x1f07('0x49')][_0x1f07('0x6b')]);_0x5dab13['where']=qs[_0x1f07('0x4a')](_[_0x1f07('0x51')](_0x2a1092[_0x1f07('0x49')],_0x1e21a6[_0x1f07('0x4a')]));if(_0x2a1092['query'][_0x1f07('0x52')]){_0x5dab13[_0x1f07('0x50')]=_[_0x1f07('0x53')](_0x5dab13[_0x1f07('0x50')],{'$or':_[_0x1f07('0x42')](_0x5dab13['attributes'],function(_0x3fef0a){var _0x30db20={};_0x30db20[_0x3fef0a]={'$like':'%'+_0x2a1092[_0x1f07('0x49')]['filter']+'%'};return _0x30db20;})});}_0x5dab13=_[_0x1f07('0x53')]({},_0x5dab13,_0x2a1092[_0x1f07('0x54')]);return _0x3cc5fd['getApplications'](_0x5dab13);}})[_0x1f07('0x26')](function(_0x56c5df){if(_0x56c5df){_0x93ab93=_0x56c5df[_0x1f07('0x72')];if(!_0x2a1092['query']['hasOwnProperty'](_0x1f07('0x4f'))){_0x5dab13['limit']=qs['limit'](_0x2a1092[_0x1f07('0x49')][_0x1f07('0x37')]);_0x5dab13[_0x1f07('0x36')]=qs[_0x1f07('0x36')](_0x2a1092[_0x1f07('0x49')][_0x1f07('0x36')]);}return _0x3cc5fd[_0x1f07('0x85')](_0x5dab13);}})[_0x1f07('0x26')](function(_0x5179a4){if(_0x5179a4){return _0x5179a4?{'count':_0x93ab93,'rows':_0x5179a4}:null;}})[_0x1f07('0x26')](respondWithResult(_0x295b88,null))[_0x1f07('0x31')](handleError(_0x295b88,null));};function Extension(_0x319e99,_0x5d5a70,_0x2d1772,_0x1a3e9a){this[_0x1f07('0x86')]=_0x1f07('0x87');this[_0x1f07('0x88')]=_0x319e99[_0x1f07('0x89')];this[_0x1f07('0x8a')]=_0x1a3e9a;this[_0x1f07('0x45')]=_0x1f07('0x8b');this[_0x1f07('0x8c')]='Fax\x20Extension';this['FaxAccountId']=_0x319e99['id'];this['priority']=_0x5d5a70;this['appdata']=_0x2d1772;}function createExtensionsReciveFax(_0xb8f7eb){var _0x424f3d=0x1;var _0x151d96=[];_0x151d96[_0x1f07('0x8d')](new Extension(_0xb8f7eb,_0x424f3d,'',_0x1f07('0x8e')));_0x424f3d+=0x1;_0x151d96['push'](new Extension(_0xb8f7eb,_0x424f3d,_0x1f07('0x8f'),_0x1f07('0x90')));_0x424f3d+=0x1;for(var _0x3e5d22 in _0xb8f7eb){if(_0xb8f7eb['hasOwnProperty'](_0x3e5d22)&&(_0x3e5d22==='ecm'||_0x3e5d22===_0x1f07('0x89')||_0x3e5d22===_0x1f07('0x91')||_0x3e5d22===_0x1f07('0x92')||_0x3e5d22===_0x1f07('0x93')||_0x3e5d22==='maxrate'||_0x3e5d22===_0x1f07('0x94')||_0x3e5d22===_0x1f07('0x95')||_0x3e5d22===_0x1f07('0x96'))){_0x151d96[_0x1f07('0x8d')](new Extension(_0xb8f7eb,_0x424f3d,'FAXOPT('+_0x3e5d22+')='+_0xb8f7eb[_0x3e5d22],_0x1f07('0x90')));_0x424f3d+=0x1;}}_0x151d96[_0x1f07('0x8d')](new Extension(_0xb8f7eb,_0x424f3d,'6',_0x1f07('0x97')));_0x424f3d+=0x1;_0x151d96[_0x1f07('0x8d')](new Extension(_0xb8f7eb,_0x424f3d,'/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',_0x1f07('0x98')));_0x424f3d=0x0;return _0x151d96;}exports[_0x1f07('0x99')]=function(_0x14a10f,_0x5a7e31,_0x397ec7){var _0x5c323c;return db[_0x1f07('0x9a')][_0x1f07('0x81')](function(_0x195851){return db['FaxAccount'][_0x1f07('0x5a')](_0x14a10f[_0x1f07('0x5b')],{'transaction':_0x195851})['then'](function(_0x868d5d){_0x5c323c=_0x868d5d[_0x1f07('0x5e')]({'plain':!![]});return db[_0x1f07('0x9b')][_0x1f07('0x83')](createExtensionsReciveFax(_0x5c323c),{'transaction':_0x195851});});})[_0x1f07('0x26')](function(){return _0x5c323c;})['then'](respondWithResult(_0x5a7e31,null))[_0x1f07('0x31')](handleError(_0x5a7e31,null));};exports[_0x1f07('0x9c')]=function(_0x5e02a7,_0x3c73b2,_0x582792){var _0x2cb170;return db[_0x1f07('0x9a')][_0x1f07('0x81')](function(_0x52df75){return db[_0x1f07('0x43')]['update'](_0x5e02a7['body'],{'where':{'id':_0x5e02a7[_0x1f07('0x5b')]['id']},'transaction':_0x52df75})[_0x1f07('0x26')](function(_0x2e5891){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x5e02a7[_0x1f07('0x5b')]['id']},'transaction':_0x52df75})['then'](function(_0x95e8f2){return db[_0x1f07('0x9b')][_0x1f07('0x83')](createExtensionsReciveFax(_['omit'](_0x5e02a7['body'],[_0x1f07('0x9d'),_0x1f07('0x46'),_0x1f07('0x9e'),'updatedAt',_0x1f07('0x9f'),_0x1f07('0xa0')])),{'transaction':_0x52df75});});});})[_0x1f07('0x26')](function(){return db[_0x1f07('0x43')][_0x1f07('0xa1')](_0x5e02a7[_0x1f07('0x5b')]['id']);})['then'](respondWithResult(_0x3c73b2,null))[_0x1f07('0x31')](handleError(_0x3c73b2,null));};exports[_0x1f07('0xa2')]=function(_0x4824e4,_0x51bf64,_0x367490){var _0xbd0519={'raw':!![],'where':{}};var _0x4e6da8={};var _0x170393={'count':0x0,'rows':[]};return db[_0x1f07('0x43')][_0x1f07('0x69')]({'where':{'id':_0x4824e4[_0x1f07('0x64')]['id']}})[_0x1f07('0x26')](handleEntityNotFound(_0x51bf64,null))[_0x1f07('0x26')](function(_0x3b5803){if(_0x3b5803){_0x4e6da8['model']=_['keys'](db[_0x1f07('0xa3')][_0x1f07('0x78')]);_0x4e6da8['query']=_[_0x1f07('0x48')](_0x4824e4['query']);_0x4e6da8[_0x1f07('0x4a')]=_[_0x1f07('0x4b')](_0x4e6da8[_0x1f07('0x47')],_0x4e6da8[_0x1f07('0x49')]);_0xbd0519['attributes']=_[_0x1f07('0x4b')](_0x4e6da8['model'],qs[_0x1f07('0x4d')](_0x4824e4[_0x1f07('0x49')]['fields']));_0xbd0519[_0x1f07('0x4c')]=_0xbd0519[_0x1f07('0x4c')][_0x1f07('0x72')]?_0xbd0519[_0x1f07('0x4c')]:_0x4e6da8[_0x1f07('0x47')];if(!_0x4824e4['query'][_0x1f07('0x4e')](_0x1f07('0x4f'))){_0xbd0519[_0x1f07('0x37')]=qs[_0x1f07('0x37')](_0x4824e4[_0x1f07('0x49')][_0x1f07('0x37')]);_0xbd0519[_0x1f07('0x36')]=qs[_0x1f07('0x36')](_0x4824e4[_0x1f07('0x49')][_0x1f07('0x36')]);}_0xbd0519[_0x1f07('0x6a')]=qs[_0x1f07('0x6b')](_0x4824e4['query'][_0x1f07('0x6b')]);_0xbd0519[_0x1f07('0x50')]=qs[_0x1f07('0x4a')](_[_0x1f07('0x51')](_0x4824e4['query'],_0x4e6da8[_0x1f07('0x4a')]));_0xbd0519[_0x1f07('0x50')][_0x1f07('0x67')]=_0x3b5803['id'];if(_0x4824e4['query'][_0x1f07('0x52')]){_0xbd0519[_0x1f07('0x50')]=_[_0x1f07('0x53')](_0xbd0519[_0x1f07('0x50')],{'$or':_[_0x1f07('0x42')](_0xbd0519[_0x1f07('0x4c')],function(_0x1354b3){var _0x5bb7a4={};_0x5bb7a4[_0x1354b3]={'$like':'%'+_0x4824e4[_0x1f07('0x49')][_0x1f07('0x52')]+'%'};return _0x5bb7a4;})});}if(_0x4824e4['query']['$gte']){var _0x1c002f=_0x4824e4[_0x1f07('0x49')][_0x1f07('0xa4')][_0x1f07('0xa5')](',');var _0x37229f={};_0x37229f[_0x1c002f[0x0]]={'$gte':moment(_0x1c002f[0x1])[_0x1f07('0xa6')](_0x1f07('0xa7'))};_0xbd0519[_0x1f07('0x50')]=_[_0x1f07('0x53')](_0xbd0519['where'],_0x37229f);}_0xbd0519=_[_0x1f07('0x53')]({},_0xbd0519,_0x4824e4[_0x1f07('0x54')]);return db[_0x1f07('0xa3')][_0x1f07('0x35')]({'where':_0xbd0519[_0x1f07('0x50')]})[_0x1f07('0x26')](function(_0x52d1e7){_0x170393[_0x1f07('0x35')]=_0x52d1e7;if(_0x4824e4[_0x1f07('0x49')][_0x1f07('0x55')]){_0xbd0519[_0x1f07('0x58')]=[{'all':!![]}];}return db[_0x1f07('0xa3')][_0x1f07('0x6c')](_0xbd0519);})[_0x1f07('0x26')](function(_0x5c555b){_0x170393[_0x1f07('0x56')]=_0x5c555b;return _0x170393;});}})[_0x1f07('0x26')](respondWithFilteredResult(_0x51bf64,_0xbd0519))[_0x1f07('0x31')](handleError(_0x51bf64,null));};exports[_0x1f07('0xa8')]=function(_0x59219c,_0x4889e3,_0x34ff90){var _0x403a5d,_0x1e3d8e={},_0xc4af7e;if(_0x59219c[_0x1f07('0x5b')]['to']){_0xc4af7e=_0x59219c[_0x1f07('0x5b')]['to'][0x0];}return db[_0x1f07('0x43')][_0x1f07('0x59')]({'where':{'id':_0x59219c[_0x1f07('0x64')]['id']},'include':[{'model':db['CmList'],'as':_0x1f07('0xa9'),'include':[{'model':db[_0x1f07('0x79')],'as':_0x1f07('0xaa'),'where':{'fax':_0xc4af7e},'limit':0x1,'order':[['updatedAt',_0x1f07('0xab')]]}]}]})[_0x1f07('0x26')](handleEntityNotFound(_0x4889e3,null))['then'](function(_0x1e746a){_0x403a5d=_0x1e746a;if(_0x59219c['body'][_0x1f07('0xac')]&&_0x59219c['body'][_0x1f07('0xac')][_0x1f07('0x72')]){for(var _0x4e1f6b=0x0;_0x4e1f6b<_0x59219c[_0x1f07('0x5b')][_0x1f07('0xac')][_0x1f07('0x72')];_0x4e1f6b+=0x1){_0x59219c[_0x1f07('0x5b')]['attachments'][_0x4e1f6b]={'filename':_0x59219c['body'][_0x1f07('0xac')][_0x4e1f6b][_0x1f07('0x3f')],'id':_0x59219c[_0x1f07('0x5b')]['attachments'][_0x4e1f6b]['id'],'path':path[_0x1f07('0xad')](config['root'],_0x1f07('0xae'),_0x59219c[_0x1f07('0x5b')][_0x1f07('0xac')][_0x4e1f6b][_0x1f07('0xaf')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_['isNil'](_0x59219c['params']['id'])?undefined:_0x59219c[_0x1f07('0x64')]['id'],'path':_['isNil'](_0x59219c[_0x1f07('0x5b')]['attachments'][0x0][_0x1f07('0x8')])?undefined:_0x59219c[_0x1f07('0x5b')][_0x1f07('0xac')][0x0][_0x1f07('0x8')],'fax':_[_0x1f07('0xb0')](_0x59219c[_0x1f07('0x5b')]['to'][0x0])?undefined:_0x59219c[_0x1f07('0x5b')]['to'][0x0]},client9002);})[_0x1f07('0x26')](function(){if(_0x403a5d){if(_[_0x1f07('0xb0')](_0x59219c[_0x1f07('0x5b')][_0x1f07('0xb1')])){_0x59219c['body'][_0x1f07('0xb1')]=util[_0x1f07('0xa6')]('\x22%s\x22\x20<%s>',_0x403a5d[_0x1f07('0x3f')],_0x403a5d[_0x1f07('0xb2')]);}if(_0x403a5d[_0x1f07('0xa9')]){if(_0x403a5d[_0x1f07('0xa9')][_0x1f07('0xaa')][_0x1f07('0x72')]){return _0x403a5d[_0x1f07('0xa9')][_0x1f07('0xaa')][0x0];}else{return db[_0x1f07('0x79')][_0x1f07('0x5a')](_['defaults'](_0x59219c[_0x1f07('0x5b')],{'firstName':_0x59219c[_0x1f07('0x5b')]['to'][0x0],'phone':_0x59219c[_0x1f07('0x5b')]['to'][0x0],'fax':_0x59219c['body']['to'][0x0],'ListId':_0x403a5d[_0x1f07('0xa0')]}));}}else{throw new Error(_0x1f07('0xb3'));}}else{throw new Error(_0x1f07('0xb4'));}})['then'](function(_0x439260){if(_0x439260){return db[_0x1f07('0x75')][_0x1f07('0x59')]({'where':{'ContactId':_0x439260['id'],'closed':![],'FaxAccountId':_0x403a5d['id']}})['then'](function(_0xa40d9){if(_0xa40d9){return[_0xa40d9,![]];}return db[_0x1f07('0x75')][_0x1f07('0x5a')]({'UserId':_0x59219c['user']['id'],'ContactId':_0x439260['id'],'FaxAccountId':_0x403a5d['id'],'fax':_0x59219c[_0x1f07('0x5b')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x59219c[_0x1f07('0x5b')],{'read':![],'body':_0x59219c[_0x1f07('0x5b')]['attachments'][0x0][_0x1f07('0xb5')],'FaxAccountId':_0x403a5d['id'],'UserId':_0x59219c[_0x1f07('0x5d')]['id'],'ContactId':_0x439260['id'],'AttachmentId':_0x59219c[_0x1f07('0x5b')][_0x1f07('0xac')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x1f07('0xb6')}]})[_0x1f07('0x26')](function(_0x4a31cb){return[_0x4a31cb,!![]];});});}else{throw new Error(_0x1f07('0xb7'));}})['spread'](function(_0x585de7,_0x58f305){if(_0x58f305){return _0x585de7;}return db[_0x1f07('0xa3')][_0x1f07('0x5a')]({'direction':_0x1f07('0xb8'),'read':![],'body':_0x59219c[_0x1f07('0x5b')][_0x1f07('0xac')][0x0]['filename'],'FaxAccountId':_0x403a5d['id'],'FaxInteractionId':_0x585de7['id'],'UserId':_0x59219c[_0x1f07('0x5d')]['id'],'ContactId':_0x585de7[_0x1f07('0xb9')],'AttachmentId':_0x59219c[_0x1f07('0x5b')]['attachments'][0x0]['id']})['then'](function(_0x561130){_0x585de7[_0x1f07('0xba')][_0x1f07('0xb6')]=[];_0x585de7['dataValues'][_0x1f07('0xb6')][_0x1f07('0x8d')](_0x561130[_0x1f07('0xba')]);return _0x585de7;});})[_0x1f07('0x26')](function(_0x252adc){respondWithRpcPromise(_0x1f07('0xbb'),'SendFax',{'FaxAccountId':_[_0x1f07('0xb0')](_0x59219c[_0x1f07('0x64')]['id'])?undefined:_0x59219c[_0x1f07('0x64')]['id'],'path':_[_0x1f07('0xb0')](_0x59219c[_0x1f07('0x5b')][_0x1f07('0xac')][0x0][_0x1f07('0x8')])?undefined:_0x59219c[_0x1f07('0x5b')][_0x1f07('0xac')][0x0][_0x1f07('0x8')],'fax':_[_0x1f07('0xb0')](_0x59219c[_0x1f07('0x5b')]['to'][0x0])?undefined:_0x59219c[_0x1f07('0x5b')]['to'][0x0],'AttachmentId':_0x59219c[_0x1f07('0x5b')][_0x1f07('0xac')][0x0]['id']},client9002)[_0x1f07('0x26')](function(_0x55e138){logger['info']('SendFaxRpc,\x20%s',_0x55e138);})['catch'](function(_0x542eb4){logger[_0x1f07('0x27')]('SendFaxRpc,\x20%s',_0x542eb4);});return _0x252adc;})[_0x1f07('0x26')](respondWithResult(_0x4889e3,null))[_0x1f07('0x31')](handleError(_0x4889e3,null));};exports['addAgents']=function(_0xd5f7c6,_0xd928be,_0x37d911){return db[_0x1f07('0x43')][_0x1f07('0x59')]({'where':{'id':_0xd5f7c6[_0x1f07('0x64')]['id']}})[_0x1f07('0x26')](handleEntityNotFound(_0xd928be,null))[_0x1f07('0x26')](function(_0x175beb){if(_0x175beb){return _0x175beb[_0x1f07('0xbc')](_0xd5f7c6[_0x1f07('0x5b')][_0x1f07('0x6e')],_[_0x1f07('0x76')](_0xd5f7c6[_0x1f07('0x5b')],[_0x1f07('0x6e'),'id'])||{})[_0x1f07('0xbd')](function(_0xa7d955){for(var _0x4fbd97=0x0;_0x4fbd97<_0xd5f7c6['body']['ids']['length'];_0x4fbd97+=0x1){socket[_0x1f07('0xbe')](_0x1f07('0xbf'),{'UserId':_0xd5f7c6[_0x1f07('0x5b')][_0x1f07('0x6e')][_0x4fbd97],'FaxAccountId':_0xd5f7c6[_0x1f07('0x64')]['id']});}return _0xa7d955;});}})[_0x1f07('0x26')](respondWithResult(_0xd928be,null))[_0x1f07('0x31')](handleError(_0xd928be,null));};exports[_0x1f07('0xc0')]=function(_0x3b07ee,_0x4a7a6b,_0xcc80ce){return db[_0x1f07('0x43')][_0x1f07('0x59')]({'where':{'id':_0x3b07ee[_0x1f07('0x64')]['id']}})[_0x1f07('0x26')](handleEntityNotFound(_0x4a7a6b,null))[_0x1f07('0x26')](function(_0x3cba6a){if(_0x3cba6a){return _0x3cba6a[_0x1f07('0xc0')](_0x3b07ee[_0x1f07('0x49')][_0x1f07('0x6e')])['then'](function(){if(_[_0x1f07('0xc1')](_0x3b07ee[_0x1f07('0x49')][_0x1f07('0x6e')])){for(var _0x7ad49c=0x0;_0x7ad49c<_0x3b07ee[_0x1f07('0x49')]['ids'][_0x1f07('0x72')];_0x7ad49c+=0x1){socket['emit'](_0x1f07('0xc2'),{'UserId':Number(_0x3b07ee[_0x1f07('0x49')][_0x1f07('0x6e')][_0x7ad49c]),'FaxAccountId':Number(_0x3b07ee['params']['id'])});}}else{socket[_0x1f07('0xbe')](_0x1f07('0xc2'),{'UserId':Number(_0x3b07ee[_0x1f07('0x49')][_0x1f07('0x6e')]),'FaxAccountId':Number(_0x3b07ee[_0x1f07('0x64')]['id'])});}});}})[_0x1f07('0x26')](respondWithStatusCode(_0x4a7a6b,null))[_0x1f07('0x31')](handleError(_0x4a7a6b,null));};exports[_0x1f07('0xc3')]=function(_0x4fc091,_0x451237,_0x4be2fb){var _0x5eecf7={};var _0x1399cf={};var _0x51c108;var _0x5942ac;return db[_0x1f07('0x43')][_0x1f07('0x69')]({'where':{'id':_0x4fc091[_0x1f07('0x64')]['id']}})[_0x1f07('0x26')](handleEntityNotFound(_0x451237,null))[_0x1f07('0x26')](function(_0x49e77b){if(_0x49e77b){_0x51c108=_0x49e77b;_0x1399cf[_0x1f07('0x47')]=_[_0x1f07('0x48')](db[_0x1f07('0x7b')][_0x1f07('0x78')]);_0x1399cf[_0x1f07('0x49')]=_['keys'](_0x4fc091[_0x1f07('0x49')]);_0x1399cf[_0x1f07('0x4a')]=_[_0x1f07('0x4b')](_0x1399cf['model'],_0x1399cf[_0x1f07('0x49')]);_0x5eecf7['attributes']=_[_0x1f07('0x4b')](_0x1399cf[_0x1f07('0x47')],qs[_0x1f07('0x4d')](_0x4fc091[_0x1f07('0x49')]['fields']));_0x5eecf7[_0x1f07('0x4c')]=_0x5eecf7[_0x1f07('0x4c')][_0x1f07('0x72')]?_0x5eecf7[_0x1f07('0x4c')]:_0x1399cf[_0x1f07('0x47')];_0x5eecf7[_0x1f07('0x6a')]=qs[_0x1f07('0x6b')](_0x4fc091[_0x1f07('0x49')][_0x1f07('0x6b')]);_0x5eecf7[_0x1f07('0x50')]=qs['filters'](_[_0x1f07('0x51')](_0x4fc091[_0x1f07('0x49')],_0x1399cf['filters']));if(_0x4fc091[_0x1f07('0x49')][_0x1f07('0x52')]){_0x5eecf7['where']=_[_0x1f07('0x53')](_0x5eecf7[_0x1f07('0x50')],{'$or':_[_0x1f07('0x42')](_0x5eecf7[_0x1f07('0x4c')],function(_0x8cda61){var _0xf7bec3={};_0xf7bec3[_0x8cda61]={'$like':'%'+_0x4fc091['query'][_0x1f07('0x52')]+'%'};return _0xf7bec3;})});}_0x5eecf7=_['merge']({},_0x5eecf7,_0x4fc091[_0x1f07('0x54')]);return _0x51c108['getAgents'](_0x5eecf7);}})[_0x1f07('0x26')](function(_0x4c97a1){if(_0x4c97a1){_0x5942ac=_0x4c97a1['length'];if(!_0x4fc091[_0x1f07('0x49')][_0x1f07('0x4e')](_0x1f07('0x4f'))){_0x5eecf7[_0x1f07('0x37')]=qs[_0x1f07('0x37')](_0x4fc091[_0x1f07('0x49')][_0x1f07('0x37')]);_0x5eecf7[_0x1f07('0x36')]=qs[_0x1f07('0x36')](_0x4fc091[_0x1f07('0x49')]['offset']);}return _0x51c108['getAgents'](_0x5eecf7);}})['then'](function(_0x2377ef){if(_0x2377ef){return _0x2377ef?{'count':_0x5942ac,'rows':_0x2377ef}:null;}})['then'](respondWithResult(_0x451237,null))[_0x1f07('0x31')](handleError(_0x451237,null));};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js
index c9fadfa..b98d753 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 _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
+var _0xdee4=['FaxAccount','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4e90c9,_0x5335c4){var _0x15aef7=function(_0x240724){while(--_0x240724){_0x4e90c9['push'](_0x4e90c9['shift']());}};_0x15aef7(++_0x5335c4);}(_0xdee4,0x136));var _0x4dee=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0xdee4[_0xa388a2];return _0x7ce7f6;};'use strict';var EventEmitter=require(_0x4dee('0x0'));var FaxAccount=require(_0x4dee('0x1'))['db'][_0x4dee('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4dee('0x3'),'afterUpdate':'update','afterDestroy':_0x4dee('0x4')};function emitEvent(_0x58e39d){return function(_0x30806e,_0x38e912,_0x302c35){FaxAccountEvents[_0x4dee('0x5')](_0x58e39d+':'+_0x30806e['id'],_0x30806e);FaxAccountEvents[_0x4dee('0x5')](_0x58e39d,_0x30806e);_0x302c35(null);};}for(var e in events){if(events[_0x4dee('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x4dee('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 42728b6..b25e08e 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 _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
+var _0x64a1=['./faxAccount.attributes','define','FaxAccount','fax_accounts','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0x64a1,0x93));var _0x164a=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x64a1[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0x164a('0x0'));var util=require('util');var logger=require(_0x164a('0x1'))('api');var moment=require(_0x164a('0x2'));var BPromise=require(_0x164a('0x3'));var rp=require(_0x164a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x164a('0x5'));var config=require(_0x164a('0x6'));var attributes=require(_0x164a('0x7'));module['exports']=function(_0x368134,_0x2e60ad){return _0x368134[_0x164a('0x8')](_0x164a('0x9'),attributes,{'tableName':_0x164a('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 959069c..623e3b4 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 _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
+var _0x4737=['register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','options','include','model','attributes','map','debug','NotifyFaxAccount','body','fax','CmContact','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','from','Sequelize','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','FaxApplication','List','get','account','applications','orderBy','priority','asc','Applications','length','create','contact','find','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','created','interaction','FaxMessage','ContactId','UserId','unshift','name','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket'];(function(_0x534fa7,_0x25acc8){var _0xfced13=function(_0x340da0){while(--_0x340da0){_0x534fa7['push'](_0x534fa7['shift']());}};_0xfced13(++_0x25acc8);}(_0x4737,0x141));var _0x7473=function(_0x3cfc2f,_0x9b607e){_0x3cfc2f=_0x3cfc2f-0x0;var _0x301bc3=_0x4737[_0x3cfc2f];return _0x301bc3;};'use strict';var _=require(_0x7473('0x0'));var util=require(_0x7473('0x1'));var moment=require(_0x7473('0x2'));var BPromise=require(_0x7473('0x3'));var rs=require(_0x7473('0x4'));var fs=require('fs');var Redis=require(_0x7473('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7473('0x6'))('rpc');var config=require(_0x7473('0x7'));var jayson=require(_0x7473('0x8'));var client=jayson[_0x7473('0x9')]['http']({'port':0x232c});config[_0x7473('0xa')]=_[_0x7473('0xb')](config['redis'],{'host':_0x7473('0xc'),'port':0x18eb});var socket=require(_0x7473('0xd'))(new Redis(config[_0x7473('0xa')]));require(_0x7473('0xe'))[_0x7473('0xf')](socket);function respondWithRpcPromise(_0x40dbd4,_0x4f996d,_0x52f315){return new BPromise(function(_0x11fb0a,_0x54afcf){return client['request'](_0x40dbd4,_0x52f315)[_0x7473('0x10')](function(_0x1c4683){logger[_0x7473('0x11')](_0x7473('0x12'),_0x4f996d,_0x7473('0x13'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x4f996d,_0x7473('0x13'),JSON[_0x7473('0x14')](_0x1c4683));if(_0x1c4683[_0x7473('0x15')]){if(_0x1c4683[_0x7473('0x15')][_0x7473('0x16')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x4f996d,_0x1c4683['error']['message']);return _0x54afcf(_0x1c4683[_0x7473('0x15')]['message']);}logger[_0x7473('0x15')](_0x7473('0x12'),_0x4f996d,_0x1c4683[_0x7473('0x15')]['message']);return _0x11fb0a(_0x1c4683[_0x7473('0x15')][_0x7473('0x17')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x4f996d,_0x7473('0x13'));_0x11fb0a(_0x1c4683[_0x7473('0x18')]['message']);}})[_0x7473('0x19')](function(_0x48cc91){logger[_0x7473('0x15')]('FaxAccount,\x20%s,\x20%s',_0x4f996d,_0x48cc91);_0x54afcf(_0x48cc91);});});}exports[_0x7473('0x1a')]=function(_0x55b369){var _0x30bede=this;return new Promise(function(_0x42f94a,_0x1bbca2){return db[_0x7473('0x1b')]['findAll']({'raw':_0x55b369[_0x7473('0x1c')]?_0x55b369[_0x7473('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x55b369[_0x7473('0x1c')]?_0x55b369[_0x7473('0x1c')]['where']||null:null,'attributes':_0x55b369[_0x7473('0x1c')]?_0x55b369[_0x7473('0x1c')]['attributes']||null:null,'limit':_0x55b369[_0x7473('0x1c')]?_0x55b369['options']['limit']||null:null,'include':_0x55b369[_0x7473('0x1c')]?_0x55b369['options'][_0x7473('0x1d')]?_['map'](_0x55b369[_0x7473('0x1c')]['include'],function(_0x52dcf2){return{'model':db[_0x52dcf2[_0x7473('0x1e')]],'as':_0x52dcf2['as'],'attributes':_0x52dcf2[_0x7473('0x1f')],'include':_0x52dcf2['include']?_[_0x7473('0x20')](_0x52dcf2['include'],function(_0x4c7151){return{'model':db[_0x4c7151[_0x7473('0x1e')]],'as':_0x4c7151['as'],'attributes':_0x4c7151[_0x7473('0x1f')],'include':_0x4c7151[_0x7473('0x1d')]?_['map'](_0x4c7151[_0x7473('0x1d')],function(_0x55c46b){return{'model':db[_0x55c46b[_0x7473('0x1e')]],'as':_0x55c46b['as'],'attributes':_0x55c46b['attributes']};}):[]};}):[]};}):[]:[]})[_0x7473('0x10')](function(_0x32a8f7){logger['info'](_0x7473('0x1a'),_0x55b369);logger[_0x7473('0x21')](_0x7473('0x1a'),_0x55b369,JSON[_0x7473('0x14')](_0x32a8f7));_0x42f94a(_0x32a8f7);})['catch'](function(_0x55bfc2){logger[_0x7473('0x15')]('GetFaxAccount',_0x55bfc2[_0x7473('0x17')],_0x55b369);_0x1bbca2(_0x30bede[_0x7473('0x15')](0x1f4,_0x55bfc2[_0x7473('0x17')]));});});};exports[_0x7473('0x22')]=function(_0x2bd524,_0x3b8e57,_0x5033c8){var _0x340543=this;return new Promise(function(_0x13320e,_0x1bb9b4){var _0x3fc8c5={'body':_0x2bd524[_0x7473('0x23')],'channel':_0x7473('0x24')};var _0x31dde1=[];var _0x5cd8ca=[];var _0x2472e6={};return db[_0x7473('0x25')]['describe']()[_0x7473('0x10')](function(_0x49fa0c){if(!_0x49fa0c){throw new db['Sequelize'][(_0x7473('0x26'))](_0x7473('0x27'));}_0x31dde1=_[_0x7473('0x28')](_[_0x7473('0x29')](_0x49fa0c),[_0x7473('0x2a'),_0x7473('0x2b')]);_0x5cd8ca=_['difference'](_['keys'](_0x49fa0c),[_0x7473('0x2a'),'updatedAt','CompanyId',_0x7473('0x2c')]);if(_0x2bd524[_0x7473('0x23')]['id']){delete _0x2bd524[_0x7473('0x23')]['id'];}if(_['isNil'](_0x2bd524[_0x7473('0x23')][_0x7473('0x2d')])){throw new db[(_0x7473('0x2e'))][(_0x7473('0x26'))](_0x7473('0x2f'));}if(_[_0x7473('0x30')](_0x2bd524[_0x7473('0x23')][_0x7473('0x23')])||_0x2bd524[_0x7473('0x23')][_0x7473('0x23')]===''){throw new db[(_0x7473('0x2e'))][(_0x7473('0x26'))](_0x7473('0x31'));}if(_[_0x7473('0x30')](_0x2bd524[_0x7473('0x23')]['mapKey'])){throw new db['Sequelize'][(_0x7473('0x26'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5cd8ca);}if(!_[_0x7473('0x32')](_0x5cd8ca,_0x2bd524['body']['mapKey'])){throw new db[(_0x7473('0x2e'))][(_0x7473('0x26'))](_0x7473('0x33')+_0x5cd8ca);}_0x2472e6[_0x2bd524[_0x7473('0x23')][_0x7473('0x34')]]=_0x2bd524['body'][_0x7473('0x2d')];})['then'](function(){return db[_0x7473('0x1b')]['find']({'where':{'id':_0x2bd524['account']['id']},'include':[{'model':db[_0x7473('0x35')],'as':'List','include':[{'model':db['CmContact'],'as':_0x7473('0x36'),'where':_0x2472e6,'limit':0x1,'order':[[_0x7473('0x2b'),_0x7473('0x37')]]}]},{'model':db[_0x7473('0x38')],'as':'Applications'}]});})[_0x7473('0x10')](function(_0xdc512e){if(_0xdc512e&&_0xdc512e[_0x7473('0x39')]){var _0x1bdb41=_0xdc512e[_0x7473('0x3a')]({'plain':!![]});_0x3fc8c5[_0x7473('0x3b')]=_0x1bdb41;_0x3fc8c5[_0x7473('0x3c')]=_0x1bdb41['Applications'];_0x3fc8c5['list']=_0x1bdb41['List'];_0x3fc8c5[_0x7473('0x3c')]=_[_0x7473('0x3d')](_0x3fc8c5['applications'],[_0x7473('0x3e')],[_0x7473('0x3f')]);if(_0x3fc8c5[_0x7473('0x3b')][_0x7473('0x40')]){delete _0x3fc8c5[_0x7473('0x3b')][_0x7473('0x40')];}if(_0x3fc8c5['account']['List']&&_0x3fc8c5[_0x7473('0x3b')][_0x7473('0x39')][_0x7473('0x36')][_0x7473('0x41')]){return _0x3fc8c5[_0x7473('0x3b')][_0x7473('0x39')][_0x7473('0x36')][0x0];}var _0x5536d9=_[_0x7473('0xb')](_0x2bd524[_0x7473('0x23')],{'firstName':_0x2bd524[_0x7473('0x23')][_0x7473('0x2d')],'ListId':_0x1bdb41[_0x7473('0x2c')]});_0x5536d9[_0x2bd524['body']['mapKey']]=_0x2bd524['body'][_0x7473('0x2d')];return db[_0x7473('0x25')][_0x7473('0x42')](_0x5536d9,{'fields':_0x31dde1,'raw':!![]});}})[_0x7473('0x10')](function(_0x35aa94){_0x3fc8c5[_0x7473('0x43')]=_0x35aa94;if(_0x35aa94){var _0x537de3={'ContactId':_0x35aa94['id'],'FaxAccountId':_0x2bd524[_0x7473('0x3b')]['id'],'fax':_0x35aa94[_0x7473('0x24')]};return db['FaxInteraction'][_0x7473('0x44')]({'where':{'ContactId':_0x35aa94['id'],'closed':![],'FaxAccountId':_0x2bd524[_0x7473('0x3b')]['id']}})[_0x7473('0x10')](function(_0xe9729b){if(_0xe9729b){return[_0xe9729b,![]];}return db[_0x7473('0x45')][_0x7473('0x42')](_0x537de3)['then'](function(_0xd0cfe5){return[_0xd0cfe5,!![]];});});}else{throw new Error(_0x7473('0x46'));}})[_0x7473('0x47')](function(_0x1c5f27,_0x46108d){var _0x3f02f7=_0x1c5f27[_0x7473('0x3a')]({'plain':!![]});if(_0x46108d){if(_0x3fc8c5[_0x7473('0x3b')][_0x7473('0x48')]){_0x3fc8c5[_0x7473('0x3c')][_0x7473('0x49')]({'id':0x0,'priority':_0x3fc8c5[_0x7473('0x3c')][_0x7473('0x41')]+0x1,'app':_0x7473('0x4a'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x3f02f7['created']=!![];}else{_0x3f02f7[_0x7473('0x4b')]=![];}_0x3fc8c5[_0x7473('0x4c')]=_0x3f02f7;return db[_0x7473('0x4d')]['create']({'body':_0x2bd524[_0x7473('0x23')][_0x7473('0x23')],'FaxAccountId':_0x2bd524[_0x7473('0x3b')]['id'],'FaxInteractionId':_0x1c5f27['id'],'direction':'in','ContactId':_0x1c5f27[_0x7473('0x4e')],'AttachmentId':_0x2bd524[_0x7473('0x23')]['AttachmentId']});})[_0x7473('0x10')](function(_0x2be257){_0x3fc8c5['message']=_0x2be257;if(_0x3fc8c5[_0x7473('0x4c')][_0x7473('0x4f')]){return db['User'][_0x7473('0x44')]({'attributes':['id','name'],'where':{'id':_0x3fc8c5[_0x7473('0x4c')][_0x7473('0x4f')]}})[_0x7473('0x10')](function(_0xa6fc27){if(_0xa6fc27){_0x3fc8c5[_0x7473('0x3c')][_0x7473('0x50')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xa6fc27[_0x7473('0x51')]+','+(_0x3fc8c5['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x7473('0x52'),_0x7473('0x53'),_0x3fc8c5);});}return respondWithRpcPromise(_0x7473('0x52'),_0x7473('0x53'),_0x3fc8c5);})['then'](function(_0x185b3a){_0x13320e(_0x185b3a);})[_0x7473('0x19')](function(_0x389463){_0x1bb9b4(_0x340543[_0x7473('0x15')](0x1f4,_0x389463[_0x7473('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js
index 0f115b5..de68f8f 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 _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
+var _0x5fdc=['save','remove','update','emit','removeListener','register','faxAccount:','./faxAccount.events'];(function(_0x3ef4f1,_0x5f0f9b){var _0x69953c=function(_0xb4e621){while(--_0xb4e621){_0x3ef4f1['push'](_0x3ef4f1['shift']());}};_0x69953c(++_0x5f0f9b);}(_0x5fdc,0x127));var _0xc5fd=function(_0x5a7188,_0x238ed6){_0x5a7188=_0x5a7188-0x0;var _0x139fc4=_0x5fdc[_0x5a7188];return _0x139fc4;};'use strict';var FaxAccountEvents=require(_0xc5fd('0x0'));var events=[_0xc5fd('0x1'),_0xc5fd('0x2'),_0xc5fd('0x3')];function createListener(_0x36e895,_0x341db9){return function(_0x3be451){_0x341db9[_0xc5fd('0x4')](_0x36e895,_0x3be451);};}function removeListener(_0xfdf928,_0x1b6205){return function(){FaxAccountEvents[_0xc5fd('0x5')](_0xfdf928,_0x1b6205);};}exports[_0xc5fd('0x6')]=function(_0x44722b){for(var _0x216902=0x0,_0x15ffe7=events['length'];_0x216902<_0x15ffe7;_0x216902++){var _0x5d86e5=events[_0x216902];var _0x493389=createListener(_0xc5fd('0x7')+_0x5d86e5,_0x44722b);FaxAccountEvents['on'](_0x5d86e5,_0x493389);}};
\ No newline at end of file
diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js
index 9483f77..dc67a46 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 _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
+var _0x13fd=['describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/users','getAgents','create','post','/:id/canned_answers','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','/:id','destroy','delete','removeAnswers','removeAgents','exports','util','path','connect-timeout','Router','../../components/auth/service','./faxAccount.controller','get','isAuthenticated','/describe'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x13fd,0x11f));var _0xd13f=function(_0x7207fb,_0x2a1588){_0x7207fb=_0x7207fb-0x0;var _0x502a6f=_0x13fd[_0x7207fb];return _0x502a6f;};'use strict';var multer=require('multer');var util=require(_0xd13f('0x0'));var path=require(_0xd13f('0x1'));var timeout=require(_0xd13f('0x2'));var express=require('express');var router=express[_0xd13f('0x3')]();var auth=require(_0xd13f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd13f('0x5'));router[_0xd13f('0x6')]('/',auth[_0xd13f('0x7')](),controller['index']);router[_0xd13f('0x6')](_0xd13f('0x8'),auth[_0xd13f('0x7')](),controller[_0xd13f('0x9')]);router['get']('/:id',auth[_0xd13f('0x7')](),controller[_0xd13f('0xa')]);router[_0xd13f('0x6')](_0xd13f('0xb'),auth[_0xd13f('0x7')](),controller[_0xd13f('0xc')]);router['get']('/:id/canned_answers',auth[_0xd13f('0x7')](),controller[_0xd13f('0xd')]);router['get'](_0xd13f('0xe'),auth[_0xd13f('0x7')](),controller[_0xd13f('0xf')]);router['get'](_0xd13f('0x10'),auth['isAuthenticated'](),controller[_0xd13f('0x11')]);router[_0xd13f('0x6')](_0xd13f('0x12'),auth[_0xd13f('0x7')](),controller['getMessages']);router[_0xd13f('0x6')](_0xd13f('0x13'),auth[_0xd13f('0x7')](),controller[_0xd13f('0x14')]);router['post']('/',auth[_0xd13f('0x7')](),controller[_0xd13f('0x15')]);router['post']('/:id/dispositions',auth[_0xd13f('0x7')](),controller['addDisposition']);router[_0xd13f('0x16')](_0xd13f('0x17'),auth[_0xd13f('0x7')](),controller['addAnswer']);router[_0xd13f('0x16')](_0xd13f('0xe'),auth[_0xd13f('0x7')](),controller[_0xd13f('0x18')]);router['post'](_0xd13f('0x10'),auth[_0xd13f('0x7')](),controller[_0xd13f('0x19')]);router['post'](_0xd13f('0x1a'),auth[_0xd13f('0x7')](),controller[_0xd13f('0x1b')]);router[_0xd13f('0x16')](_0xd13f('0x1c'),auth['isAuthenticated'](),controller[_0xd13f('0x1d')]);router[_0xd13f('0x16')](_0xd13f('0x1e'),auth[_0xd13f('0x7')](),controller['send']);router['post'](_0xd13f('0x13'),auth[_0xd13f('0x7')](),controller['addAgents']);router['put'](_0xd13f('0x1f'),auth[_0xd13f('0x7')](),controller['update']);router['delete'](_0xd13f('0x1f'),auth[_0xd13f('0x7')](),controller[_0xd13f('0x20')]);router[_0xd13f('0x21')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xd13f('0x17'),auth[_0xd13f('0x7')](),controller[_0xd13f('0x22')]);router['delete'](_0xd13f('0x13'),auth['isAuthenticated'](),controller[_0xd13f('0x23')]);module[_0xd13f('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 67563cf..91805b4 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 _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
+var _0xf9ae=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x2b4c49,_0x5a3e8a){var _0x18b246=function(_0x1d4c2f){while(--_0x1d4c2f){_0x2b4c49['push'](_0x2b4c49['shift']());}};_0x18b246(++_0x5a3e8a);}(_0xf9ae,0x85));var _0xef9a=function(_0x2b0e98,_0x4cd5d3){_0x2b0e98=_0x2b0e98-0x0;var _0x1a213b=_0xf9ae[_0x2b0e98];return _0x1a213b;};'use strict';var Sequelize=require(_0xef9a('0x0'));module[_0xef9a('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xef9a('0x2')],'allowNull':![],'defaultValue':_0xef9a('0x3')},'appdata':{'type':Sequelize[_0xef9a('0x4')]()},'description':{'type':Sequelize[_0xef9a('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xef9a('0x5')}};
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js
index 547a52b..efd0b85 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 _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
+var _0xabce=['offset','limit','status','set','Content-Range','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','keys','options','FaxApplication','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','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','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xabce,0x103));var _0xeabc=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xabce[_0x4e1d03];return _0x362d4b;};'use strict';var pdf=require(_0xeabc('0x0'));var emlformat=require(_0xeabc('0x1'));var rimraf=require(_0xeabc('0x2'));var zipdir=require(_0xeabc('0x3'));var jsonpatch=require(_0xeabc('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeabc('0x5'));var Mustache=require(_0xeabc('0x6'));var util=require(_0xeabc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xeabc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var db=require(_0xeabc('0x18'))['db'];function respondWithStatusCode(_0x435ea7,_0x3fd0b5){_0x3fd0b5=_0x3fd0b5||0xcc;return function(_0x36a92e){if(_0x36a92e){return _0x435ea7[_0xeabc('0x19')](_0x3fd0b5);}return _0x435ea7['status'](_0x3fd0b5)[_0xeabc('0x1a')]();};}function respondWithResult(_0x1319f3,_0x3251c6){_0x3251c6=_0x3251c6||0xc8;return function(_0x55f0de){if(_0x55f0de){return _0x1319f3['status'](_0x3251c6)[_0xeabc('0x1b')](_0x55f0de);}};}function respondWithFilteredResult(_0x3ae954,_0x326bac){return function(_0x53d5cb){if(_0x53d5cb){var _0xf913d7=_0x53d5cb[_0xeabc('0x1c')],_0x638976=_0x326bac['offset'],_0x49f2d8=_0x326bac[_0xeabc('0x1d')]+_0x326bac[_0xeabc('0x1e')],_0x53fe28;if(_0x49f2d8>=_0xf913d7){_0x49f2d8=_0xf913d7;_0x53fe28=0xc8;}else{_0x53fe28=0xce;}_0x3ae954[_0xeabc('0x1f')](_0x53fe28);return _0x3ae954[_0xeabc('0x20')](_0xeabc('0x21'),_0x638976+'-'+_0x49f2d8+'/'+_0xf913d7)[_0xeabc('0x1b')](_0x53d5cb);}return null;};}function patchUpdates(_0x384be5){return function(_0x5e30ee){try{jsonpatch['apply'](_0x5e30ee,_0x384be5,!![]);}catch(_0x1253e4){return BPromise['reject'](_0x1253e4);}return _0x5e30ee[_0xeabc('0x22')]();};}function saveUpdates(_0x16530c,_0x502947){return function(_0x28063a){if(_0x28063a){return _0x28063a[_0xeabc('0x23')](_0x16530c)[_0xeabc('0x24')](function(_0x184e60){return _0x184e60;});}return null;};}function removeEntity(_0x3c9611,_0x4e99a4){return function(_0xecdbf){if(_0xecdbf){return _0xecdbf[_0xeabc('0x25')]()[_0xeabc('0x24')](function(){_0x3c9611['status'](0xcc)[_0xeabc('0x1a')]();});}};}function handleEntityNotFound(_0x3854d2,_0x214953){return function(_0x319119){if(!_0x319119){_0x3854d2['sendStatus'](0x194);}return _0x319119;};}function handleError(_0x109e1d,_0x480440){_0x480440=_0x480440||0x1f4;return function(_0x27dbaf){logger['error'](_0x27dbaf[_0xeabc('0x26')]);if(_0x27dbaf[_0xeabc('0x27')]){delete _0x27dbaf[_0xeabc('0x27')];}_0x109e1d[_0xeabc('0x1f')](_0x480440)[_0xeabc('0x28')](_0x27dbaf);};}exports[_0xeabc('0x29')]=function(_0x131722,_0x4c2693){var _0x5b2934={},_0x459c8a={},_0x5bf8f2={'count':0x0,'rows':[]};var _0x3c1b5b=_[_0xeabc('0x2a')](db['FaxApplication'][_0xeabc('0x2b')],function(_0x38572d){return{'name':_0x38572d[_0xeabc('0x2c')],'type':_0x38572d[_0xeabc('0x2d')][_0xeabc('0x2e')]};});_0x459c8a[_0xeabc('0x2f')]=_[_0xeabc('0x2a')](_0x3c1b5b,_0xeabc('0x27'));_0x459c8a[_0xeabc('0x30')]=_['keys'](_0x131722[_0xeabc('0x30')]);_0x459c8a['filters']=_[_0xeabc('0x31')](_0x459c8a[_0xeabc('0x2f')],_0x459c8a[_0xeabc('0x30')]);_0x5b2934[_0xeabc('0x32')]=_[_0xeabc('0x31')](_0x459c8a[_0xeabc('0x2f')],qs[_0xeabc('0x33')](_0x131722['query'][_0xeabc('0x33')]));_0x5b2934[_0xeabc('0x32')]=_0x5b2934[_0xeabc('0x32')]['length']?_0x5b2934[_0xeabc('0x32')]:_0x459c8a[_0xeabc('0x2f')];if(!_0x131722[_0xeabc('0x30')]['hasOwnProperty'](_0xeabc('0x34'))){_0x5b2934[_0xeabc('0x1e')]=qs[_0xeabc('0x1e')](_0x131722['query'][_0xeabc('0x1e')]);_0x5b2934[_0xeabc('0x1d')]=qs['offset'](_0x131722['query'][_0xeabc('0x1d')]);}_0x5b2934[_0xeabc('0x35')]=qs['sort'](_0x131722[_0xeabc('0x30')][_0xeabc('0x36')]);_0x5b2934[_0xeabc('0x37')]=qs[_0xeabc('0x38')](_[_0xeabc('0x39')](_0x131722['query'],_0x459c8a[_0xeabc('0x38')]),_0x3c1b5b);if(_0x131722['query'][_0xeabc('0x3a')]){_0x5b2934[_0xeabc('0x37')]=_[_0xeabc('0x3b')](_0x5b2934['where'],{'$or':_['map'](_0x3c1b5b,function(_0x452580){if(_0x452580['type']!==_0xeabc('0x3c')){var _0x4ebd64={};_0x4ebd64[_0x452580['name']]={'$like':'%'+_0x131722['query']['filter']+'%'};return _0x4ebd64;}})});}_0x5b2934=_[_0xeabc('0x3b')]({},_0x5b2934,_0x131722['options']);var _0x257fe8={'where':_0x5b2934[_0xeabc('0x37')]};return db['FaxApplication'][_0xeabc('0x1c')](_0x257fe8)['then'](function(_0x3d48f4){_0x5bf8f2['count']=_0x3d48f4;if(_0x131722[_0xeabc('0x30')][_0xeabc('0x3d')]){_0x5b2934[_0xeabc('0x3e')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x5b2934);})['then'](function(_0x46056c){_0x5bf8f2[_0xeabc('0x3f')]=_0x46056c;return _0x5bf8f2;})[_0xeabc('0x24')](respondWithFilteredResult(_0x4c2693,_0x5b2934))['catch'](handleError(_0x4c2693,null));};exports['show']=function(_0x5cd62e,_0x1680e8){var _0x5e9cb3={'raw':!![],'where':{'id':_0x5cd62e['params']['id']}},_0xc6af4d={};_0xc6af4d[_0xeabc('0x2f')]=_['keys'](db['FaxApplication']['rawAttributes']);_0xc6af4d[_0xeabc('0x30')]=_[_0xeabc('0x40')](_0x5cd62e[_0xeabc('0x30')]);_0xc6af4d[_0xeabc('0x38')]=_['intersection'](_0xc6af4d[_0xeabc('0x2f')],_0xc6af4d['query']);_0x5e9cb3[_0xeabc('0x32')]=_[_0xeabc('0x31')](_0xc6af4d[_0xeabc('0x2f')],qs[_0xeabc('0x33')](_0x5cd62e[_0xeabc('0x30')]['fields']));_0x5e9cb3['attributes']=_0x5e9cb3[_0xeabc('0x32')]['length']?_0x5e9cb3[_0xeabc('0x32')]:_0xc6af4d[_0xeabc('0x2f')];if(_0x5cd62e['query'][_0xeabc('0x3d')]){_0x5e9cb3[_0xeabc('0x3e')]=[{'all':!![]}];}_0x5e9cb3=_[_0xeabc('0x3b')]({},_0x5e9cb3,_0x5cd62e[_0xeabc('0x41')]);return db[_0xeabc('0x42')][_0xeabc('0x43')](_0x5e9cb3)[_0xeabc('0x24')](handleEntityNotFound(_0x1680e8,null))['then'](respondWithResult(_0x1680e8,null))[_0xeabc('0x44')](handleError(_0x1680e8,null));};exports[_0xeabc('0x45')]=function(_0x2e7a5e,_0x1b41c8){return db[_0xeabc('0x42')][_0xeabc('0x45')](_0x2e7a5e[_0xeabc('0x46')],{})[_0xeabc('0x24')](respondWithResult(_0x1b41c8,0xc9))[_0xeabc('0x44')](handleError(_0x1b41c8,null));};exports[_0xeabc('0x23')]=function(_0x5689fc,_0x38356c){if(_0x5689fc[_0xeabc('0x46')]['id']){delete _0x5689fc[_0xeabc('0x46')]['id'];}return db[_0xeabc('0x42')][_0xeabc('0x43')]({'where':{'id':_0x5689fc[_0xeabc('0x47')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x38356c,null))['then'](saveUpdates(_0x5689fc[_0xeabc('0x46')],null))[_0xeabc('0x24')](respondWithResult(_0x38356c,null))[_0xeabc('0x44')](handleError(_0x38356c,null));};exports[_0xeabc('0x25')]=function(_0x47440e,_0x58e2c1){return db[_0xeabc('0x42')][_0xeabc('0x43')]({'where':{'id':_0x47440e[_0xeabc('0x47')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x58e2c1,null))['then'](removeEntity(_0x58e2c1,null))[_0xeabc('0x44')](handleError(_0x58e2c1,null));};
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js
index dbe0f75..21791b8 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 _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
+var _0x3ff6=['path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x3ff6,0x71));var _0x63ff=function(_0x56996a,_0x117d1c){_0x56996a=_0x56996a-0x0;var _0x440c8f=_0x3ff6[_0x56996a];return _0x440c8f;};'use strict';var _=require('lodash');var util=require(_0x63ff('0x0'));var logger=require(_0x63ff('0x1'))('api');var moment=require(_0x63ff('0x2'));var BPromise=require('bluebird');var rp=require(_0x63ff('0x3'));var fs=require('fs');var path=require(_0x63ff('0x4'));var rimraf=require(_0x63ff('0x5'));var config=require(_0x63ff('0x6'));var attributes=require(_0x63ff('0x7'));module[_0x63ff('0x8')]=function(_0x2d45ff,_0x160911){return _0x2d45ff[_0x63ff('0x9')](_0x63ff('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x63ff('0xb'),'collate':_0x63ff('0xc')});};
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js
index bdedbfc..278a0d1 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 _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
+var _0x8e51=['../../config/utils','../../config/logger','../../config/environment','client','http','request','then','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result','catch','FaxApplication','update','body','options','raw','attributes','limit','info','UpdateFaxApplication','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x8e51,0x159));var _0x18e5=function(_0x53a20e,_0x2f842f){_0x53a20e=_0x53a20e-0x0;var _0x2ba141=_0x8e51[_0x53a20e];return _0x2ba141;};'use strict';var _=require(_0x18e5('0x0'));var util=require(_0x18e5('0x1'));var moment=require(_0x18e5('0x2'));var BPromise=require(_0x18e5('0x3'));var rs=require(_0x18e5('0x4'));var fs=require('fs');var Redis=require(_0x18e5('0x5'));var db=require(_0x18e5('0x6'))['db'];var utils=require(_0x18e5('0x7'));var logger=require(_0x18e5('0x8'))('rpc');var config=require(_0x18e5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x18e5('0xa')][_0x18e5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55ccd9,_0x37502b,_0x1b4477){return new BPromise(function(_0x556be0,_0x4914e3){return client[_0x18e5('0xc')](_0x55ccd9,_0x1b4477)[_0x18e5('0xd')](function(_0x31a37c){logger['info']('FaxApplication,\x20%s,\x20%s',_0x37502b,'request\x20sent');logger['debug'](_0x18e5('0xe'),_0x37502b,'request\x20sent',JSON[_0x18e5('0xf')](_0x31a37c));if(_0x31a37c['error']){if(_0x31a37c[_0x18e5('0x10')][_0x18e5('0x11')]===0x1f4){logger['error'](_0x18e5('0x12'),_0x37502b,_0x31a37c[_0x18e5('0x10')][_0x18e5('0x13')]);return _0x4914e3(_0x31a37c[_0x18e5('0x10')][_0x18e5('0x13')]);}logger[_0x18e5('0x10')](_0x18e5('0x12'),_0x37502b,_0x31a37c[_0x18e5('0x10')][_0x18e5('0x13')]);return _0x556be0(_0x31a37c[_0x18e5('0x10')][_0x18e5('0x13')]);}else{logger['info'](_0x18e5('0x12'),_0x37502b,'request\x20sent');_0x556be0(_0x31a37c[_0x18e5('0x14')][_0x18e5('0x13')]);}})[_0x18e5('0x15')](function(_0x3f8a0f){logger['error']('FaxApplication,\x20%s,\x20%s',_0x37502b,_0x3f8a0f);_0x4914e3(_0x3f8a0f);});});}exports['UpdateFaxApplication']=function(_0x3e7057){var _0xfb9cf8=this;return new Promise(function(_0x4cd1ae,_0x333a10){return db[_0x18e5('0x16')][_0x18e5('0x17')](_0x3e7057[_0x18e5('0x18')],{'raw':_0x3e7057[_0x18e5('0x19')]?_0x3e7057[_0x18e5('0x19')][_0x18e5('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e7057[_0x18e5('0x19')]?_0x3e7057['options']['where']||null:null,'attributes':_0x3e7057[_0x18e5('0x19')]?_0x3e7057[_0x18e5('0x19')][_0x18e5('0x1b')]||null:null,'limit':_0x3e7057['options']?_0x3e7057['options'][_0x18e5('0x1c')]||null:null})[_0x18e5('0xd')](function(_0x4e37f7){logger[_0x18e5('0x1d')](_0x18e5('0x1e'),_0x3e7057);logger[_0x18e5('0x1f')]('UpdateFaxApplication',_0x3e7057,JSON[_0x18e5('0xf')](_0x4e37f7));_0x4cd1ae(_0x4e37f7);})[_0x18e5('0x15')](function(_0x3d5f16){logger[_0x18e5('0x10')]('UpdateFaxApplication',_0x3d5f16[_0x18e5('0x13')],_0x3e7057);_0x333a10(_0xfb9cf8['error'](0x1f4,_0x3d5f16[_0x18e5('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js
index 691095d..cb36414 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 _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
+var _0x5fc3=['post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','/:id','show'];(function(_0x1cf8ea,_0x1c0c7c){var _0x3d441a=function(_0x10fc9a){while(--_0x10fc9a){_0x1cf8ea['push'](_0x1cf8ea['shift']());}};_0x3d441a(++_0x1c0c7c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x156a0d,_0x3946ce){_0x156a0d=_0x156a0d-0x0;var _0x98a9ba=_0x5fc3[_0x156a0d];return _0x98a9ba;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var auth=require(_0x35fc('0x5'));var interaction=require(_0x35fc('0x6'));var config=require('../../config/environment');var controller=require(_0x35fc('0x7'));router[_0x35fc('0x8')]('/',auth[_0x35fc('0x9')](),controller['index']);router['get'](_0x35fc('0xa'),auth['isAuthenticated'](),controller[_0x35fc('0xb')]);router[_0x35fc('0xc')]('/',auth[_0x35fc('0x9')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')](_0x35fc('0xa'),auth[_0x35fc('0x9')](),controller['update']);router[_0x35fc('0xf')](_0x35fc('0xa'),auth['isAuthenticated'](),controller[_0x35fc('0x10')]);module[_0x35fc('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 5f86454..a7eed09 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 _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
+var _0xe2ab=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x2bcff5,_0x2ec4fd){var _0x1d989f=function(_0x548998){while(--_0x548998){_0x2bcff5['push'](_0x2bcff5['shift']());}};_0x1d989f(++_0x2ec4fd);}(_0xe2ab,0x1bb));var _0xbe2a=function(_0x5065b3,_0x144265){_0x5065b3=_0x5065b3-0x0;var _0x426b97=_0xe2ab[_0x5065b3];return _0x426b97;};'use strict';var Sequelize=require(_0xbe2a('0x0'));module[_0xbe2a('0x1')]={'closed':{'type':Sequelize[_0xbe2a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbe2a('0x3')]},'disposition':{'type':Sequelize[_0xbe2a('0x4')]},'note':{'type':Sequelize[_0xbe2a('0x4')]},'read1stAt':{'type':Sequelize[_0xbe2a('0x3')]},'fax':{'type':Sequelize[_0xbe2a('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xbe2a('0x5')]('in',_0xbe2a('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbe2a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xbe2a('0x5')]('in',_0xbe2a('0x6')),'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 da2de74..079af1d 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 _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
+var _0xa596=['expr','parseSearch','search','sqlOperator','conditions','unreadMessages','having','`\x20=\x200','Contact','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','UserId','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','$gte','parse','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','journey','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','catch','params','fields','includeAll','include','merge','options','FaxInteraction','find','create','update','destroy','describe','addMessage','FaxMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','format','transcript-%d-%s.zip','Attachment','createdAt','Messages','get','mkdirSync','basename','createReadStream','log','err','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','select','field','color','tools_tags','u.id','u.fullname','from','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId'];(function(_0x456a01,_0x221b75){var _0x591772=function(_0x29174c){while(--_0x29174c){_0x456a01['push'](_0x456a01['shift']());}};_0x591772(++_0x221b75);}(_0xa596,0x7b));var _0x6a59=function(_0x1db289,_0x423595){_0x1db289=_0x1db289-0x0;var _0x434e21=_0xa596[_0x1db289];return _0x434e21;};'use strict';var pdf=require(_0x6a59('0x0'));var emlformat=require(_0x6a59('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6a59('0x2'));var jsonpatch=require(_0x6a59('0x3'));var rp=require(_0x6a59('0x4'));var moment=require(_0x6a59('0x5'));var BPromise=require(_0x6a59('0x6'));var Mustache=require(_0x6a59('0x7'));var util=require(_0x6a59('0x8'));var path=require(_0x6a59('0x9'));var sox=require('sox');var csv=require(_0x6a59('0xa'));var ejs=require(_0x6a59('0xb'));var fs=require('fs');var _=require(_0x6a59('0xc'));var squel=require(_0x6a59('0xd'));var crypto=require(_0x6a59('0xe'));var jsforce=require(_0x6a59('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6a59('0xa'));var querystring=require('querystring');var Papa=require(_0x6a59('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6a59('0x11'));var as=require(_0x6a59('0x12'));var hardwareService=require(_0x6a59('0x13'));var logger=require('../../config/logger')(_0x6a59('0x14'));var utils=require(_0x6a59('0x15'));var config=require('../../config/environment');var db=require(_0x6a59('0x16'))['db'];config['redis']=_[_0x6a59('0x17')](config[_0x6a59('0x18')],{'host':_0x6a59('0x19'),'port':0x18eb});var socket=require(_0x6a59('0x1a'))(new Redis(config[_0x6a59('0x18')]));require(_0x6a59('0x1b'))[_0x6a59('0x1c')](socket);function respondWithStatusCode(_0xb2fd50,_0x3f8e6a){_0x3f8e6a=_0x3f8e6a||0xcc;return function(_0x2c450f){if(_0x2c450f){return _0xb2fd50[_0x6a59('0x1d')](_0x3f8e6a);}return _0xb2fd50['status'](_0x3f8e6a)[_0x6a59('0x1e')]();};}function respondWithResult(_0x1ec768,_0x416613){_0x416613=_0x416613||0xc8;return function(_0x2cd31a){if(_0x2cd31a){return _0x1ec768[_0x6a59('0x1f')](_0x416613)[_0x6a59('0x20')](_0x2cd31a);}};}function respondWithFilteredResult(_0x5a28f0,_0x344ed4){return function(_0xab9a1){if(_0xab9a1){var _0x3cb568=_0xab9a1[_0x6a59('0x21')],_0x45b286=_0x344ed4[_0x6a59('0x22')],_0x209319=_0x344ed4[_0x6a59('0x22')]+_0x344ed4[_0x6a59('0x23')],_0x2b15b0;if(_0x209319>=_0x3cb568){_0x209319=_0x3cb568;_0x2b15b0=0xc8;}else{_0x2b15b0=0xce;}_0x5a28f0[_0x6a59('0x1f')](_0x2b15b0);return _0x5a28f0[_0x6a59('0x24')](_0x6a59('0x25'),_0x45b286+'-'+_0x209319+'/'+_0x3cb568)[_0x6a59('0x20')](_0xab9a1);}return null;};}function patchUpdates(_0x477cdb){return function(_0x2ae2ce){try{jsonpatch[_0x6a59('0x26')](_0x2ae2ce,_0x477cdb,!![]);}catch(_0x545ce0){return BPromise[_0x6a59('0x27')](_0x545ce0);}return _0x2ae2ce[_0x6a59('0x28')]();};}function saveUpdates(_0xe2573f,_0x4764e7){return function(_0x5d7e84){if(_0x5d7e84){return _0x5d7e84['update'](_0xe2573f)[_0x6a59('0x29')](function(_0x3e683e){return _0x3e683e;});}return null;};}function removeEntity(_0x2b04a5,_0x3d3bdc){return function(_0x56dab5){if(_0x56dab5){return _0x56dab5['destroy']()[_0x6a59('0x29')](function(){_0x2b04a5[_0x6a59('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x287c49,_0x5ee827){return function(_0x342292){if(!_0x342292){_0x287c49[_0x6a59('0x1d')](0x194);}return _0x342292;};}function handleError(_0x5855bc,_0x4174ee){_0x4174ee=_0x4174ee||0x1f4;return function(_0x4ae7dc){logger[_0x6a59('0x2a')](_0x4ae7dc[_0x6a59('0x2b')]);if(_0x4ae7dc['name']){delete _0x4ae7dc[_0x6a59('0x2c')];}_0x5855bc['status'](_0x4174ee)[_0x6a59('0x2d')](_0x4ae7dc);};}function getInteractionUsers(_0x1eb305,_0x205b4d){return new BPromise(function(_0x294e8a,_0x359335){try{if(_0x205b4d[_0x1eb305['id']]){_0x1eb305[_0x6a59('0x2e')]=_['map'](_0x205b4d[_0x1eb305['id']],function(_0x5c6b80){return{'id':_0x5c6b80['id'],'fullname':_0x5c6b80[_0x6a59('0x2f')]};});}}catch(_0x37f63f){_0x359335(_0x37f63f);}_0x294e8a(_0x1eb305);});}function getInteractionTags(_0x563675,_0x1c7016){return new BPromise(function(_0x4ced19,_0x3f0a4f){try{if(_0x563675[_0x6a59('0x30')]){_0x563675[_0x6a59('0x31')]=[];_0x563675['TagIds'][_0x6a59('0x32')](',')[_0x6a59('0x33')](function(_0x41455){_0x563675['Tags'][_0x6a59('0x34')](_0x1c7016[_0x41455]);});}delete _0x563675[_0x6a59('0x30')];}catch(_0x517700){_0x3f0a4f(_0x517700);}_0x4ced19(_0x563675);});}function updateFaxInteraction(_0x3b8c8f,_0x54023e,_0x1f1024){return new BPromise(function(_0x39e2d1,_0x489cc9){return getInteractionUsers(_0x3b8c8f,_0x1f1024)[_0x6a59('0x29')](function(_0x2af776){return getInteractionTags(_0x2af776,_0x54023e);})['then'](function(_0x4beeaf){_0x39e2d1(_0x4beeaf);})['catch'](function(_0x595f72){_0x489cc9(_0x595f72);});});}exports['index']=function(_0x3f711e,_0x218355){var _0x16f497={},_0x5d2a12={},_0x476237={'count':0x0,'rows':[]};var _0x24cf48=_['map'](db['FaxInteraction'][_0x6a59('0x35')],function(_0x507d9f){return{'name':_0x507d9f[_0x6a59('0x36')],'type':_0x507d9f[_0x6a59('0x37')][_0x6a59('0x38')]};});_0x5d2a12[_0x6a59('0x39')]=_[_0x6a59('0x3a')](_0x24cf48,_0x6a59('0x2c'));_0x5d2a12[_0x6a59('0x3b')]=_[_0x6a59('0x3c')](_0x3f711e[_0x6a59('0x3b')]);_0x5d2a12[_0x6a59('0x3d')]=_[_0x6a59('0x3e')](_0x5d2a12[_0x6a59('0x39')],_0x5d2a12[_0x6a59('0x3b')]);_0x16f497[_0x6a59('0x3f')]=_[_0x6a59('0x3e')](_0x5d2a12[_0x6a59('0x39')],qs['fields'](_0x3f711e[_0x6a59('0x3b')]['fields']));_0x16f497[_0x6a59('0x3f')]=_0x16f497[_0x6a59('0x3f')][_0x6a59('0x40')]?_0x16f497[_0x6a59('0x3f')]:_0x5d2a12[_0x6a59('0x39')];if(!_0x3f711e[_0x6a59('0x3b')][_0x6a59('0x41')](_0x6a59('0x42'))){_0x16f497[_0x6a59('0x23')]=qs['limit'](_0x3f711e[_0x6a59('0x3b')][_0x6a59('0x23')]);_0x16f497[_0x6a59('0x22')]=qs['offset'](_0x3f711e['query'][_0x6a59('0x22')]);}_0x16f497[_0x6a59('0x43')]=qs[_0x6a59('0x44')](_0x3f711e['query'][_0x6a59('0x44')]);_0x16f497[_0x6a59('0x45')]=qs[_0x6a59('0x3d')](_['pick'](_0x3f711e['query'],_0x5d2a12[_0x6a59('0x3d')]),_0x24cf48);var _0x124c5d=[];var _0x3f4396=squel[_0x6a59('0x46')]()[_0x6a59('0x47')]('id')[_0x6a59('0x47')]('name')['field'](_0x6a59('0x48'))['from'](_0x6a59('0x49'));var _0x1c3855=squel['select']()[_0x6a59('0x47')](_0x6a59('0x4a'))[_0x6a59('0x47')](_0x6a59('0x4b'))[_0x6a59('0x47')]('ui.FaxInteractionId')[_0x6a59('0x4c')]('user_has_fax_interactions','ui')['left_join']('users','u',_0x6a59('0x4d'));var _0x3f1123=squel[_0x6a59('0x46')]()['from'](_0x6a59('0x4e'),'i')[_0x6a59('0x4f')](_0x6a59('0x50'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x6a59('0x51'))['left_join'](_0x6a59('0x52'),'a',_0x6a59('0x53'))['left_join']('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')[_0x6a59('0x4f')](_0x6a59('0x54'),'it',_0x6a59('0x55'))[_0x6a59('0x4f')](_0x6a59('0x49'),'t',_0x6a59('0x56'));var _0x2052e7=squel['expr']();var _0x3c0dc7=[];var _0xc24a7d=squel[_0x6a59('0x57')]();var _0x119d90;if(_0x3f711e[_0x6a59('0x3b')]['search']){_0x119d90=as[_0x6a59('0x58')](_0x3f711e[_0x6a59('0x3b')][_0x6a59('0x59')]);var _0x21c32c=_0x119d90[_0x6a59('0x5a')];for(var _0x45f9c0=0x0;_0x45f9c0<_0x119d90['conditions'][_0x6a59('0x40')];_0x45f9c0++){var _0x49e279=_0x119d90[_0x6a59('0x5b')][_0x45f9c0];var _0x1742b4='i';var _0xd207e7=_['find'](_0x24cf48,['name',_0x49e279['field']]);if(!_0xd207e7){switch(_0x49e279[_0x6a59('0x47')]){case _0x6a59('0x5c'):if(_0x49e279['value']==0x1){_0x3f1123[_0x6a59('0x5d')]('`'+_0x49e279[_0x6a59('0x47')]+_0x6a59('0x5e'));}else{_0x3f1123[_0x6a59('0x5d')]('`'+_0x49e279['field']+'`\x20>\x200');}break;case _0x6a59('0x5f'):if(_0x49e279[_0x6a59('0x60')]===_0x6a59('0x61')){if(_0x49e279[_0x6a59('0x62')][_0x6a59('0x32')]('\x20')['length']>0x1){_0x2052e7[_0x21c32c]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6a59('0x63')](_0x49e279[_0x6a59('0x62')]),null);}else{var _0x30c7a3='%'+_0x49e279['value']+'%';_0x2052e7[_0x21c32c](_0x6a59('0x64'),_0x30c7a3,_0x30c7a3,_0x30c7a3);}}else{_0xd207e7=_['find'](_0x24cf48,[_0x6a59('0x2c'),_0x6a59('0x65')]);_0x49e279['field']=_0x6a59('0x65');_0x116883=as[_0x6a59('0x66')](_0x1742b4,_0xd207e7[_0x6a59('0x37')],_0x49e279);_0x2052e7[_0x21c32c](_0x116883[_0x6a59('0x67')],_0x116883['value'][_0x6a59('0x68')],_0x116883[_0x6a59('0x62')][_0x6a59('0x1e')]);}break;case _0x6a59('0x69'):var _0x1d691e=_0x49e279[_0x6a59('0x62')]['split'](',')[_0x6a59('0x3a')](function(_0x1e0cc1){return Number(_0x1e0cc1);});_0x1d691e[_0x6a59('0x33')](function(_0x153c2f){_0xc24a7d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x153c2f+',%');});_0x3c0dc7=_[_0x6a59('0x6a')](_0x3c0dc7,_0x1d691e);break;case _0x6a59('0x6b'):if(_0x49e279['operator']===_0x6a59('0x61')){_0x2052e7[_0x21c32c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x49e279[_0x6a59('0x62')]+'%',null);}else{_0xd207e7=_['find'](_0x24cf48,[_0x6a59('0x2c'),_0x6a59('0x6c')]);_0x49e279[_0x6a59('0x47')]=_0x6a59('0x6c');_0x116883=as[_0x6a59('0x66')](_0x1742b4,_0xd207e7[_0x6a59('0x37')],_0x49e279);_0x2052e7[_0x21c32c](_0x116883[_0x6a59('0x67')],_0x116883[_0x6a59('0x62')][_0x6a59('0x68')],_0x116883[_0x6a59('0x62')][_0x6a59('0x1e')]);}break;case _0x6a59('0x6d'):_0x116883=as[_0x6a59('0x66')]('me',null,_0x49e279);_0x2052e7[_0x21c32c](_0x116883['text'],_0x116883[_0x6a59('0x62')]['start'],_0x116883['value'][_0x6a59('0x1e')]);break;}}else{var _0x116883=as['buildExpression'](_0x1742b4,_0xd207e7['type'],_0x49e279);_0x2052e7[_0x21c32c](_0x116883['text'],_0x116883[_0x6a59('0x62')]['start'],_0x116883[_0x6a59('0x62')][_0x6a59('0x1e')]);}}}else{var _0x316844=_(_0x3f711e[_0x6a59('0x3b')])[_0x6a59('0x3c')]()[_0x6a59('0x3a')](function(_0x4c1ce4){return _[_0x6a59('0x6e')](_0x24cf48,[_0x6a59('0x2c'),_0x4c1ce4])?_0x4c1ce4:undefined;})[_0x6a59('0x6f')]()[_0x6a59('0x62')]();if(!_[_0x6a59('0x70')](_0x316844)){_0x316844['forEach'](function(_0x3e3be6){if(_0x3e3be6===_0x6a59('0x71')){_0x3f1123[_0x6a59('0x45')](_0x6a59('0x72'),[][_0x6a59('0x73')](_0x3f711e[_0x6a59('0x3b')][_0x3e3be6]));}else if(_0x3e3be6==='createdAt'){var _0x2e6637=JSON['parse'](_0x3f711e['query'][_0x3e3be6])[_0x6a59('0x74')];var _0x154870=JSON[_0x6a59('0x75')](_0x3f711e['query'][_0x3e3be6])[_0x6a59('0x76')];_0x3f1123[_0x6a59('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e6637,_0x154870);}else{if(_0x3f711e[_0x6a59('0x3b')][_0x3e3be6]===_0x6a59('0x77')){_0x3f1123['where']('i.'+_0x3e3be6+_0x6a59('0x78'));}else{_0x3f1123[_0x6a59('0x45')]('i.'+_0x3e3be6+'\x20=\x20?',_0x3f711e[_0x6a59('0x3b')][_0x3e3be6]);}}});}if(_0x3f711e['query'][_0x6a59('0x79')]){if(_0x3f711e[_0x6a59('0x3b')][_0x6a59('0x79')]==0x1){_0x3f1123[_0x6a59('0x5d')](_0x6a59('0x7a'));}else{_0x3f1123['having']('`unreadMessages`\x20>\x200');}}if(_0x3f711e[_0x6a59('0x3b')][_0x6a59('0x7b')]){_0x3c0dc7=_['isArray'](_0x3f711e['query'][_0x6a59('0x7b')])?_0x3f711e['query']['tag']:new Array(_0x3f711e['query'][_0x6a59('0x7b')]);_0x3c0dc7[_0x6a59('0x33')](function(_0x47aa04){_0xc24a7d['or'](_0x6a59('0x7c'),'%,'+_0x47aa04+',%');});}if(_0x3f711e[_0x6a59('0x3b')][_0x6a59('0x7d')]){var _0x4c602a=_0x3f711e[_0x6a59('0x3b')][_0x6a59('0x7d')][_0x6a59('0x7e')]('\x5c','\x5c\x5c')[_0x6a59('0x7e')]('\x27\x27',_0x6a59('0x7f'));if(qs[_0x6a59('0x80')](_0x4c602a)){_0x2052e7['or'](_0x6a59('0x81'),_0x4c602a+'%')['or']('i.fax\x20LIKE\x20?',_0x4c602a+'%');}_0x2052e7['or'](_0x6a59('0x82'),_0x4c602a+'%');}}_0x3f1123[_0x6a59('0x45')](_0x2052e7);_0x3f1123[_0x6a59('0x83')](_0x6a59('0x84'));var _0x183dd1={'type':db[_0x6a59('0x85')][_0x6a59('0x86')]['SELECT'],'raw':!![]};var _0x52bd1e=_0x3f1123[_0x6a59('0x87')]();_0x52bd1e[_0x6a59('0x47')](_0x6a59('0x84'));_0x52bd1e[_0x6a59('0x47')](_0x6a59('0x88'),_0x6a59('0x5c'));if(_0x16f497['order']){_0x16f497[_0x6a59('0x43')]['forEach'](function(_0x2c087){_0x3f1123[_0x6a59('0x43')]('i.'+_0x2c087[0x0],_0x2c087[0x1]===_0x6a59('0x89')?![]:!![]);});}if(!_[_0x6a59('0x70')](_0x3c0dc7)){_0x3f1123[_0x6a59('0x5d')](_0xc24a7d);_0x52bd1e[_0x6a59('0x45')](_0x6a59('0x8a'),_0x3c0dc7);}BPromise['resolve']()[_0x6a59('0x29')](function(){if(!_0x119d90){if(_0x3f711e[_0x6a59('0x3b')][_0x6a59('0x71')]||_0x3f711e[_0x6a59('0x3b')][_0x6a59('0x8b')])return;_0x52bd1e['where'](_0x6a59('0x8c'));_0x3f1123[_0x6a59('0x45')](_0x6a59('0x8c'));return;}return _0x3f711e[_0x6a59('0x8d')][_0x6a59('0x8e')]({'attributes':['id'],'raw':!![]})[_0x6a59('0x29')](function(_0x2041fd){if(_[_0x6a59('0x70')](_0x2041fd)){_0x52bd1e['where'](_0x6a59('0x8f'));_0x3f1123[_0x6a59('0x45')](_0x6a59('0x8f'));}else{_0x52bd1e[_0x6a59('0x45')]('i.FaxAccountId\x20IN\x20?',_[_0x6a59('0x3a')](_0x2041fd,'id'));_0x3f1123['where']('i.FaxAccountId\x20IN\x20?',_['map'](_0x2041fd,'id'));}});})['then'](function(){db[_0x6a59('0x90')]['query'](_0x52bd1e[_0x6a59('0x91')](),_0x183dd1)[_0x6a59('0x29')](function(_0x323357){_0x476237[_0x6a59('0x21')]=_0x323357[_0x6a59('0x40')];if(_0x476237[_0x6a59('0x21')]===0x0)return[];return db[_0x6a59('0x90')][_0x6a59('0x3b')](_0x3f4396[_0x6a59('0x91')](),_0x183dd1)[_0x6a59('0x29')](function(_0x498daa){_0x124c5d=_['keyBy'](_0x498daa,'id');_0x183dd1=_['merge'](_0x183dd1,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3f711e[_0x6a59('0x3b')]['fields']){_0x16f497[_0x6a59('0x3f')]['forEach'](function(_0x58b12d){_0x3f1123[_0x6a59('0x47')]('i.'+_0x58b12d);});}else{_0x3f1123[_0x6a59('0x47')](_0x6a59('0x88'),_0x6a59('0x5c'));_0x3f1123[_0x6a59('0x47')](_0x6a59('0x92'),'Account.key');_0x3f1123[_0x6a59('0x47')](_0x6a59('0x93'),_0x6a59('0x94'));_0x3f1123[_0x6a59('0x47')](_0x6a59('0x95'));_0x3f1123['field']('c.firstName',_0x6a59('0x96'));_0x3f1123[_0x6a59('0x47')](_0x6a59('0x97'),'Contact.lastName');_0x3f1123['field'](_0x6a59('0x98'),_0x6a59('0x99'));_0x3f1123[_0x6a59('0x47')](_0x6a59('0x9a'),_0x6a59('0x9b'));_0x3f1123[_0x6a59('0x47')](_0x6a59('0x9c'),_0x6a59('0x9d'));_0x3f1123[_0x6a59('0x47')]('c.fax',_0x6a59('0x9e'));_0x3f1123[_0x6a59('0x47')](_0x6a59('0x9f'),_0x6a59('0xa0'));_0x3f1123['field'](_0x6a59('0xa1'),'Owner.internal');_0x3f1123[_0x6a59('0x47')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x16f497[_0x6a59('0x23')])_0x3f1123[_0x6a59('0x23')](_0x16f497[_0x6a59('0x23')]);if(_0x16f497[_0x6a59('0x22')])_0x3f1123[_0x6a59('0x22')](_0x16f497[_0x6a59('0x22')]);return db[_0x6a59('0x90')][_0x6a59('0x3b')](_0x3f1123['toString'](),_0x183dd1);})[_0x6a59('0x29')](function(_0x337a1f){_0x1c3855[_0x6a59('0x45')](_0x6a59('0xa2'),_[_0x6a59('0x3a')](_0x337a1f,'id'));return db[_0x6a59('0x90')][_0x6a59('0x3b')](_0x1c3855[_0x6a59('0x91')](),_0x183dd1)[_0x6a59('0x29')](function(_0x1559c7){var _0x36e278=_[_0x6a59('0xa3')](_0x1559c7,_0x6a59('0xa4'));var _0x571b33=[];_0x337a1f[_0x6a59('0x33')](function(_0x106b18){_0x571b33[_0x6a59('0x34')](updateFaxInteraction(_0x106b18,_0x124c5d,_0x36e278));});return BPromise[_0x6a59('0xa5')](_0x571b33);});});})[_0x6a59('0x29')](function(_0x1392c9){_0x476237[_0x6a59('0xa6')]=_0x1392c9;return _0x476237;})[_0x6a59('0x29')](respondWithFilteredResult(_0x218355,_0x16f497));})[_0x6a59('0xa7')](handleError(_0x218355,null));};exports['show']=function(_0x1bb060,_0x3f149f){var _0x60809a={'raw':![],'where':{'id':_0x1bb060[_0x6a59('0xa8')]['id']}},_0x1d84df={};_0x1d84df[_0x6a59('0x39')]=_[_0x6a59('0x3c')](db['FaxInteraction'][_0x6a59('0x35')]);_0x1d84df[_0x6a59('0x3b')]=_[_0x6a59('0x3c')](_0x1bb060['query']);_0x1d84df['filters']=_['intersection'](_0x1d84df[_0x6a59('0x39')],_0x1d84df[_0x6a59('0x3b')]);_0x60809a[_0x6a59('0x3f')]=_['intersection'](_0x1d84df[_0x6a59('0x39')],qs['fields'](_0x1bb060[_0x6a59('0x3b')][_0x6a59('0xa9')]));_0x60809a['attributes']=_0x60809a[_0x6a59('0x3f')][_0x6a59('0x40')]?_0x60809a[_0x6a59('0x3f')]:_0x1d84df[_0x6a59('0x39')];if(_0x1bb060[_0x6a59('0x3b')][_0x6a59('0xaa')]){_0x60809a[_0x6a59('0xab')]=[{'all':!![]}];}_0x60809a=_[_0x6a59('0xac')]({},_0x60809a,_0x1bb060[_0x6a59('0xad')]);return db[_0x6a59('0xae')][_0x6a59('0xaf')](_0x60809a)['then'](handleEntityNotFound(_0x3f149f,null))[_0x6a59('0x29')](respondWithResult(_0x3f149f,null))[_0x6a59('0xa7')](handleError(_0x3f149f,null));};exports['create']=function(_0x4b95e0,_0x333170){return db['FaxInteraction'][_0x6a59('0xb0')](_0x4b95e0[_0x6a59('0x6d')],{})[_0x6a59('0x29')](respondWithResult(_0x333170,0xc9))['catch'](handleError(_0x333170,null));};exports[_0x6a59('0xb1')]=function(_0x270bd9,_0x2a8fed){if(_0x270bd9[_0x6a59('0x6d')]['id']){delete _0x270bd9[_0x6a59('0x6d')]['id'];}return db['FaxInteraction'][_0x6a59('0xaf')]({'where':{'id':_0x270bd9[_0x6a59('0xa8')]['id']}})[_0x6a59('0x29')](handleEntityNotFound(_0x2a8fed,null))[_0x6a59('0x29')](saveUpdates(_0x270bd9[_0x6a59('0x6d')],null))['then'](respondWithResult(_0x2a8fed,null))['catch'](handleError(_0x2a8fed,null));};exports[_0x6a59('0xb2')]=function(_0x483858,_0x3e065a){return db[_0x6a59('0xae')][_0x6a59('0xaf')]({'where':{'id':_0x483858[_0x6a59('0xa8')]['id']}})['then'](handleEntityNotFound(_0x3e065a,null))['then'](removeEntity(_0x3e065a,null))['catch'](handleError(_0x3e065a,null));};exports[_0x6a59('0xb3')]=function(_0x27909f,_0x57b25d){return db[_0x6a59('0xae')]['describe']()[_0x6a59('0x29')](respondWithResult(_0x57b25d,null))[_0x6a59('0xa7')](handleError(_0x57b25d,null));};exports[_0x6a59('0xb4')]=function(_0x498556,_0x4ad481,_0x3f878c){return db[_0x6a59('0xb5')][_0x6a59('0xaf')]({'where':{'id':_0x498556[_0x6a59('0xa8')]['id']}})[_0x6a59('0x29')](handleEntityNotFound(_0x4ad481,null))[_0x6a59('0x29')](function(_0x54c1ee){if(_0x54c1ee){return _0x54c1ee[_0x6a59('0xb4')](_0x498556['body'][_0x6a59('0xb6')],_['omit'](_0x498556[_0x6a59('0x6d')],[_0x6a59('0xb6'),'id'])||{});}})[_0x6a59('0x29')](respondWithResult(_0x4ad481,null))[_0x6a59('0xa7')](handleError(_0x4ad481,null));};exports[_0x6a59('0xb7')]=function(_0x3e51e9,_0x3d099a,_0x4986b9){var _0x5c2159={'raw':![],'where':{}};var _0x2d37f2={};var _0x1041f7={'count':0x0,'rows':[]};return db[_0x6a59('0xae')]['findOne']({'where':{'id':_0x3e51e9['params']['id']}})[_0x6a59('0x29')](handleEntityNotFound(_0x3d099a,null))[_0x6a59('0x29')](function(_0x2093c7){if(_0x2093c7){_0x2d37f2[_0x6a59('0x39')]=_[_0x6a59('0x3c')](db[_0x6a59('0xb5')][_0x6a59('0x35')]);_0x2d37f2[_0x6a59('0x3b')]=_[_0x6a59('0x3c')](_0x3e51e9['query']);_0x2d37f2[_0x6a59('0x3d')]=_[_0x6a59('0x3e')](_0x2d37f2[_0x6a59('0x39')],_0x2d37f2[_0x6a59('0x3b')]);_0x5c2159[_0x6a59('0x3f')]=_['intersection'](_0x2d37f2[_0x6a59('0x39')],qs[_0x6a59('0xa9')](_0x3e51e9[_0x6a59('0x3b')][_0x6a59('0xa9')]));_0x5c2159[_0x6a59('0x3f')]=_0x5c2159[_0x6a59('0x3f')][_0x6a59('0x40')]?_0x5c2159[_0x6a59('0x3f')]:_0x2d37f2[_0x6a59('0x39')];if(!_0x3e51e9['query'][_0x6a59('0x41')](_0x6a59('0x42'))){_0x5c2159['limit']=qs['limit'](_0x3e51e9[_0x6a59('0x3b')][_0x6a59('0x23')]);_0x5c2159['offset']=qs[_0x6a59('0x22')](_0x3e51e9[_0x6a59('0x3b')]['offset']);}_0x5c2159['order']=qs[_0x6a59('0x44')](_0x3e51e9['query'][_0x6a59('0x44')]);_0x5c2159[_0x6a59('0x45')]=qs[_0x6a59('0x3d')](_['pick'](_0x3e51e9[_0x6a59('0x3b')],_0x2d37f2[_0x6a59('0x3d')]));_0x5c2159['where'][_0x6a59('0xa4')]=_0x2093c7['id'];if(_0x3e51e9[_0x6a59('0x3b')][_0x6a59('0x7d')]){_0x5c2159[_0x6a59('0x45')]=_[_0x6a59('0xac')](_0x5c2159[_0x6a59('0x45')],{'$or':_['map'](_0x5c2159['attributes'],function(_0x2ef083){var _0x42b298={};_0x42b298[_0x2ef083]={'$like':'%'+_0x3e51e9['query'][_0x6a59('0x7d')]+'%'};return _0x42b298;})});}if(_0x3e51e9[_0x6a59('0x3b')][_0x6a59('0x74')]){var _0x37da5f=_0x3e51e9[_0x6a59('0x3b')][_0x6a59('0x74')][_0x6a59('0x32')](',');var _0x361088={};_0x361088[_0x37da5f[0x0]]={'$gte':moment(_0x37da5f[0x1])['format'](_0x6a59('0xb8'))};_0x5c2159[_0x6a59('0x45')]=_[_0x6a59('0xac')](_0x5c2159['where'],_0x361088);}_0x5c2159=_[_0x6a59('0xac')]({},_0x5c2159,_0x3e51e9[_0x6a59('0xad')]);return db['FaxMessage'][_0x6a59('0x21')]({'where':_0x5c2159[_0x6a59('0x45')]})[_0x6a59('0x29')](function(_0x59d107){_0x1041f7['count']=_0x59d107;if(_0x3e51e9[_0x6a59('0x3b')][_0x6a59('0xaa')]){_0x5c2159['include']=[{'all':!![]}];}return db[_0x6a59('0xb5')][_0x6a59('0xb9')](_0x5c2159);})['then'](function(_0x31f3d7){_0x1041f7[_0x6a59('0xa6')]=_0x31f3d7;return _0x1041f7;});}})[_0x6a59('0x29')](respondWithFilteredResult(_0x3d099a,_0x5c2159))[_0x6a59('0xa7')](handleError(_0x3d099a,null));};exports[_0x6a59('0xba')]=function(_0x44df7e,_0x3bc9cc,_0x9a15e8){return db['FaxInteraction'][_0x6a59('0xaf')]({'where':{'id':_0x44df7e['params']['id']}})[_0x6a59('0x29')](handleEntityNotFound(_0x3bc9cc,null))['then'](function(_0x5f346c){if(_0x5f346c){return _0x5f346c['setTags'](_0x44df7e[_0x6a59('0x6d')][_0x6a59('0xb6')],_['omit'](_0x44df7e[_0x6a59('0x6d')],['ids','id'])||{})[_0x6a59('0xbb')](function(){return db[_0x6a59('0x69')][_0x6a59('0xb9')]({'attributes':['id',_0x6a59('0x2c'),_0x6a59('0x48')],'where':{'id':_0x44df7e['body'][_0x6a59('0xb6')]}});})[_0x6a59('0x29')](function(_0x3f1873){socket[_0x6a59('0xbc')](_0x6a59('0xbd'),{'id':Number(_0x44df7e[_0x6a59('0xa8')]['id']),'tags':_0x3f1873||[]});return{'id':Number(_0x44df7e[_0x6a59('0xa8')]['id']),'tags':_0x3f1873||[]};});}})['then'](respondWithResult(_0x3bc9cc,null))[_0x6a59('0xa7')](handleError(_0x3bc9cc,null));};exports[_0x6a59('0xbe')]=function(_0x4fc9c1,_0x11b5ab,_0x566799){return db['FaxInteraction'][_0x6a59('0xaf')]({'where':{'id':_0x4fc9c1[_0x6a59('0xa8')]['id']}})['then'](handleEntityNotFound(_0x11b5ab,null))[_0x6a59('0x29')](function(_0x52b9dd){if(_0x52b9dd){return _0x52b9dd['removeTags'](_0x4fc9c1[_0x6a59('0x3b')][_0x6a59('0xb6')]);}})[_0x6a59('0x29')](respondWithStatusCode(_0x11b5ab,null))['catch'](handleError(_0x11b5ab,null));};exports[_0x6a59('0xbf')]=function(_0x497e73,_0x30f1d6){var _0x57d792=moment()[_0x6a59('0xc0')]()[_0x6a59('0x91')]();var _0x14815b=path['join'](config[_0x6a59('0xc1')],_0x6a59('0xc2'),_0x6a59('0xc3'),_0x6a59('0xc4'));var _0x4e2ec7=path[_0x6a59('0xc5')](config[_0x6a59('0xc1')],_0x6a59('0xc2'),'files',_0x6a59('0xc6'));var _0x351d4a=path[_0x6a59('0xc5')](_0x14815b,_0x57d792);var _0x1f6636=util[_0x6a59('0xc7')](_0x6a59('0xc8'),_0x497e73[_0x6a59('0xa8')]['id'],_0x57d792);var _0x359377=path['join'](_0x14815b,_0x1f6636);var _0x14f566=[];_0x14f566[_0x6a59('0x34')]({'model':db[_0x6a59('0xc9')],'as':_0x6a59('0xc9'),'raw':!![]});var _0x49ac46=[{'model':db[_0x6a59('0xb5')],'as':'Messages','attributes':['id',_0x6a59('0x6d'),_0x6a59('0xca')],'include':_0x14f566}];return db[_0x6a59('0xae')]['find']({'where':{'id':_0x497e73[_0x6a59('0xa8')]['id']},'include':_0x49ac46})[_0x6a59('0x29')](handleEntityNotFound(_0x30f1d6,null))[_0x6a59('0x29')](function(_0x2c9176){if(_0x2c9176&&_0x2c9176[_0x6a59('0xcb')]){var _0x980961=_0x2c9176[_0x6a59('0xcc')]({'plain':!![]});fs[_0x6a59('0xcd')](_0x351d4a);for(var _0x486582=0x0;_0x486582<_0x980961[_0x6a59('0xcb')][_0x6a59('0x40')];_0x486582++){var _0x2030e5=_0x980961[_0x6a59('0xcb')][_0x486582][_0x6a59('0xc9')];if(_0x2030e5){var _0x387fa4=path[_0x6a59('0xc5')](_0x4e2ec7,_0x2030e5[_0x6a59('0xce')]);if(fs['existsSync'](_0x387fa4)){fs[_0x6a59('0xcf')](_0x387fa4)['pipe'](fs['createWriteStream'](path[_0x6a59('0xc5')](_0x351d4a,_0x2030e5['basename'])));}}}return BPromise['resolve']()[_0x6a59('0x29')](function(){return new BPromise(function(_0x795ba2,_0x21f2d3){zipdir(_0x351d4a,{'saveTo':_0x359377},function(_0xc7458f,_0x229ae0){if(_0xc7458f)return _0x21f2d3(_0xc7458f);return _0x795ba2(_0x229ae0);});})[_0x6a59('0x29')](function(){return new BPromise(function(_0x338ac6,_0x24ec4d){rimraf(_0x351d4a,function(_0x23d1d7){if(_0x23d1d7)_0x24ec4d(_0x23d1d7);return _0x338ac6();});});})['then'](function(){return _0x30f1d6[_0x6a59('0xbf')](_0x359377,_0x1f6636,function(_0x1d209d){if(_0x1d209d){console[_0x6a59('0xd0')](_0x6a59('0xd1'),_0x1d209d);}else{fs['unlinkSync'](_0x359377);}});});});}else{return _0x30f1d6[_0x6a59('0x1d')](0xc8);}})[_0x6a59('0xa7')](handleError(_0x30f1d6,null));};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js
index fdbdab8..fc95cc8 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 _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
+var _0x7a54=['setDataValue','map','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers'];(function(_0x4e16f7,_0xb4da1b){var _0x5a05ee=function(_0x26f683){while(--_0x26f683){_0x4e16f7['push'](_0x4e16f7['shift']());}};_0x5a05ee(++_0xb4da1b);}(_0x7a54,0x106));var _0x47a5=function(_0x8a5c85,_0x30409a){_0x8a5c85=_0x8a5c85-0x0;var _0x35e863=_0x7a54[_0x8a5c85];return _0x35e863;};'use strict';var EventEmitter=require(_0x47a5('0x0'));var FaxInteraction=require(_0x47a5('0x1'))['db'][_0x47a5('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x47a5('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x47a5('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x47a5('0x5'),'afterDestroy':_0x47a5('0x6')};function emitEvent(_0x2a1a7e){return function(_0x3717e1,_0xfdf934,_0x545a97){_0x3717e1[_0x47a5('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x343372){_0x3717e1[_0x47a5('0x8')]('Users',_0x343372[_0x47a5('0x9')](function(_0x5077f3){return{'id':_0x5077f3['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x3717e1['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2a0e98){_0x3717e1[_0x47a5('0x8')]('unreadMessages',_0x2a0e98[_0x47a5('0xa')]);FaxInteractionEvents['emit'](_0x2a1a7e+':'+_0x3717e1['id'],_0x3717e1);FaxInteractionEvents['emit'](_0x2a1a7e,_0x3717e1);_0x545a97(null);})[_0x47a5('0xb')](_0x545a97(null));};}for(var e in events){if(events[_0x47a5('0xc')](e)){var event=events[e];FaxInteraction[_0x47a5('0xd')](e,emitEvent(event));}}module[_0x47a5('0xe')]=FaxInteractionEvents;
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js
index 378addc..fe4a194 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 _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
+var _0xedd9=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','exports','FaxInteraction','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x19b0de,_0x1d33dd){var _0x3ab179=function(_0x3846e7){while(--_0x3846e7){_0x19b0de['push'](_0x19b0de['shift']());}};_0x3ab179(++_0x1d33dd);}(_0xedd9,0xfc));var _0x9edd=function(_0xb17696,_0xbf3738){_0xb17696=_0xb17696-0x0;var _0x80b44e=_0xedd9[_0xb17696];return _0x80b44e;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x172522,_0x190185,_0x1355be){if(_0x172522[_0x9edd('0xb')]('closed')){_0x172522[_0x9edd('0xc')]=moment()['format'](_0x9edd('0xd'));}_0x1355be(null,_0x172522);}}});};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js
index c453f39..0e3c879 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 _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
+var _0x55a9=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','FaxInteraction','body','options','raw','where','limit','UpdateFaxInteraction','stringify','addTags','ids','omit','spread','AddTags','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x55a9,0x16c));var _0x955a=function(_0x1b7e74,_0x5e9672){_0x1b7e74=_0x1b7e74-0x0;var _0x21fd02=_0x55a9[_0x1b7e74];return _0x21fd02;};'use strict';var _=require(_0x955a('0x0'));var util=require('util');var moment=require(_0x955a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x955a('0x2'))['db'];var utils=require(_0x955a('0x3'));var logger=require(_0x955a('0x4'))('rpc');var config=require(_0x955a('0x5'));var jayson=require(_0x955a('0x6'));var client=jayson[_0x955a('0x7')][_0x955a('0x8')]({'port':0x232a});config[_0x955a('0x9')]=_[_0x955a('0xa')](config['redis'],{'host':_0x955a('0xb'),'port':0x18eb});var socket=require(_0x955a('0xc'))(new Redis(config[_0x955a('0x9')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x405a00,_0x4f5d06,_0x1a24b3){return new BPromise(function(_0x29c997,_0x20aeaa){return client[_0x955a('0xd')](_0x405a00,_0x1a24b3)[_0x955a('0xe')](function(_0x5d9916){logger[_0x955a('0xf')](_0x955a('0x10'),_0x4f5d06,'request\x20sent');logger[_0x955a('0x11')](_0x955a('0x12'),_0x4f5d06,_0x955a('0x13'),JSON['stringify'](_0x5d9916));if(_0x5d9916[_0x955a('0x14')]){if(_0x5d9916[_0x955a('0x14')][_0x955a('0x15')]===0x1f4){logger[_0x955a('0x14')](_0x955a('0x10'),_0x4f5d06,_0x5d9916[_0x955a('0x14')][_0x955a('0x16')]);return _0x20aeaa(_0x5d9916[_0x955a('0x14')][_0x955a('0x16')]);}logger[_0x955a('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x4f5d06,_0x5d9916[_0x955a('0x14')][_0x955a('0x16')]);return _0x29c997(_0x5d9916[_0x955a('0x14')][_0x955a('0x16')]);}else{logger[_0x955a('0xf')](_0x955a('0x10'),_0x4f5d06,'request\x20sent');_0x29c997(_0x5d9916['result']['message']);}})[_0x955a('0x17')](function(_0x34ddc0){logger[_0x955a('0x14')](_0x955a('0x10'),_0x4f5d06,_0x34ddc0);_0x20aeaa(_0x34ddc0);});});}exports['UpdateFaxInteraction']=function(_0x4300e1){var _0xc528e9=this;return new Promise(function(_0x56f2e8,_0x1ea3d7){return db[_0x955a('0x18')]['update'](_0x4300e1[_0x955a('0x19')],{'raw':_0x4300e1[_0x955a('0x1a')]?_0x4300e1[_0x955a('0x1a')][_0x955a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4300e1['options']?_0x4300e1[_0x955a('0x1a')][_0x955a('0x1c')]||null:null,'attributes':_0x4300e1[_0x955a('0x1a')]?_0x4300e1[_0x955a('0x1a')]['attributes']||null:null,'limit':_0x4300e1['options']?_0x4300e1[_0x955a('0x1a')][_0x955a('0x1d')]||null:null})[_0x955a('0xe')](function(_0x5c1f14){logger['info']('UpdateFaxInteraction',_0x4300e1);logger['debug'](_0x955a('0x1e'),_0x4300e1,JSON[_0x955a('0x1f')](_0x5c1f14));_0x56f2e8(_0x5c1f14);})[_0x955a('0x17')](function(_0x1f4758){logger[_0x955a('0x14')](_0x955a('0x1e'),_0x1f4758['message'],_0x4300e1);_0x1ea3d7(_0xc528e9['error'](0x1f4,_0x1f4758[_0x955a('0x16')]));});});};exports['AddTagsToFaxInteraction']=function(_0x4cc9aa){return new Promise(function(_0x98844b,_0x589780){return db[_0x955a('0x18')]['find']({'where':_0x4cc9aa[_0x955a('0x1a')]?_0x4cc9aa['options'][_0x955a('0x1c')]||null:null})['then'](function(_0x3f2831){if(_0x3f2831){return _0x3f2831[_0x955a('0x20')](_0x4cc9aa[_0x955a('0x19')][_0x955a('0x21')],_[_0x955a('0x22')](_0x4cc9aa[_0x955a('0x19')],['ids','id'])||{});}})[_0x955a('0x23')](function(_0x4ea78b){logger[_0x955a('0xf')](_0x955a('0x24'),_0x4cc9aa);logger[_0x955a('0x11')]('AddTags',_0x4cc9aa,JSON[_0x955a('0x1f')](_0x4ea78b));_0x98844b(_0x4ea78b);})[_0x955a('0x17')](function(_0x39ce5c){logger['error'](_0x955a('0x24'),_0x39ce5c['message'],_0x4cc9aa);_0x589780(_this[_0x955a('0x14')](0x1f4,_0x39ce5c[_0x955a('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js
index 54171d5..ac0372b 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 _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
+var _0x0b79=['update','removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x52d8b9,_0xe54454){var _0x126b5b=function(_0x43d8c8){while(--_0x43d8c8){_0x52d8b9['push'](_0x52d8b9['shift']());}};_0x126b5b(++_0xe54454);}(_0x0b79,0xad));var _0x90b7=function(_0x510fa7,_0x5e0274){_0x510fa7=_0x510fa7-0x0;var _0x158165=_0x0b79[_0x510fa7];return _0x158165;};'use strict';var FaxInteractionEvents=require(_0x90b7('0x0'));var events=[_0x90b7('0x1'),_0x90b7('0x2'),_0x90b7('0x3')];function createListener(_0x4ce995,_0x40bb7a){return function(_0x2e65e1){_0x40bb7a['emit'](_0x4ce995,_0x2e65e1);};}function removeListener(_0xd3671f,_0x4cd6c5){return function(){FaxInteractionEvents[_0x90b7('0x4')](_0xd3671f,_0x4cd6c5);};}exports[_0x90b7('0x5')]=function(_0x1fba94){for(var _0x3a8902=0x0,_0x5191fa=events[_0x90b7('0x6')];_0x3a8902<_0x5191fa;_0x3a8902++){var _0x5c8d2a=events[_0x3a8902];var _0x41981b=createListener(_0x90b7('0x7')+_0x5c8d2a,_0x1fba94);FaxInteractionEvents['on'](_0x5c8d2a,_0x41981b);}};
\ No newline at end of file
diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js
index 987dd98..be01893 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 _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
+var _0x073d=['tracked','fax','faxinteraction:addtags','addTags','put','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getMessages','download','post','/:id/messages','addMessage','/:id/tags'];(function(_0x377df4,_0x531097){var _0x3f139f=function(_0x3d426f){while(--_0x3d426f){_0x377df4['push'](_0x377df4['shift']());}};_0x3f139f(++_0x531097);}(_0x073d,0x103));var _0xd073=function(_0x4ea44b,_0x546b89){_0x4ea44b=_0x4ea44b-0x0;var _0x418cc9=_0x073d[_0x4ea44b];return _0x418cc9;};'use strict';var multer=require(_0xd073('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd073('0x1'));var express=require(_0xd073('0x2'));var router=express[_0xd073('0x3')]();var auth=require(_0xd073('0x4'));var interaction=require(_0xd073('0x5'));var config=require('../../config/environment');var controller=require(_0xd073('0x6'));router['get']('/',auth[_0xd073('0x7')](),controller[_0xd073('0x8')]);router[_0xd073('0x9')](_0xd073('0xa'),auth[_0xd073('0x7')](),controller[_0xd073('0xb')]);router[_0xd073('0x9')](_0xd073('0xc'),auth[_0xd073('0x7')](),controller[_0xd073('0xd')]);router['get']('/:id/messages',auth[_0xd073('0x7')](),controller[_0xd073('0xe')]);router[_0xd073('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0xd073('0xf')]);router[_0xd073('0x10')]('/',auth[_0xd073('0x7')](),controller['create']);router['post'](_0xd073('0x11'),auth[_0xd073('0x7')](),controller[_0xd073('0x12')]);router[_0xd073('0x10')](_0xd073('0x13'),auth[_0xd073('0x7')](),interaction[_0xd073('0x14')](_0xd073('0x15'),_0xd073('0x16')),controller[_0xd073('0x17')]);router[_0xd073('0x18')](_0xd073('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0xd073('0x15'),'faxinteraction:update'),controller[_0xd073('0x19')]);router[_0xd073('0x1a')](_0xd073('0xc'),auth[_0xd073('0x7')](),interaction['tracked'](_0xd073('0x15'),_0xd073('0x1b')),controller[_0xd073('0x1c')]);router[_0xd073('0x1a')]('/:id/tags',auth['isAuthenticated'](),controller[_0xd073('0x1d')]);module[_0xd073('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js
index e41a4c1..866c524 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 _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
+var _0xd633=['exports','TEXT','medium','BOOLEAN','out','DATE'];(function(_0x4d56f7,_0x2ece2e){var _0x168945=function(_0x4b2b32){while(--_0x4b2b32){_0x4d56f7['push'](_0x4d56f7['shift']());}};_0x168945(++_0x2ece2e);}(_0xd633,0x96));var _0x3d63=function(_0x201bae,_0x24c602){_0x201bae=_0x201bae-0x0;var _0x5dd069=_0xd633[_0x201bae];return _0x5dd069;};'use strict';var Sequelize=require('sequelize');module[_0x3d63('0x0')]={'body':{'type':Sequelize[_0x3d63('0x1')](_0x3d63('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3d63('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3d63('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x3d63('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x3d63('0x5')]}};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js
index be86635..639b2e0 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 _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
+var _0xfb3e=['Content-Range','json','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','fieldName','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','describe','../../config/logger','fax-interactions','accept','fax','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','isNil','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','rejectmessage','create','findOne','ContactId','Attachment','AttachmentId','/var/opt/motion2/server/files/attachments/%s','basename','root','server','files','attachments','download','join','html-pdf','rimraf','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/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','register','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','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','count','offset'];(function(_0x4ed1dd,_0x2c5d4a){var _0x593018=function(_0xfba1e4){while(--_0xfba1e4){_0x4ed1dd['push'](_0x4ed1dd['shift']());}};_0x593018(++_0x2c5d4a);}(_0xfb3e,0x167));var _0xefb3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfb3e[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xefb3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xefb3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xefb3('0x2'));var rp=require(_0xefb3('0x3'));var moment=require(_0xefb3('0x4'));var BPromise=require(_0xefb3('0x5'));var Mustache=require(_0xefb3('0x6'));var util=require(_0xefb3('0x7'));var path=require(_0xefb3('0x8'));var sox=require('sox');var csv=require(_0xefb3('0x9'));var ejs=require(_0xefb3('0xa'));var fs=require('fs');var _=require(_0xefb3('0xb'));var squel=require(_0xefb3('0xc'));var crypto=require(_0xefb3('0xd'));var jsforce=require(_0xefb3('0xe'));var deskjs=require(_0xefb3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xefb3('0x10'));var Papa=require(_0xefb3('0x11'));var Redis=require(_0xefb3('0x12'));var authService=require(_0xefb3('0x13'));var qs=require(_0xefb3('0x14'));var as=require(_0xefb3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xefb3('0x16'));var config=require(_0xefb3('0x17'));var db=require(_0xefb3('0x18'))['db'];config[_0xefb3('0x19')]=_[_0xefb3('0x1a')](config[_0xefb3('0x19')],{'host':_0xefb3('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xefb3('0x19')]));require(_0xefb3('0x1c'))[_0xefb3('0x1d')](socket);var jayson=require(_0xefb3('0x1e'));var client=jayson[_0xefb3('0x1f')][_0xefb3('0x20')]({'port':0x232c});var client9002=jayson[_0xefb3('0x1f')][_0xefb3('0x20')]({'port':0x232a});function checkPasswordPattern(_0x54988c,_0x14e7bb,_0x1eab10){if(_0x1eab10){var _0x38baa2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x38baa2['test'](_0x14e7bb)){return _0x54988c;}else{throw new db[(_0xefb3('0x21'))][(_0xefb3('0x22'))](_0xefb3('0x23'));}}else{return _0x54988c;}}function respondWithRpcPromise(_0x130a01,_0x370c90,_0x2a423f,_0x12e293){return new BPromise(function(_0x37b7d3,_0x26552b){var _0x126de8=_0x12e293||client;return _0x126de8[_0xefb3('0x24')](_0x130a01,_0x2a423f)[_0xefb3('0x25')](function(_0x22767a){logger[_0xefb3('0x26')](_0xefb3('0x27'),_0x370c90,_0xefb3('0x28'));logger[_0xefb3('0x29')](_0xefb3('0x2a'),_0x370c90,_0xefb3('0x28'),JSON[_0xefb3('0x2b')](_0x22767a));if(_0x22767a[_0xefb3('0x2c')]){if(_0x22767a['error']['code']===0x1f4){logger[_0xefb3('0x2c')](_0xefb3('0x27'),_0x370c90,_0x22767a['error'][_0xefb3('0x2d')]);return _0x26552b(_0x22767a[_0xefb3('0x2c')][_0xefb3('0x2d')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x370c90,_0x22767a['error'][_0xefb3('0x2d')]);return _0x37b7d3(_0x22767a['error']['message']);}else{logger['info'](_0xefb3('0x27'),_0x370c90,_0xefb3('0x28'));_0x37b7d3(_0x22767a[_0xefb3('0x2e')][_0xefb3('0x2d')]);}})['catch'](function(_0xa15e11){logger['error']('FaxMessage,\x20%s,\x20%s',_0x370c90,_0xa15e11);_0x26552b(_0xa15e11);});});}function respondWithStatusCode(_0x168b32,_0x213d12){_0x213d12=_0x213d12||0xcc;return function(_0x4a2abd){if(_0x4a2abd){return _0x168b32[_0xefb3('0x2f')](_0x213d12);}return _0x168b32[_0xefb3('0x30')](_0x213d12)[_0xefb3('0x31')]();};}function respondWithResult(_0x38f844,_0x3cd7ce){_0x3cd7ce=_0x3cd7ce||0xc8;return function(_0x54b27d){if(_0x54b27d){return _0x38f844[_0xefb3('0x30')](_0x3cd7ce)['json'](_0x54b27d);}};}function respondWithFilteredResult(_0x1c0c18,_0x35b3dc){return function(_0x14a9a3){if(_0x14a9a3){var _0xf350fe=_0x14a9a3[_0xefb3('0x32')],_0x2a3458=_0x35b3dc[_0xefb3('0x33')],_0x159a0b=_0x35b3dc[_0xefb3('0x33')]+_0x35b3dc['limit'],_0x49f2c4;if(_0x159a0b>=_0xf350fe){_0x159a0b=_0xf350fe;_0x49f2c4=0xc8;}else{_0x49f2c4=0xce;}_0x1c0c18[_0xefb3('0x30')](_0x49f2c4);return _0x1c0c18['set'](_0xefb3('0x34'),_0x2a3458+'-'+_0x159a0b+'/'+_0xf350fe)[_0xefb3('0x35')](_0x14a9a3);}return null;};}function patchUpdates(_0x2978ad){return function(_0x3f7ae2){try{jsonpatch['apply'](_0x3f7ae2,_0x2978ad,!![]);}catch(_0x3f529e){return BPromise[_0xefb3('0x36')](_0x3f529e);}return _0x3f7ae2[_0xefb3('0x37')]();};}function saveUpdates(_0x325ce1,_0xbb1ec2){return function(_0x1765bc){if(_0x1765bc){return _0x1765bc[_0xefb3('0x38')](_0x325ce1)[_0xefb3('0x25')](function(_0x5e1829){return _0x5e1829;});}return null;};}function removeEntity(_0x217bdc,_0x585fbf){return function(_0xde4b40){if(_0xde4b40){return _0xde4b40[_0xefb3('0x39')]()[_0xefb3('0x25')](function(){_0x217bdc[_0xefb3('0x30')](0xcc)[_0xefb3('0x31')]();});}};}function handleEntityNotFound(_0x5828ef,_0x2dca30){return function(_0x154f16){if(!_0x154f16){_0x5828ef[_0xefb3('0x2f')](0x194);}return _0x154f16;};}function handleError(_0x12caeb,_0x219e70){_0x219e70=_0x219e70||0x1f4;return function(_0x2381ba){logger[_0xefb3('0x2c')](_0x2381ba[_0xefb3('0x3a')]);if(_0x2381ba[_0xefb3('0x3b')]){delete _0x2381ba['name'];}_0x12caeb[_0xefb3('0x30')](_0x219e70)[_0xefb3('0x3c')](_0x2381ba);};}exports[_0xefb3('0x3d')]=function(_0xc46829,_0x1f74da){var _0x594ead={},_0xbfc820={},_0x2e39a7={'count':0x0,'rows':[]};var _0x165fed=_[_0xefb3('0x3e')](db[_0xefb3('0x3f')]['rawAttributes'],function(_0x5b8c6a){return{'name':_0x5b8c6a[_0xefb3('0x40')],'type':_0x5b8c6a['type']['key']};});_0xbfc820[_0xefb3('0x41')]=_[_0xefb3('0x3e')](_0x165fed,'name');_0xbfc820['query']=_[_0xefb3('0x42')](_0xc46829['query']);_0xbfc820['filters']=_[_0xefb3('0x43')](_0xbfc820[_0xefb3('0x41')],_0xbfc820[_0xefb3('0x44')]);_0x594ead[_0xefb3('0x45')]=_[_0xefb3('0x43')](_0xbfc820[_0xefb3('0x41')],qs[_0xefb3('0x46')](_0xc46829['query'][_0xefb3('0x46')]));_0x594ead['attributes']=_0x594ead[_0xefb3('0x45')][_0xefb3('0x47')]?_0x594ead[_0xefb3('0x45')]:_0xbfc820[_0xefb3('0x41')];if(!_0xc46829[_0xefb3('0x44')][_0xefb3('0x48')](_0xefb3('0x49'))){_0x594ead[_0xefb3('0x4a')]=qs[_0xefb3('0x4a')](_0xc46829['query'][_0xefb3('0x4a')]);_0x594ead['offset']=qs[_0xefb3('0x33')](_0xc46829[_0xefb3('0x44')][_0xefb3('0x33')]);}_0x594ead['order']=qs[_0xefb3('0x4b')](_0xc46829[_0xefb3('0x44')][_0xefb3('0x4b')]);_0x594ead[_0xefb3('0x4c')]=qs[_0xefb3('0x4d')](_[_0xefb3('0x4e')](_0xc46829[_0xefb3('0x44')],_0xbfc820[_0xefb3('0x4d')]),_0x165fed);if(_0xc46829[_0xefb3('0x44')][_0xefb3('0x4f')]){_0x594ead[_0xefb3('0x4c')]=_[_0xefb3('0x50')](_0x594ead['where'],{'$or':_[_0xefb3('0x3e')](_0x165fed,function(_0x1d7466){if(_0x1d7466['type']!=='VIRTUAL'){var _0x2256dd={};_0x2256dd[_0x1d7466['name']]={'$like':'%'+_0xc46829[_0xefb3('0x44')][_0xefb3('0x4f')]+'%'};return _0x2256dd;}})});}_0x594ead=_[_0xefb3('0x50')]({},_0x594ead,_0xc46829['options']);var _0x4a4534={'where':_0x594ead[_0xefb3('0x4c')]};return db[_0xefb3('0x3f')][_0xefb3('0x32')](_0x4a4534)['then'](function(_0x28a025){_0x2e39a7[_0xefb3('0x32')]=_0x28a025;if(_0xc46829[_0xefb3('0x44')][_0xefb3('0x51')]){_0x594ead[_0xefb3('0x52')]=[{'all':!![]}];}return db['FaxMessage'][_0xefb3('0x53')](_0x594ead);})[_0xefb3('0x25')](function(_0x202ed6){_0x2e39a7[_0xefb3('0x54')]=_0x202ed6;return _0x2e39a7;})['then'](respondWithFilteredResult(_0x1f74da,_0x594ead))[_0xefb3('0x55')](handleError(_0x1f74da,null));};exports[_0xefb3('0x56')]=function(_0x303e1f,_0x2efb86){var _0x19374f={'raw':!![],'where':{'id':_0x303e1f[_0xefb3('0x57')]['id']}},_0x1a597e={};_0x1a597e[_0xefb3('0x41')]=_[_0xefb3('0x42')](db[_0xefb3('0x3f')]['rawAttributes']);_0x1a597e[_0xefb3('0x44')]=_[_0xefb3('0x42')](_0x303e1f[_0xefb3('0x44')]);_0x1a597e[_0xefb3('0x4d')]=_['intersection'](_0x1a597e['model'],_0x1a597e[_0xefb3('0x44')]);_0x19374f[_0xefb3('0x45')]=_[_0xefb3('0x43')](_0x1a597e[_0xefb3('0x41')],qs[_0xefb3('0x46')](_0x303e1f[_0xefb3('0x44')][_0xefb3('0x46')]));_0x19374f[_0xefb3('0x45')]=_0x19374f[_0xefb3('0x45')][_0xefb3('0x47')]?_0x19374f[_0xefb3('0x45')]:_0x1a597e[_0xefb3('0x41')];if(_0x303e1f[_0xefb3('0x44')]['includeAll']){_0x19374f['include']=[{'all':!![]}];}_0x19374f=_[_0xefb3('0x50')]({},_0x19374f,_0x303e1f[_0xefb3('0x58')]);return db['FaxMessage'][_0xefb3('0x59')](_0x19374f)[_0xefb3('0x25')](handleEntityNotFound(_0x2efb86,null))[_0xefb3('0x25')](respondWithResult(_0x2efb86,null))[_0xefb3('0x55')](handleError(_0x2efb86,null));};exports[_0xefb3('0x38')]=function(_0xee0b62,_0x480f8a){if(_0xee0b62[_0xefb3('0x5a')]['id']){delete _0xee0b62[_0xefb3('0x5a')]['id'];}return db[_0xefb3('0x3f')][_0xefb3('0x59')]({'where':{'id':_0xee0b62[_0xefb3('0x57')]['id']}})[_0xefb3('0x25')](handleEntityNotFound(_0x480f8a,null))[_0xefb3('0x25')](saveUpdates(_0xee0b62['body'],null))[_0xefb3('0x25')](respondWithResult(_0x480f8a,null))[_0xefb3('0x55')](handleError(_0x480f8a,null));};exports['destroy']=function(_0x359aca,_0x167faa){return db[_0xefb3('0x3f')]['find']({'where':{'id':_0x359aca['params']['id']}})['then'](handleEntityNotFound(_0x167faa,null))[_0xefb3('0x25')](removeEntity(_0x167faa,null))[_0xefb3('0x55')](handleError(_0x167faa,null));};exports['describe']=function(_0x14d042,_0x14ee1b){return db[_0xefb3('0x3f')][_0xefb3('0x5b')]()[_0xefb3('0x25')](respondWithResult(_0x14ee1b,null))[_0xefb3('0x55')](handleError(_0x14ee1b,null));};var interaction_log=require(_0xefb3('0x5c'))(_0xefb3('0x5d'));exports[_0xefb3('0x5e')]=function(_0x10c10b,_0x37b169,_0x460888){var _0xe3961f={'channel':_0xefb3('0x5f')};if(_0x10c10b['body']['id']){delete _0x10c10b[_0xefb3('0x5a')]['id'];}_0x10c10b[_0xefb3('0x5a')]['read']=!![];_0x10c10b[_0xefb3('0x5a')]['readAt']=moment()['format'](_0xefb3('0x60'));_0x10c10b[_0xefb3('0x5a')][_0xefb3('0x61')]=_0x10c10b[_0xefb3('0x5a')][_0xefb3('0x61')]||_0x10c10b['user']['id'];return db[_0xefb3('0x3f')][_0xefb3('0x59')]({'where':{'id':_0x10c10b['params']['id'],'UserId':null},'include':[{'model':db[_0xefb3('0x62')],'as':_0xefb3('0x63')}]})[_0xefb3('0x25')](handleEntityNotFound(_0x37b169,null))[_0xefb3('0x25')](saveUpdates(_0x10c10b[_0xefb3('0x5a')],null))[_0xefb3('0x25')](function(_0x2693a4){if(_0x2693a4){_0xe3961f[_0xefb3('0x2d')]=_0x2693a4[_0xefb3('0x64')]({'plain':!![]});return db['FaxInteraction'][_0xefb3('0x59')]({'where':{'id':_0x2693a4['FaxInteractionId']}});}return null;})[_0xefb3('0x25')](handleEntityNotFound(_0x37b169,null))[_0xefb3('0x25')](function(_0x1d5a82){if(_0x1d5a82){return _0x1d5a82[_0xefb3('0x38')]({'UserId':_0x10c10b[_0xefb3('0x5a')]['UserId'],'read1stAt':_[_0xefb3('0x65')](_0x1d5a82[_0xefb3('0x66')])?moment()[_0xefb3('0x67')](_0xefb3('0x60')):undefined});}return null;})[_0xefb3('0x25')](function(_0x17607b){if(_0x17607b){_0xe3961f[_0xefb3('0x68')]=_0x17607b[_0xefb3('0x64')]({'plain':!![]});interaction_log['info'](_0xefb3('0x69'),_0x10c10b['user']['id'],_0x10c10b['user'][_0xefb3('0x3b')],_0x10c10b[_0xefb3('0x6a')][_0xefb3('0x6b')],_0xe3961f['interaction']['id'],_0x10c10b[_0xefb3('0x5a')]?JSON['stringify'](_0x10c10b[_0xefb3('0x5a')]):'null');return respondWithRpcPromise(_0xefb3('0x6c'),_0xefb3('0x6d'),_0xe3961f);}return null;})[_0xefb3('0x25')](function(_0x40f9d9){if(_0x40f9d9){if(_0x10c10b['body'][_0xefb3('0x6e')]){_0xe3961f[_0xefb3('0x2d')][_0xefb3('0x6f')]=util['format'](_0xefb3('0x70'),_0x10c10b[_0xefb3('0x6a')][_0xefb3('0x3b')]);_0xe3961f[_0xefb3('0x2d')][_0xefb3('0x71')]=_0xe3961f[_0xefb3('0x71')];_0xe3961f[_0xefb3('0x2d')][_0xefb3('0x72')]=_0xefb3('0x5e');return respondWithRpcPromise(_0xefb3('0x73'),_0xefb3('0x73'),{'event':_0xefb3('0x74'),'message':_0xe3961f[_0xefb3('0x2d')]},client9002)['then'](function(){return _0xe3961f;});}return _0xe3961f;}return null;})[_0xefb3('0x25')](respondWithResult(_0x37b169,null))[_0xefb3('0x55')](handleError(_0x37b169,null));};var interaction_log=require(_0xefb3('0x5c'))('fax-interactions');exports['reject']=function(_0x5edeff,_0xf846ec,_0x846164){var _0xb25d9b={'agent':{},'channel':'fax'};if(_0x5edeff[_0xefb3('0x5a')]['id']){delete _0x5edeff[_0xefb3('0x5a')]['id'];}_0x5edeff[_0xefb3('0x5a')][_0xefb3('0x61')]=_0x5edeff['body'][_0xefb3('0x61')]||_0x5edeff[_0xefb3('0x6a')]['id'];_0xb25d9b[_0xefb3('0x75')]['id']=_0x5edeff[_0xefb3('0x5a')][_0xefb3('0x61')];return db[_0xefb3('0x3f')]['find']({'where':{'id':_0x5edeff[_0xefb3('0x57')]['id'],'UserId':null}})[_0xefb3('0x25')](handleEntityNotFound(_0xf846ec,null))[_0xefb3('0x25')](function(_0x3de176){if(_0x3de176){_0xb25d9b[_0xefb3('0x2d')]=_0x3de176[_0xefb3('0x64')]({'plain':!![]});return db['FaxInteraction'][_0xefb3('0x59')]({'where':{'id':_0x3de176[_0xefb3('0x76')]}});}return null;})[_0xefb3('0x25')](handleEntityNotFound(_0xf846ec,null))[_0xefb3('0x25')](function(_0x231df4){if(_0x231df4){_0xb25d9b[_0xefb3('0x68')]=_0x231df4[_0xefb3('0x64')]({'plain':!![]});interaction_log[_0xefb3('0x26')](_0xefb3('0x77'),_0x5edeff[_0xefb3('0x6a')]['id'],_0x5edeff[_0xefb3('0x6a')][_0xefb3('0x3b')],_0x5edeff[_0xefb3('0x6a')][_0xefb3('0x6b')],_0xb25d9b[_0xefb3('0x68')]['id'],_0x5edeff['body']?JSON['stringify'](_0x5edeff[_0xefb3('0x5a')]):_0xefb3('0x78'));return respondWithRpcPromise(_0xefb3('0x79'),_0xefb3('0x7a'),_0xb25d9b);}return null;})[_0xefb3('0x25')](function(_0x22f307){if(_0x22f307){_0x22f307[_0xefb3('0x2d')][_0xefb3('0x6f')]=util[_0xefb3('0x67')](_0xefb3('0x70'),_0x5edeff['user'][_0xefb3('0x3b')]);_0x22f307[_0xefb3('0x2d')][_0xefb3('0x71')]=_0xb25d9b[_0xefb3('0x71')];_0x22f307[_0xefb3('0x2d')]['event']=_0xefb3('0x36');respondWithRpcPromise('EventManager','EventManager',{'event':_0xefb3('0x7b'),'message':_0x22f307[_0xefb3('0x2d')]},client9002);return _0xb25d9b;}return null;})['then'](respondWithResult(_0xf846ec,null))[_0xefb3('0x55')](handleError(_0xf846ec,null));};exports[_0xefb3('0x7c')]=function(_0x177622,_0x4502e6){var _0x5980d6;return db[_0xefb3('0x3f')][_0xefb3('0x7c')](_0x177622[_0xefb3('0x5a')],{})['then'](function(_0x1d3711){_0x5980d6=_0x1d3711;return db['CmContact'][_0xefb3('0x7d')]({'where':{'id':_0x5980d6[_0xefb3('0x7e')]}});})['then'](function(_0x4b9a38){if(_[_0xefb3('0x65')](_0x4b9a38)){return;}else{_0x5980d6[_0xefb3('0x5f')]=_0x4b9a38[_0xefb3('0x5f')];return db[_0xefb3('0x7f')][_0xefb3('0x7d')]({'where':{'id':_0x5980d6[_0xefb3('0x80')]}});}})[_0xefb3('0x25')](function(_0x2e6133){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0xefb3('0x65')](_0x177622[_0xefb3('0x5a')])?undefined:_0x177622[_0xefb3('0x5a')]['FaxAccountId'],'path':_[_0xefb3('0x65')](_0x2e6133)?undefined:util[_0xefb3('0x67')](_0xefb3('0x81'),_0x2e6133[_0xefb3('0x82')]),'fax':_[_0xefb3('0x65')](_0x5980d6[_0xefb3('0x5f')])?undefined:_0x5980d6['fax'],'AttachmentId':_0x5980d6['AttachmentId']},client9002);})[_0xefb3('0x25')](respondWithResult(_0x4502e6,0xc9))['catch'](handleError(_0x4502e6,null));};exports['download']=function(_0x2a22d9,_0x5140f4){var _0x4f56a2=path['join'](config[_0xefb3('0x83')],_0xefb3('0x84'),_0xefb3('0x85'),_0xefb3('0x86'));return db[_0xefb3('0x3f')][_0xefb3('0x59')]({'where':{'id':_0x2a22d9['params']['id']},'include':[{'model':db['Attachment'],'as':_0xefb3('0x7f')}]})[_0xefb3('0x25')](handleEntityNotFound(_0x5140f4,null))['then'](function(_0x575a26){if(_0x575a26){return _0x5140f4[_0xefb3('0x87')](path[_0xefb3('0x88')](_0x4f56a2,_0x575a26[_0xefb3('0x7f')][_0xefb3('0x82')]));}})['catch'](handleError(_0x5140f4,null));};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js
index e02c12c..dccabb6 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 _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
+var _0x3e74=['hasOwnProperty','exports','events','FaxMessage','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x1519a9,_0x2a210e){_0x1519a9=_0x1519a9-0x0;var _0x16604e=_0x3e74[_0x1519a9];return _0x16604e;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x43e7('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){FaxMessageEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);FaxMessageEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=FaxMessageEvents;
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js
index abfb7d6..e992145 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 _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
+var _0xb50e=['FULLTEXT','models','toLowerCase','direction','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxMessage.attributes','define','body'];(function(_0x1a2a4c,_0x177909){var _0x4e0d5b=function(_0x132e1b){while(--_0x132e1b){_0x1a2a4c['push'](_0x1a2a4c['shift']());}};_0x4e0d5b(++_0x177909);}(_0xb50e,0xb5));var _0xeb50=function(_0x4ef8bc,_0x5eb00d){_0x4ef8bc=_0x4ef8bc-0x0;var _0x5d4d56=_0xb50e[_0x4ef8bc];return _0x5d4d56;};'use strict';var _=require('lodash');var util=require(_0xeb50('0x0'));var logger=require(_0xeb50('0x1'))(_0xeb50('0x2'));var moment=require(_0xeb50('0x3'));var BPromise=require(_0xeb50('0x4'));var rp=require(_0xeb50('0x5'));var fs=require('fs');var path=require(_0xeb50('0x6'));var rimraf=require(_0xeb50('0x7'));var config=require('../../config/environment');var attributes=require(_0xeb50('0x8'));module['exports']=function(_0x44ba26,_0x394077){return _0x44ba26[_0xeb50('0x9')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xeb50('0xa')],'type':_0xeb50('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5f429c,_0x95b494,_0x2597f3){var _0x5b9965=_0x44ba26[_0xeb50('0xc')];var _0x50a1a9=_0x5f429c['get']({'plain':!![]});if(_0x50a1a9['direction'][_0xeb50('0xd')]()==='in'||_0x50a1a9[_0xeb50('0xe')][_0xeb50('0xd')]()===_0xeb50('0xf')&&!_0x50a1a9['secret']&&!_[_0xeb50('0x10')](_0x50a1a9[_0xeb50('0x11')])){_0x5b9965[_0xeb50('0x12')][_0xeb50('0x13')]({'where':{'id':_0x50a1a9[_0xeb50('0x14')]}})[_0xeb50('0x15')](function(_0x914922){if(_0x914922){_0x914922['update']({'lastMsgAt':_0x50a1a9[_0xeb50('0x16')],'lastMsgDirection':_0x50a1a9[_0xeb50('0xe')][_0xeb50('0xd')]()});}})[_0xeb50('0x17')](function(_0x5a33ed){console['error'](_0x5a33ed);});}_0x2597f3();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js
index 54fcd79..01111e2 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 _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
+var _0x077f=['FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','where','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','info'];(function(_0xa5da45,_0x1616d2){var _0x25cc70=function(_0x41e4af){while(--_0x41e4af){_0xa5da45['push'](_0xa5da45['shift']());}};_0x25cc70(++_0x1616d2);}(_0x077f,0x64));var _0xf077=function(_0x53bf49,_0x14f488){_0x53bf49=_0x53bf49-0x0;var _0x349b21=_0x077f[_0x53bf49];return _0x349b21;};'use strict';var _=require(_0xf077('0x0'));var util=require(_0xf077('0x1'));var moment=require('moment');var BPromise=require(_0xf077('0x2'));var rs=require(_0xf077('0x3'));var fs=require('fs');var Redis=require(_0xf077('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf077('0x5'));var logger=require(_0xf077('0x6'))(_0xf077('0x7'));var config=require(_0xf077('0x8'));var jayson=require(_0xf077('0x9'));var client=jayson[_0xf077('0xa')][_0xf077('0xb')]({'port':0x232a});config[_0xf077('0xc')]=_[_0xf077('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf077('0xe'))(new Redis(config[_0xf077('0xc')]));require(_0xf077('0xf'))[_0xf077('0x10')](socket);function respondWithRpcPromise(_0x3e1b87,_0x3e98dc,_0x6546e6){return new BPromise(function(_0x3b0f7e,_0x33659c){return client[_0xf077('0x11')](_0x3e1b87,_0x6546e6)[_0xf077('0x12')](function(_0x4ce6cf){logger[_0xf077('0x13')](_0xf077('0x14'),_0x3e98dc,'request\x20sent');logger[_0xf077('0x15')](_0xf077('0x16'),_0x3e98dc,_0xf077('0x17'),JSON[_0xf077('0x18')](_0x4ce6cf));if(_0x4ce6cf[_0xf077('0x19')]){if(_0x4ce6cf[_0xf077('0x19')][_0xf077('0x1a')]===0x1f4){logger[_0xf077('0x19')](_0xf077('0x14'),_0x3e98dc,_0x4ce6cf[_0xf077('0x19')][_0xf077('0x1b')]);return _0x33659c(_0x4ce6cf[_0xf077('0x19')][_0xf077('0x1b')]);}logger[_0xf077('0x19')]('FaxMessage,\x20%s,\x20%s',_0x3e98dc,_0x4ce6cf[_0xf077('0x19')]['message']);return _0x3b0f7e(_0x4ce6cf[_0xf077('0x19')]['message']);}else{logger[_0xf077('0x13')]('FaxMessage,\x20%s,\x20%s',_0x3e98dc,_0xf077('0x17'));_0x3b0f7e(_0x4ce6cf[_0xf077('0x1c')]['message']);}})[_0xf077('0x1d')](function(_0x59d838){logger[_0xf077('0x19')](_0xf077('0x14'),_0x3e98dc,_0x59d838);_0x33659c(_0x59d838);});});}exports[_0xf077('0x1e')]=function(_0x1b9a22){var _0x55b1d6=this;return new Promise(function(_0x36f488,_0x3cfecd){return db[_0xf077('0x1f')][_0xf077('0x20')](_0x1b9a22[_0xf077('0x21')],{'raw':_0x1b9a22[_0xf077('0x22')]?_0x1b9a22[_0xf077('0x22')][_0xf077('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0xd389d4){logger[_0xf077('0x13')](_0xf077('0x1e'),_0x1b9a22);logger[_0xf077('0x15')](_0xf077('0x1e'),_0x1b9a22,JSON[_0xf077('0x18')](_0xd389d4));_0x36f488(_0xd389d4);})[_0xf077('0x1d')](function(_0x187afc){logger[_0xf077('0x19')](_0xf077('0x1e'),_0x187afc['message'],_0x1b9a22);_0x3cfecd(_0x55b1d6['error'](0x1f4,_0x187afc[_0xf077('0x1b')]));});});};exports[_0xf077('0x24')]=function(_0xb68b2){var _0x1ec7dd=this;return new Promise(function(_0x56fe0a,_0x78c64c){return db[_0xf077('0x1f')][_0xf077('0x25')](_0xb68b2[_0xf077('0x21')],{'raw':_0xb68b2['options']?_0xb68b2['options'][_0xf077('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb68b2['options']?_0xb68b2[_0xf077('0x22')][_0xf077('0x26')]||null:null,'attributes':_0xb68b2['options']?_0xb68b2[_0xf077('0x22')]['attributes']||null:null,'limit':_0xb68b2[_0xf077('0x22')]?_0xb68b2['options'][_0xf077('0x27')]||null:null})['then'](function(_0x4e144d){logger['info']('UpdateFaxMessage',_0xb68b2);logger['debug'](_0xf077('0x24'),_0xb68b2,JSON[_0xf077('0x18')](_0x4e144d));_0x56fe0a(_0x4e144d);})[_0xf077('0x1d')](function(_0x26d21b){logger['error'](_0xf077('0x24'),_0x26d21b[_0xf077('0x1b')],_0xb68b2);_0x78c64c(_0x1ec7dd[_0xf077('0x19')](0x1f4,_0x26d21b[_0xf077('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js
index 26e4bdf..6e947bb 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(_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
+var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x2932cf,_0x362fd9){var _0x1711dd=function(_0x2d8de6){while(--_0x2d8de6){_0x2932cf['push'](_0x2932cf['shift']());}};_0x1711dd(++_0x362fd9);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 e2cf8ca..11c503d 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 _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
+var _0x9d1f=['multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./faxMessage.controller','get','index','isAuthenticated','describe','show','download','post','fax','faxmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x4b946d,_0x104c6e){var _0x5dab4a=function(_0x1b3c8b){while(--_0x1b3c8b){_0x4b946d['push'](_0x4b946d['shift']());}};_0x5dab4a(++_0x104c6e);}(_0x9d1f,0x1a9));var _0xf9d1=function(_0x109371,_0x441c8e){_0x109371=_0x109371-0x0;var _0x4fd858=_0x9d1f[_0x109371];return _0x4fd858;};'use strict';var multer=require(_0xf9d1('0x0'));var util=require('util');var path=require(_0xf9d1('0x1'));var timeout=require(_0xf9d1('0x2'));var express=require(_0xf9d1('0x3'));var router=express['Router']();var auth=require(_0xf9d1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf9d1('0x5'));var controller=require(_0xf9d1('0x6'));router[_0xf9d1('0x7')]('/',auth['isAuthenticated'](),controller[_0xf9d1('0x8')]);router[_0xf9d1('0x7')]('/describe',auth[_0xf9d1('0x9')](),controller[_0xf9d1('0xa')]);router[_0xf9d1('0x7')]('/:id',auth[_0xf9d1('0x9')](),controller[_0xf9d1('0xb')]);router[_0xf9d1('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0xf9d1('0xc')]);router[_0xf9d1('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xf9d1('0xe'),_0xf9d1('0xf')),controller[_0xf9d1('0x10')]);router[_0xf9d1('0x11')]('/:id',auth[_0xf9d1('0x9')](),controller['update']);router[_0xf9d1('0x11')](_0xf9d1('0x12'),auth['isAuthenticated'](),controller[_0xf9d1('0x13')]);router[_0xf9d1('0x11')](_0xf9d1('0x14'),auth[_0xf9d1('0x9')](),controller[_0xf9d1('0x15')]);router[_0xf9d1('0x16')]('/:id',auth[_0xf9d1('0x9')](),controller[_0xf9d1('0x17')]);module[_0xf9d1('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js
index 5f09b96..4d388c4 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 _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
+var _0xe80c=['beepall','roundrobin','exports','STRING','name','INTEGER','rrmemory'];(function(_0x4f122a,_0x571bea){var _0x15d8fb=function(_0x771644){while(--_0x771644){_0x4f122a['push'](_0x4f122a['shift']());}};_0x15d8fb(++_0x571bea);}(_0xe80c,0x1c2));var _0xce80=function(_0x76cf90,_0x44b965){_0x76cf90=_0x76cf90-0x0;var _0x255635=_0xe80c[_0x76cf90];return _0x255635;};'use strict';var Sequelize=require('sequelize');module[_0xce80('0x0')]={'name':{'type':Sequelize[_0xce80('0x1')],'unique':_0xce80('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xce80('0x1')]},'timeout':{'type':Sequelize[_0xce80('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xce80('0x4'),_0xce80('0x5'),_0xce80('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xce80('0x3')],'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 0a4ce7c..e4905a0 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 _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
+var _0xcabe=['sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','UserProfileResource','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','find','create','body','user','get','role','FaxQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMembers','findOne','pick','FaxQueueId','User','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','ids','Agents','online','voicePause','interface','transaction','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','tq.TeamId','from','team_has_fax_queues','user_has_teams','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','TeamId','union','compact','value','removeAgents','userFaxQueue:remove','omit','isArray','getAgents','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xcabe,0x1ef));var _0xecab=function(_0xf24cc3,_0x2b58f5){_0xf24cc3=_0xf24cc3-0x0;var _0x5a65a3=_0xcabe[_0xf24cc3];return _0x5a65a3;};'use strict';var pdf=require(_0xecab('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xecab('0x1'));var zipdir=require(_0xecab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xecab('0x3'));var moment=require(_0xecab('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xecab('0x5'));var util=require(_0xecab('0x6'));var path=require(_0xecab('0x7'));var sox=require('sox');var csv=require(_0xecab('0x8'));var ejs=require(_0xecab('0x9'));var fs=require('fs');var _=require(_0xecab('0xa'));var squel=require(_0xecab('0xb'));var crypto=require(_0xecab('0xc'));var jsforce=require(_0xecab('0xd'));var deskjs=require(_0xecab('0xe'));var toCsv=require(_0xecab('0x8'));var querystring=require(_0xecab('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xecab('0x10'));var qs=require(_0xecab('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xecab('0x12'));var logger=require(_0xecab('0x13'))(_0xecab('0x14'));var utils=require(_0xecab('0x15'));var config=require(_0xecab('0x16'));var db=require(_0xecab('0x17'))['db'];config['redis']=_[_0xecab('0x18')](config[_0xecab('0x19')],{'host':_0xecab('0x1a'),'port':0x18eb});var socket=require(_0xecab('0x1b'))(new Redis(config[_0xecab('0x19')]));require(_0xecab('0x1c'))['register'](socket);function respondWithStatusCode(_0x1a9aab,_0x56a614){_0x56a614=_0x56a614||0xcc;return function(_0x4bfc49){if(_0x4bfc49){return _0x1a9aab[_0xecab('0x1d')](_0x56a614);}return _0x1a9aab[_0xecab('0x1e')](_0x56a614)[_0xecab('0x1f')]();};}function respondWithResult(_0x1c019f,_0x5bdb81){_0x5bdb81=_0x5bdb81||0xc8;return function(_0x35feb8){if(_0x35feb8){return _0x1c019f[_0xecab('0x1e')](_0x5bdb81)[_0xecab('0x20')](_0x35feb8);}};}function respondWithFilteredResult(_0x46e838,_0x2d4bc0){return function(_0x55280a){if(_0x55280a){var _0x267bf6=_0x55280a[_0xecab('0x21')],_0x447f3d=_0x2d4bc0[_0xecab('0x22')],_0x5e7e5e=_0x2d4bc0[_0xecab('0x22')]+_0x2d4bc0[_0xecab('0x23')],_0x16ab54;if(_0x5e7e5e>=_0x267bf6){_0x5e7e5e=_0x267bf6;_0x16ab54=0xc8;}else{_0x16ab54=0xce;}_0x46e838[_0xecab('0x1e')](_0x16ab54);return _0x46e838['set'](_0xecab('0x24'),_0x447f3d+'-'+_0x5e7e5e+'/'+_0x267bf6)[_0xecab('0x20')](_0x55280a);}return null;};}function patchUpdates(_0x1fdd1d){return function(_0x50eb82){try{jsonpatch[_0xecab('0x25')](_0x50eb82,_0x1fdd1d,!![]);}catch(_0x54138e){return BPromise[_0xecab('0x26')](_0x54138e);}return _0x50eb82['save']();};}function saveUpdates(_0x184dbc,_0x94d9c2){return function(_0xe61b4f){if(_0xe61b4f){return _0xe61b4f[_0xecab('0x27')](_0x184dbc)[_0xecab('0x28')](function(_0x18405d){return _0x18405d;});}return null;};}function removeEntity(_0x44ba86,_0x2991a3){return function(_0x3c701e){if(_0x3c701e){return _0x3c701e[_0xecab('0x29')]()[_0xecab('0x28')](function(){var _0x270946=_0x3c701e['get']({'plain':!![]});var _0x1fcc46='FaxQueues';return db[_0xecab('0x2a')][_0xecab('0x29')]({'where':{'type':_0x1fcc46,'resourceId':_0x270946['id']}})['then'](function(){return _0x3c701e;});})[_0xecab('0x28')](function(){_0x44ba86['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d6a57,_0xe97566){return function(_0x974659){if(!_0x974659){_0x2d6a57[_0xecab('0x1d')](0x194);}return _0x974659;};}function handleError(_0x34ded8,_0x30ca35){_0x30ca35=_0x30ca35||0x1f4;return function(_0x36c1c1){logger['error'](_0x36c1c1['stack']);if(_0x36c1c1[_0xecab('0x2b')]){delete _0x36c1c1[_0xecab('0x2b')];}_0x34ded8[_0xecab('0x1e')](_0x30ca35)[_0xecab('0x2c')](_0x36c1c1);};}exports[_0xecab('0x2d')]=function(_0x2e47fd,_0x51d4b9){var _0x5501e9={},_0x26e545={},_0x1ecb85={'count':0x0,'rows':[]};var _0x1cdc69=_[_0xecab('0x2e')](db[_0xecab('0x2f')][_0xecab('0x30')],function(_0x32955f){return{'name':_0x32955f[_0xecab('0x31')],'type':_0x32955f[_0xecab('0x32')]['key']};});_0x26e545['model']=_['map'](_0x1cdc69,'name');_0x26e545['query']=_[_0xecab('0x33')](_0x2e47fd[_0xecab('0x34')]);_0x26e545[_0xecab('0x35')]=_[_0xecab('0x36')](_0x26e545[_0xecab('0x37')],_0x26e545[_0xecab('0x34')]);_0x5501e9[_0xecab('0x38')]=_[_0xecab('0x36')](_0x26e545[_0xecab('0x37')],qs[_0xecab('0x39')](_0x2e47fd['query'][_0xecab('0x39')]));_0x5501e9['attributes']=_0x5501e9['attributes'][_0xecab('0x3a')]?_0x5501e9['attributes']:_0x26e545[_0xecab('0x37')];if(!_0x2e47fd[_0xecab('0x34')]['hasOwnProperty'](_0xecab('0x3b'))){_0x5501e9[_0xecab('0x23')]=qs[_0xecab('0x23')](_0x2e47fd[_0xecab('0x34')]['limit']);_0x5501e9[_0xecab('0x22')]=qs[_0xecab('0x22')](_0x2e47fd[_0xecab('0x34')]['offset']);}_0x5501e9[_0xecab('0x3c')]=qs[_0xecab('0x3d')](_0x2e47fd['query'][_0xecab('0x3d')]);_0x5501e9[_0xecab('0x3e')]=qs[_0xecab('0x35')](_['pick'](_0x2e47fd['query'],_0x26e545['filters']),_0x1cdc69);if(_0x2e47fd[_0xecab('0x34')][_0xecab('0x3f')]){_0x5501e9[_0xecab('0x3e')]=_[_0xecab('0x40')](_0x5501e9[_0xecab('0x3e')],{'$or':_[_0xecab('0x2e')](_0x1cdc69,function(_0x10c291){if(_0x10c291[_0xecab('0x32')]!=='VIRTUAL'){var _0x978283={};_0x978283[_0x10c291['name']]={'$like':'%'+_0x2e47fd['query']['filter']+'%'};return _0x978283;}})});}_0x5501e9=_['merge']({},_0x5501e9,_0x2e47fd[_0xecab('0x41')]);var _0x25b340={'where':_0x5501e9['where']};return db[_0xecab('0x2f')][_0xecab('0x21')](_0x25b340)[_0xecab('0x28')](function(_0x131544){_0x1ecb85[_0xecab('0x21')]=_0x131544;if(_0x2e47fd[_0xecab('0x34')][_0xecab('0x42')]){_0x5501e9[_0xecab('0x43')]=[{'all':!![]}];}return db['FaxQueue'][_0xecab('0x44')](_0x5501e9);})[_0xecab('0x28')](function(_0x2665b6){_0x1ecb85[_0xecab('0x45')]=_0x2665b6;return _0x1ecb85;})[_0xecab('0x28')](respondWithFilteredResult(_0x51d4b9,_0x5501e9))[_0xecab('0x46')](handleError(_0x51d4b9,null));};exports['show']=function(_0x4847c3,_0x295669){var _0x3b8ad7={'raw':!![],'where':{'id':_0x4847c3['params']['id']}},_0x5a5128={};_0x5a5128[_0xecab('0x37')]=_[_0xecab('0x33')](db[_0xecab('0x2f')]['rawAttributes']);_0x5a5128[_0xecab('0x34')]=_[_0xecab('0x33')](_0x4847c3[_0xecab('0x34')]);_0x5a5128['filters']=_[_0xecab('0x36')](_0x5a5128[_0xecab('0x37')],_0x5a5128[_0xecab('0x34')]);_0x3b8ad7['attributes']=_[_0xecab('0x36')](_0x5a5128[_0xecab('0x37')],qs[_0xecab('0x39')](_0x4847c3[_0xecab('0x34')][_0xecab('0x39')]));_0x3b8ad7[_0xecab('0x38')]=_0x3b8ad7[_0xecab('0x38')][_0xecab('0x3a')]?_0x3b8ad7['attributes']:_0x5a5128[_0xecab('0x37')];if(_0x4847c3[_0xecab('0x34')][_0xecab('0x42')]){_0x3b8ad7[_0xecab('0x43')]=[{'all':!![]}];}_0x3b8ad7=_['merge']({},_0x3b8ad7,_0x4847c3['options']);return db['FaxQueue'][_0xecab('0x47')](_0x3b8ad7)[_0xecab('0x28')](handleEntityNotFound(_0x295669,null))[_0xecab('0x28')](respondWithResult(_0x295669,null))[_0xecab('0x46')](handleError(_0x295669,null));};exports[_0xecab('0x48')]=function(_0x3868c3,_0x5823c6){return db[_0xecab('0x2f')][_0xecab('0x48')](_0x3868c3[_0xecab('0x49')],{})[_0xecab('0x28')](function(_0x119c50){var _0x23b223=_0x3868c3[_0xecab('0x4a')][_0xecab('0x4b')]({'plain':!![]});if(!_0x23b223)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23b223[_0xecab('0x4c')]===_0xecab('0x4a')){var _0x3d117c=_0x119c50[_0xecab('0x4b')]({'plain':!![]});var _0x4dc11b=_0xecab('0x4d');return db[_0xecab('0x4e')][_0xecab('0x47')]({'where':{'name':_0x4dc11b,'userProfileId':_0x23b223[_0xecab('0x4f')]},'raw':!![]})['then'](function(_0x2d752b){if(_0x2d752b&&_0x2d752b[_0xecab('0x50')]===0x0){return db[_0xecab('0x2a')][_0xecab('0x48')]({'name':_0x3d117c['name'],'resourceId':_0x3d117c['id'],'type':_0x2d752b[_0xecab('0x2b')],'sectionId':_0x2d752b['id']},{})[_0xecab('0x28')](function(){return _0x119c50;});}else{return _0x119c50;}})[_0xecab('0x46')](function(_0x4f103f){logger['error'](_0xecab('0x51'),_0x4f103f);throw _0x4f103f;});}return _0x119c50;})['then'](respondWithResult(_0x5823c6,0xc9))['catch'](handleError(_0x5823c6,null));};exports[_0xecab('0x27')]=function(_0xdced53,_0x138eca){if(_0xdced53[_0xecab('0x49')]['id']){delete _0xdced53[_0xecab('0x49')]['id'];}return db[_0xecab('0x2f')][_0xecab('0x47')]({'where':{'id':_0xdced53['params']['id']}})[_0xecab('0x28')](handleEntityNotFound(_0x138eca,null))[_0xecab('0x28')](saveUpdates(_0xdced53[_0xecab('0x49')],null))['then'](respondWithResult(_0x138eca,null))[_0xecab('0x46')](handleError(_0x138eca,null));};exports[_0xecab('0x29')]=function(_0x1603b2,_0x28d250){return db[_0xecab('0x2f')][_0xecab('0x47')]({'where':{'id':_0x1603b2[_0xecab('0x52')]['id']}})[_0xecab('0x28')](handleEntityNotFound(_0x28d250,null))[_0xecab('0x28')](removeEntity(_0x28d250,null))[_0xecab('0x46')](handleError(_0x28d250,null));};exports['describe']=function(_0x1649c2,_0x32dda6){return db[_0xecab('0x2f')]['describe']()[_0xecab('0x28')](respondWithResult(_0x32dda6,null))[_0xecab('0x46')](handleError(_0x32dda6,null));};exports[_0xecab('0x53')]=function(_0x331552,_0x3f0e47,_0x22e826){var _0x43c0e4={'raw':!![],'where':{}},_0x265888={},_0x46fb14;return db[_0xecab('0x2f')][_0xecab('0x54')]({'where':{'id':_0x331552[_0xecab('0x52')]['id']}})['then'](handleEntityNotFound(_0x3f0e47,null))[_0xecab('0x28')](function(_0x8c07fe){if(_0x8c07fe){_0x46fb14=_0x8c07fe[_0xecab('0x4b')]({'plain':!![]});_0x265888['model']=_[_0xecab('0x33')](db['UserFaxQueue'][_0xecab('0x30')]);_0x265888[_0xecab('0x34')]=_[_0xecab('0x33')](_0x331552[_0xecab('0x34')]);_0x265888[_0xecab('0x35')]=_[_0xecab('0x36')](_0x265888[_0xecab('0x37')],_0x265888[_0xecab('0x34')]);_0x43c0e4[_0xecab('0x38')]=_[_0xecab('0x36')](_0x265888[_0xecab('0x37')],qs[_0xecab('0x39')](_0x331552[_0xecab('0x34')][_0xecab('0x39')]));_0x43c0e4[_0xecab('0x38')]=_0x43c0e4[_0xecab('0x38')][_0xecab('0x3a')]?_0x43c0e4[_0xecab('0x38')]:_0x265888[_0xecab('0x37')];if(!_0x331552['query']['hasOwnProperty'](_0xecab('0x3b'))){_0x43c0e4[_0xecab('0x23')]=qs[_0xecab('0x23')](_0x331552[_0xecab('0x34')]['limit']);_0x43c0e4['offset']=qs[_0xecab('0x22')](_0x331552[_0xecab('0x34')][_0xecab('0x22')]);}_0x43c0e4['order']=qs['sort'](_0x331552[_0xecab('0x34')][_0xecab('0x3d')]);_0x43c0e4[_0xecab('0x3e')]=qs['filters'](_[_0xecab('0x55')](_0x331552[_0xecab('0x34')],_0x265888[_0xecab('0x35')]));_0x43c0e4[_0xecab('0x3e')][_0xecab('0x56')]=_0x8c07fe['id'];if(_0x331552['query'][_0xecab('0x3f')]){_0x43c0e4[_0xecab('0x3e')]=_[_0xecab('0x40')](_0x43c0e4['where'],{'$or':_['map'](_0x43c0e4[_0xecab('0x38')],function(_0x5e07c2){var _0x33cabe={};_0x33cabe[_0x5e07c2]={'$like':'%'+_0x331552[_0xecab('0x34')]['filter']+'%'};return _0x33cabe;})});}_0x43c0e4=_[_0xecab('0x40')]({},_0x43c0e4,_0x331552[_0xecab('0x41')]);return db['UserFaxQueue'][_0xecab('0x44')](_0x43c0e4);}})[_0xecab('0x28')](function(_0x8acedd){if(_0x8acedd){return db[_0xecab('0x57')]['findAndCountAll']({'where':{'id':_[_0xecab('0x2e')](_0x8acedd,_0xecab('0x58')),'role':_0xecab('0x59')},'attributes':['id','name',_0xecab('0x5a'),_0xecab('0x5b'),_0xecab('0x5c')]});}})[_0xecab('0x28')](function(_0x25f354){if(_0x25f354){return{'count':_0x25f354[_0xecab('0x21')],'rows':_[_0xecab('0x2e')](_0x25f354[_0xecab('0x45')],function(_0x30ccf4){return{'membername':_0x30ccf4[_0xecab('0x2b')],'UserId':_0x30ccf4['id'],'queue_name':_0x46fb14[_0xecab('0x2b')],'FaxQueueId':_0x46fb14['id'],'interface':util[_0xecab('0x5d')](_0xecab('0x5e'),_0xecab('0x5f'),_0x30ccf4[_0xecab('0x2b')]),'penalty':0x0,'paused':_0x30ccf4[_0xecab('0x5a')],'createdAt':_0x30ccf4[_0xecab('0x5c')],'updatedAt':_0x30ccf4[_0xecab('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xecab('0x28')](respondWithFilteredResult(_0x3f0e47,_0x43c0e4))[_0xecab('0x46')](handleError(_0x3f0e47,null));};exports[_0xecab('0x60')]=function(_0x3055ff,_0x50cece,_0x2b9d49){var _0x1e3ba7={};var _0x136b18={};var _0x4f922c;var _0x13a800;return db['FaxQueue'][_0xecab('0x54')]({'where':{'id':_0x3055ff['params']['id']}})[_0xecab('0x28')](handleEntityNotFound(_0x50cece,null))[_0xecab('0x28')](function(_0x1cd418){if(_0x1cd418){_0x4f922c=_0x1cd418;_0x136b18[_0xecab('0x37')]=_[_0xecab('0x33')](db[_0xecab('0x61')][_0xecab('0x30')]);_0x136b18[_0xecab('0x34')]=_[_0xecab('0x33')](_0x3055ff[_0xecab('0x34')]);_0x136b18[_0xecab('0x35')]=_[_0xecab('0x36')](_0x136b18['model'],_0x136b18['query']);_0x1e3ba7[_0xecab('0x38')]=_[_0xecab('0x36')](_0x136b18[_0xecab('0x37')],qs[_0xecab('0x39')](_0x3055ff[_0xecab('0x34')][_0xecab('0x39')]));_0x1e3ba7[_0xecab('0x38')]=_0x1e3ba7[_0xecab('0x38')]['length']?_0x1e3ba7[_0xecab('0x38')]:_0x136b18[_0xecab('0x37')];_0x1e3ba7[_0xecab('0x3c')]=qs[_0xecab('0x3d')](_0x3055ff[_0xecab('0x34')][_0xecab('0x3d')]);_0x1e3ba7['where']=qs[_0xecab('0x35')](_['pick'](_0x3055ff[_0xecab('0x34')],_0x136b18[_0xecab('0x35')]));if(_0x3055ff[_0xecab('0x34')][_0xecab('0x3f')]){_0x1e3ba7[_0xecab('0x3e')]=_[_0xecab('0x40')](_0x1e3ba7['where'],{'$or':_['map'](_0x1e3ba7[_0xecab('0x38')],function(_0x22eddd){var _0x4361db={};_0x4361db[_0x22eddd]={'$like':'%'+_0x3055ff[_0xecab('0x34')][_0xecab('0x3f')]+'%'};return _0x4361db;})});}_0x1e3ba7=_[_0xecab('0x40')]({},_0x1e3ba7,_0x3055ff[_0xecab('0x41')]);return _0x4f922c['getTeams'](_0x1e3ba7);}})[_0xecab('0x28')](function(_0x19ae25){if(_0x19ae25){_0x13a800=_0x19ae25[_0xecab('0x3a')];if(!_0x3055ff[_0xecab('0x34')][_0xecab('0x62')]('nolimit')){_0x1e3ba7[_0xecab('0x23')]=qs[_0xecab('0x23')](_0x3055ff[_0xecab('0x34')][_0xecab('0x23')]);_0x1e3ba7['offset']=qs[_0xecab('0x22')](_0x3055ff[_0xecab('0x34')]['offset']);}return _0x4f922c[_0xecab('0x60')](_0x1e3ba7);}})[_0xecab('0x28')](function(_0x8271bf){if(_0x8271bf){return _0x8271bf?{'count':_0x13a800,'rows':_0x8271bf}:null;}})[_0xecab('0x28')](respondWithResult(_0x50cece,null))[_0xecab('0x46')](handleError(_0x50cece,null));};exports[_0xecab('0x63')]=function(_0x4d074b,_0x2239be,_0x24a8fc){var _0x19b84a=_0x4d074b[_0xecab('0x49')][_0xecab('0x64')];return db[_0xecab('0x61')]['findAll']({'where':{'id':_0x19b84a},'attributes':['id'],'include':[{'model':db[_0xecab('0x57')],'as':_0xecab('0x65'),'attributes':['id',_0xecab('0x2b'),_0xecab('0x66'),_0xecab('0x67'),_0xecab('0x68')],'raw':!![]}]})[_0xecab('0x28')](function(_0xb9628c){if(_0xb9628c){var _0x3c9220=_['flatMap'](_0xb9628c,function(_0x3b0ceb){var _0x5c01c9=_0x3b0ceb['get']({'plain':!![]});return _0x5c01c9[_0xecab('0x65')];});return db[_0xecab('0x2f')]['find']({'where':{'id':_0x4d074b[_0xecab('0x52')]['id']}})['then'](function(_0x22af08){return db['sequelize'][_0xecab('0x69')](function(_0x198281){return _0x22af08[_0xecab('0x63')](_0x19b84a,{'transaction':_0x198281})[_0xecab('0x28')](function(){return BPromise['each'](_0x3c9220,function(_0x25d50a){return db['UserFaxQueue'][_0xecab('0x6a')]({'where':{'UserId':_0x25d50a['id'],'FaxQueueId':_0x4d074b[_0xecab('0x52')]['id']},'transaction':_0x198281});});})[_0xecab('0x28')](function(){_0x3c9220[_0xecab('0x6b')](function(_0xde881b){socket[_0xecab('0x6c')](_0xecab('0x6d'),{'UserId':_0xde881b['id'],'FaxQueueId':_0x22af08['id']});});});});});}})[_0xecab('0x28')](respondWithStatusCode(_0x2239be,null))[_0xecab('0x46')](handleError(_0x2239be,null));};exports[_0xecab('0x6e')]=function(_0x49f548,_0x47894e,_0x919505){return db['Team'][_0xecab('0x44')]({'where':{'id':_0x49f548[_0xecab('0x34')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xecab('0x65'),'attributes':['id'],'raw':!![]}]})[_0xecab('0x28')](handleEntityNotFound(_0x47894e,null))[_0xecab('0x28')](function(_0xb6abe6){var _0x3b2a3e=_['map'](_0xb6abe6,'id');var _0x334a8b=[];var _0x1c1a82=[];var _0x3f3ac9=squel[_0xecab('0x6f')]();_0x3f3ac9['field'](_0xecab('0x70'))[_0xecab('0x71')](_0xecab('0x72'),'tq')['join'](_0xecab('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xecab('0x3e')]('FaxQueueId\x20=\x20?',_0x49f548[_0xecab('0x52')]['id']);for(var _0xa9787b=0x0;_0xa9787b<_0xb6abe6[_0xecab('0x3a')];_0xa9787b+=0x1){let _0x16df54=_0xb6abe6[_0xa9787b];for(var _0xfe30c1=0x0;_0xfe30c1<_0x16df54['Agents'][_0xecab('0x3a')];_0xfe30c1+=0x1){let _0x416fea=_0x16df54['Agents'][_0xfe30c1];var _0x7c2e71=_0x3f3ac9[_0xecab('0x74')]();_0x7c2e71['where'](_0xecab('0x75'),_0x416fea['id']);_0x1c1a82['push'](db[_0xecab('0x76')][_0xecab('0x34')](_0x7c2e71['toString'](),{'type':db[_0xecab('0x76')][_0xecab('0x77')][_0xecab('0x78')]})[_0xecab('0x28')](function(_0x5711d5){if(_0x5711d5['length']===0x1){return _0x416fea['id'];}else{var _0x2ae99a=_[_0xecab('0x79')](_[_0xecab('0x2e')](_0x5711d5,_0xecab('0x7a')),function(_0x36f417){return _['includes'](_0x3b2a3e,_0x36f417);});if(_0x2ae99a){return _0x416fea['id'];}}}));}}return BPromise['all'](_0x1c1a82)['then'](function(_0x56cb0e){_0x334a8b=_(_0x334a8b)[_0xecab('0x7b')](_0x56cb0e)[_0xecab('0x7c')]()[_0xecab('0x7d')]();return db[_0xecab('0x2f')][_0xecab('0x47')]({'where':{'id':_0x49f548['params']['id']}})['then'](function(_0x2337a9){return db['sequelize']['transaction'](function(_0x2f7d84){return _0x2337a9['removeTeams'](_0x49f548[_0xecab('0x34')][_0xecab('0x64')],{'transaction':_0x2f7d84})[_0xecab('0x28')](function(){if(!_['isEmpty'](_0x334a8b)){return _0x2337a9[_0xecab('0x7e')](_0x334a8b,{'transaction':_0x2f7d84});}})[_0xecab('0x28')](function(){_0x334a8b[_0xecab('0x6b')](function(_0x1f0fdd){socket[_0xecab('0x6c')](_0xecab('0x7f'),{'UserId':_0x1f0fdd,'FaxQueueId':_0x2337a9['id']});});});});});});})[_0xecab('0x28')](respondWithStatusCode(_0x47894e,null))['catch'](handleError(_0x47894e,null));};exports['addAgents']=function(_0x48117c,_0x3669a1,_0x1fa1c1){return db['FaxQueue'][_0xecab('0x47')]({'where':{'id':_0x48117c['params']['id']}})['then'](handleEntityNotFound(_0x3669a1,null))[_0xecab('0x28')](function(_0x5c08f8){if(_0x5c08f8){return _0x5c08f8['addAgents'](_0x48117c['body']['ids'],_[_0xecab('0x80')](_0x48117c['body'],[_0xecab('0x64'),'id'])||{})['spread'](function(_0x13052f){for(var _0x1c6b89=0x0;_0x1c6b89<_0x48117c[_0xecab('0x49')][_0xecab('0x64')][_0xecab('0x3a')];_0x1c6b89+=0x1){socket['emit'](_0xecab('0x6d'),{'UserId':_0x48117c[_0xecab('0x49')][_0xecab('0x64')][_0x1c6b89],'FaxQueueId':_0x48117c[_0xecab('0x52')]['id']});}return _0x13052f;});}})[_0xecab('0x28')](respondWithResult(_0x3669a1,null))['catch'](handleError(_0x3669a1,null));};exports[_0xecab('0x7e')]=function(_0x177297,_0x180d71,_0x58d9be){return db['FaxQueue']['find']({'where':{'id':_0x177297[_0xecab('0x52')]['id']}})[_0xecab('0x28')](handleEntityNotFound(_0x180d71,null))['then'](function(_0x455ecd){if(_0x455ecd){return _0x455ecd[_0xecab('0x7e')](_0x177297[_0xecab('0x34')][_0xecab('0x64')])['then'](function(){if(_[_0xecab('0x81')](_0x177297[_0xecab('0x34')][_0xecab('0x64')])){for(var _0x45be5b=0x0;_0x45be5b<_0x177297['query'][_0xecab('0x64')][_0xecab('0x3a')];_0x45be5b+=0x1){socket['emit'](_0xecab('0x7f'),{'UserId':Number(_0x177297[_0xecab('0x34')]['ids'][_0x45be5b]),'FaxQueueId':Number(_0x177297[_0xecab('0x52')]['id'])});}}else{socket[_0xecab('0x6c')](_0xecab('0x7f'),{'UserId':Number(_0x177297[_0xecab('0x34')][_0xecab('0x64')]),'FaxQueueId':Number(_0x177297[_0xecab('0x52')]['id'])});}});}})[_0xecab('0x28')](respondWithStatusCode(_0x180d71,null))[_0xecab('0x46')](handleError(_0x180d71,null));};exports['getAgents']=function(_0x385bcb,_0x169cf2,_0x3b6520){var _0x51deff={};var _0x104b47={};var _0x14dd63;var _0x5cab5d;return db[_0xecab('0x2f')][_0xecab('0x54')]({'where':{'id':_0x385bcb[_0xecab('0x52')]['id']}})[_0xecab('0x28')](handleEntityNotFound(_0x169cf2,null))[_0xecab('0x28')](function(_0x35062c){if(_0x35062c){_0x14dd63=_0x35062c;_0x104b47[_0xecab('0x37')]=_[_0xecab('0x33')](db[_0xecab('0x57')][_0xecab('0x30')]);_0x104b47[_0xecab('0x34')]=_[_0xecab('0x33')](_0x385bcb[_0xecab('0x34')]);_0x104b47['filters']=_[_0xecab('0x36')](_0x104b47[_0xecab('0x37')],_0x104b47['query']);_0x51deff[_0xecab('0x38')]=_[_0xecab('0x36')](_0x104b47[_0xecab('0x37')],qs['fields'](_0x385bcb[_0xecab('0x34')][_0xecab('0x39')]));_0x51deff[_0xecab('0x38')]=_0x51deff['attributes'][_0xecab('0x3a')]?_0x51deff[_0xecab('0x38')]:_0x104b47[_0xecab('0x37')];_0x51deff[_0xecab('0x3c')]=qs['sort'](_0x385bcb[_0xecab('0x34')][_0xecab('0x3d')]);_0x51deff[_0xecab('0x3e')]=qs['filters'](_[_0xecab('0x55')](_0x385bcb[_0xecab('0x34')],_0x104b47[_0xecab('0x35')]));if(_0x385bcb['query'][_0xecab('0x3f')]){_0x51deff[_0xecab('0x3e')]=_['merge'](_0x51deff['where'],{'$or':_[_0xecab('0x2e')](_0x51deff[_0xecab('0x38')],function(_0x3174c8){var _0x32537b={};_0x32537b[_0x3174c8]={'$like':'%'+_0x385bcb[_0xecab('0x34')][_0xecab('0x3f')]+'%'};return _0x32537b;})});}_0x51deff=_['merge']({},_0x51deff,_0x385bcb[_0xecab('0x41')]);return _0x14dd63['getAgents'](_0x51deff);}})[_0xecab('0x28')](function(_0x10c0c8){if(_0x10c0c8){_0x5cab5d=_0x10c0c8[_0xecab('0x3a')];if(!_0x385bcb[_0xecab('0x34')][_0xecab('0x62')](_0xecab('0x3b'))){_0x51deff[_0xecab('0x23')]=qs[_0xecab('0x23')](_0x385bcb[_0xecab('0x34')][_0xecab('0x23')]);_0x51deff[_0xecab('0x22')]=qs[_0xecab('0x22')](_0x385bcb['query'][_0xecab('0x22')]);}return _0x14dd63[_0xecab('0x82')](_0x51deff);}})[_0xecab('0x28')](function(_0x3481b6){if(_0x3481b6){return _0x3481b6?{'count':_0x5cab5d,'rows':_0x3481b6}:null;}})[_0xecab('0x28')](respondWithResult(_0x169cf2,null))[_0xecab('0x46')](handleError(_0x169cf2,null));};
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js
index 9c72e55..e141807 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 _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
+var _0xdbf8=['hook','exports','events','FaxQueue','setMaxListeners','update','remove','emit'];(function(_0x27fdc6,_0x191b73){var _0xcccb0e=function(_0x5603fa){while(--_0x5603fa){_0x27fdc6['push'](_0x27fdc6['shift']());}};_0xcccb0e(++_0x191b73);}(_0xdbf8,0x162));var _0x8dbf=function(_0x33c7b5,_0x3f207d){_0x33c7b5=_0x33c7b5-0x0;var _0x5d7127=_0xdbf8[_0x33c7b5];return _0x5d7127;};'use strict';var EventEmitter=require(_0x8dbf('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x8dbf('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x8dbf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8dbf('0x3'),'afterDestroy':_0x8dbf('0x4')};function emitEvent(_0x5d19f2){return function(_0x44db10,_0x4873de,_0x1b97ca){FaxQueueEvents['emit'](_0x5d19f2+':'+_0x44db10['id'],_0x44db10);FaxQueueEvents[_0x8dbf('0x5')](_0x5d19f2,_0x44db10);_0x1b97ca(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x8dbf('0x6')](e,emitEvent(event));}}module[_0x8dbf('0x7')]=FaxQueueEvents;
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js
index 1d7a283..f738cd1 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 _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
+var _0xe8c2=['exports','define','FaxQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxQueue.attributes'];(function(_0x6173fc,_0x32aadf){var _0x965fbe=function(_0x50d5b3){while(--_0x50d5b3){_0x6173fc['push'](_0x6173fc['shift']());}};_0x965fbe(++_0x32aadf);}(_0xe8c2,0x1d7));var _0x2e8c=function(_0x3b5640,_0x3ec34e){_0x3b5640=_0x3b5640-0x0;var _0x1a6ecd=_0xe8c2[_0x3b5640];return _0x1a6ecd;};'use strict';var _=require(_0x2e8c('0x0'));var util=require(_0x2e8c('0x1'));var logger=require(_0x2e8c('0x2'))(_0x2e8c('0x3'));var moment=require(_0x2e8c('0x4'));var BPromise=require(_0x2e8c('0x5'));var rp=require(_0x2e8c('0x6'));var fs=require('fs');var path=require(_0x2e8c('0x7'));var rimraf=require(_0x2e8c('0x8'));var config=require('../../config/environment');var attributes=require(_0x2e8c('0x9'));module[_0x2e8c('0xa')]=function(_0x43d933,_0x122bd2){return _0x43d933[_0x2e8c('0xb')](_0x2e8c('0xc'),attributes,{'tableName':'fax_queues','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 28aac04..49835d4 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 _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
+var _0x076b=['request\x20sent','debug','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowFaxQueue','FaxQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info'];(function(_0xa990b7,_0x26c527){var _0x52c99c=function(_0xf94328){while(--_0xf94328){_0xa990b7['push'](_0xa990b7['shift']());}};_0x52c99c(++_0x26c527);}(_0x076b,0xb6));var _0xb076=function(_0x77eb0b,_0x2c2414){_0x77eb0b=_0x77eb0b-0x0;var _0x3d8316=_0x076b[_0x77eb0b];return _0x3d8316;};'use strict';var _=require(_0xb076('0x0'));var util=require(_0xb076('0x1'));var moment=require('moment');var BPromise=require(_0xb076('0x2'));var rs=require(_0xb076('0x3'));var fs=require('fs');var Redis=require(_0xb076('0x4'));var db=require(_0xb076('0x5'))['db'];var utils=require(_0xb076('0x6'));var logger=require('../../config/logger')(_0xb076('0x7'));var config=require('../../config/environment');var jayson=require(_0xb076('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xb076('0x9')]=_[_0xb076('0xa')](config[_0xb076('0x9')],{'host':_0xb076('0xb'),'port':0x18eb});var socket=require(_0xb076('0xc'))(new Redis(config[_0xb076('0x9')]));require(_0xb076('0xd'))[_0xb076('0xe')](socket);function respondWithRpcPromise(_0x3a660d,_0x391ecd,_0x1dbaa2){return new BPromise(function(_0x17fd27,_0x2890de){return client[_0xb076('0xf')](_0x3a660d,_0x1dbaa2)[_0xb076('0x10')](function(_0x400c23){logger[_0xb076('0x11')]('FaxQueue,\x20%s,\x20%s',_0x391ecd,_0xb076('0x12'));logger[_0xb076('0x13')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x391ecd,_0xb076('0x12'),JSON['stringify'](_0x400c23));if(_0x400c23[_0xb076('0x14')]){if(_0x400c23[_0xb076('0x14')][_0xb076('0x15')]===0x1f4){logger[_0xb076('0x14')](_0xb076('0x16'),_0x391ecd,_0x400c23[_0xb076('0x14')][_0xb076('0x17')]);return _0x2890de(_0x400c23[_0xb076('0x14')][_0xb076('0x17')]);}logger[_0xb076('0x14')](_0xb076('0x16'),_0x391ecd,_0x400c23[_0xb076('0x14')]['message']);return _0x17fd27(_0x400c23['error'][_0xb076('0x17')]);}else{logger[_0xb076('0x11')]('FaxQueue,\x20%s,\x20%s',_0x391ecd,'request\x20sent');_0x17fd27(_0x400c23[_0xb076('0x18')]['message']);}})[_0xb076('0x19')](function(_0x197465){logger[_0xb076('0x14')](_0xb076('0x16'),_0x391ecd,_0x197465);_0x2890de(_0x197465);});});}exports[_0xb076('0x1a')]=function(_0xbc1e78){var _0x2731ce=this;return new Promise(function(_0xbcd73b,_0x3cc812){return db['FaxQueue'][_0xb076('0x1b')]({'raw':_0xbc1e78[_0xb076('0x1c')]?_0xbc1e78[_0xb076('0x1c')][_0xb076('0x1d')]===undefined?!![]:![]:!![],'where':_0xbc1e78['options']?_0xbc1e78[_0xb076('0x1c')][_0xb076('0x1e')]||null:null,'attributes':_0xbc1e78[_0xb076('0x1c')]?_0xbc1e78[_0xb076('0x1c')][_0xb076('0x1f')]||null:null,'limit':_0xbc1e78[_0xb076('0x1c')]?_0xbc1e78['options'][_0xb076('0x20')]||null:null,'include':_0xbc1e78['options']?_0xbc1e78[_0xb076('0x1c')][_0xb076('0x21')]?_['map'](_0xbc1e78['options'][_0xb076('0x21')],function(_0x487022){return{'model':db[_0x487022[_0xb076('0x22')]],'as':_0x487022['as'],'attributes':_0x487022['attributes'],'include':_0x487022[_0xb076('0x21')]?_['map'](_0x487022[_0xb076('0x21')],function(_0x59e96b){return{'model':db[_0x59e96b[_0xb076('0x22')]],'as':_0x59e96b['as'],'attributes':_0x59e96b[_0xb076('0x1f')],'include':_0x59e96b['include']?_[_0xb076('0x23')](_0x59e96b[_0xb076('0x21')],function(_0x56bd5d){return{'model':db[_0x56bd5d['model']],'as':_0x56bd5d['as'],'attributes':_0x56bd5d[_0xb076('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x338fb6){logger[_0xb076('0x11')](_0xb076('0x1a'),_0xbc1e78);logger['debug']('GetFaxQueue',_0xbc1e78,JSON[_0xb076('0x24')](_0x338fb6));_0xbcd73b(_0x338fb6);})[_0xb076('0x19')](function(_0x2b7ec3){logger[_0xb076('0x14')](_0xb076('0x1a'),_0x2b7ec3[_0xb076('0x17')],_0xbc1e78);_0x3cc812(_0x2731ce[_0xb076('0x14')](0x1f4,_0x2b7ec3[_0xb076('0x17')]));});});};exports[_0xb076('0x25')]=function(_0x2caa8b){var _0x434a7e=this;return new Promise(function(_0x3ed725,_0x16f14f){return db[_0xb076('0x26')][_0xb076('0x27')]({'raw':_0x2caa8b['options']?_0x2caa8b['options'][_0xb076('0x1d')]===undefined?!![]:![]:!![],'where':_0x2caa8b[_0xb076('0x1c')]?_0x2caa8b[_0xb076('0x1c')][_0xb076('0x1e')]||null:null,'attributes':_0x2caa8b[_0xb076('0x1c')]?_0x2caa8b[_0xb076('0x1c')][_0xb076('0x1f')]||null:null,'include':_0x2caa8b[_0xb076('0x1c')]?_0x2caa8b['options'][_0xb076('0x21')]?_['map'](_0x2caa8b['options'][_0xb076('0x21')],function(_0x18df0c){return{'model':db[_0x18df0c[_0xb076('0x22')]],'as':_0x18df0c['as'],'attributes':_0x18df0c[_0xb076('0x1f')],'include':_0x18df0c[_0xb076('0x21')]?_['map'](_0x18df0c[_0xb076('0x21')],function(_0x3113a7){return{'model':db[_0x3113a7[_0xb076('0x22')]],'as':_0x3113a7['as'],'attributes':_0x3113a7['attributes'],'include':_0x3113a7[_0xb076('0x21')]?_[_0xb076('0x23')](_0x3113a7[_0xb076('0x21')],function(_0x1b0ebd){return{'model':db[_0x1b0ebd[_0xb076('0x22')]],'as':_0x1b0ebd['as'],'attributes':_0x1b0ebd[_0xb076('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb076('0x10')](function(_0x55c307){logger[_0xb076('0x11')](_0xb076('0x25'),_0x2caa8b);logger[_0xb076('0x13')](_0xb076('0x25'),_0x2caa8b,JSON[_0xb076('0x24')](_0x55c307));_0x3ed725(_0x55c307);})[_0xb076('0x19')](function(_0x2cdb2f){logger['error']('ShowFaxQueue',_0x2cdb2f[_0xb076('0x17')],_0x2caa8b);_0x16f14f(_0x434a7e[_0xb076('0x14')](0x1f4,_0x2cdb2f[_0xb076('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js
index e8b1865..fbe1d0f 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 _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
+var _0x5a20=['length','faxQueue:','save','remove','update','emit','removeListener','register'];(function(_0x2d91c6,_0x10ae0e){var _0x3a8d19=function(_0x27a3ce){while(--_0x27a3ce){_0x2d91c6['push'](_0x2d91c6['shift']());}};_0x3a8d19(++_0x10ae0e);}(_0x5a20,0xea));var _0x05a2=function(_0x29b778,_0x620b7b){_0x29b778=_0x29b778-0x0;var _0x561839=_0x5a20[_0x29b778];return _0x561839;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x05a2('0x0'),_0x05a2('0x1'),_0x05a2('0x2')];function createListener(_0x326dfe,_0x56afda){return function(_0x411f97){_0x56afda[_0x05a2('0x3')](_0x326dfe,_0x411f97);};}function removeListener(_0x13b082,_0x1786fc){return function(){FaxQueueEvents[_0x05a2('0x4')](_0x13b082,_0x1786fc);};}exports[_0x05a2('0x5')]=function(_0x2dd9d0){for(var _0x29be91=0x0,_0x38b5e1=events[_0x05a2('0x6')];_0x29be91<_0x38b5e1;_0x29be91++){var _0x49041b=events[_0x29be91];var _0x4356d2=createListener(_0x05a2('0x7')+_0x49041b,_0x2dd9d0);FaxQueueEvents['on'](_0x49041b,_0x4356d2);}};
\ No newline at end of file
diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js
index 8626f7b..d324a77 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(_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
+var _0x0b0e=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','destroy','delete','removeTeams','removeAgents','multer'];(function(_0x2fd69d,_0xeb1037){var _0x5d5ef3=function(_0xa9ea9e){while(--_0xa9ea9e){_0x2fd69d['push'](_0x2fd69d['shift']());}};_0x5d5ef3(++_0xeb1037);}(_0x0b0e,0x187));var _0xe0b0=function(_0x200827,_0x4af951){_0x200827=_0x200827-0x0;var _0x120047=_0x0b0e[_0x200827];return _0x120047;};'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['get'](_0xe0b0('0xe'),auth[_0xe0b0('0x9')](),controller['getMembers']);router[_0xe0b0('0x8')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x8')](_0xe0b0('0x11'),auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x14')]);router[_0xe0b0('0x13')]('/:id/teams',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x15')]);router[_0xe0b0('0x13')](_0xe0b0('0x11'),auth[_0xe0b0('0x9')](),controller['addAgents']);router[_0xe0b0('0x16')]('/:id',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x17')]);router['delete'](_0xe0b0('0xc'),auth['isAuthenticated'](),controller[_0xe0b0('0x18')]);router[_0xe0b0('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe0b0('0x1a')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xe0b0('0x1b')]);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 0e1c4a7..3de9377 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 _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
+var _0xa009=['sequelize','exports','DATE','STRING'];(function(_0x1c757c,_0xc1ee20){var _0x19cba6=function(_0x2b7339){while(--_0x2b7339){_0x1c757c['push'](_0x1c757c['shift']());}};_0x19cba6(++_0xc1ee20);}(_0xa009,0xa8));var _0x9a00=function(_0x4a05a2,_0x46f343){_0x4a05a2=_0x4a05a2-0x0;var _0x557e0b=_0xa009[_0x4a05a2];return _0x557e0b;};'use strict';var moment=require('moment');var Sequelize=require(_0x9a00('0x0'));module[_0x9a00('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x9a00('0x2')]},'leaveAt':{'type':Sequelize[_0x9a00('0x2')]},'acceptAt':{'type':Sequelize[_0x9a00('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x9a00('0x3')]}};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js
index 82a94fd..aff6a49 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 _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
+var _0x5abb=['intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','lodash','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','FaxQueueReport','fieldName','key','query','filters'];(function(_0x3a8b41,_0x122312){var _0x19cb35=function(_0x133570){while(--_0x133570){_0x3a8b41['push'](_0x3a8b41['shift']());}};_0x19cb35(++_0x122312);}(_0x5abb,0x169));var _0xb5ab=function(_0x422dce,_0xeab4b1){_0x422dce=_0x422dce-0x0;var _0x44f692=_0x5abb[_0x422dce];return _0x44f692;};'use strict';var pdf=require(_0xb5ab('0x0'));var emlformat=require(_0xb5ab('0x1'));var rimraf=require(_0xb5ab('0x2'));var zipdir=require(_0xb5ab('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb5ab('0x4'));var moment=require(_0xb5ab('0x5'));var BPromise=require(_0xb5ab('0x6'));var Mustache=require('mustache');var util=require(_0xb5ab('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb5ab('0x8'));var ejs=require(_0xb5ab('0x9'));var fs=require('fs');var _=require(_0xb5ab('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb5ab('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb5ab('0xb'));var qs=require(_0xb5ab('0xc'));var as=require(_0xb5ab('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5ab('0xe'))('api');var utils=require(_0xb5ab('0xf'));var config=require(_0xb5ab('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ea924,_0x23ff2f){_0x23ff2f=_0x23ff2f||0xcc;return function(_0x1d4d5e){if(_0x1d4d5e){return _0x4ea924[_0xb5ab('0x11')](_0x23ff2f);}return _0x4ea924[_0xb5ab('0x12')](_0x23ff2f)[_0xb5ab('0x13')]();};}function respondWithResult(_0x1ae79b,_0x38cfa5){_0x38cfa5=_0x38cfa5||0xc8;return function(_0x4bfe87){if(_0x4bfe87){return _0x1ae79b[_0xb5ab('0x12')](_0x38cfa5)[_0xb5ab('0x14')](_0x4bfe87);}};}function respondWithFilteredResult(_0x5aa63b,_0x346bac){return function(_0x439d6a){if(_0x439d6a){var _0x34a996=_0x439d6a[_0xb5ab('0x15')],_0x46ef2e=_0x346bac[_0xb5ab('0x16')],_0x360ed5=_0x346bac[_0xb5ab('0x16')]+_0x346bac[_0xb5ab('0x17')],_0x4d6155;if(_0x360ed5>=_0x34a996){_0x360ed5=_0x34a996;_0x4d6155=0xc8;}else{_0x4d6155=0xce;}_0x5aa63b[_0xb5ab('0x12')](_0x4d6155);return _0x5aa63b[_0xb5ab('0x18')](_0xb5ab('0x19'),_0x46ef2e+'-'+_0x360ed5+'/'+_0x34a996)[_0xb5ab('0x14')](_0x439d6a);}return null;};}function patchUpdates(_0x38f6d7){return function(_0x5c1d94){try{jsonpatch[_0xb5ab('0x1a')](_0x5c1d94,_0x38f6d7,!![]);}catch(_0x91f663){return BPromise[_0xb5ab('0x1b')](_0x91f663);}return _0x5c1d94['save']();};}function saveUpdates(_0x2fb402,_0x3afbb2){return function(_0x99b8e5){if(_0x99b8e5){return _0x99b8e5['update'](_0x2fb402)[_0xb5ab('0x1c')](function(_0x240937){return _0x240937;});}return null;};}function removeEntity(_0x101198,_0x303020){return function(_0x3ef09c){if(_0x3ef09c){return _0x3ef09c[_0xb5ab('0x1d')]()['then'](function(){_0x101198[_0xb5ab('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x113ef,_0xbb0789){return function(_0x2508c1){if(!_0x2508c1){_0x113ef['sendStatus'](0x194);}return _0x2508c1;};}function handleError(_0x561653,_0x301062){_0x301062=_0x301062||0x1f4;return function(_0x5044ea){logger[_0xb5ab('0x1e')](_0x5044ea[_0xb5ab('0x1f')]);if(_0x5044ea[_0xb5ab('0x20')]){delete _0x5044ea['name'];}_0x561653[_0xb5ab('0x12')](_0x301062)[_0xb5ab('0x21')](_0x5044ea);};}exports[_0xb5ab('0x22')]=function(_0x4fce66,_0x4357cd){var _0x4d7335={},_0x268657={},_0x24c0f6={'count':0x0,'rows':[]};var _0x2fa1ba=_[_0xb5ab('0x23')](db[_0xb5ab('0x24')]['rawAttributes'],function(_0x16fd7c){return{'name':_0x16fd7c[_0xb5ab('0x25')],'type':_0x16fd7c['type'][_0xb5ab('0x26')]};});_0x268657['model']=_[_0xb5ab('0x23')](_0x2fa1ba,_0xb5ab('0x20'));_0x268657[_0xb5ab('0x27')]=_['keys'](_0x4fce66[_0xb5ab('0x27')]);_0x268657[_0xb5ab('0x28')]=_[_0xb5ab('0x29')](_0x268657[_0xb5ab('0x2a')],_0x268657[_0xb5ab('0x27')]);_0x4d7335[_0xb5ab('0x2b')]=_['intersection'](_0x268657['model'],qs[_0xb5ab('0x2c')](_0x4fce66[_0xb5ab('0x27')][_0xb5ab('0x2c')]));_0x4d7335[_0xb5ab('0x2b')]=_0x4d7335['attributes'][_0xb5ab('0x2d')]?_0x4d7335[_0xb5ab('0x2b')]:_0x268657[_0xb5ab('0x2a')];if(!_0x4fce66[_0xb5ab('0x27')][_0xb5ab('0x2e')]('nolimit')){_0x4d7335['limit']=qs[_0xb5ab('0x17')](_0x4fce66['query']['limit']);_0x4d7335[_0xb5ab('0x16')]=qs[_0xb5ab('0x16')](_0x4fce66[_0xb5ab('0x27')]['offset']);}_0x4d7335['order']=qs['sort'](_0x4fce66[_0xb5ab('0x27')][_0xb5ab('0x2f')]);_0x4d7335[_0xb5ab('0x30')]=qs[_0xb5ab('0x28')](_[_0xb5ab('0x31')](_0x4fce66['query'],_0x268657[_0xb5ab('0x28')]),_0x2fa1ba);if(_0x4fce66[_0xb5ab('0x27')][_0xb5ab('0x32')]){_0x4d7335[_0xb5ab('0x30')]=_[_0xb5ab('0x33')](_0x4d7335['where'],{'$or':_[_0xb5ab('0x23')](_0x2fa1ba,function(_0x43a84b){if(_0x43a84b[_0xb5ab('0x34')]!==_0xb5ab('0x35')){var _0xba9417={};_0xba9417[_0x43a84b[_0xb5ab('0x20')]]={'$like':'%'+_0x4fce66[_0xb5ab('0x27')]['filter']+'%'};return _0xba9417;}})});}_0x4d7335=_[_0xb5ab('0x33')]({},_0x4d7335,_0x4fce66[_0xb5ab('0x36')]);var _0x173982={'where':_0x4d7335[_0xb5ab('0x30')]};return db[_0xb5ab('0x24')]['count'](_0x173982)[_0xb5ab('0x1c')](function(_0x53f1f6){_0x24c0f6['count']=_0x53f1f6;if(_0x4fce66[_0xb5ab('0x27')][_0xb5ab('0x37')]){_0x4d7335[_0xb5ab('0x38')]=[{'all':!![]}];}return db['FaxQueueReport'][_0xb5ab('0x39')](_0x4d7335);})[_0xb5ab('0x1c')](function(_0x3b9814){_0x24c0f6[_0xb5ab('0x3a')]=_0x3b9814;return _0x24c0f6;})[_0xb5ab('0x1c')](respondWithFilteredResult(_0x4357cd,_0x4d7335))[_0xb5ab('0x3b')](handleError(_0x4357cd,null));};exports[_0xb5ab('0x3c')]=function(_0x3524a8,_0x293a7c){var _0x22690f={'raw':!![],'where':{'id':_0x3524a8[_0xb5ab('0x3d')]['id']}},_0x54a5e7={};_0x54a5e7[_0xb5ab('0x2a')]=_[_0xb5ab('0x3e')](db['FaxQueueReport']['rawAttributes']);_0x54a5e7[_0xb5ab('0x27')]=_[_0xb5ab('0x3e')](_0x3524a8[_0xb5ab('0x27')]);_0x54a5e7[_0xb5ab('0x28')]=_[_0xb5ab('0x29')](_0x54a5e7[_0xb5ab('0x2a')],_0x54a5e7['query']);_0x22690f[_0xb5ab('0x2b')]=_[_0xb5ab('0x29')](_0x54a5e7[_0xb5ab('0x2a')],qs['fields'](_0x3524a8[_0xb5ab('0x27')][_0xb5ab('0x2c')]));_0x22690f[_0xb5ab('0x2b')]=_0x22690f[_0xb5ab('0x2b')]['length']?_0x22690f[_0xb5ab('0x2b')]:_0x54a5e7['model'];if(_0x3524a8[_0xb5ab('0x27')]['includeAll']){_0x22690f[_0xb5ab('0x38')]=[{'all':!![]}];}_0x22690f=_[_0xb5ab('0x33')]({},_0x22690f,_0x3524a8[_0xb5ab('0x36')]);return db[_0xb5ab('0x24')][_0xb5ab('0x3f')](_0x22690f)[_0xb5ab('0x1c')](handleEntityNotFound(_0x293a7c,null))[_0xb5ab('0x1c')](respondWithResult(_0x293a7c,null))[_0xb5ab('0x3b')](handleError(_0x293a7c,null));};exports['create']=function(_0xb00c0d,_0x4482fd){return db[_0xb5ab('0x24')]['create'](_0xb00c0d[_0xb5ab('0x40')],{})[_0xb5ab('0x1c')](respondWithResult(_0x4482fd,0xc9))[_0xb5ab('0x3b')](handleError(_0x4482fd,null));};exports[_0xb5ab('0x41')]=function(_0x3d639a,_0x170493){if(_0x3d639a['body']['id']){delete _0x3d639a[_0xb5ab('0x40')]['id'];}return db[_0xb5ab('0x24')]['find']({'where':{'id':_0x3d639a['params']['id']}})[_0xb5ab('0x1c')](handleEntityNotFound(_0x170493,null))[_0xb5ab('0x1c')](saveUpdates(_0x3d639a[_0xb5ab('0x40')],null))[_0xb5ab('0x1c')](respondWithResult(_0x170493,null))[_0xb5ab('0x3b')](handleError(_0x170493,null));};exports[_0xb5ab('0x1d')]=function(_0x44b0ae,_0x35b23e){return db[_0xb5ab('0x24')][_0xb5ab('0x3f')]({'where':{'id':_0x44b0ae[_0xb5ab('0x3d')]['id']}})[_0xb5ab('0x1c')](handleEntityNotFound(_0x35b23e,null))[_0xb5ab('0x1c')](removeEntity(_0x35b23e,null))['catch'](handleError(_0x35b23e,null));};exports[_0xb5ab('0x42')]=function(_0x3f50c7,_0x3204a3){return db[_0xb5ab('0x24')][_0xb5ab('0x42')]()['then'](respondWithResult(_0x3204a3,null))[_0xb5ab('0x3b')](handleError(_0x3204a3,null));};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js
index a2819f9..1ff3516 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 _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
+var _0x80e0=['request-promise','path','rimraf','./faxQueueReport.attributes','exports','report_fax_queue','uniqueid','../../config/logger','api','moment'];(function(_0xda1f34,_0x9ef612){var _0x349f84=function(_0x1484a3){while(--_0x1484a3){_0xda1f34['push'](_0xda1f34['shift']());}};_0x349f84(++_0x9ef612);}(_0x80e0,0x9d));var _0x080e=function(_0x2b3a6b,_0x3cd8e7){_0x2b3a6b=_0x2b3a6b-0x0;var _0x3bd7ba=_0x80e0[_0x2b3a6b];return _0x3bd7ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x080e('0x0'))(_0x080e('0x1'));var moment=require(_0x080e('0x2'));var BPromise=require('bluebird');var rp=require(_0x080e('0x3'));var fs=require('fs');var path=require(_0x080e('0x4'));var rimraf=require(_0x080e('0x5'));var config=require('../../config/environment');var attributes=require(_0x080e('0x6'));module[_0x080e('0x7')]=function(_0x307481,_0x52548f){return _0x307481['define']('FaxQueueReport',attributes,{'tableName':_0x080e('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x080e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js
index f2c5aac..b59b48d 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 _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
+var _0x3f81=['message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','then','stringify','UpdateFaxQueueReport','attributes','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x23347e,_0x350e6c){var _0x24efed=function(_0x3ea5e2){while(--_0x3ea5e2){_0x23347e['push'](_0x23347e['shift']());}};_0x24efed(++_0x350e6c);}(_0x3f81,0x158));var _0x13f8=function(_0x36d8b2,_0x2b8810){_0x36d8b2=_0x36d8b2-0x0;var _0x43684b=_0x3f81[_0x36d8b2];return _0x43684b;};'use strict';var _=require(_0x13f8('0x0'));var util=require(_0x13f8('0x1'));var moment=require(_0x13f8('0x2'));var BPromise=require('bluebird');var rs=require(_0x13f8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x13f8('0x4'))['db'];var utils=require(_0x13f8('0x5'));var logger=require(_0x13f8('0x6'))(_0x13f8('0x7'));var config=require(_0x13f8('0x8'));var jayson=require(_0x13f8('0x9'));var client=jayson[_0x13f8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fcf2f,_0x3750ab,_0x59f5d6){return new BPromise(function(_0x566169,_0xd8ec8c){return client[_0x13f8('0xb')](_0x4fcf2f,_0x59f5d6)['then'](function(_0x3c5a52){logger[_0x13f8('0xc')](_0x13f8('0xd'),_0x3750ab,_0x13f8('0xe'));logger[_0x13f8('0xf')](_0x13f8('0x10'),_0x3750ab,_0x13f8('0xe'),JSON['stringify'](_0x3c5a52));if(_0x3c5a52[_0x13f8('0x11')]){if(_0x3c5a52[_0x13f8('0x11')][_0x13f8('0x12')]===0x1f4){logger[_0x13f8('0x11')](_0x13f8('0xd'),_0x3750ab,_0x3c5a52[_0x13f8('0x11')]['message']);return _0xd8ec8c(_0x3c5a52[_0x13f8('0x11')][_0x13f8('0x13')]);}logger['error'](_0x13f8('0xd'),_0x3750ab,_0x3c5a52[_0x13f8('0x11')][_0x13f8('0x13')]);return _0x566169(_0x3c5a52[_0x13f8('0x11')][_0x13f8('0x13')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x3750ab,_0x13f8('0xe'));_0x566169(_0x3c5a52[_0x13f8('0x14')][_0x13f8('0x13')]);}})[_0x13f8('0x15')](function(_0x2e54b2){logger[_0x13f8('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x3750ab,_0x2e54b2);_0xd8ec8c(_0x2e54b2);});});}exports[_0x13f8('0x16')]=function(_0x323533){var _0x1997cc=this;return new Promise(function(_0x5366e0,_0x5091e8){return db[_0x13f8('0x17')][_0x13f8('0x18')](_0x323533[_0x13f8('0x19')],{'raw':_0x323533[_0x13f8('0x1a')]?_0x323533[_0x13f8('0x1a')][_0x13f8('0x1b')]===undefined?!![]:![]:!![]})[_0x13f8('0x1c')](function(_0x2d989a){logger[_0x13f8('0xc')]('CreateFaxQueueReport',_0x323533);logger[_0x13f8('0xf')]('CreateFaxQueueReport',_0x323533,JSON[_0x13f8('0x1d')](_0x2d989a));_0x5366e0(_0x2d989a);})['catch'](function(_0x199b26){logger[_0x13f8('0x11')](_0x13f8('0x16'),_0x199b26[_0x13f8('0x13')],_0x323533);_0x5091e8(_0x1997cc[_0x13f8('0x11')](0x1f4,_0x199b26[_0x13f8('0x13')]));});});};exports[_0x13f8('0x1e')]=function(_0x2597f4){var _0x101759=this;return new Promise(function(_0x288f49,_0x4219cb){return db['FaxQueueReport']['update'](_0x2597f4[_0x13f8('0x19')],{'raw':_0x2597f4[_0x13f8('0x1a')]?_0x2597f4[_0x13f8('0x1a')][_0x13f8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2597f4[_0x13f8('0x1a')]?_0x2597f4['options']['where']||null:null,'attributes':_0x2597f4[_0x13f8('0x1a')]?_0x2597f4[_0x13f8('0x1a')][_0x13f8('0x1f')]||null:null,'limit':_0x2597f4[_0x13f8('0x1a')]?_0x2597f4['options'][_0x13f8('0x20')]||null:null})[_0x13f8('0x1c')](function(_0x2de30f){logger[_0x13f8('0xc')](_0x13f8('0x1e'),_0x2597f4);logger[_0x13f8('0xf')](_0x13f8('0x1e'),_0x2597f4,JSON[_0x13f8('0x1d')](_0x2de30f));_0x288f49(_0x2de30f);})[_0x13f8('0x15')](function(_0x404299){logger[_0x13f8('0x11')](_0x13f8('0x1e'),_0x404299[_0x13f8('0x13')],_0x2597f4);_0x4219cb(_0x101759[_0x13f8('0x11')](0x1f4,_0x404299[_0x13f8('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js
index f3e1ac1..20342ff 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 _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
+var _0xe4c0=['index','/describe','describe','/:id','show','create','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x2c0ef9,_0x519ca1){var _0x4b946e=function(_0x1084df){while(--_0x1084df){_0x2c0ef9['push'](_0x2c0ef9['shift']());}};_0x4b946e(++_0x519ca1);}(_0xe4c0,0xc5));var _0x0e4c=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0xe4c0[_0x478c8a];return _0x3b6b3e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0e4c('0x0'));var express=require(_0x0e4c('0x1'));var router=express[_0x0e4c('0x2')]();var auth=require(_0x0e4c('0x3'));var interaction=require(_0x0e4c('0x4'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0x0e4c('0x5')]('/',auth[_0x0e4c('0x6')](),controller[_0x0e4c('0x7')]);router[_0x0e4c('0x5')](_0x0e4c('0x8'),auth['isAuthenticated'](),controller[_0x0e4c('0x9')]);router['get'](_0x0e4c('0xa'),auth['isAuthenticated'](),controller[_0x0e4c('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0e4c('0xc')]);router['put'](_0x0e4c('0xa'),auth[_0x0e4c('0x6')](),controller[_0x0e4c('0xd')]);router[_0x0e4c('0xe')](_0x0e4c('0xa'),auth[_0x0e4c('0x6')](),controller[_0x0e4c('0xf')]);module[_0x0e4c('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js
index 73804fb..6c2ddc3 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 _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
+var _0x56ca=['DATE','exports','STRING','ENUM','account','agent','queue'];(function(_0x390556,_0x5b64bd){var _0x11868e=function(_0x51bf69){while(--_0x51bf69){_0x390556['push'](_0x390556['shift']());}};_0x11868e(++_0x5b64bd);}(_0x56ca,0x1f2));var _0xa56c=function(_0xddeebf,_0x51610b){_0xddeebf=_0xddeebf-0x0;var _0x4b9104=_0x56ca[_0xddeebf];return _0x4b9104;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xa56c('0x0')]={'uniqueid':{'type':Sequelize[_0xa56c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa56c('0x2')](_0xa56c('0x3'),_0xa56c('0x4'),'queue'),'allowNull':![],'defaultValue':_0xa56c('0x5')},'transferredAt':{'type':Sequelize[_0xa56c('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js
index f177627..354d592 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 _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
+var _0xdb28=['Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','options','where','count','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','offset','limit','set'];(function(_0xee7143,_0x1719ac){var _0x22f461=function(_0x1798fe){while(--_0x1798fe){_0xee7143['push'](_0xee7143['shift']());}};_0x22f461(++_0x1719ac);}(_0xdb28,0x106));var _0x8db2=function(_0x5bfc11,_0x573588){_0x5bfc11=_0x5bfc11-0x0;var _0x130f55=_0xdb28[_0x5bfc11];return _0x130f55;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var db=require(_0x8db2('0x17'))['db'];function respondWithStatusCode(_0x1349f6,_0x204f49){_0x204f49=_0x204f49||0xcc;return function(_0x37d017){if(_0x37d017){return _0x1349f6['sendStatus'](_0x204f49);}return _0x1349f6['status'](_0x204f49)[_0x8db2('0x18')]();};}function respondWithResult(_0x15e87c,_0x350d61){_0x350d61=_0x350d61||0xc8;return function(_0x1d6a15){if(_0x1d6a15){return _0x15e87c[_0x8db2('0x19')](_0x350d61)[_0x8db2('0x1a')](_0x1d6a15);}};}function respondWithFilteredResult(_0x2f177a,_0x3c96a7){return function(_0x131252){if(_0x131252){var _0x16c8c2=_0x131252['count'],_0x5489a9=_0x3c96a7[_0x8db2('0x1b')],_0x13b0f5=_0x3c96a7[_0x8db2('0x1b')]+_0x3c96a7[_0x8db2('0x1c')],_0x24da1b;if(_0x13b0f5>=_0x16c8c2){_0x13b0f5=_0x16c8c2;_0x24da1b=0xc8;}else{_0x24da1b=0xce;}_0x2f177a[_0x8db2('0x19')](_0x24da1b);return _0x2f177a[_0x8db2('0x1d')](_0x8db2('0x1e'),_0x5489a9+'-'+_0x13b0f5+'/'+_0x16c8c2)['json'](_0x131252);}return null;};}function patchUpdates(_0x5df464){return function(_0x77789){try{jsonpatch[_0x8db2('0x1f')](_0x77789,_0x5df464,!![]);}catch(_0x1310d3){return BPromise[_0x8db2('0x20')](_0x1310d3);}return _0x77789['save']();};}function saveUpdates(_0x431d60,_0x36a9ff){return function(_0x260940){if(_0x260940){return _0x260940[_0x8db2('0x21')](_0x431d60)[_0x8db2('0x22')](function(_0x597260){return _0x597260;});}return null;};}function removeEntity(_0x124467,_0x3e30e6){return function(_0x18f69c){if(_0x18f69c){return _0x18f69c[_0x8db2('0x23')]()[_0x8db2('0x22')](function(){_0x124467[_0x8db2('0x19')](0xcc)[_0x8db2('0x18')]();});}};}function handleEntityNotFound(_0x5c6614,_0x256202){return function(_0x4f6516){if(!_0x4f6516){_0x5c6614['sendStatus'](0x194);}return _0x4f6516;};}function handleError(_0x52a9ca,_0x4d923c){_0x4d923c=_0x4d923c||0x1f4;return function(_0xec8cd2){logger[_0x8db2('0x24')](_0xec8cd2[_0x8db2('0x25')]);if(_0xec8cd2[_0x8db2('0x26')]){delete _0xec8cd2[_0x8db2('0x26')];}_0x52a9ca[_0x8db2('0x19')](_0x4d923c)['send'](_0xec8cd2);};}exports[_0x8db2('0x27')]=function(_0x372311,_0x430dd5){var _0x8b7cec={},_0x483aee={},_0x2e0691={'count':0x0,'rows':[]};var _0x11f398=_[_0x8db2('0x28')](db[_0x8db2('0x29')][_0x8db2('0x2a')],function(_0x21bae5){return{'name':_0x21bae5[_0x8db2('0x2b')],'type':_0x21bae5[_0x8db2('0x2c')][_0x8db2('0x2d')]};});_0x483aee['model']=_[_0x8db2('0x28')](_0x11f398,'name');_0x483aee['query']=_[_0x8db2('0x2e')](_0x372311[_0x8db2('0x2f')]);_0x483aee[_0x8db2('0x30')]=_['intersection'](_0x483aee[_0x8db2('0x31')],_0x483aee['query']);_0x8b7cec[_0x8db2('0x32')]=_[_0x8db2('0x33')](_0x483aee[_0x8db2('0x31')],qs['fields'](_0x372311['query'][_0x8db2('0x34')]));_0x8b7cec[_0x8db2('0x32')]=_0x8b7cec['attributes']['length']?_0x8b7cec[_0x8db2('0x32')]:_0x483aee[_0x8db2('0x31')];if(!_0x372311[_0x8db2('0x2f')][_0x8db2('0x35')](_0x8db2('0x36'))){_0x8b7cec[_0x8db2('0x1c')]=qs[_0x8db2('0x1c')](_0x372311[_0x8db2('0x2f')][_0x8db2('0x1c')]);_0x8b7cec[_0x8db2('0x1b')]=qs['offset'](_0x372311[_0x8db2('0x2f')][_0x8db2('0x1b')]);}_0x8b7cec['order']=qs[_0x8db2('0x37')](_0x372311[_0x8db2('0x2f')]['sort']);_0x8b7cec['where']=qs[_0x8db2('0x30')](_['pick'](_0x372311[_0x8db2('0x2f')],_0x483aee[_0x8db2('0x30')]),_0x11f398);if(_0x372311[_0x8db2('0x2f')][_0x8db2('0x38')]){_0x8b7cec['where']=_[_0x8db2('0x39')](_0x8b7cec['where'],{'$or':_[_0x8db2('0x28')](_0x11f398,function(_0xd550ae){if(_0xd550ae[_0x8db2('0x2c')]!==_0x8db2('0x3a')){var _0x50e88a={};_0x50e88a[_0xd550ae['name']]={'$like':'%'+_0x372311[_0x8db2('0x2f')][_0x8db2('0x38')]+'%'};return _0x50e88a;}})});}_0x8b7cec=_['merge']({},_0x8b7cec,_0x372311[_0x8db2('0x3b')]);var _0x24bcfe={'where':_0x8b7cec[_0x8db2('0x3c')]};return db['FaxTransferReport'][_0x8db2('0x3d')](_0x24bcfe)[_0x8db2('0x22')](function(_0x953349){_0x2e0691[_0x8db2('0x3d')]=_0x953349;if(_0x372311[_0x8db2('0x2f')][_0x8db2('0x3e')]){_0x8b7cec[_0x8db2('0x3f')]=[{'all':!![]}];}return db[_0x8db2('0x29')][_0x8db2('0x40')](_0x8b7cec);})[_0x8db2('0x22')](function(_0x21cf7c){_0x2e0691[_0x8db2('0x41')]=_0x21cf7c;return _0x2e0691;})[_0x8db2('0x22')](respondWithFilteredResult(_0x430dd5,_0x8b7cec))['catch'](handleError(_0x430dd5,null));};exports[_0x8db2('0x42')]=function(_0x2b2472,_0x5e0382){var _0x49a7ae={'raw':!![],'where':{'id':_0x2b2472['params']['id']}},_0x249c73={};_0x249c73[_0x8db2('0x31')]=_[_0x8db2('0x2e')](db[_0x8db2('0x29')][_0x8db2('0x2a')]);_0x249c73[_0x8db2('0x2f')]=_[_0x8db2('0x2e')](_0x2b2472[_0x8db2('0x2f')]);_0x249c73['filters']=_[_0x8db2('0x33')](_0x249c73[_0x8db2('0x31')],_0x249c73[_0x8db2('0x2f')]);_0x49a7ae[_0x8db2('0x32')]=_['intersection'](_0x249c73[_0x8db2('0x31')],qs[_0x8db2('0x34')](_0x2b2472[_0x8db2('0x2f')][_0x8db2('0x34')]));_0x49a7ae['attributes']=_0x49a7ae[_0x8db2('0x32')]['length']?_0x49a7ae[_0x8db2('0x32')]:_0x249c73[_0x8db2('0x31')];if(_0x2b2472[_0x8db2('0x2f')]['includeAll']){_0x49a7ae['include']=[{'all':!![]}];}_0x49a7ae=_[_0x8db2('0x39')]({},_0x49a7ae,_0x2b2472['options']);return db[_0x8db2('0x29')][_0x8db2('0x43')](_0x49a7ae)[_0x8db2('0x22')](handleEntityNotFound(_0x5e0382,null))[_0x8db2('0x22')](respondWithResult(_0x5e0382,null))[_0x8db2('0x44')](handleError(_0x5e0382,null));};exports[_0x8db2('0x45')]=function(_0x4355e2,_0xab6bdd){return db[_0x8db2('0x29')][_0x8db2('0x45')](_0x4355e2[_0x8db2('0x46')],{})[_0x8db2('0x22')](respondWithResult(_0xab6bdd,0xc9))['catch'](handleError(_0xab6bdd,null));};exports[_0x8db2('0x21')]=function(_0x2ada52,_0xdbba64){if(_0x2ada52[_0x8db2('0x46')]['id']){delete _0x2ada52['body']['id'];}return db['FaxTransferReport'][_0x8db2('0x43')]({'where':{'id':_0x2ada52[_0x8db2('0x47')]['id']}})[_0x8db2('0x22')](handleEntityNotFound(_0xdbba64,null))['then'](saveUpdates(_0x2ada52['body'],null))['then'](respondWithResult(_0xdbba64,null))[_0x8db2('0x44')](handleError(_0xdbba64,null));};exports[_0x8db2('0x23')]=function(_0x55c7dd,_0x383fa1){return db[_0x8db2('0x29')][_0x8db2('0x43')]({'where':{'id':_0x55c7dd[_0x8db2('0x47')]['id']}})['then'](handleEntityNotFound(_0x383fa1,null))['then'](removeEntity(_0x383fa1,null))[_0x8db2('0x44')](handleError(_0x383fa1,null));};exports[_0x8db2('0x48')]=function(_0x2908e4,_0x2f0bd0){return db[_0x8db2('0x29')][_0x8db2('0x48')]()[_0x8db2('0x22')](respondWithResult(_0x2f0bd0,null))[_0x8db2('0x44')](handleError(_0x2f0bd0,null));};
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js
index 9181526..433b2eb 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 _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
+var _0x2e3a=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2e3a,0x145));var _0xa2e3=function(_0x259153,_0x4ff2aa){_0x259153=_0x259153-0x0;var _0x4dfa06=_0x2e3a[_0x259153];return _0x4dfa06;};'use strict';var _=require(_0xa2e3('0x0'));var util=require('util');var logger=require(_0xa2e3('0x1'))('api');var moment=require(_0xa2e3('0x2'));var BPromise=require(_0xa2e3('0x3'));var rp=require(_0xa2e3('0x4'));var fs=require('fs');var path=require(_0xa2e3('0x5'));var rimraf=require(_0xa2e3('0x6'));var config=require(_0xa2e3('0x7'));var attributes=require(_0xa2e3('0x8'));module[_0xa2e3('0x9')]=function(_0x43226f,_0x2237f1){return _0x43226f[_0xa2e3('0xa')](_0xa2e3('0xb'),attributes,{'tableName':_0xa2e3('0xc'),'paranoid':![],'indexes':[{'name':_0xa2e3('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js
index 726af44..e76d7cb 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 _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
+var _0xd309=['FaxTransferReport,\x20%s,\x20%s,\x20%s','error','message','FaxTransferReport,\x20%s,\x20%s','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug'];(function(_0x32c5bc,_0x2afe0c){var _0x8c5cf6=function(_0xc89ba8){while(--_0xc89ba8){_0x32c5bc['push'](_0x32c5bc['shift']());}};_0x8c5cf6(++_0x2afe0c);}(_0xd309,0x75));var _0x9d30=function(_0x35f513,_0xec7d83){_0x35f513=_0x35f513-0x0;var _0x195766=_0xd309[_0x35f513];return _0x195766;};'use strict';var _=require(_0x9d30('0x0'));var util=require(_0x9d30('0x1'));var moment=require('moment');var BPromise=require(_0x9d30('0x2'));var rs=require(_0x9d30('0x3'));var fs=require('fs');var Redis=require(_0x9d30('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d30('0x5'));var logger=require(_0x9d30('0x6'))('rpc');var config=require(_0x9d30('0x7'));var jayson=require(_0x9d30('0x8'));var client=jayson[_0x9d30('0x9')][_0x9d30('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x569543,_0x2ef59a,_0x2c3088){return new BPromise(function(_0x1976d1,_0x454b84){return client[_0x9d30('0xb')](_0x569543,_0x2c3088)[_0x9d30('0xc')](function(_0x54c5ad){logger[_0x9d30('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x2ef59a,'request\x20sent');logger[_0x9d30('0xe')](_0x9d30('0xf'),_0x2ef59a,'request\x20sent',JSON['stringify'](_0x54c5ad));if(_0x54c5ad[_0x9d30('0x10')]){if(_0x54c5ad['error']['code']===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x2ef59a,_0x54c5ad[_0x9d30('0x10')][_0x9d30('0x11')]);return _0x454b84(_0x54c5ad[_0x9d30('0x10')]['message']);}logger[_0x9d30('0x10')](_0x9d30('0x12'),_0x2ef59a,_0x54c5ad[_0x9d30('0x10')][_0x9d30('0x11')]);return _0x1976d1(_0x54c5ad[_0x9d30('0x10')][_0x9d30('0x11')]);}else{logger[_0x9d30('0xd')](_0x9d30('0x12'),_0x2ef59a,_0x9d30('0x13'));_0x1976d1(_0x54c5ad[_0x9d30('0x14')][_0x9d30('0x11')]);}})[_0x9d30('0x15')](function(_0x58d1c5){logger[_0x9d30('0x10')](_0x9d30('0x12'),_0x2ef59a,_0x58d1c5);_0x454b84(_0x58d1c5);});});}
\ No newline at end of file
diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js
index ad61321..e46d875 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 _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
+var _0x6b6f=['../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b6f,0x12a));var _0xf6b6=function(_0x3a10bb,_0x5706e8){_0x3a10bb=_0x3a10bb-0x0;var _0x2ebe30=_0x6b6f[_0x3a10bb];return _0x2ebe30;};'use strict';var multer=require(_0xf6b6('0x0'));var util=require(_0xf6b6('0x1'));var path=require(_0xf6b6('0x2'));var timeout=require(_0xf6b6('0x3'));var express=require(_0xf6b6('0x4'));var router=express['Router']();var auth=require(_0xf6b6('0x5'));var interaction=require(_0xf6b6('0x6'));var config=require('../../config/environment');var controller=require(_0xf6b6('0x7'));router[_0xf6b6('0x8')]('/',auth[_0xf6b6('0x9')](),controller[_0xf6b6('0xa')]);router[_0xf6b6('0x8')](_0xf6b6('0xb'),auth['isAuthenticated'](),controller[_0xf6b6('0xc')]);router[_0xf6b6('0x8')](_0xf6b6('0xd'),auth['isAuthenticated'](),controller[_0xf6b6('0xe')]);router[_0xf6b6('0xf')]('/',auth[_0xf6b6('0x9')](),controller['create']);router[_0xf6b6('0x10')](_0xf6b6('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xf6b6('0x11')](_0xf6b6('0xd'),auth[_0xf6b6('0x9')](),controller['destroy']);module[_0xf6b6('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js
index a1059a6..9e85604 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 _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
+var _0x1af3=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x588932,_0x1ae423){var _0x307e46=function(_0x35771f){while(--_0x35771f){_0x588932['push'](_0x588932['shift']());}};_0x307e46(++_0x1ae423);}(_0x1af3,0x1ca));var _0x31af=function(_0x2e4cbf,_0x8763d3){_0x2e4cbf=_0x2e4cbf-0x0;var _0x52840f=_0x1af3[_0x2e4cbf];return _0x52840f;};'use strict';var multer=require(_0x31af('0x0'));var util=require(_0x31af('0x1'));var path=require(_0x31af('0x2'));var timeout=require(_0x31af('0x3'));var express=require(_0x31af('0x4'));var router=express[_0x31af('0x5')]();var auth=require(_0x31af('0x6'));var interaction=require(_0x31af('0x7'));var config=require(_0x31af('0x8'));var controller=require(_0x31af('0x9'));router['get']('/',auth[_0x31af('0xa')](),controller[_0x31af('0xb')]);router[_0x31af('0xc')](_0x31af('0xd'),auth['isAuthenticated'](),controller[_0x31af('0xe')]);router[_0x31af('0xc')](_0x31af('0xf'),auth['isAuthenticated'](),controller[_0x31af('0x10')]);router[_0x31af('0xc')](_0x31af('0x11'),auth[_0x31af('0xa')](),controller[_0x31af('0x12')]);router[_0x31af('0x13')]('/',auth[_0x31af('0xa')](),controller[_0x31af('0x14')]);router['post'](_0x31af('0xf'),auth[_0x31af('0xa')](),controller[_0x31af('0x15')]);router[_0x31af('0x16')](_0x31af('0xd'),auth['isAuthenticated'](),controller[_0x31af('0x17')]);router[_0x31af('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x31af('0x19')]);module[_0x31af('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js
index 925bfa0..72c6370 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 _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
+var _0xef52=['sequelize','exports','STRING','basic','ENUM','integrationTab','newTab'];(function(_0x25545f,_0x6f9bab){var _0x18856d=function(_0x299117){while(--_0x299117){_0x25545f['push'](_0x25545f['shift']());}};_0x18856d(++_0x6f9bab);}(_0xef52,0x126));var _0x2ef5=function(_0x1d5458,_0x3acf09){_0x1d5458=_0x1d5458-0x0;var _0x9bf6f=_0xef52[_0x1d5458];return _0x9bf6f;};'use strict';var Sequelize=require(_0x2ef5('0x0'));module[_0x2ef5('0x1')]={'name':{'type':Sequelize[_0x2ef5('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2ef5('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x2ef5('0x3')),'defaultValue':_0x2ef5('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x2ef5('0x2')]},'token':{'type':Sequelize[_0x2ef5('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2ef5('0x4')](_0x2ef5('0x5'),_0x2ef5('0x6')),'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 90fcbed..6528852 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 _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
+var _0x4474=['Basic\x20%s','%s:%s','password','toString','base64','concat','_embedded','entries','active','label','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','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','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','DeskAccount','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','DeskConfiguration','rawAttributes','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','DeskField','getFields','priority','remoteUri','authType','username','consumerSecret','token','tokenSecret','GET','format','application/json','basic','headers','Authorization'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x4474,0x8b));var _0x4447=function(_0x371f33,_0x278a69){_0x371f33=_0x371f33-0x0;var _0x246c96=_0x4474[_0x371f33];return _0x246c96;};'use strict';var pdf=require(_0x4447('0x0'));var emlformat=require(_0x4447('0x1'));var rimraf=require(_0x4447('0x2'));var zipdir=require(_0x4447('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4447('0x4'));var moment=require('moment');var BPromise=require(_0x4447('0x5'));var Mustache=require(_0x4447('0x6'));var util=require(_0x4447('0x7'));var path=require(_0x4447('0x8'));var sox=require(_0x4447('0x9'));var csv=require('to-csv');var ejs=require(_0x4447('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4447('0xb'));var jsforce=require(_0x4447('0xc'));var deskjs=require(_0x4447('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4447('0xe'));var Papa=require(_0x4447('0xf'));var Redis=require('ioredis');var authService=require(_0x4447('0x10'));var qs=require(_0x4447('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4447('0x12'));var logger=require(_0x4447('0x13'))(_0x4447('0x14'));var utils=require(_0x4447('0x15'));var config=require(_0x4447('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x4447('0x17'));var client=jayson[_0x4447('0x18')][_0x4447('0x19')]({'port':0x232a});function checkPasswordPattern(_0x139e0d,_0x489a64,_0x19ceb7){if(_0x19ceb7){var _0x365b24=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x365b24[_0x4447('0x1a')](_0x489a64)){return _0x139e0d;}else{throw new db[(_0x4447('0x1b'))]['ValidationError'](_0x4447('0x1c'));}}else{return _0x139e0d;}}function respondWithRpcPromise(_0xa23cfb,_0x409e9a,_0x1f1d10,_0x30cf84){return new BPromise(function(_0x1eeb82,_0x572b05){var _0x4ff95b=_0x30cf84||client;return _0x4ff95b[_0x4447('0x1d')](_0xa23cfb,_0x1f1d10)[_0x4447('0x1e')](function(_0x14ffb0){logger['info'](_0x4447('0x1f'),_0x409e9a,_0x4447('0x20'));logger[_0x4447('0x21')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x409e9a,'request\x20sent',JSON[_0x4447('0x22')](_0x14ffb0));if(_0x14ffb0[_0x4447('0x23')]){if(_0x14ffb0['error'][_0x4447('0x24')]===0x1f4){logger[_0x4447('0x23')](_0x4447('0x1f'),_0x409e9a,_0x14ffb0[_0x4447('0x23')]['message']);return _0x572b05(_0x14ffb0[_0x4447('0x23')]['message']);}logger[_0x4447('0x23')]('DeskAccount,\x20%s,\x20%s',_0x409e9a,_0x14ffb0['error'][_0x4447('0x25')]);return _0x1eeb82(_0x14ffb0[_0x4447('0x23')][_0x4447('0x25')]);}else{logger[_0x4447('0x26')]('DeskAccount,\x20%s,\x20%s',_0x409e9a,_0x4447('0x20'));_0x1eeb82(_0x14ffb0[_0x4447('0x27')][_0x4447('0x25')]);}})[_0x4447('0x28')](function(_0x33b35c){logger['error']('DeskAccount,\x20%s,\x20%s',_0x409e9a,_0x33b35c);_0x572b05(_0x33b35c);});});}function respondWithStatusCode(_0x389a1e,_0x213a10){_0x213a10=_0x213a10||0xcc;return function(_0x320b0b){if(_0x320b0b){return _0x389a1e[_0x4447('0x29')](_0x213a10);}return _0x389a1e['status'](_0x213a10)[_0x4447('0x2a')]();};}function respondWithResult(_0x489b95,_0x162540){_0x162540=_0x162540||0xc8;return function(_0x145a7e){if(_0x145a7e){return _0x489b95[_0x4447('0x2b')](_0x162540)[_0x4447('0x2c')](_0x145a7e);}};}function respondWithFilteredResult(_0x32ed13,_0x9731b4){return function(_0x421351){if(_0x421351){var _0x20866e=_0x421351['count'],_0x5e2e2b=_0x9731b4[_0x4447('0x2d')],_0x16da61=_0x9731b4[_0x4447('0x2d')]+_0x9731b4[_0x4447('0x2e')],_0x4767f4;if(_0x16da61>=_0x20866e){_0x16da61=_0x20866e;_0x4767f4=0xc8;}else{_0x4767f4=0xce;}_0x32ed13[_0x4447('0x2b')](_0x4767f4);return _0x32ed13[_0x4447('0x2f')](_0x4447('0x30'),_0x5e2e2b+'-'+_0x16da61+'/'+_0x20866e)['json'](_0x421351);}return null;};}function patchUpdates(_0x3636dd){return function(_0x4369e0){try{jsonpatch[_0x4447('0x31')](_0x4369e0,_0x3636dd,!![]);}catch(_0x3f72a1){return BPromise[_0x4447('0x32')](_0x3f72a1);}return _0x4369e0[_0x4447('0x33')]();};}function saveUpdates(_0x3ae99d,_0x3e2aff){return function(_0x257481){if(_0x257481){return _0x257481[_0x4447('0x34')](_0x3ae99d)[_0x4447('0x1e')](function(_0x10c4ed){return _0x10c4ed;});}return null;};}function removeEntity(_0x13afe1,_0x2e5d6a){return function(_0x3b9e8f){if(_0x3b9e8f){return _0x3b9e8f[_0x4447('0x35')]()['then'](function(){_0x13afe1[_0x4447('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10ad03,_0x28660c){return function(_0x2fca38){if(!_0x2fca38){_0x10ad03['sendStatus'](0x194);}return _0x2fca38;};}function handleError(_0x2f9b52,_0x3bbe7){_0x3bbe7=_0x3bbe7||0x1f4;return function(_0xa4904){logger[_0x4447('0x23')](_0xa4904[_0x4447('0x36')]);if(_0xa4904[_0x4447('0x37')]){delete _0xa4904['name'];}_0x2f9b52[_0x4447('0x2b')](_0x3bbe7)[_0x4447('0x38')](_0xa4904);};}exports['index']=function(_0x47f186,_0x3af59b){var _0x4fe11a={},_0x459912={},_0x44eb97={'count':0x0,'rows':[]};var _0x220f50=_[_0x4447('0x39')](db[_0x4447('0x3a')]['rawAttributes'],function(_0x5aafed){return{'name':_0x5aafed[_0x4447('0x3b')],'type':_0x5aafed[_0x4447('0x3c')][_0x4447('0x3d')]};});_0x459912[_0x4447('0x3e')]=_[_0x4447('0x39')](_0x220f50,_0x4447('0x37'));_0x459912['query']=_[_0x4447('0x3f')](_0x47f186[_0x4447('0x40')]);_0x459912[_0x4447('0x41')]=_[_0x4447('0x42')](_0x459912[_0x4447('0x3e')],_0x459912[_0x4447('0x40')]);_0x4fe11a[_0x4447('0x43')]=_['intersection'](_0x459912[_0x4447('0x3e')],qs[_0x4447('0x44')](_0x47f186[_0x4447('0x40')][_0x4447('0x44')]));_0x4fe11a['attributes']=_0x4fe11a['attributes'][_0x4447('0x45')]?_0x4fe11a[_0x4447('0x43')]:_0x459912[_0x4447('0x3e')];if(!_0x47f186[_0x4447('0x40')]['hasOwnProperty'](_0x4447('0x46'))){_0x4fe11a['limit']=qs[_0x4447('0x2e')](_0x47f186[_0x4447('0x40')][_0x4447('0x2e')]);_0x4fe11a['offset']=qs[_0x4447('0x2d')](_0x47f186[_0x4447('0x40')][_0x4447('0x2d')]);}_0x4fe11a[_0x4447('0x47')]=qs[_0x4447('0x48')](_0x47f186[_0x4447('0x40')][_0x4447('0x48')]);_0x4fe11a[_0x4447('0x49')]=qs['filters'](_[_0x4447('0x4a')](_0x47f186[_0x4447('0x40')],_0x459912[_0x4447('0x41')]),_0x220f50);if(_0x47f186[_0x4447('0x40')][_0x4447('0x4b')]){_0x4fe11a[_0x4447('0x49')]=_['merge'](_0x4fe11a[_0x4447('0x49')],{'$or':_['map'](_0x220f50,function(_0x37042c){if(_0x37042c['type']!==_0x4447('0x4c')){var _0x408382={};_0x408382[_0x37042c[_0x4447('0x37')]]={'$like':'%'+_0x47f186['query']['filter']+'%'};return _0x408382;}})});}_0x4fe11a=_[_0x4447('0x4d')]({},_0x4fe11a,_0x47f186[_0x4447('0x4e')]);var _0x285377={'where':_0x4fe11a[_0x4447('0x49')]};return db[_0x4447('0x3a')][_0x4447('0x4f')](_0x285377)['then'](function(_0x492a2d){_0x44eb97[_0x4447('0x4f')]=_0x492a2d;if(_0x47f186['query'][_0x4447('0x50')]){_0x4fe11a[_0x4447('0x51')]=[{'all':!![]}];}return db[_0x4447('0x3a')][_0x4447('0x52')](_0x4fe11a);})[_0x4447('0x1e')](function(_0x26ccd4){_0x44eb97[_0x4447('0x53')]=_0x26ccd4;return _0x44eb97;})[_0x4447('0x1e')](respondWithFilteredResult(_0x3af59b,_0x4fe11a))[_0x4447('0x28')](handleError(_0x3af59b,null));};exports[_0x4447('0x54')]=function(_0xdd39f5,_0xdba79f){var _0x27a30f={'raw':![],'where':{'id':_0xdd39f5[_0x4447('0x55')]['id']}},_0x575a49={};_0x575a49[_0x4447('0x3e')]=_[_0x4447('0x3f')](db[_0x4447('0x3a')]['rawAttributes']);_0x575a49[_0x4447('0x40')]=_['keys'](_0xdd39f5[_0x4447('0x40')]);_0x575a49[_0x4447('0x41')]=_['intersection'](_0x575a49[_0x4447('0x3e')],_0x575a49['query']);_0x27a30f[_0x4447('0x43')]=_[_0x4447('0x42')](_0x575a49['model'],qs[_0x4447('0x44')](_0xdd39f5[_0x4447('0x40')][_0x4447('0x44')]));_0x27a30f['attributes']=_0x27a30f['attributes'][_0x4447('0x45')]?_0x27a30f[_0x4447('0x43')]:_0x575a49[_0x4447('0x3e')];if(_0xdd39f5[_0x4447('0x40')][_0x4447('0x50')]){_0x27a30f['include']=[{'all':!![]}];}_0x27a30f=_[_0x4447('0x4d')]({},_0x27a30f,_0xdd39f5[_0x4447('0x4e')]);return db[_0x4447('0x3a')][_0x4447('0x56')](_0x27a30f)[_0x4447('0x1e')](handleEntityNotFound(_0xdba79f,null))['then'](respondWithResult(_0xdba79f,null))[_0x4447('0x28')](handleError(_0xdba79f,null));};exports[_0x4447('0x57')]=function(_0x68f876,_0x4c10ed){return db[_0x4447('0x3a')][_0x4447('0x57')](_0x68f876[_0x4447('0x58')],{})[_0x4447('0x1e')](respondWithResult(_0x4c10ed,0xc9))[_0x4447('0x28')](handleError(_0x4c10ed,null));};exports[_0x4447('0x34')]=function(_0x5c0d24,_0x1679db){if(_0x5c0d24['body']['id']){delete _0x5c0d24[_0x4447('0x58')]['id'];}return db['DeskAccount'][_0x4447('0x56')]({'where':{'id':_0x5c0d24[_0x4447('0x55')]['id']}})['then'](handleEntityNotFound(_0x1679db,null))[_0x4447('0x1e')](saveUpdates(_0x5c0d24[_0x4447('0x58')],null))[_0x4447('0x1e')](respondWithResult(_0x1679db,null))['catch'](handleError(_0x1679db,null));};exports['destroy']=function(_0x1b822d,_0x11907d){return db[_0x4447('0x3a')][_0x4447('0x56')]({'where':{'id':_0x1b822d['params']['id']}})['then'](handleEntityNotFound(_0x11907d,null))[_0x4447('0x1e')](removeEntity(_0x11907d,null))[_0x4447('0x28')](handleError(_0x11907d,null));};exports[_0x4447('0x59')]=function(_0x1b06a9,_0x1bf9db,_0x90f8d3){var _0x1d15b1={};var _0x472eae={};var _0xf29da5;var _0x579ab2;return db['DeskAccount'][_0x4447('0x5a')]({'where':{'id':_0x1b06a9[_0x4447('0x55')]['id']}})[_0x4447('0x1e')](handleEntityNotFound(_0x1bf9db,null))[_0x4447('0x1e')](function(_0x3cd23e){if(_0x3cd23e){_0xf29da5=_0x3cd23e;_0x472eae['model']=_['keys'](db[_0x4447('0x5b')][_0x4447('0x5c')]);_0x472eae[_0x4447('0x40')]=_[_0x4447('0x3f')](_0x1b06a9[_0x4447('0x40')]);_0x472eae['filters']=_[_0x4447('0x42')](_0x472eae[_0x4447('0x3e')],_0x472eae[_0x4447('0x40')]);_0x1d15b1[_0x4447('0x43')]=_[_0x4447('0x42')](_0x472eae['model'],qs[_0x4447('0x44')](_0x1b06a9[_0x4447('0x40')][_0x4447('0x44')]));_0x1d15b1[_0x4447('0x43')]=_0x1d15b1['attributes'][_0x4447('0x45')]?_0x1d15b1[_0x4447('0x43')]:_0x472eae[_0x4447('0x3e')];_0x1d15b1[_0x4447('0x47')]=qs[_0x4447('0x48')](_0x1b06a9[_0x4447('0x40')]['sort']);_0x1d15b1[_0x4447('0x49')]=qs['filters'](_['pick'](_0x1b06a9['query'],_0x472eae[_0x4447('0x41')]));if(_0x1b06a9[_0x4447('0x40')]['filter']){_0x1d15b1[_0x4447('0x49')]=_[_0x4447('0x4d')](_0x1d15b1[_0x4447('0x49')],{'$or':_[_0x4447('0x39')](_0x1d15b1[_0x4447('0x43')],function(_0x3a8a3b){var _0xa2398e={};_0xa2398e[_0x3a8a3b]={'$like':'%'+_0x1b06a9[_0x4447('0x40')][_0x4447('0x4b')]+'%'};return _0xa2398e;})});}_0x1d15b1=_[_0x4447('0x4d')]({},_0x1d15b1,_0x1b06a9[_0x4447('0x4e')]);return _0xf29da5[_0x4447('0x59')](_0x1d15b1);}})['then'](function(_0x174eeb){if(_0x174eeb){_0x579ab2=_0x174eeb[_0x4447('0x45')];if(!_0x1b06a9[_0x4447('0x40')][_0x4447('0x5d')]('nolimit')){_0x1d15b1[_0x4447('0x2e')]=qs[_0x4447('0x2e')](_0x1b06a9[_0x4447('0x40')][_0x4447('0x2e')]);_0x1d15b1[_0x4447('0x2d')]=qs[_0x4447('0x2d')](_0x1b06a9[_0x4447('0x40')][_0x4447('0x2d')]);}return _0xf29da5[_0x4447('0x59')](_0x1d15b1);}})[_0x4447('0x1e')](function(_0x39454c){if(_0x39454c){return _0x39454c?{'count':_0x579ab2,'rows':_0x39454c}:null;}})[_0x4447('0x1e')](respondWithResult(_0x1bf9db,null))[_0x4447('0x28')](handleError(_0x1bf9db,null));};exports[_0x4447('0x5e')]=function(_0x110198,_0x26a53f,_0x50791c){if(_0x110198[_0x4447('0x58')]['id']){delete _0x110198[_0x4447('0x58')]['id'];}return db[_0x4447('0x3a')]['findOne']({'where':{'id':_0x110198[_0x4447('0x55')]['id']}})['then'](handleEntityNotFound(_0x26a53f,null))[_0x4447('0x1e')](function(_0x44ce64){if(_0x44ce64){_0x110198[_0x4447('0x58')][_0x4447('0x5f')]=_0x44ce64['id'];_0x110198[_0x4447('0x58')][_0x4447('0x60')]=integrations[_0x4447('0x61')](_0x110198['body']['channel'],_0x110198['body'][_0x4447('0x3c')]);_0x110198[_0x4447('0x58')][_0x4447('0x62')]=integrations['getDescriptions'](_0x110198[_0x4447('0x58')][_0x4447('0x63')],_0x110198[_0x4447('0x58')][_0x4447('0x3c')]);return db[_0x4447('0x5b')][_0x4447('0x57')](_0x110198['body'],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0x4447('0x64')],'as':'Descriptions'}]});}return null;})[_0x4447('0x1e')](respondWithResult(_0x26a53f,null))['catch'](handleError(_0x26a53f,null));};exports[_0x4447('0x65')]=function(_0x5a7cc2,_0x41cad3,_0x43fb8c){var _0x29bb03=[{'name':_0x4447('0x66'),'label':_0x4447('0x66'),'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 _0x594cc9='';return db['DeskAccount'][_0x4447('0x5a')]({'where':{'id':_0x5a7cc2[_0x4447('0x55')]['id']},'attributes':['id',_0x4447('0x67'),_0x4447('0x68'),_0x4447('0x69'),'password','consumerKey',_0x4447('0x6a'),_0x4447('0x6b'),_0x4447('0x6c')]})['then'](handleEntityNotFound(_0x41cad3,null))[_0x4447('0x1e')](function(_0x5c9045){if(_0x5c9045){_0x594cc9=_0x5c9045[_0x4447('0x67')];var _0x375152=_0x594cc9['slice'](-0x1);if(_0x375152==='/'){_0x594cc9=_0x594cc9['substring'](0x0,_0x594cc9['lastIndexOf'](_0x375152));}var _0x41d00d={'method':_0x4447('0x6d'),'uri':util[_0x4447('0x6e')]('%s/custom_fields',_0x594cc9),'headers':{'Content-Type':_0x4447('0x6f'),'Accept':_0x4447('0x6f')},'json':!![]};if(_0x5c9045[_0x4447('0x68')]===_0x4447('0x70')){_0x41d00d[_0x4447('0x71')][_0x4447('0x72')]=util[_0x4447('0x6e')](_0x4447('0x73'),new Buffer(util[_0x4447('0x6e')](_0x4447('0x74'),_0x5c9045['username'],_0x5c9045[_0x4447('0x75')]))[_0x4447('0x76')](_0x4447('0x77')));}return rp(_0x41d00d)[_0x4447('0x1e')](function(_0x367089){return _0x29bb03[_0x4447('0x78')](_[_0x4447('0x39')](_0x367089[_0x4447('0x79')][_0x4447('0x7a')],function(_0x214ea2){return{'id':_0x214ea2[_0x4447('0x37')],'name':_0x214ea2['name'],'type':_0x214ea2[_0x4447('0x3c')],'active':_0x214ea2[_0x4447('0x7b')],'label':_0x214ea2[_0x4447('0x7c')],'custom':!![]};}));});}})[_0x4447('0x1e')](function(_0x23b081){return{'count':_0x23b081['length'],'rows':_0x23b081};})['then'](respondWithResult(_0x41cad3,null))[_0x4447('0x28')](function(_0x5af81d){var _0x5d53e5=_0x5a7cc2[_0x4447('0x40')][_0x4447('0x1a')]?0x1f4:_0x5af81d['statusCode']||0x1f4;logger[_0x4447('0x23')](_0x4447('0x7d'),_0x4447('0x65'),_0x5d53e5,JSON['stringify'](_0x5af81d));delete _0x5af81d['name'];if(_0x5d53e5===0x191){_0x5d53e5=0x190;}_0x41cad3[_0x4447('0x2b')](_0x5d53e5)[_0x4447('0x38')](_0x5a7cc2[_0x4447('0x40')][_0x4447('0x1a')]?{'message':_0x4447('0x7e'),'statusCode':_0x5af81d['statusCode']}:_0x5af81d);});};
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js
index f527903..cbdd192 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 _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
+var _0x17f5=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x39d5b5,_0x534ec9){var _0x19ade3=function(_0x5611ea){while(--_0x5611ea){_0x39d5b5['push'](_0x39d5b5['shift']());}};_0x19ade3(++_0x534ec9);}(_0x17f5,0xaf));var _0x517f=function(_0x20f1ec,_0x1ab353){_0x20f1ec=_0x20f1ec-0x0;var _0x1565f6=_0x17f5[_0x20f1ec];return _0x1565f6;};'use strict';var _=require(_0x517f('0x0'));var util=require(_0x517f('0x1'));var logger=require(_0x517f('0x2'))(_0x517f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x517f('0x4'));var fs=require('fs');var path=require(_0x517f('0x5'));var rimraf=require(_0x517f('0x6'));var config=require(_0x517f('0x7'));var attributes=require(_0x517f('0x8'));var integrations=require(_0x517f('0x9'));module[_0x517f('0xa')]=function(_0x541389,_0x25bca2){return _0x541389[_0x517f('0xb')](_0x517f('0xc'),attributes,{'tableName':_0x517f('0xd'),'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 1083cbc..1cf7a5d 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 _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
+var _0xa079=['map','model','GetDeskAccount','ShowDeskAccount','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','DeskAccount','findAll','options','where','attributes','limit','include'];(function(_0x49c46e,_0x4c7335){var _0x2cfb73=function(_0xe00313){while(--_0xe00313){_0x49c46e['push'](_0x49c46e['shift']());}};_0x2cfb73(++_0x4c7335);}(_0xa079,0x12e));var _0x9a07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa079[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9a07('0x0'));var util=require('util');var moment=require(_0x9a07('0x1'));var BPromise=require(_0x9a07('0x2'));var rs=require(_0x9a07('0x3'));var fs=require('fs');var Redis=require(_0x9a07('0x4'));var db=require(_0x9a07('0x5'))['db'];var utils=require(_0x9a07('0x6'));var logger=require('../../config/logger')(_0x9a07('0x7'));var config=require('../../config/environment');var jayson=require(_0x9a07('0x8'));var client=jayson[_0x9a07('0x9')][_0x9a07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cc4a8,_0x220f04,_0x348b0d){return new BPromise(function(_0x740098,_0x4ecf29){return client[_0x9a07('0xb')](_0x3cc4a8,_0x348b0d)[_0x9a07('0xc')](function(_0x4aa2aa){logger['info'](_0x9a07('0xd'),_0x220f04,_0x9a07('0xe'));logger[_0x9a07('0xf')](_0x9a07('0x10'),_0x220f04,_0x9a07('0xe'),JSON[_0x9a07('0x11')](_0x4aa2aa));if(_0x4aa2aa['error']){if(_0x4aa2aa[_0x9a07('0x12')][_0x9a07('0x13')]===0x1f4){logger[_0x9a07('0x12')](_0x9a07('0xd'),_0x220f04,_0x4aa2aa['error'][_0x9a07('0x14')]);return _0x4ecf29(_0x4aa2aa[_0x9a07('0x12')]['message']);}logger[_0x9a07('0x12')]('DeskAccount,\x20%s,\x20%s',_0x220f04,_0x4aa2aa[_0x9a07('0x12')][_0x9a07('0x14')]);return _0x740098(_0x4aa2aa[_0x9a07('0x12')]['message']);}else{logger[_0x9a07('0x15')](_0x9a07('0xd'),_0x220f04,_0x9a07('0xe'));_0x740098(_0x4aa2aa[_0x9a07('0x16')][_0x9a07('0x14')]);}})[_0x9a07('0x17')](function(_0x4b26d1){logger[_0x9a07('0x12')](_0x9a07('0xd'),_0x220f04,_0x4b26d1);_0x4ecf29(_0x4b26d1);});});}exports['GetDeskAccount']=function(_0x6fc6ba){var _0x8680e1=this;return new Promise(function(_0x4804bf,_0x1b3b96){return db[_0x9a07('0x18')][_0x9a07('0x19')]({'raw':_0x6fc6ba[_0x9a07('0x1a')]?_0x6fc6ba['options']['raw']===undefined?!![]:![]:!![],'where':_0x6fc6ba[_0x9a07('0x1a')]?_0x6fc6ba['options'][_0x9a07('0x1b')]||null:null,'attributes':_0x6fc6ba[_0x9a07('0x1a')]?_0x6fc6ba[_0x9a07('0x1a')][_0x9a07('0x1c')]||null:null,'limit':_0x6fc6ba[_0x9a07('0x1a')]?_0x6fc6ba[_0x9a07('0x1a')][_0x9a07('0x1d')]||null:null,'include':_0x6fc6ba[_0x9a07('0x1a')]?_0x6fc6ba[_0x9a07('0x1a')][_0x9a07('0x1e')]?_[_0x9a07('0x1f')](_0x6fc6ba['options'][_0x9a07('0x1e')],function(_0x34e805){return{'model':db[_0x34e805[_0x9a07('0x20')]],'as':_0x34e805['as'],'attributes':_0x34e805[_0x9a07('0x1c')],'include':_0x34e805['include']?_[_0x9a07('0x1f')](_0x34e805[_0x9a07('0x1e')],function(_0x535ab7){return{'model':db[_0x535ab7[_0x9a07('0x20')]],'as':_0x535ab7['as'],'attributes':_0x535ab7[_0x9a07('0x1c')],'include':_0x535ab7[_0x9a07('0x1e')]?_[_0x9a07('0x1f')](_0x535ab7[_0x9a07('0x1e')],function(_0x224e4d){return{'model':db[_0x224e4d['model']],'as':_0x224e4d['as'],'attributes':_0x224e4d[_0x9a07('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25b7d0){logger[_0x9a07('0x15')](_0x9a07('0x21'),_0x6fc6ba);logger[_0x9a07('0xf')](_0x9a07('0x21'),_0x6fc6ba,JSON[_0x9a07('0x11')](_0x25b7d0));_0x4804bf(_0x25b7d0);})[_0x9a07('0x17')](function(_0x335e30){logger['error'](_0x9a07('0x21'),_0x335e30[_0x9a07('0x14')],_0x6fc6ba);_0x1b3b96(_0x8680e1[_0x9a07('0x12')](0x1f4,_0x335e30[_0x9a07('0x14')]));});});};exports[_0x9a07('0x22')]=function(_0x49b4f0){var _0x567f17=this;return new Promise(function(_0x103a1d,_0x937049){return db[_0x9a07('0x18')][_0x9a07('0x23')]({'raw':_0x49b4f0[_0x9a07('0x1a')]?_0x49b4f0[_0x9a07('0x1a')][_0x9a07('0x24')]===undefined?!![]:![]:!![],'where':_0x49b4f0[_0x9a07('0x1a')]?_0x49b4f0[_0x9a07('0x1a')][_0x9a07('0x1b')]||null:null,'attributes':_0x49b4f0[_0x9a07('0x1a')]?_0x49b4f0[_0x9a07('0x1a')][_0x9a07('0x1c')]||null:null,'include':_0x49b4f0[_0x9a07('0x1a')]?_0x49b4f0[_0x9a07('0x1a')][_0x9a07('0x1e')]?_[_0x9a07('0x1f')](_0x49b4f0[_0x9a07('0x1a')][_0x9a07('0x1e')],function(_0x2b8de8){return{'model':db[_0x2b8de8['model']],'as':_0x2b8de8['as'],'attributes':_0x2b8de8[_0x9a07('0x1c')],'include':_0x2b8de8[_0x9a07('0x1e')]?_[_0x9a07('0x1f')](_0x2b8de8[_0x9a07('0x1e')],function(_0x10bf5a){return{'model':db[_0x10bf5a[_0x9a07('0x20')]],'as':_0x10bf5a['as'],'attributes':_0x10bf5a['attributes'],'include':_0x10bf5a[_0x9a07('0x1e')]?_[_0x9a07('0x1f')](_0x10bf5a[_0x9a07('0x1e')],function(_0x1a3e0e){return{'model':db[_0x1a3e0e[_0x9a07('0x20')]],'as':_0x1a3e0e['as'],'attributes':_0x1a3e0e[_0x9a07('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a8284){logger[_0x9a07('0x15')](_0x9a07('0x22'),_0x49b4f0);logger[_0x9a07('0xf')](_0x9a07('0x22'),_0x49b4f0,JSON['stringify'](_0x4a8284));_0x103a1d(_0x4a8284);})[_0x9a07('0x17')](function(_0x20a4af){logger[_0x9a07('0x12')](_0x9a07('0x22'),_0x20a4af[_0x9a07('0x14')],_0x49b4f0);_0x937049(_0x567f17[_0x9a07('0x12')](0x1f4,_0x20a4af['message']));});});};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js
index 60e5e09..a0668bf 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 _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
+var _0x66c7=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','destroy','exports','multer','util'];(function(_0x28bd08,_0x2d71cf){var _0xf60d64=function(_0x2dc4e0){while(--_0x2dc4e0){_0x28bd08['push'](_0x28bd08['shift']());}};_0xf60d64(++_0x2d71cf);}(_0x66c7,0x15c));var _0x766c=function(_0x581a78,_0x4bb5c2){_0x581a78=_0x581a78-0x0;var _0x12d5d2=_0x66c7[_0x581a78];return _0x12d5d2;};'use strict';var multer=require(_0x766c('0x0'));var util=require(_0x766c('0x1'));var path=require(_0x766c('0x2'));var timeout=require('connect-timeout');var express=require(_0x766c('0x3'));var router=express[_0x766c('0x4')]();var auth=require(_0x766c('0x5'));var interaction=require(_0x766c('0x6'));var config=require(_0x766c('0x7'));var controller=require(_0x766c('0x8'));router['get']('/',auth[_0x766c('0x9')](),controller[_0x766c('0xa')]);router[_0x766c('0xb')](_0x766c('0xc'),auth[_0x766c('0x9')](),controller[_0x766c('0xd')]);router[_0x766c('0xb')](_0x766c('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x766c('0xb')](_0x766c('0xf'),auth[_0x766c('0x9')](),controller['getSubjects']);router[_0x766c('0xb')]('/:id/descriptions',auth[_0x766c('0x9')](),controller[_0x766c('0x10')]);router[_0x766c('0xb')](_0x766c('0x11'),auth[_0x766c('0x9')](),controller[_0x766c('0x12')]);router[_0x766c('0x13')]('/',auth[_0x766c('0x9')](),controller[_0x766c('0x14')]);router[_0x766c('0x13')](_0x766c('0x11'),auth[_0x766c('0x9')](),controller[_0x766c('0x15')]);router[_0x766c('0x16')](_0x766c('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x766c('0xc'),auth[_0x766c('0x9')](),controller[_0x766c('0x17')]);module[_0x766c('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
index 2893b18..2b1559a 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 _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
+var _0x983e=['sequelize','STRING'];(function(_0x401479,_0x5665f7){var _0x3f6457=function(_0x1c0b46){while(--_0x1c0b46){_0x401479['push'](_0x401479['shift']());}};_0x3f6457(++_0x5665f7);}(_0x983e,0x12e));var _0xe983=function(_0x3e7ecb,_0xad6ea1){_0x3e7ecb=_0x3e7ecb-0x0;var _0x34b2ed=_0x983e[_0x3e7ecb];return _0x34b2ed;};'use strict';var Sequelize=require(_0xe983('0x0'));module['exports']={'name':{'type':Sequelize[_0xe983('0x1')]},'description':{'type':Sequelize[_0xe983('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js
index 9d724d8..ed183e1 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 _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
+var _0x4ab0=['VIRTUAL','includeAll','include','findAll','show','options','create','body','params','find','getFields','DeskField','getSubjects','getDescriptions','getTags','findOne','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','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','jayson/promise','client','test','Sequelize','request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s','catch','sendStatus','status','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','end','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filters','filter','merge'];(function(_0xee9b22,_0x515b58){var _0x4b638e=function(_0x2d19bd){while(--_0x2d19bd){_0xee9b22['push'](_0xee9b22['shift']());}};_0x4b638e(++_0x515b58);}(_0x4ab0,0xd5));var _0x04ab=function(_0x3854e3,_0x4f0659){_0x3854e3=_0x3854e3-0x0;var _0x43ef42=_0x4ab0[_0x3854e3];return _0x43ef42;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x04ab('0x0'));var rimraf=require(_0x04ab('0x1'));var zipdir=require(_0x04ab('0x2'));var jsonpatch=require(_0x04ab('0x3'));var rp=require(_0x04ab('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x04ab('0x5'));var util=require(_0x04ab('0x6'));var path=require('path');var sox=require(_0x04ab('0x7'));var csv=require(_0x04ab('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x04ab('0x9'));var squel=require(_0x04ab('0xa'));var crypto=require(_0x04ab('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04ab('0xc'));var toCsv=require(_0x04ab('0x8'));var querystring=require(_0x04ab('0xd'));var Papa=require(_0x04ab('0xe'));var Redis=require('ioredis');var authService=require(_0x04ab('0xf'));var qs=require(_0x04ab('0x10'));var as=require(_0x04ab('0x11'));var hardwareService=require(_0x04ab('0x12'));var logger=require('../../config/logger')(_0x04ab('0x13'));var utils=require(_0x04ab('0x14'));var config=require(_0x04ab('0x15'));var db=require(_0x04ab('0x16'))['db'];var jayson=require(_0x04ab('0x17'));var client=jayson[_0x04ab('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x710503,_0x491b3f,_0xbb763d){if(_0xbb763d){var _0xef8710=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xef8710[_0x04ab('0x19')](_0x491b3f)){return _0x710503;}else{throw new db[(_0x04ab('0x1a'))]['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 _0x710503;}}function respondWithRpcPromise(_0x58aef3,_0x103ca8,_0x3cee44,_0x149fd2){return new BPromise(function(_0x2b10b0,_0x16d633){var _0x3e9a05=_0x149fd2||client;return _0x3e9a05[_0x04ab('0x1b')](_0x58aef3,_0x3cee44)[_0x04ab('0x1c')](function(_0x1f3251){logger[_0x04ab('0x1d')]('DeskConfiguration,\x20%s,\x20%s',_0x103ca8,_0x04ab('0x1e'));logger[_0x04ab('0x1f')](_0x04ab('0x20'),_0x103ca8,_0x04ab('0x1e'),JSON[_0x04ab('0x21')](_0x1f3251));if(_0x1f3251[_0x04ab('0x22')]){if(_0x1f3251[_0x04ab('0x22')][_0x04ab('0x23')]===0x1f4){logger[_0x04ab('0x22')]('DeskConfiguration,\x20%s,\x20%s',_0x103ca8,_0x1f3251[_0x04ab('0x22')]['message']);return _0x16d633(_0x1f3251[_0x04ab('0x22')][_0x04ab('0x24')]);}logger[_0x04ab('0x22')]('DeskConfiguration,\x20%s,\x20%s',_0x103ca8,_0x1f3251[_0x04ab('0x22')][_0x04ab('0x24')]);return _0x2b10b0(_0x1f3251[_0x04ab('0x22')]['message']);}else{logger['info'](_0x04ab('0x25'),_0x103ca8,_0x04ab('0x1e'));_0x2b10b0(_0x1f3251['result']['message']);}})[_0x04ab('0x26')](function(_0x4692c4){logger[_0x04ab('0x22')](_0x04ab('0x25'),_0x103ca8,_0x4692c4);_0x16d633(_0x4692c4);});});}function respondWithStatusCode(_0x26bb81,_0xa3838a){_0xa3838a=_0xa3838a||0xcc;return function(_0x21d9b7){if(_0x21d9b7){return _0x26bb81[_0x04ab('0x27')](_0xa3838a);}return _0x26bb81[_0x04ab('0x28')](_0xa3838a)['end']();};}function respondWithResult(_0x86bf80,_0x3343d0){_0x3343d0=_0x3343d0||0xc8;return function(_0x115fa6){if(_0x115fa6){return _0x86bf80[_0x04ab('0x28')](_0x3343d0)['json'](_0x115fa6);}};}function respondWithFilteredResult(_0x530a1c,_0x2a498b){return function(_0x5397cd){if(_0x5397cd){var _0x404eae=_0x5397cd[_0x04ab('0x29')],_0x30db64=_0x2a498b['offset'],_0x2e069d=_0x2a498b['offset']+_0x2a498b[_0x04ab('0x2a')],_0x3c25fb;if(_0x2e069d>=_0x404eae){_0x2e069d=_0x404eae;_0x3c25fb=0xc8;}else{_0x3c25fb=0xce;}_0x530a1c[_0x04ab('0x28')](_0x3c25fb);return _0x530a1c[_0x04ab('0x2b')](_0x04ab('0x2c'),_0x30db64+'-'+_0x2e069d+'/'+_0x404eae)[_0x04ab('0x2d')](_0x5397cd);}return null;};}function patchUpdates(_0x459e8c){return function(_0x1c3dca){try{jsonpatch[_0x04ab('0x2e')](_0x1c3dca,_0x459e8c,!![]);}catch(_0x1b8a9a){return BPromise[_0x04ab('0x2f')](_0x1b8a9a);}return _0x1c3dca[_0x04ab('0x30')]();};}function saveUpdates(_0x28bfca,_0x2f978d){return function(_0x48b7a3){if(_0x48b7a3){return _0x48b7a3[_0x04ab('0x31')](_0x28bfca)[_0x04ab('0x1c')](function(_0x5798ca){return _0x5798ca;});}return null;};}function removeEntity(_0x2dafe8,_0x148c76){return function(_0x5dbdfd){if(_0x5dbdfd){return _0x5dbdfd[_0x04ab('0x32')]()[_0x04ab('0x1c')](function(){_0x2dafe8['status'](0xcc)[_0x04ab('0x33')]();});}};}function handleEntityNotFound(_0x3e1750,_0x42202f){return function(_0x3b61d0){if(!_0x3b61d0){_0x3e1750[_0x04ab('0x27')](0x194);}return _0x3b61d0;};}function handleError(_0x15963a,_0x538cf7){_0x538cf7=_0x538cf7||0x1f4;return function(_0x2dab83){logger[_0x04ab('0x22')](_0x2dab83[_0x04ab('0x34')]);if(_0x2dab83['name']){delete _0x2dab83[_0x04ab('0x35')];}_0x15963a['status'](_0x538cf7)['send'](_0x2dab83);};}exports[_0x04ab('0x36')]=function(_0x3b7b51,_0x5569ba){var _0x40995c={},_0x487093={},_0x3c66a8={'count':0x0,'rows':[]};var _0x22a60d=_[_0x04ab('0x37')](db[_0x04ab('0x38')][_0x04ab('0x39')],function(_0x4018fa){return{'name':_0x4018fa[_0x04ab('0x3a')],'type':_0x4018fa[_0x04ab('0x3b')][_0x04ab('0x3c')]};});_0x487093[_0x04ab('0x3d')]=_[_0x04ab('0x37')](_0x22a60d,_0x04ab('0x35'));_0x487093['query']=_[_0x04ab('0x3e')](_0x3b7b51[_0x04ab('0x3f')]);_0x487093['filters']=_['intersection'](_0x487093[_0x04ab('0x3d')],_0x487093[_0x04ab('0x3f')]);_0x40995c[_0x04ab('0x40')]=_[_0x04ab('0x41')](_0x487093['model'],qs[_0x04ab('0x42')](_0x3b7b51[_0x04ab('0x3f')][_0x04ab('0x42')]));_0x40995c[_0x04ab('0x40')]=_0x40995c['attributes'][_0x04ab('0x43')]?_0x40995c[_0x04ab('0x40')]:_0x487093[_0x04ab('0x3d')];if(!_0x3b7b51[_0x04ab('0x3f')][_0x04ab('0x44')](_0x04ab('0x45'))){_0x40995c[_0x04ab('0x2a')]=qs[_0x04ab('0x2a')](_0x3b7b51['query']['limit']);_0x40995c[_0x04ab('0x46')]=qs[_0x04ab('0x46')](_0x3b7b51[_0x04ab('0x3f')][_0x04ab('0x46')]);}_0x40995c[_0x04ab('0x47')]=qs['sort'](_0x3b7b51[_0x04ab('0x3f')][_0x04ab('0x48')]);_0x40995c[_0x04ab('0x49')]=qs['filters'](_[_0x04ab('0x4a')](_0x3b7b51[_0x04ab('0x3f')],_0x487093[_0x04ab('0x4b')]),_0x22a60d);if(_0x3b7b51[_0x04ab('0x3f')][_0x04ab('0x4c')]){_0x40995c[_0x04ab('0x49')]=_[_0x04ab('0x4d')](_0x40995c[_0x04ab('0x49')],{'$or':_[_0x04ab('0x37')](_0x22a60d,function(_0x183464){if(_0x183464['type']!==_0x04ab('0x4e')){var _0xaac4e3={};_0xaac4e3[_0x183464[_0x04ab('0x35')]]={'$like':'%'+_0x3b7b51[_0x04ab('0x3f')][_0x04ab('0x4c')]+'%'};return _0xaac4e3;}})});}_0x40995c=_[_0x04ab('0x4d')]({},_0x40995c,_0x3b7b51['options']);var _0x272689={'where':_0x40995c[_0x04ab('0x49')]};return db[_0x04ab('0x38')][_0x04ab('0x29')](_0x272689)['then'](function(_0x19c4ee){_0x3c66a8[_0x04ab('0x29')]=_0x19c4ee;if(_0x3b7b51[_0x04ab('0x3f')][_0x04ab('0x4f')]){_0x40995c[_0x04ab('0x50')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x04ab('0x51')](_0x40995c);})[_0x04ab('0x1c')](function(_0x551f94){_0x3c66a8['rows']=_0x551f94;return _0x3c66a8;})[_0x04ab('0x1c')](respondWithFilteredResult(_0x5569ba,_0x40995c))[_0x04ab('0x26')](handleError(_0x5569ba,null));};exports[_0x04ab('0x52')]=function(_0x109355,_0x1c4aa2){var _0x3a9056={'raw':![],'where':{'id':_0x109355['params']['id']}},_0xae46c7={};_0xae46c7[_0x04ab('0x3d')]=_[_0x04ab('0x3e')](db[_0x04ab('0x38')]['rawAttributes']);_0xae46c7[_0x04ab('0x3f')]=_[_0x04ab('0x3e')](_0x109355['query']);_0xae46c7[_0x04ab('0x4b')]=_['intersection'](_0xae46c7[_0x04ab('0x3d')],_0xae46c7['query']);_0x3a9056[_0x04ab('0x40')]=_['intersection'](_0xae46c7['model'],qs[_0x04ab('0x42')](_0x109355[_0x04ab('0x3f')][_0x04ab('0x42')]));_0x3a9056['attributes']=_0x3a9056['attributes'][_0x04ab('0x43')]?_0x3a9056[_0x04ab('0x40')]:_0xae46c7[_0x04ab('0x3d')];if(_0x109355['query'][_0x04ab('0x4f')]){_0x3a9056['include']=[{'all':!![]}];}_0x3a9056=_[_0x04ab('0x4d')]({},_0x3a9056,_0x109355[_0x04ab('0x53')]);return db[_0x04ab('0x38')]['find'](_0x3a9056)[_0x04ab('0x1c')](handleEntityNotFound(_0x1c4aa2,null))[_0x04ab('0x1c')](respondWithResult(_0x1c4aa2,null))[_0x04ab('0x26')](handleError(_0x1c4aa2,null));};exports[_0x04ab('0x54')]=function(_0x3297fe,_0x122611){return db[_0x04ab('0x38')][_0x04ab('0x54')](_0x3297fe[_0x04ab('0x55')],{})[_0x04ab('0x1c')](respondWithResult(_0x122611,0xc9))[_0x04ab('0x26')](handleError(_0x122611,null));};exports['update']=function(_0x3ecf57,_0x5e9bb9){if(_0x3ecf57[_0x04ab('0x55')]['id']){delete _0x3ecf57[_0x04ab('0x55')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x3ecf57[_0x04ab('0x56')]['id']}})[_0x04ab('0x1c')](handleEntityNotFound(_0x5e9bb9,null))[_0x04ab('0x1c')](saveUpdates(_0x3ecf57[_0x04ab('0x55')],null))[_0x04ab('0x1c')](respondWithResult(_0x5e9bb9,null))[_0x04ab('0x26')](handleError(_0x5e9bb9,null));};exports[_0x04ab('0x32')]=function(_0x466119,_0x405780){return db['DeskConfiguration'][_0x04ab('0x57')]({'where':{'id':_0x466119[_0x04ab('0x56')]['id']}})[_0x04ab('0x1c')](handleEntityNotFound(_0x405780,null))['then'](removeEntity(_0x405780,null))[_0x04ab('0x26')](handleError(_0x405780,null));};exports[_0x04ab('0x58')]=function(_0x2b0ba1,_0x4c9f03,_0x2d60c8){var _0x22d3be={};var _0x14810f={};var _0x1837d2;var _0x59ddca;return db[_0x04ab('0x38')]['findOne']({'where':{'id':_0x2b0ba1[_0x04ab('0x56')]['id']}})[_0x04ab('0x1c')](handleEntityNotFound(_0x4c9f03,null))['then'](function(_0x3245b2){if(_0x3245b2){_0x1837d2=_0x3245b2;_0x14810f['model']=_[_0x04ab('0x3e')](db[_0x04ab('0x59')][_0x04ab('0x39')]);_0x14810f[_0x04ab('0x3f')]=_['keys'](_0x2b0ba1[_0x04ab('0x3f')]);_0x14810f[_0x04ab('0x4b')]=_[_0x04ab('0x41')](_0x14810f[_0x04ab('0x3d')],_0x14810f[_0x04ab('0x3f')]);_0x22d3be[_0x04ab('0x40')]=_[_0x04ab('0x41')](_0x14810f[_0x04ab('0x3d')],qs[_0x04ab('0x42')](_0x2b0ba1[_0x04ab('0x3f')][_0x04ab('0x42')]));_0x22d3be[_0x04ab('0x40')]=_0x22d3be[_0x04ab('0x40')][_0x04ab('0x43')]?_0x22d3be[_0x04ab('0x40')]:_0x14810f[_0x04ab('0x3d')];_0x22d3be[_0x04ab('0x47')]=qs[_0x04ab('0x48')](_0x2b0ba1[_0x04ab('0x3f')][_0x04ab('0x48')]);_0x22d3be[_0x04ab('0x49')]=qs[_0x04ab('0x4b')](_['pick'](_0x2b0ba1[_0x04ab('0x3f')],_0x14810f['filters']));if(_0x2b0ba1[_0x04ab('0x3f')][_0x04ab('0x4c')]){_0x22d3be[_0x04ab('0x49')]=_['merge'](_0x22d3be[_0x04ab('0x49')],{'$or':_[_0x04ab('0x37')](_0x22d3be[_0x04ab('0x40')],function(_0x4a24a4){var _0x2f5be4={};_0x2f5be4[_0x4a24a4]={'$like':'%'+_0x2b0ba1[_0x04ab('0x3f')][_0x04ab('0x4c')]+'%'};return _0x2f5be4;})});}_0x22d3be=_['merge']({},_0x22d3be,_0x2b0ba1[_0x04ab('0x53')]);return _0x1837d2[_0x04ab('0x58')](_0x22d3be);}})['then'](function(_0xd1cc67){if(_0xd1cc67){_0x59ddca=_0xd1cc67['length'];if(!_0x2b0ba1['query'][_0x04ab('0x44')](_0x04ab('0x45'))){_0x22d3be[_0x04ab('0x2a')]=qs[_0x04ab('0x2a')](_0x2b0ba1[_0x04ab('0x3f')][_0x04ab('0x2a')]);_0x22d3be[_0x04ab('0x46')]=qs['offset'](_0x2b0ba1['query'][_0x04ab('0x46')]);}return _0x1837d2[_0x04ab('0x58')](_0x22d3be);}})[_0x04ab('0x1c')](function(_0x484a13){if(_0x484a13){return _0x484a13?{'count':_0x59ddca,'rows':_0x484a13}:null;}})[_0x04ab('0x1c')](respondWithResult(_0x4c9f03,null))[_0x04ab('0x26')](handleError(_0x4c9f03,null));};exports[_0x04ab('0x5a')]=function(_0x262303,_0x4bd06c,_0x2f097c){var _0x4d8eb9={};var _0x1205b0={};var _0x2c9a50;var _0x1d31c1;return db[_0x04ab('0x38')]['findOne']({'where':{'id':_0x262303[_0x04ab('0x56')]['id']}})[_0x04ab('0x1c')](handleEntityNotFound(_0x4bd06c,null))[_0x04ab('0x1c')](function(_0x1e62b2){if(_0x1e62b2){_0x2c9a50=_0x1e62b2;_0x1205b0['model']=_[_0x04ab('0x3e')](db['DeskField'][_0x04ab('0x39')]);_0x1205b0[_0x04ab('0x3f')]=_['keys'](_0x262303[_0x04ab('0x3f')]);_0x1205b0['filters']=_[_0x04ab('0x41')](_0x1205b0[_0x04ab('0x3d')],_0x1205b0['query']);_0x4d8eb9[_0x04ab('0x40')]=_[_0x04ab('0x41')](_0x1205b0[_0x04ab('0x3d')],qs[_0x04ab('0x42')](_0x262303['query'][_0x04ab('0x42')]));_0x4d8eb9['attributes']=_0x4d8eb9[_0x04ab('0x40')][_0x04ab('0x43')]?_0x4d8eb9['attributes']:_0x1205b0['model'];_0x4d8eb9[_0x04ab('0x47')]=qs[_0x04ab('0x48')](_0x262303['query'][_0x04ab('0x48')]);_0x4d8eb9[_0x04ab('0x49')]=qs[_0x04ab('0x4b')](_['pick'](_0x262303[_0x04ab('0x3f')],_0x1205b0[_0x04ab('0x4b')]));if(_0x262303[_0x04ab('0x3f')]['filter']){_0x4d8eb9[_0x04ab('0x49')]=_[_0x04ab('0x4d')](_0x4d8eb9[_0x04ab('0x49')],{'$or':_[_0x04ab('0x37')](_0x4d8eb9[_0x04ab('0x40')],function(_0x3fae43){var _0x2acd05={};_0x2acd05[_0x3fae43]={'$like':'%'+_0x262303['query'][_0x04ab('0x4c')]+'%'};return _0x2acd05;})});}_0x4d8eb9=_[_0x04ab('0x4d')]({},_0x4d8eb9,_0x262303['options']);return _0x2c9a50[_0x04ab('0x5a')](_0x4d8eb9);}})[_0x04ab('0x1c')](function(_0x595e73){if(_0x595e73){_0x1d31c1=_0x595e73[_0x04ab('0x43')];if(!_0x262303[_0x04ab('0x3f')][_0x04ab('0x44')]('nolimit')){_0x4d8eb9['limit']=qs[_0x04ab('0x2a')](_0x262303['query'][_0x04ab('0x2a')]);_0x4d8eb9[_0x04ab('0x46')]=qs[_0x04ab('0x46')](_0x262303['query'][_0x04ab('0x46')]);}return _0x2c9a50['getSubjects'](_0x4d8eb9);}})[_0x04ab('0x1c')](function(_0x31879a){if(_0x31879a){return _0x31879a?{'count':_0x1d31c1,'rows':_0x31879a}:null;}})['then'](respondWithResult(_0x4bd06c,null))[_0x04ab('0x26')](handleError(_0x4bd06c,null));};exports['getDescriptions']=function(_0x3d97d3,_0x1e1ace,_0x11cb01){var _0x584916={};var _0x1d7e8b={};var _0x1459bd;var _0x23e03b;return db[_0x04ab('0x38')]['findOne']({'where':{'id':_0x3d97d3[_0x04ab('0x56')]['id']}})[_0x04ab('0x1c')](handleEntityNotFound(_0x1e1ace,null))[_0x04ab('0x1c')](function(_0x1e900c){if(_0x1e900c){_0x1459bd=_0x1e900c;_0x1d7e8b[_0x04ab('0x3d')]=_['keys'](db['DeskField']['rawAttributes']);_0x1d7e8b[_0x04ab('0x3f')]=_[_0x04ab('0x3e')](_0x3d97d3[_0x04ab('0x3f')]);_0x1d7e8b['filters']=_[_0x04ab('0x41')](_0x1d7e8b[_0x04ab('0x3d')],_0x1d7e8b[_0x04ab('0x3f')]);_0x584916['attributes']=_[_0x04ab('0x41')](_0x1d7e8b['model'],qs['fields'](_0x3d97d3[_0x04ab('0x3f')][_0x04ab('0x42')]));_0x584916[_0x04ab('0x40')]=_0x584916[_0x04ab('0x40')]['length']?_0x584916[_0x04ab('0x40')]:_0x1d7e8b[_0x04ab('0x3d')];_0x584916[_0x04ab('0x47')]=qs[_0x04ab('0x48')](_0x3d97d3[_0x04ab('0x3f')][_0x04ab('0x48')]);_0x584916[_0x04ab('0x49')]=qs[_0x04ab('0x4b')](_[_0x04ab('0x4a')](_0x3d97d3[_0x04ab('0x3f')],_0x1d7e8b[_0x04ab('0x4b')]));if(_0x3d97d3[_0x04ab('0x3f')][_0x04ab('0x4c')]){_0x584916[_0x04ab('0x49')]=_[_0x04ab('0x4d')](_0x584916[_0x04ab('0x49')],{'$or':_[_0x04ab('0x37')](_0x584916[_0x04ab('0x40')],function(_0x5b82a9){var _0xfc85c0={};_0xfc85c0[_0x5b82a9]={'$like':'%'+_0x3d97d3[_0x04ab('0x3f')][_0x04ab('0x4c')]+'%'};return _0xfc85c0;})});}_0x584916=_[_0x04ab('0x4d')]({},_0x584916,_0x3d97d3[_0x04ab('0x53')]);return _0x1459bd['getDescriptions'](_0x584916);}})[_0x04ab('0x1c')](function(_0x585a94){if(_0x585a94){_0x23e03b=_0x585a94[_0x04ab('0x43')];if(!_0x3d97d3[_0x04ab('0x3f')][_0x04ab('0x44')]('nolimit')){_0x584916[_0x04ab('0x2a')]=qs['limit'](_0x3d97d3['query'][_0x04ab('0x2a')]);_0x584916[_0x04ab('0x46')]=qs['offset'](_0x3d97d3[_0x04ab('0x3f')]['offset']);}return _0x1459bd[_0x04ab('0x5b')](_0x584916);}})[_0x04ab('0x1c')](function(_0x1629cc){if(_0x1629cc){return _0x1629cc?{'count':_0x23e03b,'rows':_0x1629cc}:null;}})['then'](respondWithResult(_0x1e1ace,null))['catch'](handleError(_0x1e1ace,null));};exports[_0x04ab('0x5c')]=function(_0x5f148a,_0x591a87,_0x6f3d21){var _0x4bac52={};var _0xb355b={};var _0x4426f7;var _0x1f3957;return db[_0x04ab('0x38')][_0x04ab('0x5d')]({'where':{'id':_0x5f148a[_0x04ab('0x56')]['id']}})[_0x04ab('0x1c')](handleEntityNotFound(_0x591a87,null))[_0x04ab('0x1c')](function(_0x3aab7b){if(_0x3aab7b){_0x4426f7=_0x3aab7b;_0xb355b[_0x04ab('0x3d')]=_[_0x04ab('0x3e')](db[_0x04ab('0x5e')][_0x04ab('0x39')]);_0xb355b[_0x04ab('0x3f')]=_[_0x04ab('0x3e')](_0x5f148a[_0x04ab('0x3f')]);_0xb355b[_0x04ab('0x4b')]=_['intersection'](_0xb355b[_0x04ab('0x3d')],_0xb355b[_0x04ab('0x3f')]);_0x4bac52[_0x04ab('0x40')]=_[_0x04ab('0x41')](_0xb355b[_0x04ab('0x3d')],qs[_0x04ab('0x42')](_0x5f148a['query'][_0x04ab('0x42')]));_0x4bac52[_0x04ab('0x40')]=_0x4bac52[_0x04ab('0x40')][_0x04ab('0x43')]?_0x4bac52['attributes']:_0xb355b[_0x04ab('0x3d')];_0x4bac52['order']=qs[_0x04ab('0x48')](_0x5f148a[_0x04ab('0x3f')][_0x04ab('0x48')]);_0x4bac52['where']=qs[_0x04ab('0x4b')](_[_0x04ab('0x4a')](_0x5f148a[_0x04ab('0x3f')],_0xb355b[_0x04ab('0x4b')]));if(_0x5f148a[_0x04ab('0x3f')][_0x04ab('0x4c')]){_0x4bac52[_0x04ab('0x49')]=_[_0x04ab('0x4d')](_0x4bac52[_0x04ab('0x49')],{'$or':_[_0x04ab('0x37')](_0x4bac52['attributes'],function(_0x54a61e){var _0x14fcde={};_0x14fcde[_0x54a61e]={'$like':'%'+_0x5f148a[_0x04ab('0x3f')][_0x04ab('0x4c')]+'%'};return _0x14fcde;})});}_0x4bac52=_[_0x04ab('0x4d')]({},_0x4bac52,_0x5f148a[_0x04ab('0x53')]);return _0x4426f7[_0x04ab('0x5c')](_0x4bac52);}})[_0x04ab('0x1c')](function(_0x47f073){if(_0x47f073){_0x1f3957=_0x47f073['length'];if(!_0x5f148a[_0x04ab('0x3f')][_0x04ab('0x44')]('nolimit')){_0x4bac52['limit']=qs[_0x04ab('0x2a')](_0x5f148a[_0x04ab('0x3f')][_0x04ab('0x2a')]);_0x4bac52[_0x04ab('0x46')]=qs[_0x04ab('0x46')](_0x5f148a[_0x04ab('0x3f')][_0x04ab('0x46')]);}return _0x4426f7['getTags'](_0x4bac52);}})[_0x04ab('0x1c')](function(_0x571ce0){if(_0x571ce0){return _0x571ce0?{'count':_0x1f3957,'rows':_0x571ce0}:null;}})[_0x04ab('0x1c')](respondWithResult(_0x591a87,null))[_0x04ab('0x26')](handleError(_0x591a87,null));};exports[_0x04ab('0x5f')]=function(_0x52f7b2,_0x3cb5fa,_0x5b8d79){if(_0x52f7b2[_0x04ab('0x55')]['id']){delete _0x52f7b2[_0x04ab('0x55')]['id'];}return db[_0x04ab('0x38')]['findOne']({'where':{'id':_0x52f7b2[_0x04ab('0x56')]['id']}})['then'](handleEntityNotFound(_0x3cb5fa,null))[_0x04ab('0x1c')](function(_0x2b2220){if(_0x2b2220){return _0x2b2220[_0x04ab('0x5f')](_0x52f7b2[_0x04ab('0x55')][_0x04ab('0x60')]||[]);}return null;})['then'](respondWithResult(_0x3cb5fa,null))[_0x04ab('0x26')](handleError(_0x3cb5fa,null));};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js
index 26f2f6a..74848a2 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 _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
+var _0xdd48=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','DeskConfiguration','int_desk_configurations','api'];(function(_0x4b2125,_0x31462d){var _0x1a6fc3=function(_0x218c03){while(--_0x218c03){_0x4b2125['push'](_0x4b2125['shift']());}};_0x1a6fc3(++_0x31462d);}(_0xdd48,0x16a));var _0x8dd4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xdd48[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8dd4('0x0'));var moment=require(_0x8dd4('0x1'));var BPromise=require(_0x8dd4('0x2'));var rp=require(_0x8dd4('0x3'));var fs=require('fs');var path=require(_0x8dd4('0x4'));var rimraf=require(_0x8dd4('0x5'));var config=require(_0x8dd4('0x6'));var attributes=require('./intDeskConfiguration.attributes');module[_0x8dd4('0x7')]=function(_0x3aca5e,_0x2ed0c8){return _0x3aca5e[_0x8dd4('0x8')](_0x8dd4('0x9'),attributes,{'tableName':_0x8dd4('0xa'),'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 e6db62c..5488119 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 _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
+var _0xa477=['client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x117c43,_0x54b6be){var _0x5e4f90=function(_0x490ac7){while(--_0x490ac7){_0x117c43['push'](_0x117c43['shift']());}};_0x5e4f90(++_0x54b6be);}(_0xa477,0xe6));var _0x7a47=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa477[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x7a47('0x0'));var util=require(_0x7a47('0x1'));var moment=require('moment');var BPromise=require(_0x7a47('0x2'));var rs=require(_0x7a47('0x3'));var fs=require('fs');var Redis=require(_0x7a47('0x4'));var db=require(_0x7a47('0x5'))['db'];var utils=require(_0x7a47('0x6'));var logger=require(_0x7a47('0x7'))(_0x7a47('0x8'));var config=require('../../config/environment');var jayson=require(_0x7a47('0x9'));var client=jayson[_0x7a47('0xa')][_0x7a47('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c6e0e,_0x54e9aa,_0x47f594){return new BPromise(function(_0x4276ed,_0x49db4c){return client[_0x7a47('0xc')](_0x4c6e0e,_0x47f594)[_0x7a47('0xd')](function(_0x52eb49){logger[_0x7a47('0xe')](_0x7a47('0xf'),_0x54e9aa,_0x7a47('0x10'));logger[_0x7a47('0x11')](_0x7a47('0x12'),_0x54e9aa,'request\x20sent',JSON[_0x7a47('0x13')](_0x52eb49));if(_0x52eb49[_0x7a47('0x14')]){if(_0x52eb49[_0x7a47('0x14')][_0x7a47('0x15')]===0x1f4){logger['error'](_0x7a47('0xf'),_0x54e9aa,_0x52eb49[_0x7a47('0x14')][_0x7a47('0x16')]);return _0x49db4c(_0x52eb49[_0x7a47('0x14')][_0x7a47('0x16')]);}logger[_0x7a47('0x14')](_0x7a47('0xf'),_0x54e9aa,_0x52eb49[_0x7a47('0x14')]['message']);return _0x4276ed(_0x52eb49[_0x7a47('0x14')][_0x7a47('0x16')]);}else{logger[_0x7a47('0xe')](_0x7a47('0xf'),_0x54e9aa,'request\x20sent');_0x4276ed(_0x52eb49[_0x7a47('0x17')][_0x7a47('0x16')]);}})['catch'](function(_0x4a81fb){logger[_0x7a47('0x14')](_0x7a47('0xf'),_0x54e9aa,_0x4a81fb);_0x49db4c(_0x4a81fb);});});}
\ No newline at end of file
diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js
index b90e255..9727df9 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 _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
+var _0x88c4=['show','post','create','put','update','delete','destroy','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x88c4,0x16f));var _0x488c=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0x88c4[_0x3238ea];return _0x4aaac2;};'use strict';var multer=require(_0x488c('0x0'));var util=require(_0x488c('0x1'));var path=require('path');var timeout=require(_0x488c('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x488c('0x3'));var interaction=require(_0x488c('0x4'));var config=require(_0x488c('0x5'));var controller=require(_0x488c('0x6'));router[_0x488c('0x7')]('/',auth[_0x488c('0x8')](),controller[_0x488c('0x9')]);router[_0x488c('0x7')](_0x488c('0xa'),auth[_0x488c('0x8')](),controller[_0x488c('0xb')]);router[_0x488c('0xc')]('/',auth[_0x488c('0x8')](),controller[_0x488c('0xd')]);router[_0x488c('0xe')](_0x488c('0xa'),auth[_0x488c('0x8')](),controller[_0x488c('0xf')]);router[_0x488c('0x10')](_0x488c('0xa'),auth['isAuthenticated'](),controller[_0x488c('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js
index 5a31899..506c412 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 _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
+var _0x945d=['exports','string','variable','customVariable','keyValue','STRING','ENUM','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x945d,0x188));var _0xd945=function(_0x403dd4,_0x469869){_0x403dd4=_0x403dd4-0x0;var _0x25e6f9=_0x945d[_0x403dd4];return _0x25e6f9;};'use strict';var Sequelize=require('sequelize');module[_0xd945('0x0')]={'type':{'type':Sequelize['ENUM'](_0xd945('0x1'),_0xd945('0x2'),_0xd945('0x3'),_0xd945('0x4')),'defaultValue':_0xd945('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd945('0x5')]},'keyType':{'type':Sequelize[_0xd945('0x6')]('string','variable',_0xd945('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd945('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd945('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js
index 01c4eaf..fdaec36 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 _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
+var _0x5032=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','DeskField','includeAll','catch','show','params','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','set','json','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type'];(function(_0x48c784,_0x52b6fc){var _0x4634d9=function(_0x5c4f16){while(--_0x5c4f16){_0x48c784['push'](_0x48c784['shift']());}};_0x4634d9(++_0x52b6fc);}(_0x5032,0x1b7));var _0x2503=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x5032[_0x1ac595];return _0x455fff;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2503('0x0'));var rimraf=require(_0x2503('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2503('0x2'));var rp=require(_0x2503('0x3'));var moment=require(_0x2503('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2503('0x5'));var util=require(_0x2503('0x6'));var path=require('path');var sox=require(_0x2503('0x7'));var csv=require(_0x2503('0x8'));var ejs=require(_0x2503('0x9'));var fs=require('fs');var _=require(_0x2503('0xa'));var squel=require(_0x2503('0xb'));var crypto=require(_0x2503('0xc'));var jsforce=require(_0x2503('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2503('0x8'));var querystring=require(_0x2503('0xe'));var Papa=require(_0x2503('0xf'));var Redis=require(_0x2503('0x10'));var authService=require(_0x2503('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2503('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2503('0x13'))(_0x2503('0x14'));var utils=require(_0x2503('0x15'));var config=require(_0x2503('0x16'));var db=require(_0x2503('0x17'))['db'];function respondWithStatusCode(_0x1f1041,_0xe00b7f){_0xe00b7f=_0xe00b7f||0xcc;return function(_0x5d84b0){if(_0x5d84b0){return _0x1f1041['sendStatus'](_0xe00b7f);}return _0x1f1041[_0x2503('0x18')](_0xe00b7f)['end']();};}function respondWithResult(_0x4f8511,_0x581079){_0x581079=_0x581079||0xc8;return function(_0x559f31){if(_0x559f31){return _0x4f8511[_0x2503('0x18')](_0x581079)['json'](_0x559f31);}};}function respondWithFilteredResult(_0x25d78c,_0x1dd2ea){return function(_0x53b244){if(_0x53b244){var _0x5fb8e0=_0x53b244[_0x2503('0x19')],_0x56fd32=_0x1dd2ea[_0x2503('0x1a')],_0xbce711=_0x1dd2ea[_0x2503('0x1a')]+_0x1dd2ea[_0x2503('0x1b')],_0x9ada07;if(_0xbce711>=_0x5fb8e0){_0xbce711=_0x5fb8e0;_0x9ada07=0xc8;}else{_0x9ada07=0xce;}_0x25d78c[_0x2503('0x18')](_0x9ada07);return _0x25d78c[_0x2503('0x1c')]('Content-Range',_0x56fd32+'-'+_0xbce711+'/'+_0x5fb8e0)[_0x2503('0x1d')](_0x53b244);}return null;};}function patchUpdates(_0xf307e0){return function(_0x51f074){try{jsonpatch[_0x2503('0x1e')](_0x51f074,_0xf307e0,!![]);}catch(_0x286909){return BPromise['reject'](_0x286909);}return _0x51f074[_0x2503('0x1f')]();};}function saveUpdates(_0x402d78,_0x5c637f){return function(_0xbab8fb){if(_0xbab8fb){return _0xbab8fb[_0x2503('0x20')](_0x402d78)[_0x2503('0x21')](function(_0x227a59){return _0x227a59;});}return null;};}function removeEntity(_0xb4f4da,_0x79ce19){return function(_0x423e22){if(_0x423e22){return _0x423e22[_0x2503('0x22')]()['then'](function(){_0xb4f4da[_0x2503('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48a25e,_0x209e6b){return function(_0x4a34f0){if(!_0x4a34f0){_0x48a25e[_0x2503('0x23')](0x194);}return _0x4a34f0;};}function handleError(_0x4de9b7,_0x504791){_0x504791=_0x504791||0x1f4;return function(_0x4ce7b6){logger[_0x2503('0x24')](_0x4ce7b6[_0x2503('0x25')]);if(_0x4ce7b6[_0x2503('0x26')]){delete _0x4ce7b6['name'];}_0x4de9b7[_0x2503('0x18')](_0x504791)[_0x2503('0x27')](_0x4ce7b6);};}exports['index']=function(_0x53ce9d,_0x1d824d){var _0xcd8ada={},_0x4c445f={},_0x254fa5={'count':0x0,'rows':[]};var _0x1d2db0=_[_0x2503('0x28')](db['DeskField'][_0x2503('0x29')],function(_0x47ccf6){return{'name':_0x47ccf6[_0x2503('0x2a')],'type':_0x47ccf6[_0x2503('0x2b')][_0x2503('0x2c')]};});_0x4c445f[_0x2503('0x2d')]=_[_0x2503('0x28')](_0x1d2db0,_0x2503('0x26'));_0x4c445f[_0x2503('0x2e')]=_[_0x2503('0x2f')](_0x53ce9d[_0x2503('0x2e')]);_0x4c445f[_0x2503('0x30')]=_[_0x2503('0x31')](_0x4c445f[_0x2503('0x2d')],_0x4c445f['query']);_0xcd8ada[_0x2503('0x32')]=_[_0x2503('0x31')](_0x4c445f['model'],qs[_0x2503('0x33')](_0x53ce9d[_0x2503('0x2e')][_0x2503('0x33')]));_0xcd8ada[_0x2503('0x32')]=_0xcd8ada[_0x2503('0x32')][_0x2503('0x34')]?_0xcd8ada['attributes']:_0x4c445f[_0x2503('0x2d')];if(!_0x53ce9d['query'][_0x2503('0x35')](_0x2503('0x36'))){_0xcd8ada[_0x2503('0x1b')]=qs[_0x2503('0x1b')](_0x53ce9d[_0x2503('0x2e')]['limit']);_0xcd8ada[_0x2503('0x1a')]=qs[_0x2503('0x1a')](_0x53ce9d[_0x2503('0x2e')]['offset']);}_0xcd8ada['order']=qs[_0x2503('0x37')](_0x53ce9d[_0x2503('0x2e')][_0x2503('0x37')]);_0xcd8ada[_0x2503('0x38')]=qs['filters'](_['pick'](_0x53ce9d[_0x2503('0x2e')],_0x4c445f['filters']),_0x1d2db0);if(_0x53ce9d[_0x2503('0x2e')][_0x2503('0x39')]){_0xcd8ada[_0x2503('0x38')]=_[_0x2503('0x3a')](_0xcd8ada[_0x2503('0x38')],{'$or':_[_0x2503('0x28')](_0x1d2db0,function(_0x498249){if(_0x498249[_0x2503('0x2b')]!==_0x2503('0x3b')){var _0xfa000f={};_0xfa000f[_0x498249[_0x2503('0x26')]]={'$like':'%'+_0x53ce9d[_0x2503('0x2e')][_0x2503('0x39')]+'%'};return _0xfa000f;}})});}_0xcd8ada=_[_0x2503('0x3a')]({},_0xcd8ada,_0x53ce9d['options']);var _0x390502={'where':_0xcd8ada[_0x2503('0x38')]};return db[_0x2503('0x3c')][_0x2503('0x19')](_0x390502)[_0x2503('0x21')](function(_0x406fc5){_0x254fa5['count']=_0x406fc5;if(_0x53ce9d[_0x2503('0x2e')][_0x2503('0x3d')]){_0xcd8ada['include']=[{'all':!![]}];}return db[_0x2503('0x3c')]['findAll'](_0xcd8ada);})['then'](function(_0x35ce2b){_0x254fa5['rows']=_0x35ce2b;return _0x254fa5;})[_0x2503('0x21')](respondWithFilteredResult(_0x1d824d,_0xcd8ada))[_0x2503('0x3e')](handleError(_0x1d824d,null));};exports[_0x2503('0x3f')]=function(_0x391eea,_0x268d10){var _0x230a68={'raw':!![],'where':{'id':_0x391eea[_0x2503('0x40')]['id']}},_0x4a666e={};_0x4a666e[_0x2503('0x2d')]=_[_0x2503('0x2f')](db[_0x2503('0x3c')]['rawAttributes']);_0x4a666e[_0x2503('0x2e')]=_[_0x2503('0x2f')](_0x391eea[_0x2503('0x2e')]);_0x4a666e[_0x2503('0x30')]=_[_0x2503('0x31')](_0x4a666e[_0x2503('0x2d')],_0x4a666e[_0x2503('0x2e')]);_0x230a68[_0x2503('0x32')]=_['intersection'](_0x4a666e[_0x2503('0x2d')],qs[_0x2503('0x33')](_0x391eea[_0x2503('0x2e')][_0x2503('0x33')]));_0x230a68[_0x2503('0x32')]=_0x230a68[_0x2503('0x32')][_0x2503('0x34')]?_0x230a68['attributes']:_0x4a666e[_0x2503('0x2d')];if(_0x391eea[_0x2503('0x2e')][_0x2503('0x3d')]){_0x230a68[_0x2503('0x41')]=[{'all':!![]}];}_0x230a68=_[_0x2503('0x3a')]({},_0x230a68,_0x391eea['options']);return db[_0x2503('0x3c')][_0x2503('0x42')](_0x230a68)[_0x2503('0x21')](handleEntityNotFound(_0x268d10,null))[_0x2503('0x21')](respondWithResult(_0x268d10,null))[_0x2503('0x3e')](handleError(_0x268d10,null));};exports[_0x2503('0x43')]=function(_0x243b31,_0x2cf3ba){return db[_0x2503('0x3c')][_0x2503('0x43')](_0x243b31[_0x2503('0x44')],{})[_0x2503('0x21')](respondWithResult(_0x2cf3ba,0xc9))['catch'](handleError(_0x2cf3ba,null));};exports[_0x2503('0x20')]=function(_0x426b20,_0x1d4960){if(_0x426b20[_0x2503('0x44')]['id']){delete _0x426b20[_0x2503('0x44')]['id'];}return db['DeskField'][_0x2503('0x42')]({'where':{'id':_0x426b20[_0x2503('0x40')]['id']}})[_0x2503('0x21')](handleEntityNotFound(_0x1d4960,null))[_0x2503('0x21')](saveUpdates(_0x426b20[_0x2503('0x44')],null))['then'](respondWithResult(_0x1d4960,null))[_0x2503('0x3e')](handleError(_0x1d4960,null));};exports['destroy']=function(_0x455ede,_0x1586cc){return db[_0x2503('0x3c')][_0x2503('0x42')]({'where':{'id':_0x455ede[_0x2503('0x40')]['id']}})['then'](handleEntityNotFound(_0x1586cc,null))[_0x2503('0x21')](removeEntity(_0x1586cc,null))[_0x2503('0x3e')](handleError(_0x1586cc,null));};
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js
index 8fe5d6c..3f2f263 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 _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
+var _0x6487=['./intDeskField.attributes','exports','define','DeskField','desk_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2e1387,_0x2fd52a){var _0xda65a6=function(_0x59d3f5){while(--_0x59d3f5){_0x2e1387['push'](_0x2e1387['shift']());}};_0xda65a6(++_0x2fd52a);}(_0x6487,0x1ab));var _0x7648=function(_0x45c1a9,_0x15905f){_0x45c1a9=_0x45c1a9-0x0;var _0x3575fb=_0x6487[_0x45c1a9];return _0x3575fb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7648('0x0'))(_0x7648('0x1'));var moment=require(_0x7648('0x2'));var BPromise=require(_0x7648('0x3'));var rp=require(_0x7648('0x4'));var fs=require('fs');var path=require(_0x7648('0x5'));var rimraf=require(_0x7648('0x6'));var config=require('../../config/environment');var attributes=require(_0x7648('0x7'));module[_0x7648('0x8')]=function(_0x5c8878,_0x1f9604){return _0x5c8878[_0x7648('0x9')](_0x7648('0xa'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x7648('0xb'),'fields':[_0x7648('0xc'),_0x7648('0xd')],'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 70cf655..a3d1c9c 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 _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
+var _0xe60d=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xe60d,0x15e));var _0xde60=function(_0x3334f3,_0x499459){_0x3334f3=_0x3334f3-0x0;var _0x65728b=_0xe60d[_0x3334f3];return _0x65728b;};'use strict';var _=require(_0xde60('0x0'));var util=require(_0xde60('0x1'));var moment=require(_0xde60('0x2'));var BPromise=require(_0xde60('0x3'));var rs=require(_0xde60('0x4'));var fs=require('fs');var Redis=require(_0xde60('0x5'));var db=require(_0xde60('0x6'))['db'];var utils=require(_0xde60('0x7'));var logger=require('../../config/logger')(_0xde60('0x8'));var config=require(_0xde60('0x9'));var jayson=require(_0xde60('0xa'));var client=jayson[_0xde60('0xb')][_0xde60('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1207f9,_0x1413cd,_0x32ec36){return new BPromise(function(_0x6c262c,_0xd57521){return client[_0xde60('0xd')](_0x1207f9,_0x32ec36)['then'](function(_0x7136c6){logger[_0xde60('0xe')](_0xde60('0xf'),_0x1413cd,'request\x20sent');logger[_0xde60('0x10')](_0xde60('0x11'),_0x1413cd,_0xde60('0x12'),JSON[_0xde60('0x13')](_0x7136c6));if(_0x7136c6[_0xde60('0x14')]){if(_0x7136c6[_0xde60('0x14')][_0xde60('0x15')]===0x1f4){logger[_0xde60('0x14')](_0xde60('0xf'),_0x1413cd,_0x7136c6[_0xde60('0x14')][_0xde60('0x16')]);return _0xd57521(_0x7136c6[_0xde60('0x14')]['message']);}logger[_0xde60('0x14')](_0xde60('0xf'),_0x1413cd,_0x7136c6['error'][_0xde60('0x16')]);return _0x6c262c(_0x7136c6[_0xde60('0x14')][_0xde60('0x16')]);}else{logger[_0xde60('0xe')](_0xde60('0xf'),_0x1413cd,_0xde60('0x12'));_0x6c262c(_0x7136c6[_0xde60('0x17')][_0xde60('0x16')]);}})[_0xde60('0x18')](function(_0x4f463a){logger[_0xde60('0x14')](_0xde60('0xf'),_0x1413cd,_0x4f463a);_0xd57521(_0x4f463a);});});}
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js
index 1ece4e8..5eafb91 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 _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
+var _0x5bb5=['getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x13926c,_0x42a62e){var _0x3bb434=function(_0x50af59){while(--_0x50af59){_0x13926c['push'](_0x13926c['shift']());}};_0x3bb434(++_0x42a62e);}(_0x5bb5,0x103));var _0x55bb=function(_0x514350,_0x5beac8){_0x514350=_0x514350-0x0;var _0x1c89d7=_0x5bb5[_0x514350];return _0x1c89d7;};'use strict';var multer=require(_0x55bb('0x0'));var util=require(_0x55bb('0x1'));var path=require(_0x55bb('0x2'));var timeout=require(_0x55bb('0x3'));var express=require(_0x55bb('0x4'));var router=express['Router']();var auth=require(_0x55bb('0x5'));var interaction=require(_0x55bb('0x6'));var config=require(_0x55bb('0x7'));var controller=require('./intDynamics365Account.controller');router[_0x55bb('0x8')]('/',auth[_0x55bb('0x9')](),controller[_0x55bb('0xa')]);router[_0x55bb('0x8')](_0x55bb('0xb'),auth[_0x55bb('0x9')](),controller[_0x55bb('0xc')]);router[_0x55bb('0x8')](_0x55bb('0xd'),auth[_0x55bb('0x9')](),controller[_0x55bb('0xe')]);router['get'](_0x55bb('0xf'),auth['isAuthenticated'](),controller[_0x55bb('0x10')]);router[_0x55bb('0x11')]('/',auth[_0x55bb('0x9')](),controller[_0x55bb('0x12')]);router[_0x55bb('0x11')](_0x55bb('0xd'),auth[_0x55bb('0x9')](),controller[_0x55bb('0x13')]);router[_0x55bb('0x14')]('/:id',auth[_0x55bb('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js
index d8b2009..d45b186 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 _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
+var _0x1bdd=['STRING'];(function(_0x2c26a0,_0x2b9577){var _0x3e26d2=function(_0xcd6fc5){while(--_0xcd6fc5){_0x2c26a0['push'](_0x2c26a0['shift']());}};_0x3e26d2(++_0x2b9577);}(_0x1bdd,0x166));var _0xd1bd=function(_0x35ed0c,_0x474766){_0x35ed0c=_0x35ed0c-0x0;var _0x40a02c=_0x1bdd[_0x35ed0c];return _0x40a02c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd1bd('0x0')]},'password':{'type':Sequelize[_0xd1bd('0x0')]},'remoteUri':{'type':Sequelize[_0xd1bd('0x0')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xd1bd('0x0')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xd1bd('0x0')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js
index 6d7d2d2..c28670a 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 _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
+var _0x2daf=['Dynamics365Field','Descriptions','ticketType','incident','Incident','PhoneCall','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','concat','username','password','remoteUri','tenantId','clientSecret','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','access_token','GET','Bearer\x20','4.0','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','substring','PicklistAttributeMetadata','all','isNil','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','EntityDefinitions(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','Value','LogicalName','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','request','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','end','json','count','offset','set','Content-Range','reject','save','update','then','stack','name','status','send','map','Dynamics365Account','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','create','body','destroy','getConfigurations','findOne','Dynamics365Configuration','order','AccountId','Subjects','getSubjects','channel','getDescriptions'];(function(_0x55a529,_0x49a10a){var _0x188595=function(_0x3c8e61){while(--_0x3c8e61){_0x55a529['push'](_0x55a529['shift']());}};_0x188595(++_0x49a10a);}(_0x2daf,0x78));var _0xf2da=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0x2daf[_0x43f881];return _0x365c14;};'use strict';var pdf=require(_0xf2da('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf2da('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf2da('0x2'));var rp=require(_0xf2da('0x3'));var moment=require(_0xf2da('0x4'));var BPromise=require(_0xf2da('0x5'));var Mustache=require('mustache');var util=require(_0xf2da('0x6'));var path=require('path');var sox=require(_0xf2da('0x7'));var csv=require(_0xf2da('0x8'));var ejs=require(_0xf2da('0x9'));var fs=require('fs');var _=require(_0xf2da('0xa'));var squel=require('squel');var crypto=require(_0xf2da('0xb'));var jsforce=require(_0xf2da('0xc'));var deskjs=require(_0xf2da('0xd'));var toCsv=require(_0xf2da('0x8'));var querystring=require(_0xf2da('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf2da('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf2da('0x10'));var hardwareService=require(_0xf2da('0x11'));var logger=require(_0xf2da('0x12'))(_0xf2da('0x13'));var utils=require(_0xf2da('0x14'));var config=require(_0xf2da('0x15'));var db=require(_0xf2da('0x16'))['db'];var integrations=require(_0xf2da('0x17'));var jayson=require(_0xf2da('0x18'));var client=jayson['client'][_0xf2da('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4f16b9,_0x169a58,_0x2793ca){if(_0x2793ca){var _0x31ed08=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x31ed08[_0xf2da('0x1a')](_0x169a58)){return _0x4f16b9;}else{throw new db[(_0xf2da('0x1b'))]['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 _0x4f16b9;}}function respondWithRpcPromise(_0x57bc6f,_0x5ae9fa,_0x152a30,_0x568ffc){return new BPromise(function(_0x5ee3e4,_0x4d53f2){var _0x5d733a=_0x568ffc||client;return _0x5d733a[_0xf2da('0x1c')](_0x57bc6f,_0x152a30)['then'](function(_0x25e79b){logger['info'](_0xf2da('0x1d'),_0x5ae9fa,_0xf2da('0x1e'));logger[_0xf2da('0x1f')](_0xf2da('0x20'),_0x5ae9fa,'request\x20sent',JSON[_0xf2da('0x21')](_0x25e79b));if(_0x25e79b[_0xf2da('0x22')]){if(_0x25e79b[_0xf2da('0x22')][_0xf2da('0x23')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x5ae9fa,_0x25e79b[_0xf2da('0x22')][_0xf2da('0x24')]);return _0x4d53f2(_0x25e79b[_0xf2da('0x22')]['message']);}logger['error'](_0xf2da('0x1d'),_0x5ae9fa,_0x25e79b['error'][_0xf2da('0x24')]);return _0x5ee3e4(_0x25e79b[_0xf2da('0x22')][_0xf2da('0x24')]);}else{logger[_0xf2da('0x25')](_0xf2da('0x1d'),_0x5ae9fa,_0xf2da('0x1e'));_0x5ee3e4(_0x25e79b['result'][_0xf2da('0x24')]);}})[_0xf2da('0x26')](function(_0x16831){logger[_0xf2da('0x22')](_0xf2da('0x1d'),_0x5ae9fa,_0x16831);_0x4d53f2(_0x16831);});});}function respondWithStatusCode(_0x1d1c48,_0x24ffcd){_0x24ffcd=_0x24ffcd||0xcc;return function(_0x2c9e65){if(_0x2c9e65){return _0x1d1c48[_0xf2da('0x27')](_0x24ffcd);}return _0x1d1c48['status'](_0x24ffcd)[_0xf2da('0x28')]();};}function respondWithResult(_0x391f4b,_0x2fe6a4){_0x2fe6a4=_0x2fe6a4||0xc8;return function(_0x3e7cd5){if(_0x3e7cd5){return _0x391f4b['status'](_0x2fe6a4)[_0xf2da('0x29')](_0x3e7cd5);}};}function respondWithFilteredResult(_0x47a9f7,_0x309f8e){return function(_0xc5ff81){if(_0xc5ff81){var _0x5bb04f=_0xc5ff81[_0xf2da('0x2a')],_0x31ee78=_0x309f8e[_0xf2da('0x2b')],_0x1b33d7=_0x309f8e[_0xf2da('0x2b')]+_0x309f8e['limit'],_0x540447;if(_0x1b33d7>=_0x5bb04f){_0x1b33d7=_0x5bb04f;_0x540447=0xc8;}else{_0x540447=0xce;}_0x47a9f7['status'](_0x540447);return _0x47a9f7[_0xf2da('0x2c')](_0xf2da('0x2d'),_0x31ee78+'-'+_0x1b33d7+'/'+_0x5bb04f)[_0xf2da('0x29')](_0xc5ff81);}return null;};}function patchUpdates(_0x3cd482){return function(_0x5dd449){try{jsonpatch['apply'](_0x5dd449,_0x3cd482,!![]);}catch(_0x1c476e){return BPromise[_0xf2da('0x2e')](_0x1c476e);}return _0x5dd449[_0xf2da('0x2f')]();};}function saveUpdates(_0xc59045,_0x3b7d4d){return function(_0x44840c){if(_0x44840c){return _0x44840c[_0xf2da('0x30')](_0xc59045)[_0xf2da('0x31')](function(_0x495f98){return _0x495f98;});}return null;};}function removeEntity(_0x11c42c,_0x42c1b2){return function(_0x54c03a){if(_0x54c03a){return _0x54c03a['destroy']()[_0xf2da('0x31')](function(){_0x11c42c['status'](0xcc)[_0xf2da('0x28')]();});}};}function handleEntityNotFound(_0x1251db,_0x2c6ba5){return function(_0x3b9914){if(!_0x3b9914){_0x1251db[_0xf2da('0x27')](0x194);}return _0x3b9914;};}function handleError(_0x19ac3d,_0x4aacae){_0x4aacae=_0x4aacae||0x1f4;return function(_0x37e447){logger['error'](_0x37e447[_0xf2da('0x32')]);if(_0x37e447[_0xf2da('0x33')]){delete _0x37e447[_0xf2da('0x33')];}_0x19ac3d[_0xf2da('0x34')](_0x4aacae)[_0xf2da('0x35')](_0x37e447);};}exports['index']=function(_0x436686,_0x33f02f){var _0x2d3e07={},_0x457d4f={},_0x497314={'count':0x0,'rows':[]};var _0x80d43a=_[_0xf2da('0x36')](db[_0xf2da('0x37')][_0xf2da('0x38')],function(_0x400139){return{'name':_0x400139[_0xf2da('0x39')],'type':_0x400139[_0xf2da('0x3a')][_0xf2da('0x3b')]};});_0x457d4f['model']=_[_0xf2da('0x36')](_0x80d43a,'name');_0x457d4f[_0xf2da('0x3c')]=_[_0xf2da('0x3d')](_0x436686[_0xf2da('0x3c')]);_0x457d4f['filters']=_[_0xf2da('0x3e')](_0x457d4f[_0xf2da('0x3f')],_0x457d4f['query']);_0x2d3e07['attributes']=_[_0xf2da('0x3e')](_0x457d4f[_0xf2da('0x3f')],qs[_0xf2da('0x40')](_0x436686[_0xf2da('0x3c')][_0xf2da('0x40')]));_0x2d3e07[_0xf2da('0x41')]=_0x2d3e07['attributes'][_0xf2da('0x42')]?_0x2d3e07[_0xf2da('0x41')]:_0x457d4f['model'];if(!_0x436686[_0xf2da('0x3c')][_0xf2da('0x43')](_0xf2da('0x44'))){_0x2d3e07['limit']=qs[_0xf2da('0x45')](_0x436686['query'][_0xf2da('0x45')]);_0x2d3e07[_0xf2da('0x2b')]=qs[_0xf2da('0x2b')](_0x436686['query'][_0xf2da('0x2b')]);}_0x2d3e07['order']=qs[_0xf2da('0x46')](_0x436686['query'][_0xf2da('0x46')]);_0x2d3e07['where']=qs[_0xf2da('0x47')](_[_0xf2da('0x48')](_0x436686['query'],_0x457d4f[_0xf2da('0x47')]),_0x80d43a);if(_0x436686[_0xf2da('0x3c')][_0xf2da('0x49')]){_0x2d3e07[_0xf2da('0x4a')]=_[_0xf2da('0x4b')](_0x2d3e07['where'],{'$or':_[_0xf2da('0x36')](_0x80d43a,function(_0x4e1947){if(_0x4e1947[_0xf2da('0x3a')]!==_0xf2da('0x4c')){var _0x3b8454={};_0x3b8454[_0x4e1947[_0xf2da('0x33')]]={'$like':'%'+_0x436686[_0xf2da('0x3c')][_0xf2da('0x49')]+'%'};return _0x3b8454;}})});}_0x2d3e07=_['merge']({},_0x2d3e07,_0x436686[_0xf2da('0x4d')]);var _0x275bad={'where':_0x2d3e07[_0xf2da('0x4a')]};return db[_0xf2da('0x37')][_0xf2da('0x2a')](_0x275bad)[_0xf2da('0x31')](function(_0x5c88f6){_0x497314[_0xf2da('0x2a')]=_0x5c88f6;if(_0x436686[_0xf2da('0x3c')]['includeAll']){_0x2d3e07['include']=[{'all':!![]}];}return db[_0xf2da('0x37')][_0xf2da('0x4e')](_0x2d3e07);})[_0xf2da('0x31')](function(_0xebfb45){_0x497314[_0xf2da('0x4f')]=_0xebfb45;return _0x497314;})[_0xf2da('0x31')](respondWithFilteredResult(_0x33f02f,_0x2d3e07))['catch'](handleError(_0x33f02f,null));};exports[_0xf2da('0x50')]=function(_0x4ccc59,_0x29d9a4){var _0x3ed85d={'raw':![],'where':{'id':_0x4ccc59[_0xf2da('0x51')]['id']}},_0x4ee4d2={};_0x4ee4d2[_0xf2da('0x3f')]=_[_0xf2da('0x3d')](db[_0xf2da('0x37')]['rawAttributes']);_0x4ee4d2[_0xf2da('0x3c')]=_[_0xf2da('0x3d')](_0x4ccc59[_0xf2da('0x3c')]);_0x4ee4d2[_0xf2da('0x47')]=_[_0xf2da('0x3e')](_0x4ee4d2[_0xf2da('0x3f')],_0x4ee4d2[_0xf2da('0x3c')]);_0x3ed85d[_0xf2da('0x41')]=_['intersection'](_0x4ee4d2['model'],qs['fields'](_0x4ccc59[_0xf2da('0x3c')][_0xf2da('0x40')]));_0x3ed85d[_0xf2da('0x41')]=_0x3ed85d[_0xf2da('0x41')]['length']?_0x3ed85d[_0xf2da('0x41')]:_0x4ee4d2[_0xf2da('0x3f')];if(_0x4ccc59[_0xf2da('0x3c')][_0xf2da('0x52')]){_0x3ed85d[_0xf2da('0x53')]=[{'all':!![]}];}_0x3ed85d=_['merge']({},_0x3ed85d,_0x4ccc59[_0xf2da('0x4d')]);return db[_0xf2da('0x37')][_0xf2da('0x54')](_0x3ed85d)[_0xf2da('0x31')](handleEntityNotFound(_0x29d9a4,null))['then'](respondWithResult(_0x29d9a4,null))[_0xf2da('0x26')](handleError(_0x29d9a4,null));};exports[_0xf2da('0x55')]=function(_0x587fc4,_0x4a6698){return db[_0xf2da('0x37')][_0xf2da('0x55')](_0x587fc4[_0xf2da('0x56')],{})[_0xf2da('0x31')](respondWithResult(_0x4a6698,0xc9))[_0xf2da('0x26')](handleError(_0x4a6698,null));};exports[_0xf2da('0x30')]=function(_0x504434,_0x25ed73){if(_0x504434[_0xf2da('0x56')]['id']){delete _0x504434['body']['id'];}return db[_0xf2da('0x37')][_0xf2da('0x54')]({'where':{'id':_0x504434[_0xf2da('0x51')]['id']}})[_0xf2da('0x31')](handleEntityNotFound(_0x25ed73,null))['then'](saveUpdates(_0x504434[_0xf2da('0x56')],null))[_0xf2da('0x31')](respondWithResult(_0x25ed73,null))[_0xf2da('0x26')](handleError(_0x25ed73,null));};exports[_0xf2da('0x57')]=function(_0x50b778,_0x4ede0d){return db[_0xf2da('0x37')][_0xf2da('0x54')]({'where':{'id':_0x50b778['params']['id']}})['then'](handleEntityNotFound(_0x4ede0d,null))['then'](removeEntity(_0x4ede0d,null))[_0xf2da('0x26')](handleError(_0x4ede0d,null));};exports[_0xf2da('0x58')]=function(_0x19c692,_0x430046,_0x8148ce){var _0x310dff={};var _0x13d2f2={};var _0x531414;var _0x4c1496;return db['Dynamics365Account'][_0xf2da('0x59')]({'where':{'id':_0x19c692[_0xf2da('0x51')]['id']}})['then'](handleEntityNotFound(_0x430046,null))['then'](function(_0x4f7f96){if(_0x4f7f96){_0x531414=_0x4f7f96;_0x13d2f2[_0xf2da('0x3f')]=_[_0xf2da('0x3d')](db[_0xf2da('0x5a')][_0xf2da('0x38')]);_0x13d2f2['query']=_[_0xf2da('0x3d')](_0x19c692[_0xf2da('0x3c')]);_0x13d2f2['filters']=_['intersection'](_0x13d2f2[_0xf2da('0x3f')],_0x13d2f2[_0xf2da('0x3c')]);_0x310dff[_0xf2da('0x41')]=_[_0xf2da('0x3e')](_0x13d2f2['model'],qs[_0xf2da('0x40')](_0x19c692[_0xf2da('0x3c')][_0xf2da('0x40')]));_0x310dff[_0xf2da('0x41')]=_0x310dff[_0xf2da('0x41')][_0xf2da('0x42')]?_0x310dff['attributes']:_0x13d2f2['model'];_0x310dff[_0xf2da('0x5b')]=qs[_0xf2da('0x46')](_0x19c692[_0xf2da('0x3c')]['sort']);_0x310dff['where']=qs[_0xf2da('0x47')](_['pick'](_0x19c692[_0xf2da('0x3c')],_0x13d2f2['filters']));if(_0x19c692['query'][_0xf2da('0x49')]){_0x310dff[_0xf2da('0x4a')]=_[_0xf2da('0x4b')](_0x310dff[_0xf2da('0x4a')],{'$or':_[_0xf2da('0x36')](_0x310dff['attributes'],function(_0xde241e){var _0x35c73b={};_0x35c73b[_0xde241e]={'$like':'%'+_0x19c692['query'][_0xf2da('0x49')]+'%'};return _0x35c73b;})});}_0x310dff=_[_0xf2da('0x4b')]({},_0x310dff,_0x19c692['options']);return _0x531414[_0xf2da('0x58')](_0x310dff);}})[_0xf2da('0x31')](function(_0x3fe916){if(_0x3fe916){_0x4c1496=_0x3fe916[_0xf2da('0x42')];if(!_0x19c692[_0xf2da('0x3c')][_0xf2da('0x43')]('nolimit')){_0x310dff[_0xf2da('0x45')]=qs[_0xf2da('0x45')](_0x19c692[_0xf2da('0x3c')][_0xf2da('0x45')]);_0x310dff['offset']=qs[_0xf2da('0x2b')](_0x19c692[_0xf2da('0x3c')]['offset']);}return _0x531414[_0xf2da('0x58')](_0x310dff);}})[_0xf2da('0x31')](function(_0x31810b){if(_0x31810b){return _0x31810b?{'count':_0x4c1496,'rows':_0x31810b}:null;}})[_0xf2da('0x31')](respondWithResult(_0x430046,null))[_0xf2da('0x26')](handleError(_0x430046,null));};exports['addConfiguration']=function(_0x40aaf1,_0x2ea3ac,_0x3c5084){if(_0x40aaf1[_0xf2da('0x56')]['id']){delete _0x40aaf1[_0xf2da('0x56')]['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x40aaf1[_0xf2da('0x51')]['id']}})[_0xf2da('0x31')](handleEntityNotFound(_0x2ea3ac,null))['then'](function(_0x431003){if(_0x431003){_0x40aaf1[_0xf2da('0x56')][_0xf2da('0x5c')]=_0x431003['id'];_0x40aaf1[_0xf2da('0x56')][_0xf2da('0x5d')]=integrations[_0xf2da('0x5e')](_0x40aaf1[_0xf2da('0x56')][_0xf2da('0x5f')],_0x40aaf1[_0xf2da('0x56')][_0xf2da('0x3a')]);_0x40aaf1[_0xf2da('0x56')]['Descriptions']=integrations[_0xf2da('0x60')](_0x40aaf1[_0xf2da('0x56')][_0xf2da('0x5f')],_0x40aaf1[_0xf2da('0x56')][_0xf2da('0x3a')]);return db['Dynamics365Configuration']['create'](_0x40aaf1['body'],{'include':[{'model':db[_0xf2da('0x61')],'as':_0xf2da('0x5d')},{'model':db[_0xf2da('0x61')],'as':_0xf2da('0x62')}]});}return null;})['then'](respondWithResult(_0x2ea3ac,null))[_0xf2da('0x26')](handleError(_0x2ea3ac,null));};exports['getFields']=function(_0x16ff8f,_0x526db7,_0x26d2a2){var _0x431676=_0x16ff8f[_0xf2da('0x3c')][_0xf2da('0x63')];var _0x4686ad=_0x431676===_0xf2da('0x64')?_0xf2da('0x65'):_0xf2da('0x66');var _0x138189='';var _0x14adef='';var _0x5a246e='';var _0x3e957c='';var _0x25d4a8='';var _0x52c71c='';var _0x2d37fb='';var _0xdd8802='';var _0x23116f=['title',_0xf2da('0x67'),_0xf2da('0x68'),_0xf2da('0x69'),_0xf2da('0x6a'),_0xf2da('0x6b'),_0xf2da('0x6c'),_0xf2da('0x6d'),_0xf2da('0x6e'),_0xf2da('0x6f')];var _0x2a5aa3=[_0xf2da('0x70'),_0xf2da('0x71'),_0xf2da('0x72'),_0xf2da('0x73'),'contactidname',_0xf2da('0x74'),'contractdetailidname',_0xf2da('0x75'),_0xf2da('0x76'),_0xf2da('0x77'),'createdbyname',_0xf2da('0x78'),_0xf2da('0x79'),'createdonbehalfbyname',_0xf2da('0x7a'),_0xf2da('0x7b'),_0xf2da('0x7c'),_0xf2da('0x7d'),'emailaddress',_0xf2da('0x7e'),_0xf2da('0x7f'),_0xf2da('0x80'),'escalatedon',_0xf2da('0x81'),'firstresponsebykpiidname','followupby',_0xf2da('0x82'),_0xf2da('0x83'),_0xf2da('0x84'),_0xf2da('0x85'),_0xf2da('0x86'),_0xf2da('0x87'),_0xf2da('0x88'),_0xf2da('0x89'),_0xf2da('0x8a'),'modifiedon',_0xf2da('0x8b'),_0xf2da('0x8c'),_0xf2da('0x8d'),'msdyn_iotalertname','numberofchildincidents',_0xf2da('0x8e'),'overriddencreatedon',_0xf2da('0x8f'),_0xf2da('0x90'),_0xf2da('0x91'),_0xf2da('0x92'),'primarycontactidname',_0xf2da('0x93'),_0xf2da('0x94'),_0xf2da('0x95'),'productserialnumber',_0xf2da('0x96'),_0xf2da('0x97'),_0xf2da('0x98'),_0xf2da('0x99'),_0xf2da('0x9a'),_0xf2da('0x9b'),_0xf2da('0x9c'),'slaname','socialprofileidname',_0xf2da('0x9d'),'statuscode',_0xf2da('0x9e'),_0xf2da('0x9f'),_0xf2da('0xa0'),'transactioncurrencyidname',_0xf2da('0xa1'),'utcconversiontimezonecode','versionnumber'];var _0x1e837a=_0x23116f[_0xf2da('0xa2')](_0x2a5aa3);return db['Dynamics365Account'][_0xf2da('0x59')]({'where':{'id':_0x16ff8f[_0xf2da('0x51')]['id']},'attributes':['id',_0xf2da('0xa3'),_0xf2da('0xa4'),_0xf2da('0xa5'),_0xf2da('0xa6'),'clientId',_0xf2da('0xa7')]})[_0xf2da('0x31')](handleEntityNotFound(_0x526db7,null))[_0xf2da('0x31')](function(_0x138fdf){if(_0x138fdf){_0xdd8802=_0x138fdf['remoteUri'];var _0x21a8ae=_0xdd8802['slice'](-0x1);if(_0x21a8ae==='/'){_0xdd8802=_0xdd8802['substring'](0x0,_0xdd8802[_0xf2da('0xa8')](_0x21a8ae));}_0x2d37fb=util[_0xf2da('0xa9')](_0xf2da('0xaa'),_0xdd8802);var _0x125e06={'method':_0xf2da('0xab'),'uri':_0xf2da('0xac')+_0x138fdf[_0xf2da('0xa6')]+_0xf2da('0xad'),'form':{'client_id':_0x138fdf[_0xf2da('0xae')],'resource':_0xdd8802,'username':_0x138fdf[_0xf2da('0xa3')],'password':_0x138fdf[_0xf2da('0xa4')],'grant_type':'password','client_secret':_0x138fdf[_0xf2da('0xa7')]},'json':!![]};return rp(_0x125e06);}})[_0xf2da('0x31')](function(_0x50e1e1){_0x52c71c=_0x50e1e1[_0xf2da('0xaf')];var _0x53590c={'method':_0xf2da('0xb0'),'uri':encodeURI(_0x2d37fb+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x4686ad+'\x27'),'headers':{'Authorization':_0xf2da('0xb1')+_0x52c71c,'If-None-Match':null,'OData-Version':_0xf2da('0xb2')},'json':!![]};return rp(_0x53590c);})[_0xf2da('0x31')](function(_0x3b6ab3){var _0x3ed8a1=_0x3b6ab3['value'][0x0];var _0x40c9a5=_0x3ed8a1[_0xf2da('0xb3')];var _0x1b2530={'method':_0xf2da('0xb0'),'uri':_0x2d37fb+'EntityDefinitions('+_0x40c9a5+_0xf2da('0xb4'),'headers':{'Authorization':_0xf2da('0xb1')+_0x52c71c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1b2530);})['then'](function(_0x1b9ca0){_0x138189=_0x1b9ca0;_0x14adef=_0x138189[_0xf2da('0xb5')];_0x14adef=_[_0xf2da('0xb6')](_0x14adef,function(_0x5a24e5){return!_0x1e837a[_0xf2da('0xb7')](_0x5a24e5['LogicalName']);});var _0x20d9fc=[];var _0x3c49f1=[];_0x14adef[_0xf2da('0xb8')](function(_0x391996){if(_0x391996[_0xf2da('0xb9')]){var _0xeec1f1=_0x391996['@odata.type'][_0xf2da('0xba')](_0x391996['@odata.type'][_0xf2da('0xa8')]('.')+0x1);if(_0xeec1f1===_0xf2da('0xbb')){_0x20d9fc['push'](getSelectList(_0x2d37fb,_0x431676,_0x3c49f1,_0x138189[_0xf2da('0xb3')],_0x391996[_0xf2da('0xb3')],_0x52c71c));}}});return Promise[_0xf2da('0xbc')](_0x20d9fc);})['then'](function(_0x53c8c7){_0x5a246e=_0x53c8c7[0x0];var _0x2c2e81=[];var _0x587966=[];_0x14adef[_0xf2da('0xb8')](function(_0x338e4d){if(!_[_0xf2da('0xbd')](_0x338e4d[_0xf2da('0xb9')])){var _0x5d6647=_0x338e4d[_0xf2da('0xb9')][_0xf2da('0xba')](_0x338e4d[_0xf2da('0xb9')]['lastIndexOf']('.')+0x1);if(_0x5d6647==='BooleanAttributeMetadata'){_0x2c2e81[_0xf2da('0xbe')](getBooleanList(_0x2d37fb,_0x431676,_0x587966,_0x138189[_0xf2da('0xb3')],_0x338e4d[_0xf2da('0xb3')],_0x52c71c));}}});return Promise[_0xf2da('0xbc')](_0x2c2e81);})[_0xf2da('0x31')](function(_0x4f39ec){_0x3e957c=_0x4f39ec[0x0];var _0x1280a6=[];var _0x4d30a8=[];_0x14adef[_0xf2da('0xb8')](function(_0x3b1f54){if(_0x3b1f54[_0xf2da('0xb9')]){var _0xd9e3c=_0x3b1f54[_0xf2da('0xb9')][_0xf2da('0xba')](_0x3b1f54[_0xf2da('0xb9')]['lastIndexOf']('.')+0x1);if(_0xd9e3c===_0xf2da('0xbf')||_0xd9e3c===_0xf2da('0xc0')||_0xd9e3c===_0xf2da('0xc1')||_0xd9e3c===_0xf2da('0xc2')||_0xd9e3c==='MemoAttributeMetadata'||_0xd9e3c===_0xf2da('0xc3')||_0xd9e3c===_0xf2da('0xc4')||_0xd9e3c===_0xf2da('0xc5')||_0xd9e3c===_0xf2da('0xc6')||_0xd9e3c===_0xf2da('0xc7')){_0x1280a6[_0xf2da('0xbe')](getInputList(_0x2d37fb,_0x431676,_0xd9e3c,_0x4d30a8,_0x138189[_0xf2da('0xb3')],_0x3b1f54[_0xf2da('0xb3')],_0x52c71c));}}});return Promise['all'](_0x1280a6);})[_0xf2da('0x31')](function(_0x1f75b3){_0x25d4a8=_0x1f75b3[0x0];var _0x571d1c=_0x5a246e[_0xf2da('0xa2')](_0x3e957c)[_0xf2da('0xa2')](_0x25d4a8);var _0x4f8497={'count':_0x571d1c[_0xf2da('0x42')],'rows':_0x571d1c};return _0x4f8497;})['then'](respondWithResult(_0x526db7,null))[_0xf2da('0x26')](function(_0x3a8278){var _0x2f34b4=_0x16ff8f[_0xf2da('0x3c')]['test']?0x1f4:_0x3a8278[_0xf2da('0xc8')]||0x1f4;logger[_0xf2da('0x22')](_0x3a8278[_0xf2da('0x32')]);delete _0x3a8278[_0xf2da('0x33')];if(_0x2f34b4===0x191){_0x2f34b4=0x190;}_0x526db7['status'](_0x2f34b4)[_0xf2da('0x35')](_0x16ff8f[_0xf2da('0x3c')][_0xf2da('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x3a8278[_0xf2da('0xc8')]}:_0x3a8278);});};function getSelectList(_0x4e4e04,_0x2d4389,_0x171119,_0x1b23df,_0x5d03b6,_0x17c884){var _0x45339a={'method':'GET','uri':_0x4e4e04+_0xf2da('0xc9')+_0x1b23df+')/Attributes('+_0x5d03b6+_0xf2da('0xca')+_0xf2da('0xcb'),'headers':{'Authorization':_0xf2da('0xb1')+_0x17c884,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x45339a)[_0xf2da('0x31')](function(_0x3f3031){var _0x2bb1d8=[];var _0x36d52c=_0x3f3031[_0xf2da('0xcc')][_0xf2da('0xcd')];_0x36d52c[_0xf2da('0xb8')](function(_0x23cb40){_0x2bb1d8[_0xf2da('0xbe')]({'name':_0x23cb40['Label'][_0xf2da('0xce')][_0xf2da('0xcf')],'value':String(_0x23cb40[_0xf2da('0xd0')])});});var _0x440762={'id':_0x2d4389+'_'+_0x3f3031[_0xf2da('0xd1')],'name':_0x3f3031[_0xf2da('0xd2')][_0xf2da('0xce')][_0xf2da('0xcf')],'custom':![],'options':_0x2bb1d8};_0x171119['push'](_0x440762);return _0x171119;});}function getBooleanList(_0x2c481f,_0x399499,_0x307d72,_0x164faf,_0x10ffbe,_0x1e38b4){var _0x269120={'method':'GET','uri':_0x2c481f+_0xf2da('0xc9')+_0x164faf+_0xf2da('0xd3')+_0x10ffbe+_0xf2da('0xd4'),'headers':{'Authorization':_0xf2da('0xb1')+_0x1e38b4,'If-None-Match':null,'OData-Version':_0xf2da('0xb2')},'json':!![]};return rp(_0x269120)[_0xf2da('0x31')](function(_0x111e69){var _0x4df2d1=[];_0x4df2d1[_0xf2da('0xbe')]({'name':_0x111e69['OptionSet']['TrueOption'][_0xf2da('0xcf')][_0xf2da('0xce')]['Label'],'value':_0xf2da('0xd5')},{'name':_0x111e69[_0xf2da('0xcc')]['FalseOption']['Label'][_0xf2da('0xce')][_0xf2da('0xcf')],'value':_0xf2da('0xd6')});var _0x442276={'id':_0x399499+'_'+_0x111e69[_0xf2da('0xd1')],'name':_0x111e69[_0xf2da('0xd2')][_0xf2da('0xce')]['Label'],'custom':![],'options':_0x4df2d1};_0x307d72[_0xf2da('0xbe')](_0x442276);return _0x307d72;});}function getInputList(_0x3fa474,_0x414d03,_0x57d601,_0x1dc84d,_0x5ad88b,_0xe2789b,_0x43bf00){var _0x51e52f={'method':_0xf2da('0xb0'),'uri':_0x3fa474+_0xf2da('0xc9')+_0x5ad88b+_0xf2da('0xd3')+_0xe2789b+_0xf2da('0xd7')+_0x57d601+_0xf2da('0xd8'),'headers':{'Authorization':'Bearer\x20'+_0x43bf00,'If-None-Match':null,'OData-Version':_0xf2da('0xb2')},'json':!![]};return rp(_0x51e52f)[_0xf2da('0x31')](function(_0x5ee980){var _0x136403={'id':_0x414d03+'_'+_0x5ee980[_0xf2da('0xd1')],'name':_0x5ee980[_0xf2da('0xd2')][_0xf2da('0xce')]?_0x5ee980[_0xf2da('0xd2')][_0xf2da('0xce')][_0xf2da('0xcf')]:_0x5ee980[_0xf2da('0xd1')],'custom':![],'options':[]};_0x1dc84d[_0xf2da('0xbe')](_0x136403);return _0x1dc84d;});}
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js
index f9a3c4f..284e9f1 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 _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
+var _0xf347=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf347,0xef));var _0x7f34=function(_0xa1e659,_0xd4c7c3){_0xa1e659=_0xa1e659-0x0;var _0x5504b2=_0xf347[_0xa1e659];return _0x5504b2;};'use strict';var _=require(_0x7f34('0x0'));var util=require('util');var logger=require(_0x7f34('0x1'))(_0x7f34('0x2'));var moment=require('moment');var BPromise=require(_0x7f34('0x3'));var rp=require(_0x7f34('0x4'));var fs=require('fs');var path=require(_0x7f34('0x5'));var rimraf=require(_0x7f34('0x6'));var config=require('../../config/environment');var attributes=require('./intDynamics365Account.attributes');var integrations=require(_0x7f34('0x7'));module[_0x7f34('0x8')]=function(_0x534f97,_0xeda919){return _0x534f97[_0x7f34('0x9')](_0x7f34('0xa'),attributes,{'tableName':_0x7f34('0xb'),'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 6cf69fa..1c779e6 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 _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
+var _0x2428=['result','GetDynamics365Account','Dynamics365Account','options','raw','attributes','include','map','model','stringify','catch','ShowDynamics365Account','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s','error','message'];(function(_0x3d4cce,_0x53cae9){var _0x83fbc=function(_0x59be6a){while(--_0x59be6a){_0x3d4cce['push'](_0x3d4cce['shift']());}};_0x83fbc(++_0x53cae9);}(_0x2428,0xd3));var _0x8242=function(_0x5ca163,_0x7f4404){_0x5ca163=_0x5ca163-0x0;var _0x555d55=_0x2428[_0x5ca163];return _0x555d55;};'use strict';var _=require('lodash');var util=require(_0x8242('0x0'));var moment=require(_0x8242('0x1'));var BPromise=require(_0x8242('0x2'));var rs=require(_0x8242('0x3'));var fs=require('fs');var Redis=require(_0x8242('0x4'));var db=require(_0x8242('0x5'))['db'];var utils=require(_0x8242('0x6'));var logger=require(_0x8242('0x7'))(_0x8242('0x8'));var config=require(_0x8242('0x9'));var jayson=require(_0x8242('0xa'));var client=jayson['client'][_0x8242('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11da5f,_0x3fb12e,_0x3712f3){return new BPromise(function(_0x1501e8,_0x4b9617){return client[_0x8242('0xc')](_0x11da5f,_0x3712f3)[_0x8242('0xd')](function(_0x12b115){logger[_0x8242('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x3fb12e,_0x8242('0xf'));logger[_0x8242('0x10')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x3fb12e,_0x8242('0xf'),JSON['stringify'](_0x12b115));if(_0x12b115['error']){if(_0x12b115['error']['code']===0x1f4){logger['error'](_0x8242('0x11'),_0x3fb12e,_0x12b115[_0x8242('0x12')]['message']);return _0x4b9617(_0x12b115['error'][_0x8242('0x13')]);}logger[_0x8242('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x3fb12e,_0x12b115[_0x8242('0x12')]['message']);return _0x1501e8(_0x12b115[_0x8242('0x12')][_0x8242('0x13')]);}else{logger[_0x8242('0xe')](_0x8242('0x11'),_0x3fb12e,_0x8242('0xf'));_0x1501e8(_0x12b115[_0x8242('0x14')][_0x8242('0x13')]);}})['catch'](function(_0x4ad29d){logger[_0x8242('0x12')](_0x8242('0x11'),_0x3fb12e,_0x4ad29d);_0x4b9617(_0x4ad29d);});});}exports[_0x8242('0x15')]=function(_0xad2711){var _0x12b745=this;return new Promise(function(_0x473f67,_0x2de515){return db[_0x8242('0x16')]['findAll']({'raw':_0xad2711[_0x8242('0x17')]?_0xad2711[_0x8242('0x17')][_0x8242('0x18')]===undefined?!![]:![]:!![],'where':_0xad2711[_0x8242('0x17')]?_0xad2711[_0x8242('0x17')]['where']||null:null,'attributes':_0xad2711[_0x8242('0x17')]?_0xad2711['options'][_0x8242('0x19')]||null:null,'limit':_0xad2711[_0x8242('0x17')]?_0xad2711['options']['limit']||null:null,'include':_0xad2711[_0x8242('0x17')]?_0xad2711[_0x8242('0x17')][_0x8242('0x1a')]?_[_0x8242('0x1b')](_0xad2711[_0x8242('0x17')][_0x8242('0x1a')],function(_0x35196f){return{'model':db[_0x35196f['model']],'as':_0x35196f['as'],'attributes':_0x35196f['attributes'],'include':_0x35196f['include']?_[_0x8242('0x1b')](_0x35196f[_0x8242('0x1a')],function(_0x4e3caa){return{'model':db[_0x4e3caa['model']],'as':_0x4e3caa['as'],'attributes':_0x4e3caa[_0x8242('0x19')],'include':_0x4e3caa[_0x8242('0x1a')]?_['map'](_0x4e3caa[_0x8242('0x1a')],function(_0x483632){return{'model':db[_0x483632[_0x8242('0x1c')]],'as':_0x483632['as'],'attributes':_0x483632['attributes']};}):[]};}):[]};}):[]:[]})[_0x8242('0xd')](function(_0x20f2b7){logger['info'](_0x8242('0x15'),_0xad2711);logger[_0x8242('0x10')](_0x8242('0x15'),_0xad2711,JSON[_0x8242('0x1d')](_0x20f2b7));_0x473f67(_0x20f2b7);})[_0x8242('0x1e')](function(_0x2766b0){logger[_0x8242('0x12')](_0x8242('0x15'),_0x2766b0[_0x8242('0x13')],_0xad2711);_0x2de515(_0x12b745[_0x8242('0x12')](0x1f4,_0x2766b0[_0x8242('0x13')]));});});};exports[_0x8242('0x1f')]=function(_0x44f2ca){var _0x163b1e=this;return new Promise(function(_0x358fd1,_0x22edf0){return db[_0x8242('0x16')][_0x8242('0x20')]({'raw':_0x44f2ca[_0x8242('0x17')]?_0x44f2ca[_0x8242('0x17')][_0x8242('0x18')]===undefined?!![]:![]:!![],'where':_0x44f2ca[_0x8242('0x17')]?_0x44f2ca[_0x8242('0x17')]['where']||null:null,'attributes':_0x44f2ca[_0x8242('0x17')]?_0x44f2ca[_0x8242('0x17')][_0x8242('0x19')]||null:null,'include':_0x44f2ca[_0x8242('0x17')]?_0x44f2ca[_0x8242('0x17')][_0x8242('0x1a')]?_[_0x8242('0x1b')](_0x44f2ca['options']['include'],function(_0x6e75ef){return{'model':db[_0x6e75ef['model']],'as':_0x6e75ef['as'],'attributes':_0x6e75ef[_0x8242('0x19')],'include':_0x6e75ef['include']?_[_0x8242('0x1b')](_0x6e75ef[_0x8242('0x1a')],function(_0x1176ed){return{'model':db[_0x1176ed[_0x8242('0x1c')]],'as':_0x1176ed['as'],'attributes':_0x1176ed[_0x8242('0x19')],'include':_0x1176ed[_0x8242('0x1a')]?_[_0x8242('0x1b')](_0x1176ed['include'],function(_0x56a069){return{'model':db[_0x56a069[_0x8242('0x1c')]],'as':_0x56a069['as'],'attributes':_0x56a069[_0x8242('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8242('0xd')](function(_0x59c54){logger['info'](_0x8242('0x1f'),_0x44f2ca);logger['debug'](_0x8242('0x1f'),_0x44f2ca,JSON[_0x8242('0x1d')](_0x59c54));_0x358fd1(_0x59c54);})[_0x8242('0x1e')](function(_0x5a8a75){logger['error'](_0x8242('0x1f'),_0x5a8a75[_0x8242('0x13')],_0x44f2ca);_0x22edf0(_0x163b1e['error'](0x1f4,_0x5a8a75[_0x8242('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js
index 2c0ff31..8d507a7 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 _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
+var _0x1d8a=['/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields'];(function(_0x1614d5,_0x2067c3){var _0x3cbf5b=function(_0x56f363){while(--_0x56f363){_0x1614d5['push'](_0x1614d5['shift']());}};_0x3cbf5b(++_0x2067c3);}(_0x1d8a,0xe9));var _0xa1d8=function(_0x419815,_0x370a6b){_0x419815=_0x419815-0x0;var _0x58d44b=_0x1d8a[_0x419815];return _0x58d44b;};'use strict';var multer=require(_0xa1d8('0x0'));var util=require(_0xa1d8('0x1'));var path=require(_0xa1d8('0x2'));var timeout=require(_0xa1d8('0x3'));var express=require(_0xa1d8('0x4'));var router=express[_0xa1d8('0x5')]();var auth=require(_0xa1d8('0x6'));var interaction=require(_0xa1d8('0x7'));var config=require(_0xa1d8('0x8'));var controller=require(_0xa1d8('0x9'));router['get']('/',auth[_0xa1d8('0xa')](),controller[_0xa1d8('0xb')]);router[_0xa1d8('0xc')](_0xa1d8('0xd'),auth[_0xa1d8('0xa')](),controller[_0xa1d8('0xe')]);router['get'](_0xa1d8('0xf'),auth[_0xa1d8('0xa')](),controller[_0xa1d8('0x10')]);router[_0xa1d8('0xc')]('/:id/subjects',auth[_0xa1d8('0xa')](),controller['getSubjects']);router[_0xa1d8('0xc')](_0xa1d8('0x11'),auth[_0xa1d8('0xa')](),controller[_0xa1d8('0x12')]);router[_0xa1d8('0x13')]('/',auth[_0xa1d8('0xa')](),controller['create']);router[_0xa1d8('0x14')](_0xa1d8('0xd'),auth['isAuthenticated'](),controller[_0xa1d8('0x15')]);router[_0xa1d8('0x16')](_0xa1d8('0xd'),auth[_0xa1d8('0xa')](),controller[_0xa1d8('0x17')]);module[_0xa1d8('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
index 570d983..023b05c 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 _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
+var _0x3b6f=['STRING','ENUM','phonecall','incident','sequelize','exports'];(function(_0x8c91b3,_0x1ad126){var _0x96803d=function(_0x4cebd9){while(--_0x4cebd9){_0x8c91b3['push'](_0x8c91b3['shift']());}};_0x96803d(++_0x1ad126);}(_0x3b6f,0x1f0));var _0xf3b6=function(_0x472d94,_0x3d405a){_0x472d94=_0x472d94-0x0;var _0x36d41d=_0x3b6f[_0x472d94];return _0x36d41d;};'use strict';var Sequelize=require(_0xf3b6('0x0'));module[_0xf3b6('0x1')]={'name':{'type':Sequelize[_0xf3b6('0x2')]},'description':{'type':Sequelize[_0xf3b6('0x2')]},'ticketType':{'type':Sequelize[_0xf3b6('0x3')]('incident',_0xf3b6('0x4')),'defaultValue':_0xf3b6('0x5')}};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
index 7313851..8535d04 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 _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
+var _0x8c01=['../../mysqldb','jayson/promise','http','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','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','status','end','json','offset','limit','set','Content-Range','apply','save','update','stack','name','index','map','Dynamics365Configuration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','VIRTUAL','filter','count','includeAll','findAll','rows','params','length','include','body','find','Dynamics365Field','pick','options','hasOwnProperty','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x31b5b2,_0x5ab927){var _0x364f13=function(_0x163bd0){while(--_0x163bd0){_0x31b5b2['push'](_0x31b5b2['shift']());}};_0x364f13(++_0x5ab927);}(_0x8c01,0xed));var _0x18c0=function(_0x282e44,_0x4f0355){_0x282e44=_0x282e44-0x0;var _0x36c239=_0x8c01[_0x282e44];return _0x36c239;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x18c0('0x0'));var rimraf=require(_0x18c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x18c0('0x2'));var rp=require(_0x18c0('0x3'));var moment=require(_0x18c0('0x4'));var BPromise=require(_0x18c0('0x5'));var Mustache=require(_0x18c0('0x6'));var util=require(_0x18c0('0x7'));var path=require(_0x18c0('0x8'));var sox=require(_0x18c0('0x9'));var csv=require(_0x18c0('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x18c0('0xb'));var squel=require(_0x18c0('0xc'));var crypto=require(_0x18c0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x18c0('0xe'));var toCsv=require(_0x18c0('0xa'));var querystring=require(_0x18c0('0xf'));var Papa=require(_0x18c0('0x10'));var Redis=require('ioredis');var authService=require(_0x18c0('0x11'));var qs=require(_0x18c0('0x12'));var as=require(_0x18c0('0x13'));var hardwareService=require(_0x18c0('0x14'));var logger=require('../../config/logger')(_0x18c0('0x15'));var utils=require(_0x18c0('0x16'));var config=require(_0x18c0('0x17'));var db=require(_0x18c0('0x18'))['db'];var jayson=require(_0x18c0('0x19'));var client=jayson['client'][_0x18c0('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x56f08f,_0x17481b,_0x23f3d7){if(_0x23f3d7){var _0x1dbbed=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1dbbed['test'](_0x17481b)){return _0x56f08f;}else{throw new db[(_0x18c0('0x1b'))]['ValidationError'](_0x18c0('0x1c'));}}else{return _0x56f08f;}}function respondWithRpcPromise(_0x227cd6,_0x4aa350,_0x305962,_0x4d45fc){return new BPromise(function(_0x980bc4,_0x5b1a1f){var _0x39264b=_0x4d45fc||client;return _0x39264b[_0x18c0('0x1d')](_0x227cd6,_0x305962)[_0x18c0('0x1e')](function(_0x2f5878){logger[_0x18c0('0x1f')](_0x18c0('0x20'),_0x4aa350,_0x18c0('0x21'));logger[_0x18c0('0x22')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4aa350,_0x18c0('0x21'),JSON['stringify'](_0x2f5878));if(_0x2f5878[_0x18c0('0x23')]){if(_0x2f5878['error']['code']===0x1f4){logger[_0x18c0('0x23')](_0x18c0('0x20'),_0x4aa350,_0x2f5878[_0x18c0('0x23')]['message']);return _0x5b1a1f(_0x2f5878['error']['message']);}logger[_0x18c0('0x23')](_0x18c0('0x20'),_0x4aa350,_0x2f5878[_0x18c0('0x23')][_0x18c0('0x24')]);return _0x980bc4(_0x2f5878[_0x18c0('0x23')][_0x18c0('0x24')]);}else{logger[_0x18c0('0x1f')](_0x18c0('0x20'),_0x4aa350,_0x18c0('0x21'));_0x980bc4(_0x2f5878['result']['message']);}})[_0x18c0('0x25')](function(_0x328292){logger['error'](_0x18c0('0x20'),_0x4aa350,_0x328292);_0x5b1a1f(_0x328292);});});}function respondWithStatusCode(_0x2d15fe,_0x1f2a4e){_0x1f2a4e=_0x1f2a4e||0xcc;return function(_0x4a1fef){if(_0x4a1fef){return _0x2d15fe['sendStatus'](_0x1f2a4e);}return _0x2d15fe[_0x18c0('0x26')](_0x1f2a4e)[_0x18c0('0x27')]();};}function respondWithResult(_0x104abb,_0x2ed991){_0x2ed991=_0x2ed991||0xc8;return function(_0x246cb5){if(_0x246cb5){return _0x104abb['status'](_0x2ed991)[_0x18c0('0x28')](_0x246cb5);}};}function respondWithFilteredResult(_0x2eabb,_0x4bc5e5){return function(_0x4fbaf4){if(_0x4fbaf4){var _0x173df6=_0x4fbaf4['count'],_0x7c9389=_0x4bc5e5[_0x18c0('0x29')],_0x32ce82=_0x4bc5e5['offset']+_0x4bc5e5[_0x18c0('0x2a')],_0x4e4ee8;if(_0x32ce82>=_0x173df6){_0x32ce82=_0x173df6;_0x4e4ee8=0xc8;}else{_0x4e4ee8=0xce;}_0x2eabb[_0x18c0('0x26')](_0x4e4ee8);return _0x2eabb[_0x18c0('0x2b')](_0x18c0('0x2c'),_0x7c9389+'-'+_0x32ce82+'/'+_0x173df6)['json'](_0x4fbaf4);}return null;};}function patchUpdates(_0x3da275){return function(_0x2e122f){try{jsonpatch[_0x18c0('0x2d')](_0x2e122f,_0x3da275,!![]);}catch(_0x11f9bf){return BPromise['reject'](_0x11f9bf);}return _0x2e122f[_0x18c0('0x2e')]();};}function saveUpdates(_0x4e633c,_0x31ca44){return function(_0x48b089){if(_0x48b089){return _0x48b089[_0x18c0('0x2f')](_0x4e633c)[_0x18c0('0x1e')](function(_0x1de428){return _0x1de428;});}return null;};}function removeEntity(_0x2e8886,_0x390c4c){return function(_0x5a773a){if(_0x5a773a){return _0x5a773a['destroy']()['then'](function(){_0x2e8886[_0x18c0('0x26')](0xcc)[_0x18c0('0x27')]();});}};}function handleEntityNotFound(_0x34017c,_0x3f2360){return function(_0x3c1bd2){if(!_0x3c1bd2){_0x34017c['sendStatus'](0x194);}return _0x3c1bd2;};}function handleError(_0x543739,_0x4d6372){_0x4d6372=_0x4d6372||0x1f4;return function(_0x1f867b){logger[_0x18c0('0x23')](_0x1f867b[_0x18c0('0x30')]);if(_0x1f867b[_0x18c0('0x31')]){delete _0x1f867b[_0x18c0('0x31')];}_0x543739[_0x18c0('0x26')](_0x4d6372)['send'](_0x1f867b);};}exports[_0x18c0('0x32')]=function(_0x238064,_0x92fa75){var _0x41898f={},_0x41ea67={},_0xcc6951={'count':0x0,'rows':[]};var _0x2b7491=_[_0x18c0('0x33')](db[_0x18c0('0x34')][_0x18c0('0x35')],function(_0x5c8ebc){return{'name':_0x5c8ebc['fieldName'],'type':_0x5c8ebc[_0x18c0('0x36')][_0x18c0('0x37')]};});_0x41ea67[_0x18c0('0x38')]=_[_0x18c0('0x33')](_0x2b7491,_0x18c0('0x31'));_0x41ea67['query']=_[_0x18c0('0x39')](_0x238064[_0x18c0('0x3a')]);_0x41ea67[_0x18c0('0x3b')]=_[_0x18c0('0x3c')](_0x41ea67[_0x18c0('0x38')],_0x41ea67[_0x18c0('0x3a')]);_0x41898f[_0x18c0('0x3d')]=_['intersection'](_0x41ea67[_0x18c0('0x38')],qs[_0x18c0('0x3e')](_0x238064[_0x18c0('0x3a')]['fields']));_0x41898f[_0x18c0('0x3d')]=_0x41898f[_0x18c0('0x3d')]['length']?_0x41898f[_0x18c0('0x3d')]:_0x41ea67['model'];if(!_0x238064['query']['hasOwnProperty'](_0x18c0('0x3f'))){_0x41898f[_0x18c0('0x2a')]=qs['limit'](_0x238064[_0x18c0('0x3a')][_0x18c0('0x2a')]);_0x41898f['offset']=qs[_0x18c0('0x29')](_0x238064['query'][_0x18c0('0x29')]);}_0x41898f[_0x18c0('0x40')]=qs[_0x18c0('0x41')](_0x238064[_0x18c0('0x3a')][_0x18c0('0x41')]);_0x41898f[_0x18c0('0x42')]=qs['filters'](_['pick'](_0x238064['query'],_0x41ea67[_0x18c0('0x3b')]),_0x2b7491);if(_0x238064['query']['filter']){_0x41898f['where']=_[_0x18c0('0x43')](_0x41898f[_0x18c0('0x42')],{'$or':_[_0x18c0('0x33')](_0x2b7491,function(_0x416d94){if(_0x416d94[_0x18c0('0x36')]!==_0x18c0('0x44')){var _0x246876={};_0x246876[_0x416d94['name']]={'$like':'%'+_0x238064[_0x18c0('0x3a')][_0x18c0('0x45')]+'%'};return _0x246876;}})});}_0x41898f=_['merge']({},_0x41898f,_0x238064['options']);var _0x2142fe={'where':_0x41898f[_0x18c0('0x42')]};return db[_0x18c0('0x34')][_0x18c0('0x46')](_0x2142fe)[_0x18c0('0x1e')](function(_0x46bd89){_0xcc6951[_0x18c0('0x46')]=_0x46bd89;if(_0x238064[_0x18c0('0x3a')][_0x18c0('0x47')]){_0x41898f['include']=[{'all':!![]}];}return db[_0x18c0('0x34')][_0x18c0('0x48')](_0x41898f);})['then'](function(_0x2bf6be){_0xcc6951[_0x18c0('0x49')]=_0x2bf6be;return _0xcc6951;})[_0x18c0('0x1e')](respondWithFilteredResult(_0x92fa75,_0x41898f))[_0x18c0('0x25')](handleError(_0x92fa75,null));};exports['show']=function(_0x15a7ed,_0x58ba22){var _0x2a97d0={'raw':![],'where':{'id':_0x15a7ed[_0x18c0('0x4a')]['id']}},_0x490c2f={};_0x490c2f[_0x18c0('0x38')]=_[_0x18c0('0x39')](db[_0x18c0('0x34')]['rawAttributes']);_0x490c2f[_0x18c0('0x3a')]=_[_0x18c0('0x39')](_0x15a7ed[_0x18c0('0x3a')]);_0x490c2f[_0x18c0('0x3b')]=_[_0x18c0('0x3c')](_0x490c2f['model'],_0x490c2f[_0x18c0('0x3a')]);_0x2a97d0['attributes']=_[_0x18c0('0x3c')](_0x490c2f[_0x18c0('0x38')],qs[_0x18c0('0x3e')](_0x15a7ed[_0x18c0('0x3a')][_0x18c0('0x3e')]));_0x2a97d0['attributes']=_0x2a97d0[_0x18c0('0x3d')][_0x18c0('0x4b')]?_0x2a97d0[_0x18c0('0x3d')]:_0x490c2f[_0x18c0('0x38')];if(_0x15a7ed[_0x18c0('0x3a')][_0x18c0('0x47')]){_0x2a97d0[_0x18c0('0x4c')]=[{'all':!![]}];}_0x2a97d0=_[_0x18c0('0x43')]({},_0x2a97d0,_0x15a7ed['options']);return db[_0x18c0('0x34')]['find'](_0x2a97d0)[_0x18c0('0x1e')](handleEntityNotFound(_0x58ba22,null))[_0x18c0('0x1e')](respondWithResult(_0x58ba22,null))[_0x18c0('0x25')](handleError(_0x58ba22,null));};exports['create']=function(_0x5adffb,_0xe67995){return db['Dynamics365Configuration']['create'](_0x5adffb[_0x18c0('0x4d')],{})[_0x18c0('0x1e')](respondWithResult(_0xe67995,0xc9))['catch'](handleError(_0xe67995,null));};exports['update']=function(_0x2bfbfb,_0xedb9ec){if(_0x2bfbfb[_0x18c0('0x4d')]['id']){delete _0x2bfbfb[_0x18c0('0x4d')]['id'];}return db[_0x18c0('0x34')][_0x18c0('0x4e')]({'where':{'id':_0x2bfbfb[_0x18c0('0x4a')]['id']}})[_0x18c0('0x1e')](handleEntityNotFound(_0xedb9ec,null))[_0x18c0('0x1e')](saveUpdates(_0x2bfbfb[_0x18c0('0x4d')],null))[_0x18c0('0x1e')](respondWithResult(_0xedb9ec,null))[_0x18c0('0x25')](handleError(_0xedb9ec,null));};exports['destroy']=function(_0x426fc1,_0x2aa185){return db[_0x18c0('0x34')][_0x18c0('0x4e')]({'where':{'id':_0x426fc1[_0x18c0('0x4a')]['id']}})[_0x18c0('0x1e')](handleEntityNotFound(_0x2aa185,null))[_0x18c0('0x1e')](removeEntity(_0x2aa185,null))[_0x18c0('0x25')](handleError(_0x2aa185,null));};exports['getFields']=function(_0x174c5d,_0x137269,_0x5cf5a2){var _0x57b569={};var _0x4d2045={};var _0xc2eb56;var _0x100818;return db[_0x18c0('0x34')]['findOne']({'where':{'id':_0x174c5d[_0x18c0('0x4a')]['id']}})[_0x18c0('0x1e')](handleEntityNotFound(_0x137269,null))['then'](function(_0xdde928){if(_0xdde928){_0xc2eb56=_0xdde928;_0x4d2045['model']=_[_0x18c0('0x39')](db[_0x18c0('0x4f')][_0x18c0('0x35')]);_0x4d2045['query']=_[_0x18c0('0x39')](_0x174c5d[_0x18c0('0x3a')]);_0x4d2045[_0x18c0('0x3b')]=_[_0x18c0('0x3c')](_0x4d2045[_0x18c0('0x38')],_0x4d2045['query']);_0x57b569[_0x18c0('0x3d')]=_[_0x18c0('0x3c')](_0x4d2045[_0x18c0('0x38')],qs[_0x18c0('0x3e')](_0x174c5d[_0x18c0('0x3a')][_0x18c0('0x3e')]));_0x57b569[_0x18c0('0x3d')]=_0x57b569[_0x18c0('0x3d')][_0x18c0('0x4b')]?_0x57b569[_0x18c0('0x3d')]:_0x4d2045[_0x18c0('0x38')];_0x57b569[_0x18c0('0x40')]=qs[_0x18c0('0x41')](_0x174c5d[_0x18c0('0x3a')][_0x18c0('0x41')]);_0x57b569[_0x18c0('0x42')]=qs[_0x18c0('0x3b')](_[_0x18c0('0x50')](_0x174c5d[_0x18c0('0x3a')],_0x4d2045[_0x18c0('0x3b')]));if(_0x174c5d[_0x18c0('0x3a')][_0x18c0('0x45')]){_0x57b569['where']=_[_0x18c0('0x43')](_0x57b569['where'],{'$or':_['map'](_0x57b569[_0x18c0('0x3d')],function(_0x546bd7){var _0x5b3777={};_0x5b3777[_0x546bd7]={'$like':'%'+_0x174c5d['query'][_0x18c0('0x45')]+'%'};return _0x5b3777;})});}_0x57b569=_[_0x18c0('0x43')]({},_0x57b569,_0x174c5d[_0x18c0('0x51')]);return _0xc2eb56['getFields'](_0x57b569);}})[_0x18c0('0x1e')](function(_0x18b5ad){if(_0x18b5ad){_0x100818=_0x18b5ad[_0x18c0('0x4b')];if(!_0x174c5d[_0x18c0('0x3a')][_0x18c0('0x52')](_0x18c0('0x3f'))){_0x57b569[_0x18c0('0x2a')]=qs[_0x18c0('0x2a')](_0x174c5d[_0x18c0('0x3a')][_0x18c0('0x2a')]);_0x57b569[_0x18c0('0x29')]=qs['offset'](_0x174c5d[_0x18c0('0x3a')]['offset']);}return _0xc2eb56[_0x18c0('0x53')](_0x57b569);}})[_0x18c0('0x1e')](function(_0x18c7ea){if(_0x18c7ea){return _0x18c7ea?{'count':_0x100818,'rows':_0x18c7ea}:null;}})[_0x18c0('0x1e')](respondWithResult(_0x137269,null))[_0x18c0('0x25')](handleError(_0x137269,null));};exports['getSubjects']=function(_0x4bd257,_0x280425,_0x3b74d3){var _0x5924ad={};var _0x2ba3dc={};var _0x10c062;var _0x21dcc0;return db[_0x18c0('0x34')]['findOne']({'where':{'id':_0x4bd257[_0x18c0('0x4a')]['id']}})[_0x18c0('0x1e')](handleEntityNotFound(_0x280425,null))[_0x18c0('0x1e')](function(_0x37d0e8){if(_0x37d0e8){_0x10c062=_0x37d0e8;_0x2ba3dc['model']=_[_0x18c0('0x39')](db[_0x18c0('0x4f')][_0x18c0('0x35')]);_0x2ba3dc[_0x18c0('0x3a')]=_[_0x18c0('0x39')](_0x4bd257[_0x18c0('0x3a')]);_0x2ba3dc[_0x18c0('0x3b')]=_[_0x18c0('0x3c')](_0x2ba3dc[_0x18c0('0x38')],_0x2ba3dc[_0x18c0('0x3a')]);_0x5924ad[_0x18c0('0x3d')]=_[_0x18c0('0x3c')](_0x2ba3dc['model'],qs[_0x18c0('0x3e')](_0x4bd257['query'][_0x18c0('0x3e')]));_0x5924ad[_0x18c0('0x3d')]=_0x5924ad[_0x18c0('0x3d')][_0x18c0('0x4b')]?_0x5924ad[_0x18c0('0x3d')]:_0x2ba3dc['model'];_0x5924ad[_0x18c0('0x40')]=qs[_0x18c0('0x41')](_0x4bd257[_0x18c0('0x3a')]['sort']);_0x5924ad['where']=qs[_0x18c0('0x3b')](_[_0x18c0('0x50')](_0x4bd257[_0x18c0('0x3a')],_0x2ba3dc[_0x18c0('0x3b')]));if(_0x4bd257['query']['filter']){_0x5924ad[_0x18c0('0x42')]=_[_0x18c0('0x43')](_0x5924ad[_0x18c0('0x42')],{'$or':_[_0x18c0('0x33')](_0x5924ad['attributes'],function(_0x50d539){var _0x5185d1={};_0x5185d1[_0x50d539]={'$like':'%'+_0x4bd257[_0x18c0('0x3a')][_0x18c0('0x45')]+'%'};return _0x5185d1;})});}_0x5924ad=_[_0x18c0('0x43')]({},_0x5924ad,_0x4bd257[_0x18c0('0x51')]);return _0x10c062[_0x18c0('0x54')](_0x5924ad);}})[_0x18c0('0x1e')](function(_0x45712f){if(_0x45712f){_0x21dcc0=_0x45712f[_0x18c0('0x4b')];if(!_0x4bd257[_0x18c0('0x3a')][_0x18c0('0x52')](_0x18c0('0x3f'))){_0x5924ad['limit']=qs[_0x18c0('0x2a')](_0x4bd257[_0x18c0('0x3a')][_0x18c0('0x2a')]);_0x5924ad[_0x18c0('0x29')]=qs[_0x18c0('0x29')](_0x4bd257[_0x18c0('0x3a')][_0x18c0('0x29')]);}return _0x10c062[_0x18c0('0x54')](_0x5924ad);}})[_0x18c0('0x1e')](function(_0x6b7122){if(_0x6b7122){return _0x6b7122?{'count':_0x21dcc0,'rows':_0x6b7122}:null;}})['then'](respondWithResult(_0x280425,null))[_0x18c0('0x25')](handleError(_0x280425,null));};exports['getDescriptions']=function(_0x38bac6,_0x195f7f,_0x3194f2){var _0x418c26={};var _0x5589de={};var _0x3d3f81;var _0x4b4834;return db[_0x18c0('0x34')][_0x18c0('0x55')]({'where':{'id':_0x38bac6['params']['id']}})[_0x18c0('0x1e')](handleEntityNotFound(_0x195f7f,null))[_0x18c0('0x1e')](function(_0x4a76a6){if(_0x4a76a6){_0x3d3f81=_0x4a76a6;_0x5589de[_0x18c0('0x38')]=_[_0x18c0('0x39')](db[_0x18c0('0x4f')][_0x18c0('0x35')]);_0x5589de[_0x18c0('0x3a')]=_[_0x18c0('0x39')](_0x38bac6[_0x18c0('0x3a')]);_0x5589de[_0x18c0('0x3b')]=_[_0x18c0('0x3c')](_0x5589de[_0x18c0('0x38')],_0x5589de[_0x18c0('0x3a')]);_0x418c26['attributes']=_[_0x18c0('0x3c')](_0x5589de[_0x18c0('0x38')],qs['fields'](_0x38bac6[_0x18c0('0x3a')][_0x18c0('0x3e')]));_0x418c26['attributes']=_0x418c26[_0x18c0('0x3d')]['length']?_0x418c26[_0x18c0('0x3d')]:_0x5589de[_0x18c0('0x38')];_0x418c26['order']=qs[_0x18c0('0x41')](_0x38bac6[_0x18c0('0x3a')][_0x18c0('0x41')]);_0x418c26[_0x18c0('0x42')]=qs[_0x18c0('0x3b')](_[_0x18c0('0x50')](_0x38bac6['query'],_0x5589de[_0x18c0('0x3b')]));if(_0x38bac6[_0x18c0('0x3a')][_0x18c0('0x45')]){_0x418c26[_0x18c0('0x42')]=_['merge'](_0x418c26['where'],{'$or':_[_0x18c0('0x33')](_0x418c26['attributes'],function(_0x38ff41){var _0xd08569={};_0xd08569[_0x38ff41]={'$like':'%'+_0x38bac6[_0x18c0('0x3a')][_0x18c0('0x45')]+'%'};return _0xd08569;})});}_0x418c26=_['merge']({},_0x418c26,_0x38bac6[_0x18c0('0x51')]);return _0x3d3f81['getDescriptions'](_0x418c26);}})[_0x18c0('0x1e')](function(_0x4867a2){if(_0x4867a2){_0x4b4834=_0x4867a2[_0x18c0('0x4b')];if(!_0x38bac6['query'][_0x18c0('0x52')]('nolimit')){_0x418c26['limit']=qs['limit'](_0x38bac6[_0x18c0('0x3a')]['limit']);_0x418c26[_0x18c0('0x29')]=qs[_0x18c0('0x29')](_0x38bac6['query']['offset']);}return _0x3d3f81[_0x18c0('0x56')](_0x418c26);}})['then'](function(_0x56516f){if(_0x56516f){return _0x56516f?{'count':_0x4b4834,'rows':_0x56516f}:null;}})[_0x18c0('0x1e')](respondWithResult(_0x195f7f,null))[_0x18c0('0x25')](handleError(_0x195f7f,null));};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
index fad61bf..4276407 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 _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
+var _0x04f4=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x40b8d9,_0x3e6be4){var _0x51d349=function(_0x4804ba){while(--_0x4804ba){_0x40b8d9['push'](_0x40b8d9['shift']());}};_0x51d349(++_0x3e6be4);}(_0x04f4,0xa2));var _0x404f=function(_0x1680bc,_0x301d5d){_0x1680bc=_0x1680bc-0x0;var _0xa31eaf=_0x04f4[_0x1680bc];return _0xa31eaf;};'use strict';var _=require(_0x404f('0x0'));var util=require('util');var logger=require(_0x404f('0x1'))(_0x404f('0x2'));var moment=require(_0x404f('0x3'));var BPromise=require(_0x404f('0x4'));var rp=require(_0x404f('0x5'));var fs=require('fs');var path=require(_0x404f('0x6'));var rimraf=require(_0x404f('0x7'));var config=require(_0x404f('0x8'));var attributes=require(_0x404f('0x9'));module[_0x404f('0xa')]=function(_0x447ebd,_0x43a582){return _0x447ebd[_0x404f('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0x404f('0xc'),'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 195e7ae..6a32426 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 _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
+var _0xcd79=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xcd79,0x1d2));var _0x9cd7=function(_0x1bd9d5,_0x2520aa){_0x1bd9d5=_0x1bd9d5-0x0;var _0x5ad760=_0xcd79[_0x1bd9d5];return _0x5ad760;};'use strict';var _=require(_0x9cd7('0x0'));var util=require(_0x9cd7('0x1'));var moment=require(_0x9cd7('0x2'));var BPromise=require(_0x9cd7('0x3'));var rs=require(_0x9cd7('0x4'));var fs=require('fs');var Redis=require(_0x9cd7('0x5'));var db=require(_0x9cd7('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9cd7('0x7'));var jayson=require(_0x9cd7('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x14f1b0,_0x2413d9,_0x3859ac){return new BPromise(function(_0x5896c8,_0x2cea2a){return client[_0x9cd7('0x9')](_0x14f1b0,_0x3859ac)['then'](function(_0x24a90a){logger[_0x9cd7('0xa')](_0x9cd7('0xb'),_0x2413d9,_0x9cd7('0xc'));logger[_0x9cd7('0xd')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x2413d9,_0x9cd7('0xc'),JSON[_0x9cd7('0xe')](_0x24a90a));if(_0x24a90a[_0x9cd7('0xf')]){if(_0x24a90a[_0x9cd7('0xf')][_0x9cd7('0x10')]===0x1f4){logger['error'](_0x9cd7('0xb'),_0x2413d9,_0x24a90a[_0x9cd7('0xf')][_0x9cd7('0x11')]);return _0x2cea2a(_0x24a90a[_0x9cd7('0xf')][_0x9cd7('0x11')]);}logger[_0x9cd7('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2413d9,_0x24a90a['error'][_0x9cd7('0x11')]);return _0x5896c8(_0x24a90a[_0x9cd7('0xf')][_0x9cd7('0x11')]);}else{logger[_0x9cd7('0xa')](_0x9cd7('0xb'),_0x2413d9,_0x9cd7('0xc'));_0x5896c8(_0x24a90a[_0x9cd7('0x12')][_0x9cd7('0x11')]);}})[_0x9cd7('0x13')](function(_0x2862e1){logger[_0x9cd7('0xf')](_0x9cd7('0xb'),_0x2413d9,_0x2862e1);_0x2cea2a(_0x2862e1);});});}
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js
index f3abef6..80d7bed 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 _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
+var _0x422f=['../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','util','connect-timeout','express','../../components/auth/service'];(function(_0x21a8ba,_0x2b09e1){var _0x1da12a=function(_0xb9a7f0){while(--_0xb9a7f0){_0x21a8ba['push'](_0x21a8ba['shift']());}};_0x1da12a(++_0x2b09e1);}(_0x422f,0x1c7));var _0xf422=function(_0x2a656b,_0x7f9ccf){_0x2a656b=_0x2a656b-0x0;var _0x4d90ce=_0x422f[_0x2a656b];return _0x4d90ce;};'use strict';var multer=require('multer');var util=require(_0xf422('0x0'));var path=require('path');var timeout=require(_0xf422('0x1'));var express=require(_0xf422('0x2'));var router=express['Router']();var auth=require(_0xf422('0x3'));var interaction=require(_0xf422('0x4'));var config=require(_0xf422('0x5'));var controller=require(_0xf422('0x6'));router[_0xf422('0x7')]('/',auth[_0xf422('0x8')](),controller[_0xf422('0x9')]);router[_0xf422('0x7')](_0xf422('0xa'),auth['isAuthenticated'](),controller[_0xf422('0xb')]);router[_0xf422('0xc')]('/',auth[_0xf422('0x8')](),controller[_0xf422('0xd')]);router[_0xf422('0xe')]('/:id',auth[_0xf422('0x8')](),controller['update']);router['delete'](_0xf422('0xa'),auth[_0xf422('0x8')](),controller[_0xf422('0xf')]);module[_0xf422('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js
index 01e5d2f..415ae68 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 _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
+var _0xe97d=['exports','ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN'];(function(_0x59fca3,_0x376dd3){var _0x1d4906=function(_0x254ae6){while(--_0x254ae6){_0x59fca3['push'](_0x59fca3['shift']());}};_0x1d4906(++_0x376dd3);}(_0xe97d,0x178));var _0xde97=function(_0x284538,_0x54e438){_0x284538=_0x284538-0x0;var _0x5becaf=_0xe97d[_0x284538];return _0x5becaf;};'use strict';var Sequelize=require('sequelize');module[_0xde97('0x0')]={'type':{'type':Sequelize[_0xde97('0x1')](_0xde97('0x2'),_0xde97('0x3'),'customVariable',_0xde97('0x4')),'defaultValue':_0xde97('0x2')},'content':{'type':Sequelize[_0xde97('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xde97('0x3'),_0xde97('0x6'))},'keyContent':{'type':Sequelize[_0xde97('0x5')]},'idField':{'type':Sequelize[_0xde97('0x5')]},'nameField':{'type':Sequelize[_0xde97('0x5')]},'customField':{'type':Sequelize[_0xde97('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js
index d5daad8..69dbe23 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 _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
+var _0x9ffd=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','reject','save','destroy','then','error','name','send','index','map','Dynamics365Field','rawAttributes','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','include','findAll','rows','catch','intersection','length','includeAll','options','create','body','update','find','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel'];(function(_0x12c34e,_0x39287a){var _0x244e88=function(_0x34507b){while(--_0x34507b){_0x12c34e['push'](_0x12c34e['shift']());}};_0x244e88(++_0x39287a);}(_0x9ffd,0x1d7));var _0xd9ff=function(_0x67ac,_0x6b77c){_0x67ac=_0x67ac-0x0;var _0x389922=_0x9ffd[_0x67ac];return _0x389922;};'use strict';var pdf=require(_0xd9ff('0x0'));var emlformat=require(_0xd9ff('0x1'));var rimraf=require(_0xd9ff('0x2'));var zipdir=require(_0xd9ff('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x4'));var moment=require(_0xd9ff('0x5'));var BPromise=require(_0xd9ff('0x6'));var Mustache=require(_0xd9ff('0x7'));var util=require(_0xd9ff('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xd9ff('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd9ff('0xa'));var squel=require(_0xd9ff('0xb'));var crypto=require('crypto');var jsforce=require(_0xd9ff('0xc'));var deskjs=require(_0xd9ff('0xd'));var toCsv=require(_0xd9ff('0x9'));var querystring=require(_0xd9ff('0xe'));var Papa=require('papaparse');var Redis=require(_0xd9ff('0xf'));var authService=require(_0xd9ff('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd9ff('0x12'));var db=require(_0xd9ff('0x13'))['db'];function respondWithStatusCode(_0x40c45c,_0x2bb498){_0x2bb498=_0x2bb498||0xcc;return function(_0x28c488){if(_0x28c488){return _0x40c45c[_0xd9ff('0x14')](_0x2bb498);}return _0x40c45c[_0xd9ff('0x15')](_0x2bb498)[_0xd9ff('0x16')]();};}function respondWithResult(_0x15d5e5,_0x1912fb){_0x1912fb=_0x1912fb||0xc8;return function(_0x470802){if(_0x470802){return _0x15d5e5[_0xd9ff('0x15')](_0x1912fb)[_0xd9ff('0x17')](_0x470802);}};}function respondWithFilteredResult(_0x2b682b,_0x3865d7){return function(_0x40ae90){if(_0x40ae90){var _0xa44d2e=_0x40ae90['count'],_0x34b515=_0x3865d7[_0xd9ff('0x18')],_0x19661c=_0x3865d7[_0xd9ff('0x18')]+_0x3865d7[_0xd9ff('0x19')],_0x177341;if(_0x19661c>=_0xa44d2e){_0x19661c=_0xa44d2e;_0x177341=0xc8;}else{_0x177341=0xce;}_0x2b682b[_0xd9ff('0x15')](_0x177341);return _0x2b682b[_0xd9ff('0x1a')]('Content-Range',_0x34b515+'-'+_0x19661c+'/'+_0xa44d2e)[_0xd9ff('0x17')](_0x40ae90);}return null;};}function patchUpdates(_0x1d88f1){return function(_0x3ea39b){try{jsonpatch[_0xd9ff('0x1b')](_0x3ea39b,_0x1d88f1,!![]);}catch(_0x5ed648){return BPromise[_0xd9ff('0x1c')](_0x5ed648);}return _0x3ea39b[_0xd9ff('0x1d')]();};}function saveUpdates(_0x1db9c2,_0x3bd1a9){return function(_0x200fb9){if(_0x200fb9){return _0x200fb9['update'](_0x1db9c2)['then'](function(_0x488059){return _0x488059;});}return null;};}function removeEntity(_0x5381c0,_0x54f9da){return function(_0x510b79){if(_0x510b79){return _0x510b79[_0xd9ff('0x1e')]()[_0xd9ff('0x1f')](function(){_0x5381c0[_0xd9ff('0x15')](0xcc)[_0xd9ff('0x16')]();});}};}function handleEntityNotFound(_0x746dc4,_0x446d1b){return function(_0x496bf0){if(!_0x496bf0){_0x746dc4[_0xd9ff('0x14')](0x194);}return _0x496bf0;};}function handleError(_0x56293d,_0x5e556f){_0x5e556f=_0x5e556f||0x1f4;return function(_0x497ac4){logger[_0xd9ff('0x20')](_0x497ac4['stack']);if(_0x497ac4[_0xd9ff('0x21')]){delete _0x497ac4[_0xd9ff('0x21')];}_0x56293d[_0xd9ff('0x15')](_0x5e556f)[_0xd9ff('0x22')](_0x497ac4);};}exports[_0xd9ff('0x23')]=function(_0x37325f,_0x142850){var _0x34964b={},_0x5b5fd4={},_0x12ed6f={'count':0x0,'rows':[]};var _0x5c02ac=_[_0xd9ff('0x24')](db[_0xd9ff('0x25')][_0xd9ff('0x26')],function(_0x542394){return{'name':_0x542394['fieldName'],'type':_0x542394['type'][_0xd9ff('0x27')]};});_0x5b5fd4['model']=_['map'](_0x5c02ac,_0xd9ff('0x21'));_0x5b5fd4[_0xd9ff('0x28')]=_[_0xd9ff('0x29')](_0x37325f['query']);_0x5b5fd4[_0xd9ff('0x2a')]=_['intersection'](_0x5b5fd4[_0xd9ff('0x2b')],_0x5b5fd4[_0xd9ff('0x28')]);_0x34964b[_0xd9ff('0x2c')]=_['intersection'](_0x5b5fd4[_0xd9ff('0x2b')],qs[_0xd9ff('0x2d')](_0x37325f[_0xd9ff('0x28')][_0xd9ff('0x2d')]));_0x34964b['attributes']=_0x34964b[_0xd9ff('0x2c')]['length']?_0x34964b[_0xd9ff('0x2c')]:_0x5b5fd4[_0xd9ff('0x2b')];if(!_0x37325f['query'][_0xd9ff('0x2e')](_0xd9ff('0x2f'))){_0x34964b[_0xd9ff('0x19')]=qs[_0xd9ff('0x19')](_0x37325f['query'][_0xd9ff('0x19')]);_0x34964b[_0xd9ff('0x18')]=qs[_0xd9ff('0x18')](_0x37325f['query'][_0xd9ff('0x18')]);}_0x34964b[_0xd9ff('0x30')]=qs[_0xd9ff('0x31')](_0x37325f[_0xd9ff('0x28')][_0xd9ff('0x31')]);_0x34964b[_0xd9ff('0x32')]=qs[_0xd9ff('0x2a')](_[_0xd9ff('0x33')](_0x37325f[_0xd9ff('0x28')],_0x5b5fd4['filters']),_0x5c02ac);if(_0x37325f[_0xd9ff('0x28')][_0xd9ff('0x34')]){_0x34964b['where']=_[_0xd9ff('0x35')](_0x34964b[_0xd9ff('0x32')],{'$or':_[_0xd9ff('0x24')](_0x5c02ac,function(_0x60d989){if(_0x60d989['type']!==_0xd9ff('0x36')){var _0x17b4e0={};_0x17b4e0[_0x60d989['name']]={'$like':'%'+_0x37325f['query'][_0xd9ff('0x34')]+'%'};return _0x17b4e0;}})});}_0x34964b=_[_0xd9ff('0x35')]({},_0x34964b,_0x37325f['options']);var _0x5324ff={'where':_0x34964b[_0xd9ff('0x32')]};return db['Dynamics365Field'][_0xd9ff('0x37')](_0x5324ff)[_0xd9ff('0x1f')](function(_0x4f990c){_0x12ed6f[_0xd9ff('0x37')]=_0x4f990c;if(_0x37325f[_0xd9ff('0x28')]['includeAll']){_0x34964b[_0xd9ff('0x38')]=[{'all':!![]}];}return db[_0xd9ff('0x25')][_0xd9ff('0x39')](_0x34964b);})[_0xd9ff('0x1f')](function(_0x3f1f39){_0x12ed6f[_0xd9ff('0x3a')]=_0x3f1f39;return _0x12ed6f;})[_0xd9ff('0x1f')](respondWithFilteredResult(_0x142850,_0x34964b))[_0xd9ff('0x3b')](handleError(_0x142850,null));};exports['show']=function(_0x472034,_0x4eeaaa){var _0x3e7d1c={'raw':!![],'where':{'id':_0x472034['params']['id']}},_0x39edfe={};_0x39edfe[_0xd9ff('0x2b')]=_[_0xd9ff('0x29')](db[_0xd9ff('0x25')][_0xd9ff('0x26')]);_0x39edfe[_0xd9ff('0x28')]=_[_0xd9ff('0x29')](_0x472034[_0xd9ff('0x28')]);_0x39edfe[_0xd9ff('0x2a')]=_[_0xd9ff('0x3c')](_0x39edfe[_0xd9ff('0x2b')],_0x39edfe['query']);_0x3e7d1c[_0xd9ff('0x2c')]=_[_0xd9ff('0x3c')](_0x39edfe[_0xd9ff('0x2b')],qs[_0xd9ff('0x2d')](_0x472034[_0xd9ff('0x28')]['fields']));_0x3e7d1c[_0xd9ff('0x2c')]=_0x3e7d1c[_0xd9ff('0x2c')][_0xd9ff('0x3d')]?_0x3e7d1c[_0xd9ff('0x2c')]:_0x39edfe['model'];if(_0x472034[_0xd9ff('0x28')][_0xd9ff('0x3e')]){_0x3e7d1c['include']=[{'all':!![]}];}_0x3e7d1c=_[_0xd9ff('0x35')]({},_0x3e7d1c,_0x472034[_0xd9ff('0x3f')]);return db['Dynamics365Field']['find'](_0x3e7d1c)[_0xd9ff('0x1f')](handleEntityNotFound(_0x4eeaaa,null))['then'](respondWithResult(_0x4eeaaa,null))[_0xd9ff('0x3b')](handleError(_0x4eeaaa,null));};exports[_0xd9ff('0x40')]=function(_0x546f36,_0x2ed6c1){return db['Dynamics365Field'][_0xd9ff('0x40')](_0x546f36[_0xd9ff('0x41')],{})['then'](respondWithResult(_0x2ed6c1,0xc9))[_0xd9ff('0x3b')](handleError(_0x2ed6c1,null));};exports[_0xd9ff('0x42')]=function(_0x11dd75,_0x5a8e96){if(_0x11dd75[_0xd9ff('0x41')]['id']){delete _0x11dd75[_0xd9ff('0x41')]['id'];}return db[_0xd9ff('0x25')][_0xd9ff('0x43')]({'where':{'id':_0x11dd75[_0xd9ff('0x44')]['id']}})[_0xd9ff('0x1f')](handleEntityNotFound(_0x5a8e96,null))[_0xd9ff('0x1f')](saveUpdates(_0x11dd75[_0xd9ff('0x41')],null))[_0xd9ff('0x1f')](respondWithResult(_0x5a8e96,null))[_0xd9ff('0x3b')](handleError(_0x5a8e96,null));};exports[_0xd9ff('0x1e')]=function(_0x1f4cc5,_0x1463da){return db['Dynamics365Field'][_0xd9ff('0x43')]({'where':{'id':_0x1f4cc5[_0xd9ff('0x44')]['id']}})[_0xd9ff('0x1f')](handleEntityNotFound(_0x1463da,null))[_0xd9ff('0x1f')](removeEntity(_0x1463da,null))['catch'](handleError(_0x1463da,null));};
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js
index 9c491d3..a6b8802 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 _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
+var _0xabe6=['int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0xabe6,0x6d));var _0x6abe=function(_0x119463,_0xb41dab){_0x119463=_0x119463-0x0;var _0x498ed6=_0xabe6[_0x119463];return _0x498ed6;};'use strict';var _=require(_0x6abe('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6abe('0x1'));var moment=require(_0x6abe('0x2'));var BPromise=require(_0x6abe('0x3'));var rp=require(_0x6abe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6abe('0x5'));var config=require(_0x6abe('0x6'));var attributes=require(_0x6abe('0x7'));module[_0x6abe('0x8')]=function(_0x59b5c1,_0x3ec53f){return _0x59b5c1[_0x6abe('0x9')](_0x6abe('0xa'),attributes,{'tableName':_0x6abe('0xb'),'paranoid':![],'indexes':[{'name':_0x6abe('0xc'),'fields':[_0x6abe('0xd'),_0x6abe('0xe')],'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 fe723b9..4155aa2 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 _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
+var _0xdc59=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x36862d,_0x4f5d23){var _0x3aa4b9=function(_0x111477){while(--_0x111477){_0x36862d['push'](_0x36862d['shift']());}};_0x3aa4b9(++_0x4f5d23);}(_0xdc59,0x12c));var _0x9dc5=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xdc59[_0x599e60];return _0x468e19;};'use strict';var _=require(_0x9dc5('0x0'));var util=require(_0x9dc5('0x1'));var moment=require(_0x9dc5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9dc5('0x3'));var db=require(_0x9dc5('0x4'))['db'];var utils=require(_0x9dc5('0x5'));var logger=require(_0x9dc5('0x6'))(_0x9dc5('0x7'));var config=require(_0x9dc5('0x8'));var jayson=require(_0x9dc5('0x9'));var client=jayson[_0x9dc5('0xa')][_0x9dc5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48beee,_0x42941b,_0x10b268){return new BPromise(function(_0x202a8a,_0x3729b6){return client[_0x9dc5('0xc')](_0x48beee,_0x10b268)[_0x9dc5('0xd')](function(_0x174835){logger[_0x9dc5('0xe')](_0x9dc5('0xf'),_0x42941b,_0x9dc5('0x10'));logger['debug'](_0x9dc5('0x11'),_0x42941b,_0x9dc5('0x10'),JSON[_0x9dc5('0x12')](_0x174835));if(_0x174835[_0x9dc5('0x13')]){if(_0x174835['error'][_0x9dc5('0x14')]===0x1f4){logger[_0x9dc5('0x13')](_0x9dc5('0xf'),_0x42941b,_0x174835['error'][_0x9dc5('0x15')]);return _0x3729b6(_0x174835[_0x9dc5('0x13')][_0x9dc5('0x15')]);}logger[_0x9dc5('0x13')](_0x9dc5('0xf'),_0x42941b,_0x174835[_0x9dc5('0x13')][_0x9dc5('0x15')]);return _0x202a8a(_0x174835[_0x9dc5('0x13')][_0x9dc5('0x15')]);}else{logger[_0x9dc5('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x42941b,_0x9dc5('0x10'));_0x202a8a(_0x174835['result'][_0x9dc5('0x15')]);}})[_0x9dc5('0x16')](function(_0x5a9ffb){logger[_0x9dc5('0x13')](_0x9dc5('0xf'),_0x42941b,_0x5a9ffb);_0x3729b6(_0x5a9ffb);});});}
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js
index 3f303b3..0e67a86 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 _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
+var _0x25e9=['post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields'];(function(_0x1760a7,_0x18c79b){var _0x384ac0=function(_0x21d5fa){while(--_0x21d5fa){_0x1760a7['push'](_0x1760a7['shift']());}};_0x384ac0(++_0x18c79b);}(_0x25e9,0x133));var _0x925e=function(_0xaf8280,_0x5c1176){_0xaf8280=_0xaf8280-0x0;var _0x1b92a5=_0x25e9[_0xaf8280];return _0x1b92a5;};'use strict';var multer=require(_0x925e('0x0'));var util=require(_0x925e('0x1'));var path=require(_0x925e('0x2'));var timeout=require('connect-timeout');var express=require(_0x925e('0x3'));var router=express[_0x925e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x925e('0x5'));var config=require(_0x925e('0x6'));var controller=require(_0x925e('0x7'));router[_0x925e('0x8')]('/',auth[_0x925e('0x9')](),controller[_0x925e('0xa')]);router[_0x925e('0x8')]('/:id',auth[_0x925e('0x9')](),controller[_0x925e('0xb')]);router[_0x925e('0x8')](_0x925e('0xc'),auth[_0x925e('0x9')](),controller['getConfigurations']);router['get'](_0x925e('0xd'),auth[_0x925e('0x9')](),controller[_0x925e('0xe')]);router[_0x925e('0xf')]('/',auth[_0x925e('0x9')](),controller[_0x925e('0x10')]);router[_0x925e('0xf')](_0x925e('0xc'),auth[_0x925e('0x9')](),controller[_0x925e('0x11')]);router[_0x925e('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x925e('0x13')]);router[_0x925e('0x14')]('/:id',auth[_0x925e('0x9')](),controller[_0x925e('0x15')]);module[_0x925e('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
index 618d591..0f38411 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 _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
+var _0x01d3=['username','remoteUri','sequelize','exports','STRING'];(function(_0x58b25d,_0x4a332e){var _0x45289e=function(_0x33c280){while(--_0x33c280){_0x58b25d['push'](_0x58b25d['shift']());}};_0x45289e(++_0x4a332e);}(_0x01d3,0xa2));var _0x301d=function(_0x5b8064,_0x18e7e2){_0x5b8064=_0x5b8064-0x0;var _0x111d62=_0x01d3[_0x5b8064];return _0x111d62;};'use strict';var Sequelize=require(_0x301d('0x0'));module[_0x301d('0x1')]={'name':{'type':Sequelize[_0x301d('0x2')]},'description':{'type':Sequelize[_0x301d('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x301d('0x3')},'apiKey':{'type':Sequelize[_0x301d('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x301d('0x4')},'serverUrl':{'type':Sequelize[_0x301d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
index 70aef47..29acf89 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 _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
+var _0xabce=['%s/%s','api/v2/ticket_fields','base64','requester','agent','priority','source','company','remove','includes','custom_text','custom_dropdown','label','default','choices','test','stringify','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','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','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','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~!@#$%^&-_=+[{]}.','then','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','offset','limit','Content-Range','apply','reject','save','update','stack','name','send','FreshdeskAccount','map','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','order','sort','pick','merge','VIRTUAL','filter','options','where','includeAll','include','rows','show','params','rawAttributes','fields','find','create','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','getSubjects','channel','getDescriptions','type','FreshdeskField','Subjects','Descriptions','getFields','remoteUri','slice','substring','GET','format'];(function(_0x31a9bc,_0x144bc6){var _0x18caea=function(_0x33225e){while(--_0x33225e){_0x31a9bc['push'](_0x31a9bc['shift']());}};_0x18caea(++_0x144bc6);}(_0xabce,0x103));var _0xeabc=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xabce[_0x543084];return _0x306a57;};'use strict';var pdf=require(_0xeabc('0x0'));var emlformat=require(_0xeabc('0x1'));var rimraf=require(_0xeabc('0x2'));var zipdir=require(_0xeabc('0x3'));var jsonpatch=require(_0xeabc('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeabc('0x5'));var Mustache=require(_0xeabc('0x6'));var util=require(_0xeabc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xeabc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var db=require(_0xeabc('0x18'))['db'];var integrations=require(_0xeabc('0x19'));var jayson=require(_0xeabc('0x1a'));var client=jayson[_0xeabc('0x1b')][_0xeabc('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x53df9c,_0x235c2d,_0x1319f3){if(_0x1319f3){var _0x3251c6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3251c6['test'](_0x235c2d)){return _0x53df9c;}else{throw new db['Sequelize'][(_0xeabc('0x1d'))](_0xeabc('0x1e'));}}else{return _0x53df9c;}}function respondWithRpcPromise(_0x326bac,_0x53d5cb,_0xf913d7,_0x638976){return new BPromise(function(_0x49f2d8,_0x53fe28){var _0x10fa8e=_0x638976||client;return _0x10fa8e['request'](_0x326bac,_0xf913d7)[_0xeabc('0x1f')](function(_0x1b64b9){logger[_0xeabc('0x20')](_0xeabc('0x21'),_0x53d5cb,_0xeabc('0x22'));logger[_0xeabc('0x23')](_0xeabc('0x24'),_0x53d5cb,_0xeabc('0x22'),JSON['stringify'](_0x1b64b9));if(_0x1b64b9[_0xeabc('0x25')]){if(_0x1b64b9['error'][_0xeabc('0x26')]===0x1f4){logger[_0xeabc('0x25')]('FreshdeskAccount,\x20%s,\x20%s',_0x53d5cb,_0x1b64b9[_0xeabc('0x25')][_0xeabc('0x27')]);return _0x53fe28(_0x1b64b9[_0xeabc('0x25')][_0xeabc('0x27')]);}logger[_0xeabc('0x25')]('FreshdeskAccount,\x20%s,\x20%s',_0x53d5cb,_0x1b64b9[_0xeabc('0x25')][_0xeabc('0x27')]);return _0x49f2d8(_0x1b64b9[_0xeabc('0x25')]['message']);}else{logger[_0xeabc('0x20')](_0xeabc('0x21'),_0x53d5cb,_0xeabc('0x22'));_0x49f2d8(_0x1b64b9[_0xeabc('0x28')]['message']);}})[_0xeabc('0x29')](function(_0x480440){logger[_0xeabc('0x25')]('FreshdeskAccount,\x20%s,\x20%s',_0x53d5cb,_0x480440);_0x53fe28(_0x480440);});});}function respondWithStatusCode(_0x811f0d,_0x12acbd){_0x12acbd=_0x12acbd||0xcc;return function(_0x269621){if(_0x269621){return _0x811f0d[_0xeabc('0x2a')](_0x12acbd);}return _0x811f0d[_0xeabc('0x2b')](_0x12acbd)[_0xeabc('0x2c')]();};}function respondWithResult(_0x131722,_0x4c2693){_0x4c2693=_0x4c2693||0xc8;return function(_0x5b2934){if(_0x5b2934){return _0x131722[_0xeabc('0x2b')](_0x4c2693)['json'](_0x5b2934);}};}function respondWithFilteredResult(_0x3c1b5b,_0x2b342c){return function(_0x48fb52){if(_0x48fb52){var _0x2163e6=_0x48fb52[_0xeabc('0x2d')],_0x38572d=_0x2b342c[_0xeabc('0x2e')],_0x2b568f=_0x2b342c[_0xeabc('0x2e')]+_0x2b342c[_0xeabc('0x2f')],_0x2f8633;if(_0x2b568f>=_0x2163e6){_0x2b568f=_0x2163e6;_0x2f8633=0xc8;}else{_0x2f8633=0xce;}_0x3c1b5b[_0xeabc('0x2b')](_0x2f8633);return _0x3c1b5b['set'](_0xeabc('0x30'),_0x38572d+'-'+_0x2b568f+'/'+_0x2163e6)['json'](_0x48fb52);}return null;};}function patchUpdates(_0x2f03e8){return function(_0x2d027e){try{jsonpatch[_0xeabc('0x31')](_0x2d027e,_0x2f03e8,!![]);}catch(_0x3c606a){return BPromise[_0xeabc('0x32')](_0x3c606a);}return _0x2d027e[_0xeabc('0x33')]();};}function saveUpdates(_0x61c0af,_0x545d7f){return function(_0x78510a){if(_0x78510a){return _0x78510a[_0xeabc('0x34')](_0x61c0af)[_0xeabc('0x1f')](function(_0x4918e2){return _0x4918e2;});}return null;};}function removeEntity(_0x1e74ca,_0x3777c1){return function(_0x4492fd){if(_0x4492fd){return _0x4492fd['destroy']()[_0xeabc('0x1f')](function(){_0x1e74ca[_0xeabc('0x2b')](0xcc)[_0xeabc('0x2c')]();});}};}function handleEntityNotFound(_0x521091,_0xf98c7c){return function(_0x286203){if(!_0x286203){_0x521091['sendStatus'](0x194);}return _0x286203;};}function handleError(_0x50cca2,_0x254568){_0x254568=_0x254568||0x1f4;return function(_0x3829a9){logger['error'](_0x3829a9[_0xeabc('0x35')]);if(_0x3829a9[_0xeabc('0x36')]){delete _0x3829a9[_0xeabc('0x36')];}_0x50cca2[_0xeabc('0x2b')](_0x254568)[_0xeabc('0x37')](_0x3829a9);};}exports['index']=function(_0x353e48,_0x5b61fa){var _0x31ee7a={},_0x2bda29={},_0x311291={'count':0x0,'rows':[]};var _0x5b52c4=_['map'](db[_0xeabc('0x38')]['rawAttributes'],function(_0x113d5a){return{'name':_0x113d5a['fieldName'],'type':_0x113d5a['type']['key']};});_0x2bda29['model']=_[_0xeabc('0x39')](_0x5b52c4,'name');_0x2bda29[_0xeabc('0x3a')]=_[_0xeabc('0x3b')](_0x353e48['query']);_0x2bda29[_0xeabc('0x3c')]=_['intersection'](_0x2bda29[_0xeabc('0x3d')],_0x2bda29['query']);_0x31ee7a[_0xeabc('0x3e')]=_[_0xeabc('0x3f')](_0x2bda29[_0xeabc('0x3d')],qs['fields'](_0x353e48['query']['fields']));_0x31ee7a[_0xeabc('0x3e')]=_0x31ee7a[_0xeabc('0x3e')][_0xeabc('0x40')]?_0x31ee7a['attributes']:_0x2bda29['model'];if(!_0x353e48[_0xeabc('0x3a')][_0xeabc('0x41')]('nolimit')){_0x31ee7a[_0xeabc('0x2f')]=qs['limit'](_0x353e48[_0xeabc('0x3a')]['limit']);_0x31ee7a['offset']=qs['offset'](_0x353e48[_0xeabc('0x3a')][_0xeabc('0x2e')]);}_0x31ee7a[_0xeabc('0x42')]=qs[_0xeabc('0x43')](_0x353e48['query'][_0xeabc('0x43')]);_0x31ee7a['where']=qs[_0xeabc('0x3c')](_[_0xeabc('0x44')](_0x353e48[_0xeabc('0x3a')],_0x2bda29[_0xeabc('0x3c')]),_0x5b52c4);if(_0x353e48[_0xeabc('0x3a')]['filter']){_0x31ee7a['where']=_[_0xeabc('0x45')](_0x31ee7a['where'],{'$or':_[_0xeabc('0x39')](_0x5b52c4,function(_0x2cdf59){if(_0x2cdf59['type']!==_0xeabc('0x46')){var _0x2b3c28={};_0x2b3c28[_0x2cdf59[_0xeabc('0x36')]]={'$like':'%'+_0x353e48[_0xeabc('0x3a')][_0xeabc('0x47')]+'%'};return _0x2b3c28;}})});}_0x31ee7a=_[_0xeabc('0x45')]({},_0x31ee7a,_0x353e48[_0xeabc('0x48')]);var _0x4b2fb6={'where':_0x31ee7a[_0xeabc('0x49')]};return db[_0xeabc('0x38')][_0xeabc('0x2d')](_0x4b2fb6)[_0xeabc('0x1f')](function(_0x271f8c){_0x311291[_0xeabc('0x2d')]=_0x271f8c;if(_0x353e48[_0xeabc('0x3a')][_0xeabc('0x4a')]){_0x31ee7a[_0xeabc('0x4b')]=[{'all':!![]}];}return db[_0xeabc('0x38')]['findAll'](_0x31ee7a);})[_0xeabc('0x1f')](function(_0x2e6efb){_0x311291[_0xeabc('0x4c')]=_0x2e6efb;return _0x311291;})[_0xeabc('0x1f')](respondWithFilteredResult(_0x5b61fa,_0x31ee7a))[_0xeabc('0x29')](handleError(_0x5b61fa,null));};exports[_0xeabc('0x4d')]=function(_0x268d95,_0x48df43){var _0x766743={'raw':![],'where':{'id':_0x268d95[_0xeabc('0x4e')]['id']}},_0x32e09b={};_0x32e09b[_0xeabc('0x3d')]=_[_0xeabc('0x3b')](db['FreshdeskAccount'][_0xeabc('0x4f')]);_0x32e09b[_0xeabc('0x3a')]=_[_0xeabc('0x3b')](_0x268d95[_0xeabc('0x3a')]);_0x32e09b['filters']=_[_0xeabc('0x3f')](_0x32e09b[_0xeabc('0x3d')],_0x32e09b['query']);_0x766743[_0xeabc('0x3e')]=_['intersection'](_0x32e09b[_0xeabc('0x3d')],qs['fields'](_0x268d95[_0xeabc('0x3a')][_0xeabc('0x50')]));_0x766743[_0xeabc('0x3e')]=_0x766743[_0xeabc('0x3e')][_0xeabc('0x40')]?_0x766743[_0xeabc('0x3e')]:_0x32e09b[_0xeabc('0x3d')];if(_0x268d95[_0xeabc('0x3a')][_0xeabc('0x4a')]){_0x766743[_0xeabc('0x4b')]=[{'all':!![]}];}_0x766743=_['merge']({},_0x766743,_0x268d95[_0xeabc('0x48')]);return db[_0xeabc('0x38')][_0xeabc('0x51')](_0x766743)[_0xeabc('0x1f')](handleEntityNotFound(_0x48df43,null))['then'](respondWithResult(_0x48df43,null))[_0xeabc('0x29')](handleError(_0x48df43,null));};exports[_0xeabc('0x52')]=function(_0x10d56f,_0x21f972){return db['FreshdeskAccount'][_0xeabc('0x52')](_0x10d56f[_0xeabc('0x53')],{})[_0xeabc('0x1f')](respondWithResult(_0x21f972,0xc9))[_0xeabc('0x29')](handleError(_0x21f972,null));};exports[_0xeabc('0x34')]=function(_0x3b5e94,_0x14c322){if(_0x3b5e94[_0xeabc('0x53')]['id']){delete _0x3b5e94[_0xeabc('0x53')]['id'];}return db['FreshdeskAccount'][_0xeabc('0x51')]({'where':{'id':_0x3b5e94['params']['id']}})['then'](handleEntityNotFound(_0x14c322,null))['then'](saveUpdates(_0x3b5e94[_0xeabc('0x53')],null))[_0xeabc('0x1f')](respondWithResult(_0x14c322,null))[_0xeabc('0x29')](handleError(_0x14c322,null));};exports[_0xeabc('0x54')]=function(_0xe89728,_0x2f78f3){return db['FreshdeskAccount'][_0xeabc('0x51')]({'where':{'id':_0xe89728[_0xeabc('0x4e')]['id']}})[_0xeabc('0x1f')](handleEntityNotFound(_0x2f78f3,null))[_0xeabc('0x1f')](removeEntity(_0x2f78f3,null))[_0xeabc('0x29')](handleError(_0x2f78f3,null));};exports[_0xeabc('0x55')]=function(_0x1750e9,_0x25c728,_0x5820ca){var _0x5b8370={};var _0x180e62={};var _0x340520;var _0x2c0894;return db['FreshdeskAccount'][_0xeabc('0x56')]({'where':{'id':_0x1750e9['params']['id']}})['then'](handleEntityNotFound(_0x25c728,null))[_0xeabc('0x1f')](function(_0x1fca99){if(_0x1fca99){_0x340520=_0x1fca99;_0x180e62[_0xeabc('0x3d')]=_[_0xeabc('0x3b')](db[_0xeabc('0x57')][_0xeabc('0x4f')]);_0x180e62['query']=_[_0xeabc('0x3b')](_0x1750e9[_0xeabc('0x3a')]);_0x180e62[_0xeabc('0x3c')]=_[_0xeabc('0x3f')](_0x180e62[_0xeabc('0x3d')],_0x180e62[_0xeabc('0x3a')]);_0x5b8370['attributes']=_[_0xeabc('0x3f')](_0x180e62[_0xeabc('0x3d')],qs[_0xeabc('0x50')](_0x1750e9[_0xeabc('0x3a')][_0xeabc('0x50')]));_0x5b8370[_0xeabc('0x3e')]=_0x5b8370[_0xeabc('0x3e')][_0xeabc('0x40')]?_0x5b8370[_0xeabc('0x3e')]:_0x180e62['model'];_0x5b8370[_0xeabc('0x42')]=qs['sort'](_0x1750e9[_0xeabc('0x3a')][_0xeabc('0x43')]);_0x5b8370[_0xeabc('0x49')]=qs[_0xeabc('0x3c')](_[_0xeabc('0x44')](_0x1750e9[_0xeabc('0x3a')],_0x180e62[_0xeabc('0x3c')]));if(_0x1750e9[_0xeabc('0x3a')][_0xeabc('0x47')]){_0x5b8370[_0xeabc('0x49')]=_['merge'](_0x5b8370[_0xeabc('0x49')],{'$or':_[_0xeabc('0x39')](_0x5b8370[_0xeabc('0x3e')],function(_0x41cad5){var _0x5b4430={};_0x5b4430[_0x41cad5]={'$like':'%'+_0x1750e9[_0xeabc('0x3a')]['filter']+'%'};return _0x5b4430;})});}_0x5b8370=_['merge']({},_0x5b8370,_0x1750e9[_0xeabc('0x48')]);return _0x340520[_0xeabc('0x55')](_0x5b8370);}})[_0xeabc('0x1f')](function(_0x1c91e4){if(_0x1c91e4){_0x2c0894=_0x1c91e4['length'];if(!_0x1750e9['query'][_0xeabc('0x41')]('nolimit')){_0x5b8370['limit']=qs[_0xeabc('0x2f')](_0x1750e9['query']['limit']);_0x5b8370[_0xeabc('0x2e')]=qs[_0xeabc('0x2e')](_0x1750e9['query']['offset']);}return _0x340520[_0xeabc('0x55')](_0x5b8370);}})['then'](function(_0x238e2d){if(_0x238e2d){return _0x238e2d?{'count':_0x2c0894,'rows':_0x238e2d}:null;}})[_0xeabc('0x1f')](respondWithResult(_0x25c728,null))['catch'](handleError(_0x25c728,null));};exports['addConfiguration']=function(_0x24365a,_0x74f5ac,_0xd86ea7){if(_0x24365a[_0xeabc('0x53')]['id']){delete _0x24365a[_0xeabc('0x53')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x24365a[_0xeabc('0x4e')]['id']}})['then'](handleEntityNotFound(_0x74f5ac,null))[_0xeabc('0x1f')](function(_0x5086c6){if(_0x5086c6){_0x24365a[_0xeabc('0x53')]['AccountId']=_0x5086c6['id'];_0x24365a[_0xeabc('0x53')]['Subjects']=integrations[_0xeabc('0x58')](_0x24365a[_0xeabc('0x53')][_0xeabc('0x59')],_0x24365a[_0xeabc('0x53')]['type']);_0x24365a[_0xeabc('0x53')]['Descriptions']=integrations[_0xeabc('0x5a')](_0x24365a[_0xeabc('0x53')][_0xeabc('0x59')],_0x24365a[_0xeabc('0x53')][_0xeabc('0x5b')]);return db['FreshdeskConfiguration'][_0xeabc('0x52')](_0x24365a[_0xeabc('0x53')],{'include':[{'model':db[_0xeabc('0x5c')],'as':_0xeabc('0x5d')},{'model':db['FreshdeskField'],'as':_0xeabc('0x5e')}]});}return null;})[_0xeabc('0x1f')](respondWithResult(_0x74f5ac,null))[_0xeabc('0x29')](handleError(_0x74f5ac,null));};exports[_0xeabc('0x5f')]=function(_0x5bacbb,_0xb9b460,_0x368cd4){var _0x287f88='';return db[_0xeabc('0x38')]['findOne']({'where':{'id':_0x5bacbb['params']['id']},'attributes':['id',_0xeabc('0x60'),'apiKey']})['then'](handleEntityNotFound(_0xb9b460,null))[_0xeabc('0x1f')](function(_0x460f07){if(_0x460f07){_0x287f88=_0x460f07[_0xeabc('0x60')];var _0x49679d=_0x287f88[_0xeabc('0x61')](-0x1);if(_0x49679d==='/'){_0x287f88=_0x287f88[_0xeabc('0x62')](0x0,_0x287f88['lastIndexOf'](_0x49679d));}return rp({'method':_0xeabc('0x63'),'uri':util[_0xeabc('0x64')](_0xeabc('0x65'),_0x287f88,_0xeabc('0x66')),'headers':{'Authorization':util[_0xeabc('0x64')]('Basic\x20%s',new Buffer(util[_0xeabc('0x64')]('%s:X',_0x460f07['apiKey']))['toString'](_0xeabc('0x67')))},'json':!![]});}})[_0xeabc('0x1f')](function(_0x1b6e9e){if(_0x1b6e9e){var _0x4424ce=[_0xeabc('0x68'),'subject',_0xeabc('0x69'),'description',_0xeabc('0x2b'),_0xeabc('0x6a'),'group',_0xeabc('0x6b'),'ticket_type','group',_0xeabc('0x6c')];_[_0xeabc('0x6d')](_0x1b6e9e,function(_0x439a48){return _0x4424ce[_0xeabc('0x6e')](_0x439a48[_0xeabc('0x36')])||!_0x439a48['default']&&_0x439a48[_0xeabc('0x5b')]!==_0xeabc('0x6f')&&_0x439a48[_0xeabc('0x5b')]!==_0xeabc('0x70');});return{'count':_0x1b6e9e[_0xeabc('0x40')],'rows':_[_0xeabc('0x39')](_0x1b6e9e,function(_0x2d05b4){return{'id':_0x2d05b4[_0xeabc('0x36')],'name':_0x2d05b4[_0xeabc('0x71')],'custom':!_0x2d05b4[_0xeabc('0x72')],'options':_0x2d05b4['choices']?_[_0xeabc('0x39')](_0x2d05b4[_0xeabc('0x73')],function(_0xba29f){return{'name':_['capitalize'](_0xba29f),'value':_0xba29f};}):[]};})};}})['then'](respondWithResult(_0xb9b460,null))[_0xeabc('0x29')](function(_0x273ca5){var _0xe90200=_0x5bacbb[_0xeabc('0x3a')][_0xeabc('0x74')]?0x1f4:_0x273ca5['statusCode']||0x1f4;logger[_0xeabc('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0xe90200,JSON[_0xeabc('0x75')](_0x273ca5));delete _0x273ca5[_0xeabc('0x36')];if(_0xe90200===0x191){_0xe90200=0x190;}_0xb9b460['status'](_0xe90200)[_0xeabc('0x37')](_0x5bacbb[_0xeabc('0x3a')][_0xeabc('0x74')]?{'message':_0xeabc('0x76'),'statusCode':_0x273ca5[_0xeabc('0x77')]}:_0x273ca5);});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
index 7a419fb..b712885 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 _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
+var _0x59e1=['bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','api'];(function(_0x35c2f6,_0x53ca58){var _0x435de7=function(_0x2c3c84){while(--_0x2c3c84){_0x35c2f6['push'](_0x35c2f6['shift']());}};_0x435de7(++_0x53ca58);}(_0x59e1,0x19d));var _0x159e=function(_0x5ab802,_0x46d738){_0x5ab802=_0x5ab802-0x0;var _0x154906=_0x59e1[_0x5ab802];return _0x154906;};'use strict';var _=require('lodash');var util=require(_0x159e('0x0'));var logger=require(_0x159e('0x1'))(_0x159e('0x2'));var moment=require('moment');var BPromise=require(_0x159e('0x3'));var rp=require(_0x159e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x159e('0x5'));var config=require(_0x159e('0x6'));var attributes=require(_0x159e('0x7'));var integrations=require(_0x159e('0x8'));module[_0x159e('0x9')]=function(_0x1e58bc,_0x310f11){return _0x1e58bc[_0x159e('0xa')](_0x159e('0xb'),attributes,{'tableName':_0x159e('0xc'),'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 311a55e..01d36da 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 _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
+var _0x22b1=['include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','find','then','debug','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes'];(function(_0x504553,_0x433d09){var _0x56195a=function(_0x2e8b3c){while(--_0x2e8b3c){_0x504553['push'](_0x504553['shift']());}};_0x56195a(++_0x433d09);}(_0x22b1,0x143));var _0x122b=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x22b1[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x122b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x122b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x122b('0x2'));var db=require(_0x122b('0x3'))['db'];var utils=require(_0x122b('0x4'));var logger=require(_0x122b('0x5'))(_0x122b('0x6'));var config=require(_0x122b('0x7'));var jayson=require(_0x122b('0x8'));var client=jayson[_0x122b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe2327e,_0x57962e,_0x530427){return new BPromise(function(_0x1b028b,_0x1a20b3){return client[_0x122b('0xa')](_0xe2327e,_0x530427)['then'](function(_0x3cb88c){logger[_0x122b('0xb')](_0x122b('0xc'),_0x57962e,'request\x20sent');logger['debug'](_0x122b('0xd'),_0x57962e,_0x122b('0xe'),JSON[_0x122b('0xf')](_0x3cb88c));if(_0x3cb88c[_0x122b('0x10')]){if(_0x3cb88c[_0x122b('0x10')][_0x122b('0x11')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x57962e,_0x3cb88c['error'][_0x122b('0x12')]);return _0x1a20b3(_0x3cb88c[_0x122b('0x10')]['message']);}logger[_0x122b('0x10')](_0x122b('0xc'),_0x57962e,_0x3cb88c['error'][_0x122b('0x12')]);return _0x1b028b(_0x3cb88c[_0x122b('0x10')][_0x122b('0x12')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x57962e,_0x122b('0xe'));_0x1b028b(_0x3cb88c[_0x122b('0x13')][_0x122b('0x12')]);}})[_0x122b('0x14')](function(_0x4e84e7){logger['error'](_0x122b('0xc'),_0x57962e,_0x4e84e7);_0x1a20b3(_0x4e84e7);});});}exports['GetFreshdeskAccount']=function(_0x277797){var _0x33406f=this;return new Promise(function(_0x1b0ece,_0x5a4b22){return db[_0x122b('0x15')][_0x122b('0x16')]({'raw':_0x277797[_0x122b('0x17')]?_0x277797[_0x122b('0x17')][_0x122b('0x18')]===undefined?!![]:![]:!![],'where':_0x277797[_0x122b('0x17')]?_0x277797[_0x122b('0x17')][_0x122b('0x19')]||null:null,'attributes':_0x277797['options']?_0x277797[_0x122b('0x17')][_0x122b('0x1a')]||null:null,'limit':_0x277797[_0x122b('0x17')]?_0x277797['options']['limit']||null:null,'include':_0x277797[_0x122b('0x17')]?_0x277797[_0x122b('0x17')][_0x122b('0x1b')]?_[_0x122b('0x1c')](_0x277797['options'][_0x122b('0x1b')],function(_0x509e55){return{'model':db[_0x509e55[_0x122b('0x1d')]],'as':_0x509e55['as'],'attributes':_0x509e55[_0x122b('0x1a')],'include':_0x509e55['include']?_[_0x122b('0x1c')](_0x509e55[_0x122b('0x1b')],function(_0x59d0cf){return{'model':db[_0x59d0cf[_0x122b('0x1d')]],'as':_0x59d0cf['as'],'attributes':_0x59d0cf[_0x122b('0x1a')],'include':_0x59d0cf[_0x122b('0x1b')]?_[_0x122b('0x1c')](_0x59d0cf[_0x122b('0x1b')],function(_0x5a606e){return{'model':db[_0x5a606e[_0x122b('0x1d')]],'as':_0x5a606e['as'],'attributes':_0x5a606e[_0x122b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39cafd){logger['info'](_0x122b('0x1e'),_0x277797);logger['debug']('GetFreshdeskAccount',_0x277797,JSON[_0x122b('0xf')](_0x39cafd));_0x1b0ece(_0x39cafd);})[_0x122b('0x14')](function(_0x3bae3a){logger[_0x122b('0x10')](_0x122b('0x1e'),_0x3bae3a[_0x122b('0x12')],_0x277797);_0x5a4b22(_0x33406f[_0x122b('0x10')](0x1f4,_0x3bae3a['message']));});});};exports[_0x122b('0x1f')]=function(_0x2943cc){var _0x1028ff=this;return new Promise(function(_0x50c59a,_0x1da858){return db[_0x122b('0x15')][_0x122b('0x20')]({'raw':_0x2943cc[_0x122b('0x17')]?_0x2943cc[_0x122b('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2943cc['options']?_0x2943cc[_0x122b('0x17')][_0x122b('0x19')]||null:null,'attributes':_0x2943cc[_0x122b('0x17')]?_0x2943cc['options'][_0x122b('0x1a')]||null:null,'include':_0x2943cc['options']?_0x2943cc[_0x122b('0x17')]['include']?_['map'](_0x2943cc[_0x122b('0x17')][_0x122b('0x1b')],function(_0x4ea63b){return{'model':db[_0x4ea63b[_0x122b('0x1d')]],'as':_0x4ea63b['as'],'attributes':_0x4ea63b[_0x122b('0x1a')],'include':_0x4ea63b[_0x122b('0x1b')]?_[_0x122b('0x1c')](_0x4ea63b[_0x122b('0x1b')],function(_0xdfccdf){return{'model':db[_0xdfccdf[_0x122b('0x1d')]],'as':_0xdfccdf['as'],'attributes':_0xdfccdf[_0x122b('0x1a')],'include':_0xdfccdf[_0x122b('0x1b')]?_[_0x122b('0x1c')](_0xdfccdf[_0x122b('0x1b')],function(_0x5b8cd7){return{'model':db[_0x5b8cd7[_0x122b('0x1d')]],'as':_0x5b8cd7['as'],'attributes':_0x5b8cd7[_0x122b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x122b('0x21')](function(_0x28e396){logger[_0x122b('0xb')](_0x122b('0x1f'),_0x2943cc);logger[_0x122b('0x22')](_0x122b('0x1f'),_0x2943cc,JSON[_0x122b('0xf')](_0x28e396));_0x50c59a(_0x28e396);})[_0x122b('0x14')](function(_0x21fdf0){logger[_0x122b('0x10')](_0x122b('0x1f'),_0x21fdf0[_0x122b('0x12')],_0x2943cc);_0x1da858(_0x1028ff[_0x122b('0x10')](0x1f4,_0x21fdf0[_0x122b('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js
index c62d50f..f8f9b55 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 _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
+var _0xdd0a=['delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','getFields','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','put','update'];(function(_0x28dadc,_0x33a3dc){var _0x1b8496=function(_0x193426){while(--_0x193426){_0x28dadc['push'](_0x28dadc['shift']());}};_0x1b8496(++_0x33a3dc);}(_0xdd0a,0xf2));var _0xadd0=function(_0x43a1f0,_0x279e28){_0x43a1f0=_0x43a1f0-0x0;var _0x32f486=_0xdd0a[_0x43a1f0];return _0x32f486;};'use strict';var multer=require(_0xadd0('0x0'));var util=require('util');var path=require(_0xadd0('0x1'));var timeout=require(_0xadd0('0x2'));var express=require(_0xadd0('0x3'));var router=express[_0xadd0('0x4')]();var auth=require(_0xadd0('0x5'));var interaction=require(_0xadd0('0x6'));var config=require(_0xadd0('0x7'));var controller=require(_0xadd0('0x8'));router[_0xadd0('0x9')]('/',auth[_0xadd0('0xa')](),controller['index']);router[_0xadd0('0x9')](_0xadd0('0xb'),auth[_0xadd0('0xa')](),controller[_0xadd0('0xc')]);router[_0xadd0('0x9')]('/:id/fields',auth[_0xadd0('0xa')](),controller[_0xadd0('0xd')]);router['get']('/:id/subjects',auth[_0xadd0('0xa')](),controller['getSubjects']);router[_0xadd0('0x9')](_0xadd0('0xe'),auth[_0xadd0('0xa')](),controller[_0xadd0('0xf')]);router[_0xadd0('0x9')](_0xadd0('0x10'),auth['isAuthenticated'](),controller['getTags']);router[_0xadd0('0x11')]('/',auth[_0xadd0('0xa')](),controller[_0xadd0('0x12')]);router[_0xadd0('0x11')](_0xadd0('0x10'),auth['isAuthenticated'](),controller[_0xadd0('0x13')]);router[_0xadd0('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xadd0('0x15')]);router[_0xadd0('0x16')](_0xadd0('0xb'),auth[_0xadd0('0xa')](),controller[_0xadd0('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
index c318d19..1e56643 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 _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
+var _0xc590=['STRING','exports'];(function(_0x5c24dc,_0x5b6042){var _0x16bb27=function(_0x3d8916){while(--_0x3d8916){_0x5c24dc['push'](_0x5c24dc['shift']());}};_0x16bb27(++_0x5b6042);}(_0xc590,0x111));var _0x0c59=function(_0x4def8f,_0x5d1ef0){_0x4def8f=_0x4def8f-0x0;var _0x5da9c8=_0xc590[_0x4def8f];return _0x5da9c8;};'use strict';var Sequelize=require('sequelize');module[_0x0c59('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0c59('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
index ecbf114..351ba8e 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 _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
+var _0x64a1=['show','params','keys','rawAttributes','length','find','create','body','catch','getFields','getSubjects','findOne','FreshdeskField','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../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','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','FreshdeskConfiguration','fieldName','type','key','map','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows'];(function(_0x24fdc7,_0x13b25d){var _0x321a1f=function(_0x5b1571){while(--_0x5b1571){_0x24fdc7['push'](_0x24fdc7['shift']());}};_0x321a1f(++_0x13b25d);}(_0x64a1,0x13e));var _0x164a=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x64a1[_0x29d94e];return _0x106237;};'use strict';var pdf=require(_0x164a('0x0'));var emlformat=require(_0x164a('0x1'));var rimraf=require(_0x164a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x164a('0x3'));var moment=require(_0x164a('0x4'));var BPromise=require(_0x164a('0x5'));var Mustache=require('mustache');var util=require(_0x164a('0x6'));var path=require(_0x164a('0x7'));var sox=require(_0x164a('0x8'));var csv=require(_0x164a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x164a('0xa'));var squel=require(_0x164a('0xb'));var crypto=require(_0x164a('0xc'));var jsforce=require(_0x164a('0xd'));var deskjs=require(_0x164a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x164a('0xf'));var Papa=require(_0x164a('0x10'));var Redis=require('ioredis');var authService=require(_0x164a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x164a('0x12'))(_0x164a('0x13'));var utils=require('../../config/utils');var config=require(_0x164a('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x164a('0x15'));var client=jayson[_0x164a('0x16')][_0x164a('0x17')]({'port':0x232a});function checkPasswordPattern(_0x508a58,_0x64b9aa,_0x15b63e){if(_0x15b63e){var _0x40f214=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x40f214[_0x164a('0x18')](_0x64b9aa)){return _0x508a58;}else{throw new db[(_0x164a('0x19'))][(_0x164a('0x1a'))](_0x164a('0x1b'));}}else{return _0x508a58;}}function respondWithRpcPromise(_0x263b3a,_0x28984f,_0x43fc19,_0x3bfc66){return new BPromise(function(_0xb44b99,_0x2e9883){var _0x16c705=_0x3bfc66||client;return _0x16c705['request'](_0x263b3a,_0x43fc19)[_0x164a('0x1c')](function(_0x1ba59d){logger[_0x164a('0x1d')](_0x164a('0x1e'),_0x28984f,'request\x20sent');logger[_0x164a('0x1f')](_0x164a('0x20'),_0x28984f,'request\x20sent',JSON[_0x164a('0x21')](_0x1ba59d));if(_0x1ba59d[_0x164a('0x22')]){if(_0x1ba59d[_0x164a('0x22')][_0x164a('0x23')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x28984f,_0x1ba59d['error'][_0x164a('0x24')]);return _0x2e9883(_0x1ba59d[_0x164a('0x22')][_0x164a('0x24')]);}logger[_0x164a('0x22')](_0x164a('0x1e'),_0x28984f,_0x1ba59d[_0x164a('0x22')][_0x164a('0x24')]);return _0xb44b99(_0x1ba59d[_0x164a('0x22')][_0x164a('0x24')]);}else{logger['info'](_0x164a('0x1e'),_0x28984f,_0x164a('0x25'));_0xb44b99(_0x1ba59d[_0x164a('0x26')]['message']);}})['catch'](function(_0x317d20){logger[_0x164a('0x22')](_0x164a('0x1e'),_0x28984f,_0x317d20);_0x2e9883(_0x317d20);});});}function respondWithStatusCode(_0x27a261,_0xbd1d59){_0xbd1d59=_0xbd1d59||0xcc;return function(_0x5d6a11){if(_0x5d6a11){return _0x27a261[_0x164a('0x27')](_0xbd1d59);}return _0x27a261[_0x164a('0x28')](_0xbd1d59)['end']();};}function respondWithResult(_0x6740e1,_0x5f1db3){_0x5f1db3=_0x5f1db3||0xc8;return function(_0x3a98ba){if(_0x3a98ba){return _0x6740e1[_0x164a('0x28')](_0x5f1db3)[_0x164a('0x29')](_0x3a98ba);}};}function respondWithFilteredResult(_0x1e089c,_0x1210ab){return function(_0x547b0c){if(_0x547b0c){var _0x2c964d=_0x547b0c['count'],_0x2ea402=_0x1210ab['offset'],_0x12d7d4=_0x1210ab[_0x164a('0x2a')]+_0x1210ab[_0x164a('0x2b')],_0x48533d;if(_0x12d7d4>=_0x2c964d){_0x12d7d4=_0x2c964d;_0x48533d=0xc8;}else{_0x48533d=0xce;}_0x1e089c['status'](_0x48533d);return _0x1e089c[_0x164a('0x2c')](_0x164a('0x2d'),_0x2ea402+'-'+_0x12d7d4+'/'+_0x2c964d)[_0x164a('0x29')](_0x547b0c);}return null;};}function patchUpdates(_0x2cdeea){return function(_0x37b06f){try{jsonpatch[_0x164a('0x2e')](_0x37b06f,_0x2cdeea,!![]);}catch(_0x5b8053){return BPromise[_0x164a('0x2f')](_0x5b8053);}return _0x37b06f[_0x164a('0x30')]();};}function saveUpdates(_0x497670,_0x1881e3){return function(_0x24f57a){if(_0x24f57a){return _0x24f57a[_0x164a('0x31')](_0x497670)[_0x164a('0x1c')](function(_0x2f1a29){return _0x2f1a29;});}return null;};}function removeEntity(_0x20c59c,_0x36358c){return function(_0x1be10d){if(_0x1be10d){return _0x1be10d[_0x164a('0x32')]()['then'](function(){_0x20c59c[_0x164a('0x28')](0xcc)[_0x164a('0x33')]();});}};}function handleEntityNotFound(_0x1743ec,_0x158e61){return function(_0x44b550){if(!_0x44b550){_0x1743ec['sendStatus'](0x194);}return _0x44b550;};}function handleError(_0x3e736b,_0x14138d){_0x14138d=_0x14138d||0x1f4;return function(_0x3b5f45){logger[_0x164a('0x22')](_0x3b5f45[_0x164a('0x34')]);if(_0x3b5f45[_0x164a('0x35')]){delete _0x3b5f45[_0x164a('0x35')];}_0x3e736b[_0x164a('0x28')](_0x14138d)[_0x164a('0x36')](_0x3b5f45);};}exports[_0x164a('0x37')]=function(_0x22bd38,_0x3193bb){var _0x413124={},_0x36e2d0={},_0x3f1fa5={'count':0x0,'rows':[]};var _0x3ae030=_['map'](db[_0x164a('0x38')]['rawAttributes'],function(_0x53f6df){return{'name':_0x53f6df[_0x164a('0x39')],'type':_0x53f6df[_0x164a('0x3a')][_0x164a('0x3b')]};});_0x36e2d0['model']=_[_0x164a('0x3c')](_0x3ae030,_0x164a('0x35'));_0x36e2d0[_0x164a('0x3d')]=_['keys'](_0x22bd38[_0x164a('0x3d')]);_0x36e2d0['filters']=_[_0x164a('0x3e')](_0x36e2d0[_0x164a('0x3f')],_0x36e2d0[_0x164a('0x3d')]);_0x413124[_0x164a('0x40')]=_[_0x164a('0x3e')](_0x36e2d0['model'],qs[_0x164a('0x41')](_0x22bd38[_0x164a('0x3d')][_0x164a('0x41')]));_0x413124[_0x164a('0x40')]=_0x413124[_0x164a('0x40')]['length']?_0x413124['attributes']:_0x36e2d0[_0x164a('0x3f')];if(!_0x22bd38['query'][_0x164a('0x42')](_0x164a('0x43'))){_0x413124[_0x164a('0x2b')]=qs[_0x164a('0x2b')](_0x22bd38[_0x164a('0x3d')][_0x164a('0x2b')]);_0x413124[_0x164a('0x2a')]=qs['offset'](_0x22bd38[_0x164a('0x3d')][_0x164a('0x2a')]);}_0x413124[_0x164a('0x44')]=qs['sort'](_0x22bd38[_0x164a('0x3d')][_0x164a('0x45')]);_0x413124[_0x164a('0x46')]=qs[_0x164a('0x47')](_[_0x164a('0x48')](_0x22bd38[_0x164a('0x3d')],_0x36e2d0['filters']),_0x3ae030);if(_0x22bd38['query'][_0x164a('0x49')]){_0x413124[_0x164a('0x46')]=_['merge'](_0x413124['where'],{'$or':_['map'](_0x3ae030,function(_0x13739d){if(_0x13739d[_0x164a('0x3a')]!==_0x164a('0x4a')){var _0x358331={};_0x358331[_0x13739d[_0x164a('0x35')]]={'$like':'%'+_0x22bd38['query'][_0x164a('0x49')]+'%'};return _0x358331;}})});}_0x413124=_[_0x164a('0x4b')]({},_0x413124,_0x22bd38[_0x164a('0x4c')]);var _0x5806ce={'where':_0x413124[_0x164a('0x46')]};return db[_0x164a('0x38')][_0x164a('0x4d')](_0x5806ce)['then'](function(_0x3bd819){_0x3f1fa5[_0x164a('0x4d')]=_0x3bd819;if(_0x22bd38[_0x164a('0x3d')][_0x164a('0x4e')]){_0x413124[_0x164a('0x4f')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x164a('0x50')](_0x413124);})[_0x164a('0x1c')](function(_0x450d75){_0x3f1fa5[_0x164a('0x51')]=_0x450d75;return _0x3f1fa5;})[_0x164a('0x1c')](respondWithFilteredResult(_0x3193bb,_0x413124))['catch'](handleError(_0x3193bb,null));};exports[_0x164a('0x52')]=function(_0x11a434,_0x1f7d22){var _0x33a582={'raw':![],'where':{'id':_0x11a434[_0x164a('0x53')]['id']}},_0x2dc2b3={};_0x2dc2b3[_0x164a('0x3f')]=_[_0x164a('0x54')](db[_0x164a('0x38')][_0x164a('0x55')]);_0x2dc2b3[_0x164a('0x3d')]=_[_0x164a('0x54')](_0x11a434[_0x164a('0x3d')]);_0x2dc2b3['filters']=_[_0x164a('0x3e')](_0x2dc2b3[_0x164a('0x3f')],_0x2dc2b3[_0x164a('0x3d')]);_0x33a582[_0x164a('0x40')]=_[_0x164a('0x3e')](_0x2dc2b3[_0x164a('0x3f')],qs['fields'](_0x11a434[_0x164a('0x3d')][_0x164a('0x41')]));_0x33a582[_0x164a('0x40')]=_0x33a582[_0x164a('0x40')][_0x164a('0x56')]?_0x33a582['attributes']:_0x2dc2b3[_0x164a('0x3f')];if(_0x11a434['query'][_0x164a('0x4e')]){_0x33a582['include']=[{'all':!![]}];}_0x33a582=_['merge']({},_0x33a582,_0x11a434[_0x164a('0x4c')]);return db[_0x164a('0x38')][_0x164a('0x57')](_0x33a582)[_0x164a('0x1c')](handleEntityNotFound(_0x1f7d22,null))[_0x164a('0x1c')](respondWithResult(_0x1f7d22,null))['catch'](handleError(_0x1f7d22,null));};exports[_0x164a('0x58')]=function(_0x23e276,_0x516d2c){return db[_0x164a('0x38')][_0x164a('0x58')](_0x23e276['body'],{})[_0x164a('0x1c')](respondWithResult(_0x516d2c,0xc9))['catch'](handleError(_0x516d2c,null));};exports[_0x164a('0x31')]=function(_0x5ef55f,_0x1fbc32){if(_0x5ef55f['body']['id']){delete _0x5ef55f[_0x164a('0x59')]['id'];}return db[_0x164a('0x38')][_0x164a('0x57')]({'where':{'id':_0x5ef55f[_0x164a('0x53')]['id']}})[_0x164a('0x1c')](handleEntityNotFound(_0x1fbc32,null))['then'](saveUpdates(_0x5ef55f[_0x164a('0x59')],null))[_0x164a('0x1c')](respondWithResult(_0x1fbc32,null))['catch'](handleError(_0x1fbc32,null));};exports[_0x164a('0x32')]=function(_0x4dff1f,_0x30ee39){return db[_0x164a('0x38')][_0x164a('0x57')]({'where':{'id':_0x4dff1f[_0x164a('0x53')]['id']}})[_0x164a('0x1c')](handleEntityNotFound(_0x30ee39,null))[_0x164a('0x1c')](removeEntity(_0x30ee39,null))[_0x164a('0x5a')](handleError(_0x30ee39,null));};exports[_0x164a('0x5b')]=function(_0x58c79e,_0x1468c1,_0x1530d5){var _0xfbb667={};var _0x6bd68={};var _0x5912b3;var _0x36d671;return db[_0x164a('0x38')]['findOne']({'where':{'id':_0x58c79e[_0x164a('0x53')]['id']}})[_0x164a('0x1c')](handleEntityNotFound(_0x1468c1,null))['then'](function(_0x230548){if(_0x230548){_0x5912b3=_0x230548;_0x6bd68[_0x164a('0x3f')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x6bd68[_0x164a('0x3d')]=_[_0x164a('0x54')](_0x58c79e[_0x164a('0x3d')]);_0x6bd68[_0x164a('0x47')]=_['intersection'](_0x6bd68[_0x164a('0x3f')],_0x6bd68[_0x164a('0x3d')]);_0xfbb667[_0x164a('0x40')]=_[_0x164a('0x3e')](_0x6bd68[_0x164a('0x3f')],qs[_0x164a('0x41')](_0x58c79e['query'][_0x164a('0x41')]));_0xfbb667[_0x164a('0x40')]=_0xfbb667[_0x164a('0x40')]['length']?_0xfbb667[_0x164a('0x40')]:_0x6bd68[_0x164a('0x3f')];_0xfbb667[_0x164a('0x44')]=qs['sort'](_0x58c79e[_0x164a('0x3d')][_0x164a('0x45')]);_0xfbb667[_0x164a('0x46')]=qs['filters'](_[_0x164a('0x48')](_0x58c79e[_0x164a('0x3d')],_0x6bd68[_0x164a('0x47')]));if(_0x58c79e[_0x164a('0x3d')][_0x164a('0x49')]){_0xfbb667[_0x164a('0x46')]=_[_0x164a('0x4b')](_0xfbb667[_0x164a('0x46')],{'$or':_[_0x164a('0x3c')](_0xfbb667[_0x164a('0x40')],function(_0x5e5e4a){var _0xf080c9={};_0xf080c9[_0x5e5e4a]={'$like':'%'+_0x58c79e['query'][_0x164a('0x49')]+'%'};return _0xf080c9;})});}_0xfbb667=_[_0x164a('0x4b')]({},_0xfbb667,_0x58c79e[_0x164a('0x4c')]);return _0x5912b3[_0x164a('0x5b')](_0xfbb667);}})[_0x164a('0x1c')](function(_0x232f88){if(_0x232f88){_0x36d671=_0x232f88[_0x164a('0x56')];if(!_0x58c79e[_0x164a('0x3d')][_0x164a('0x42')]('nolimit')){_0xfbb667['limit']=qs[_0x164a('0x2b')](_0x58c79e['query'][_0x164a('0x2b')]);_0xfbb667[_0x164a('0x2a')]=qs[_0x164a('0x2a')](_0x58c79e[_0x164a('0x3d')][_0x164a('0x2a')]);}return _0x5912b3[_0x164a('0x5b')](_0xfbb667);}})[_0x164a('0x1c')](function(_0x14f3ca){if(_0x14f3ca){return _0x14f3ca?{'count':_0x36d671,'rows':_0x14f3ca}:null;}})[_0x164a('0x1c')](respondWithResult(_0x1468c1,null))[_0x164a('0x5a')](handleError(_0x1468c1,null));};exports[_0x164a('0x5c')]=function(_0x4e419f,_0x4ef262,_0x55cb07){var _0x1ff688={};var _0x5f10bc={};var _0x40662;var _0x1c47f9;return db[_0x164a('0x38')][_0x164a('0x5d')]({'where':{'id':_0x4e419f['params']['id']}})[_0x164a('0x1c')](handleEntityNotFound(_0x4ef262,null))['then'](function(_0x149077){if(_0x149077){_0x40662=_0x149077;_0x5f10bc['model']=_[_0x164a('0x54')](db[_0x164a('0x5e')][_0x164a('0x55')]);_0x5f10bc[_0x164a('0x3d')]=_[_0x164a('0x54')](_0x4e419f['query']);_0x5f10bc[_0x164a('0x47')]=_[_0x164a('0x3e')](_0x5f10bc[_0x164a('0x3f')],_0x5f10bc[_0x164a('0x3d')]);_0x1ff688[_0x164a('0x40')]=_[_0x164a('0x3e')](_0x5f10bc['model'],qs['fields'](_0x4e419f['query'][_0x164a('0x41')]));_0x1ff688['attributes']=_0x1ff688['attributes'][_0x164a('0x56')]?_0x1ff688[_0x164a('0x40')]:_0x5f10bc[_0x164a('0x3f')];_0x1ff688[_0x164a('0x44')]=qs['sort'](_0x4e419f[_0x164a('0x3d')][_0x164a('0x45')]);_0x1ff688['where']=qs['filters'](_[_0x164a('0x48')](_0x4e419f[_0x164a('0x3d')],_0x5f10bc[_0x164a('0x47')]));if(_0x4e419f[_0x164a('0x3d')][_0x164a('0x49')]){_0x1ff688['where']=_[_0x164a('0x4b')](_0x1ff688['where'],{'$or':_[_0x164a('0x3c')](_0x1ff688['attributes'],function(_0x5f09a4){var _0x17f60d={};_0x17f60d[_0x5f09a4]={'$like':'%'+_0x4e419f['query']['filter']+'%'};return _0x17f60d;})});}_0x1ff688=_['merge']({},_0x1ff688,_0x4e419f[_0x164a('0x4c')]);return _0x40662[_0x164a('0x5c')](_0x1ff688);}})[_0x164a('0x1c')](function(_0x22c325){if(_0x22c325){_0x1c47f9=_0x22c325[_0x164a('0x56')];if(!_0x4e419f['query'][_0x164a('0x42')](_0x164a('0x43'))){_0x1ff688['limit']=qs[_0x164a('0x2b')](_0x4e419f['query'][_0x164a('0x2b')]);_0x1ff688['offset']=qs[_0x164a('0x2a')](_0x4e419f[_0x164a('0x3d')][_0x164a('0x2a')]);}return _0x40662[_0x164a('0x5c')](_0x1ff688);}})[_0x164a('0x1c')](function(_0x2a32ed){if(_0x2a32ed){return _0x2a32ed?{'count':_0x1c47f9,'rows':_0x2a32ed}:null;}})[_0x164a('0x1c')](respondWithResult(_0x4ef262,null))[_0x164a('0x5a')](handleError(_0x4ef262,null));};exports['getDescriptions']=function(_0x5f35b0,_0x2db767,_0x22e8d2){var _0x19bf82={};var _0x4aa1b9={};var _0x2c2389;var _0x9fb265;return db[_0x164a('0x38')][_0x164a('0x5d')]({'where':{'id':_0x5f35b0[_0x164a('0x53')]['id']}})['then'](handleEntityNotFound(_0x2db767,null))[_0x164a('0x1c')](function(_0x2caf95){if(_0x2caf95){_0x2c2389=_0x2caf95;_0x4aa1b9['model']=_[_0x164a('0x54')](db[_0x164a('0x5e')][_0x164a('0x55')]);_0x4aa1b9[_0x164a('0x3d')]=_[_0x164a('0x54')](_0x5f35b0['query']);_0x4aa1b9[_0x164a('0x47')]=_[_0x164a('0x3e')](_0x4aa1b9[_0x164a('0x3f')],_0x4aa1b9[_0x164a('0x3d')]);_0x19bf82[_0x164a('0x40')]=_['intersection'](_0x4aa1b9[_0x164a('0x3f')],qs['fields'](_0x5f35b0[_0x164a('0x3d')][_0x164a('0x41')]));_0x19bf82['attributes']=_0x19bf82[_0x164a('0x40')][_0x164a('0x56')]?_0x19bf82[_0x164a('0x40')]:_0x4aa1b9['model'];_0x19bf82[_0x164a('0x44')]=qs[_0x164a('0x45')](_0x5f35b0[_0x164a('0x3d')][_0x164a('0x45')]);_0x19bf82['where']=qs[_0x164a('0x47')](_[_0x164a('0x48')](_0x5f35b0[_0x164a('0x3d')],_0x4aa1b9[_0x164a('0x47')]));if(_0x5f35b0[_0x164a('0x3d')][_0x164a('0x49')]){_0x19bf82[_0x164a('0x46')]=_[_0x164a('0x4b')](_0x19bf82[_0x164a('0x46')],{'$or':_[_0x164a('0x3c')](_0x19bf82[_0x164a('0x40')],function(_0x2a337e){var _0x4d7696={};_0x4d7696[_0x2a337e]={'$like':'%'+_0x5f35b0[_0x164a('0x3d')][_0x164a('0x49')]+'%'};return _0x4d7696;})});}_0x19bf82=_['merge']({},_0x19bf82,_0x5f35b0[_0x164a('0x4c')]);return _0x2c2389[_0x164a('0x5f')](_0x19bf82);}})[_0x164a('0x1c')](function(_0x1e09c0){if(_0x1e09c0){_0x9fb265=_0x1e09c0['length'];if(!_0x5f35b0[_0x164a('0x3d')]['hasOwnProperty'](_0x164a('0x43'))){_0x19bf82[_0x164a('0x2b')]=qs[_0x164a('0x2b')](_0x5f35b0[_0x164a('0x3d')]['limit']);_0x19bf82[_0x164a('0x2a')]=qs['offset'](_0x5f35b0[_0x164a('0x3d')]['offset']);}return _0x2c2389[_0x164a('0x5f')](_0x19bf82);}})[_0x164a('0x1c')](function(_0x43dda5){if(_0x43dda5){return _0x43dda5?{'count':_0x9fb265,'rows':_0x43dda5}:null;}})[_0x164a('0x1c')](respondWithResult(_0x2db767,null))[_0x164a('0x5a')](handleError(_0x2db767,null));};exports[_0x164a('0x60')]=function(_0x5a3db5,_0x5b1be1,_0x456960){var _0x38d11c={};var _0x247d39={};var _0x32fedb;var _0xa958b9;return db[_0x164a('0x38')][_0x164a('0x5d')]({'where':{'id':_0x5a3db5[_0x164a('0x53')]['id']}})['then'](handleEntityNotFound(_0x5b1be1,null))[_0x164a('0x1c')](function(_0x488d98){if(_0x488d98){_0x32fedb=_0x488d98;_0x247d39['model']=_['keys'](db[_0x164a('0x61')][_0x164a('0x55')]);_0x247d39[_0x164a('0x3d')]=_[_0x164a('0x54')](_0x5a3db5[_0x164a('0x3d')]);_0x247d39[_0x164a('0x47')]=_[_0x164a('0x3e')](_0x247d39['model'],_0x247d39[_0x164a('0x3d')]);_0x38d11c[_0x164a('0x40')]=_[_0x164a('0x3e')](_0x247d39[_0x164a('0x3f')],qs[_0x164a('0x41')](_0x5a3db5[_0x164a('0x3d')][_0x164a('0x41')]));_0x38d11c[_0x164a('0x40')]=_0x38d11c[_0x164a('0x40')][_0x164a('0x56')]?_0x38d11c[_0x164a('0x40')]:_0x247d39[_0x164a('0x3f')];_0x38d11c[_0x164a('0x44')]=qs[_0x164a('0x45')](_0x5a3db5['query'][_0x164a('0x45')]);_0x38d11c['where']=qs[_0x164a('0x47')](_['pick'](_0x5a3db5[_0x164a('0x3d')],_0x247d39['filters']));if(_0x5a3db5['query']['filter']){_0x38d11c['where']=_[_0x164a('0x4b')](_0x38d11c[_0x164a('0x46')],{'$or':_['map'](_0x38d11c[_0x164a('0x40')],function(_0x424053){var _0x419359={};_0x419359[_0x424053]={'$like':'%'+_0x5a3db5['query']['filter']+'%'};return _0x419359;})});}_0x38d11c=_[_0x164a('0x4b')]({},_0x38d11c,_0x5a3db5[_0x164a('0x4c')]);return _0x32fedb[_0x164a('0x60')](_0x38d11c);}})[_0x164a('0x1c')](function(_0x7e0b4a){if(_0x7e0b4a){_0xa958b9=_0x7e0b4a['length'];if(!_0x5a3db5[_0x164a('0x3d')]['hasOwnProperty'](_0x164a('0x43'))){_0x38d11c['limit']=qs['limit'](_0x5a3db5['query']['limit']);_0x38d11c[_0x164a('0x2a')]=qs['offset'](_0x5a3db5[_0x164a('0x3d')][_0x164a('0x2a')]);}return _0x32fedb['getTags'](_0x38d11c);}})[_0x164a('0x1c')](function(_0x4a0c04){if(_0x4a0c04){return _0x4a0c04?{'count':_0xa958b9,'rows':_0x4a0c04}:null;}})['then'](respondWithResult(_0x5b1be1,null))[_0x164a('0x5a')](handleError(_0x5b1be1,null));};exports['setTags']=function(_0x257458,_0x585748,_0x10facb){if(_0x257458[_0x164a('0x59')]['id']){delete _0x257458[_0x164a('0x59')]['id'];}return db[_0x164a('0x38')][_0x164a('0x5d')]({'where':{'id':_0x257458['params']['id']}})['then'](handleEntityNotFound(_0x585748,null))[_0x164a('0x1c')](function(_0x43885d){if(_0x43885d){return _0x43885d[_0x164a('0x62')](_0x257458[_0x164a('0x59')][_0x164a('0x63')]||[]);}return null;})[_0x164a('0x1c')](respondWithResult(_0x585748,null))[_0x164a('0x5a')](handleError(_0x585748,null));};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
index 7a3d681..eceea9e 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 _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
+var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations'];(function(_0x41b84c,_0xbeeff8){var _0x248c84=function(_0x36a845){while(--_0x36a845){_0x41b84c['push'](_0x41b84c['shift']());}};_0x248c84(++_0xbeeff8);}(_0x5fc3,0xa8));var _0x35fc=function(_0x36bff5,_0x3156cb){_0x36bff5=_0x36bff5-0x0;var _0x80ade5=_0x5fc3[_0x36bff5];return _0x80ade5;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('FreshdeskConfiguration',attributes,{'tableName':_0x35fc('0xb'),'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 b7915a2..cd62e69 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 _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
+var _0x8d42=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1e90af,_0x4ba6ce){var _0x7f1a60=function(_0x5eaac3){while(--_0x5eaac3){_0x1e90af['push'](_0x1e90af['shift']());}};_0x7f1a60(++_0x4ba6ce);}(_0x8d42,0x184));var _0x28d4=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x8d42[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x28d4('0x0'));var util=require(_0x28d4('0x1'));var moment=require(_0x28d4('0x2'));var BPromise=require(_0x28d4('0x3'));var rs=require(_0x28d4('0x4'));var fs=require('fs');var Redis=require(_0x28d4('0x5'));var db=require(_0x28d4('0x6'))['db'];var utils=require(_0x28d4('0x7'));var logger=require(_0x28d4('0x8'))('rpc');var config=require(_0x28d4('0x9'));var jayson=require(_0x28d4('0xa'));var client=jayson[_0x28d4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f8a02,_0x2ff748,_0x12c745){return new BPromise(function(_0x22c682,_0x6f65da){return client[_0x28d4('0xc')](_0x3f8a02,_0x12c745)[_0x28d4('0xd')](function(_0x2c7087){logger[_0x28d4('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2ff748,_0x28d4('0xf'));logger['debug'](_0x28d4('0x10'),_0x2ff748,_0x28d4('0xf'),JSON[_0x28d4('0x11')](_0x2c7087));if(_0x2c7087[_0x28d4('0x12')]){if(_0x2c7087[_0x28d4('0x12')]['code']===0x1f4){logger[_0x28d4('0x12')](_0x28d4('0x13'),_0x2ff748,_0x2c7087[_0x28d4('0x12')][_0x28d4('0x14')]);return _0x6f65da(_0x2c7087[_0x28d4('0x12')][_0x28d4('0x14')]);}logger[_0x28d4('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2ff748,_0x2c7087[_0x28d4('0x12')][_0x28d4('0x14')]);return _0x22c682(_0x2c7087[_0x28d4('0x12')][_0x28d4('0x14')]);}else{logger[_0x28d4('0xe')](_0x28d4('0x13'),_0x2ff748,_0x28d4('0xf'));_0x22c682(_0x2c7087['result'][_0x28d4('0x14')]);}})[_0x28d4('0x15')](function(_0x1d3a85){logger[_0x28d4('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2ff748,_0x1d3a85);_0x6f65da(_0x1d3a85);});});}
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js
index db600eb..8104109 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 _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
+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(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xedd9,0xfc));var _0x9edd=function(_0xf2fadb,_0x43fb47){_0xf2fadb=_0xf2fadb-0x0;var _0x3d342a=_0xedd9[_0xf2fadb];return _0x3d342a;};'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 e7e6e31..6d52451 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 _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
+var _0xfb92=['keyValue','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x345c79,_0x10b704){var _0x26c652=function(_0x3879ad){while(--_0x3879ad){_0x345c79['push'](_0x345c79['shift']());}};_0x26c652(++_0x10b704);}(_0xfb92,0x1e3));var _0x2fb9=function(_0x88ea4e,_0x16b52a){_0x88ea4e=_0x88ea4e-0x0;var _0x91419e=_0xfb92[_0x88ea4e];return _0x91419e;};'use strict';var Sequelize=require(_0x2fb9('0x0'));module['exports']={'type':{'type':Sequelize[_0x2fb9('0x1')](_0x2fb9('0x2'),_0x2fb9('0x3'),_0x2fb9('0x4'),_0x2fb9('0x5')),'defaultValue':_0x2fb9('0x2')},'content':{'type':Sequelize[_0x2fb9('0x6')]},'key':{'type':Sequelize[_0x2fb9('0x6')]},'keyType':{'type':Sequelize[_0x2fb9('0x1')](_0x2fb9('0x2'),_0x2fb9('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2fb9('0x6')]},'customField':{'type':Sequelize[_0x2fb9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2fb9('0x6')]}};
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js
index 1ce556b..33c769b 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 _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
+var _0x24be=['query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','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','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','FreshdeskField','rawAttributes','key','map'];(function(_0x3ab980,_0x43f8b5){var _0x2aed95=function(_0x1d4de4){while(--_0x1d4de4){_0x3ab980['push'](_0x3ab980['shift']());}};_0x2aed95(++_0x43f8b5);}(_0x24be,0x14c));var _0xe24b=function(_0x5826a4,_0x2d6fcb){_0x5826a4=_0x5826a4-0x0;var _0xbe6092=_0x24be[_0x5826a4];return _0xbe6092;};'use strict';var pdf=require(_0xe24b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe24b('0x1'));var zipdir=require(_0xe24b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe24b('0x3'));var BPromise=require(_0xe24b('0x4'));var Mustache=require(_0xe24b('0x5'));var util=require(_0xe24b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe24b('0x7'));var fs=require('fs');var _=require(_0xe24b('0x8'));var squel=require(_0xe24b('0x9'));var crypto=require(_0xe24b('0xa'));var jsforce=require(_0xe24b('0xb'));var deskjs=require(_0xe24b('0xc'));var toCsv=require(_0xe24b('0xd'));var querystring=require(_0xe24b('0xe'));var Papa=require(_0xe24b('0xf'));var Redis=require(_0xe24b('0x10'));var authService=require(_0xe24b('0x11'));var qs=require(_0xe24b('0x12'));var as=require(_0xe24b('0x13'));var hardwareService=require(_0xe24b('0x14'));var logger=require(_0xe24b('0x15'))(_0xe24b('0x16'));var utils=require(_0xe24b('0x17'));var config=require(_0xe24b('0x18'));var db=require(_0xe24b('0x19'))['db'];function respondWithStatusCode(_0x57d6fc,_0x4bc6a9){_0x4bc6a9=_0x4bc6a9||0xcc;return function(_0x3a1da6){if(_0x3a1da6){return _0x57d6fc[_0xe24b('0x1a')](_0x4bc6a9);}return _0x57d6fc['status'](_0x4bc6a9)[_0xe24b('0x1b')]();};}function respondWithResult(_0x5bbe9e,_0x260712){_0x260712=_0x260712||0xc8;return function(_0xe35132){if(_0xe35132){return _0x5bbe9e[_0xe24b('0x1c')](_0x260712)[_0xe24b('0x1d')](_0xe35132);}};}function respondWithFilteredResult(_0x28f5b5,_0xa59b6d){return function(_0x174648){if(_0x174648){var _0x2c36e1=_0x174648['count'],_0x2ce1a7=_0xa59b6d[_0xe24b('0x1e')],_0x5c065d=_0xa59b6d['offset']+_0xa59b6d[_0xe24b('0x1f')],_0x3127ba;if(_0x5c065d>=_0x2c36e1){_0x5c065d=_0x2c36e1;_0x3127ba=0xc8;}else{_0x3127ba=0xce;}_0x28f5b5[_0xe24b('0x1c')](_0x3127ba);return _0x28f5b5[_0xe24b('0x20')](_0xe24b('0x21'),_0x2ce1a7+'-'+_0x5c065d+'/'+_0x2c36e1)[_0xe24b('0x1d')](_0x174648);}return null;};}function patchUpdates(_0x13a8ba){return function(_0x3eb7a5){try{jsonpatch[_0xe24b('0x22')](_0x3eb7a5,_0x13a8ba,!![]);}catch(_0x6cc8b7){return BPromise[_0xe24b('0x23')](_0x6cc8b7);}return _0x3eb7a5[_0xe24b('0x24')]();};}function saveUpdates(_0x510f2e,_0x1479d6){return function(_0x32bb7b){if(_0x32bb7b){return _0x32bb7b[_0xe24b('0x25')](_0x510f2e)[_0xe24b('0x26')](function(_0x130244){return _0x130244;});}return null;};}function removeEntity(_0x20866e,_0x2946fc){return function(_0x4c1763){if(_0x4c1763){return _0x4c1763[_0xe24b('0x27')]()[_0xe24b('0x26')](function(){_0x20866e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c907a,_0x506ef4){return function(_0x3046ef){if(!_0x3046ef){_0x4c907a[_0xe24b('0x1a')](0x194);}return _0x3046ef;};}function handleError(_0x7db912,_0x257c84){_0x257c84=_0x257c84||0x1f4;return function(_0x10f898){logger['error'](_0x10f898[_0xe24b('0x28')]);if(_0x10f898[_0xe24b('0x29')]){delete _0x10f898['name'];}_0x7db912[_0xe24b('0x1c')](_0x257c84)[_0xe24b('0x2a')](_0x10f898);};}exports[_0xe24b('0x2b')]=function(_0x2d5653,_0x4e1a5d){var _0x597a4b={},_0x4fb3da={},_0x49b001={'count':0x0,'rows':[]};var _0x16d25f=_['map'](db[_0xe24b('0x2c')][_0xe24b('0x2d')],function(_0x153865){return{'name':_0x153865['fieldName'],'type':_0x153865['type'][_0xe24b('0x2e')]};});_0x4fb3da['model']=_[_0xe24b('0x2f')](_0x16d25f,_0xe24b('0x29'));_0x4fb3da[_0xe24b('0x30')]=_[_0xe24b('0x31')](_0x2d5653[_0xe24b('0x30')]);_0x4fb3da[_0xe24b('0x32')]=_['intersection'](_0x4fb3da[_0xe24b('0x33')],_0x4fb3da['query']);_0x597a4b[_0xe24b('0x34')]=_[_0xe24b('0x35')](_0x4fb3da['model'],qs['fields'](_0x2d5653[_0xe24b('0x30')][_0xe24b('0x36')]));_0x597a4b[_0xe24b('0x34')]=_0x597a4b[_0xe24b('0x34')][_0xe24b('0x37')]?_0x597a4b[_0xe24b('0x34')]:_0x4fb3da['model'];if(!_0x2d5653[_0xe24b('0x30')]['hasOwnProperty'](_0xe24b('0x38'))){_0x597a4b[_0xe24b('0x1f')]=qs[_0xe24b('0x1f')](_0x2d5653['query'][_0xe24b('0x1f')]);_0x597a4b[_0xe24b('0x1e')]=qs[_0xe24b('0x1e')](_0x2d5653['query'][_0xe24b('0x1e')]);}_0x597a4b[_0xe24b('0x39')]=qs['sort'](_0x2d5653[_0xe24b('0x30')][_0xe24b('0x3a')]);_0x597a4b['where']=qs['filters'](_[_0xe24b('0x3b')](_0x2d5653[_0xe24b('0x30')],_0x4fb3da[_0xe24b('0x32')]),_0x16d25f);if(_0x2d5653[_0xe24b('0x30')][_0xe24b('0x3c')]){_0x597a4b[_0xe24b('0x3d')]=_[_0xe24b('0x3e')](_0x597a4b[_0xe24b('0x3d')],{'$or':_[_0xe24b('0x2f')](_0x16d25f,function(_0x6d7a19){if(_0x6d7a19[_0xe24b('0x3f')]!==_0xe24b('0x40')){var _0x5008da={};_0x5008da[_0x6d7a19[_0xe24b('0x29')]]={'$like':'%'+_0x2d5653[_0xe24b('0x30')][_0xe24b('0x3c')]+'%'};return _0x5008da;}})});}_0x597a4b=_['merge']({},_0x597a4b,_0x2d5653[_0xe24b('0x41')]);var _0xf70510={'where':_0x597a4b[_0xe24b('0x3d')]};return db[_0xe24b('0x2c')]['count'](_0xf70510)[_0xe24b('0x26')](function(_0x4031bb){_0x49b001[_0xe24b('0x42')]=_0x4031bb;if(_0x2d5653['query'][_0xe24b('0x43')]){_0x597a4b[_0xe24b('0x44')]=[{'all':!![]}];}return db['FreshdeskField'][_0xe24b('0x45')](_0x597a4b);})[_0xe24b('0x26')](function(_0x2faf6a){_0x49b001[_0xe24b('0x46')]=_0x2faf6a;return _0x49b001;})[_0xe24b('0x26')](respondWithFilteredResult(_0x4e1a5d,_0x597a4b))[_0xe24b('0x47')](handleError(_0x4e1a5d,null));};exports[_0xe24b('0x48')]=function(_0x146583,_0x125e97){var _0x5ca56a={'raw':!![],'where':{'id':_0x146583['params']['id']}},_0x4d9c41={};_0x4d9c41[_0xe24b('0x33')]=_['keys'](db[_0xe24b('0x2c')][_0xe24b('0x2d')]);_0x4d9c41[_0xe24b('0x30')]=_[_0xe24b('0x31')](_0x146583['query']);_0x4d9c41[_0xe24b('0x32')]=_['intersection'](_0x4d9c41[_0xe24b('0x33')],_0x4d9c41[_0xe24b('0x30')]);_0x5ca56a['attributes']=_[_0xe24b('0x35')](_0x4d9c41[_0xe24b('0x33')],qs['fields'](_0x146583[_0xe24b('0x30')][_0xe24b('0x36')]));_0x5ca56a[_0xe24b('0x34')]=_0x5ca56a[_0xe24b('0x34')][_0xe24b('0x37')]?_0x5ca56a[_0xe24b('0x34')]:_0x4d9c41['model'];if(_0x146583[_0xe24b('0x30')][_0xe24b('0x43')]){_0x5ca56a[_0xe24b('0x44')]=[{'all':!![]}];}_0x5ca56a=_[_0xe24b('0x3e')]({},_0x5ca56a,_0x146583[_0xe24b('0x41')]);return db['FreshdeskField'][_0xe24b('0x49')](_0x5ca56a)['then'](handleEntityNotFound(_0x125e97,null))[_0xe24b('0x26')](respondWithResult(_0x125e97,null))['catch'](handleError(_0x125e97,null));};exports['create']=function(_0x15e49b,_0x13c79f){return db['FreshdeskField'][_0xe24b('0x4a')](_0x15e49b['body'],{})['then'](respondWithResult(_0x13c79f,0xc9))[_0xe24b('0x47')](handleError(_0x13c79f,null));};exports[_0xe24b('0x25')]=function(_0x455490,_0x3ca3d8){if(_0x455490[_0xe24b('0x4b')]['id']){delete _0x455490['body']['id'];}return db['FreshdeskField'][_0xe24b('0x49')]({'where':{'id':_0x455490['params']['id']}})[_0xe24b('0x26')](handleEntityNotFound(_0x3ca3d8,null))[_0xe24b('0x26')](saveUpdates(_0x455490[_0xe24b('0x4b')],null))[_0xe24b('0x26')](respondWithResult(_0x3ca3d8,null))[_0xe24b('0x47')](handleError(_0x3ca3d8,null));};exports[_0xe24b('0x27')]=function(_0x24bf93,_0x3bead0){return db[_0xe24b('0x2c')]['find']({'where':{'id':_0x24bf93['params']['id']}})[_0xe24b('0x26')](handleEntityNotFound(_0x3bead0,null))[_0xe24b('0x26')](removeEntity(_0x3bead0,null))['catch'](handleError(_0x3bead0,null));};
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js
index 4fa91bf..4d23048 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 _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
+var _0xe7df=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index'];(function(_0x18d665,_0x2f65ab){var _0x4abe5c=function(_0x199e11){while(--_0x199e11){_0x18d665['push'](_0x18d665['shift']());}};_0x4abe5c(++_0x2f65ab);}(_0xe7df,0x98));var _0xfe7d=function(_0x1df24f,_0x3fef84){_0x1df24f=_0x1df24f-0x0;var _0x1fe835=_0xe7df[_0x1df24f];return _0x1fe835;};'use strict';var _=require(_0xfe7d('0x0'));var util=require(_0xfe7d('0x1'));var logger=require(_0xfe7d('0x2'))(_0xfe7d('0x3'));var moment=require(_0xfe7d('0x4'));var BPromise=require(_0xfe7d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe7d('0x6'));var rimraf=require(_0xfe7d('0x7'));var config=require('../../config/environment');var attributes=require(_0xfe7d('0x8'));module['exports']=function(_0x4e7f9d,_0x44fd2b){return _0x4e7f9d[_0xfe7d('0x9')](_0xfe7d('0xa'),attributes,{'tableName':_0xfe7d('0xb'),'paranoid':![],'indexes':[{'name':_0xfe7d('0xc'),'fields':[_0xfe7d('0xd'),_0xfe7d('0xe')],'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 bdf42b0..41ba86b 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 _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
+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(_0x598737,_0x53c409){var _0x13782d=function(_0x513ce0){while(--_0x513ce0){_0x598737['push'](_0x598737['shift']());}};_0x13782d(++_0x53c409);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e99bc,_0x3a0006){_0x1e99bc=_0x1e99bc-0x0;var _0x281232=_0xb10b[_0x1e99bc];return _0x281232;};'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
diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js
index ae40c90..699a642 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 _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
+var _0x6060=['/:id/configurations','getConfigurations','getFields','create','post','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','show'];(function(_0xc86b48,_0x212e1b){var _0x1741e9=function(_0xf15453){while(--_0xf15453){_0xc86b48['push'](_0xc86b48['shift']());}};_0x1741e9(++_0x212e1b);}(_0x6060,0x1bf));var _0x0606=function(_0x37026f,_0x2df88f){_0x37026f=_0x37026f-0x0;var _0x40cb74=_0x6060[_0x37026f];return _0x40cb74;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0606('0x0'));var timeout=require(_0x0606('0x1'));var express=require(_0x0606('0x2'));var router=express[_0x0606('0x3')]();var auth=require(_0x0606('0x4'));var interaction=require(_0x0606('0x5'));var config=require(_0x0606('0x6'));var controller=require(_0x0606('0x7'));router[_0x0606('0x8')]('/',auth['isAuthenticated'](),controller[_0x0606('0x9')]);router[_0x0606('0x8')](_0x0606('0xa'),auth[_0x0606('0xb')](),controller[_0x0606('0xc')]);router[_0x0606('0x8')](_0x0606('0xd'),auth['isAuthenticated'](),controller[_0x0606('0xe')]);router[_0x0606('0x8')]('/:id/fields',auth[_0x0606('0xb')](),controller[_0x0606('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0606('0x10')]);router[_0x0606('0x11')](_0x0606('0xd'),auth[_0x0606('0xb')](),controller['addConfiguration']);router[_0x0606('0x12')](_0x0606('0xa'),auth[_0x0606('0xb')](),controller[_0x0606('0x13')]);router[_0x0606('0x14')](_0x0606('0xa'),auth['isAuthenticated'](),controller[_0x0606('0x15')]);module[_0x0606('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
index b80bcbd..55b9b34 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 _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
+var _0xc891=['STRING','username','sequelize'];(function(_0x137c03,_0x5b0e26){var _0x762570=function(_0x452bc3){while(--_0x452bc3){_0x137c03['push'](_0x137c03['shift']());}};_0x762570(++_0x5b0e26);}(_0xc891,0x152));var _0x1c89=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xc891[_0x2b7764];return _0x848dcb;};'use strict';var Sequelize=require(_0x1c89('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1c89('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x1c89('0x2')},'apiKey':{'type':Sequelize[_0x1c89('0x1')]},'remoteUri':{'type':Sequelize[_0x1c89('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x1c89('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
index edcf3f9..51a1449 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 _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
+var _0x38c7=['getConfigurations','FreshsalesConfiguration','sort','findOne','getSubjects','Descriptions','channel','Subjects','getFields','remoteUri','apiKey','substring','GET','format','/api/selector/owners','Token\x20token=','users','email','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','request-promise','moment','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','api','../../config/utils','../../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\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','info','result','sendStatus','status','end','count','offset','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','index','FreshsalesAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body'];(function(_0x4ead7d,_0xff4c17){var _0x312141=function(_0x53fe4c){while(--_0x53fe4c){_0x4ead7d['push'](_0x4ead7d['shift']());}};_0x312141(++_0xff4c17);}(_0x38c7,0x165));var _0x738c=function(_0x1ceee0,_0x527a5f){_0x1ceee0=_0x1ceee0-0x0;var _0x4a7ba5=_0x38c7[_0x1ceee0];return _0x4a7ba5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x738c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x738c('0x1'));var moment=require(_0x738c('0x2'));var BPromise=require(_0x738c('0x3'));var Mustache=require(_0x738c('0x4'));var util=require(_0x738c('0x5'));var path=require(_0x738c('0x6'));var sox=require(_0x738c('0x7'));var csv=require(_0x738c('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x738c('0x9'));var squel=require(_0x738c('0xa'));var crypto=require('crypto');var jsforce=require(_0x738c('0xb'));var deskjs=require(_0x738c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x738c('0xd'));var Papa=require(_0x738c('0xe'));var Redis=require(_0x738c('0xf'));var authService=require(_0x738c('0x10'));var qs=require(_0x738c('0x11'));var as=require(_0x738c('0x12'));var hardwareService=require(_0x738c('0x13'));var logger=require(_0x738c('0x14'))(_0x738c('0x15'));var utils=require(_0x738c('0x16'));var config=require(_0x738c('0x17'));var db=require(_0x738c('0x18'))['db'];var integrations=require(_0x738c('0x19'));var jayson=require(_0x738c('0x1a'));var client=jayson[_0x738c('0x1b')][_0x738c('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2647a4,_0x6472b2,_0x2fe900){if(_0x2fe900){var _0x5e5cc4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e5cc4[_0x738c('0x1d')](_0x6472b2)){return _0x2647a4;}else{throw new db[(_0x738c('0x1e'))][(_0x738c('0x1f'))](_0x738c('0x20'));}}else{return _0x2647a4;}}function respondWithRpcPromise(_0x33492c,_0x35a94e,_0xf711f2,_0x4a2e73){return new BPromise(function(_0x252d12,_0x321c80){var _0x1400bb=_0x4a2e73||client;return _0x1400bb['request'](_0x33492c,_0xf711f2)['then'](function(_0xe8c121){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x35a94e,_0x738c('0x21'));logger[_0x738c('0x22')](_0x738c('0x23'),_0x35a94e,_0x738c('0x21'),JSON[_0x738c('0x24')](_0xe8c121));if(_0xe8c121[_0x738c('0x25')]){if(_0xe8c121['error'][_0x738c('0x26')]===0x1f4){logger[_0x738c('0x25')](_0x738c('0x27'),_0x35a94e,_0xe8c121['error'][_0x738c('0x28')]);return _0x321c80(_0xe8c121['error']['message']);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x35a94e,_0xe8c121[_0x738c('0x25')][_0x738c('0x28')]);return _0x252d12(_0xe8c121[_0x738c('0x25')][_0x738c('0x28')]);}else{logger[_0x738c('0x29')]('FreshsalesAccount,\x20%s,\x20%s',_0x35a94e,'request\x20sent');_0x252d12(_0xe8c121[_0x738c('0x2a')][_0x738c('0x28')]);}})['catch'](function(_0x617d88){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x35a94e,_0x617d88);_0x321c80(_0x617d88);});});}function respondWithStatusCode(_0x58b010,_0x26a797){_0x26a797=_0x26a797||0xcc;return function(_0x222302){if(_0x222302){return _0x58b010[_0x738c('0x2b')](_0x26a797);}return _0x58b010[_0x738c('0x2c')](_0x26a797)[_0x738c('0x2d')]();};}function respondWithResult(_0x266c95,_0x2c3e4d){_0x2c3e4d=_0x2c3e4d||0xc8;return function(_0x340514){if(_0x340514){return _0x266c95[_0x738c('0x2c')](_0x2c3e4d)['json'](_0x340514);}};}function respondWithFilteredResult(_0x4c3832,_0xadd58){return function(_0x3620e6){if(_0x3620e6){var _0x412241=_0x3620e6[_0x738c('0x2e')],_0x4469c3=_0xadd58[_0x738c('0x2f')],_0x15e7c8=_0xadd58[_0x738c('0x2f')]+_0xadd58['limit'],_0x4215db;if(_0x15e7c8>=_0x412241){_0x15e7c8=_0x412241;_0x4215db=0xc8;}else{_0x4215db=0xce;}_0x4c3832[_0x738c('0x2c')](_0x4215db);return _0x4c3832[_0x738c('0x30')](_0x738c('0x31'),_0x4469c3+'-'+_0x15e7c8+'/'+_0x412241)[_0x738c('0x32')](_0x3620e6);}return null;};}function patchUpdates(_0x412f4b){return function(_0x2d546c){try{jsonpatch['apply'](_0x2d546c,_0x412f4b,!![]);}catch(_0x31cb44){return BPromise[_0x738c('0x33')](_0x31cb44);}return _0x2d546c[_0x738c('0x34')]();};}function saveUpdates(_0x2251d6,_0x1e7d4f){return function(_0x4743ff){if(_0x4743ff){return _0x4743ff[_0x738c('0x35')](_0x2251d6)[_0x738c('0x36')](function(_0x56f523){return _0x56f523;});}return null;};}function removeEntity(_0x158998,_0x499886){return function(_0x5bc8c5){if(_0x5bc8c5){return _0x5bc8c5[_0x738c('0x37')]()['then'](function(){_0x158998['status'](0xcc)[_0x738c('0x2d')]();});}};}function handleEntityNotFound(_0x12fb68,_0x34d932){return function(_0x25b8a3){if(!_0x25b8a3){_0x12fb68[_0x738c('0x2b')](0x194);}return _0x25b8a3;};}function handleError(_0x32dc23,_0x412eed){_0x412eed=_0x412eed||0x1f4;return function(_0x5c095a){logger[_0x738c('0x25')](_0x5c095a[_0x738c('0x38')]);if(_0x5c095a[_0x738c('0x39')]){delete _0x5c095a[_0x738c('0x39')];}_0x32dc23[_0x738c('0x2c')](_0x412eed)[_0x738c('0x3a')](_0x5c095a);};}exports[_0x738c('0x3b')]=function(_0x480a29,_0x36c3b2){var _0x1b6b48={},_0xbb70e2={},_0x3157eb={'count':0x0,'rows':[]};var _0x3ee46a=_['map'](db[_0x738c('0x3c')][_0x738c('0x3d')],function(_0x3de8c2){return{'name':_0x3de8c2['fieldName'],'type':_0x3de8c2[_0x738c('0x3e')][_0x738c('0x3f')]};});_0xbb70e2[_0x738c('0x40')]=_[_0x738c('0x41')](_0x3ee46a,_0x738c('0x39'));_0xbb70e2[_0x738c('0x42')]=_[_0x738c('0x43')](_0x480a29[_0x738c('0x42')]);_0xbb70e2[_0x738c('0x44')]=_['intersection'](_0xbb70e2[_0x738c('0x40')],_0xbb70e2['query']);_0x1b6b48['attributes']=_[_0x738c('0x45')](_0xbb70e2[_0x738c('0x40')],qs[_0x738c('0x46')](_0x480a29[_0x738c('0x42')][_0x738c('0x46')]));_0x1b6b48['attributes']=_0x1b6b48['attributes']['length']?_0x1b6b48[_0x738c('0x47')]:_0xbb70e2['model'];if(!_0x480a29[_0x738c('0x42')][_0x738c('0x48')](_0x738c('0x49'))){_0x1b6b48[_0x738c('0x4a')]=qs['limit'](_0x480a29[_0x738c('0x42')][_0x738c('0x4a')]);_0x1b6b48[_0x738c('0x2f')]=qs[_0x738c('0x2f')](_0x480a29[_0x738c('0x42')][_0x738c('0x2f')]);}_0x1b6b48['order']=qs['sort'](_0x480a29[_0x738c('0x42')]['sort']);_0x1b6b48[_0x738c('0x4b')]=qs[_0x738c('0x44')](_[_0x738c('0x4c')](_0x480a29['query'],_0xbb70e2[_0x738c('0x44')]),_0x3ee46a);if(_0x480a29['query'][_0x738c('0x4d')]){_0x1b6b48[_0x738c('0x4b')]=_['merge'](_0x1b6b48[_0x738c('0x4b')],{'$or':_['map'](_0x3ee46a,function(_0x3bd397){if(_0x3bd397[_0x738c('0x3e')]!=='VIRTUAL'){var _0x22ed18={};_0x22ed18[_0x3bd397[_0x738c('0x39')]]={'$like':'%'+_0x480a29[_0x738c('0x42')][_0x738c('0x4d')]+'%'};return _0x22ed18;}})});}_0x1b6b48=_[_0x738c('0x4e')]({},_0x1b6b48,_0x480a29[_0x738c('0x4f')]);var _0x2053f4={'where':_0x1b6b48[_0x738c('0x4b')]};return db['FreshsalesAccount'][_0x738c('0x2e')](_0x2053f4)[_0x738c('0x36')](function(_0x150ee8){_0x3157eb[_0x738c('0x2e')]=_0x150ee8;if(_0x480a29[_0x738c('0x42')][_0x738c('0x50')]){_0x1b6b48[_0x738c('0x51')]=[{'all':!![]}];}return db[_0x738c('0x3c')][_0x738c('0x52')](_0x1b6b48);})[_0x738c('0x36')](function(_0x513926){_0x3157eb[_0x738c('0x53')]=_0x513926;return _0x3157eb;})['then'](respondWithFilteredResult(_0x36c3b2,_0x1b6b48))['catch'](handleError(_0x36c3b2,null));};exports[_0x738c('0x54')]=function(_0x3e31a0,_0x9e1939){var _0x253f9c={'raw':![],'where':{'id':_0x3e31a0[_0x738c('0x55')]['id']}},_0x198eeb={};_0x198eeb[_0x738c('0x40')]=_[_0x738c('0x43')](db[_0x738c('0x3c')][_0x738c('0x3d')]);_0x198eeb[_0x738c('0x42')]=_[_0x738c('0x43')](_0x3e31a0['query']);_0x198eeb['filters']=_[_0x738c('0x45')](_0x198eeb['model'],_0x198eeb[_0x738c('0x42')]);_0x253f9c[_0x738c('0x47')]=_[_0x738c('0x45')](_0x198eeb[_0x738c('0x40')],qs[_0x738c('0x46')](_0x3e31a0[_0x738c('0x42')][_0x738c('0x46')]));_0x253f9c[_0x738c('0x47')]=_0x253f9c[_0x738c('0x47')][_0x738c('0x56')]?_0x253f9c['attributes']:_0x198eeb[_0x738c('0x40')];if(_0x3e31a0[_0x738c('0x42')][_0x738c('0x50')]){_0x253f9c[_0x738c('0x51')]=[{'all':!![]}];}_0x253f9c=_[_0x738c('0x4e')]({},_0x253f9c,_0x3e31a0[_0x738c('0x4f')]);return db[_0x738c('0x3c')][_0x738c('0x57')](_0x253f9c)[_0x738c('0x36')](handleEntityNotFound(_0x9e1939,null))[_0x738c('0x36')](respondWithResult(_0x9e1939,null))[_0x738c('0x58')](handleError(_0x9e1939,null));};exports[_0x738c('0x59')]=function(_0x157a07,_0x531340){return db[_0x738c('0x3c')]['create'](_0x157a07[_0x738c('0x5a')],{})[_0x738c('0x36')](respondWithResult(_0x531340,0xc9))['catch'](handleError(_0x531340,null));};exports[_0x738c('0x35')]=function(_0x29dc04,_0x2c7566){if(_0x29dc04['body']['id']){delete _0x29dc04[_0x738c('0x5a')]['id'];}return db[_0x738c('0x3c')][_0x738c('0x57')]({'where':{'id':_0x29dc04[_0x738c('0x55')]['id']}})['then'](handleEntityNotFound(_0x2c7566,null))[_0x738c('0x36')](saveUpdates(_0x29dc04[_0x738c('0x5a')],null))[_0x738c('0x36')](respondWithResult(_0x2c7566,null))[_0x738c('0x58')](handleError(_0x2c7566,null));};exports['destroy']=function(_0x31c784,_0x478abd){return db[_0x738c('0x3c')][_0x738c('0x57')]({'where':{'id':_0x31c784[_0x738c('0x55')]['id']}})[_0x738c('0x36')](handleEntityNotFound(_0x478abd,null))[_0x738c('0x36')](removeEntity(_0x478abd,null))[_0x738c('0x58')](handleError(_0x478abd,null));};exports[_0x738c('0x5b')]=function(_0x16a75c,_0x16ac49,_0x679974){var _0x413205={};var _0x24d6e5={};var _0x28b1c8;var _0x1365cf;return db[_0x738c('0x3c')]['findOne']({'where':{'id':_0x16a75c[_0x738c('0x55')]['id']}})[_0x738c('0x36')](handleEntityNotFound(_0x16ac49,null))[_0x738c('0x36')](function(_0x4e5175){if(_0x4e5175){_0x28b1c8=_0x4e5175;_0x24d6e5[_0x738c('0x40')]=_[_0x738c('0x43')](db[_0x738c('0x5c')]['rawAttributes']);_0x24d6e5[_0x738c('0x42')]=_[_0x738c('0x43')](_0x16a75c[_0x738c('0x42')]);_0x24d6e5[_0x738c('0x44')]=_[_0x738c('0x45')](_0x24d6e5[_0x738c('0x40')],_0x24d6e5['query']);_0x413205['attributes']=_[_0x738c('0x45')](_0x24d6e5[_0x738c('0x40')],qs[_0x738c('0x46')](_0x16a75c[_0x738c('0x42')][_0x738c('0x46')]));_0x413205[_0x738c('0x47')]=_0x413205['attributes']['length']?_0x413205[_0x738c('0x47')]:_0x24d6e5[_0x738c('0x40')];_0x413205['order']=qs['sort'](_0x16a75c[_0x738c('0x42')][_0x738c('0x5d')]);_0x413205[_0x738c('0x4b')]=qs[_0x738c('0x44')](_[_0x738c('0x4c')](_0x16a75c[_0x738c('0x42')],_0x24d6e5[_0x738c('0x44')]));if(_0x16a75c[_0x738c('0x42')][_0x738c('0x4d')]){_0x413205[_0x738c('0x4b')]=_[_0x738c('0x4e')](_0x413205[_0x738c('0x4b')],{'$or':_[_0x738c('0x41')](_0x413205['attributes'],function(_0x19c800){var _0xeb4851={};_0xeb4851[_0x19c800]={'$like':'%'+_0x16a75c[_0x738c('0x42')][_0x738c('0x4d')]+'%'};return _0xeb4851;})});}_0x413205=_[_0x738c('0x4e')]({},_0x413205,_0x16a75c[_0x738c('0x4f')]);return _0x28b1c8[_0x738c('0x5b')](_0x413205);}})[_0x738c('0x36')](function(_0x7c1834){if(_0x7c1834){_0x1365cf=_0x7c1834[_0x738c('0x56')];if(!_0x16a75c[_0x738c('0x42')][_0x738c('0x48')](_0x738c('0x49'))){_0x413205[_0x738c('0x4a')]=qs[_0x738c('0x4a')](_0x16a75c[_0x738c('0x42')][_0x738c('0x4a')]);_0x413205[_0x738c('0x2f')]=qs[_0x738c('0x2f')](_0x16a75c[_0x738c('0x42')][_0x738c('0x2f')]);}return _0x28b1c8['getConfigurations'](_0x413205);}})[_0x738c('0x36')](function(_0x86b78d){if(_0x86b78d){return _0x86b78d?{'count':_0x1365cf,'rows':_0x86b78d}:null;}})['then'](respondWithResult(_0x16ac49,null))[_0x738c('0x58')](handleError(_0x16ac49,null));};exports['addConfiguration']=function(_0x3cebc0,_0x106442,_0x53a20e){if(_0x3cebc0['body']['id']){delete _0x3cebc0[_0x738c('0x5a')]['id'];}return db[_0x738c('0x3c')][_0x738c('0x5e')]({'where':{'id':_0x3cebc0['params']['id']}})[_0x738c('0x36')](handleEntityNotFound(_0x106442,null))[_0x738c('0x36')](function(_0x103266){if(_0x103266){_0x3cebc0['body']['AccountId']=_0x103266['id'];_0x3cebc0[_0x738c('0x5a')]['Subjects']=integrations[_0x738c('0x5f')](_0x3cebc0[_0x738c('0x5a')]['channel'],_0x3cebc0['body'][_0x738c('0x3e')]);_0x3cebc0[_0x738c('0x5a')][_0x738c('0x60')]=integrations['getDescriptions'](_0x3cebc0[_0x738c('0x5a')][_0x738c('0x61')],_0x3cebc0[_0x738c('0x5a')][_0x738c('0x3e')]);return db['FreshsalesConfiguration'][_0x738c('0x59')](_0x3cebc0[_0x738c('0x5a')],{'include':[{'model':db['FreshsalesField'],'as':_0x738c('0x62')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})[_0x738c('0x36')](respondWithResult(_0x106442,null))[_0x738c('0x58')](handleError(_0x106442,null));};exports[_0x738c('0x63')]=function(_0x23f44c,_0x64ec66,_0x483d8e){var _0x11ab95='';var _0x90fe87='';return db[_0x738c('0x3c')][_0x738c('0x5e')]({'where':{'id':_0x23f44c['params']['id']},'attributes':['id','username',_0x738c('0x64'),_0x738c('0x65')]})['then'](handleEntityNotFound(_0x64ec66,null))[_0x738c('0x36')](function(_0x205893){if(_0x205893){_0x90fe87=_0x205893['username'];_0x11ab95=_0x205893[_0x738c('0x64')];var _0x49d157=_0x205893[_0x738c('0x64')]['slice'](-0x1);if(_0x49d157==='/'){_0x11ab95=_0x11ab95[_0x738c('0x66')](0x0,_0x11ab95['lastIndexOf'](_0x49d157));}return rp({'method':_0x738c('0x67'),'uri':util[_0x738c('0x68')]('%s%s',_0x11ab95,_0x738c('0x69')),'headers':{'Authorization':_0x738c('0x6a')+_0x205893['apiKey']},'json':!![]});}})[_0x738c('0x36')](function(_0x1cdb6e){if(_0x1cdb6e){var _0xf3b461=_0x1cdb6e[_0x738c('0x6b')];var _0x322172=![];var _0x5f29cf=null;for(_0x5f29cf=0x0;_0x5f29cf<_0xf3b461[_0x738c('0x56')];_0x5f29cf++){if(_0xf3b461[_0x5f29cf][_0x738c('0x6c')]===_0x90fe87){_0x322172=!![];}}if(_0x322172){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x738c('0x36')](respondWithResult(_0x64ec66,null))[_0x738c('0x58')](function(_0x5f31b1){var _0x231d18=_0x23f44c[_0x738c('0x42')][_0x738c('0x1d')]?0x1f4:_0x5f31b1[_0x738c('0x6d')]||0x1f4;logger[_0x738c('0x25')](_0x738c('0x6e'),'getFields',_0x231d18,JSON[_0x738c('0x24')](_0x5f31b1));delete _0x5f31b1[_0x738c('0x39')];if(_0x231d18===0x191){_0x231d18=0x190;}_0x64ec66[_0x738c('0x2c')](_0x231d18)[_0x738c('0x3a')](_0x23f44c[_0x738c('0x42')]['test']?{'message':_0x738c('0x6f'),'statusCode':_0x5f31b1[_0x738c('0x6d')]}:_0x5f31b1);});};
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
index 4adb7d9..7bf54a2 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 _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
+var _0x57d4=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','util','api','moment','bluebird','request-promise'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0x57d4,0x78));var _0x457d=function(_0x1995d2,_0x239964){_0x1995d2=_0x1995d2-0x0;var _0x442aa0=_0x57d4[_0x1995d2];return _0x442aa0;};'use strict';var _=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var logger=require('../../config/logger')(_0x457d('0x2'));var moment=require(_0x457d('0x3'));var BPromise=require(_0x457d('0x4'));var rp=require(_0x457d('0x5'));var fs=require('fs');var path=require(_0x457d('0x6'));var rimraf=require(_0x457d('0x7'));var config=require(_0x457d('0x8'));var attributes=require(_0x457d('0x9'));var integrations=require(_0x457d('0xa'));module[_0x457d('0xb')]=function(_0x3fd867,_0x5c6816){return _0x3fd867[_0x457d('0xc')](_0x457d('0xd'),attributes,{'tableName':'int_freshsales_accounts','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 74caf4c..4054a1d 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 _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
+var _0x676c=['then','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','FreshsalesAccount,\x20%s,\x20%s','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','include','model','map','info','stringify','ShowFreshsalesAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x35c5a8,_0x8ecb48){var _0x34782c=function(_0x1b23ec){while(--_0x1b23ec){_0x35c5a8['push'](_0x35c5a8['shift']());}};_0x34782c(++_0x8ecb48);}(_0x676c,0x198));var _0xc676=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x676c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc676('0x0'));var util=require(_0xc676('0x1'));var moment=require(_0xc676('0x2'));var BPromise=require('bluebird');var rs=require(_0xc676('0x3'));var fs=require('fs');var Redis=require(_0xc676('0x4'));var db=require(_0xc676('0x5'))['db'];var utils=require(_0xc676('0x6'));var logger=require(_0xc676('0x7'))(_0xc676('0x8'));var config=require('../../config/environment');var jayson=require(_0xc676('0x9'));var client=jayson[_0xc676('0xa')][_0xc676('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c7510,_0x36fa26,_0x4a71a8){return new BPromise(function(_0x26ad9c,_0x5e8ad4){return client['request'](_0x2c7510,_0x4a71a8)[_0xc676('0xc')](function(_0x27912c){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x36fa26,_0xc676('0xd'));logger[_0xc676('0xe')](_0xc676('0xf'),_0x36fa26,'request\x20sent',JSON['stringify'](_0x27912c));if(_0x27912c[_0xc676('0x10')]){if(_0x27912c[_0xc676('0x10')][_0xc676('0x11')]===0x1f4){logger[_0xc676('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x36fa26,_0x27912c[_0xc676('0x10')][_0xc676('0x12')]);return _0x5e8ad4(_0x27912c[_0xc676('0x10')][_0xc676('0x12')]);}logger[_0xc676('0x10')](_0xc676('0x13'),_0x36fa26,_0x27912c[_0xc676('0x10')]['message']);return _0x26ad9c(_0x27912c[_0xc676('0x10')]['message']);}else{logger['info'](_0xc676('0x13'),_0x36fa26,'request\x20sent');_0x26ad9c(_0x27912c['result']['message']);}})[_0xc676('0x14')](function(_0x4ee99d){logger[_0xc676('0x10')](_0xc676('0x13'),_0x36fa26,_0x4ee99d);_0x5e8ad4(_0x4ee99d);});});}exports[_0xc676('0x15')]=function(_0x3b3215){var _0x3f1f5d=this;return new Promise(function(_0x215ea6,_0x4f0269){return db[_0xc676('0x16')][_0xc676('0x17')]({'raw':_0x3b3215['options']?_0x3b3215[_0xc676('0x18')][_0xc676('0x19')]===undefined?!![]:![]:!![],'where':_0x3b3215[_0xc676('0x18')]?_0x3b3215[_0xc676('0x18')][_0xc676('0x1a')]||null:null,'attributes':_0x3b3215[_0xc676('0x18')]?_0x3b3215[_0xc676('0x18')][_0xc676('0x1b')]||null:null,'limit':_0x3b3215['options']?_0x3b3215['options']['limit']||null:null,'include':_0x3b3215[_0xc676('0x18')]?_0x3b3215['options'][_0xc676('0x1c')]?_['map'](_0x3b3215['options'][_0xc676('0x1c')],function(_0x575de4){return{'model':db[_0x575de4[_0xc676('0x1d')]],'as':_0x575de4['as'],'attributes':_0x575de4[_0xc676('0x1b')],'include':_0x575de4[_0xc676('0x1c')]?_[_0xc676('0x1e')](_0x575de4[_0xc676('0x1c')],function(_0x4ca666){return{'model':db[_0x4ca666[_0xc676('0x1d')]],'as':_0x4ca666['as'],'attributes':_0x4ca666[_0xc676('0x1b')],'include':_0x4ca666[_0xc676('0x1c')]?_['map'](_0x4ca666[_0xc676('0x1c')],function(_0x4b61aa){return{'model':db[_0x4b61aa[_0xc676('0x1d')]],'as':_0x4b61aa['as'],'attributes':_0x4b61aa[_0xc676('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x361f97){logger[_0xc676('0x1f')]('GetFreshsalesAccount',_0x3b3215);logger[_0xc676('0xe')](_0xc676('0x15'),_0x3b3215,JSON[_0xc676('0x20')](_0x361f97));_0x215ea6(_0x361f97);})['catch'](function(_0x278ccc){logger[_0xc676('0x10')](_0xc676('0x15'),_0x278ccc[_0xc676('0x12')],_0x3b3215);_0x4f0269(_0x3f1f5d[_0xc676('0x10')](0x1f4,_0x278ccc['message']));});});};exports[_0xc676('0x21')]=function(_0x19338b){var _0x3e1b89=this;return new Promise(function(_0x39d9a0,_0xed17d6){return db['FreshsalesAccount'][_0xc676('0x22')]({'raw':_0x19338b[_0xc676('0x18')]?_0x19338b[_0xc676('0x18')][_0xc676('0x19')]===undefined?!![]:![]:!![],'where':_0x19338b['options']?_0x19338b[_0xc676('0x18')][_0xc676('0x1a')]||null:null,'attributes':_0x19338b[_0xc676('0x18')]?_0x19338b[_0xc676('0x18')][_0xc676('0x1b')]||null:null,'include':_0x19338b[_0xc676('0x18')]?_0x19338b[_0xc676('0x18')][_0xc676('0x1c')]?_[_0xc676('0x1e')](_0x19338b['options']['include'],function(_0x4a29f6){return{'model':db[_0x4a29f6[_0xc676('0x1d')]],'as':_0x4a29f6['as'],'attributes':_0x4a29f6[_0xc676('0x1b')],'include':_0x4a29f6[_0xc676('0x1c')]?_[_0xc676('0x1e')](_0x4a29f6['include'],function(_0x3298f1){return{'model':db[_0x3298f1[_0xc676('0x1d')]],'as':_0x3298f1['as'],'attributes':_0x3298f1[_0xc676('0x1b')],'include':_0x3298f1[_0xc676('0x1c')]?_[_0xc676('0x1e')](_0x3298f1[_0xc676('0x1c')],function(_0x4efce8){return{'model':db[_0x4efce8['model']],'as':_0x4efce8['as'],'attributes':_0x4efce8[_0xc676('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14f703){logger[_0xc676('0x1f')](_0xc676('0x21'),_0x19338b);logger[_0xc676('0xe')]('ShowFreshsalesAccount',_0x19338b,JSON['stringify'](_0x14f703));_0x39d9a0(_0x14f703);})['catch'](function(_0x133489){logger[_0xc676('0x10')](_0xc676('0x21'),_0x133489[_0xc676('0x12')],_0x19338b);_0xed17d6(_0x3e1b89[_0xc676('0x10')](0x1f4,_0x133489[_0xc676('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js
index 3e0ce0d..3d5b94d 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 _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
+var _0x58a8=['show','/:id/subjects','getDescriptions','/:id/fields','getFields','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','index','get','/:id','isAuthenticated'];(function(_0x2f8b6e,_0x46c867){var _0x457a1f=function(_0x402810){while(--_0x402810){_0x2f8b6e['push'](_0x2f8b6e['shift']());}};_0x457a1f(++_0x46c867);}(_0x58a8,0x7e));var _0x858a=function(_0x2d04a6,_0x5bbf0a){_0x2d04a6=_0x2d04a6-0x0;var _0x3cd00e=_0x58a8[_0x2d04a6];return _0x3cd00e;};'use strict';var multer=require(_0x858a('0x0'));var util=require('util');var path=require(_0x858a('0x1'));var timeout=require(_0x858a('0x2'));var express=require(_0x858a('0x3'));var router=express[_0x858a('0x4')]();var auth=require(_0x858a('0x5'));var interaction=require(_0x858a('0x6'));var config=require('../../config/environment');var controller=require(_0x858a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x858a('0x8')]);router[_0x858a('0x9')](_0x858a('0xa'),auth[_0x858a('0xb')](),controller[_0x858a('0xc')]);router[_0x858a('0x9')](_0x858a('0xd'),auth[_0x858a('0xb')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x858a('0xb')](),controller[_0x858a('0xe')]);router[_0x858a('0x9')](_0x858a('0xf'),auth[_0x858a('0xb')](),controller[_0x858a('0x10')]);router[_0x858a('0x11')]('/',auth[_0x858a('0xb')](),controller['create']);router[_0x858a('0x12')](_0x858a('0xa'),auth['isAuthenticated'](),controller[_0x858a('0x13')]);router[_0x858a('0x14')](_0x858a('0xa'),auth[_0x858a('0xb')](),controller[_0x858a('0x15')]);module[_0x858a('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
index a1a600c..85ae6c4 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 _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
+var _0x80ad=['STRING','exports'];(function(_0x4c7b20,_0x361515){var _0x4872bd=function(_0x358e19){while(--_0x358e19){_0x4c7b20['push'](_0x4c7b20['shift']());}};_0x4872bd(++_0x361515);}(_0x80ad,0x165));var _0xd80a=function(_0x56d5ea,_0x530395){_0x56d5ea=_0x56d5ea-0x0;var _0x3080c=_0x80ad[_0x56d5ea];return _0x3080c;};'use strict';var Sequelize=require('sequelize');module[_0xd80a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd80a('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
index 6b55c89..7359037 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 _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
+var _0x10f4=['offset','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','create','body','getSubjects','findOne','getDescriptions','FreshsalesField','pick','getFields','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','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','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','end','status','count'];(function(_0x4bfb87,_0x2ed356){var _0x2b4e25=function(_0x24469d){while(--_0x24469d){_0x4bfb87['push'](_0x4bfb87['shift']());}};_0x2b4e25(++_0x2ed356);}(_0x10f4,0x158));var _0x410f=function(_0x1dd69e,_0x417ebb){_0x1dd69e=_0x1dd69e-0x0;var _0x51e902=_0x10f4[_0x1dd69e];return _0x51e902;};'use strict';var pdf=require(_0x410f('0x0'));var emlformat=require(_0x410f('0x1'));var rimraf=require(_0x410f('0x2'));var zipdir=require(_0x410f('0x3'));var jsonpatch=require(_0x410f('0x4'));var rp=require(_0x410f('0x5'));var moment=require(_0x410f('0x6'));var BPromise=require(_0x410f('0x7'));var Mustache=require(_0x410f('0x8'));var util=require(_0x410f('0x9'));var path=require(_0x410f('0xa'));var sox=require(_0x410f('0xb'));var csv=require(_0x410f('0xc'));var ejs=require(_0x410f('0xd'));var fs=require('fs');var _=require(_0x410f('0xe'));var squel=require(_0x410f('0xf'));var crypto=require(_0x410f('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x410f('0x11'));var toCsv=require(_0x410f('0xc'));var querystring=require(_0x410f('0x12'));var Papa=require(_0x410f('0x13'));var Redis=require(_0x410f('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x410f('0x15'));var as=require(_0x410f('0x16'));var hardwareService=require(_0x410f('0x17'));var logger=require(_0x410f('0x18'))('api');var utils=require(_0x410f('0x19'));var config=require(_0x410f('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0x410f('0x1b'));var client=jayson[_0x410f('0x1c')][_0x410f('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x5bc598,_0x42e300,_0x11084a){if(_0x11084a){var _0x25abb6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25abb6[_0x410f('0x1e')](_0x42e300)){return _0x5bc598;}else{throw new db['Sequelize'][(_0x410f('0x1f'))](_0x410f('0x20'));}}else{return _0x5bc598;}}function respondWithRpcPromise(_0x4b80b9,_0x4b9478,_0x3ae286,_0x585812){return new BPromise(function(_0x43db97,_0x177a86){var _0x460456=_0x585812||client;return _0x460456['request'](_0x4b80b9,_0x3ae286)[_0x410f('0x21')](function(_0x3a5736){logger['info'](_0x410f('0x22'),_0x4b9478,_0x410f('0x23'));logger[_0x410f('0x24')](_0x410f('0x25'),_0x4b9478,'request\x20sent',JSON[_0x410f('0x26')](_0x3a5736));if(_0x3a5736[_0x410f('0x27')]){if(_0x3a5736[_0x410f('0x27')][_0x410f('0x28')]===0x1f4){logger[_0x410f('0x27')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4b9478,_0x3a5736[_0x410f('0x27')][_0x410f('0x29')]);return _0x177a86(_0x3a5736[_0x410f('0x27')][_0x410f('0x29')]);}logger[_0x410f('0x27')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4b9478,_0x3a5736[_0x410f('0x27')][_0x410f('0x29')]);return _0x43db97(_0x3a5736['error'][_0x410f('0x29')]);}else{logger[_0x410f('0x2a')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4b9478,_0x410f('0x23'));_0x43db97(_0x3a5736[_0x410f('0x2b')][_0x410f('0x29')]);}})['catch'](function(_0x3a4940){logger['error'](_0x410f('0x22'),_0x4b9478,_0x3a4940);_0x177a86(_0x3a4940);});});}function respondWithStatusCode(_0x2c11d6,_0x1b7824){_0x1b7824=_0x1b7824||0xcc;return function(_0x2d9e57){if(_0x2d9e57){return _0x2c11d6[_0x410f('0x2c')](_0x1b7824);}return _0x2c11d6['status'](_0x1b7824)[_0x410f('0x2d')]();};}function respondWithResult(_0x367a3d,_0x45696a){_0x45696a=_0x45696a||0xc8;return function(_0x16efec){if(_0x16efec){return _0x367a3d[_0x410f('0x2e')](_0x45696a)['json'](_0x16efec);}};}function respondWithFilteredResult(_0x44dd77,_0x734d3){return function(_0x344106){if(_0x344106){var _0xe3d160=_0x344106[_0x410f('0x2f')],_0xc5e130=_0x734d3[_0x410f('0x30')],_0x523f63=_0x734d3['offset']+_0x734d3['limit'],_0x4893fc;if(_0x523f63>=_0xe3d160){_0x523f63=_0xe3d160;_0x4893fc=0xc8;}else{_0x4893fc=0xce;}_0x44dd77[_0x410f('0x2e')](_0x4893fc);return _0x44dd77[_0x410f('0x31')](_0x410f('0x32'),_0xc5e130+'-'+_0x523f63+'/'+_0xe3d160)['json'](_0x344106);}return null;};}function patchUpdates(_0x1179ad){return function(_0x3b1570){try{jsonpatch['apply'](_0x3b1570,_0x1179ad,!![]);}catch(_0x5e46d9){return BPromise[_0x410f('0x33')](_0x5e46d9);}return _0x3b1570[_0x410f('0x34')]();};}function saveUpdates(_0x214070,_0x183f83){return function(_0x38a52e){if(_0x38a52e){return _0x38a52e[_0x410f('0x35')](_0x214070)[_0x410f('0x21')](function(_0x36ca76){return _0x36ca76;});}return null;};}function removeEntity(_0x25c059,_0x559e0e){return function(_0x74d57b){if(_0x74d57b){return _0x74d57b[_0x410f('0x36')]()[_0x410f('0x21')](function(){_0x25c059['status'](0xcc)[_0x410f('0x2d')]();});}};}function handleEntityNotFound(_0x39e595,_0x3127f7){return function(_0x3274e4){if(!_0x3274e4){_0x39e595[_0x410f('0x2c')](0x194);}return _0x3274e4;};}function handleError(_0x1159c8,_0x4e7802){_0x4e7802=_0x4e7802||0x1f4;return function(_0x1d8733){logger[_0x410f('0x27')](_0x1d8733[_0x410f('0x37')]);if(_0x1d8733[_0x410f('0x38')]){delete _0x1d8733[_0x410f('0x38')];}_0x1159c8['status'](_0x4e7802)[_0x410f('0x39')](_0x1d8733);};}exports[_0x410f('0x3a')]=function(_0x3d7c5b,_0x59715f){var _0x194325={},_0x2beff6={},_0x2fdd51={'count':0x0,'rows':[]};var _0x3b8ca4=_[_0x410f('0x3b')](db[_0x410f('0x3c')][_0x410f('0x3d')],function(_0x289f34){return{'name':_0x289f34[_0x410f('0x3e')],'type':_0x289f34[_0x410f('0x3f')][_0x410f('0x40')]};});_0x2beff6['model']=_[_0x410f('0x3b')](_0x3b8ca4,_0x410f('0x38'));_0x2beff6[_0x410f('0x41')]=_[_0x410f('0x42')](_0x3d7c5b[_0x410f('0x41')]);_0x2beff6[_0x410f('0x43')]=_['intersection'](_0x2beff6[_0x410f('0x44')],_0x2beff6[_0x410f('0x41')]);_0x194325[_0x410f('0x45')]=_[_0x410f('0x46')](_0x2beff6[_0x410f('0x44')],qs[_0x410f('0x47')](_0x3d7c5b[_0x410f('0x41')][_0x410f('0x47')]));_0x194325[_0x410f('0x45')]=_0x194325[_0x410f('0x45')][_0x410f('0x48')]?_0x194325[_0x410f('0x45')]:_0x2beff6[_0x410f('0x44')];if(!_0x3d7c5b[_0x410f('0x41')][_0x410f('0x49')](_0x410f('0x4a'))){_0x194325[_0x410f('0x4b')]=qs['limit'](_0x3d7c5b[_0x410f('0x41')][_0x410f('0x4b')]);_0x194325[_0x410f('0x30')]=qs[_0x410f('0x30')](_0x3d7c5b[_0x410f('0x41')][_0x410f('0x30')]);}_0x194325[_0x410f('0x4c')]=qs['sort'](_0x3d7c5b[_0x410f('0x41')][_0x410f('0x4d')]);_0x194325[_0x410f('0x4e')]=qs[_0x410f('0x43')](_['pick'](_0x3d7c5b[_0x410f('0x41')],_0x2beff6['filters']),_0x3b8ca4);if(_0x3d7c5b[_0x410f('0x41')][_0x410f('0x4f')]){_0x194325[_0x410f('0x4e')]=_[_0x410f('0x50')](_0x194325['where'],{'$or':_[_0x410f('0x3b')](_0x3b8ca4,function(_0x519a24){if(_0x519a24[_0x410f('0x3f')]!==_0x410f('0x51')){var _0x557132={};_0x557132[_0x519a24[_0x410f('0x38')]]={'$like':'%'+_0x3d7c5b[_0x410f('0x41')][_0x410f('0x4f')]+'%'};return _0x557132;}})});}_0x194325=_[_0x410f('0x50')]({},_0x194325,_0x3d7c5b[_0x410f('0x52')]);var _0x515dc3={'where':_0x194325[_0x410f('0x4e')]};return db['FreshsalesConfiguration'][_0x410f('0x2f')](_0x515dc3)[_0x410f('0x21')](function(_0x57add6){_0x2fdd51[_0x410f('0x2f')]=_0x57add6;if(_0x3d7c5b[_0x410f('0x41')][_0x410f('0x53')]){_0x194325['include']=[{'all':!![]}];}return db[_0x410f('0x3c')][_0x410f('0x54')](_0x194325);})[_0x410f('0x21')](function(_0x505e10){_0x2fdd51[_0x410f('0x55')]=_0x505e10;return _0x2fdd51;})[_0x410f('0x21')](respondWithFilteredResult(_0x59715f,_0x194325))['catch'](handleError(_0x59715f,null));};exports['show']=function(_0x232fbe,_0x3474b2){var _0x86344b={'raw':![],'where':{'id':_0x232fbe[_0x410f('0x56')]['id']}},_0x5798ae={};_0x5798ae['model']=_['keys'](db['FreshsalesConfiguration']['rawAttributes']);_0x5798ae['query']=_['keys'](_0x232fbe['query']);_0x5798ae[_0x410f('0x43')]=_[_0x410f('0x46')](_0x5798ae[_0x410f('0x44')],_0x5798ae[_0x410f('0x41')]);_0x86344b[_0x410f('0x45')]=_[_0x410f('0x46')](_0x5798ae[_0x410f('0x44')],qs[_0x410f('0x47')](_0x232fbe['query'][_0x410f('0x47')]));_0x86344b['attributes']=_0x86344b[_0x410f('0x45')][_0x410f('0x48')]?_0x86344b['attributes']:_0x5798ae[_0x410f('0x44')];if(_0x232fbe[_0x410f('0x41')][_0x410f('0x53')]){_0x86344b[_0x410f('0x57')]=[{'all':!![]}];}_0x86344b=_[_0x410f('0x50')]({},_0x86344b,_0x232fbe['options']);return db[_0x410f('0x3c')][_0x410f('0x58')](_0x86344b)[_0x410f('0x21')](handleEntityNotFound(_0x3474b2,null))[_0x410f('0x21')](respondWithResult(_0x3474b2,null))[_0x410f('0x59')](handleError(_0x3474b2,null));};exports[_0x410f('0x5a')]=function(_0x55ca91,_0x12f175){return db[_0x410f('0x3c')][_0x410f('0x5a')](_0x55ca91[_0x410f('0x5b')],{})['then'](respondWithResult(_0x12f175,0xc9))[_0x410f('0x59')](handleError(_0x12f175,null));};exports[_0x410f('0x35')]=function(_0x3d561c,_0x5a33de){if(_0x3d561c[_0x410f('0x5b')]['id']){delete _0x3d561c[_0x410f('0x5b')]['id'];}return db[_0x410f('0x3c')][_0x410f('0x58')]({'where':{'id':_0x3d561c[_0x410f('0x56')]['id']}})['then'](handleEntityNotFound(_0x5a33de,null))[_0x410f('0x21')](saveUpdates(_0x3d561c[_0x410f('0x5b')],null))[_0x410f('0x21')](respondWithResult(_0x5a33de,null))[_0x410f('0x59')](handleError(_0x5a33de,null));};exports[_0x410f('0x36')]=function(_0x1025b5,_0x17111a){return db[_0x410f('0x3c')]['find']({'where':{'id':_0x1025b5['params']['id']}})[_0x410f('0x21')](handleEntityNotFound(_0x17111a,null))['then'](removeEntity(_0x17111a,null))[_0x410f('0x59')](handleError(_0x17111a,null));};exports[_0x410f('0x5c')]=function(_0x1ed009,_0x2c612c,_0x3560ee){var _0x4505ae={};var _0x1faf09={};var _0x315cb6;var _0x74d28a;return db[_0x410f('0x3c')][_0x410f('0x5d')]({'where':{'id':_0x1ed009['params']['id']}})['then'](handleEntityNotFound(_0x2c612c,null))[_0x410f('0x21')](function(_0x78705d){if(_0x78705d){_0x315cb6=_0x78705d;_0x1faf09[_0x410f('0x44')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x1faf09[_0x410f('0x41')]=_[_0x410f('0x42')](_0x1ed009[_0x410f('0x41')]);_0x1faf09[_0x410f('0x43')]=_[_0x410f('0x46')](_0x1faf09[_0x410f('0x44')],_0x1faf09[_0x410f('0x41')]);_0x4505ae[_0x410f('0x45')]=_[_0x410f('0x46')](_0x1faf09[_0x410f('0x44')],qs[_0x410f('0x47')](_0x1ed009[_0x410f('0x41')][_0x410f('0x47')]));_0x4505ae[_0x410f('0x45')]=_0x4505ae['attributes']['length']?_0x4505ae[_0x410f('0x45')]:_0x1faf09[_0x410f('0x44')];_0x4505ae[_0x410f('0x4c')]=qs[_0x410f('0x4d')](_0x1ed009['query'][_0x410f('0x4d')]);_0x4505ae[_0x410f('0x4e')]=qs[_0x410f('0x43')](_['pick'](_0x1ed009[_0x410f('0x41')],_0x1faf09['filters']));if(_0x1ed009[_0x410f('0x41')][_0x410f('0x4f')]){_0x4505ae[_0x410f('0x4e')]=_[_0x410f('0x50')](_0x4505ae['where'],{'$or':_[_0x410f('0x3b')](_0x4505ae[_0x410f('0x45')],function(_0x26b3ea){var _0x4777f4={};_0x4777f4[_0x26b3ea]={'$like':'%'+_0x1ed009[_0x410f('0x41')]['filter']+'%'};return _0x4777f4;})});}_0x4505ae=_[_0x410f('0x50')]({},_0x4505ae,_0x1ed009['options']);return _0x315cb6['getSubjects'](_0x4505ae);}})[_0x410f('0x21')](function(_0x182320){if(_0x182320){_0x74d28a=_0x182320[_0x410f('0x48')];if(!_0x1ed009[_0x410f('0x41')]['hasOwnProperty']('nolimit')){_0x4505ae[_0x410f('0x4b')]=qs[_0x410f('0x4b')](_0x1ed009[_0x410f('0x41')][_0x410f('0x4b')]);_0x4505ae[_0x410f('0x30')]=qs['offset'](_0x1ed009[_0x410f('0x41')][_0x410f('0x30')]);}return _0x315cb6[_0x410f('0x5c')](_0x4505ae);}})['then'](function(_0x4af0e1){if(_0x4af0e1){return _0x4af0e1?{'count':_0x74d28a,'rows':_0x4af0e1}:null;}})[_0x410f('0x21')](respondWithResult(_0x2c612c,null))['catch'](handleError(_0x2c612c,null));};exports[_0x410f('0x5e')]=function(_0x2c4473,_0x27c091,_0x519012){var _0xa3ca1d={};var _0x5e08d4={};var _0x46abb8;var _0x203c8e;return db[_0x410f('0x3c')][_0x410f('0x5d')]({'where':{'id':_0x2c4473[_0x410f('0x56')]['id']}})[_0x410f('0x21')](handleEntityNotFound(_0x27c091,null))['then'](function(_0xf92bf1){if(_0xf92bf1){_0x46abb8=_0xf92bf1;_0x5e08d4[_0x410f('0x44')]=_[_0x410f('0x42')](db[_0x410f('0x5f')][_0x410f('0x3d')]);_0x5e08d4[_0x410f('0x41')]=_[_0x410f('0x42')](_0x2c4473[_0x410f('0x41')]);_0x5e08d4[_0x410f('0x43')]=_[_0x410f('0x46')](_0x5e08d4[_0x410f('0x44')],_0x5e08d4[_0x410f('0x41')]);_0xa3ca1d['attributes']=_[_0x410f('0x46')](_0x5e08d4[_0x410f('0x44')],qs['fields'](_0x2c4473[_0x410f('0x41')][_0x410f('0x47')]));_0xa3ca1d[_0x410f('0x45')]=_0xa3ca1d[_0x410f('0x45')]['length']?_0xa3ca1d['attributes']:_0x5e08d4[_0x410f('0x44')];_0xa3ca1d[_0x410f('0x4c')]=qs['sort'](_0x2c4473['query']['sort']);_0xa3ca1d[_0x410f('0x4e')]=qs[_0x410f('0x43')](_[_0x410f('0x60')](_0x2c4473[_0x410f('0x41')],_0x5e08d4[_0x410f('0x43')]));if(_0x2c4473['query']['filter']){_0xa3ca1d['where']=_['merge'](_0xa3ca1d[_0x410f('0x4e')],{'$or':_[_0x410f('0x3b')](_0xa3ca1d[_0x410f('0x45')],function(_0x7e1da5){var _0x4ca09a={};_0x4ca09a[_0x7e1da5]={'$like':'%'+_0x2c4473[_0x410f('0x41')][_0x410f('0x4f')]+'%'};return _0x4ca09a;})});}_0xa3ca1d=_[_0x410f('0x50')]({},_0xa3ca1d,_0x2c4473['options']);return _0x46abb8[_0x410f('0x5e')](_0xa3ca1d);}})[_0x410f('0x21')](function(_0x1a5b40){if(_0x1a5b40){_0x203c8e=_0x1a5b40['length'];if(!_0x2c4473['query'][_0x410f('0x49')]('nolimit')){_0xa3ca1d[_0x410f('0x4b')]=qs['limit'](_0x2c4473[_0x410f('0x41')]['limit']);_0xa3ca1d[_0x410f('0x30')]=qs['offset'](_0x2c4473[_0x410f('0x41')][_0x410f('0x30')]);}return _0x46abb8[_0x410f('0x5e')](_0xa3ca1d);}})['then'](function(_0x41a488){if(_0x41a488){return _0x41a488?{'count':_0x203c8e,'rows':_0x41a488}:null;}})[_0x410f('0x21')](respondWithResult(_0x27c091,null))[_0x410f('0x59')](handleError(_0x27c091,null));};exports[_0x410f('0x61')]=function(_0x30ace7,_0x5e13e8,_0x478241){var _0x78c0f4={};var _0x44617a={};var _0x4f68da;var _0x15ed38;return db[_0x410f('0x3c')]['findOne']({'where':{'id':_0x30ace7[_0x410f('0x56')]['id']}})[_0x410f('0x21')](handleEntityNotFound(_0x5e13e8,null))[_0x410f('0x21')](function(_0x201be8){if(_0x201be8){_0x4f68da=_0x201be8;_0x44617a['model']=_[_0x410f('0x42')](db['FreshsalesField'][_0x410f('0x3d')]);_0x44617a['query']=_[_0x410f('0x42')](_0x30ace7[_0x410f('0x41')]);_0x44617a[_0x410f('0x43')]=_[_0x410f('0x46')](_0x44617a[_0x410f('0x44')],_0x44617a['query']);_0x78c0f4[_0x410f('0x45')]=_[_0x410f('0x46')](_0x44617a[_0x410f('0x44')],qs[_0x410f('0x47')](_0x30ace7[_0x410f('0x41')]['fields']));_0x78c0f4['attributes']=_0x78c0f4[_0x410f('0x45')][_0x410f('0x48')]?_0x78c0f4[_0x410f('0x45')]:_0x44617a[_0x410f('0x44')];_0x78c0f4['order']=qs[_0x410f('0x4d')](_0x30ace7[_0x410f('0x41')][_0x410f('0x4d')]);_0x78c0f4[_0x410f('0x4e')]=qs[_0x410f('0x43')](_[_0x410f('0x60')](_0x30ace7['query'],_0x44617a['filters']));if(_0x30ace7[_0x410f('0x41')]['filter']){_0x78c0f4[_0x410f('0x4e')]=_['merge'](_0x78c0f4[_0x410f('0x4e')],{'$or':_[_0x410f('0x3b')](_0x78c0f4[_0x410f('0x45')],function(_0x1476b1){var _0x30e729={};_0x30e729[_0x1476b1]={'$like':'%'+_0x30ace7[_0x410f('0x41')][_0x410f('0x4f')]+'%'};return _0x30e729;})});}_0x78c0f4=_[_0x410f('0x50')]({},_0x78c0f4,_0x30ace7[_0x410f('0x52')]);return _0x4f68da[_0x410f('0x61')](_0x78c0f4);}})[_0x410f('0x21')](function(_0x5a8118){if(_0x5a8118){_0x15ed38=_0x5a8118[_0x410f('0x48')];if(!_0x30ace7[_0x410f('0x41')][_0x410f('0x49')](_0x410f('0x4a'))){_0x78c0f4[_0x410f('0x4b')]=qs[_0x410f('0x4b')](_0x30ace7['query'][_0x410f('0x4b')]);_0x78c0f4[_0x410f('0x30')]=qs['offset'](_0x30ace7['query'][_0x410f('0x30')]);}return _0x4f68da['getFields'](_0x78c0f4);}})[_0x410f('0x21')](function(_0x4b4dcd){if(_0x4b4dcd){return _0x4b4dcd?{'count':_0x15ed38,'rows':_0x4b4dcd}:null;}})[_0x410f('0x21')](respondWithResult(_0x5e13e8,null))[_0x410f('0x59')](handleError(_0x5e13e8,null));};
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
index 698df68..c2a1d75 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 _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
+var _0xedb5=['api','bluebird','request-promise','path','rimraf','exports','lodash','util'];(function(_0x57cac3,_0x4817d0){var _0x4224a8=function(_0x32fd62){while(--_0x32fd62){_0x57cac3['push'](_0x57cac3['shift']());}};_0x4224a8(++_0x4817d0);}(_0xedb5,0xee));var _0x5edb=function(_0x2b2087,_0x53c90b){_0x2b2087=_0x2b2087-0x0;var _0x195657=_0xedb5[_0x2b2087];return _0x195657;};'use strict';var _=require(_0x5edb('0x0'));var util=require(_0x5edb('0x1'));var logger=require('../../config/logger')(_0x5edb('0x2'));var moment=require('moment');var BPromise=require(_0x5edb('0x3'));var rp=require(_0x5edb('0x4'));var fs=require('fs');var path=require(_0x5edb('0x5'));var rimraf=require(_0x5edb('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x5edb('0x7')]=function(_0x4bdbfa,_0x5358ad){return _0x4bdbfa['define']('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','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 d3c98a8..f12a342 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 _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
+var _0x0427=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3b45d7,_0xbc2848){var _0x4690e8=function(_0x209c3b){while(--_0x209c3b){_0x3b45d7['push'](_0x3b45d7['shift']());}};_0x4690e8(++_0xbc2848);}(_0x0427,0x137));var _0x7042=function(_0xda8ea8,_0x577f75){_0xda8ea8=_0xda8ea8-0x0;var _0xe7aa47=_0x0427[_0xda8ea8];return _0xe7aa47;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7042('0x0'));var BPromise=require(_0x7042('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7042('0x2'));var db=require(_0x7042('0x3'))['db'];var utils=require(_0x7042('0x4'));var logger=require(_0x7042('0x5'))(_0x7042('0x6'));var config=require(_0x7042('0x7'));var jayson=require(_0x7042('0x8'));var client=jayson['client'][_0x7042('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f24b5,_0x25c552,_0x346aa8){return new BPromise(function(_0x295b19,_0x978169){return client[_0x7042('0xa')](_0x2f24b5,_0x346aa8)[_0x7042('0xb')](function(_0x3bd534){logger['info'](_0x7042('0xc'),_0x25c552,'request\x20sent');logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x25c552,'request\x20sent',JSON[_0x7042('0xd')](_0x3bd534));if(_0x3bd534['error']){if(_0x3bd534[_0x7042('0xe')][_0x7042('0xf')]===0x1f4){logger[_0x7042('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x25c552,_0x3bd534['error'][_0x7042('0x10')]);return _0x978169(_0x3bd534[_0x7042('0xe')][_0x7042('0x10')]);}logger[_0x7042('0xe')](_0x7042('0xc'),_0x25c552,_0x3bd534[_0x7042('0xe')]['message']);return _0x295b19(_0x3bd534[_0x7042('0xe')][_0x7042('0x10')]);}else{logger[_0x7042('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x25c552,_0x7042('0x12'));_0x295b19(_0x3bd534[_0x7042('0x13')]['message']);}})[_0x7042('0x14')](function(_0x590edd){logger['error'](_0x7042('0xc'),_0x25c552,_0x590edd);_0x978169(_0x590edd);});});}
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js
index cf99594..80a2ca4 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 _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
+var _0x4d40=['create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id'];(function(_0x1c06f4,_0x2feba6){var _0x1a727e=function(_0x2e83af){while(--_0x2e83af){_0x1c06f4['push'](_0x1c06f4['shift']());}};_0x1a727e(++_0x2feba6);}(_0x4d40,0x175));var _0x04d4=function(_0x5c4585,_0x3d0eab){_0x5c4585=_0x5c4585-0x0;var _0x21dede=_0x4d40[_0x5c4585];return _0x21dede;};'use strict';var multer=require(_0x04d4('0x0'));var util=require('util');var path=require(_0x04d4('0x1'));var timeout=require(_0x04d4('0x2'));var express=require(_0x04d4('0x3'));var router=express[_0x04d4('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x04d4('0x5'));var controller=require(_0x04d4('0x6'));router[_0x04d4('0x7')]('/',auth[_0x04d4('0x8')](),controller[_0x04d4('0x9')]);router['get'](_0x04d4('0xa'),auth[_0x04d4('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x04d4('0xb')]);router[_0x04d4('0xc')](_0x04d4('0xa'),auth[_0x04d4('0x8')](),controller[_0x04d4('0xd')]);router[_0x04d4('0xe')](_0x04d4('0xa'),auth['isAuthenticated'](),controller[_0x04d4('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js
index 78f85b8..6d5a5c4 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 _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
+var _0x82f4=['string','variable','customVariable','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x41382c,_0xc3ffd1){var _0x4da35b=function(_0x5d56b8){while(--_0x5d56b8){_0x41382c['push'](_0x41382c['shift']());}};_0x4da35b(++_0xc3ffd1);}(_0x82f4,0xed));var _0x482f=function(_0x5cd054,_0x2d3b5d){_0x5cd054=_0x5cd054-0x0;var _0x5a9331=_0x82f4[_0x5cd054];return _0x5a9331;};'use strict';var Sequelize=require(_0x482f('0x0'));module[_0x482f('0x1')]={'type':{'type':Sequelize[_0x482f('0x2')](_0x482f('0x3'),_0x482f('0x4'),_0x482f('0x5'),'keyValue'),'defaultValue':_0x482f('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x482f('0x2')]('string','variable',_0x482f('0x5'))},'keyContent':{'type':Sequelize[_0x482f('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x482f('0x6')]},'customField':{'type':Sequelize[_0x482f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x482f('0x6')]}};
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js
index 4e295f6..2989464 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 _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
+var _0x7ceb=['../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis'];(function(_0x3fe393,_0x234a3a){var _0x534d14=function(_0x277fab){while(--_0x277fab){_0x3fe393['push'](_0x3fe393['shift']());}};_0x534d14(++_0x234a3a);}(_0x7ceb,0x81));var _0xb7ce=function(_0x14cd5f,_0x3d80b0){_0x14cd5f=_0x14cd5f-0x0;var _0x2c97a5=_0x7ceb[_0x14cd5f];return _0x2c97a5;};'use strict';var pdf=require(_0xb7ce('0x0'));var emlformat=require(_0xb7ce('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb7ce('0x2'));var jsonpatch=require(_0xb7ce('0x3'));var rp=require(_0xb7ce('0x4'));var moment=require(_0xb7ce('0x5'));var BPromise=require(_0xb7ce('0x6'));var Mustache=require(_0xb7ce('0x7'));var util=require(_0xb7ce('0x8'));var path=require('path');var sox=require(_0xb7ce('0x9'));var csv=require(_0xb7ce('0xa'));var ejs=require(_0xb7ce('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb7ce('0xc'));var crypto=require(_0xb7ce('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb7ce('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb7ce('0xf'));var Redis=require(_0xb7ce('0x10'));var authService=require(_0xb7ce('0x11'));var qs=require(_0xb7ce('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb7ce('0x13'))(_0xb7ce('0x14'));var utils=require(_0xb7ce('0x15'));var config=require(_0xb7ce('0x16'));var db=require(_0xb7ce('0x17'))['db'];function respondWithStatusCode(_0x5105fc,_0x1bb841){_0x1bb841=_0x1bb841||0xcc;return function(_0x56c83f){if(_0x56c83f){return _0x5105fc['sendStatus'](_0x1bb841);}return _0x5105fc['status'](_0x1bb841)[_0xb7ce('0x18')]();};}function respondWithResult(_0x4f83e7,_0x4ef0c4){_0x4ef0c4=_0x4ef0c4||0xc8;return function(_0x308a31){if(_0x308a31){return _0x4f83e7[_0xb7ce('0x19')](_0x4ef0c4)[_0xb7ce('0x1a')](_0x308a31);}};}function respondWithFilteredResult(_0x294972,_0x144881){return function(_0x277d54){if(_0x277d54){var _0x3d86ee=_0x277d54[_0xb7ce('0x1b')],_0x5c05fd=_0x144881[_0xb7ce('0x1c')],_0x521ad0=_0x144881[_0xb7ce('0x1c')]+_0x144881[_0xb7ce('0x1d')],_0x456599;if(_0x521ad0>=_0x3d86ee){_0x521ad0=_0x3d86ee;_0x456599=0xc8;}else{_0x456599=0xce;}_0x294972['status'](_0x456599);return _0x294972[_0xb7ce('0x1e')](_0xb7ce('0x1f'),_0x5c05fd+'-'+_0x521ad0+'/'+_0x3d86ee)[_0xb7ce('0x1a')](_0x277d54);}return null;};}function patchUpdates(_0x20046b){return function(_0x3a94bb){try{jsonpatch[_0xb7ce('0x20')](_0x3a94bb,_0x20046b,!![]);}catch(_0x1d0522){return BPromise['reject'](_0x1d0522);}return _0x3a94bb[_0xb7ce('0x21')]();};}function saveUpdates(_0x374c40,_0x2a6040){return function(_0xe86080){if(_0xe86080){return _0xe86080[_0xb7ce('0x22')](_0x374c40)[_0xb7ce('0x23')](function(_0xeed27c){return _0xeed27c;});}return null;};}function removeEntity(_0x12040b,_0x21c0f0){return function(_0x27be4f){if(_0x27be4f){return _0x27be4f[_0xb7ce('0x24')]()['then'](function(){_0x12040b[_0xb7ce('0x19')](0xcc)[_0xb7ce('0x18')]();});}};}function handleEntityNotFound(_0x3bb0c9,_0x36317b){return function(_0x745cf8){if(!_0x745cf8){_0x3bb0c9[_0xb7ce('0x25')](0x194);}return _0x745cf8;};}function handleError(_0x1f0af3,_0x1a1fc9){_0x1a1fc9=_0x1a1fc9||0x1f4;return function(_0x3512f7){logger[_0xb7ce('0x26')](_0x3512f7[_0xb7ce('0x27')]);if(_0x3512f7['name']){delete _0x3512f7[_0xb7ce('0x28')];}_0x1f0af3[_0xb7ce('0x19')](_0x1a1fc9)['send'](_0x3512f7);};}exports[_0xb7ce('0x29')]=function(_0x166e5e,_0x4dcf87){var _0x530be1={},_0x10256f={},_0x2d6a60={'count':0x0,'rows':[]};var _0x15b06d=_[_0xb7ce('0x2a')](db[_0xb7ce('0x2b')][_0xb7ce('0x2c')],function(_0x24808b){return{'name':_0x24808b[_0xb7ce('0x2d')],'type':_0x24808b[_0xb7ce('0x2e')][_0xb7ce('0x2f')]};});_0x10256f[_0xb7ce('0x30')]=_[_0xb7ce('0x2a')](_0x15b06d,_0xb7ce('0x28'));_0x10256f['query']=_[_0xb7ce('0x31')](_0x166e5e['query']);_0x10256f[_0xb7ce('0x32')]=_['intersection'](_0x10256f[_0xb7ce('0x30')],_0x10256f[_0xb7ce('0x33')]);_0x530be1['attributes']=_[_0xb7ce('0x34')](_0x10256f[_0xb7ce('0x30')],qs[_0xb7ce('0x35')](_0x166e5e[_0xb7ce('0x33')][_0xb7ce('0x35')]));_0x530be1[_0xb7ce('0x36')]=_0x530be1['attributes'][_0xb7ce('0x37')]?_0x530be1[_0xb7ce('0x36')]:_0x10256f[_0xb7ce('0x30')];if(!_0x166e5e[_0xb7ce('0x33')][_0xb7ce('0x38')](_0xb7ce('0x39'))){_0x530be1['limit']=qs['limit'](_0x166e5e[_0xb7ce('0x33')][_0xb7ce('0x1d')]);_0x530be1[_0xb7ce('0x1c')]=qs[_0xb7ce('0x1c')](_0x166e5e[_0xb7ce('0x33')][_0xb7ce('0x1c')]);}_0x530be1[_0xb7ce('0x3a')]=qs[_0xb7ce('0x3b')](_0x166e5e[_0xb7ce('0x33')]['sort']);_0x530be1[_0xb7ce('0x3c')]=qs[_0xb7ce('0x32')](_[_0xb7ce('0x3d')](_0x166e5e[_0xb7ce('0x33')],_0x10256f['filters']),_0x15b06d);if(_0x166e5e[_0xb7ce('0x33')][_0xb7ce('0x3e')]){_0x530be1[_0xb7ce('0x3c')]=_[_0xb7ce('0x3f')](_0x530be1[_0xb7ce('0x3c')],{'$or':_[_0xb7ce('0x2a')](_0x15b06d,function(_0x30c0ad){if(_0x30c0ad[_0xb7ce('0x2e')]!==_0xb7ce('0x40')){var _0x4a6c78={};_0x4a6c78[_0x30c0ad['name']]={'$like':'%'+_0x166e5e[_0xb7ce('0x33')][_0xb7ce('0x3e')]+'%'};return _0x4a6c78;}})});}_0x530be1=_[_0xb7ce('0x3f')]({},_0x530be1,_0x166e5e[_0xb7ce('0x41')]);var _0x153798={'where':_0x530be1[_0xb7ce('0x3c')]};return db[_0xb7ce('0x2b')][_0xb7ce('0x1b')](_0x153798)[_0xb7ce('0x23')](function(_0x2a305d){_0x2d6a60[_0xb7ce('0x1b')]=_0x2a305d;if(_0x166e5e[_0xb7ce('0x33')][_0xb7ce('0x42')]){_0x530be1[_0xb7ce('0x43')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x530be1);})[_0xb7ce('0x23')](function(_0x5dc118){_0x2d6a60['rows']=_0x5dc118;return _0x2d6a60;})[_0xb7ce('0x23')](respondWithFilteredResult(_0x4dcf87,_0x530be1))[_0xb7ce('0x44')](handleError(_0x4dcf87,null));};exports['show']=function(_0x429e49,_0x4fd14a){var _0x3ffe2d={'raw':!![],'where':{'id':_0x429e49['params']['id']}},_0x195a7e={};_0x195a7e[_0xb7ce('0x30')]=_[_0xb7ce('0x31')](db[_0xb7ce('0x2b')]['rawAttributes']);_0x195a7e['query']=_[_0xb7ce('0x31')](_0x429e49[_0xb7ce('0x33')]);_0x195a7e['filters']=_[_0xb7ce('0x34')](_0x195a7e[_0xb7ce('0x30')],_0x195a7e[_0xb7ce('0x33')]);_0x3ffe2d['attributes']=_[_0xb7ce('0x34')](_0x195a7e['model'],qs[_0xb7ce('0x35')](_0x429e49[_0xb7ce('0x33')][_0xb7ce('0x35')]));_0x3ffe2d[_0xb7ce('0x36')]=_0x3ffe2d['attributes'][_0xb7ce('0x37')]?_0x3ffe2d['attributes']:_0x195a7e['model'];if(_0x429e49[_0xb7ce('0x33')][_0xb7ce('0x42')]){_0x3ffe2d[_0xb7ce('0x43')]=[{'all':!![]}];}_0x3ffe2d=_[_0xb7ce('0x3f')]({},_0x3ffe2d,_0x429e49[_0xb7ce('0x41')]);return db['FreshsalesField'][_0xb7ce('0x45')](_0x3ffe2d)['then'](handleEntityNotFound(_0x4fd14a,null))[_0xb7ce('0x23')](respondWithResult(_0x4fd14a,null))[_0xb7ce('0x44')](handleError(_0x4fd14a,null));};exports[_0xb7ce('0x46')]=function(_0x4f3b89,_0x5babe2){return db[_0xb7ce('0x2b')][_0xb7ce('0x46')](_0x4f3b89[_0xb7ce('0x47')],{})[_0xb7ce('0x23')](respondWithResult(_0x5babe2,0xc9))[_0xb7ce('0x44')](handleError(_0x5babe2,null));};exports[_0xb7ce('0x22')]=function(_0x2f11d0,_0x1be689){if(_0x2f11d0[_0xb7ce('0x47')]['id']){delete _0x2f11d0['body']['id'];}return db[_0xb7ce('0x2b')][_0xb7ce('0x45')]({'where':{'id':_0x2f11d0['params']['id']}})[_0xb7ce('0x23')](handleEntityNotFound(_0x1be689,null))['then'](saveUpdates(_0x2f11d0['body'],null))[_0xb7ce('0x23')](respondWithResult(_0x1be689,null))['catch'](handleError(_0x1be689,null));};exports[_0xb7ce('0x24')]=function(_0xf6cb13,_0x27408c){return db[_0xb7ce('0x2b')][_0xb7ce('0x45')]({'where':{'id':_0xf6cb13[_0xb7ce('0x48')]['id']}})['then'](handleEntityNotFound(_0x27408c,null))[_0xb7ce('0x23')](removeEntity(_0x27408c,null))['catch'](handleError(_0x27408c,null));};
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js
index 4a00840..7c7416f 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 _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
+var _0x1ecd=['rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','util','moment','bluebird','request-promise','path'];(function(_0x2c4eac,_0x1ef29e){var _0x3ed661=function(_0x3c4e5a){while(--_0x3c4e5a){_0x2c4eac['push'](_0x2c4eac['shift']());}};_0x3ed661(++_0x1ef29e);}(_0x1ecd,0x126));var _0xd1ec=function(_0x4b1eda,_0x1ca265){_0x4b1eda=_0x4b1eda-0x0;var _0x520e6b=_0x1ecd[_0x4b1eda];return _0x520e6b;};'use strict';var _=require(_0xd1ec('0x0'));var util=require(_0xd1ec('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd1ec('0x2'));var BPromise=require(_0xd1ec('0x3'));var rp=require(_0xd1ec('0x4'));var fs=require('fs');var path=require(_0xd1ec('0x5'));var rimraf=require(_0xd1ec('0x6'));var config=require(_0xd1ec('0x7'));var attributes=require(_0xd1ec('0x8'));module[_0xd1ec('0x9')]=function(_0x535094,_0x3052ed){return _0x535094[_0xd1ec('0xa')](_0xd1ec('0xb'),attributes,{'tableName':_0xd1ec('0xc'),'paranoid':![],'indexes':[{'name':_0xd1ec('0xd'),'fields':[_0xd1ec('0xe'),'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 10c6d8f..1145bce 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 _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
+var _0xf03e=['../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x382500,_0x43e04e){var _0x4aa842=function(_0x22c871){while(--_0x22c871){_0x382500['push'](_0x382500['shift']());}};_0x4aa842(++_0x43e04e);}(_0xf03e,0x129));var _0xef03=function(_0x181972,_0x3df406){_0x181972=_0x181972-0x0;var _0x3ac138=_0xf03e[_0x181972];return _0x3ac138;};'use strict';var _=require(_0xef03('0x0'));var util=require(_0xef03('0x1'));var moment=require(_0xef03('0x2'));var BPromise=require(_0xef03('0x3'));var rs=require(_0xef03('0x4'));var fs=require('fs');var Redis=require(_0xef03('0x5'));var db=require(_0xef03('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xef03('0x7'))(_0xef03('0x8'));var config=require('../../config/environment');var jayson=require(_0xef03('0x9'));var client=jayson['client'][_0xef03('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26191c,_0x1e2010,_0x695598){return new BPromise(function(_0xd9c95d,_0x4fe7cb){return client[_0xef03('0xb')](_0x26191c,_0x695598)[_0xef03('0xc')](function(_0xeaa0e4){logger[_0xef03('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x1e2010,'request\x20sent');logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x1e2010,_0xef03('0xe'),JSON['stringify'](_0xeaa0e4));if(_0xeaa0e4[_0xef03('0xf')]){if(_0xeaa0e4['error']['code']===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x1e2010,_0xeaa0e4[_0xef03('0xf')][_0xef03('0x10')]);return _0x4fe7cb(_0xeaa0e4[_0xef03('0xf')][_0xef03('0x10')]);}logger[_0xef03('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x1e2010,_0xeaa0e4[_0xef03('0xf')]['message']);return _0xd9c95d(_0xeaa0e4[_0xef03('0xf')][_0xef03('0x10')]);}else{logger[_0xef03('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x1e2010,'request\x20sent');_0xd9c95d(_0xeaa0e4[_0xef03('0x11')]['message']);}})[_0xef03('0x12')](function(_0x34fc6a){logger[_0xef03('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x1e2010,_0x34fc6a);_0x4fe7cb(_0x34fc6a);});});}
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js
index e5a5a04..6be5df0 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 _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
+var _0x95d9=['/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x95d9,0x8d));var _0x995d=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x95d9[_0x39096d];return _0x13da4f;};'use strict';var multer=require(_0x995d('0x0'));var util=require(_0x995d('0x1'));var path=require(_0x995d('0x2'));var timeout=require(_0x995d('0x3'));var express=require(_0x995d('0x4'));var router=express['Router']();var auth=require(_0x995d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x995d('0x6'));router[_0x995d('0x7')]('/',auth[_0x995d('0x8')](),controller[_0x995d('0x9')]);router[_0x995d('0x7')](_0x995d('0xa'),auth[_0x995d('0x8')](),controller[_0x995d('0xb')]);router['get']('/:id/configurations',auth[_0x995d('0x8')](),controller[_0x995d('0xc')]);router[_0x995d('0x7')](_0x995d('0xd'),auth[_0x995d('0x8')](),controller[_0x995d('0xe')]);router[_0x995d('0xf')]('/',auth[_0x995d('0x8')](),controller['create']);router['post'](_0x995d('0x10'),auth['isAuthenticated'](),controller[_0x995d('0x11')]);router[_0x995d('0x12')](_0x995d('0xa'),auth[_0x995d('0x8')](),controller[_0x995d('0x13')]);router[_0x995d('0x14')]('/:id',auth[_0x995d('0x8')](),controller['destroy']);module[_0x995d('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
index 3b88c81..393f43e 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 _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
+var _0x9957=['sequelize','exports','STRING','username','ENUM','integrationTab','newTab'];(function(_0x23276e,_0x5c3144){var _0x40c600=function(_0x6f0b68){while(--_0x6f0b68){_0x23276e['push'](_0x23276e['shift']());}};_0x40c600(++_0x5c3144);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')]},'description':{'type':Sequelize[_0x7995('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x7995('0x3')},'remoteUri':{'type':Sequelize[_0x7995('0x2')]},'password':{'type':Sequelize[_0x7995('0x2')]},'clientId':{'type':Sequelize[_0x7995('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x7995('0x2')]},'serverUrl':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x4')](_0x7995('0x5'),_0x7995('0x6')),'defaultValue':_0x7995('0x5')}};
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js
index c25a826..c0f7e71 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 _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
+var _0x0b5e=['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','../../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','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','SalesforceAccount','keys','query','filters','intersection','attributes','model','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','include','findAll','rows','params','rawAttributes','includeAll','find','create','body','getConfigurations','order','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','type','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','Task','clientId','clientSecret','username','password','remoteUri','slice','substring','lastIndexOf','Connection','login','concat','securityToken','isNil','ticketType','CallDisposition','CallDurationInSeconds','CallType','Priority','Status','Type','Case','Origin','Reason','IsEscalated','SuppliedCompany','remove','custom','label','picklistValues','boolean','True','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch'];(function(_0x3474ab,_0x4dd8cd){var _0x182bf4=function(_0x35d515){while(--_0x35d515){_0x3474ab['push'](_0x3474ab['shift']());}};_0x182bf4(++_0x4dd8cd);}(_0x0b5e,0x10b));var _0xe0b5=function(_0x384f30,_0x547c8b){_0x384f30=_0x384f30-0x0;var _0x34e315=_0x0b5e[_0x384f30];return _0x34e315;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe0b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b5('0x1'));var jsonpatch=require(_0xe0b5('0x2'));var rp=require('request-promise');var moment=require(_0xe0b5('0x3'));var BPromise=require(_0xe0b5('0x4'));var Mustache=require(_0xe0b5('0x5'));var util=require('util');var path=require(_0xe0b5('0x6'));var sox=require(_0xe0b5('0x7'));var csv=require(_0xe0b5('0x8'));var ejs=require(_0xe0b5('0x9'));var fs=require('fs');var _=require(_0xe0b5('0xa'));var squel=require(_0xe0b5('0xb'));var crypto=require(_0xe0b5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe0b5('0xd'));var Papa=require(_0xe0b5('0xe'));var Redis=require(_0xe0b5('0xf'));var authService=require(_0xe0b5('0x10'));var qs=require(_0xe0b5('0x11'));var as=require(_0xe0b5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0b5('0x13'))(_0xe0b5('0x14'));var utils=require('../../config/utils');var config=require(_0xe0b5('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe0b5('0x16'));var jayson=require('jayson/promise');var client=jayson[_0xe0b5('0x17')][_0xe0b5('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4c9166,_0x57125b,_0x174269){if(_0x174269){var _0x4fc1dd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4fc1dd[_0xe0b5('0x19')](_0x57125b)){return _0x4c9166;}else{throw new db[(_0xe0b5('0x1a'))][(_0xe0b5('0x1b'))](_0xe0b5('0x1c'));}}else{return _0x4c9166;}}function respondWithRpcPromise(_0x5ebe18,_0x450d57,_0x316106,_0x3ce8fc){return new BPromise(function(_0x4d56a9,_0x3df6d6){var _0x2803c4=_0x3ce8fc||client;return _0x2803c4[_0xe0b5('0x1d')](_0x5ebe18,_0x316106)[_0xe0b5('0x1e')](function(_0x342f81){logger[_0xe0b5('0x1f')](_0xe0b5('0x20'),_0x450d57,_0xe0b5('0x21'));logger['debug'](_0xe0b5('0x22'),_0x450d57,_0xe0b5('0x21'),JSON['stringify'](_0x342f81));if(_0x342f81[_0xe0b5('0x23')]){if(_0x342f81[_0xe0b5('0x23')]['code']===0x1f4){logger[_0xe0b5('0x23')](_0xe0b5('0x20'),_0x450d57,_0x342f81[_0xe0b5('0x23')][_0xe0b5('0x24')]);return _0x3df6d6(_0x342f81[_0xe0b5('0x23')][_0xe0b5('0x24')]);}logger[_0xe0b5('0x23')]('SalesforceAccount,\x20%s,\x20%s',_0x450d57,_0x342f81[_0xe0b5('0x23')]['message']);return _0x4d56a9(_0x342f81['error']['message']);}else{logger[_0xe0b5('0x1f')](_0xe0b5('0x20'),_0x450d57,_0xe0b5('0x21'));_0x4d56a9(_0x342f81[_0xe0b5('0x25')][_0xe0b5('0x24')]);}})[_0xe0b5('0x26')](function(_0x5591c4){logger[_0xe0b5('0x23')](_0xe0b5('0x20'),_0x450d57,_0x5591c4);_0x3df6d6(_0x5591c4);});});}function respondWithStatusCode(_0x1e0502,_0x4f6314){_0x4f6314=_0x4f6314||0xcc;return function(_0x389920){if(_0x389920){return _0x1e0502[_0xe0b5('0x27')](_0x4f6314);}return _0x1e0502[_0xe0b5('0x28')](_0x4f6314)[_0xe0b5('0x29')]();};}function respondWithResult(_0x4ecfef,_0x2a0727){_0x2a0727=_0x2a0727||0xc8;return function(_0xbf158f){if(_0xbf158f){return _0x4ecfef[_0xe0b5('0x28')](_0x2a0727)[_0xe0b5('0x2a')](_0xbf158f);}};}function respondWithFilteredResult(_0x57f79f,_0x55e98d){return function(_0x119f6c){if(_0x119f6c){var _0x479a93=_0x119f6c[_0xe0b5('0x2b')],_0x48a511=_0x55e98d[_0xe0b5('0x2c')],_0x31f8e1=_0x55e98d['offset']+_0x55e98d[_0xe0b5('0x2d')],_0x1d37af;if(_0x31f8e1>=_0x479a93){_0x31f8e1=_0x479a93;_0x1d37af=0xc8;}else{_0x1d37af=0xce;}_0x57f79f[_0xe0b5('0x28')](_0x1d37af);return _0x57f79f[_0xe0b5('0x2e')](_0xe0b5('0x2f'),_0x48a511+'-'+_0x31f8e1+'/'+_0x479a93)['json'](_0x119f6c);}return null;};}function patchUpdates(_0x4af106){return function(_0x510912){try{jsonpatch[_0xe0b5('0x30')](_0x510912,_0x4af106,!![]);}catch(_0x2c6896){return BPromise[_0xe0b5('0x31')](_0x2c6896);}return _0x510912['save']();};}function saveUpdates(_0x545e51,_0x6ec795){return function(_0x5c18c8){if(_0x5c18c8){return _0x5c18c8[_0xe0b5('0x32')](_0x545e51)['then'](function(_0x28b9fc){return _0x28b9fc;});}return null;};}function removeEntity(_0x216f06,_0x324844){return function(_0x24b3dd){if(_0x24b3dd){return _0x24b3dd[_0xe0b5('0x33')]()[_0xe0b5('0x1e')](function(){_0x216f06[_0xe0b5('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18df42,_0x4910e8){return function(_0x1c3509){if(!_0x1c3509){_0x18df42[_0xe0b5('0x27')](0x194);}return _0x1c3509;};}function handleError(_0x190ee1,_0x518c33){_0x518c33=_0x518c33||0x1f4;return function(_0x14703c){logger['error'](_0x14703c[_0xe0b5('0x34')]);if(_0x14703c[_0xe0b5('0x35')]){delete _0x14703c[_0xe0b5('0x35')];}_0x190ee1[_0xe0b5('0x28')](_0x518c33)[_0xe0b5('0x36')](_0x14703c);};}exports[_0xe0b5('0x37')]=function(_0xe1ee77,_0x40ecc1){var _0x597367={},_0x41b81c={},_0x43a7fb={'count':0x0,'rows':[]};var _0x58296e=_[_0xe0b5('0x38')](db[_0xe0b5('0x39')]['rawAttributes'],function(_0x3c312b){return{'name':_0x3c312b['fieldName'],'type':_0x3c312b['type']['key']};});_0x41b81c['model']=_['map'](_0x58296e,_0xe0b5('0x35'));_0x41b81c['query']=_[_0xe0b5('0x3a')](_0xe1ee77[_0xe0b5('0x3b')]);_0x41b81c[_0xe0b5('0x3c')]=_[_0xe0b5('0x3d')](_0x41b81c['model'],_0x41b81c[_0xe0b5('0x3b')]);_0x597367[_0xe0b5('0x3e')]=_[_0xe0b5('0x3d')](_0x41b81c[_0xe0b5('0x3f')],qs[_0xe0b5('0x40')](_0xe1ee77[_0xe0b5('0x3b')][_0xe0b5('0x40')]));_0x597367[_0xe0b5('0x3e')]=_0x597367[_0xe0b5('0x3e')][_0xe0b5('0x41')]?_0x597367[_0xe0b5('0x3e')]:_0x41b81c['model'];if(!_0xe1ee77['query']['hasOwnProperty'](_0xe0b5('0x42'))){_0x597367[_0xe0b5('0x2d')]=qs[_0xe0b5('0x2d')](_0xe1ee77[_0xe0b5('0x3b')][_0xe0b5('0x2d')]);_0x597367[_0xe0b5('0x2c')]=qs[_0xe0b5('0x2c')](_0xe1ee77[_0xe0b5('0x3b')]['offset']);}_0x597367['order']=qs[_0xe0b5('0x43')](_0xe1ee77[_0xe0b5('0x3b')][_0xe0b5('0x43')]);_0x597367[_0xe0b5('0x44')]=qs[_0xe0b5('0x3c')](_[_0xe0b5('0x45')](_0xe1ee77[_0xe0b5('0x3b')],_0x41b81c[_0xe0b5('0x3c')]),_0x58296e);if(_0xe1ee77[_0xe0b5('0x3b')]['filter']){_0x597367[_0xe0b5('0x44')]=_['merge'](_0x597367[_0xe0b5('0x44')],{'$or':_[_0xe0b5('0x38')](_0x58296e,function(_0x5f2975){if(_0x5f2975['type']!==_0xe0b5('0x46')){var _0x5b936d={};_0x5b936d[_0x5f2975[_0xe0b5('0x35')]]={'$like':'%'+_0xe1ee77[_0xe0b5('0x3b')][_0xe0b5('0x47')]+'%'};return _0x5b936d;}})});}_0x597367=_[_0xe0b5('0x48')]({},_0x597367,_0xe1ee77[_0xe0b5('0x49')]);var _0x4b5d75={'where':_0x597367[_0xe0b5('0x44')]};return db[_0xe0b5('0x39')][_0xe0b5('0x2b')](_0x4b5d75)[_0xe0b5('0x1e')](function(_0x3eb8ca){_0x43a7fb[_0xe0b5('0x2b')]=_0x3eb8ca;if(_0xe1ee77['query']['includeAll']){_0x597367[_0xe0b5('0x4a')]=[{'all':!![]}];}return db[_0xe0b5('0x39')][_0xe0b5('0x4b')](_0x597367);})[_0xe0b5('0x1e')](function(_0x1e58d5){_0x43a7fb[_0xe0b5('0x4c')]=_0x1e58d5;return _0x43a7fb;})['then'](respondWithFilteredResult(_0x40ecc1,_0x597367))[_0xe0b5('0x26')](handleError(_0x40ecc1,null));};exports['show']=function(_0x1fafce,_0x2e8997){var _0x4d1b26={'raw':![],'where':{'id':_0x1fafce[_0xe0b5('0x4d')]['id']}},_0x260a72={};_0x260a72['model']=_[_0xe0b5('0x3a')](db[_0xe0b5('0x39')][_0xe0b5('0x4e')]);_0x260a72[_0xe0b5('0x3b')]=_[_0xe0b5('0x3a')](_0x1fafce[_0xe0b5('0x3b')]);_0x260a72['filters']=_['intersection'](_0x260a72['model'],_0x260a72[_0xe0b5('0x3b')]);_0x4d1b26['attributes']=_['intersection'](_0x260a72[_0xe0b5('0x3f')],qs[_0xe0b5('0x40')](_0x1fafce['query'][_0xe0b5('0x40')]));_0x4d1b26[_0xe0b5('0x3e')]=_0x4d1b26[_0xe0b5('0x3e')][_0xe0b5('0x41')]?_0x4d1b26[_0xe0b5('0x3e')]:_0x260a72[_0xe0b5('0x3f')];if(_0x1fafce[_0xe0b5('0x3b')][_0xe0b5('0x4f')]){_0x4d1b26[_0xe0b5('0x4a')]=[{'all':!![]}];}_0x4d1b26=_[_0xe0b5('0x48')]({},_0x4d1b26,_0x1fafce[_0xe0b5('0x49')]);return db['SalesforceAccount'][_0xe0b5('0x50')](_0x4d1b26)[_0xe0b5('0x1e')](handleEntityNotFound(_0x2e8997,null))['then'](respondWithResult(_0x2e8997,null))[_0xe0b5('0x26')](handleError(_0x2e8997,null));};exports['create']=function(_0x15d7d4,_0x29eaa4){return db[_0xe0b5('0x39')][_0xe0b5('0x51')](_0x15d7d4['body'],{})[_0xe0b5('0x1e')](respondWithResult(_0x29eaa4,0xc9))[_0xe0b5('0x26')](handleError(_0x29eaa4,null));};exports[_0xe0b5('0x32')]=function(_0x5315b9,_0x310cba){if(_0x5315b9[_0xe0b5('0x52')]['id']){delete _0x5315b9[_0xe0b5('0x52')]['id'];}return db[_0xe0b5('0x39')][_0xe0b5('0x50')]({'where':{'id':_0x5315b9['params']['id']}})[_0xe0b5('0x1e')](handleEntityNotFound(_0x310cba,null))[_0xe0b5('0x1e')](saveUpdates(_0x5315b9[_0xe0b5('0x52')],null))[_0xe0b5('0x1e')](respondWithResult(_0x310cba,null))['catch'](handleError(_0x310cba,null));};exports[_0xe0b5('0x33')]=function(_0x76ed68,_0x100368){return db['SalesforceAccount']['find']({'where':{'id':_0x76ed68[_0xe0b5('0x4d')]['id']}})[_0xe0b5('0x1e')](handleEntityNotFound(_0x100368,null))[_0xe0b5('0x1e')](removeEntity(_0x100368,null))['catch'](handleError(_0x100368,null));};exports[_0xe0b5('0x53')]=function(_0x5db3fc,_0x412f58,_0x145604){var _0x4b318a={};var _0x14e901={};var _0x3ae4dc;var _0x1d5be1;return db[_0xe0b5('0x39')]['findOne']({'where':{'id':_0x5db3fc[_0xe0b5('0x4d')]['id']}})[_0xe0b5('0x1e')](handleEntityNotFound(_0x412f58,null))['then'](function(_0x12f93f){if(_0x12f93f){_0x3ae4dc=_0x12f93f;_0x14e901[_0xe0b5('0x3f')]=_[_0xe0b5('0x3a')](db['SalesforceConfiguration'][_0xe0b5('0x4e')]);_0x14e901[_0xe0b5('0x3b')]=_['keys'](_0x5db3fc[_0xe0b5('0x3b')]);_0x14e901[_0xe0b5('0x3c')]=_[_0xe0b5('0x3d')](_0x14e901[_0xe0b5('0x3f')],_0x14e901[_0xe0b5('0x3b')]);_0x4b318a[_0xe0b5('0x3e')]=_['intersection'](_0x14e901[_0xe0b5('0x3f')],qs[_0xe0b5('0x40')](_0x5db3fc[_0xe0b5('0x3b')][_0xe0b5('0x40')]));_0x4b318a[_0xe0b5('0x3e')]=_0x4b318a[_0xe0b5('0x3e')][_0xe0b5('0x41')]?_0x4b318a[_0xe0b5('0x3e')]:_0x14e901['model'];_0x4b318a[_0xe0b5('0x54')]=qs[_0xe0b5('0x43')](_0x5db3fc[_0xe0b5('0x3b')][_0xe0b5('0x43')]);_0x4b318a['where']=qs[_0xe0b5('0x3c')](_['pick'](_0x5db3fc[_0xe0b5('0x3b')],_0x14e901['filters']));if(_0x5db3fc[_0xe0b5('0x3b')][_0xe0b5('0x47')]){_0x4b318a[_0xe0b5('0x44')]=_[_0xe0b5('0x48')](_0x4b318a['where'],{'$or':_[_0xe0b5('0x38')](_0x4b318a['attributes'],function(_0x1626e9){var _0x56eb3c={};_0x56eb3c[_0x1626e9]={'$like':'%'+_0x5db3fc[_0xe0b5('0x3b')][_0xe0b5('0x47')]+'%'};return _0x56eb3c;})});}_0x4b318a=_[_0xe0b5('0x48')]({},_0x4b318a,_0x5db3fc['options']);return _0x3ae4dc['getConfigurations'](_0x4b318a);}})['then'](function(_0x5a1ce0){if(_0x5a1ce0){_0x1d5be1=_0x5a1ce0['length'];if(!_0x5db3fc[_0xe0b5('0x3b')][_0xe0b5('0x55')]('nolimit')){_0x4b318a[_0xe0b5('0x2d')]=qs[_0xe0b5('0x2d')](_0x5db3fc[_0xe0b5('0x3b')][_0xe0b5('0x2d')]);_0x4b318a['offset']=qs[_0xe0b5('0x2c')](_0x5db3fc[_0xe0b5('0x3b')][_0xe0b5('0x2c')]);}return _0x3ae4dc[_0xe0b5('0x53')](_0x4b318a);}})[_0xe0b5('0x1e')](function(_0x45398c){if(_0x45398c){return _0x45398c?{'count':_0x1d5be1,'rows':_0x45398c}:null;}})[_0xe0b5('0x1e')](respondWithResult(_0x412f58,null))[_0xe0b5('0x26')](handleError(_0x412f58,null));};exports[_0xe0b5('0x56')]=function(_0x3e8fce,_0x57210c,_0x11fbaa){if(_0x3e8fce['body']['id']){delete _0x3e8fce['body']['id'];}return db[_0xe0b5('0x39')][_0xe0b5('0x57')]({'where':{'id':_0x3e8fce['params']['id']}})[_0xe0b5('0x1e')](handleEntityNotFound(_0x57210c,null))[_0xe0b5('0x1e')](function(_0x1a3570){if(_0x1a3570){_0x3e8fce[_0xe0b5('0x52')][_0xe0b5('0x58')]=_0x1a3570['id'];_0x3e8fce[_0xe0b5('0x52')][_0xe0b5('0x59')]=integrations[_0xe0b5('0x5a')](_0x3e8fce[_0xe0b5('0x52')]['channel'],_0x3e8fce[_0xe0b5('0x52')][_0xe0b5('0x5b')]);_0x3e8fce[_0xe0b5('0x52')][_0xe0b5('0x5c')]=integrations[_0xe0b5('0x5d')](_0x3e8fce[_0xe0b5('0x52')]['channel'],_0x3e8fce[_0xe0b5('0x52')][_0xe0b5('0x5b')]);return db[_0xe0b5('0x5e')][_0xe0b5('0x51')](_0x3e8fce[_0xe0b5('0x52')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0xe0b5('0x5f')],'as':_0xe0b5('0x5c')}]});}return null;})[_0xe0b5('0x1e')](respondWithResult(_0x57210c,null))[_0xe0b5('0x26')](handleError(_0x57210c,null));};exports['getFields']=function(_0x293f07,_0x59bc0f,_0xcec25){var _0x3aa943;var _0x2e6786='';var _0x3db9a7=_0xe0b5('0x60');return db[_0xe0b5('0x39')][_0xe0b5('0x57')]({'where':{'id':_0x293f07[_0xe0b5('0x4d')]['id']},'attributes':['id','remoteUri',_0xe0b5('0x61'),_0xe0b5('0x62'),_0xe0b5('0x63'),_0xe0b5('0x64'),'securityToken']})[_0xe0b5('0x1e')](handleEntityNotFound(_0x59bc0f,null))[_0xe0b5('0x1e')](function(_0x4e96ab){if(_0x4e96ab){_0x2e6786=_0x4e96ab[_0xe0b5('0x65')];var _0x3750ef=_0x2e6786[_0xe0b5('0x66')](-0x1);if(_0x3750ef==='/'){_0x2e6786=_0x2e6786[_0xe0b5('0x67')](0x0,_0x2e6786[_0xe0b5('0x68')](_0x3750ef));}_0x3aa943=new jsforce[(_0xe0b5('0x69'))]({'oauth2':{'loginUrl':_0x2e6786,'clientId':_0x4e96ab['clientId'],'clientSecret':_0x4e96ab['clientSecret']}});return _0x3aa943[_0xe0b5('0x6a')](_0x4e96ab['username'],_0x4e96ab[_0xe0b5('0x64')][_0xe0b5('0x6b')](_0x4e96ab[_0xe0b5('0x6c')]));}})['then'](function(_0x381dac){if(_0x381dac){if(!_[_0xe0b5('0x6d')](_0x293f07[_0xe0b5('0x3b')]['ticketType'])){_0x3db9a7=_0x293f07[_0xe0b5('0x3b')][_0xe0b5('0x6e')];}return _0x3aa943['sobject'](_0x3db9a7)['describe']();}})['then'](function(_0x42c6f4){var _0x5d92b7=[_0xe0b5('0x6f'),_0xe0b5('0x70'),'CallObject',_0xe0b5('0x71'),'IsArchived',_0xe0b5('0x72'),_0xe0b5('0x73'),_0xe0b5('0x74')];if(!_['isNil'](_0x293f07['query'][_0xe0b5('0x6e')])&&_0x293f07[_0xe0b5('0x3b')]['ticketType']===_0xe0b5('0x75')){_0x5d92b7=[_0xe0b5('0x74'),_0xe0b5('0x76'),_0xe0b5('0x77'),_0xe0b5('0x73'),_0xe0b5('0x72'),_0xe0b5('0x78'),'SuppliedName',_0xe0b5('0x79')];}if(_0x42c6f4){_[_0xe0b5('0x7a')](_0x42c6f4['fields'],function(_0x283a38){return _0x283a38[_0xe0b5('0x7b')]===![]&&!_0x5d92b7['includes'](_0x283a38[_0xe0b5('0x35')]);});return{'count':_0x42c6f4[_0xe0b5('0x40')][_0xe0b5('0x41')],'rows':_[_0xe0b5('0x38')](_0x42c6f4[_0xe0b5('0x40')],function(_0x188125){return{'id':_0x188125[_0xe0b5('0x35')],'name':_0x188125[_0xe0b5('0x7c')],'custom':_0x188125[_0xe0b5('0x7b')],'options':_0x188125[_0xe0b5('0x7d')]['length']>0x0?_[_0xe0b5('0x38')](_0x188125[_0xe0b5('0x7d')],function(_0x3aaf77){return{'name':_0x3aaf77[_0xe0b5('0x7c')],'value':_0x3aaf77['value']};}):_0x188125[_0xe0b5('0x5b')]==_0xe0b5('0x7e')?[{'name':_0xe0b5('0x7f'),'value':_0xe0b5('0x80')},{'name':_0xe0b5('0x81'),'value':_0xe0b5('0x82')}]:[]};})};}})[_0xe0b5('0x1e')](respondWithResult(_0x59bc0f,null))[_0xe0b5('0x26')](function(_0x498108){var _0x1b0796=_0x293f07[_0xe0b5('0x3b')][_0xe0b5('0x19')]?0x1f4:_0x498108[_0xe0b5('0x83')]||0x1f4;logger[_0xe0b5('0x23')](_0xe0b5('0x84'),'getFields',_0x1b0796,JSON[_0xe0b5('0x85')](_0x498108));delete _0x498108[_0xe0b5('0x35')];if(_0x1b0796===0x191){_0x1b0796=0x190;}_0x59bc0f['status'](_0x1b0796)[_0xe0b5('0x36')](_0x293f07[_0xe0b5('0x3b')][_0xe0b5('0x19')]?{'message':_0xe0b5('0x86'),'statusCode':_0x498108[_0xe0b5('0x83')]}:_0x498108);});};
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js
index 964a4e0..b694bcd 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 _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
+var _0xc665=['path','rimraf','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3458f4,_0x1b9889){var _0x53ea55=function(_0x3b5b9e){while(--_0x3b5b9e){_0x3458f4['push'](_0x3458f4['shift']());}};_0x53ea55(++_0x1b9889);}(_0xc665,0xaf));var _0x5c66=function(_0x29d61d,_0x43ae85){_0x29d61d=_0x29d61d-0x0;var _0x50d092=_0xc665[_0x29d61d];return _0x50d092;};'use strict';var _=require(_0x5c66('0x0'));var util=require(_0x5c66('0x1'));var logger=require(_0x5c66('0x2'))(_0x5c66('0x3'));var moment=require(_0x5c66('0x4'));var BPromise=require(_0x5c66('0x5'));var rp=require(_0x5c66('0x6'));var fs=require('fs');var path=require(_0x5c66('0x7'));var rimraf=require(_0x5c66('0x8'));var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x5c66('0x9'));module[_0x5c66('0xa')]=function(_0x53ed80,_0xcd9c0a){return _0x53ed80['define'](_0x5c66('0xb'),attributes,{'tableName':_0x5c66('0xc'),'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 7904677..57ad69f 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 _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
+var _0xe205=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','include','map','model','attributes','ShowSalesforceAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xe205,0xa7));var _0x5e20=function(_0x34817b,_0x20294d){_0x34817b=_0x34817b-0x0;var _0x2beab2=_0xe205[_0x34817b];return _0x2beab2;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var moment=require(_0x5e20('0x2'));var BPromise=require(_0x5e20('0x3'));var rs=require(_0x5e20('0x4'));var fs=require('fs');var Redis=require(_0x5e20('0x5'));var db=require(_0x5e20('0x6'))['db'];var utils=require(_0x5e20('0x7'));var logger=require(_0x5e20('0x8'))('rpc');var config=require(_0x5e20('0x9'));var jayson=require(_0x5e20('0xa'));var client=jayson[_0x5e20('0xb')][_0x5e20('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5eca5c,_0x4cc88d,_0x3a382f){return new BPromise(function(_0x4c9332,_0x533e18){return client[_0x5e20('0xd')](_0x5eca5c,_0x3a382f)[_0x5e20('0xe')](function(_0x5c1eee){logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));logger[_0x5e20('0x12')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4cc88d,_0x5e20('0x11'),JSON[_0x5e20('0x13')](_0x5c1eee));if(_0x5c1eee[_0x5e20('0x14')]){if(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x15')]===0x1f4){logger[_0x5e20('0x14')]('SalesforceAccount,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);return _0x533e18(_0x5c1eee[_0x5e20('0x14')]['message']);}logger[_0x5e20('0x14')]('SalesforceAccount,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')]['message']);return _0x4c9332(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);}else{logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));_0x4c9332(_0x5c1eee['result'][_0x5e20('0x16')]);}})[_0x5e20('0x17')](function(_0x166ffd){logger[_0x5e20('0x14')](_0x5e20('0x10'),_0x4cc88d,_0x166ffd);_0x533e18(_0x166ffd);});});}exports[_0x5e20('0x18')]=function(_0x1cc706){var _0xf3488f=this;return new Promise(function(_0x4d3e4a,_0x434686){return db[_0x5e20('0x19')]['findAll']({'raw':_0x1cc706[_0x5e20('0x1a')]?_0x1cc706[_0x5e20('0x1a')][_0x5e20('0x1b')]===undefined?!![]:![]:!![],'where':_0x1cc706[_0x5e20('0x1a')]?_0x1cc706['options'][_0x5e20('0x1c')]||null:null,'attributes':_0x1cc706['options']?_0x1cc706['options']['attributes']||null:null,'limit':_0x1cc706['options']?_0x1cc706[_0x5e20('0x1a')]['limit']||null:null,'include':_0x1cc706[_0x5e20('0x1a')]?_0x1cc706[_0x5e20('0x1a')][_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x1cc706[_0x5e20('0x1a')][_0x5e20('0x1d')],function(_0x4c5732){return{'model':db[_0x4c5732[_0x5e20('0x1f')]],'as':_0x4c5732['as'],'attributes':_0x4c5732['attributes'],'include':_0x4c5732['include']?_[_0x5e20('0x1e')](_0x4c5732[_0x5e20('0x1d')],function(_0x2bae08){return{'model':db[_0x2bae08[_0x5e20('0x1f')]],'as':_0x2bae08['as'],'attributes':_0x2bae08[_0x5e20('0x20')],'include':_0x2bae08[_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x2bae08['include'],function(_0x3bf4f4){return{'model':db[_0x3bf4f4[_0x5e20('0x1f')]],'as':_0x3bf4f4['as'],'attributes':_0x3bf4f4[_0x5e20('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5e20('0xe')](function(_0x4c799d){logger[_0x5e20('0xf')](_0x5e20('0x18'),_0x1cc706);logger[_0x5e20('0x12')](_0x5e20('0x18'),_0x1cc706,JSON[_0x5e20('0x13')](_0x4c799d));_0x4d3e4a(_0x4c799d);})[_0x5e20('0x17')](function(_0x5ec45b){logger[_0x5e20('0x14')](_0x5e20('0x18'),_0x5ec45b['message'],_0x1cc706);_0x434686(_0xf3488f[_0x5e20('0x14')](0x1f4,_0x5ec45b[_0x5e20('0x16')]));});});};exports[_0x5e20('0x21')]=function(_0x4196a3){var _0x1548c8=this;return new Promise(function(_0x395a27,_0x4ff715){return db[_0x5e20('0x19')][_0x5e20('0x22')]({'raw':_0x4196a3[_0x5e20('0x1a')]?_0x4196a3[_0x5e20('0x1a')][_0x5e20('0x1b')]===undefined?!![]:![]:!![],'where':_0x4196a3[_0x5e20('0x1a')]?_0x4196a3[_0x5e20('0x1a')][_0x5e20('0x1c')]||null:null,'attributes':_0x4196a3[_0x5e20('0x1a')]?_0x4196a3[_0x5e20('0x1a')][_0x5e20('0x20')]||null:null,'include':_0x4196a3['options']?_0x4196a3[_0x5e20('0x1a')][_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x4196a3['options'][_0x5e20('0x1d')],function(_0x2d397b){return{'model':db[_0x2d397b[_0x5e20('0x1f')]],'as':_0x2d397b['as'],'attributes':_0x2d397b[_0x5e20('0x20')],'include':_0x2d397b[_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x2d397b[_0x5e20('0x1d')],function(_0x173165){return{'model':db[_0x173165[_0x5e20('0x1f')]],'as':_0x173165['as'],'attributes':_0x173165[_0x5e20('0x20')],'include':_0x173165[_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x173165[_0x5e20('0x1d')],function(_0x255b67){return{'model':db[_0x255b67['model']],'as':_0x255b67['as'],'attributes':_0x255b67[_0x5e20('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x549f01){logger[_0x5e20('0xf')](_0x5e20('0x21'),_0x4196a3);logger['debug'](_0x5e20('0x21'),_0x4196a3,JSON[_0x5e20('0x13')](_0x549f01));_0x395a27(_0x549f01);})['catch'](function(_0x3f3908){logger[_0x5e20('0x14')](_0x5e20('0x21'),_0x3f3908[_0x5e20('0x16')],_0x4196a3);_0x4ff715(_0x1548c8[_0x5e20('0x14')](0x1f4,_0x3f3908[_0x5e20('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js
index fa88b22..eb11bdd 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 _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
+var _0x5e5b=['./intSalesforceConfiguration.controller','index','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x5e5b,0x1a7));var _0xb5e5=function(_0xd03609,_0x512287){_0xd03609=_0xd03609-0x0;var _0x44f652=_0x5e5b[_0xd03609];return _0x44f652;};'use strict';var multer=require(_0xb5e5('0x0'));var util=require(_0xb5e5('0x1'));var path=require(_0xb5e5('0x2'));var timeout=require(_0xb5e5('0x3'));var express=require(_0xb5e5('0x4'));var router=express[_0xb5e5('0x5')]();var auth=require(_0xb5e5('0x6'));var interaction=require(_0xb5e5('0x7'));var config=require(_0xb5e5('0x8'));var controller=require(_0xb5e5('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xb5e5('0xa')]);router[_0xb5e5('0xb')](_0xb5e5('0xc'),auth[_0xb5e5('0xd')](),controller['show']);router[_0xb5e5('0xb')](_0xb5e5('0xe'),auth['isAuthenticated'](),controller[_0xb5e5('0xf')]);router['get'](_0xb5e5('0x10'),auth['isAuthenticated'](),controller[_0xb5e5('0x11')]);router['get'](_0xb5e5('0x12'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0xb5e5('0xd')](),controller[_0xb5e5('0x13')]);router[_0xb5e5('0x14')](_0xb5e5('0xc'),auth[_0xb5e5('0xd')](),controller['update']);router[_0xb5e5('0x15')](_0xb5e5('0xc'),auth[_0xb5e5('0xd')](),controller[_0xb5e5('0x16')]);module[_0xb5e5('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
index 556941d..40cf5e1 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 _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
+var _0x30a2=['sequelize','exports','STRING','ENUM','contact_lead','contact','lead','nothing'];(function(_0x5decec,_0x4e5761){var _0x35e1b4=function(_0x27066d){while(--_0x27066d){_0x5decec['push'](_0x5decec['shift']());}};_0x35e1b4(++_0x4e5761);}(_0x30a2,0x90));var _0x230a=function(_0x17ec16,_0x2436e3){_0x17ec16=_0x17ec16-0x0;var _0x1f59f5=_0x30a2[_0x17ec16];return _0x1f59f5;};'use strict';var Sequelize=require(_0x230a('0x0'));module[_0x230a('0x1')]={'name':{'type':Sequelize[_0x230a('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x230a('0x3')]('Task','Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x230a('0x3')](_0x230a('0x4'),_0x230a('0x5'),_0x230a('0x6')),'defaultValue':_0x230a('0x4')},'moduleCreate':{'type':Sequelize[_0x230a('0x3')](_0x230a('0x7'),_0x230a('0x5'),_0x230a('0x6')),'defaultValue':_0x230a('0x6')}};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
index c4390cf..017504e 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 _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
+var _0xb098=['nolimit','offset','order','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','params','length','includeAll','include','create','body','find','getFields','findOne','SalesforceField','hasOwnProperty','getSubjects','getDescriptions','options','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../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','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','end','status','json','count','limit','set','Content-Range','apply','reject','save','destroy','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb098,0x195));var _0x8b09=function(_0x3b03bd,_0x184afe){_0x3b03bd=_0x3b03bd-0x0;var _0x51697b=_0xb098[_0x3b03bd];return _0x51697b;};'use strict';var pdf=require(_0x8b09('0x0'));var emlformat=require(_0x8b09('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8b09('0x2'));var rp=require(_0x8b09('0x3'));var moment=require(_0x8b09('0x4'));var BPromise=require(_0x8b09('0x5'));var Mustache=require(_0x8b09('0x6'));var util=require(_0x8b09('0x7'));var path=require(_0x8b09('0x8'));var sox=require(_0x8b09('0x9'));var csv=require('to-csv');var ejs=require(_0x8b09('0xa'));var fs=require('fs');var _=require(_0x8b09('0xb'));var squel=require(_0x8b09('0xc'));var crypto=require(_0x8b09('0xd'));var jsforce=require(_0x8b09('0xe'));var deskjs=require(_0x8b09('0xf'));var toCsv=require(_0x8b09('0x10'));var querystring=require(_0x8b09('0x11'));var Papa=require('papaparse');var Redis=require(_0x8b09('0x12'));var authService=require(_0x8b09('0x13'));var qs=require(_0x8b09('0x14'));var as=require(_0x8b09('0x15'));var hardwareService=require(_0x8b09('0x16'));var logger=require(_0x8b09('0x17'))('api');var utils=require(_0x8b09('0x18'));var config=require(_0x8b09('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0x8b09('0x1a'));var client=jayson[_0x8b09('0x1b')][_0x8b09('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x239383,_0x57b055,_0x1b1fda){if(_0x1b1fda){var _0x529d4a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x529d4a[_0x8b09('0x1d')](_0x57b055)){return _0x239383;}else{throw new db[(_0x8b09('0x1e'))][(_0x8b09('0x1f'))](_0x8b09('0x20'));}}else{return _0x239383;}}function respondWithRpcPromise(_0x42661c,_0x22d885,_0x13b626,_0x5b24bb){return new BPromise(function(_0x39c6a5,_0x1e64b4){var _0x579ef0=_0x5b24bb||client;return _0x579ef0[_0x8b09('0x21')](_0x42661c,_0x13b626)[_0x8b09('0x22')](function(_0x1b0408){logger[_0x8b09('0x23')](_0x8b09('0x24'),_0x22d885,_0x8b09('0x25'));logger['debug'](_0x8b09('0x26'),_0x22d885,'request\x20sent',JSON['stringify'](_0x1b0408));if(_0x1b0408[_0x8b09('0x27')]){if(_0x1b0408[_0x8b09('0x27')][_0x8b09('0x28')]===0x1f4){logger[_0x8b09('0x27')]('SalesforceConfiguration,\x20%s,\x20%s',_0x22d885,_0x1b0408[_0x8b09('0x27')][_0x8b09('0x29')]);return _0x1e64b4(_0x1b0408[_0x8b09('0x27')][_0x8b09('0x29')]);}logger[_0x8b09('0x27')](_0x8b09('0x24'),_0x22d885,_0x1b0408[_0x8b09('0x27')][_0x8b09('0x29')]);return _0x39c6a5(_0x1b0408[_0x8b09('0x27')]['message']);}else{logger[_0x8b09('0x23')](_0x8b09('0x24'),_0x22d885,_0x8b09('0x25'));_0x39c6a5(_0x1b0408[_0x8b09('0x2a')][_0x8b09('0x29')]);}})[_0x8b09('0x2b')](function(_0x3b7c9f){logger[_0x8b09('0x27')](_0x8b09('0x24'),_0x22d885,_0x3b7c9f);_0x1e64b4(_0x3b7c9f);});});}function respondWithStatusCode(_0x191ab2,_0x5b72fe){_0x5b72fe=_0x5b72fe||0xcc;return function(_0xcba0dd){if(_0xcba0dd){return _0x191ab2['sendStatus'](_0x5b72fe);}return _0x191ab2['status'](_0x5b72fe)[_0x8b09('0x2c')]();};}function respondWithResult(_0x577417,_0x1aa74d){_0x1aa74d=_0x1aa74d||0xc8;return function(_0x3f2062){if(_0x3f2062){return _0x577417[_0x8b09('0x2d')](_0x1aa74d)[_0x8b09('0x2e')](_0x3f2062);}};}function respondWithFilteredResult(_0x4b440d,_0x5a9559){return function(_0x5d6151){if(_0x5d6151){var _0x28b0f6=_0x5d6151[_0x8b09('0x2f')],_0x4da224=_0x5a9559['offset'],_0x4bcf25=_0x5a9559['offset']+_0x5a9559[_0x8b09('0x30')],_0x34b6be;if(_0x4bcf25>=_0x28b0f6){_0x4bcf25=_0x28b0f6;_0x34b6be=0xc8;}else{_0x34b6be=0xce;}_0x4b440d[_0x8b09('0x2d')](_0x34b6be);return _0x4b440d[_0x8b09('0x31')](_0x8b09('0x32'),_0x4da224+'-'+_0x4bcf25+'/'+_0x28b0f6)[_0x8b09('0x2e')](_0x5d6151);}return null;};}function patchUpdates(_0x15804d){return function(_0x26f766){try{jsonpatch[_0x8b09('0x33')](_0x26f766,_0x15804d,!![]);}catch(_0xf1df93){return BPromise[_0x8b09('0x34')](_0xf1df93);}return _0x26f766[_0x8b09('0x35')]();};}function saveUpdates(_0x216498,_0x589a4a){return function(_0x17364f){if(_0x17364f){return _0x17364f['update'](_0x216498)[_0x8b09('0x22')](function(_0x33f090){return _0x33f090;});}return null;};}function removeEntity(_0x44d524,_0x5e276d){return function(_0x1d20b0){if(_0x1d20b0){return _0x1d20b0[_0x8b09('0x36')]()['then'](function(){_0x44d524[_0x8b09('0x2d')](0xcc)[_0x8b09('0x2c')]();});}};}function handleEntityNotFound(_0x31a7c3,_0x7b6d78){return function(_0x4278a7){if(!_0x4278a7){_0x31a7c3['sendStatus'](0x194);}return _0x4278a7;};}function handleError(_0x14e67a,_0x38f8aa){_0x38f8aa=_0x38f8aa||0x1f4;return function(_0x282c41){logger[_0x8b09('0x27')](_0x282c41['stack']);if(_0x282c41[_0x8b09('0x37')]){delete _0x282c41[_0x8b09('0x37')];}_0x14e67a[_0x8b09('0x2d')](_0x38f8aa)[_0x8b09('0x38')](_0x282c41);};}exports[_0x8b09('0x39')]=function(_0x192e13,_0x308644){var _0x52f4b1={},_0x4a8733={},_0x4ab240={'count':0x0,'rows':[]};var _0x17b073=_[_0x8b09('0x3a')](db[_0x8b09('0x3b')][_0x8b09('0x3c')],function(_0x23f046){return{'name':_0x23f046[_0x8b09('0x3d')],'type':_0x23f046[_0x8b09('0x3e')]['key']};});_0x4a8733[_0x8b09('0x3f')]=_[_0x8b09('0x3a')](_0x17b073,'name');_0x4a8733[_0x8b09('0x40')]=_[_0x8b09('0x41')](_0x192e13[_0x8b09('0x40')]);_0x4a8733[_0x8b09('0x42')]=_[_0x8b09('0x43')](_0x4a8733[_0x8b09('0x3f')],_0x4a8733[_0x8b09('0x40')]);_0x52f4b1['attributes']=_['intersection'](_0x4a8733[_0x8b09('0x3f')],qs[_0x8b09('0x44')](_0x192e13[_0x8b09('0x40')][_0x8b09('0x44')]));_0x52f4b1[_0x8b09('0x45')]=_0x52f4b1[_0x8b09('0x45')]['length']?_0x52f4b1[_0x8b09('0x45')]:_0x4a8733['model'];if(!_0x192e13[_0x8b09('0x40')]['hasOwnProperty'](_0x8b09('0x46'))){_0x52f4b1['limit']=qs[_0x8b09('0x30')](_0x192e13[_0x8b09('0x40')]['limit']);_0x52f4b1[_0x8b09('0x47')]=qs['offset'](_0x192e13[_0x8b09('0x40')][_0x8b09('0x47')]);}_0x52f4b1[_0x8b09('0x48')]=qs[_0x8b09('0x49')](_0x192e13[_0x8b09('0x40')]['sort']);_0x52f4b1[_0x8b09('0x4a')]=qs['filters'](_[_0x8b09('0x4b')](_0x192e13['query'],_0x4a8733[_0x8b09('0x42')]),_0x17b073);if(_0x192e13[_0x8b09('0x40')][_0x8b09('0x4c')]){_0x52f4b1[_0x8b09('0x4a')]=_['merge'](_0x52f4b1[_0x8b09('0x4a')],{'$or':_[_0x8b09('0x3a')](_0x17b073,function(_0x4fe39f){if(_0x4fe39f[_0x8b09('0x3e')]!==_0x8b09('0x4d')){var _0x5d0cb5={};_0x5d0cb5[_0x4fe39f[_0x8b09('0x37')]]={'$like':'%'+_0x192e13[_0x8b09('0x40')][_0x8b09('0x4c')]+'%'};return _0x5d0cb5;}})});}_0x52f4b1=_[_0x8b09('0x4e')]({},_0x52f4b1,_0x192e13['options']);var _0xe63eee={'where':_0x52f4b1[_0x8b09('0x4a')]};return db['SalesforceConfiguration'][_0x8b09('0x2f')](_0xe63eee)[_0x8b09('0x22')](function(_0x57fc2f){_0x4ab240[_0x8b09('0x2f')]=_0x57fc2f;if(_0x192e13[_0x8b09('0x40')]['includeAll']){_0x52f4b1['include']=[{'all':!![]}];}return db[_0x8b09('0x3b')][_0x8b09('0x4f')](_0x52f4b1);})['then'](function(_0x28ca7a){_0x4ab240[_0x8b09('0x50')]=_0x28ca7a;return _0x4ab240;})[_0x8b09('0x22')](respondWithFilteredResult(_0x308644,_0x52f4b1))['catch'](handleError(_0x308644,null));};exports['show']=function(_0x16df26,_0x29b957){var _0x10259c={'raw':![],'where':{'id':_0x16df26[_0x8b09('0x51')]['id']}},_0x29fa4c={};_0x29fa4c[_0x8b09('0x3f')]=_['keys'](db[_0x8b09('0x3b')][_0x8b09('0x3c')]);_0x29fa4c['query']=_[_0x8b09('0x41')](_0x16df26[_0x8b09('0x40')]);_0x29fa4c[_0x8b09('0x42')]=_[_0x8b09('0x43')](_0x29fa4c[_0x8b09('0x3f')],_0x29fa4c[_0x8b09('0x40')]);_0x10259c[_0x8b09('0x45')]=_['intersection'](_0x29fa4c['model'],qs[_0x8b09('0x44')](_0x16df26[_0x8b09('0x40')][_0x8b09('0x44')]));_0x10259c['attributes']=_0x10259c[_0x8b09('0x45')][_0x8b09('0x52')]?_0x10259c[_0x8b09('0x45')]:_0x29fa4c[_0x8b09('0x3f')];if(_0x16df26[_0x8b09('0x40')][_0x8b09('0x53')]){_0x10259c[_0x8b09('0x54')]=[{'all':!![]}];}_0x10259c=_[_0x8b09('0x4e')]({},_0x10259c,_0x16df26['options']);return db[_0x8b09('0x3b')]['find'](_0x10259c)[_0x8b09('0x22')](handleEntityNotFound(_0x29b957,null))[_0x8b09('0x22')](respondWithResult(_0x29b957,null))['catch'](handleError(_0x29b957,null));};exports[_0x8b09('0x55')]=function(_0xf24473,_0x1f949d){return db[_0x8b09('0x3b')][_0x8b09('0x55')](_0xf24473['body'],{})[_0x8b09('0x22')](respondWithResult(_0x1f949d,0xc9))[_0x8b09('0x2b')](handleError(_0x1f949d,null));};exports['update']=function(_0x56838e,_0x42bd30){if(_0x56838e['body']['id']){delete _0x56838e[_0x8b09('0x56')]['id'];}return db[_0x8b09('0x3b')][_0x8b09('0x57')]({'where':{'id':_0x56838e['params']['id']}})[_0x8b09('0x22')](handleEntityNotFound(_0x42bd30,null))[_0x8b09('0x22')](saveUpdates(_0x56838e[_0x8b09('0x56')],null))[_0x8b09('0x22')](respondWithResult(_0x42bd30,null))['catch'](handleError(_0x42bd30,null));};exports[_0x8b09('0x36')]=function(_0x1cc4e9,_0x291cb7){return db['SalesforceConfiguration']['find']({'where':{'id':_0x1cc4e9[_0x8b09('0x51')]['id']}})[_0x8b09('0x22')](handleEntityNotFound(_0x291cb7,null))[_0x8b09('0x22')](removeEntity(_0x291cb7,null))[_0x8b09('0x2b')](handleError(_0x291cb7,null));};exports[_0x8b09('0x58')]=function(_0x2eccac,_0xa1975e,_0x11f3b8){var _0x5c2af2={};var _0x56486c={};var _0x2c16d3;var _0x8a1ac9;return db['SalesforceConfiguration'][_0x8b09('0x59')]({'where':{'id':_0x2eccac[_0x8b09('0x51')]['id']}})[_0x8b09('0x22')](handleEntityNotFound(_0xa1975e,null))[_0x8b09('0x22')](function(_0x54adb8){if(_0x54adb8){_0x2c16d3=_0x54adb8;_0x56486c['model']=_[_0x8b09('0x41')](db[_0x8b09('0x5a')]['rawAttributes']);_0x56486c[_0x8b09('0x40')]=_[_0x8b09('0x41')](_0x2eccac[_0x8b09('0x40')]);_0x56486c[_0x8b09('0x42')]=_['intersection'](_0x56486c[_0x8b09('0x3f')],_0x56486c[_0x8b09('0x40')]);_0x5c2af2[_0x8b09('0x45')]=_[_0x8b09('0x43')](_0x56486c[_0x8b09('0x3f')],qs['fields'](_0x2eccac['query'][_0x8b09('0x44')]));_0x5c2af2[_0x8b09('0x45')]=_0x5c2af2['attributes'][_0x8b09('0x52')]?_0x5c2af2[_0x8b09('0x45')]:_0x56486c[_0x8b09('0x3f')];_0x5c2af2[_0x8b09('0x48')]=qs[_0x8b09('0x49')](_0x2eccac[_0x8b09('0x40')][_0x8b09('0x49')]);_0x5c2af2[_0x8b09('0x4a')]=qs[_0x8b09('0x42')](_[_0x8b09('0x4b')](_0x2eccac[_0x8b09('0x40')],_0x56486c[_0x8b09('0x42')]));if(_0x2eccac[_0x8b09('0x40')][_0x8b09('0x4c')]){_0x5c2af2['where']=_[_0x8b09('0x4e')](_0x5c2af2[_0x8b09('0x4a')],{'$or':_['map'](_0x5c2af2[_0x8b09('0x45')],function(_0x50fd62){var _0x5c6ab4={};_0x5c6ab4[_0x50fd62]={'$like':'%'+_0x2eccac[_0x8b09('0x40')]['filter']+'%'};return _0x5c6ab4;})});}_0x5c2af2=_[_0x8b09('0x4e')]({},_0x5c2af2,_0x2eccac['options']);return _0x2c16d3[_0x8b09('0x58')](_0x5c2af2);}})[_0x8b09('0x22')](function(_0x261746){if(_0x261746){_0x8a1ac9=_0x261746[_0x8b09('0x52')];if(!_0x2eccac[_0x8b09('0x40')][_0x8b09('0x5b')](_0x8b09('0x46'))){_0x5c2af2[_0x8b09('0x30')]=qs['limit'](_0x2eccac[_0x8b09('0x40')][_0x8b09('0x30')]);_0x5c2af2[_0x8b09('0x47')]=qs[_0x8b09('0x47')](_0x2eccac[_0x8b09('0x40')][_0x8b09('0x47')]);}return _0x2c16d3[_0x8b09('0x58')](_0x5c2af2);}})['then'](function(_0x480228){if(_0x480228){return _0x480228?{'count':_0x8a1ac9,'rows':_0x480228}:null;}})[_0x8b09('0x22')](respondWithResult(_0xa1975e,null))[_0x8b09('0x2b')](handleError(_0xa1975e,null));};exports['getSubjects']=function(_0x3613f6,_0x21901e,_0x30fbb1){var _0x12a433={};var _0x2facea={};var _0x922fed;var _0x5bb979;return db['SalesforceConfiguration'][_0x8b09('0x59')]({'where':{'id':_0x3613f6[_0x8b09('0x51')]['id']}})['then'](handleEntityNotFound(_0x21901e,null))[_0x8b09('0x22')](function(_0x370ecb){if(_0x370ecb){_0x922fed=_0x370ecb;_0x2facea[_0x8b09('0x3f')]=_[_0x8b09('0x41')](db[_0x8b09('0x5a')][_0x8b09('0x3c')]);_0x2facea[_0x8b09('0x40')]=_[_0x8b09('0x41')](_0x3613f6['query']);_0x2facea[_0x8b09('0x42')]=_[_0x8b09('0x43')](_0x2facea['model'],_0x2facea[_0x8b09('0x40')]);_0x12a433[_0x8b09('0x45')]=_[_0x8b09('0x43')](_0x2facea[_0x8b09('0x3f')],qs[_0x8b09('0x44')](_0x3613f6[_0x8b09('0x40')][_0x8b09('0x44')]));_0x12a433['attributes']=_0x12a433[_0x8b09('0x45')][_0x8b09('0x52')]?_0x12a433[_0x8b09('0x45')]:_0x2facea[_0x8b09('0x3f')];_0x12a433[_0x8b09('0x48')]=qs[_0x8b09('0x49')](_0x3613f6['query']['sort']);_0x12a433['where']=qs[_0x8b09('0x42')](_[_0x8b09('0x4b')](_0x3613f6[_0x8b09('0x40')],_0x2facea[_0x8b09('0x42')]));if(_0x3613f6[_0x8b09('0x40')][_0x8b09('0x4c')]){_0x12a433['where']=_['merge'](_0x12a433['where'],{'$or':_[_0x8b09('0x3a')](_0x12a433[_0x8b09('0x45')],function(_0x420d8d){var _0x198efa={};_0x198efa[_0x420d8d]={'$like':'%'+_0x3613f6[_0x8b09('0x40')][_0x8b09('0x4c')]+'%'};return _0x198efa;})});}_0x12a433=_['merge']({},_0x12a433,_0x3613f6['options']);return _0x922fed[_0x8b09('0x5c')](_0x12a433);}})['then'](function(_0x272574){if(_0x272574){_0x5bb979=_0x272574['length'];if(!_0x3613f6[_0x8b09('0x40')][_0x8b09('0x5b')]('nolimit')){_0x12a433[_0x8b09('0x30')]=qs[_0x8b09('0x30')](_0x3613f6[_0x8b09('0x40')][_0x8b09('0x30')]);_0x12a433[_0x8b09('0x47')]=qs[_0x8b09('0x47')](_0x3613f6[_0x8b09('0x40')][_0x8b09('0x47')]);}return _0x922fed[_0x8b09('0x5c')](_0x12a433);}})[_0x8b09('0x22')](function(_0xdff93b){if(_0xdff93b){return _0xdff93b?{'count':_0x5bb979,'rows':_0xdff93b}:null;}})[_0x8b09('0x22')](respondWithResult(_0x21901e,null))[_0x8b09('0x2b')](handleError(_0x21901e,null));};exports[_0x8b09('0x5d')]=function(_0x829a15,_0x54b2fe,_0x569c92){var _0x5e94e8={};var _0x225be1={};var _0x2d4836;var _0x34b869;return db['SalesforceConfiguration'][_0x8b09('0x59')]({'where':{'id':_0x829a15[_0x8b09('0x51')]['id']}})[_0x8b09('0x22')](handleEntityNotFound(_0x54b2fe,null))[_0x8b09('0x22')](function(_0x55d7c4){if(_0x55d7c4){_0x2d4836=_0x55d7c4;_0x225be1[_0x8b09('0x3f')]=_[_0x8b09('0x41')](db[_0x8b09('0x5a')][_0x8b09('0x3c')]);_0x225be1[_0x8b09('0x40')]=_[_0x8b09('0x41')](_0x829a15[_0x8b09('0x40')]);_0x225be1[_0x8b09('0x42')]=_[_0x8b09('0x43')](_0x225be1[_0x8b09('0x3f')],_0x225be1[_0x8b09('0x40')]);_0x5e94e8['attributes']=_[_0x8b09('0x43')](_0x225be1['model'],qs[_0x8b09('0x44')](_0x829a15[_0x8b09('0x40')][_0x8b09('0x44')]));_0x5e94e8['attributes']=_0x5e94e8[_0x8b09('0x45')]['length']?_0x5e94e8[_0x8b09('0x45')]:_0x225be1[_0x8b09('0x3f')];_0x5e94e8[_0x8b09('0x48')]=qs['sort'](_0x829a15['query'][_0x8b09('0x49')]);_0x5e94e8['where']=qs['filters'](_[_0x8b09('0x4b')](_0x829a15[_0x8b09('0x40')],_0x225be1[_0x8b09('0x42')]));if(_0x829a15['query']['filter']){_0x5e94e8[_0x8b09('0x4a')]=_[_0x8b09('0x4e')](_0x5e94e8[_0x8b09('0x4a')],{'$or':_['map'](_0x5e94e8['attributes'],function(_0x13dce4){var _0x40c96c={};_0x40c96c[_0x13dce4]={'$like':'%'+_0x829a15[_0x8b09('0x40')][_0x8b09('0x4c')]+'%'};return _0x40c96c;})});}_0x5e94e8=_[_0x8b09('0x4e')]({},_0x5e94e8,_0x829a15[_0x8b09('0x5e')]);return _0x2d4836[_0x8b09('0x5d')](_0x5e94e8);}})[_0x8b09('0x22')](function(_0x4ba70c){if(_0x4ba70c){_0x34b869=_0x4ba70c[_0x8b09('0x52')];if(!_0x829a15[_0x8b09('0x40')][_0x8b09('0x5b')]('nolimit')){_0x5e94e8[_0x8b09('0x30')]=qs[_0x8b09('0x30')](_0x829a15['query']['limit']);_0x5e94e8[_0x8b09('0x47')]=qs['offset'](_0x829a15['query'][_0x8b09('0x47')]);}return _0x2d4836[_0x8b09('0x5d')](_0x5e94e8);}})['then'](function(_0x8fb0a5){if(_0x8fb0a5){return _0x8fb0a5?{'count':_0x34b869,'rows':_0x8fb0a5}:null;}})[_0x8b09('0x22')](respondWithResult(_0x54b2fe,null))['catch'](handleError(_0x54b2fe,null));};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
index c263556..be64fe8 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 _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
+var _0xca33=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0xca33,0xd8));var _0x3ca3=function(_0x3b5e5a,_0x377383){_0x3b5e5a=_0x3b5e5a-0x0;var _0x3b9104=_0xca33[_0x3b5e5a];return _0x3b9104;};'use strict';var _=require('lodash');var util=require(_0x3ca3('0x0'));var logger=require(_0x3ca3('0x1'))(_0x3ca3('0x2'));var moment=require(_0x3ca3('0x3'));var BPromise=require(_0x3ca3('0x4'));var rp=require(_0x3ca3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ca3('0x6'));var config=require(_0x3ca3('0x7'));var attributes=require(_0x3ca3('0x8'));module[_0x3ca3('0x9')]=function(_0x390537,_0x469251){return _0x390537[_0x3ca3('0xa')]('SalesforceConfiguration',attributes,{'tableName':_0x3ca3('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 3921d57..2f99094 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 _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
+var _0x1e7d=['../../config/logger','../../config/environment','jayson/promise','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x45d051,_0x42fe35){var _0x3875e3=function(_0x26c9a8){while(--_0x26c9a8){_0x45d051['push'](_0x45d051['shift']());}};_0x3875e3(++_0x42fe35);}(_0x1e7d,0x1f3));var _0xd1e7=function(_0x3f0bf1,_0x10dfe2){_0x3f0bf1=_0x3f0bf1-0x0;var _0x3ae7a4=_0x1e7d[_0x3f0bf1];return _0x3ae7a4;};'use strict';var _=require(_0xd1e7('0x0'));var util=require(_0xd1e7('0x1'));var moment=require(_0xd1e7('0x2'));var BPromise=require(_0xd1e7('0x3'));var rs=require(_0xd1e7('0x4'));var fs=require('fs');var Redis=require(_0xd1e7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd1e7('0x6'));var logger=require(_0xd1e7('0x7'))('rpc');var config=require(_0xd1e7('0x8'));var jayson=require(_0xd1e7('0x9'));var client=jayson['client'][_0xd1e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58270b,_0x161732,_0x49208e){return new BPromise(function(_0x9e91bd,_0x10a814){return client[_0xd1e7('0xb')](_0x58270b,_0x49208e)[_0xd1e7('0xc')](function(_0xb1aad3){logger['info'](_0xd1e7('0xd'),_0x161732,_0xd1e7('0xe'));logger['debug'](_0xd1e7('0xf'),_0x161732,'request\x20sent',JSON[_0xd1e7('0x10')](_0xb1aad3));if(_0xb1aad3[_0xd1e7('0x11')]){if(_0xb1aad3[_0xd1e7('0x11')][_0xd1e7('0x12')]===0x1f4){logger[_0xd1e7('0x11')](_0xd1e7('0xd'),_0x161732,_0xb1aad3['error'][_0xd1e7('0x13')]);return _0x10a814(_0xb1aad3['error'][_0xd1e7('0x13')]);}logger[_0xd1e7('0x11')](_0xd1e7('0xd'),_0x161732,_0xb1aad3[_0xd1e7('0x11')][_0xd1e7('0x13')]);return _0x9e91bd(_0xb1aad3[_0xd1e7('0x11')]['message']);}else{logger['info'](_0xd1e7('0xd'),_0x161732,_0xd1e7('0xe'));_0x9e91bd(_0xb1aad3[_0xd1e7('0x14')][_0xd1e7('0x13')]);}})[_0xd1e7('0x15')](function(_0x43746b){logger[_0xd1e7('0x11')](_0xd1e7('0xd'),_0x161732,_0x43746b);_0x10a814(_0x43746b);});});}
\ No newline at end of file
diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js
index 03bf485..a0a9327 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 _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
+var _0xda19=['post','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x8ee4e8,_0x192cf2){var _0x4b1ec4=function(_0xc3cfa5){while(--_0xc3cfa5){_0x8ee4e8['push'](_0x8ee4e8['shift']());}};_0x4b1ec4(++_0x192cf2);}(_0xda19,0xd5));var _0x9da1=function(_0x15a9b5,_0x56466b){_0x15a9b5=_0x15a9b5-0x0;var _0x5b81bf=_0xda19[_0x15a9b5];return _0x5b81bf;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var auth=require(_0x9da1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9da1('0x4'));var controller=require(_0x9da1('0x5'));router[_0x9da1('0x6')]('/',auth[_0x9da1('0x7')](),controller[_0x9da1('0x8')]);router[_0x9da1('0x6')](_0x9da1('0x9'),auth[_0x9da1('0x7')](),controller[_0x9da1('0xa')]);router[_0x9da1('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9da1('0x9'),auth['isAuthenticated'](),controller[_0x9da1('0xc')]);router[_0x9da1('0xd')](_0x9da1('0x9'),auth[_0x9da1('0x7')](),controller[_0x9da1('0xe')]);module[_0x9da1('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js
index a351dba..34f4560 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 _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
+var _0x326b=['customVariable','keyValue','STRING','ENUM','sequelize','exports','string','variable'];(function(_0x504a44,_0x1a700e){var _0xfa522c=function(_0x250250){while(--_0x250250){_0x504a44['push'](_0x504a44['shift']());}};_0xfa522c(++_0x1a700e);}(_0x326b,0x1f4));var _0xb326=function(_0x335a62,_0xfafea4){_0x335a62=_0x335a62-0x0;var _0x249a9a=_0x326b[_0x335a62];return _0x249a9a;};'use strict';var Sequelize=require(_0xb326('0x0'));module[_0xb326('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb326('0x2'),_0xb326('0x3'),_0xb326('0x4'),_0xb326('0x5')),'defaultValue':_0xb326('0x2')},'content':{'type':Sequelize[_0xb326('0x6')]},'key':{'type':Sequelize[_0xb326('0x6')]},'keyType':{'type':Sequelize[_0xb326('0x7')]('string',_0xb326('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xb326('0x6')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xb326('0x6')]}};
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js
index 4b97d4b..5b113ba 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 _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
+var _0xcdd5=['params','length','includeAll','options','create','body','destroy','find','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','update','then','end','error','stack','name','send','index','map','SalesforceField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show'];(function(_0x28847e,_0x1b575c){var _0x13fed9=function(_0x52ef27){while(--_0x52ef27){_0x28847e['push'](_0x28847e['shift']());}};_0x13fed9(++_0x1b575c);}(_0xcdd5,0x1c4));var _0x5cdd=function(_0x5520af,_0x41002d){_0x5520af=_0x5520af-0x0;var _0x2e6299=_0xcdd5[_0x5520af];return _0x2e6299;};'use strict';var pdf=require(_0x5cdd('0x0'));var emlformat=require(_0x5cdd('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5cdd('0x2'));var jsonpatch=require(_0x5cdd('0x3'));var rp=require('request-promise');var moment=require(_0x5cdd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5cdd('0x5'));var util=require(_0x5cdd('0x6'));var path=require(_0x5cdd('0x7'));var sox=require(_0x5cdd('0x8'));var csv=require(_0x5cdd('0x9'));var ejs=require(_0x5cdd('0xa'));var fs=require('fs');var _=require(_0x5cdd('0xb'));var squel=require('squel');var crypto=require(_0x5cdd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5cdd('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5cdd('0xe'));var Papa=require(_0x5cdd('0xf'));var Redis=require(_0x5cdd('0x10'));var authService=require(_0x5cdd('0x11'));var qs=require(_0x5cdd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5cdd('0x13'));var logger=require(_0x5cdd('0x14'))(_0x5cdd('0x15'));var utils=require('../../config/utils');var config=require(_0x5cdd('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38a5ab,_0x53ad7b){_0x53ad7b=_0x53ad7b||0xcc;return function(_0x1edc98){if(_0x1edc98){return _0x38a5ab[_0x5cdd('0x17')](_0x53ad7b);}return _0x38a5ab[_0x5cdd('0x18')](_0x53ad7b)['end']();};}function respondWithResult(_0x4ab56c,_0x437f39){_0x437f39=_0x437f39||0xc8;return function(_0x5478b2){if(_0x5478b2){return _0x4ab56c['status'](_0x437f39)['json'](_0x5478b2);}};}function respondWithFilteredResult(_0x5a93a9,_0x30473a){return function(_0xf2feeb){if(_0xf2feeb){var _0x5514f4=_0xf2feeb[_0x5cdd('0x19')],_0x371078=_0x30473a[_0x5cdd('0x1a')],_0x44833c=_0x30473a[_0x5cdd('0x1a')]+_0x30473a['limit'],_0x265eff;if(_0x44833c>=_0x5514f4){_0x44833c=_0x5514f4;_0x265eff=0xc8;}else{_0x265eff=0xce;}_0x5a93a9[_0x5cdd('0x18')](_0x265eff);return _0x5a93a9[_0x5cdd('0x1b')](_0x5cdd('0x1c'),_0x371078+'-'+_0x44833c+'/'+_0x5514f4)[_0x5cdd('0x1d')](_0xf2feeb);}return null;};}function patchUpdates(_0x4a342d){return function(_0x15ae12){try{jsonpatch[_0x5cdd('0x1e')](_0x15ae12,_0x4a342d,!![]);}catch(_0x29ef43){return BPromise[_0x5cdd('0x1f')](_0x29ef43);}return _0x15ae12['save']();};}function saveUpdates(_0x3d0d90,_0x2cc8fd){return function(_0x2fad3b){if(_0x2fad3b){return _0x2fad3b[_0x5cdd('0x20')](_0x3d0d90)[_0x5cdd('0x21')](function(_0x615bd4){return _0x615bd4;});}return null;};}function removeEntity(_0x53c86d,_0x583121){return function(_0x325b7e){if(_0x325b7e){return _0x325b7e['destroy']()[_0x5cdd('0x21')](function(){_0x53c86d[_0x5cdd('0x18')](0xcc)[_0x5cdd('0x22')]();});}};}function handleEntityNotFound(_0x2d247c,_0x49f4b9){return function(_0x44a9e8){if(!_0x44a9e8){_0x2d247c['sendStatus'](0x194);}return _0x44a9e8;};}function handleError(_0x54e1ff,_0x4c95b0){_0x4c95b0=_0x4c95b0||0x1f4;return function(_0x58b0fd){logger[_0x5cdd('0x23')](_0x58b0fd[_0x5cdd('0x24')]);if(_0x58b0fd['name']){delete _0x58b0fd[_0x5cdd('0x25')];}_0x54e1ff[_0x5cdd('0x18')](_0x4c95b0)[_0x5cdd('0x26')](_0x58b0fd);};}exports[_0x5cdd('0x27')]=function(_0x1086ab,_0x2bf256){var _0x195713={},_0x35bee6={},_0x553da6={'count':0x0,'rows':[]};var _0x54309e=_[_0x5cdd('0x28')](db[_0x5cdd('0x29')][_0x5cdd('0x2a')],function(_0xa74fb6){return{'name':_0xa74fb6['fieldName'],'type':_0xa74fb6[_0x5cdd('0x2b')][_0x5cdd('0x2c')]};});_0x35bee6[_0x5cdd('0x2d')]=_['map'](_0x54309e,_0x5cdd('0x25'));_0x35bee6[_0x5cdd('0x2e')]=_[_0x5cdd('0x2f')](_0x1086ab[_0x5cdd('0x2e')]);_0x35bee6[_0x5cdd('0x30')]=_[_0x5cdd('0x31')](_0x35bee6[_0x5cdd('0x2d')],_0x35bee6[_0x5cdd('0x2e')]);_0x195713[_0x5cdd('0x32')]=_['intersection'](_0x35bee6[_0x5cdd('0x2d')],qs[_0x5cdd('0x33')](_0x1086ab['query']['fields']));_0x195713['attributes']=_0x195713[_0x5cdd('0x32')]['length']?_0x195713['attributes']:_0x35bee6[_0x5cdd('0x2d')];if(!_0x1086ab[_0x5cdd('0x2e')][_0x5cdd('0x34')](_0x5cdd('0x35'))){_0x195713['limit']=qs[_0x5cdd('0x36')](_0x1086ab[_0x5cdd('0x2e')][_0x5cdd('0x36')]);_0x195713[_0x5cdd('0x1a')]=qs[_0x5cdd('0x1a')](_0x1086ab[_0x5cdd('0x2e')][_0x5cdd('0x1a')]);}_0x195713[_0x5cdd('0x37')]=qs[_0x5cdd('0x38')](_0x1086ab[_0x5cdd('0x2e')]['sort']);_0x195713[_0x5cdd('0x39')]=qs[_0x5cdd('0x30')](_[_0x5cdd('0x3a')](_0x1086ab[_0x5cdd('0x2e')],_0x35bee6['filters']),_0x54309e);if(_0x1086ab[_0x5cdd('0x2e')][_0x5cdd('0x3b')]){_0x195713[_0x5cdd('0x39')]=_[_0x5cdd('0x3c')](_0x195713[_0x5cdd('0x39')],{'$or':_[_0x5cdd('0x28')](_0x54309e,function(_0x3596c9){if(_0x3596c9[_0x5cdd('0x2b')]!==_0x5cdd('0x3d')){var _0x33f239={};_0x33f239[_0x3596c9[_0x5cdd('0x25')]]={'$like':'%'+_0x1086ab[_0x5cdd('0x2e')][_0x5cdd('0x3b')]+'%'};return _0x33f239;}})});}_0x195713=_[_0x5cdd('0x3c')]({},_0x195713,_0x1086ab['options']);var _0x451973={'where':_0x195713[_0x5cdd('0x39')]};return db[_0x5cdd('0x29')]['count'](_0x451973)[_0x5cdd('0x21')](function(_0x4d352b){_0x553da6[_0x5cdd('0x19')]=_0x4d352b;if(_0x1086ab[_0x5cdd('0x2e')]['includeAll']){_0x195713[_0x5cdd('0x3e')]=[{'all':!![]}];}return db['SalesforceField'][_0x5cdd('0x3f')](_0x195713);})['then'](function(_0x20a590){_0x553da6['rows']=_0x20a590;return _0x553da6;})[_0x5cdd('0x21')](respondWithFilteredResult(_0x2bf256,_0x195713))[_0x5cdd('0x40')](handleError(_0x2bf256,null));};exports[_0x5cdd('0x41')]=function(_0x104607,_0x3d0b07){var _0x510778={'raw':!![],'where':{'id':_0x104607[_0x5cdd('0x42')]['id']}},_0x59026f={};_0x59026f[_0x5cdd('0x2d')]=_['keys'](db[_0x5cdd('0x29')][_0x5cdd('0x2a')]);_0x59026f[_0x5cdd('0x2e')]=_[_0x5cdd('0x2f')](_0x104607[_0x5cdd('0x2e')]);_0x59026f['filters']=_[_0x5cdd('0x31')](_0x59026f[_0x5cdd('0x2d')],_0x59026f['query']);_0x510778[_0x5cdd('0x32')]=_['intersection'](_0x59026f[_0x5cdd('0x2d')],qs[_0x5cdd('0x33')](_0x104607[_0x5cdd('0x2e')][_0x5cdd('0x33')]));_0x510778[_0x5cdd('0x32')]=_0x510778[_0x5cdd('0x32')][_0x5cdd('0x43')]?_0x510778[_0x5cdd('0x32')]:_0x59026f['model'];if(_0x104607[_0x5cdd('0x2e')][_0x5cdd('0x44')]){_0x510778[_0x5cdd('0x3e')]=[{'all':!![]}];}_0x510778=_[_0x5cdd('0x3c')]({},_0x510778,_0x104607[_0x5cdd('0x45')]);return db[_0x5cdd('0x29')]['find'](_0x510778)['then'](handleEntityNotFound(_0x3d0b07,null))[_0x5cdd('0x21')](respondWithResult(_0x3d0b07,null))[_0x5cdd('0x40')](handleError(_0x3d0b07,null));};exports[_0x5cdd('0x46')]=function(_0x100ca1,_0x2d1fa6){return db[_0x5cdd('0x29')][_0x5cdd('0x46')](_0x100ca1['body'],{})[_0x5cdd('0x21')](respondWithResult(_0x2d1fa6,0xc9))[_0x5cdd('0x40')](handleError(_0x2d1fa6,null));};exports['update']=function(_0x75a040,_0x1966e3){if(_0x75a040[_0x5cdd('0x47')]['id']){delete _0x75a040[_0x5cdd('0x47')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x75a040[_0x5cdd('0x42')]['id']}})[_0x5cdd('0x21')](handleEntityNotFound(_0x1966e3,null))[_0x5cdd('0x21')](saveUpdates(_0x75a040['body'],null))[_0x5cdd('0x21')](respondWithResult(_0x1966e3,null))['catch'](handleError(_0x1966e3,null));};exports[_0x5cdd('0x48')]=function(_0x4ed0f7,_0x1dc5d7){return db['SalesforceField'][_0x5cdd('0x49')]({'where':{'id':_0x4ed0f7['params']['id']}})[_0x5cdd('0x21')](handleEntityNotFound(_0x1dc5d7,null))[_0x5cdd('0x21')](removeEntity(_0x1dc5d7,null))['catch'](handleError(_0x1dc5d7,null));};
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js
index 9c53071..997b28c 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 _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
+var _0x3eb8=['./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','idField','FieldId','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0x3eb8,0x1e7));var _0x83eb=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x3eb8[_0x616290];return _0x453879;};'use strict';var _=require(_0x83eb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x83eb('0x1'));var moment=require(_0x83eb('0x2'));var BPromise=require(_0x83eb('0x3'));var rp=require(_0x83eb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x83eb('0x5'));var config=require(_0x83eb('0x6'));var attributes=require(_0x83eb('0x7'));module[_0x83eb('0x8')]=function(_0x4519a4,_0x44f4d5){return _0x4519a4['define'](_0x83eb('0x9'),attributes,{'tableName':_0x83eb('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x83eb('0xb'),_0x83eb('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 978ad7d..5f2fb54 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 _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
+var _0xe706=['http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\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(_0x2d3449,_0xe447b9){var _0x472e2e=function(_0x195bd0){while(--_0x195bd0){_0x2d3449['push'](_0x2d3449['shift']());}};_0x472e2e(++_0xe447b9);}(_0xe706,0xa3));var _0x6e70=function(_0x101176,_0x1ad975){_0x101176=_0x101176-0x0;var _0x4ec27c=_0xe706[_0x101176];return _0x4ec27c;};'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']('SalesforceField,\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']('SalesforceField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js
index 7be5b16..24105a0 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 _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
+var _0xabe8=['getConfigurations','post','create','put','/:id','update','destroy','multer','util','path','express','Router','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','show','/:id/configurations'];(function(_0x3f1ba9,_0x51ffb4){var _0x534b5c=function(_0xa9e2f7){while(--_0xa9e2f7){_0x3f1ba9['push'](_0x3f1ba9['shift']());}};_0x534b5c(++_0x51ffb4);}(_0xabe8,0x8c));var _0x8abe=function(_0x483592,_0x143c23){_0x483592=_0x483592-0x0;var _0x3b9fdc=_0xabe8[_0x483592];return _0x3b9fdc;};'use strict';var multer=require(_0x8abe('0x0'));var util=require(_0x8abe('0x1'));var path=require(_0x8abe('0x2'));var timeout=require('connect-timeout');var express=require(_0x8abe('0x3'));var router=express[_0x8abe('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8abe('0x5'));var config=require('../../config/environment');var controller=require(_0x8abe('0x6'));router[_0x8abe('0x7')]('/',auth[_0x8abe('0x8')](),controller[_0x8abe('0x9')]);router[_0x8abe('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x8abe('0xa')]);router[_0x8abe('0x7')](_0x8abe('0xb'),auth[_0x8abe('0x8')](),controller[_0x8abe('0xc')]);router[_0x8abe('0x7')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x8abe('0xd')]('/',auth[_0x8abe('0x8')](),controller[_0x8abe('0xe')]);router[_0x8abe('0xd')](_0x8abe('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x8abe('0xf')](_0x8abe('0x10'),auth[_0x8abe('0x8')](),controller[_0x8abe('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8abe('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js
index 3e1a5d0..2610581 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 _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
+var _0x4874=['STRING','username','sequelize','exports'];(function(_0x362a9c,_0x434fd5){var _0x159079=function(_0x4e5a3c){while(--_0x4e5a3c){_0x362a9c['push'](_0x362a9c['shift']());}};_0x159079(++_0x434fd5);}(_0x4874,0x7a));var _0x4487=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x4874[_0x21549c];return _0x426cbd;};'use strict';var Sequelize=require(_0x4487('0x0'));module[_0x4487('0x1')]={'name':{'type':Sequelize[_0x4487('0x2')]},'description':{'type':Sequelize[_0x4487('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x4487('0x3')},'password':{'type':Sequelize[_0x4487('0x2')]},'email':{'type':Sequelize[_0x4487('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4487('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js
index 512ae64..17978f7 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 _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
+var _0xc788=['intersection','fields','attributes','length','limit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','create','body','find','destroy','getConfigurations','findOne','ServicenowConfiguration','order','nolimit','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','incident_state','severity','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','subcategory','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','close_notes','follow_up','parent_incident','sys_id','reopened_by','urgency','company','reassignment_count','activity_due','assigned_to','approval','comments_and_work_notes','reopen_count','sys_tags','escalation','upon_approval','username','password','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','false','sys_choice?sysparm_query=name=incident^element=','value','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','client','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','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','set','Content-Range','save','update','then','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','filters'];(function(_0x654f94,_0x36f849){var _0x11a2cf=function(_0x1e3983){while(--_0x1e3983){_0x654f94['push'](_0x654f94['shift']());}};_0x11a2cf(++_0x36f849);}(_0xc788,0x82));var _0x8c78=function(_0x170eb7,_0x1ac59b){_0x170eb7=_0x170eb7-0x0;var _0x4dfeac=_0xc788[_0x170eb7];return _0x4dfeac;};'use strict';var pdf=require(_0x8c78('0x0'));var emlformat=require(_0x8c78('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8c78('0x2'));var jsonpatch=require(_0x8c78('0x3'));var rp=require('request-promise');var moment=require(_0x8c78('0x4'));var BPromise=require(_0x8c78('0x5'));var Mustache=require(_0x8c78('0x6'));var util=require(_0x8c78('0x7'));var path=require(_0x8c78('0x8'));var sox=require(_0x8c78('0x9'));var csv=require(_0x8c78('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8c78('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8c78('0x10'));var qs=require(_0x8c78('0x11'));var as=require(_0x8c78('0x12'));var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))(_0x8c78('0x15'));var utils=require('../../config/utils');var config=require(_0x8c78('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x8c78('0x17'));var client=jayson[_0x8c78('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x3142a7,_0x2b8cb6,_0x5ed393){if(_0x5ed393){var _0x4424ad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4424ad['test'](_0x2b8cb6)){return _0x3142a7;}else{throw new db[(_0x8c78('0x19'))]['ValidationError'](_0x8c78('0x1a'));}}else{return _0x3142a7;}}function respondWithRpcPromise(_0x2c5e82,_0x54370c,_0x52b882,_0x129547){return new BPromise(function(_0x503908,_0xb723c0){var _0x5b4f9f=_0x129547||client;return _0x5b4f9f[_0x8c78('0x1b')](_0x2c5e82,_0x52b882)['then'](function(_0x48ecf9){logger[_0x8c78('0x1c')](_0x8c78('0x1d'),_0x54370c,_0x8c78('0x1e'));logger[_0x8c78('0x1f')](_0x8c78('0x20'),_0x54370c,_0x8c78('0x1e'),JSON[_0x8c78('0x21')](_0x48ecf9));if(_0x48ecf9['error']){if(_0x48ecf9[_0x8c78('0x22')][_0x8c78('0x23')]===0x1f4){logger[_0x8c78('0x22')]('ServicenowAccount,\x20%s,\x20%s',_0x54370c,_0x48ecf9[_0x8c78('0x22')][_0x8c78('0x24')]);return _0xb723c0(_0x48ecf9[_0x8c78('0x22')][_0x8c78('0x24')]);}logger[_0x8c78('0x22')](_0x8c78('0x1d'),_0x54370c,_0x48ecf9[_0x8c78('0x22')][_0x8c78('0x24')]);return _0x503908(_0x48ecf9[_0x8c78('0x22')][_0x8c78('0x24')]);}else{logger[_0x8c78('0x1c')](_0x8c78('0x1d'),_0x54370c,'request\x20sent');_0x503908(_0x48ecf9['result']['message']);}})[_0x8c78('0x25')](function(_0x3c8c2f){logger['error'](_0x8c78('0x1d'),_0x54370c,_0x3c8c2f);_0xb723c0(_0x3c8c2f);});});}function respondWithStatusCode(_0x3b4d9f,_0x2cbdfe){_0x2cbdfe=_0x2cbdfe||0xcc;return function(_0x1b2ec3){if(_0x1b2ec3){return _0x3b4d9f[_0x8c78('0x26')](_0x2cbdfe);}return _0x3b4d9f[_0x8c78('0x27')](_0x2cbdfe)[_0x8c78('0x28')]();};}function respondWithResult(_0x3b70bb,_0x1790a){_0x1790a=_0x1790a||0xc8;return function(_0x29f8e1){if(_0x29f8e1){return _0x3b70bb[_0x8c78('0x27')](_0x1790a)[_0x8c78('0x29')](_0x29f8e1);}};}function respondWithFilteredResult(_0x18a418,_0x555d07){return function(_0x5cd06e){if(_0x5cd06e){var _0x2ea89a=_0x5cd06e[_0x8c78('0x2a')],_0x209401=_0x555d07[_0x8c78('0x2b')],_0x2282e4=_0x555d07['offset']+_0x555d07['limit'],_0x3a8384;if(_0x2282e4>=_0x2ea89a){_0x2282e4=_0x2ea89a;_0x3a8384=0xc8;}else{_0x3a8384=0xce;}_0x18a418[_0x8c78('0x27')](_0x3a8384);return _0x18a418[_0x8c78('0x2c')](_0x8c78('0x2d'),_0x209401+'-'+_0x2282e4+'/'+_0x2ea89a)[_0x8c78('0x29')](_0x5cd06e);}return null;};}function patchUpdates(_0x459c13){return function(_0x207767){try{jsonpatch['apply'](_0x207767,_0x459c13,!![]);}catch(_0x18609f){return BPromise['reject'](_0x18609f);}return _0x207767[_0x8c78('0x2e')]();};}function saveUpdates(_0x5fa360,_0x17d318){return function(_0x413c9d){if(_0x413c9d){return _0x413c9d[_0x8c78('0x2f')](_0x5fa360)[_0x8c78('0x30')](function(_0x2635af){return _0x2635af;});}return null;};}function removeEntity(_0xc1731,_0x5ad1d1){return function(_0x3078a9){if(_0x3078a9){return _0x3078a9['destroy']()[_0x8c78('0x30')](function(){_0xc1731['status'](0xcc)[_0x8c78('0x28')]();});}};}function handleEntityNotFound(_0x2449c9,_0x14012c){return function(_0x334884){if(!_0x334884){_0x2449c9[_0x8c78('0x26')](0x194);}return _0x334884;};}function handleError(_0x3aaea7,_0x336373){_0x336373=_0x336373||0x1f4;return function(_0x125253){logger[_0x8c78('0x22')](_0x125253[_0x8c78('0x31')]);if(_0x125253[_0x8c78('0x32')]){delete _0x125253[_0x8c78('0x32')];}_0x3aaea7['status'](_0x336373)[_0x8c78('0x33')](_0x125253);};}exports[_0x8c78('0x34')]=function(_0x4fdc8c,_0x1889cd){var _0x37302d={},_0xdf6b45={},_0x437f59={'count':0x0,'rows':[]};var _0x16c72e=_[_0x8c78('0x35')](db[_0x8c78('0x36')][_0x8c78('0x37')],function(_0x40c9d9){return{'name':_0x40c9d9[_0x8c78('0x38')],'type':_0x40c9d9['type'][_0x8c78('0x39')]};});_0xdf6b45[_0x8c78('0x3a')]=_['map'](_0x16c72e,'name');_0xdf6b45[_0x8c78('0x3b')]=_['keys'](_0x4fdc8c['query']);_0xdf6b45[_0x8c78('0x3c')]=_[_0x8c78('0x3d')](_0xdf6b45[_0x8c78('0x3a')],_0xdf6b45[_0x8c78('0x3b')]);_0x37302d['attributes']=_[_0x8c78('0x3d')](_0xdf6b45[_0x8c78('0x3a')],qs[_0x8c78('0x3e')](_0x4fdc8c[_0x8c78('0x3b')][_0x8c78('0x3e')]));_0x37302d[_0x8c78('0x3f')]=_0x37302d['attributes'][_0x8c78('0x40')]?_0x37302d[_0x8c78('0x3f')]:_0xdf6b45[_0x8c78('0x3a')];if(!_0x4fdc8c[_0x8c78('0x3b')]['hasOwnProperty']('nolimit')){_0x37302d['limit']=qs[_0x8c78('0x41')](_0x4fdc8c['query'][_0x8c78('0x41')]);_0x37302d[_0x8c78('0x2b')]=qs[_0x8c78('0x2b')](_0x4fdc8c[_0x8c78('0x3b')]['offset']);}_0x37302d['order']=qs['sort'](_0x4fdc8c['query'][_0x8c78('0x42')]);_0x37302d[_0x8c78('0x43')]=qs[_0x8c78('0x3c')](_[_0x8c78('0x44')](_0x4fdc8c[_0x8c78('0x3b')],_0xdf6b45[_0x8c78('0x3c')]),_0x16c72e);if(_0x4fdc8c[_0x8c78('0x3b')][_0x8c78('0x45')]){_0x37302d[_0x8c78('0x43')]=_['merge'](_0x37302d[_0x8c78('0x43')],{'$or':_['map'](_0x16c72e,function(_0x1d2ae3){if(_0x1d2ae3[_0x8c78('0x46')]!==_0x8c78('0x47')){var _0x338d05={};_0x338d05[_0x1d2ae3[_0x8c78('0x32')]]={'$like':'%'+_0x4fdc8c[_0x8c78('0x3b')][_0x8c78('0x45')]+'%'};return _0x338d05;}})});}_0x37302d=_[_0x8c78('0x48')]({},_0x37302d,_0x4fdc8c[_0x8c78('0x49')]);var _0x34af77={'where':_0x37302d[_0x8c78('0x43')]};return db[_0x8c78('0x36')][_0x8c78('0x2a')](_0x34af77)[_0x8c78('0x30')](function(_0x569ac8){_0x437f59['count']=_0x569ac8;if(_0x4fdc8c[_0x8c78('0x3b')][_0x8c78('0x4a')]){_0x37302d[_0x8c78('0x4b')]=[{'all':!![]}];}return db[_0x8c78('0x36')][_0x8c78('0x4c')](_0x37302d);})[_0x8c78('0x30')](function(_0x3acbcf){_0x437f59[_0x8c78('0x4d')]=_0x3acbcf;return _0x437f59;})[_0x8c78('0x30')](respondWithFilteredResult(_0x1889cd,_0x37302d))[_0x8c78('0x25')](handleError(_0x1889cd,null));};exports[_0x8c78('0x4e')]=function(_0x2a51df,_0x177437){var _0x413741={'raw':![],'where':{'id':_0x2a51df[_0x8c78('0x4f')]['id']}},_0x49cf6f={};_0x49cf6f[_0x8c78('0x3a')]=_['keys'](db[_0x8c78('0x36')][_0x8c78('0x37')]);_0x49cf6f[_0x8c78('0x3b')]=_[_0x8c78('0x50')](_0x2a51df['query']);_0x49cf6f[_0x8c78('0x3c')]=_['intersection'](_0x49cf6f[_0x8c78('0x3a')],_0x49cf6f['query']);_0x413741[_0x8c78('0x3f')]=_['intersection'](_0x49cf6f[_0x8c78('0x3a')],qs[_0x8c78('0x3e')](_0x2a51df['query']['fields']));_0x413741['attributes']=_0x413741[_0x8c78('0x3f')][_0x8c78('0x40')]?_0x413741[_0x8c78('0x3f')]:_0x49cf6f[_0x8c78('0x3a')];if(_0x2a51df[_0x8c78('0x3b')][_0x8c78('0x4a')]){_0x413741[_0x8c78('0x4b')]=[{'all':!![]}];}_0x413741=_[_0x8c78('0x48')]({},_0x413741,_0x2a51df['options']);return db[_0x8c78('0x36')]['find'](_0x413741)['then'](handleEntityNotFound(_0x177437,null))[_0x8c78('0x30')](respondWithResult(_0x177437,null))[_0x8c78('0x25')](handleError(_0x177437,null));};exports[_0x8c78('0x51')]=function(_0x47d195,_0x2dbb56){return db[_0x8c78('0x36')][_0x8c78('0x51')](_0x47d195['body'],{})[_0x8c78('0x30')](respondWithResult(_0x2dbb56,0xc9))[_0x8c78('0x25')](handleError(_0x2dbb56,null));};exports[_0x8c78('0x2f')]=function(_0x3a6b80,_0x6f4515){if(_0x3a6b80[_0x8c78('0x52')]['id']){delete _0x3a6b80[_0x8c78('0x52')]['id'];}return db[_0x8c78('0x36')][_0x8c78('0x53')]({'where':{'id':_0x3a6b80[_0x8c78('0x4f')]['id']}})[_0x8c78('0x30')](handleEntityNotFound(_0x6f4515,null))[_0x8c78('0x30')](saveUpdates(_0x3a6b80[_0x8c78('0x52')],null))[_0x8c78('0x30')](respondWithResult(_0x6f4515,null))[_0x8c78('0x25')](handleError(_0x6f4515,null));};exports[_0x8c78('0x54')]=function(_0x33d849,_0x41a752){return db['ServicenowAccount'][_0x8c78('0x53')]({'where':{'id':_0x33d849['params']['id']}})[_0x8c78('0x30')](handleEntityNotFound(_0x41a752,null))[_0x8c78('0x30')](removeEntity(_0x41a752,null))['catch'](handleError(_0x41a752,null));};exports[_0x8c78('0x55')]=function(_0x8ae0fa,_0x470271,_0x2542e2){var _0x70303c={};var _0x8beb74={};var _0x2d168a;var _0x12edf1;return db[_0x8c78('0x36')][_0x8c78('0x56')]({'where':{'id':_0x8ae0fa[_0x8c78('0x4f')]['id']}})[_0x8c78('0x30')](handleEntityNotFound(_0x470271,null))['then'](function(_0x47c312){if(_0x47c312){_0x2d168a=_0x47c312;_0x8beb74[_0x8c78('0x3a')]=_[_0x8c78('0x50')](db[_0x8c78('0x57')][_0x8c78('0x37')]);_0x8beb74['query']=_['keys'](_0x8ae0fa[_0x8c78('0x3b')]);_0x8beb74['filters']=_[_0x8c78('0x3d')](_0x8beb74[_0x8c78('0x3a')],_0x8beb74[_0x8c78('0x3b')]);_0x70303c[_0x8c78('0x3f')]=_[_0x8c78('0x3d')](_0x8beb74[_0x8c78('0x3a')],qs[_0x8c78('0x3e')](_0x8ae0fa[_0x8c78('0x3b')][_0x8c78('0x3e')]));_0x70303c[_0x8c78('0x3f')]=_0x70303c[_0x8c78('0x3f')][_0x8c78('0x40')]?_0x70303c[_0x8c78('0x3f')]:_0x8beb74[_0x8c78('0x3a')];_0x70303c[_0x8c78('0x58')]=qs['sort'](_0x8ae0fa[_0x8c78('0x3b')][_0x8c78('0x42')]);_0x70303c[_0x8c78('0x43')]=qs['filters'](_[_0x8c78('0x44')](_0x8ae0fa[_0x8c78('0x3b')],_0x8beb74['filters']));if(_0x8ae0fa['query'][_0x8c78('0x45')]){_0x70303c[_0x8c78('0x43')]=_[_0x8c78('0x48')](_0x70303c[_0x8c78('0x43')],{'$or':_[_0x8c78('0x35')](_0x70303c[_0x8c78('0x3f')],function(_0x4914e0){var _0x412d43={};_0x412d43[_0x4914e0]={'$like':'%'+_0x8ae0fa[_0x8c78('0x3b')][_0x8c78('0x45')]+'%'};return _0x412d43;})});}_0x70303c=_[_0x8c78('0x48')]({},_0x70303c,_0x8ae0fa[_0x8c78('0x49')]);return _0x2d168a[_0x8c78('0x55')](_0x70303c);}})['then'](function(_0x2914e3){if(_0x2914e3){_0x12edf1=_0x2914e3['length'];if(!_0x8ae0fa[_0x8c78('0x3b')]['hasOwnProperty'](_0x8c78('0x59'))){_0x70303c[_0x8c78('0x41')]=qs['limit'](_0x8ae0fa[_0x8c78('0x3b')]['limit']);_0x70303c[_0x8c78('0x2b')]=qs[_0x8c78('0x2b')](_0x8ae0fa[_0x8c78('0x3b')][_0x8c78('0x2b')]);}return _0x2d168a[_0x8c78('0x55')](_0x70303c);}})[_0x8c78('0x30')](function(_0x1b8227){if(_0x1b8227){return _0x1b8227?{'count':_0x12edf1,'rows':_0x1b8227}:null;}})[_0x8c78('0x30')](respondWithResult(_0x470271,null))['catch'](handleError(_0x470271,null));};exports[_0x8c78('0x5a')]=function(_0x1b0e30,_0x5d0404,_0x103cf9){if(_0x1b0e30[_0x8c78('0x52')]['id']){delete _0x1b0e30[_0x8c78('0x52')]['id'];}return db[_0x8c78('0x36')][_0x8c78('0x56')]({'where':{'id':_0x1b0e30[_0x8c78('0x4f')]['id']}})[_0x8c78('0x30')](handleEntityNotFound(_0x5d0404,null))['then'](function(_0x33b652){if(_0x33b652){_0x1b0e30[_0x8c78('0x52')][_0x8c78('0x5b')]=_0x33b652['id'];_0x1b0e30[_0x8c78('0x52')][_0x8c78('0x5c')]=integrations['getSubjects'](_0x1b0e30[_0x8c78('0x52')]['channel'],_0x1b0e30[_0x8c78('0x52')]['type']);_0x1b0e30[_0x8c78('0x52')][_0x8c78('0x5d')]=integrations[_0x8c78('0x5e')](_0x1b0e30[_0x8c78('0x52')][_0x8c78('0x5f')],_0x1b0e30[_0x8c78('0x52')]['type']);return db[_0x8c78('0x57')][_0x8c78('0x51')](_0x1b0e30[_0x8c78('0x52')],{'include':[{'model':db['ServicenowField'],'as':_0x8c78('0x5c')},{'model':db[_0x8c78('0x60')],'as':_0x8c78('0x5d')}]});}return null;})[_0x8c78('0x30')](respondWithResult(_0x5d0404,null))[_0x8c78('0x25')](handleError(_0x5d0404,null));};exports[_0x8c78('0x61')]=function(_0x1bd417,_0x3225fa,_0x137551){var _0x3a060f=[_0x8c78('0x62'),_0x8c78('0x63'),_0x8c78('0x64'),'subcategory','close_code','notify',_0x8c78('0x65'),_0x8c78('0x66'),'category'];var _0x441cb5=[_0x8c78('0x67'),_0x8c78('0x62'),_0x8c78('0x68'),_0x8c78('0x69'),_0x8c78('0x6a'),_0x8c78('0x6b'),_0x8c78('0x6c'),_0x8c78('0x63'),'approval_history',_0x8c78('0x6d'),_0x8c78('0x6e'),_0x8c78('0x6f'),'opened_by',_0x8c78('0x70'),_0x8c78('0x71'),'sys_domain','state',_0x8c78('0x72'),_0x8c78('0x64'),_0x8c78('0x58'),_0x8c78('0x73'),_0x8c78('0x74'),_0x8c78('0x75'),_0x8c78('0x76'),'impact','active',_0x8c78('0x77'),_0x8c78('0x78'),_0x8c78('0x79'),_0x8c78('0x7a'),_0x8c78('0x7b'),'time_worked',_0x8c78('0x7c'),_0x8c78('0x7d'),_0x8c78('0x7e'),_0x8c78('0x7f'),_0x8c78('0x80'),'reopened_time',_0x8c78('0x81'),_0x8c78('0x82'),_0x8c78('0x83'),_0x8c78('0x84'),'work_notes',_0x8c78('0x85'),'close_code',_0x8c78('0x86'),'delivery_task',_0x8c78('0x87'),_0x8c78('0x88'),_0x8c78('0x89'),_0x8c78('0x8a'),_0x8c78('0x8b'),_0x8c78('0x8c'),_0x8c78('0x8d'),'sys_class_name',_0x8c78('0x8e'),'closed_by',_0x8c78('0x8f'),_0x8c78('0x90'),_0x8c78('0x91'),'contact_type',_0x8c78('0x92'),_0x8c78('0x65'),_0x8c78('0x93'),'problem_id',_0x8c78('0x94'),_0x8c78('0x95'),_0x8c78('0x96'),_0x8c78('0x97'),_0x8c78('0x66'),'comments','sla_due',_0x8c78('0x98'),_0x8c78('0x99'),'due_date','sys_mod_count',_0x8c78('0x9a'),_0x8c78('0x9b'),_0x8c78('0x9c'),_0x8c78('0x9d'),'correlation_id','location','category'];var _0x3dd968='';var _0x328fff='';var _0x18f8fb=[];var _0x3f74cf='';var _0x4b5e52='';var _0x30d060=[];var _0xaa61c1='';var _0x269bda='';var _0x3f2276={};var _0x23729e='';return db[_0x8c78('0x36')][_0x8c78('0x56')]({'where':{'id':_0x1bd417[_0x8c78('0x4f')]['id']},'attributes':['id',_0x8c78('0x9e'),_0x8c78('0x9f'),'email',_0x8c78('0xa0'),_0x8c78('0xa1')]})[_0x8c78('0x30')](handleEntityNotFound(_0x3225fa,null))[_0x8c78('0x30')](function(_0x96e901){if(_0x96e901){_0x23729e=_0x96e901[_0x8c78('0xa0')];var _0x47b0df=_0x23729e[_0x8c78('0xa2')](-0x1);if(_0x47b0df==='/'){_0x23729e=_0x23729e[_0x8c78('0xa3')](0x0,_0x23729e[_0x8c78('0xa4')](_0x47b0df));}_0x269bda=util[_0x8c78('0xa5')]('%s/api/now/doc/table/schema/',_0x23729e);_0xaa61c1=util[_0x8c78('0xa5')](_0x8c78('0xa6'),_0x23729e);_0x3f2276={'user':_0x96e901[_0x8c78('0x9e')],'pass':_0x96e901[_0x8c78('0x9f')]};var _0x4c6645={'method':'GET','uri':_0x269bda+_0x8c78('0xa7'),'auth':_0x3f2276,'json':!![]};return rp(_0x4c6645);}})[_0x8c78('0x30')](function(_0x4ebe5c){if(_0x4ebe5c[_0x8c78('0xa8')][_0x8c78('0x40')]>0x0){_0x3dd968=_0x4ebe5c[_0x8c78('0xa8')];}console[_0x8c78('0xa9')](_0x8c78('0xaa'),_0x3dd968);_0x30d060=[];_0x328fff=Object[_0x8c78('0xab')]([],_0x3dd968);_['remove'](_0x328fff,function(_0x1f247e){return!_0x3a060f[_0x8c78('0xac')](_0x1f247e[_0x8c78('0x32')]);});_0x328fff[_0x8c78('0xad')](function(_0xec3015){var _0x364724=createFieldObject(_0xaa61c1,_0x3f2276,_0xec3015[_0x8c78('0xae')],_0xec3015[_0x8c78('0x32')],_0xec3015[_0x8c78('0xaf')],![]);_0x30d060[_0x8c78('0xb0')](_0x364724);});return Promise[_0x8c78('0xb1')](_0x30d060);})['then'](function(_0x25784c){_0x18f8fb=_0x25784c;_0x3f74cf=Object[_0x8c78('0xab')]([],_0x3dd968);console[_0x8c78('0xa9')]('TCL:\x20_object',_0x3dd968);_[_0x8c78('0xb2')](_0x3f74cf,function(_0x5aa00b){return _0x441cb5[_0x8c78('0xac')](_0x5aa00b[_0x8c78('0x32')]);});console['log'](_0x8c78('0xb3'),_0x3f74cf);_0x30d060=[];_0x3f74cf[_0x8c78('0xad')](function(_0x545c40){var _0x3c2129=createFieldObject(_0xaa61c1,_0x3f2276,_0x545c40['internalType'],_0x545c40[_0x8c78('0x32')],_0x545c40[_0x8c78('0xaf')],!![]);_0x30d060[_0x8c78('0xb0')](_0x3c2129);});return Promise['all'](_0x30d060);})[_0x8c78('0x30')](function(_0xc153c5){_0x4b5e52=_0xc153c5;var _0x241474=_0x18f8fb[_0x8c78('0xb4')](_0x4b5e52);return{'count':_0x241474[_0x8c78('0x40')],'rows':_0x241474};})[_0x8c78('0x30')](respondWithResult(_0x3225fa,null))[_0x8c78('0x25')](function(_0x4e3fb7){console[_0x8c78('0xa9')](_0x8c78('0xb5')+_0x4e3fb7);var _0x800185=_0x1bd417[_0x8c78('0x3b')][_0x8c78('0xb6')]?0x1f4:_0x4e3fb7[_0x8c78('0xb7')]||0x1f4;logger['error'](_0x4e3fb7[_0x8c78('0x31')]);delete _0x4e3fb7[_0x8c78('0x32')];if(_0x800185===0x191){_0x800185=0x190;}_0x3225fa['status'](_0x800185)[_0x8c78('0x33')](_0x1bd417[_0x8c78('0x3b')][_0x8c78('0xb6')]?{'message':_0x8c78('0xb8'),'statusCode':_0x4e3fb7[_0x8c78('0xb7')]}:_0x4e3fb7);});};function createFieldObject(_0x5c3521,_0x41e4d8,_0xa83483,_0x5bd27d,_0x4e14ee,_0x44a956){return new Promise(function(_0x592c32,_0x5e11b0){var _0xb35ea0={'id':_0x5bd27d,'name':_0x4e14ee,'custom':_0x44a956};if(_0xa83483===_0x8c78('0xb9')){_0xb35ea0['options']=[{'name':_0x8c78('0xba'),'value':_0x8c78('0xbb')},{'name':'False','value':_0x8c78('0xbc')}];_0x592c32(_0xb35ea0);}else{var _0xfd9068={'method':'GET','uri':_0x5c3521+_0x8c78('0xbd')+_0x5bd27d,'auth':_0x41e4d8,'json':!![]};return rp(_0xfd9068)[_0x8c78('0x30')](function(_0x70e87f){var _0x3727a8=[];if(_0x70e87f['result'][_0x8c78('0x40')]>0x0){_0x70e87f[_0x8c78('0xa8')]['forEach'](function(_0x175ae7){if(_0x175ae7['inactive']===_0x8c78('0xbc')){var _0x177a50={'name':_0x175ae7[_0x8c78('0xaf')],'value':_0x175ae7[_0x8c78('0xbe')]};_0x3727a8[_0x8c78('0xb0')](_0x177a50);}});}_0xb35ea0[_0x8c78('0x49')]=_0x3727a8;if(_0xb35ea0[_0x8c78('0x49')][_0x8c78('0x40')]>0x0){_0x592c32(_0xb35ea0);}else{if(_0x44a956==![]){_0x592c32();}else{_0x592c32(_0xb35ea0);}}});}});}
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js
index 87664f5..e13b0b5 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 _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
+var _0x3a4c=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','lodash','util','api','moment','bluebird','request-promise'];(function(_0xa2c0a3,_0x5bbac0){var _0x52c618=function(_0x20f7fd){while(--_0x20f7fd){_0xa2c0a3['push'](_0xa2c0a3['shift']());}};_0x52c618(++_0x5bbac0);}(_0x3a4c,0xe4));var _0xc3a4=function(_0xddbe4b,_0xbd131c){_0xddbe4b=_0xddbe4b-0x0;var _0x222a24=_0x3a4c[_0xddbe4b];return _0x222a24;};'use strict';var _=require(_0xc3a4('0x0'));var util=require(_0xc3a4('0x1'));var logger=require('../../config/logger')(_0xc3a4('0x2'));var moment=require(_0xc3a4('0x3'));var BPromise=require(_0xc3a4('0x4'));var rp=require(_0xc3a4('0x5'));var fs=require('fs');var path=require(_0xc3a4('0x6'));var rimraf=require(_0xc3a4('0x7'));var config=require(_0xc3a4('0x8'));var attributes=require(_0xc3a4('0x9'));var integrations=require(_0xc3a4('0xa'));module['exports']=function(_0xdebc20,_0xbde53a){return _0xdebc20[_0xc3a4('0xb')](_0xc3a4('0xc'),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 b4c6cd6..0c6ed08 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 _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
+var _0xb235=['message','catch','GetServicenowAccount','findAll','raw','options','where','attributes','limit','include','map','model','debug','ShowServicenowAccount','ServicenowAccount','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowAccount,\x20%s,\x20%s'];(function(_0x556757,_0x54da56){var _0x14852c=function(_0x22e67a){while(--_0x22e67a){_0x556757['push'](_0x556757['shift']());}};_0x14852c(++_0x54da56);}(_0xb235,0xd5));var _0x5b23=function(_0x5d8631,_0x44944b){_0x5d8631=_0x5d8631-0x0;var _0x34c15e=_0xb235[_0x5d8631];return _0x34c15e;};'use strict';var _=require(_0x5b23('0x0'));var util=require(_0x5b23('0x1'));var moment=require('moment');var BPromise=require(_0x5b23('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b23('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5b23('0x4'));var logger=require(_0x5b23('0x5'))(_0x5b23('0x6'));var config=require(_0x5b23('0x7'));var jayson=require(_0x5b23('0x8'));var client=jayson[_0x5b23('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1733d7,_0xb6ea1f,_0x6d0f5f){return new BPromise(function(_0x460d7d,_0x2f1eb6){return client[_0x5b23('0xa')](_0x1733d7,_0x6d0f5f)[_0x5b23('0xb')](function(_0x4ab99f){logger[_0x5b23('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0xb6ea1f,_0x5b23('0xd'));logger['debug'](_0x5b23('0xe'),_0xb6ea1f,_0x5b23('0xd'),JSON[_0x5b23('0xf')](_0x4ab99f));if(_0x4ab99f[_0x5b23('0x10')]){if(_0x4ab99f[_0x5b23('0x10')]['code']===0x1f4){logger[_0x5b23('0x10')](_0x5b23('0x11'),_0xb6ea1f,_0x4ab99f[_0x5b23('0x10')][_0x5b23('0x12')]);return _0x2f1eb6(_0x4ab99f['error'][_0x5b23('0x12')]);}logger[_0x5b23('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0xb6ea1f,_0x4ab99f[_0x5b23('0x10')]['message']);return _0x460d7d(_0x4ab99f[_0x5b23('0x10')]['message']);}else{logger[_0x5b23('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0xb6ea1f,_0x5b23('0xd'));_0x460d7d(_0x4ab99f['result'][_0x5b23('0x12')]);}})[_0x5b23('0x13')](function(_0x40e885){logger[_0x5b23('0x10')](_0x5b23('0x11'),_0xb6ea1f,_0x40e885);_0x2f1eb6(_0x40e885);});});}exports[_0x5b23('0x14')]=function(_0x49b8a6){var _0x39f379=this;return new Promise(function(_0x469a69,_0x3c8834){return db['ServicenowAccount'][_0x5b23('0x15')]({'raw':_0x49b8a6['options']?_0x49b8a6['options'][_0x5b23('0x16')]===undefined?!![]:![]:!![],'where':_0x49b8a6[_0x5b23('0x17')]?_0x49b8a6[_0x5b23('0x17')][_0x5b23('0x18')]||null:null,'attributes':_0x49b8a6[_0x5b23('0x17')]?_0x49b8a6[_0x5b23('0x17')][_0x5b23('0x19')]||null:null,'limit':_0x49b8a6['options']?_0x49b8a6[_0x5b23('0x17')][_0x5b23('0x1a')]||null:null,'include':_0x49b8a6[_0x5b23('0x17')]?_0x49b8a6[_0x5b23('0x17')][_0x5b23('0x1b')]?_[_0x5b23('0x1c')](_0x49b8a6[_0x5b23('0x17')][_0x5b23('0x1b')],function(_0x5cce85){return{'model':db[_0x5cce85[_0x5b23('0x1d')]],'as':_0x5cce85['as'],'attributes':_0x5cce85[_0x5b23('0x19')],'include':_0x5cce85[_0x5b23('0x1b')]?_[_0x5b23('0x1c')](_0x5cce85[_0x5b23('0x1b')],function(_0x3a127e){return{'model':db[_0x3a127e['model']],'as':_0x3a127e['as'],'attributes':_0x3a127e[_0x5b23('0x19')],'include':_0x3a127e[_0x5b23('0x1b')]?_['map'](_0x3a127e['include'],function(_0x4d10bc){return{'model':db[_0x4d10bc[_0x5b23('0x1d')]],'as':_0x4d10bc['as'],'attributes':_0x4d10bc[_0x5b23('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5b23('0xb')](function(_0x4cb7c3){logger[_0x5b23('0xc')]('GetServicenowAccount',_0x49b8a6);logger[_0x5b23('0x1e')]('GetServicenowAccount',_0x49b8a6,JSON[_0x5b23('0xf')](_0x4cb7c3));_0x469a69(_0x4cb7c3);})[_0x5b23('0x13')](function(_0x1e41d9){logger[_0x5b23('0x10')](_0x5b23('0x14'),_0x1e41d9[_0x5b23('0x12')],_0x49b8a6);_0x3c8834(_0x39f379[_0x5b23('0x10')](0x1f4,_0x1e41d9[_0x5b23('0x12')]));});});};exports[_0x5b23('0x1f')]=function(_0xdcc31d){var _0xb02a52=this;return new Promise(function(_0x3e446d,_0x371a23){return db[_0x5b23('0x20')]['find']({'raw':_0xdcc31d['options']?_0xdcc31d[_0x5b23('0x17')][_0x5b23('0x16')]===undefined?!![]:![]:!![],'where':_0xdcc31d['options']?_0xdcc31d[_0x5b23('0x17')][_0x5b23('0x18')]||null:null,'attributes':_0xdcc31d[_0x5b23('0x17')]?_0xdcc31d[_0x5b23('0x17')][_0x5b23('0x19')]||null:null,'include':_0xdcc31d[_0x5b23('0x17')]?_0xdcc31d[_0x5b23('0x17')]['include']?_['map'](_0xdcc31d[_0x5b23('0x17')][_0x5b23('0x1b')],function(_0x3f41d7){return{'model':db[_0x3f41d7['model']],'as':_0x3f41d7['as'],'attributes':_0x3f41d7[_0x5b23('0x19')],'include':_0x3f41d7[_0x5b23('0x1b')]?_[_0x5b23('0x1c')](_0x3f41d7[_0x5b23('0x1b')],function(_0x176d5b){return{'model':db[_0x176d5b[_0x5b23('0x1d')]],'as':_0x176d5b['as'],'attributes':_0x176d5b['attributes'],'include':_0x176d5b[_0x5b23('0x1b')]?_[_0x5b23('0x1c')](_0x176d5b[_0x5b23('0x1b')],function(_0x222767){return{'model':db[_0x222767[_0x5b23('0x1d')]],'as':_0x222767['as'],'attributes':_0x222767[_0x5b23('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5b23('0xb')](function(_0xa403c1){logger[_0x5b23('0xc')](_0x5b23('0x1f'),_0xdcc31d);logger[_0x5b23('0x1e')]('ShowServicenowAccount',_0xdcc31d,JSON[_0x5b23('0xf')](_0xa403c1));_0x3e446d(_0xa403c1);})['catch'](function(_0x4d85b7){logger[_0x5b23('0x10')]('ShowServicenowAccount',_0x4d85b7['message'],_0xdcc31d);_0x371a23(_0xb02a52['error'](0x1f4,_0x4d85b7[_0x5b23('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js
index 81cc01e..b17baba 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 _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
+var _0xfc9b=['/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x70b273,_0x34c5a0){var _0x72ac98=function(_0xcc7e43){while(--_0xcc7e43){_0x70b273['push'](_0x70b273['shift']());}};_0x72ac98(++_0x34c5a0);}(_0xfc9b,0xd7));var _0xbfc9=function(_0x381b96,_0x2a7f5d){_0x381b96=_0x381b96-0x0;var _0x222fcd=_0xfc9b[_0x381b96];return _0x222fcd;};'use strict';var multer=require(_0xbfc9('0x0'));var util=require(_0xbfc9('0x1'));var path=require(_0xbfc9('0x2'));var timeout=require(_0xbfc9('0x3'));var express=require(_0xbfc9('0x4'));var router=express[_0xbfc9('0x5')]();var auth=require(_0xbfc9('0x6'));var interaction=require(_0xbfc9('0x7'));var config=require(_0xbfc9('0x8'));var controller=require(_0xbfc9('0x9'));router[_0xbfc9('0xa')]('/',auth[_0xbfc9('0xb')](),controller[_0xbfc9('0xc')]);router[_0xbfc9('0xa')](_0xbfc9('0xd'),auth[_0xbfc9('0xb')](),controller[_0xbfc9('0xe')]);router[_0xbfc9('0xa')](_0xbfc9('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xbfc9('0xa')](_0xbfc9('0x10'),auth[_0xbfc9('0xb')](),controller[_0xbfc9('0x11')]);router[_0xbfc9('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xbfc9('0x12')]);router[_0xbfc9('0x13')]('/',auth[_0xbfc9('0xb')](),controller['create']);router[_0xbfc9('0x14')](_0xbfc9('0xd'),auth[_0xbfc9('0xb')](),controller['update']);router[_0xbfc9('0x15')](_0xbfc9('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xbfc9('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
index 0c7feff..af8f268 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 _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
+var _0xd8d6=['sequelize','exports','STRING'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0xd8d6,0x9f));var _0x6d8d=function(_0x20020a,_0x2e8f87){_0x20020a=_0x20020a-0x0;var _0x3ab313=_0xd8d6[_0x20020a];return _0x3ab313;};'use strict';var Sequelize=require(_0x6d8d('0x0'));module[_0x6d8d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6d8d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
index 818968e..8c4230a 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 _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
+var _0x5c00=['mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','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','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowConfiguration,\x20%s,\x20%s','result','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','sendStatus','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','show','params','intersection','options','catch','create','body','find','getFields','findOne','getSubjects','getDescriptions','ServicenowField','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird'];(function(_0xee6a6a,_0x4e67ce){var _0x206012=function(_0x3cee2a){while(--_0x3cee2a){_0xee6a6a['push'](_0xee6a6a['shift']());}};_0x206012(++_0x4e67ce);}(_0x5c00,0x17e));var _0x05c0=function(_0x1418a5,_0x19c106){_0x1418a5=_0x1418a5-0x0;var _0x22c849=_0x5c00[_0x1418a5];return _0x22c849;};'use strict';var pdf=require(_0x05c0('0x0'));var emlformat=require(_0x05c0('0x1'));var rimraf=require(_0x05c0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x05c0('0x3'));var rp=require('request-promise');var moment=require(_0x05c0('0x4'));var BPromise=require(_0x05c0('0x5'));var Mustache=require(_0x05c0('0x6'));var util=require(_0x05c0('0x7'));var path=require('path');var sox=require(_0x05c0('0x8'));var csv=require(_0x05c0('0x9'));var ejs=require(_0x05c0('0xa'));var fs=require('fs');var _=require(_0x05c0('0xb'));var squel=require('squel');var crypto=require(_0x05c0('0xc'));var jsforce=require(_0x05c0('0xd'));var deskjs=require(_0x05c0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x05c0('0xf'));var Papa=require(_0x05c0('0x10'));var Redis=require(_0x05c0('0x11'));var authService=require(_0x05c0('0x12'));var qs=require(_0x05c0('0x13'));var as=require(_0x05c0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x05c0('0x15'));var utils=require('../../config/utils');var config=require(_0x05c0('0x16'));var db=require(_0x05c0('0x17'))['db'];var jayson=require(_0x05c0('0x18'));var client=jayson['client'][_0x05c0('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5eec41,_0x16a290,_0x49e07e){if(_0x49e07e){var _0x20ff48=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20ff48[_0x05c0('0x1a')](_0x16a290)){return _0x5eec41;}else{throw new db[(_0x05c0('0x1b'))][(_0x05c0('0x1c'))](_0x05c0('0x1d'));}}else{return _0x5eec41;}}function respondWithRpcPromise(_0xd7b487,_0x4c3e54,_0x238e25,_0x161a5f){return new BPromise(function(_0x4bb164,_0x29e6b0){var _0x27c7bd=_0x161a5f||client;return _0x27c7bd[_0x05c0('0x1e')](_0xd7b487,_0x238e25)[_0x05c0('0x1f')](function(_0xd07ad1){logger[_0x05c0('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4c3e54,_0x05c0('0x21'));logger[_0x05c0('0x22')](_0x05c0('0x23'),_0x4c3e54,'request\x20sent',JSON[_0x05c0('0x24')](_0xd07ad1));if(_0xd07ad1[_0x05c0('0x25')]){if(_0xd07ad1[_0x05c0('0x25')][_0x05c0('0x26')]===0x1f4){logger[_0x05c0('0x25')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4c3e54,_0xd07ad1[_0x05c0('0x25')][_0x05c0('0x27')]);return _0x29e6b0(_0xd07ad1['error']['message']);}logger['error'](_0x05c0('0x28'),_0x4c3e54,_0xd07ad1[_0x05c0('0x25')][_0x05c0('0x27')]);return _0x4bb164(_0xd07ad1[_0x05c0('0x25')][_0x05c0('0x27')]);}else{logger[_0x05c0('0x20')](_0x05c0('0x28'),_0x4c3e54,'request\x20sent');_0x4bb164(_0xd07ad1[_0x05c0('0x29')][_0x05c0('0x27')]);}})['catch'](function(_0x530966){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x4c3e54,_0x530966);_0x29e6b0(_0x530966);});});}function respondWithStatusCode(_0x56aa78,_0x3df135){_0x3df135=_0x3df135||0xcc;return function(_0x15b497){if(_0x15b497){return _0x56aa78['sendStatus'](_0x3df135);}return _0x56aa78[_0x05c0('0x2a')](_0x3df135)[_0x05c0('0x2b')]();};}function respondWithResult(_0x3617dc,_0x889c75){_0x889c75=_0x889c75||0xc8;return function(_0x58769a){if(_0x58769a){return _0x3617dc[_0x05c0('0x2a')](_0x889c75)[_0x05c0('0x2c')](_0x58769a);}};}function respondWithFilteredResult(_0x2ceaed,_0x200e80){return function(_0x216a5c){if(_0x216a5c){var _0x5d12e0=_0x216a5c[_0x05c0('0x2d')],_0x57886b=_0x200e80[_0x05c0('0x2e')],_0x56ba64=_0x200e80[_0x05c0('0x2e')]+_0x200e80[_0x05c0('0x2f')],_0x2df109;if(_0x56ba64>=_0x5d12e0){_0x56ba64=_0x5d12e0;_0x2df109=0xc8;}else{_0x2df109=0xce;}_0x2ceaed[_0x05c0('0x2a')](_0x2df109);return _0x2ceaed[_0x05c0('0x30')](_0x05c0('0x31'),_0x57886b+'-'+_0x56ba64+'/'+_0x5d12e0)[_0x05c0('0x2c')](_0x216a5c);}return null;};}function patchUpdates(_0x87b07c){return function(_0x3e38f0){try{jsonpatch[_0x05c0('0x32')](_0x3e38f0,_0x87b07c,!![]);}catch(_0x50f03d){return BPromise['reject'](_0x50f03d);}return _0x3e38f0[_0x05c0('0x33')]();};}function saveUpdates(_0x31b0b8,_0x861027){return function(_0x5c652f){if(_0x5c652f){return _0x5c652f[_0x05c0('0x34')](_0x31b0b8)[_0x05c0('0x1f')](function(_0x4b0ea1){return _0x4b0ea1;});}return null;};}function removeEntity(_0x25936a,_0x4e923d){return function(_0x3d81bb){if(_0x3d81bb){return _0x3d81bb[_0x05c0('0x35')]()[_0x05c0('0x1f')](function(){_0x25936a[_0x05c0('0x2a')](0xcc)[_0x05c0('0x2b')]();});}};}function handleEntityNotFound(_0x2a9e82,_0x3dfacc){return function(_0x9da3fa){if(!_0x9da3fa){_0x2a9e82[_0x05c0('0x36')](0x194);}return _0x9da3fa;};}function handleError(_0x3a72c2,_0x39d783){_0x39d783=_0x39d783||0x1f4;return function(_0x3a9c63){logger[_0x05c0('0x25')](_0x3a9c63[_0x05c0('0x37')]);if(_0x3a9c63[_0x05c0('0x38')]){delete _0x3a9c63[_0x05c0('0x38')];}_0x3a72c2[_0x05c0('0x2a')](_0x39d783)[_0x05c0('0x39')](_0x3a9c63);};}exports[_0x05c0('0x3a')]=function(_0x1faa63,_0x3d1bae){var _0x337847={},_0x9ca737={},_0x285422={'count':0x0,'rows':[]};var _0x3d3291=_[_0x05c0('0x3b')](db[_0x05c0('0x3c')][_0x05c0('0x3d')],function(_0x40d4db){return{'name':_0x40d4db[_0x05c0('0x3e')],'type':_0x40d4db[_0x05c0('0x3f')][_0x05c0('0x40')]};});_0x9ca737[_0x05c0('0x41')]=_['map'](_0x3d3291,_0x05c0('0x38'));_0x9ca737[_0x05c0('0x42')]=_[_0x05c0('0x43')](_0x1faa63[_0x05c0('0x42')]);_0x9ca737['filters']=_['intersection'](_0x9ca737[_0x05c0('0x41')],_0x9ca737[_0x05c0('0x42')]);_0x337847[_0x05c0('0x44')]=_['intersection'](_0x9ca737[_0x05c0('0x41')],qs[_0x05c0('0x45')](_0x1faa63[_0x05c0('0x42')][_0x05c0('0x45')]));_0x337847['attributes']=_0x337847[_0x05c0('0x44')][_0x05c0('0x46')]?_0x337847['attributes']:_0x9ca737[_0x05c0('0x41')];if(!_0x1faa63[_0x05c0('0x42')][_0x05c0('0x47')](_0x05c0('0x48'))){_0x337847[_0x05c0('0x2f')]=qs[_0x05c0('0x2f')](_0x1faa63[_0x05c0('0x42')]['limit']);_0x337847['offset']=qs[_0x05c0('0x2e')](_0x1faa63[_0x05c0('0x42')][_0x05c0('0x2e')]);}_0x337847[_0x05c0('0x49')]=qs[_0x05c0('0x4a')](_0x1faa63['query'][_0x05c0('0x4a')]);_0x337847[_0x05c0('0x4b')]=qs[_0x05c0('0x4c')](_[_0x05c0('0x4d')](_0x1faa63[_0x05c0('0x42')],_0x9ca737[_0x05c0('0x4c')]),_0x3d3291);if(_0x1faa63[_0x05c0('0x42')]['filter']){_0x337847[_0x05c0('0x4b')]=_[_0x05c0('0x4e')](_0x337847[_0x05c0('0x4b')],{'$or':_[_0x05c0('0x3b')](_0x3d3291,function(_0x4396df){if(_0x4396df[_0x05c0('0x3f')]!==_0x05c0('0x4f')){var _0x42835d={};_0x42835d[_0x4396df[_0x05c0('0x38')]]={'$like':'%'+_0x1faa63[_0x05c0('0x42')][_0x05c0('0x50')]+'%'};return _0x42835d;}})});}_0x337847=_['merge']({},_0x337847,_0x1faa63['options']);var _0x2e3f47={'where':_0x337847[_0x05c0('0x4b')]};return db[_0x05c0('0x3c')][_0x05c0('0x2d')](_0x2e3f47)[_0x05c0('0x1f')](function(_0x856372){_0x285422['count']=_0x856372;if(_0x1faa63[_0x05c0('0x42')][_0x05c0('0x51')]){_0x337847[_0x05c0('0x52')]=[{'all':!![]}];}return db[_0x05c0('0x3c')]['findAll'](_0x337847);})[_0x05c0('0x1f')](function(_0x2440e8){_0x285422[_0x05c0('0x53')]=_0x2440e8;return _0x285422;})[_0x05c0('0x1f')](respondWithFilteredResult(_0x3d1bae,_0x337847))['catch'](handleError(_0x3d1bae,null));};exports[_0x05c0('0x54')]=function(_0x39e6ad,_0x2e5660){var _0x9b521b={'raw':![],'where':{'id':_0x39e6ad[_0x05c0('0x55')]['id']}},_0x5ef6cf={};_0x5ef6cf[_0x05c0('0x41')]=_['keys'](db[_0x05c0('0x3c')]['rawAttributes']);_0x5ef6cf['query']=_[_0x05c0('0x43')](_0x39e6ad['query']);_0x5ef6cf[_0x05c0('0x4c')]=_[_0x05c0('0x56')](_0x5ef6cf[_0x05c0('0x41')],_0x5ef6cf[_0x05c0('0x42')]);_0x9b521b[_0x05c0('0x44')]=_[_0x05c0('0x56')](_0x5ef6cf['model'],qs[_0x05c0('0x45')](_0x39e6ad['query'][_0x05c0('0x45')]));_0x9b521b[_0x05c0('0x44')]=_0x9b521b[_0x05c0('0x44')][_0x05c0('0x46')]?_0x9b521b[_0x05c0('0x44')]:_0x5ef6cf[_0x05c0('0x41')];if(_0x39e6ad[_0x05c0('0x42')]['includeAll']){_0x9b521b['include']=[{'all':!![]}];}_0x9b521b=_['merge']({},_0x9b521b,_0x39e6ad[_0x05c0('0x57')]);return db[_0x05c0('0x3c')]['find'](_0x9b521b)['then'](handleEntityNotFound(_0x2e5660,null))[_0x05c0('0x1f')](respondWithResult(_0x2e5660,null))[_0x05c0('0x58')](handleError(_0x2e5660,null));};exports[_0x05c0('0x59')]=function(_0xbe455d,_0x1a3dcd){return db[_0x05c0('0x3c')][_0x05c0('0x59')](_0xbe455d['body'],{})[_0x05c0('0x1f')](respondWithResult(_0x1a3dcd,0xc9))[_0x05c0('0x58')](handleError(_0x1a3dcd,null));};exports[_0x05c0('0x34')]=function(_0x179e5a,_0x4b5e1f){if(_0x179e5a[_0x05c0('0x5a')]['id']){delete _0x179e5a['body']['id'];}return db[_0x05c0('0x3c')][_0x05c0('0x5b')]({'where':{'id':_0x179e5a['params']['id']}})[_0x05c0('0x1f')](handleEntityNotFound(_0x4b5e1f,null))['then'](saveUpdates(_0x179e5a[_0x05c0('0x5a')],null))[_0x05c0('0x1f')](respondWithResult(_0x4b5e1f,null))[_0x05c0('0x58')](handleError(_0x4b5e1f,null));};exports[_0x05c0('0x35')]=function(_0x371ba8,_0x2226e3){return db['ServicenowConfiguration'][_0x05c0('0x5b')]({'where':{'id':_0x371ba8[_0x05c0('0x55')]['id']}})[_0x05c0('0x1f')](handleEntityNotFound(_0x2226e3,null))[_0x05c0('0x1f')](removeEntity(_0x2226e3,null))[_0x05c0('0x58')](handleError(_0x2226e3,null));};exports[_0x05c0('0x5c')]=function(_0x58c7bc,_0x284650,_0x2dff63){var _0x1dd246={};var _0x41de8c={};var _0x1584a3;var _0x16288c;return db[_0x05c0('0x3c')][_0x05c0('0x5d')]({'where':{'id':_0x58c7bc[_0x05c0('0x55')]['id']}})[_0x05c0('0x1f')](handleEntityNotFound(_0x284650,null))[_0x05c0('0x1f')](function(_0x376618){if(_0x376618){_0x1584a3=_0x376618;_0x41de8c['model']=_['keys'](db['ServicenowField'][_0x05c0('0x3d')]);_0x41de8c[_0x05c0('0x42')]=_[_0x05c0('0x43')](_0x58c7bc['query']);_0x41de8c[_0x05c0('0x4c')]=_[_0x05c0('0x56')](_0x41de8c[_0x05c0('0x41')],_0x41de8c[_0x05c0('0x42')]);_0x1dd246[_0x05c0('0x44')]=_[_0x05c0('0x56')](_0x41de8c[_0x05c0('0x41')],qs['fields'](_0x58c7bc[_0x05c0('0x42')][_0x05c0('0x45')]));_0x1dd246[_0x05c0('0x44')]=_0x1dd246[_0x05c0('0x44')]['length']?_0x1dd246['attributes']:_0x41de8c['model'];_0x1dd246[_0x05c0('0x49')]=qs[_0x05c0('0x4a')](_0x58c7bc[_0x05c0('0x42')][_0x05c0('0x4a')]);_0x1dd246[_0x05c0('0x4b')]=qs[_0x05c0('0x4c')](_[_0x05c0('0x4d')](_0x58c7bc['query'],_0x41de8c[_0x05c0('0x4c')]));if(_0x58c7bc[_0x05c0('0x42')][_0x05c0('0x50')]){_0x1dd246[_0x05c0('0x4b')]=_[_0x05c0('0x4e')](_0x1dd246['where'],{'$or':_['map'](_0x1dd246[_0x05c0('0x44')],function(_0x204706){var _0x50bcf1={};_0x50bcf1[_0x204706]={'$like':'%'+_0x58c7bc[_0x05c0('0x42')]['filter']+'%'};return _0x50bcf1;})});}_0x1dd246=_['merge']({},_0x1dd246,_0x58c7bc[_0x05c0('0x57')]);return _0x1584a3[_0x05c0('0x5c')](_0x1dd246);}})[_0x05c0('0x1f')](function(_0x50725c){if(_0x50725c){_0x16288c=_0x50725c['length'];if(!_0x58c7bc[_0x05c0('0x42')][_0x05c0('0x47')](_0x05c0('0x48'))){_0x1dd246['limit']=qs['limit'](_0x58c7bc['query']['limit']);_0x1dd246['offset']=qs[_0x05c0('0x2e')](_0x58c7bc['query']['offset']);}return _0x1584a3['getFields'](_0x1dd246);}})[_0x05c0('0x1f')](function(_0x1a6dc4){if(_0x1a6dc4){return _0x1a6dc4?{'count':_0x16288c,'rows':_0x1a6dc4}:null;}})[_0x05c0('0x1f')](respondWithResult(_0x284650,null))['catch'](handleError(_0x284650,null));};exports[_0x05c0('0x5e')]=function(_0x1820ac,_0x500e3a,_0x2ac43c){var _0x1830dc={};var _0x17ed82={};var _0x3048f3;var _0x4a32c4;return db[_0x05c0('0x3c')][_0x05c0('0x5d')]({'where':{'id':_0x1820ac[_0x05c0('0x55')]['id']}})[_0x05c0('0x1f')](handleEntityNotFound(_0x500e3a,null))[_0x05c0('0x1f')](function(_0x570168){if(_0x570168){_0x3048f3=_0x570168;_0x17ed82['model']=_[_0x05c0('0x43')](db['ServicenowField'][_0x05c0('0x3d')]);_0x17ed82[_0x05c0('0x42')]=_['keys'](_0x1820ac[_0x05c0('0x42')]);_0x17ed82['filters']=_['intersection'](_0x17ed82['model'],_0x17ed82['query']);_0x1830dc[_0x05c0('0x44')]=_[_0x05c0('0x56')](_0x17ed82[_0x05c0('0x41')],qs[_0x05c0('0x45')](_0x1820ac['query'][_0x05c0('0x45')]));_0x1830dc[_0x05c0('0x44')]=_0x1830dc[_0x05c0('0x44')][_0x05c0('0x46')]?_0x1830dc[_0x05c0('0x44')]:_0x17ed82['model'];_0x1830dc[_0x05c0('0x49')]=qs['sort'](_0x1820ac['query'][_0x05c0('0x4a')]);_0x1830dc[_0x05c0('0x4b')]=qs[_0x05c0('0x4c')](_[_0x05c0('0x4d')](_0x1820ac[_0x05c0('0x42')],_0x17ed82[_0x05c0('0x4c')]));if(_0x1820ac['query']['filter']){_0x1830dc[_0x05c0('0x4b')]=_[_0x05c0('0x4e')](_0x1830dc[_0x05c0('0x4b')],{'$or':_['map'](_0x1830dc[_0x05c0('0x44')],function(_0x7c5ce6){var _0x1cba99={};_0x1cba99[_0x7c5ce6]={'$like':'%'+_0x1820ac[_0x05c0('0x42')][_0x05c0('0x50')]+'%'};return _0x1cba99;})});}_0x1830dc=_[_0x05c0('0x4e')]({},_0x1830dc,_0x1820ac['options']);return _0x3048f3[_0x05c0('0x5e')](_0x1830dc);}})[_0x05c0('0x1f')](function(_0x4be0bf){if(_0x4be0bf){_0x4a32c4=_0x4be0bf[_0x05c0('0x46')];if(!_0x1820ac[_0x05c0('0x42')]['hasOwnProperty'](_0x05c0('0x48'))){_0x1830dc[_0x05c0('0x2f')]=qs[_0x05c0('0x2f')](_0x1820ac[_0x05c0('0x42')][_0x05c0('0x2f')]);_0x1830dc[_0x05c0('0x2e')]=qs['offset'](_0x1820ac[_0x05c0('0x42')]['offset']);}return _0x3048f3[_0x05c0('0x5e')](_0x1830dc);}})[_0x05c0('0x1f')](function(_0x12ddfb){if(_0x12ddfb){return _0x12ddfb?{'count':_0x4a32c4,'rows':_0x12ddfb}:null;}})[_0x05c0('0x1f')](respondWithResult(_0x500e3a,null))[_0x05c0('0x58')](handleError(_0x500e3a,null));};exports[_0x05c0('0x5f')]=function(_0x28ce96,_0xe1a739,_0x2de8b3){var _0x39c847={};var _0x5f015a={};var _0x23c221;var _0x4f920f;return db[_0x05c0('0x3c')]['findOne']({'where':{'id':_0x28ce96[_0x05c0('0x55')]['id']}})[_0x05c0('0x1f')](handleEntityNotFound(_0xe1a739,null))[_0x05c0('0x1f')](function(_0xaad786){if(_0xaad786){_0x23c221=_0xaad786;_0x5f015a[_0x05c0('0x41')]=_[_0x05c0('0x43')](db[_0x05c0('0x60')][_0x05c0('0x3d')]);_0x5f015a[_0x05c0('0x42')]=_['keys'](_0x28ce96['query']);_0x5f015a[_0x05c0('0x4c')]=_[_0x05c0('0x56')](_0x5f015a[_0x05c0('0x41')],_0x5f015a[_0x05c0('0x42')]);_0x39c847[_0x05c0('0x44')]=_[_0x05c0('0x56')](_0x5f015a[_0x05c0('0x41')],qs['fields'](_0x28ce96[_0x05c0('0x42')]['fields']));_0x39c847[_0x05c0('0x44')]=_0x39c847['attributes'][_0x05c0('0x46')]?_0x39c847['attributes']:_0x5f015a[_0x05c0('0x41')];_0x39c847[_0x05c0('0x49')]=qs['sort'](_0x28ce96[_0x05c0('0x42')]['sort']);_0x39c847['where']=qs[_0x05c0('0x4c')](_[_0x05c0('0x4d')](_0x28ce96[_0x05c0('0x42')],_0x5f015a[_0x05c0('0x4c')]));if(_0x28ce96[_0x05c0('0x42')][_0x05c0('0x50')]){_0x39c847[_0x05c0('0x4b')]=_['merge'](_0x39c847['where'],{'$or':_['map'](_0x39c847['attributes'],function(_0x55e330){var _0x16ae0f={};_0x16ae0f[_0x55e330]={'$like':'%'+_0x28ce96[_0x05c0('0x42')][_0x05c0('0x50')]+'%'};return _0x16ae0f;})});}_0x39c847=_[_0x05c0('0x4e')]({},_0x39c847,_0x28ce96['options']);return _0x23c221[_0x05c0('0x5f')](_0x39c847);}})[_0x05c0('0x1f')](function(_0x303be3){if(_0x303be3){_0x4f920f=_0x303be3[_0x05c0('0x46')];if(!_0x28ce96[_0x05c0('0x42')][_0x05c0('0x47')](_0x05c0('0x48'))){_0x39c847[_0x05c0('0x2f')]=qs[_0x05c0('0x2f')](_0x28ce96['query'][_0x05c0('0x2f')]);_0x39c847['offset']=qs[_0x05c0('0x2e')](_0x28ce96['query'][_0x05c0('0x2e')]);}return _0x23c221[_0x05c0('0x5f')](_0x39c847);}})['then'](function(_0x2273eb){if(_0x2273eb){return _0x2273eb?{'count':_0x4f920f,'rows':_0x2273eb}:null;}})[_0x05c0('0x1f')](respondWithResult(_0xe1a739,null))['catch'](handleError(_0xe1a739,null));};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
index a48a0ad..51cf1b6 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 _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
+var _0x6e9b=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x454e37,_0x39016d){var _0xf78f57=function(_0x4cc363){while(--_0x4cc363){_0x454e37['push'](_0x454e37['shift']());}};_0xf78f57(++_0x39016d);}(_0x6e9b,0xea));var _0xb6e9=function(_0xb5514c,_0x4fe280){_0xb5514c=_0xb5514c-0x0;var _0x27d7a8=_0x6e9b[_0xb5514c];return _0x27d7a8;};'use strict';var _=require(_0xb6e9('0x0'));var util=require(_0xb6e9('0x1'));var logger=require(_0xb6e9('0x2'))(_0xb6e9('0x3'));var moment=require(_0xb6e9('0x4'));var BPromise=require('bluebird');var rp=require(_0xb6e9('0x5'));var fs=require('fs');var path=require(_0xb6e9('0x6'));var rimraf=require(_0xb6e9('0x7'));var config=require('../../config/environment');var attributes=require(_0xb6e9('0x8'));module[_0xb6e9('0x9')]=function(_0x2bdfb8,_0x6b0286){return _0x2bdfb8[_0xb6e9('0xa')](_0xb6e9('0xb'),attributes,{'tableName':_0xb6e9('0xc'),'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 cce7e9d..da08aee 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 _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
+var _0x7e9a=['message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x12a06b,_0x417b51){var _0x5d0bb8=function(_0x41d3d0){while(--_0x41d3d0){_0x12a06b['push'](_0x12a06b['shift']());}};_0x5d0bb8(++_0x417b51);}(_0x7e9a,0x127));var _0xa7e9=function(_0x41fff6,_0x42aa8d){_0x41fff6=_0x41fff6-0x0;var _0x2ddf19=_0x7e9a[_0x41fff6];return _0x2ddf19;};'use strict';var _=require('lodash');var util=require(_0xa7e9('0x0'));var moment=require(_0xa7e9('0x1'));var BPromise=require(_0xa7e9('0x2'));var rs=require(_0xa7e9('0x3'));var fs=require('fs');var Redis=require(_0xa7e9('0x4'));var db=require(_0xa7e9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7e9('0x6'))(_0xa7e9('0x7'));var config=require('../../config/environment');var jayson=require(_0xa7e9('0x8'));var client=jayson['client'][_0xa7e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56d0a8,_0x30b6e2,_0x54f0be){return new BPromise(function(_0xe00e4a,_0x2da73c){return client[_0xa7e9('0xa')](_0x56d0a8,_0x54f0be)[_0xa7e9('0xb')](function(_0x44410e){logger[_0xa7e9('0xc')](_0xa7e9('0xd'),_0x30b6e2,_0xa7e9('0xe'));logger[_0xa7e9('0xf')](_0xa7e9('0x10'),_0x30b6e2,_0xa7e9('0xe'),JSON[_0xa7e9('0x11')](_0x44410e));if(_0x44410e['error']){if(_0x44410e['error'][_0xa7e9('0x12')]===0x1f4){logger[_0xa7e9('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x30b6e2,_0x44410e[_0xa7e9('0x13')][_0xa7e9('0x14')]);return _0x2da73c(_0x44410e[_0xa7e9('0x13')][_0xa7e9('0x14')]);}logger[_0xa7e9('0x13')](_0xa7e9('0xd'),_0x30b6e2,_0x44410e[_0xa7e9('0x13')][_0xa7e9('0x14')]);return _0xe00e4a(_0x44410e['error'][_0xa7e9('0x14')]);}else{logger[_0xa7e9('0xc')](_0xa7e9('0xd'),_0x30b6e2,_0xa7e9('0xe'));_0xe00e4a(_0x44410e['result'][_0xa7e9('0x14')]);}})['catch'](function(_0x13d419){logger[_0xa7e9('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x30b6e2,_0x13d419);_0x2da73c(_0x13d419);});});}
\ No newline at end of file
diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js
index f834c36..5ffdd1e 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 _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
+var _0xc8a0=['show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0xc8a0,0xf7));var _0x0c8a=function(_0x31d3c3,_0x5279a3){_0x31d3c3=_0x31d3c3-0x0;var _0x58f1a7=_0xc8a0[_0x31d3c3];return _0x58f1a7;};'use strict';var multer=require(_0x0c8a('0x0'));var util=require(_0x0c8a('0x1'));var path=require(_0x0c8a('0x2'));var timeout=require(_0x0c8a('0x3'));var express=require(_0x0c8a('0x4'));var router=express[_0x0c8a('0x5')]();var auth=require(_0x0c8a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0c8a('0x7'));var controller=require(_0x0c8a('0x8'));router[_0x0c8a('0x9')]('/',auth[_0x0c8a('0xa')](),controller[_0x0c8a('0xb')]);router[_0x0c8a('0x9')](_0x0c8a('0xc'),auth[_0x0c8a('0xa')](),controller[_0x0c8a('0xd')]);router[_0x0c8a('0xe')]('/',auth[_0x0c8a('0xa')](),controller['create']);router[_0x0c8a('0xf')](_0x0c8a('0xc'),auth['isAuthenticated'](),controller[_0x0c8a('0x10')]);router[_0x0c8a('0x11')](_0x0c8a('0xc'),auth[_0x0c8a('0xa')](),controller[_0x0c8a('0x12')]);module[_0x0c8a('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js
index ef83a40..c6e84d3 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 _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
+var _0xdcd0=['STRING','variable','BOOLEAN','sequelize','ENUM','customVariable','keyValue'];(function(_0x5050f8,_0x346aca){var _0x54c929=function(_0x212841){while(--_0x212841){_0x5050f8['push'](_0x5050f8['shift']());}};_0x54c929(++_0x346aca);}(_0xdcd0,0xb9));var _0x0dcd=function(_0x8cafee,_0x9f33e4){_0x8cafee=_0x8cafee-0x0;var _0x2d989d=_0xdcd0[_0x8cafee];return _0x2d989d;};'use strict';var Sequelize=require(_0x0dcd('0x0'));module['exports']={'type':{'type':Sequelize[_0x0dcd('0x1')]('string','variable',_0x0dcd('0x2'),_0x0dcd('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0dcd('0x4')]},'key':{'type':Sequelize[_0x0dcd('0x4')]},'keyType':{'type':Sequelize[_0x0dcd('0x1')]('string',_0x0dcd('0x5'),_0x0dcd('0x2'))},'keyContent':{'type':Sequelize[_0x0dcd('0x4')]},'idField':{'type':Sequelize[_0x0dcd('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0dcd('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0dcd('0x4')]}};
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js
index dbe063e..4bf758c 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(_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
+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(_0x4a367a,_0x57effa){var _0x3d7f63=function(_0x1d9638){while(--_0x1d9638){_0x4a367a['push'](_0x4a367a['shift']());}};_0x3d7f63(++_0x57effa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 3b707d7..e65c59c 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 _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
+var _0x1fc6=['exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','util','api','moment','bluebird','request-promise','rimraf','./intServicenowField.attributes'];(function(_0x108a98,_0x112087){var _0xd4205=function(_0xb5e7d9){while(--_0xb5e7d9){_0x108a98['push'](_0x108a98['shift']());}};_0xd4205(++_0x112087);}(_0x1fc6,0x1e3));var _0x61fc=function(_0x25c326,_0x250137){_0x25c326=_0x25c326-0x0;var _0x762452=_0x1fc6[_0x25c326];return _0x762452;};'use strict';var _=require('lodash');var util=require(_0x61fc('0x0'));var logger=require('../../config/logger')(_0x61fc('0x1'));var moment=require(_0x61fc('0x2'));var BPromise=require(_0x61fc('0x3'));var rp=require(_0x61fc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x61fc('0x5'));var config=require('../../config/environment');var attributes=require(_0x61fc('0x6'));module[_0x61fc('0x7')]=function(_0x51d3b5,_0x501d36){return _0x51d3b5[_0x61fc('0x8')](_0x61fc('0x9'),attributes,{'tableName':_0x61fc('0xa'),'paranoid':![],'indexes':[{'name':_0x61fc('0xb'),'fields':[_0x61fc('0xc'),_0x61fc('0xd')],'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 503294b..5b1c748 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 _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
+var _0x55f4=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55f4,0x1c0));var _0x455f=function(_0x319b02,_0x1be26d){_0x319b02=_0x319b02-0x0;var _0x2a5ec4=_0x55f4[_0x319b02];return _0x2a5ec4;};'use strict';var _=require(_0x455f('0x0'));var util=require(_0x455f('0x1'));var moment=require(_0x455f('0x2'));var BPromise=require('bluebird');var rs=require(_0x455f('0x3'));var fs=require('fs');var Redis=require(_0x455f('0x4'));var db=require(_0x455f('0x5'))['db'];var utils=require(_0x455f('0x6'));var logger=require(_0x455f('0x7'))(_0x455f('0x8'));var config=require('../../config/environment');var jayson=require(_0x455f('0x9'));var client=jayson['client'][_0x455f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c357f,_0xb0ef0e,_0x337ec7){return new BPromise(function(_0x115e99,_0xf53f01){return client[_0x455f('0xb')](_0x3c357f,_0x337ec7)[_0x455f('0xc')](function(_0x114a51){logger[_0x455f('0xd')](_0x455f('0xe'),_0xb0ef0e,_0x455f('0xf'));logger[_0x455f('0x10')](_0x455f('0x11'),_0xb0ef0e,_0x455f('0xf'),JSON['stringify'](_0x114a51));if(_0x114a51[_0x455f('0x12')]){if(_0x114a51['error'][_0x455f('0x13')]===0x1f4){logger[_0x455f('0x12')](_0x455f('0xe'),_0xb0ef0e,_0x114a51[_0x455f('0x12')]['message']);return _0xf53f01(_0x114a51[_0x455f('0x12')][_0x455f('0x14')]);}logger[_0x455f('0x12')](_0x455f('0xe'),_0xb0ef0e,_0x114a51[_0x455f('0x12')][_0x455f('0x14')]);return _0x115e99(_0x114a51['error'][_0x455f('0x14')]);}else{logger[_0x455f('0xd')](_0x455f('0xe'),_0xb0ef0e,_0x455f('0xf'));_0x115e99(_0x114a51[_0x455f('0x15')]['message']);}})['catch'](function(_0x1c6dd2){logger[_0x455f('0x12')](_0x455f('0xe'),_0xb0ef0e,_0x1c6dd2);_0xf53f01(_0x1c6dd2);});});}
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js
index 7ee9ffd..35b2d98 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 _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
+var _0x379a=['getFields','post','create','/:id/configurations','addConfiguration','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields'];(function(_0x217372,_0x1822ce){var _0x2715a1=function(_0x5712db){while(--_0x5712db){_0x217372['push'](_0x217372['shift']());}};_0x2715a1(++_0x1822ce);}(_0x379a,0xd0));var _0xa379=function(_0xd578cb,_0x2167a3){_0xd578cb=_0xd578cb-0x0;var _0x775533=_0x379a[_0xd578cb];return _0x775533;};'use strict';var multer=require(_0xa379('0x0'));var util=require(_0xa379('0x1'));var path=require(_0xa379('0x2'));var timeout=require(_0xa379('0x3'));var express=require(_0xa379('0x4'));var router=express[_0xa379('0x5')]();var auth=require(_0xa379('0x6'));var interaction=require(_0xa379('0x7'));var config=require(_0xa379('0x8'));var controller=require(_0xa379('0x9'));router[_0xa379('0xa')]('/',auth[_0xa379('0xb')](),controller[_0xa379('0xc')]);router['get'](_0xa379('0xd'),auth[_0xa379('0xb')](),controller[_0xa379('0xe')]);router[_0xa379('0xa')]('/:id/configurations',auth[_0xa379('0xb')](),controller[_0xa379('0xf')]);router['get'](_0xa379('0x10'),auth[_0xa379('0xb')](),controller[_0xa379('0x11')]);router[_0xa379('0x12')]('/',auth[_0xa379('0xb')](),controller[_0xa379('0x13')]);router['post'](_0xa379('0x14'),auth[_0xa379('0xb')](),controller[_0xa379('0x15')]);router[_0xa379('0x16')]('/:id',auth[_0xa379('0xb')](),controller['update']);router['delete'](_0xa379('0xd'),auth['isAuthenticated'](),controller[_0xa379('0x17')]);module[_0xa379('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
index 865c2af..fd2a50b 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 _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
+var _0xf872=['exports','STRING','sequelize'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0xf872,0x1eb));var _0x2f87=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0xf872[_0x2b45b5];return _0x1d9c06;};'use strict';var Sequelize=require(_0x2f87('0x0'));module[_0x2f87('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2f87('0x2')]},'username':{'type':Sequelize[_0x2f87('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x2f87('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x2f87('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
index 525b401..8f84d93 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 _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
+var _0x23c9=['getDescriptions','SugarcrmField','Subjects','getFields','description','duration_minutes','parent_id','parent_type','parent_name','direction','password','remoteUri','slice','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','Password\x20Expired','format','Calls','module_fields','remove','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','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','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','name','send','index','SugarcrmAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','findAll','params','include','options','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions'];(function(_0x27bd9b,_0x206238){var _0xbd6219=function(_0x3c1577){while(--_0x3c1577){_0x27bd9b['push'](_0x27bd9b['shift']());}};_0xbd6219(++_0x206238);}(_0x23c9,0x1a1));var _0x923c=function(_0x333767,_0x220733){_0x333767=_0x333767-0x0;var _0x42a755=_0x23c9[_0x333767];return _0x42a755;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x923c('0x0'));var rimraf=require(_0x923c('0x1'));var zipdir=require(_0x923c('0x2'));var jsonpatch=require(_0x923c('0x3'));var rp=require('request-promise');var moment=require(_0x923c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x923c('0x5'));var util=require(_0x923c('0x6'));var path=require(_0x923c('0x7'));var sox=require('sox');var csv=require(_0x923c('0x8'));var ejs=require(_0x923c('0x9'));var fs=require('fs');var _=require(_0x923c('0xa'));var squel=require('squel');var crypto=require(_0x923c('0xb'));var jsforce=require(_0x923c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x923c('0x8'));var querystring=require(_0x923c('0xd'));var Papa=require(_0x923c('0xe'));var Redis=require(_0x923c('0xf'));var authService=require(_0x923c('0x10'));var qs=require(_0x923c('0x11'));var as=require(_0x923c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x923c('0x13'))('api');var utils=require(_0x923c('0x14'));var config=require(_0x923c('0x15'));var db=require(_0x923c('0x16'))['db'];var integrations=require(_0x923c('0x17'));var jayson=require(_0x923c('0x18'));var client=jayson[_0x923c('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x5d6ffd,_0x512b12,_0xf8913a){if(_0xf8913a){var _0x121cc6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x121cc6[_0x923c('0x1a')](_0x512b12)){return _0x5d6ffd;}else{throw new db[(_0x923c('0x1b'))][(_0x923c('0x1c'))](_0x923c('0x1d'));}}else{return _0x5d6ffd;}}function respondWithRpcPromise(_0x21b172,_0x2eb02c,_0x11ba5a,_0x5b37ac){return new BPromise(function(_0x308be8,_0x297fc3){var _0x2a4d23=_0x5b37ac||client;return _0x2a4d23[_0x923c('0x1e')](_0x21b172,_0x11ba5a)[_0x923c('0x1f')](function(_0x23a969){logger['info'](_0x923c('0x20'),_0x2eb02c,'request\x20sent');logger[_0x923c('0x21')](_0x923c('0x22'),_0x2eb02c,_0x923c('0x23'),JSON['stringify'](_0x23a969));if(_0x23a969[_0x923c('0x24')]){if(_0x23a969[_0x923c('0x24')][_0x923c('0x25')]===0x1f4){logger[_0x923c('0x24')](_0x923c('0x20'),_0x2eb02c,_0x23a969[_0x923c('0x24')][_0x923c('0x26')]);return _0x297fc3(_0x23a969[_0x923c('0x24')][_0x923c('0x26')]);}logger[_0x923c('0x24')](_0x923c('0x20'),_0x2eb02c,_0x23a969[_0x923c('0x24')]['message']);return _0x308be8(_0x23a969[_0x923c('0x24')][_0x923c('0x26')]);}else{logger['info'](_0x923c('0x20'),_0x2eb02c,_0x923c('0x23'));_0x308be8(_0x23a969[_0x923c('0x27')][_0x923c('0x26')]);}})[_0x923c('0x28')](function(_0x4e20c2){logger[_0x923c('0x24')]('SugarcrmAccount,\x20%s,\x20%s',_0x2eb02c,_0x4e20c2);_0x297fc3(_0x4e20c2);});});}function respondWithStatusCode(_0x438580,_0x416172){_0x416172=_0x416172||0xcc;return function(_0x51ad21){if(_0x51ad21){return _0x438580['sendStatus'](_0x416172);}return _0x438580[_0x923c('0x29')](_0x416172)[_0x923c('0x2a')]();};}function respondWithResult(_0x28c483,_0x567c55){_0x567c55=_0x567c55||0xc8;return function(_0x191bb5){if(_0x191bb5){return _0x28c483['status'](_0x567c55)['json'](_0x191bb5);}};}function respondWithFilteredResult(_0x475d7a,_0x5f371a){return function(_0x528a6e){if(_0x528a6e){var _0xf3e355=_0x528a6e[_0x923c('0x2b')],_0x196e09=_0x5f371a[_0x923c('0x2c')],_0x1e7909=_0x5f371a['offset']+_0x5f371a[_0x923c('0x2d')],_0x4467b2;if(_0x1e7909>=_0xf3e355){_0x1e7909=_0xf3e355;_0x4467b2=0xc8;}else{_0x4467b2=0xce;}_0x475d7a[_0x923c('0x29')](_0x4467b2);return _0x475d7a[_0x923c('0x2e')](_0x923c('0x2f'),_0x196e09+'-'+_0x1e7909+'/'+_0xf3e355)[_0x923c('0x30')](_0x528a6e);}return null;};}function patchUpdates(_0x40a56c){return function(_0x587d85){try{jsonpatch[_0x923c('0x31')](_0x587d85,_0x40a56c,!![]);}catch(_0x384454){return BPromise[_0x923c('0x32')](_0x384454);}return _0x587d85[_0x923c('0x33')]();};}function saveUpdates(_0x180f63,_0x38ccfc){return function(_0x5378ea){if(_0x5378ea){return _0x5378ea['update'](_0x180f63)[_0x923c('0x1f')](function(_0x58f003){return _0x58f003;});}return null;};}function removeEntity(_0x37dbee,_0x1de60b){return function(_0x1b2593){if(_0x1b2593){return _0x1b2593[_0x923c('0x34')]()[_0x923c('0x1f')](function(){_0x37dbee[_0x923c('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd410a7,_0x374937){return function(_0x172885){if(!_0x172885){_0xd410a7['sendStatus'](0x194);}return _0x172885;};}function handleError(_0x5af561,_0xc87bea){_0xc87bea=_0xc87bea||0x1f4;return function(_0x2649a0){logger[_0x923c('0x24')](_0x2649a0['stack']);if(_0x2649a0[_0x923c('0x35')]){delete _0x2649a0['name'];}_0x5af561[_0x923c('0x29')](_0xc87bea)[_0x923c('0x36')](_0x2649a0);};}exports[_0x923c('0x37')]=function(_0x3dd57e,_0x3a6534){var _0x4c4204={},_0x3ce406={},_0x4b2c61={'count':0x0,'rows':[]};var _0xe054f0=_['map'](db[_0x923c('0x38')][_0x923c('0x39')],function(_0xc955c3){return{'name':_0xc955c3[_0x923c('0x3a')],'type':_0xc955c3[_0x923c('0x3b')][_0x923c('0x3c')]};});_0x3ce406[_0x923c('0x3d')]=_[_0x923c('0x3e')](_0xe054f0,_0x923c('0x35'));_0x3ce406[_0x923c('0x3f')]=_[_0x923c('0x40')](_0x3dd57e['query']);_0x3ce406[_0x923c('0x41')]=_[_0x923c('0x42')](_0x3ce406[_0x923c('0x3d')],_0x3ce406[_0x923c('0x3f')]);_0x4c4204[_0x923c('0x43')]=_[_0x923c('0x42')](_0x3ce406[_0x923c('0x3d')],qs[_0x923c('0x44')](_0x3dd57e[_0x923c('0x3f')]['fields']));_0x4c4204['attributes']=_0x4c4204['attributes'][_0x923c('0x45')]?_0x4c4204[_0x923c('0x43')]:_0x3ce406[_0x923c('0x3d')];if(!_0x3dd57e['query'][_0x923c('0x46')]('nolimit')){_0x4c4204[_0x923c('0x2d')]=qs[_0x923c('0x2d')](_0x3dd57e[_0x923c('0x3f')][_0x923c('0x2d')]);_0x4c4204[_0x923c('0x2c')]=qs[_0x923c('0x2c')](_0x3dd57e['query']['offset']);}_0x4c4204[_0x923c('0x47')]=qs[_0x923c('0x48')](_0x3dd57e[_0x923c('0x3f')][_0x923c('0x48')]);_0x4c4204[_0x923c('0x49')]=qs[_0x923c('0x41')](_[_0x923c('0x4a')](_0x3dd57e[_0x923c('0x3f')],_0x3ce406[_0x923c('0x41')]),_0xe054f0);if(_0x3dd57e[_0x923c('0x3f')]['filter']){_0x4c4204[_0x923c('0x49')]=_['merge'](_0x4c4204[_0x923c('0x49')],{'$or':_[_0x923c('0x3e')](_0xe054f0,function(_0x1e30b2){if(_0x1e30b2[_0x923c('0x3b')]!==_0x923c('0x4b')){var _0x5d7db2={};_0x5d7db2[_0x1e30b2[_0x923c('0x35')]]={'$like':'%'+_0x3dd57e[_0x923c('0x3f')][_0x923c('0x4c')]+'%'};return _0x5d7db2;}})});}_0x4c4204=_[_0x923c('0x4d')]({},_0x4c4204,_0x3dd57e['options']);var _0x4867b9={'where':_0x4c4204['where']};return db[_0x923c('0x38')][_0x923c('0x2b')](_0x4867b9)[_0x923c('0x1f')](function(_0x2b7194){_0x4b2c61[_0x923c('0x2b')]=_0x2b7194;if(_0x3dd57e[_0x923c('0x3f')][_0x923c('0x4e')]){_0x4c4204['include']=[{'all':!![]}];}return db[_0x923c('0x38')][_0x923c('0x4f')](_0x4c4204);})['then'](function(_0x183a06){_0x4b2c61['rows']=_0x183a06;return _0x4b2c61;})[_0x923c('0x1f')](respondWithFilteredResult(_0x3a6534,_0x4c4204))[_0x923c('0x28')](handleError(_0x3a6534,null));};exports['show']=function(_0x156667,_0x3873d1){var _0x42e903={'raw':![],'where':{'id':_0x156667[_0x923c('0x50')]['id']}},_0xd72360={};_0xd72360[_0x923c('0x3d')]=_[_0x923c('0x40')](db[_0x923c('0x38')][_0x923c('0x39')]);_0xd72360[_0x923c('0x3f')]=_[_0x923c('0x40')](_0x156667['query']);_0xd72360['filters']=_[_0x923c('0x42')](_0xd72360[_0x923c('0x3d')],_0xd72360[_0x923c('0x3f')]);_0x42e903['attributes']=_[_0x923c('0x42')](_0xd72360['model'],qs[_0x923c('0x44')](_0x156667[_0x923c('0x3f')][_0x923c('0x44')]));_0x42e903[_0x923c('0x43')]=_0x42e903['attributes'][_0x923c('0x45')]?_0x42e903[_0x923c('0x43')]:_0xd72360['model'];if(_0x156667[_0x923c('0x3f')]['includeAll']){_0x42e903[_0x923c('0x51')]=[{'all':!![]}];}_0x42e903=_[_0x923c('0x4d')]({},_0x42e903,_0x156667[_0x923c('0x52')]);return db[_0x923c('0x38')][_0x923c('0x53')](_0x42e903)[_0x923c('0x1f')](handleEntityNotFound(_0x3873d1,null))[_0x923c('0x1f')](respondWithResult(_0x3873d1,null))[_0x923c('0x28')](handleError(_0x3873d1,null));};exports['create']=function(_0x568404,_0x3a2924){return db[_0x923c('0x38')][_0x923c('0x54')](_0x568404[_0x923c('0x55')],{})[_0x923c('0x1f')](respondWithResult(_0x3a2924,0xc9))[_0x923c('0x28')](handleError(_0x3a2924,null));};exports['update']=function(_0x27547d,_0xd195e4){if(_0x27547d['body']['id']){delete _0x27547d['body']['id'];}return db[_0x923c('0x38')]['find']({'where':{'id':_0x27547d['params']['id']}})[_0x923c('0x1f')](handleEntityNotFound(_0xd195e4,null))[_0x923c('0x1f')](saveUpdates(_0x27547d['body'],null))[_0x923c('0x1f')](respondWithResult(_0xd195e4,null))[_0x923c('0x28')](handleError(_0xd195e4,null));};exports[_0x923c('0x34')]=function(_0xc90262,_0x480441){return db[_0x923c('0x38')][_0x923c('0x53')]({'where':{'id':_0xc90262[_0x923c('0x50')]['id']}})[_0x923c('0x1f')](handleEntityNotFound(_0x480441,null))[_0x923c('0x1f')](removeEntity(_0x480441,null))['catch'](handleError(_0x480441,null));};exports[_0x923c('0x56')]=function(_0x269854,_0x40973d,_0x2daf75){var _0x3730d4={};var _0x57775e={};var _0x1a5681;var _0x3622f1;return db[_0x923c('0x38')][_0x923c('0x57')]({'where':{'id':_0x269854[_0x923c('0x50')]['id']}})[_0x923c('0x1f')](handleEntityNotFound(_0x40973d,null))[_0x923c('0x1f')](function(_0x18865c){if(_0x18865c){_0x1a5681=_0x18865c;_0x57775e['model']=_[_0x923c('0x40')](db[_0x923c('0x58')]['rawAttributes']);_0x57775e[_0x923c('0x3f')]=_[_0x923c('0x40')](_0x269854['query']);_0x57775e[_0x923c('0x41')]=_['intersection'](_0x57775e[_0x923c('0x3d')],_0x57775e[_0x923c('0x3f')]);_0x3730d4[_0x923c('0x43')]=_[_0x923c('0x42')](_0x57775e[_0x923c('0x3d')],qs['fields'](_0x269854['query'][_0x923c('0x44')]));_0x3730d4['attributes']=_0x3730d4[_0x923c('0x43')][_0x923c('0x45')]?_0x3730d4[_0x923c('0x43')]:_0x57775e[_0x923c('0x3d')];_0x3730d4[_0x923c('0x47')]=qs[_0x923c('0x48')](_0x269854[_0x923c('0x3f')][_0x923c('0x48')]);_0x3730d4[_0x923c('0x49')]=qs[_0x923c('0x41')](_[_0x923c('0x4a')](_0x269854['query'],_0x57775e[_0x923c('0x41')]));if(_0x269854['query']['filter']){_0x3730d4[_0x923c('0x49')]=_[_0x923c('0x4d')](_0x3730d4[_0x923c('0x49')],{'$or':_[_0x923c('0x3e')](_0x3730d4[_0x923c('0x43')],function(_0x1dfd7a){var _0x31d498={};_0x31d498[_0x1dfd7a]={'$like':'%'+_0x269854[_0x923c('0x3f')]['filter']+'%'};return _0x31d498;})});}_0x3730d4=_[_0x923c('0x4d')]({},_0x3730d4,_0x269854[_0x923c('0x52')]);return _0x1a5681['getConfigurations'](_0x3730d4);}})[_0x923c('0x1f')](function(_0x1a96fa){if(_0x1a96fa){_0x3622f1=_0x1a96fa['length'];if(!_0x269854[_0x923c('0x3f')]['hasOwnProperty'](_0x923c('0x59'))){_0x3730d4['limit']=qs['limit'](_0x269854[_0x923c('0x3f')][_0x923c('0x2d')]);_0x3730d4[_0x923c('0x2c')]=qs[_0x923c('0x2c')](_0x269854[_0x923c('0x3f')][_0x923c('0x2c')]);}return _0x1a5681[_0x923c('0x56')](_0x3730d4);}})[_0x923c('0x1f')](function(_0x500e65){if(_0x500e65){return _0x500e65?{'count':_0x3622f1,'rows':_0x500e65}:null;}})[_0x923c('0x1f')](respondWithResult(_0x40973d,null))[_0x923c('0x28')](handleError(_0x40973d,null));};exports[_0x923c('0x5a')]=function(_0x293868,_0x5cca8e,_0x5cdcb1){if(_0x293868[_0x923c('0x55')]['id']){delete _0x293868[_0x923c('0x55')]['id'];}return db[_0x923c('0x38')][_0x923c('0x57')]({'where':{'id':_0x293868[_0x923c('0x50')]['id']}})[_0x923c('0x1f')](handleEntityNotFound(_0x5cca8e,null))[_0x923c('0x1f')](function(_0x17199a){if(_0x17199a){_0x293868[_0x923c('0x55')][_0x923c('0x5b')]=_0x17199a['id'];_0x293868[_0x923c('0x55')]['Subjects']=integrations[_0x923c('0x5c')](_0x293868['body'][_0x923c('0x5d')],_0x293868[_0x923c('0x55')][_0x923c('0x3b')]);_0x293868['body'][_0x923c('0x5e')]=integrations[_0x923c('0x5f')](_0x293868['body'][_0x923c('0x5d')],_0x293868['body'][_0x923c('0x3b')]);return db[_0x923c('0x58')][_0x923c('0x54')](_0x293868[_0x923c('0x55')],{'include':[{'model':db[_0x923c('0x60')],'as':_0x923c('0x61')},{'model':db[_0x923c('0x60')],'as':_0x923c('0x5e')}]});}return null;})[_0x923c('0x1f')](respondWithResult(_0x5cca8e,null))[_0x923c('0x28')](handleError(_0x5cca8e,null));};exports[_0x923c('0x62')]=function(_0x4625f6,_0xa0fec6,_0x34b6d8){var _0x590373='';var _0x56e462=['id',_0x923c('0x35'),'assigned_user_id','created_by',_0x923c('0x63'),'date_start','duration_hours',_0x923c('0x64'),_0x923c('0x65'),_0x923c('0x66'),_0x923c('0x67'),_0x923c('0x68')];return db[_0x923c('0x38')]['findOne']({'where':{'id':_0x4625f6[_0x923c('0x50')]['id']},'attributes':['id','username',_0x923c('0x69'),_0x923c('0x6a')]})['then'](handleEntityNotFound(_0xa0fec6,null))[_0x923c('0x1f')](function(_0x51649b){if(_0x51649b){_0x590373=_0x51649b[_0x923c('0x6a')];var _0x2fe0c5=_0x590373[_0x923c('0x6b')](-0x1);if(_0x2fe0c5==='/'){_0x590373=_0x590373['substring'](0x0,_0x590373[_0x923c('0x6c')](_0x2fe0c5));}return rp({'method':_0x923c('0x6d'),'uri':util['format'](_0x923c('0x6e'),_0x590373,_0x923c('0x6f')),'json':!![],'form':{'method':_0x923c('0x70'),'input_type':'JSON','response_type':_0x923c('0x71'),'rest_data':JSON[_0x923c('0x72')]({'user_auth':{'user_name':_0x51649b['username'],'password':_0x51649b[_0x923c('0x69')],'encryption':_0x923c('0x73')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x923c('0x1f')](function(_0x5c1c81){if(_0x5c1c81&&_0x5c1c81['name']!=='Invalid\x20Login'&&_0x5c1c81[_0x923c('0x35')]!==_0x923c('0x74')){return rp({'method':'POST','uri':util[_0x923c('0x75')]('%s%s',_0x590373,_0x923c('0x6f')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x923c('0x71'),'response_type':_0x923c('0x71'),'rest_data':JSON[_0x923c('0x72')]({'session':_0x5c1c81['id'],'module_name':_0x923c('0x76')})}})[_0x923c('0x1f')](function(_0x185646){if(_0x185646){var _0x5bad4b=_['values'](_0x185646[_0x923c('0x77')]);_[_0x923c('0x78')](_0x5bad4b,function(_0xb8310){return _0x56e462[_0x923c('0x79')](_0xb8310[_0x923c('0x35')]);});return{'count':_0x5bad4b[_0x923c('0x45')],'rows':_[_0x923c('0x3e')](_0x5bad4b,function(_0xe20d33){return{'id':_0xe20d33[_0x923c('0x35')],'name':_0xe20d33[_0x923c('0x7a')],'custom':_[_0x923c('0x7b')](_0xe20d33['name'],'_c')?!![]:![],'options':_0xe20d33['options']?_[_0x923c('0x3e')](_['values'](_0xe20d33['options']),function(_0x294974){return{'name':_0x294974[_0x923c('0x7c')],'value':_0x294974['name']};}):[]};})};}})[_0x923c('0x1f')](respondWithResult(_0xa0fec6,null))[_0x923c('0x28')](function(_0x41a138){var _0x2a8e88=_0x4625f6['query']['test']?0x1f4:_0x41a138[_0x923c('0x7d')]||0x1f4;logger[_0x923c('0x24')](_0x923c('0x7e'),_0x923c('0x62'),_0x2a8e88,JSON[_0x923c('0x72')](_0x41a138));delete _0x41a138['name'];if(_0x2a8e88===0x191){_0x2a8e88=0x190;}_0xa0fec6[_0x923c('0x29')](_0x2a8e88)[_0x923c('0x36')](_0x4625f6[_0x923c('0x3f')][_0x923c('0x1a')]?{'message':_0x923c('0x7f'),'statusCode':_0x41a138[_0x923c('0x7d')]}:_0x41a138);});}else{var _0x3fe2e8=0x1f4;_0xa0fec6[_0x923c('0x29')](_0x3fe2e8)[_0x923c('0x36')]({'message':_0x923c('0x7f'),'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 3f7d48d..8cf35f4 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 _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
+var _0x8e1d=['moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','api'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x8e1d,0x190));var _0xd8e1=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8e1d[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xd8e1('0x0'));var util=require('util');var logger=require(_0xd8e1('0x1'))(_0xd8e1('0x2'));var moment=require(_0xd8e1('0x3'));var BPromise=require(_0xd8e1('0x4'));var rp=require(_0xd8e1('0x5'));var fs=require('fs');var path=require(_0xd8e1('0x6'));var rimraf=require('rimraf');var config=require(_0xd8e1('0x7'));var attributes=require(_0xd8e1('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xd8e1('0x9')]=function(_0x3d68be,_0x728129){return _0x3d68be[_0xd8e1('0xa')](_0xd8e1('0xb'),attributes,{'tableName':_0xd8e1('0xc'),'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 33466ed..29bc17d 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 _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
+var _0x6142=['info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSugarcrmAccount','raw','options','where','limit','include','map','model','attributes','ShowSugarcrmAccount','SugarcrmAccount','find','catch','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3c4f93,_0x24be5c){var _0x56d097=function(_0x30ad6e){while(--_0x30ad6e){_0x3c4f93['push'](_0x3c4f93['shift']());}};_0x56d097(++_0x24be5c);}(_0x6142,0xa3));var _0x2614=function(_0x2c1bbe,_0x5c4e40){_0x2c1bbe=_0x2c1bbe-0x0;var _0x46315a=_0x6142[_0x2c1bbe];return _0x46315a;};'use strict';var _=require('lodash');var util=require(_0x2614('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2614('0x1'));var fs=require('fs');var Redis=require(_0x2614('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2614('0x3'));var logger=require(_0x2614('0x4'))(_0x2614('0x5'));var config=require(_0x2614('0x6'));var jayson=require(_0x2614('0x7'));var client=jayson[_0x2614('0x8')][_0x2614('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11ac0f,_0x2cc177,_0x142668){return new BPromise(function(_0x237fb3,_0x46037b){return client[_0x2614('0xa')](_0x11ac0f,_0x142668)[_0x2614('0xb')](function(_0x144d40){logger[_0x2614('0xc')](_0x2614('0xd'),_0x2cc177,_0x2614('0xe'));logger[_0x2614('0xf')](_0x2614('0x10'),_0x2cc177,_0x2614('0xe'),JSON[_0x2614('0x11')](_0x144d40));if(_0x144d40[_0x2614('0x12')]){if(_0x144d40[_0x2614('0x12')][_0x2614('0x13')]===0x1f4){logger[_0x2614('0x12')](_0x2614('0xd'),_0x2cc177,_0x144d40[_0x2614('0x12')][_0x2614('0x14')]);return _0x46037b(_0x144d40[_0x2614('0x12')][_0x2614('0x14')]);}logger[_0x2614('0x12')](_0x2614('0xd'),_0x2cc177,_0x144d40[_0x2614('0x12')][_0x2614('0x14')]);return _0x237fb3(_0x144d40[_0x2614('0x12')][_0x2614('0x14')]);}else{logger['info'](_0x2614('0xd'),_0x2cc177,_0x2614('0xe'));_0x237fb3(_0x144d40[_0x2614('0x15')][_0x2614('0x14')]);}})['catch'](function(_0x33d6ce){logger[_0x2614('0x12')](_0x2614('0xd'),_0x2cc177,_0x33d6ce);_0x46037b(_0x33d6ce);});});}exports[_0x2614('0x16')]=function(_0x4a4cb0){var _0x6857a2=this;return new Promise(function(_0x341e34,_0x453ab2){return db['SugarcrmAccount']['findAll']({'raw':_0x4a4cb0['options']?_0x4a4cb0['options'][_0x2614('0x17')]===undefined?!![]:![]:!![],'where':_0x4a4cb0[_0x2614('0x18')]?_0x4a4cb0[_0x2614('0x18')][_0x2614('0x19')]||null:null,'attributes':_0x4a4cb0['options']?_0x4a4cb0[_0x2614('0x18')]['attributes']||null:null,'limit':_0x4a4cb0['options']?_0x4a4cb0[_0x2614('0x18')][_0x2614('0x1a')]||null:null,'include':_0x4a4cb0[_0x2614('0x18')]?_0x4a4cb0[_0x2614('0x18')][_0x2614('0x1b')]?_[_0x2614('0x1c')](_0x4a4cb0[_0x2614('0x18')][_0x2614('0x1b')],function(_0x3a81db){return{'model':db[_0x3a81db[_0x2614('0x1d')]],'as':_0x3a81db['as'],'attributes':_0x3a81db[_0x2614('0x1e')],'include':_0x3a81db['include']?_['map'](_0x3a81db['include'],function(_0x259e76){return{'model':db[_0x259e76[_0x2614('0x1d')]],'as':_0x259e76['as'],'attributes':_0x259e76[_0x2614('0x1e')],'include':_0x259e76['include']?_[_0x2614('0x1c')](_0x259e76['include'],function(_0x36d95f){return{'model':db[_0x36d95f[_0x2614('0x1d')]],'as':_0x36d95f['as'],'attributes':_0x36d95f[_0x2614('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2614('0xb')](function(_0x17c5f8){logger[_0x2614('0xc')]('GetSugarcrmAccount',_0x4a4cb0);logger[_0x2614('0xf')](_0x2614('0x16'),_0x4a4cb0,JSON[_0x2614('0x11')](_0x17c5f8));_0x341e34(_0x17c5f8);})['catch'](function(_0x1a664d){logger[_0x2614('0x12')](_0x2614('0x16'),_0x1a664d[_0x2614('0x14')],_0x4a4cb0);_0x453ab2(_0x6857a2[_0x2614('0x12')](0x1f4,_0x1a664d[_0x2614('0x14')]));});});};exports[_0x2614('0x1f')]=function(_0x244ef1){var _0x3aeeee=this;return new Promise(function(_0x4e93c8,_0x216617){return db[_0x2614('0x20')][_0x2614('0x21')]({'raw':_0x244ef1['options']?_0x244ef1[_0x2614('0x18')][_0x2614('0x17')]===undefined?!![]:![]:!![],'where':_0x244ef1['options']?_0x244ef1[_0x2614('0x18')]['where']||null:null,'attributes':_0x244ef1[_0x2614('0x18')]?_0x244ef1[_0x2614('0x18')][_0x2614('0x1e')]||null:null,'include':_0x244ef1[_0x2614('0x18')]?_0x244ef1['options'][_0x2614('0x1b')]?_['map'](_0x244ef1[_0x2614('0x18')]['include'],function(_0x540a56){return{'model':db[_0x540a56[_0x2614('0x1d')]],'as':_0x540a56['as'],'attributes':_0x540a56[_0x2614('0x1e')],'include':_0x540a56[_0x2614('0x1b')]?_[_0x2614('0x1c')](_0x540a56['include'],function(_0x159aff){return{'model':db[_0x159aff['model']],'as':_0x159aff['as'],'attributes':_0x159aff[_0x2614('0x1e')],'include':_0x159aff[_0x2614('0x1b')]?_[_0x2614('0x1c')](_0x159aff[_0x2614('0x1b')],function(_0x2319cf){return{'model':db[_0x2319cf[_0x2614('0x1d')]],'as':_0x2319cf['as'],'attributes':_0x2319cf['attributes']};}):[]};}):[]};}):[]:[]})[_0x2614('0xb')](function(_0xf8e167){logger[_0x2614('0xc')](_0x2614('0x1f'),_0x244ef1);logger[_0x2614('0xf')](_0x2614('0x1f'),_0x244ef1,JSON['stringify'](_0xf8e167));_0x4e93c8(_0xf8e167);})[_0x2614('0x22')](function(_0xd01972){logger[_0x2614('0x12')]('ShowSugarcrmAccount',_0xd01972['message'],_0x244ef1);_0x216617(_0x3aeeee[_0x2614('0x12')](0x1f4,_0xd01972[_0x2614('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js
index 6b999c2..76c5feb 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 _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
+var _0x8d84=['show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x178b60,_0x6e6a09){var _0x3312d8=function(_0x153a0a){while(--_0x153a0a){_0x178b60['push'](_0x178b60['shift']());}};_0x3312d8(++_0x6e6a09);}(_0x8d84,0x16b));var _0x48d8=function(_0x32c80c,_0x4e2212){_0x32c80c=_0x32c80c-0x0;var _0x39804d=_0x8d84[_0x32c80c];return _0x39804d;};'use strict';var multer=require(_0x48d8('0x0'));var util=require(_0x48d8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x48d8('0x2'));var router=express['Router']();var auth=require(_0x48d8('0x3'));var interaction=require(_0x48d8('0x4'));var config=require(_0x48d8('0x5'));var controller=require(_0x48d8('0x6'));router[_0x48d8('0x7')]('/',auth[_0x48d8('0x8')](),controller[_0x48d8('0x9')]);router[_0x48d8('0x7')](_0x48d8('0xa'),auth[_0x48d8('0x8')](),controller[_0x48d8('0xb')]);router['get'](_0x48d8('0xc'),auth[_0x48d8('0x8')](),controller['getFields']);router[_0x48d8('0x7')](_0x48d8('0xd'),auth[_0x48d8('0x8')](),controller[_0x48d8('0xe')]);router[_0x48d8('0x7')](_0x48d8('0xf'),auth[_0x48d8('0x8')](),controller[_0x48d8('0x10')]);router['post']('/',auth[_0x48d8('0x8')](),controller[_0x48d8('0x11')]);router[_0x48d8('0x12')](_0x48d8('0xa'),auth['isAuthenticated'](),controller[_0x48d8('0x13')]);router[_0x48d8('0x14')]('/:id',auth[_0x48d8('0x8')](),controller[_0x48d8('0x15')]);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 155523d..97b474e 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 _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
+var _0xf773=['exports','STRING','sequelize'];(function(_0x2046dd,_0x40a9ab){var _0x2eb055=function(_0x1c65e8){while(--_0x1c65e8){_0x2046dd['push'](_0x2046dd['shift']());}};_0x2eb055(++_0x40a9ab);}(_0xf773,0x1d0));var _0x3f77=function(_0x2824e8,_0x2199b3){_0x2824e8=_0x2824e8-0x0;var _0x2509a7=_0xf773[_0x2824e8];return _0x2509a7;};'use strict';var Sequelize=require(_0x3f77('0x0'));module[_0x3f77('0x1')]={'name':{'type':Sequelize[_0x3f77('0x2')]},'description':{'type':Sequelize[_0x3f77('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
index f36589f..a41ce09 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 _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
+var _0x799a=['findAll','rows','params','find','create','body','findOne','SugarcrmField','getFields','nolimit','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','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','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','update','destroy','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','options','SugarcrmConfiguration','includeAll','include'];(function(_0x5723e2,_0x4f629d){var _0x544543=function(_0x5ed9f4){while(--_0x5ed9f4){_0x5723e2['push'](_0x5723e2['shift']());}};_0x544543(++_0x4f629d);}(_0x799a,0x117));var _0xa799=function(_0x5df173,_0x4a4c40){_0x5df173=_0x5df173-0x0;var _0x7ac066=_0x799a[_0x5df173];return _0x7ac066;};'use strict';var pdf=require(_0xa799('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa799('0x1'));var zipdir=require(_0xa799('0x2'));var jsonpatch=require(_0xa799('0x3'));var rp=require(_0xa799('0x4'));var moment=require(_0xa799('0x5'));var BPromise=require(_0xa799('0x6'));var Mustache=require(_0xa799('0x7'));var util=require('util');var path=require(_0xa799('0x8'));var sox=require(_0xa799('0x9'));var csv=require(_0xa799('0xa'));var ejs=require(_0xa799('0xb'));var fs=require('fs');var _=require(_0xa799('0xc'));var squel=require(_0xa799('0xd'));var crypto=require(_0xa799('0xe'));var jsforce=require(_0xa799('0xf'));var deskjs=require(_0xa799('0x10'));var toCsv=require(_0xa799('0xa'));var querystring=require(_0xa799('0x11'));var Papa=require(_0xa799('0x12'));var Redis=require(_0xa799('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa799('0x14'));var hardwareService=require(_0xa799('0x15'));var logger=require(_0xa799('0x16'))('api');var utils=require(_0xa799('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xa799('0x18')][_0xa799('0x19')]({'port':0x232a});function checkPasswordPattern(_0xd53385,_0x3c7d05,_0x2c9e9e){if(_0x2c9e9e){var _0x5beb45=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5beb45[_0xa799('0x1a')](_0x3c7d05)){return _0xd53385;}else{throw new db['Sequelize'][(_0xa799('0x1b'))](_0xa799('0x1c'));}}else{return _0xd53385;}}function respondWithRpcPromise(_0x577b41,_0x38fd82,_0x4466d4,_0x3524c8){return new BPromise(function(_0x1ae9a1,_0x3a4b53){var _0x222598=_0x3524c8||client;return _0x222598[_0xa799('0x1d')](_0x577b41,_0x4466d4)[_0xa799('0x1e')](function(_0x25f00c){logger[_0xa799('0x1f')](_0xa799('0x20'),_0x38fd82,'request\x20sent');logger[_0xa799('0x21')](_0xa799('0x22'),_0x38fd82,_0xa799('0x23'),JSON['stringify'](_0x25f00c));if(_0x25f00c[_0xa799('0x24')]){if(_0x25f00c[_0xa799('0x24')]['code']===0x1f4){logger[_0xa799('0x24')](_0xa799('0x20'),_0x38fd82,_0x25f00c[_0xa799('0x24')][_0xa799('0x25')]);return _0x3a4b53(_0x25f00c[_0xa799('0x24')][_0xa799('0x25')]);}logger[_0xa799('0x24')](_0xa799('0x20'),_0x38fd82,_0x25f00c[_0xa799('0x24')]['message']);return _0x1ae9a1(_0x25f00c[_0xa799('0x24')][_0xa799('0x25')]);}else{logger['info'](_0xa799('0x20'),_0x38fd82,_0xa799('0x23'));_0x1ae9a1(_0x25f00c['result'][_0xa799('0x25')]);}})[_0xa799('0x26')](function(_0x506c11){logger[_0xa799('0x24')](_0xa799('0x20'),_0x38fd82,_0x506c11);_0x3a4b53(_0x506c11);});});}function respondWithStatusCode(_0x14328c,_0x4b2ce1){_0x4b2ce1=_0x4b2ce1||0xcc;return function(_0x4834ca){if(_0x4834ca){return _0x14328c[_0xa799('0x27')](_0x4b2ce1);}return _0x14328c[_0xa799('0x28')](_0x4b2ce1)[_0xa799('0x29')]();};}function respondWithResult(_0x1994b8,_0x5d71cd){_0x5d71cd=_0x5d71cd||0xc8;return function(_0x52dfb5){if(_0x52dfb5){return _0x1994b8[_0xa799('0x28')](_0x5d71cd)['json'](_0x52dfb5);}};}function respondWithFilteredResult(_0x4e8d5a,_0x349fa9){return function(_0x20e810){if(_0x20e810){var _0x4c6670=_0x20e810[_0xa799('0x2a')],_0x59bc00=_0x349fa9[_0xa799('0x2b')],_0x4f80fd=_0x349fa9['offset']+_0x349fa9[_0xa799('0x2c')],_0x3052ff;if(_0x4f80fd>=_0x4c6670){_0x4f80fd=_0x4c6670;_0x3052ff=0xc8;}else{_0x3052ff=0xce;}_0x4e8d5a['status'](_0x3052ff);return _0x4e8d5a[_0xa799('0x2d')](_0xa799('0x2e'),_0x59bc00+'-'+_0x4f80fd+'/'+_0x4c6670)['json'](_0x20e810);}return null;};}function patchUpdates(_0x219f6b){return function(_0x38aba0){try{jsonpatch['apply'](_0x38aba0,_0x219f6b,!![]);}catch(_0x5eb8ae){return BPromise[_0xa799('0x2f')](_0x5eb8ae);}return _0x38aba0[_0xa799('0x30')]();};}function saveUpdates(_0xb14852,_0xda3b01){return function(_0xe01942){if(_0xe01942){return _0xe01942[_0xa799('0x31')](_0xb14852)[_0xa799('0x1e')](function(_0x294878){return _0x294878;});}return null;};}function removeEntity(_0x104825,_0x50244b){return function(_0x41b265){if(_0x41b265){return _0x41b265[_0xa799('0x32')]()[_0xa799('0x1e')](function(){_0x104825[_0xa799('0x28')](0xcc)[_0xa799('0x29')]();});}};}function handleEntityNotFound(_0x393119,_0x3d97e8){return function(_0x12a8a8){if(!_0x12a8a8){_0x393119['sendStatus'](0x194);}return _0x12a8a8;};}function handleError(_0x411a2d,_0x1aaaf6){_0x1aaaf6=_0x1aaaf6||0x1f4;return function(_0x1a2df8){logger['error'](_0x1a2df8['stack']);if(_0x1a2df8[_0xa799('0x33')]){delete _0x1a2df8[_0xa799('0x33')];}_0x411a2d['status'](_0x1aaaf6)[_0xa799('0x34')](_0x1a2df8);};}exports[_0xa799('0x35')]=function(_0x3eadd7,_0x1a12e6){var _0xf93413={},_0x1c2b74={},_0x4e9ffa={'count':0x0,'rows':[]};var _0x35279c=_[_0xa799('0x36')](db['SugarcrmConfiguration'][_0xa799('0x37')],function(_0x436e6b){return{'name':_0x436e6b[_0xa799('0x38')],'type':_0x436e6b[_0xa799('0x39')]['key']};});_0x1c2b74[_0xa799('0x3a')]=_[_0xa799('0x36')](_0x35279c,_0xa799('0x33'));_0x1c2b74[_0xa799('0x3b')]=_[_0xa799('0x3c')](_0x3eadd7[_0xa799('0x3b')]);_0x1c2b74['filters']=_[_0xa799('0x3d')](_0x1c2b74[_0xa799('0x3a')],_0x1c2b74[_0xa799('0x3b')]);_0xf93413['attributes']=_[_0xa799('0x3d')](_0x1c2b74[_0xa799('0x3a')],qs[_0xa799('0x3e')](_0x3eadd7[_0xa799('0x3b')][_0xa799('0x3e')]));_0xf93413[_0xa799('0x3f')]=_0xf93413[_0xa799('0x3f')][_0xa799('0x40')]?_0xf93413[_0xa799('0x3f')]:_0x1c2b74[_0xa799('0x3a')];if(!_0x3eadd7[_0xa799('0x3b')][_0xa799('0x41')]('nolimit')){_0xf93413[_0xa799('0x2c')]=qs[_0xa799('0x2c')](_0x3eadd7[_0xa799('0x3b')][_0xa799('0x2c')]);_0xf93413[_0xa799('0x2b')]=qs[_0xa799('0x2b')](_0x3eadd7[_0xa799('0x3b')]['offset']);}_0xf93413[_0xa799('0x42')]=qs[_0xa799('0x43')](_0x3eadd7['query']['sort']);_0xf93413[_0xa799('0x44')]=qs['filters'](_[_0xa799('0x45')](_0x3eadd7[_0xa799('0x3b')],_0x1c2b74[_0xa799('0x46')]),_0x35279c);if(_0x3eadd7[_0xa799('0x3b')][_0xa799('0x47')]){_0xf93413['where']=_[_0xa799('0x48')](_0xf93413[_0xa799('0x44')],{'$or':_[_0xa799('0x36')](_0x35279c,function(_0x42c573){if(_0x42c573[_0xa799('0x39')]!=='VIRTUAL'){var _0x1c0fc5={};_0x1c0fc5[_0x42c573[_0xa799('0x33')]]={'$like':'%'+_0x3eadd7[_0xa799('0x3b')][_0xa799('0x47')]+'%'};return _0x1c0fc5;}})});}_0xf93413=_[_0xa799('0x48')]({},_0xf93413,_0x3eadd7[_0xa799('0x49')]);var _0x4ff806={'where':_0xf93413[_0xa799('0x44')]};return db[_0xa799('0x4a')]['count'](_0x4ff806)[_0xa799('0x1e')](function(_0x740290){_0x4e9ffa[_0xa799('0x2a')]=_0x740290;if(_0x3eadd7[_0xa799('0x3b')][_0xa799('0x4b')]){_0xf93413[_0xa799('0x4c')]=[{'all':!![]}];}return db[_0xa799('0x4a')][_0xa799('0x4d')](_0xf93413);})[_0xa799('0x1e')](function(_0x5d6507){_0x4e9ffa[_0xa799('0x4e')]=_0x5d6507;return _0x4e9ffa;})['then'](respondWithFilteredResult(_0x1a12e6,_0xf93413))[_0xa799('0x26')](handleError(_0x1a12e6,null));};exports['show']=function(_0xaa9f32,_0x529b98){var _0x1188f5={'raw':![],'where':{'id':_0xaa9f32[_0xa799('0x4f')]['id']}},_0x2919cd={};_0x2919cd[_0xa799('0x3a')]=_['keys'](db[_0xa799('0x4a')]['rawAttributes']);_0x2919cd[_0xa799('0x3b')]=_[_0xa799('0x3c')](_0xaa9f32[_0xa799('0x3b')]);_0x2919cd[_0xa799('0x46')]=_[_0xa799('0x3d')](_0x2919cd[_0xa799('0x3a')],_0x2919cd[_0xa799('0x3b')]);_0x1188f5[_0xa799('0x3f')]=_[_0xa799('0x3d')](_0x2919cd[_0xa799('0x3a')],qs[_0xa799('0x3e')](_0xaa9f32[_0xa799('0x3b')][_0xa799('0x3e')]));_0x1188f5[_0xa799('0x3f')]=_0x1188f5['attributes'][_0xa799('0x40')]?_0x1188f5[_0xa799('0x3f')]:_0x2919cd[_0xa799('0x3a')];if(_0xaa9f32[_0xa799('0x3b')][_0xa799('0x4b')]){_0x1188f5['include']=[{'all':!![]}];}_0x1188f5=_['merge']({},_0x1188f5,_0xaa9f32[_0xa799('0x49')]);return db[_0xa799('0x4a')][_0xa799('0x50')](_0x1188f5)['then'](handleEntityNotFound(_0x529b98,null))['then'](respondWithResult(_0x529b98,null))['catch'](handleError(_0x529b98,null));};exports[_0xa799('0x51')]=function(_0x206386,_0x2f5810){return db[_0xa799('0x4a')][_0xa799('0x51')](_0x206386[_0xa799('0x52')],{})['then'](respondWithResult(_0x2f5810,0xc9))[_0xa799('0x26')](handleError(_0x2f5810,null));};exports[_0xa799('0x31')]=function(_0x204d76,_0x5741ad){if(_0x204d76['body']['id']){delete _0x204d76[_0xa799('0x52')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x204d76[_0xa799('0x4f')]['id']}})[_0xa799('0x1e')](handleEntityNotFound(_0x5741ad,null))[_0xa799('0x1e')](saveUpdates(_0x204d76['body'],null))[_0xa799('0x1e')](respondWithResult(_0x5741ad,null))['catch'](handleError(_0x5741ad,null));};exports[_0xa799('0x32')]=function(_0x412837,_0x233a91){return db['SugarcrmConfiguration'][_0xa799('0x50')]({'where':{'id':_0x412837[_0xa799('0x4f')]['id']}})['then'](handleEntityNotFound(_0x233a91,null))[_0xa799('0x1e')](removeEntity(_0x233a91,null))[_0xa799('0x26')](handleError(_0x233a91,null));};exports['getFields']=function(_0x3073f2,_0x1a76e3,_0x468c35){var _0x1f5047={};var _0x4d32ee={};var _0x6bb43;var _0x3d4c40;return db[_0xa799('0x4a')][_0xa799('0x53')]({'where':{'id':_0x3073f2[_0xa799('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1a76e3,null))[_0xa799('0x1e')](function(_0x2b45c4){if(_0x2b45c4){_0x6bb43=_0x2b45c4;_0x4d32ee[_0xa799('0x3a')]=_[_0xa799('0x3c')](db[_0xa799('0x54')]['rawAttributes']);_0x4d32ee[_0xa799('0x3b')]=_['keys'](_0x3073f2[_0xa799('0x3b')]);_0x4d32ee[_0xa799('0x46')]=_[_0xa799('0x3d')](_0x4d32ee[_0xa799('0x3a')],_0x4d32ee[_0xa799('0x3b')]);_0x1f5047[_0xa799('0x3f')]=_['intersection'](_0x4d32ee[_0xa799('0x3a')],qs[_0xa799('0x3e')](_0x3073f2[_0xa799('0x3b')]['fields']));_0x1f5047['attributes']=_0x1f5047[_0xa799('0x3f')][_0xa799('0x40')]?_0x1f5047[_0xa799('0x3f')]:_0x4d32ee[_0xa799('0x3a')];_0x1f5047[_0xa799('0x42')]=qs['sort'](_0x3073f2['query'][_0xa799('0x43')]);_0x1f5047[_0xa799('0x44')]=qs[_0xa799('0x46')](_[_0xa799('0x45')](_0x3073f2[_0xa799('0x3b')],_0x4d32ee[_0xa799('0x46')]));if(_0x3073f2['query'][_0xa799('0x47')]){_0x1f5047[_0xa799('0x44')]=_[_0xa799('0x48')](_0x1f5047[_0xa799('0x44')],{'$or':_['map'](_0x1f5047[_0xa799('0x3f')],function(_0x33b488){var _0x1c1008={};_0x1c1008[_0x33b488]={'$like':'%'+_0x3073f2[_0xa799('0x3b')][_0xa799('0x47')]+'%'};return _0x1c1008;})});}_0x1f5047=_[_0xa799('0x48')]({},_0x1f5047,_0x3073f2[_0xa799('0x49')]);return _0x6bb43[_0xa799('0x55')](_0x1f5047);}})[_0xa799('0x1e')](function(_0x55e086){if(_0x55e086){_0x3d4c40=_0x55e086[_0xa799('0x40')];if(!_0x3073f2[_0xa799('0x3b')][_0xa799('0x41')](_0xa799('0x56'))){_0x1f5047[_0xa799('0x2c')]=qs[_0xa799('0x2c')](_0x3073f2[_0xa799('0x3b')]['limit']);_0x1f5047['offset']=qs[_0xa799('0x2b')](_0x3073f2[_0xa799('0x3b')][_0xa799('0x2b')]);}return _0x6bb43[_0xa799('0x55')](_0x1f5047);}})['then'](function(_0x3a501d){if(_0x3a501d){return _0x3a501d?{'count':_0x3d4c40,'rows':_0x3a501d}:null;}})[_0xa799('0x1e')](respondWithResult(_0x1a76e3,null))[_0xa799('0x26')](handleError(_0x1a76e3,null));};exports[_0xa799('0x57')]=function(_0x120e26,_0x21003a,_0x12354c){var _0x49fb3a={};var _0x5515e3={};var _0x3222fe;var _0x2236ff;return db['SugarcrmConfiguration'][_0xa799('0x53')]({'where':{'id':_0x120e26[_0xa799('0x4f')]['id']}})[_0xa799('0x1e')](handleEntityNotFound(_0x21003a,null))[_0xa799('0x1e')](function(_0x4597e6){if(_0x4597e6){_0x3222fe=_0x4597e6;_0x5515e3[_0xa799('0x3a')]=_['keys'](db[_0xa799('0x54')][_0xa799('0x37')]);_0x5515e3['query']=_[_0xa799('0x3c')](_0x120e26[_0xa799('0x3b')]);_0x5515e3[_0xa799('0x46')]=_[_0xa799('0x3d')](_0x5515e3[_0xa799('0x3a')],_0x5515e3[_0xa799('0x3b')]);_0x49fb3a['attributes']=_[_0xa799('0x3d')](_0x5515e3['model'],qs['fields'](_0x120e26[_0xa799('0x3b')][_0xa799('0x3e')]));_0x49fb3a[_0xa799('0x3f')]=_0x49fb3a[_0xa799('0x3f')][_0xa799('0x40')]?_0x49fb3a[_0xa799('0x3f')]:_0x5515e3[_0xa799('0x3a')];_0x49fb3a[_0xa799('0x42')]=qs['sort'](_0x120e26[_0xa799('0x3b')][_0xa799('0x43')]);_0x49fb3a[_0xa799('0x44')]=qs[_0xa799('0x46')](_[_0xa799('0x45')](_0x120e26[_0xa799('0x3b')],_0x5515e3['filters']));if(_0x120e26['query'][_0xa799('0x47')]){_0x49fb3a['where']=_[_0xa799('0x48')](_0x49fb3a['where'],{'$or':_['map'](_0x49fb3a['attributes'],function(_0x13b30d){var _0x48e76c={};_0x48e76c[_0x13b30d]={'$like':'%'+_0x120e26['query'][_0xa799('0x47')]+'%'};return _0x48e76c;})});}_0x49fb3a=_[_0xa799('0x48')]({},_0x49fb3a,_0x120e26[_0xa799('0x49')]);return _0x3222fe[_0xa799('0x57')](_0x49fb3a);}})[_0xa799('0x1e')](function(_0x2b8cf1){if(_0x2b8cf1){_0x2236ff=_0x2b8cf1['length'];if(!_0x120e26[_0xa799('0x3b')]['hasOwnProperty']('nolimit')){_0x49fb3a[_0xa799('0x2c')]=qs[_0xa799('0x2c')](_0x120e26[_0xa799('0x3b')][_0xa799('0x2c')]);_0x49fb3a[_0xa799('0x2b')]=qs['offset'](_0x120e26[_0xa799('0x3b')][_0xa799('0x2b')]);}return _0x3222fe[_0xa799('0x57')](_0x49fb3a);}})[_0xa799('0x1e')](function(_0x41c054){if(_0x41c054){return _0x41c054?{'count':_0x2236ff,'rows':_0x41c054}:null;}})[_0xa799('0x1e')](respondWithResult(_0x21003a,null))['catch'](handleError(_0x21003a,null));};exports[_0xa799('0x58')]=function(_0x494270,_0x3669d3,_0x3f3180){var _0x1e294f={};var _0x28848a={};var _0x74286;var _0x384507;return db['SugarcrmConfiguration'][_0xa799('0x53')]({'where':{'id':_0x494270[_0xa799('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3669d3,null))['then'](function(_0x4fc41a){if(_0x4fc41a){_0x74286=_0x4fc41a;_0x28848a[_0xa799('0x3a')]=_[_0xa799('0x3c')](db['SugarcrmField'][_0xa799('0x37')]);_0x28848a[_0xa799('0x3b')]=_[_0xa799('0x3c')](_0x494270['query']);_0x28848a[_0xa799('0x46')]=_[_0xa799('0x3d')](_0x28848a[_0xa799('0x3a')],_0x28848a[_0xa799('0x3b')]);_0x1e294f[_0xa799('0x3f')]=_[_0xa799('0x3d')](_0x28848a['model'],qs[_0xa799('0x3e')](_0x494270[_0xa799('0x3b')][_0xa799('0x3e')]));_0x1e294f[_0xa799('0x3f')]=_0x1e294f[_0xa799('0x3f')]['length']?_0x1e294f[_0xa799('0x3f')]:_0x28848a[_0xa799('0x3a')];_0x1e294f['order']=qs[_0xa799('0x43')](_0x494270[_0xa799('0x3b')][_0xa799('0x43')]);_0x1e294f[_0xa799('0x44')]=qs['filters'](_['pick'](_0x494270[_0xa799('0x3b')],_0x28848a['filters']));if(_0x494270[_0xa799('0x3b')][_0xa799('0x47')]){_0x1e294f['where']=_['merge'](_0x1e294f[_0xa799('0x44')],{'$or':_[_0xa799('0x36')](_0x1e294f[_0xa799('0x3f')],function(_0x16117e){var _0x4fe1ef={};_0x4fe1ef[_0x16117e]={'$like':'%'+_0x494270[_0xa799('0x3b')][_0xa799('0x47')]+'%'};return _0x4fe1ef;})});}_0x1e294f=_[_0xa799('0x48')]({},_0x1e294f,_0x494270[_0xa799('0x49')]);return _0x74286['getDescriptions'](_0x1e294f);}})['then'](function(_0x881d61){if(_0x881d61){_0x384507=_0x881d61[_0xa799('0x40')];if(!_0x494270[_0xa799('0x3b')][_0xa799('0x41')](_0xa799('0x56'))){_0x1e294f['limit']=qs[_0xa799('0x2c')](_0x494270[_0xa799('0x3b')][_0xa799('0x2c')]);_0x1e294f[_0xa799('0x2b')]=qs[_0xa799('0x2b')](_0x494270[_0xa799('0x3b')][_0xa799('0x2b')]);}return _0x74286[_0xa799('0x58')](_0x1e294f);}})[_0xa799('0x1e')](function(_0xfc5be9){if(_0xfc5be9){return _0xfc5be9?{'count':_0x384507,'rows':_0xfc5be9}:null;}})['then'](respondWithResult(_0x3669d3,null))['catch'](handleError(_0x3669d3,null));};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
index 77ed6b9..5988fc7 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 _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
+var _0xc8c6=['define','SugarcrmConfiguration','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x51a344,_0x41934b){var _0xa079dd=function(_0x5f1584){while(--_0x5f1584){_0x51a344['push'](_0x51a344['shift']());}};_0xa079dd(++_0x41934b);}(_0xc8c6,0x98));var _0x6c8c=function(_0x54554e,_0x2202ad){_0x54554e=_0x54554e-0x0;var _0x1f7a99=_0xc8c6[_0x54554e];return _0x1f7a99;};'use strict';var _=require(_0x6c8c('0x0'));var util=require('util');var logger=require(_0x6c8c('0x1'))(_0x6c8c('0x2'));var moment=require(_0x6c8c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c8c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c8c('0x5'));var config=require(_0x6c8c('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x6c8c('0x7')]=function(_0x161e4f,_0x35934e){return _0x161e4f[_0x6c8c('0x8')](_0x6c8c('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','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 21a65d8..e94cdb4 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 _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
+var _0x5642=['client','http','request','then','info','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','result','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4ff41c,_0x483c21){var _0x275644=function(_0xcaef54){while(--_0xcaef54){_0x4ff41c['push'](_0x4ff41c['shift']());}};_0x275644(++_0x483c21);}(_0x5642,0x98));var _0x2564=function(_0x46d21a,_0x46920e){_0x46d21a=_0x46d21a-0x0;var _0x32574f=_0x5642[_0x46d21a];return _0x32574f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2564('0x0'));var rs=require(_0x2564('0x1'));var fs=require('fs');var Redis=require(_0x2564('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2564('0x3'));var logger=require(_0x2564('0x4'))(_0x2564('0x5'));var config=require(_0x2564('0x6'));var jayson=require(_0x2564('0x7'));var client=jayson[_0x2564('0x8')][_0x2564('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f0fe0,_0x28357e,_0x27733b){return new BPromise(function(_0x167a4e,_0x3b86d0){return client[_0x2564('0xa')](_0x1f0fe0,_0x27733b)[_0x2564('0xb')](function(_0x38b39a){logger[_0x2564('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x28357e,_0x2564('0xd'));logger['debug'](_0x2564('0xe'),_0x28357e,_0x2564('0xd'),JSON[_0x2564('0xf')](_0x38b39a));if(_0x38b39a[_0x2564('0x10')]){if(_0x38b39a[_0x2564('0x10')]['code']===0x1f4){logger[_0x2564('0x10')](_0x2564('0x11'),_0x28357e,_0x38b39a[_0x2564('0x10')][_0x2564('0x12')]);return _0x3b86d0(_0x38b39a[_0x2564('0x10')][_0x2564('0x12')]);}logger[_0x2564('0x10')](_0x2564('0x11'),_0x28357e,_0x38b39a[_0x2564('0x10')][_0x2564('0x12')]);return _0x167a4e(_0x38b39a['error'][_0x2564('0x12')]);}else{logger[_0x2564('0xc')](_0x2564('0x11'),_0x28357e,_0x2564('0xd'));_0x167a4e(_0x38b39a[_0x2564('0x13')]['message']);}})['catch'](function(_0x3433aa){logger['error'](_0x2564('0x11'),_0x28357e,_0x3433aa);_0x3b86d0(_0x3433aa);});});}
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js
index 63e33e8..ef9e495 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 _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
+var _0xd4ec=['connect-timeout','Router','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x2940d2,_0x492142){var _0x2a4049=function(_0x5065a5){while(--_0x5065a5){_0x2940d2['push'](_0x2940d2['shift']());}};_0x2a4049(++_0x492142);}(_0xd4ec,0x179));var _0xcd4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4ec[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcd4e('0x0'));var util=require(_0xcd4e('0x1'));var path=require(_0xcd4e('0x2'));var timeout=require(_0xcd4e('0x3'));var express=require('express');var router=express[_0xcd4e('0x4')]();var auth=require(_0xcd4e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcd4e('0x6'));var controller=require(_0xcd4e('0x7'));router[_0xcd4e('0x8')]('/',auth[_0xcd4e('0x9')](),controller[_0xcd4e('0xa')]);router[_0xcd4e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xcd4e('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcd4e('0xc')]);router[_0xcd4e('0xd')](_0xcd4e('0xe'),auth[_0xcd4e('0x9')](),controller[_0xcd4e('0xf')]);router[_0xcd4e('0x10')](_0xcd4e('0xe'),auth[_0xcd4e('0x9')](),controller[_0xcd4e('0x11')]);module[_0xcd4e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js
index 06a0c5b..53a09c8 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 _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
+var _0xa9e7=['ENUM','keyValue','string','STRING','variable','customVariable','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e7,0xfa));var _0x7a9e=function(_0x149c1f,_0x7b4dc6){_0x149c1f=_0x149c1f-0x0;var _0x309eeb=_0xa9e7[_0x149c1f];return _0x309eeb;};'use strict';var Sequelize=require(_0x7a9e('0x0'));module[_0x7a9e('0x1')]={'type':{'type':Sequelize[_0x7a9e('0x2')]('string','variable','customVariable',_0x7a9e('0x3')),'defaultValue':_0x7a9e('0x4')},'content':{'type':Sequelize[_0x7a9e('0x5')]},'key':{'type':Sequelize[_0x7a9e('0x5')]},'keyType':{'type':Sequelize[_0x7a9e('0x2')](_0x7a9e('0x4'),_0x7a9e('0x6'),_0x7a9e('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7a9e('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7a9e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7a9e('0x5')]}};
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js
index 949da75..8e47d68 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 _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
+var _0x6dd8=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','count','includeAll','include','rows','catch','params','intersection','options','find','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x54de06,_0x391c3b){var _0x3610a7=function(_0x21e884){while(--_0x21e884){_0x54de06['push'](_0x54de06['shift']());}};_0x3610a7(++_0x391c3b);}(_0x6dd8,0x87));var _0x86dd=function(_0x145f15,_0x3837a3){_0x145f15=_0x145f15-0x0;var _0x1dd966=_0x6dd8[_0x145f15];return _0x1dd966;};'use strict';var pdf=require(_0x86dd('0x0'));var emlformat=require(_0x86dd('0x1'));var rimraf=require(_0x86dd('0x2'));var zipdir=require(_0x86dd('0x3'));var jsonpatch=require(_0x86dd('0x4'));var rp=require(_0x86dd('0x5'));var moment=require('moment');var BPromise=require(_0x86dd('0x6'));var Mustache=require(_0x86dd('0x7'));var util=require(_0x86dd('0x8'));var path=require(_0x86dd('0x9'));var sox=require(_0x86dd('0xa'));var csv=require(_0x86dd('0xb'));var ejs=require(_0x86dd('0xc'));var fs=require('fs');var _=require(_0x86dd('0xd'));var squel=require(_0x86dd('0xe'));var crypto=require(_0x86dd('0xf'));var jsforce=require(_0x86dd('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x86dd('0x11'));var Papa=require(_0x86dd('0x12'));var Redis=require(_0x86dd('0x13'));var authService=require(_0x86dd('0x14'));var qs=require(_0x86dd('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x86dd('0x16'));var logger=require(_0x86dd('0x17'))(_0x86dd('0x18'));var utils=require(_0x86dd('0x19'));var config=require(_0x86dd('0x1a'));var db=require(_0x86dd('0x1b'))['db'];function respondWithStatusCode(_0x3faf29,_0x4f187b){_0x4f187b=_0x4f187b||0xcc;return function(_0x5d0146){if(_0x5d0146){return _0x3faf29[_0x86dd('0x1c')](_0x4f187b);}return _0x3faf29[_0x86dd('0x1d')](_0x4f187b)['end']();};}function respondWithResult(_0x2fc1bf,_0x4062da){_0x4062da=_0x4062da||0xc8;return function(_0x986836){if(_0x986836){return _0x2fc1bf[_0x86dd('0x1d')](_0x4062da)[_0x86dd('0x1e')](_0x986836);}};}function respondWithFilteredResult(_0x3c00e5,_0x35aa93){return function(_0x127977){if(_0x127977){var _0x3ea11=_0x127977['count'],_0x28177d=_0x35aa93[_0x86dd('0x1f')],_0x52a837=_0x35aa93[_0x86dd('0x1f')]+_0x35aa93['limit'],_0x3e2d7a;if(_0x52a837>=_0x3ea11){_0x52a837=_0x3ea11;_0x3e2d7a=0xc8;}else{_0x3e2d7a=0xce;}_0x3c00e5['status'](_0x3e2d7a);return _0x3c00e5[_0x86dd('0x20')](_0x86dd('0x21'),_0x28177d+'-'+_0x52a837+'/'+_0x3ea11)[_0x86dd('0x1e')](_0x127977);}return null;};}function patchUpdates(_0x12a943){return function(_0x3f1eeb){try{jsonpatch[_0x86dd('0x22')](_0x3f1eeb,_0x12a943,!![]);}catch(_0x2d945c){return BPromise[_0x86dd('0x23')](_0x2d945c);}return _0x3f1eeb[_0x86dd('0x24')]();};}function saveUpdates(_0x21ef48,_0x2bc04c){return function(_0x3b3ba8){if(_0x3b3ba8){return _0x3b3ba8[_0x86dd('0x25')](_0x21ef48)[_0x86dd('0x26')](function(_0x43605d){return _0x43605d;});}return null;};}function removeEntity(_0x12eced,_0x524a75){return function(_0x1c63c7){if(_0x1c63c7){return _0x1c63c7[_0x86dd('0x27')]()[_0x86dd('0x26')](function(){_0x12eced[_0x86dd('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x563f11,_0x39d556){return function(_0x42ea29){if(!_0x42ea29){_0x563f11[_0x86dd('0x1c')](0x194);}return _0x42ea29;};}function handleError(_0x117312,_0x27ea17){_0x27ea17=_0x27ea17||0x1f4;return function(_0x2ce577){logger['error'](_0x2ce577[_0x86dd('0x28')]);if(_0x2ce577['name']){delete _0x2ce577[_0x86dd('0x29')];}_0x117312[_0x86dd('0x1d')](_0x27ea17)['send'](_0x2ce577);};}exports['index']=function(_0x434ba1,_0x7fa460){var _0x2b54cc={},_0xf595f6={},_0x43b480={'count':0x0,'rows':[]};var _0x562041=_['map'](db[_0x86dd('0x2a')][_0x86dd('0x2b')],function(_0x3a9024){return{'name':_0x3a9024[_0x86dd('0x2c')],'type':_0x3a9024[_0x86dd('0x2d')][_0x86dd('0x2e')]};});_0xf595f6[_0x86dd('0x2f')]=_[_0x86dd('0x30')](_0x562041,_0x86dd('0x29'));_0xf595f6[_0x86dd('0x31')]=_[_0x86dd('0x32')](_0x434ba1[_0x86dd('0x31')]);_0xf595f6[_0x86dd('0x33')]=_['intersection'](_0xf595f6[_0x86dd('0x2f')],_0xf595f6['query']);_0x2b54cc[_0x86dd('0x34')]=_['intersection'](_0xf595f6[_0x86dd('0x2f')],qs[_0x86dd('0x35')](_0x434ba1['query']['fields']));_0x2b54cc['attributes']=_0x2b54cc[_0x86dd('0x34')][_0x86dd('0x36')]?_0x2b54cc[_0x86dd('0x34')]:_0xf595f6[_0x86dd('0x2f')];if(!_0x434ba1[_0x86dd('0x31')][_0x86dd('0x37')](_0x86dd('0x38'))){_0x2b54cc[_0x86dd('0x39')]=qs[_0x86dd('0x39')](_0x434ba1['query'][_0x86dd('0x39')]);_0x2b54cc['offset']=qs[_0x86dd('0x1f')](_0x434ba1[_0x86dd('0x31')][_0x86dd('0x1f')]);}_0x2b54cc[_0x86dd('0x3a')]=qs[_0x86dd('0x3b')](_0x434ba1[_0x86dd('0x31')][_0x86dd('0x3b')]);_0x2b54cc['where']=qs[_0x86dd('0x33')](_[_0x86dd('0x3c')](_0x434ba1[_0x86dd('0x31')],_0xf595f6[_0x86dd('0x33')]),_0x562041);if(_0x434ba1[_0x86dd('0x31')][_0x86dd('0x3d')]){_0x2b54cc[_0x86dd('0x3e')]=_[_0x86dd('0x3f')](_0x2b54cc['where'],{'$or':_[_0x86dd('0x30')](_0x562041,function(_0x5e28c5){if(_0x5e28c5[_0x86dd('0x2d')]!==_0x86dd('0x40')){var _0x2b9ce7={};_0x2b9ce7[_0x5e28c5[_0x86dd('0x29')]]={'$like':'%'+_0x434ba1[_0x86dd('0x31')][_0x86dd('0x3d')]+'%'};return _0x2b9ce7;}})});}_0x2b54cc=_['merge']({},_0x2b54cc,_0x434ba1['options']);var _0x297ee7={'where':_0x2b54cc[_0x86dd('0x3e')]};return db[_0x86dd('0x2a')][_0x86dd('0x41')](_0x297ee7)[_0x86dd('0x26')](function(_0x16918e){_0x43b480[_0x86dd('0x41')]=_0x16918e;if(_0x434ba1[_0x86dd('0x31')][_0x86dd('0x42')]){_0x2b54cc[_0x86dd('0x43')]=[{'all':!![]}];}return db[_0x86dd('0x2a')]['findAll'](_0x2b54cc);})[_0x86dd('0x26')](function(_0x1af69b){_0x43b480[_0x86dd('0x44')]=_0x1af69b;return _0x43b480;})[_0x86dd('0x26')](respondWithFilteredResult(_0x7fa460,_0x2b54cc))[_0x86dd('0x45')](handleError(_0x7fa460,null));};exports['show']=function(_0x4a7991,_0x15b934){var _0x4938c7={'raw':!![],'where':{'id':_0x4a7991[_0x86dd('0x46')]['id']}},_0x9f18b5={};_0x9f18b5[_0x86dd('0x2f')]=_[_0x86dd('0x32')](db[_0x86dd('0x2a')]['rawAttributes']);_0x9f18b5['query']=_[_0x86dd('0x32')](_0x4a7991[_0x86dd('0x31')]);_0x9f18b5[_0x86dd('0x33')]=_[_0x86dd('0x47')](_0x9f18b5[_0x86dd('0x2f')],_0x9f18b5['query']);_0x4938c7[_0x86dd('0x34')]=_[_0x86dd('0x47')](_0x9f18b5[_0x86dd('0x2f')],qs[_0x86dd('0x35')](_0x4a7991['query'][_0x86dd('0x35')]));_0x4938c7['attributes']=_0x4938c7[_0x86dd('0x34')][_0x86dd('0x36')]?_0x4938c7[_0x86dd('0x34')]:_0x9f18b5[_0x86dd('0x2f')];if(_0x4a7991[_0x86dd('0x31')][_0x86dd('0x42')]){_0x4938c7[_0x86dd('0x43')]=[{'all':!![]}];}_0x4938c7=_['merge']({},_0x4938c7,_0x4a7991[_0x86dd('0x48')]);return db[_0x86dd('0x2a')][_0x86dd('0x49')](_0x4938c7)[_0x86dd('0x26')](handleEntityNotFound(_0x15b934,null))[_0x86dd('0x26')](respondWithResult(_0x15b934,null))['catch'](handleError(_0x15b934,null));};exports['create']=function(_0x186215,_0x1953c6){return db[_0x86dd('0x2a')]['create'](_0x186215[_0x86dd('0x4a')],{})[_0x86dd('0x26')](respondWithResult(_0x1953c6,0xc9))[_0x86dd('0x45')](handleError(_0x1953c6,null));};exports[_0x86dd('0x25')]=function(_0x3002f2,_0x190e16){if(_0x3002f2[_0x86dd('0x4a')]['id']){delete _0x3002f2[_0x86dd('0x4a')]['id'];}return db[_0x86dd('0x2a')][_0x86dd('0x49')]({'where':{'id':_0x3002f2[_0x86dd('0x46')]['id']}})[_0x86dd('0x26')](handleEntityNotFound(_0x190e16,null))[_0x86dd('0x26')](saveUpdates(_0x3002f2[_0x86dd('0x4a')],null))[_0x86dd('0x26')](respondWithResult(_0x190e16,null))[_0x86dd('0x45')](handleError(_0x190e16,null));};exports['destroy']=function(_0x1dadb9,_0xcb8592){return db[_0x86dd('0x2a')]['find']({'where':{'id':_0x1dadb9[_0x86dd('0x46')]['id']}})[_0x86dd('0x26')](handleEntityNotFound(_0xcb8592,null))['then'](removeEntity(_0xcb8592,null))[_0x86dd('0x45')](handleError(_0xcb8592,null));};
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js
index c347f8b..fe65061 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 _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
+var _0xb7f3=['sugarcrm_unique_index','idField','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields'];(function(_0x547321,_0xd2311d){var _0x786235=function(_0x42e82a){while(--_0x42e82a){_0x547321['push'](_0x547321['shift']());}};_0x786235(++_0xd2311d);}(_0xb7f3,0xc6));var _0x3b7f=function(_0x9ed876,_0x35aca0){_0x9ed876=_0x9ed876-0x0;var _0x4db02e=_0xb7f3[_0x9ed876];return _0x4db02e;};'use strict';var _=require(_0x3b7f('0x0'));var util=require(_0x3b7f('0x1'));var logger=require(_0x3b7f('0x2'))(_0x3b7f('0x3'));var moment=require(_0x3b7f('0x4'));var BPromise=require('bluebird');var rp=require(_0x3b7f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b7f('0x6'));var config=require(_0x3b7f('0x7'));var attributes=require(_0x3b7f('0x8'));module['exports']=function(_0x5c619b,_0x58a21c){return _0x5c619b[_0x3b7f('0x9')](_0x3b7f('0xa'),attributes,{'tableName':_0x3b7f('0xb'),'paranoid':![],'indexes':[{'name':_0x3b7f('0xc'),'fields':[_0x3b7f('0xd'),'FieldId'],'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 2acbbde..d6c2ca3 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 _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
+var _0x5eb8=['info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x45b807,_0x24131c){var _0x291ceb=function(_0x41cf87){while(--_0x41cf87){_0x45b807['push'](_0x45b807['shift']());}};_0x291ceb(++_0x24131c);}(_0x5eb8,0xb0));var _0x85eb=function(_0x5ca784,_0x28bea2){_0x5ca784=_0x5ca784-0x0;var _0x5aa579=_0x5eb8[_0x5ca784];return _0x5aa579;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js
index 03c76e4..1d3b0c6 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 _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
+var _0xa221=['multer','express','Router','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','destroy','exports'];(function(_0x3d82b4,_0x371265){var _0x17dfb7=function(_0x3b1e21){while(--_0x3b1e21){_0x3d82b4['push'](_0x3d82b4['shift']());}};_0x17dfb7(++_0x371265);}(_0xa221,0x1c2));var _0x1a22=function(_0x39b1eb,_0x43af9b){_0x39b1eb=_0x39b1eb-0x0;var _0x435246=_0xa221[_0x39b1eb];return _0x435246;};'use strict';var multer=require(_0x1a22('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1a22('0x1'));var router=express[_0x1a22('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a22('0x3'));var controller=require(_0x1a22('0x4'));router[_0x1a22('0x5')]('/',auth[_0x1a22('0x6')](),controller['index']);router[_0x1a22('0x5')](_0x1a22('0x7'),auth[_0x1a22('0x6')](),controller['show']);router[_0x1a22('0x5')](_0x1a22('0x8'),auth[_0x1a22('0x6')](),controller[_0x1a22('0x9')]);router[_0x1a22('0x5')]('/:id/fields',auth[_0x1a22('0x6')](),controller[_0x1a22('0xa')]);router[_0x1a22('0xb')]('/',auth[_0x1a22('0x6')](),controller[_0x1a22('0xc')]);router[_0x1a22('0xb')](_0x1a22('0x8'),auth[_0x1a22('0x6')](),controller[_0x1a22('0xd')]);router[_0x1a22('0xe')](_0x1a22('0x7'),auth[_0x1a22('0x6')](),controller[_0x1a22('0xf')]);router['delete'](_0x1a22('0x7'),auth['isAuthenticated'](),controller[_0x1a22('0x10')]);module[_0x1a22('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js
index c43203e..22ec08e 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 _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
+var _0xac88=['HelpDesk','sequelize','exports','STRING'];(function(_0x47120,_0x4e4359){var _0x6e0048=function(_0x570f0c){while(--_0x570f0c){_0x47120['push'](_0x47120['shift']());}};_0x6e0048(++_0x4e4359);}(_0xac88,0x141));var _0x8ac8=function(_0x3604f2,_0x2f369b){_0x3604f2=_0x3604f2-0x0;var _0x238dc0=_0xac88[_0x3604f2];return _0x238dc0;};'use strict';var Sequelize=require(_0x8ac8('0x0'));module[_0x8ac8('0x1')]={'name':{'type':Sequelize[_0x8ac8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8ac8('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8ac8('0x2')],'allowNull':![],'defaultValue':_0x8ac8('0x3')},'remoteUri':{'type':Sequelize[_0x8ac8('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8ac8('0x2')]},'accessKey':{'type':Sequelize[_0x8ac8('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js
index a8a984a..2dafb66 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 _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
+var _0xdfe9=['remove','includes','false','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','stringify','send','Wrong\x20credentials','statusCode','html-pdf','eml-format','zip-dir','request-promise','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','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','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','update','name','index','VtigerAccount','fieldName','type','key','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','include','findAll','show','params','rawAttributes','includeAll','create','body','getConfigurations','VtigerConfiguration','sort','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','GET','getchallenge','POST','login','success','describe','sessionName','autogenerated','reference'];(function(_0x1efa0a,_0x166054){var _0xd75b88=function(_0x17f146){while(--_0x17f146){_0x1efa0a['push'](_0x1efa0a['shift']());}};_0xd75b88(++_0x166054);}(_0xdfe9,0x8a));var _0x9dfe=function(_0x180145,_0x356c7a){_0x180145=_0x180145-0x0;var _0x13aad7=_0xdfe9[_0x180145];return _0x13aad7;};'use strict';var pdf=require(_0x9dfe('0x0'));var emlformat=require(_0x9dfe('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9dfe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9dfe('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9dfe('0x4'));var path=require(_0x9dfe('0x5'));var sox=require(_0x9dfe('0x6'));var csv=require(_0x9dfe('0x7'));var ejs=require(_0x9dfe('0x8'));var fs=require('fs');var _=require(_0x9dfe('0x9'));var squel=require('squel');var crypto=require(_0x9dfe('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9dfe('0x7'));var querystring=require(_0x9dfe('0xb'));var Papa=require(_0x9dfe('0xc'));var Redis=require(_0x9dfe('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9dfe('0xe'));var as=require(_0x9dfe('0xf'));var hardwareService=require(_0x9dfe('0x10'));var logger=require(_0x9dfe('0x11'))(_0x9dfe('0x12'));var utils=require('../../config/utils');var config=require(_0x9dfe('0x13'));var db=require(_0x9dfe('0x14'))['db'];var integrations=require(_0x9dfe('0x15'));var jayson=require('jayson/promise');var client=jayson[_0x9dfe('0x16')][_0x9dfe('0x17')]({'port':0x232a});function checkPasswordPattern(_0x2a8019,_0x15d4fe,_0x11abdc){if(_0x11abdc){var _0x4421c5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4421c5['test'](_0x15d4fe)){return _0x2a8019;}else{throw new db[(_0x9dfe('0x18'))][(_0x9dfe('0x19'))](_0x9dfe('0x1a'));}}else{return _0x2a8019;}}function respondWithRpcPromise(_0x3e850c,_0x1b9825,_0x410757,_0x4c3c36){return new BPromise(function(_0x5cab6e,_0xc01291){var _0x363d56=_0x4c3c36||client;return _0x363d56[_0x9dfe('0x1b')](_0x3e850c,_0x410757)[_0x9dfe('0x1c')](function(_0x3fc36a){logger[_0x9dfe('0x1d')](_0x9dfe('0x1e'),_0x1b9825,_0x9dfe('0x1f'));logger[_0x9dfe('0x20')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x1b9825,_0x9dfe('0x1f'),JSON['stringify'](_0x3fc36a));if(_0x3fc36a[_0x9dfe('0x21')]){if(_0x3fc36a[_0x9dfe('0x21')]['code']===0x1f4){logger[_0x9dfe('0x21')]('VtigerAccount,\x20%s,\x20%s',_0x1b9825,_0x3fc36a[_0x9dfe('0x21')]['message']);return _0xc01291(_0x3fc36a['error'][_0x9dfe('0x22')]);}logger['error'](_0x9dfe('0x1e'),_0x1b9825,_0x3fc36a[_0x9dfe('0x21')][_0x9dfe('0x22')]);return _0x5cab6e(_0x3fc36a['error'][_0x9dfe('0x22')]);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x1b9825,_0x9dfe('0x1f'));_0x5cab6e(_0x3fc36a[_0x9dfe('0x23')][_0x9dfe('0x22')]);}})[_0x9dfe('0x24')](function(_0x4a0e8b){logger[_0x9dfe('0x21')](_0x9dfe('0x1e'),_0x1b9825,_0x4a0e8b);_0xc01291(_0x4a0e8b);});});}function respondWithStatusCode(_0x2a5942,_0x453493){_0x453493=_0x453493||0xcc;return function(_0x910ff9){if(_0x910ff9){return _0x2a5942[_0x9dfe('0x25')](_0x453493);}return _0x2a5942[_0x9dfe('0x26')](_0x453493)[_0x9dfe('0x27')]();};}function respondWithResult(_0x454f57,_0x3526ee){_0x3526ee=_0x3526ee||0xc8;return function(_0x5c21d){if(_0x5c21d){return _0x454f57[_0x9dfe('0x26')](_0x3526ee)[_0x9dfe('0x28')](_0x5c21d);}};}function respondWithFilteredResult(_0x2c3068,_0x41de79){return function(_0x33a955){if(_0x33a955){var _0x4c0d99=_0x33a955['count'],_0x4fde9e=_0x41de79['offset'],_0x1bf544=_0x41de79[_0x9dfe('0x29')]+_0x41de79[_0x9dfe('0x2a')],_0x875907;if(_0x1bf544>=_0x4c0d99){_0x1bf544=_0x4c0d99;_0x875907=0xc8;}else{_0x875907=0xce;}_0x2c3068[_0x9dfe('0x26')](_0x875907);return _0x2c3068['set'](_0x9dfe('0x2b'),_0x4fde9e+'-'+_0x1bf544+'/'+_0x4c0d99)[_0x9dfe('0x28')](_0x33a955);}return null;};}function patchUpdates(_0x220adc){return function(_0x38349e){try{jsonpatch['apply'](_0x38349e,_0x220adc,!![]);}catch(_0x1d15be){return BPromise[_0x9dfe('0x2c')](_0x1d15be);}return _0x38349e[_0x9dfe('0x2d')]();};}function saveUpdates(_0x10ac4a,_0x17da7c){return function(_0x1de91a){if(_0x1de91a){return _0x1de91a[_0x9dfe('0x2e')](_0x10ac4a)['then'](function(_0x1f11df){return _0x1f11df;});}return null;};}function removeEntity(_0x5b4186,_0x2294f6){return function(_0x2dd872){if(_0x2dd872){return _0x2dd872['destroy']()[_0x9dfe('0x1c')](function(){_0x5b4186[_0x9dfe('0x26')](0xcc)[_0x9dfe('0x27')]();});}};}function handleEntityNotFound(_0x56588b,_0x570609){return function(_0x275b39){if(!_0x275b39){_0x56588b[_0x9dfe('0x25')](0x194);}return _0x275b39;};}function handleError(_0x1577f4,_0x578278){_0x578278=_0x578278||0x1f4;return function(_0x16e830){logger[_0x9dfe('0x21')](_0x16e830['stack']);if(_0x16e830[_0x9dfe('0x2f')]){delete _0x16e830[_0x9dfe('0x2f')];}_0x1577f4[_0x9dfe('0x26')](_0x578278)['send'](_0x16e830);};}exports[_0x9dfe('0x30')]=function(_0xe22818,_0x30b6de){var _0x507870={},_0x4cfced={},_0x5f09a6={'count':0x0,'rows':[]};var _0x34fb03=_['map'](db[_0x9dfe('0x31')]['rawAttributes'],function(_0x29dd8c){return{'name':_0x29dd8c[_0x9dfe('0x32')],'type':_0x29dd8c[_0x9dfe('0x33')][_0x9dfe('0x34')]};});_0x4cfced[_0x9dfe('0x35')]=_[_0x9dfe('0x36')](_0x34fb03,_0x9dfe('0x2f'));_0x4cfced['query']=_[_0x9dfe('0x37')](_0xe22818['query']);_0x4cfced[_0x9dfe('0x38')]=_[_0x9dfe('0x39')](_0x4cfced['model'],_0x4cfced[_0x9dfe('0x3a')]);_0x507870['attributes']=_[_0x9dfe('0x39')](_0x4cfced[_0x9dfe('0x35')],qs['fields'](_0xe22818['query'][_0x9dfe('0x3b')]));_0x507870[_0x9dfe('0x3c')]=_0x507870[_0x9dfe('0x3c')][_0x9dfe('0x3d')]?_0x507870[_0x9dfe('0x3c')]:_0x4cfced[_0x9dfe('0x35')];if(!_0xe22818[_0x9dfe('0x3a')][_0x9dfe('0x3e')](_0x9dfe('0x3f'))){_0x507870[_0x9dfe('0x2a')]=qs[_0x9dfe('0x2a')](_0xe22818[_0x9dfe('0x3a')][_0x9dfe('0x2a')]);_0x507870[_0x9dfe('0x29')]=qs[_0x9dfe('0x29')](_0xe22818['query'][_0x9dfe('0x29')]);}_0x507870[_0x9dfe('0x40')]=qs['sort'](_0xe22818[_0x9dfe('0x3a')]['sort']);_0x507870[_0x9dfe('0x41')]=qs[_0x9dfe('0x38')](_[_0x9dfe('0x42')](_0xe22818['query'],_0x4cfced[_0x9dfe('0x38')]),_0x34fb03);if(_0xe22818[_0x9dfe('0x3a')]['filter']){_0x507870[_0x9dfe('0x41')]=_[_0x9dfe('0x43')](_0x507870[_0x9dfe('0x41')],{'$or':_['map'](_0x34fb03,function(_0x3f759b){if(_0x3f759b[_0x9dfe('0x33')]!==_0x9dfe('0x44')){var _0x59b970={};_0x59b970[_0x3f759b[_0x9dfe('0x2f')]]={'$like':'%'+_0xe22818[_0x9dfe('0x3a')][_0x9dfe('0x45')]+'%'};return _0x59b970;}})});}_0x507870=_[_0x9dfe('0x43')]({},_0x507870,_0xe22818[_0x9dfe('0x46')]);var _0x2bb46b={'where':_0x507870[_0x9dfe('0x41')]};return db[_0x9dfe('0x31')]['count'](_0x2bb46b)[_0x9dfe('0x1c')](function(_0x36636c){_0x5f09a6['count']=_0x36636c;if(_0xe22818[_0x9dfe('0x3a')]['includeAll']){_0x507870[_0x9dfe('0x47')]=[{'all':!![]}];}return db['VtigerAccount'][_0x9dfe('0x48')](_0x507870);})[_0x9dfe('0x1c')](function(_0x542662){_0x5f09a6['rows']=_0x542662;return _0x5f09a6;})[_0x9dfe('0x1c')](respondWithFilteredResult(_0x30b6de,_0x507870))['catch'](handleError(_0x30b6de,null));};exports[_0x9dfe('0x49')]=function(_0x1477cd,_0x44b217){var _0x28a7be={'raw':![],'where':{'id':_0x1477cd[_0x9dfe('0x4a')]['id']}},_0x179bae={};_0x179bae[_0x9dfe('0x35')]=_[_0x9dfe('0x37')](db[_0x9dfe('0x31')][_0x9dfe('0x4b')]);_0x179bae['query']=_[_0x9dfe('0x37')](_0x1477cd[_0x9dfe('0x3a')]);_0x179bae[_0x9dfe('0x38')]=_[_0x9dfe('0x39')](_0x179bae[_0x9dfe('0x35')],_0x179bae[_0x9dfe('0x3a')]);_0x28a7be[_0x9dfe('0x3c')]=_[_0x9dfe('0x39')](_0x179bae['model'],qs[_0x9dfe('0x3b')](_0x1477cd[_0x9dfe('0x3a')]['fields']));_0x28a7be[_0x9dfe('0x3c')]=_0x28a7be[_0x9dfe('0x3c')]['length']?_0x28a7be[_0x9dfe('0x3c')]:_0x179bae[_0x9dfe('0x35')];if(_0x1477cd[_0x9dfe('0x3a')][_0x9dfe('0x4c')]){_0x28a7be[_0x9dfe('0x47')]=[{'all':!![]}];}_0x28a7be=_['merge']({},_0x28a7be,_0x1477cd[_0x9dfe('0x46')]);return db['VtigerAccount']['find'](_0x28a7be)[_0x9dfe('0x1c')](handleEntityNotFound(_0x44b217,null))[_0x9dfe('0x1c')](respondWithResult(_0x44b217,null))[_0x9dfe('0x24')](handleError(_0x44b217,null));};exports[_0x9dfe('0x4d')]=function(_0x4ab503,_0x1e262e){return db['VtigerAccount'][_0x9dfe('0x4d')](_0x4ab503['body'],{})['then'](respondWithResult(_0x1e262e,0xc9))['catch'](handleError(_0x1e262e,null));};exports[_0x9dfe('0x2e')]=function(_0x567aab,_0x2d68c8){if(_0x567aab[_0x9dfe('0x4e')]['id']){delete _0x567aab[_0x9dfe('0x4e')]['id'];}return db[_0x9dfe('0x31')]['find']({'where':{'id':_0x567aab['params']['id']}})[_0x9dfe('0x1c')](handleEntityNotFound(_0x2d68c8,null))['then'](saveUpdates(_0x567aab['body'],null))['then'](respondWithResult(_0x2d68c8,null))[_0x9dfe('0x24')](handleError(_0x2d68c8,null));};exports['destroy']=function(_0x63e33c,_0x10b79e){return db[_0x9dfe('0x31')]['find']({'where':{'id':_0x63e33c[_0x9dfe('0x4a')]['id']}})[_0x9dfe('0x1c')](handleEntityNotFound(_0x10b79e,null))[_0x9dfe('0x1c')](removeEntity(_0x10b79e,null))[_0x9dfe('0x24')](handleError(_0x10b79e,null));};exports[_0x9dfe('0x4f')]=function(_0x1f009b,_0x4c7cce,_0x2bcc4d){var _0x26fc85={};var _0x239b72={};var _0x4d7d22;var _0x4dcf32;return db[_0x9dfe('0x31')]['findOne']({'where':{'id':_0x1f009b[_0x9dfe('0x4a')]['id']}})[_0x9dfe('0x1c')](handleEntityNotFound(_0x4c7cce,null))[_0x9dfe('0x1c')](function(_0x3fe115){if(_0x3fe115){_0x4d7d22=_0x3fe115;_0x239b72['model']=_[_0x9dfe('0x37')](db[_0x9dfe('0x50')][_0x9dfe('0x4b')]);_0x239b72[_0x9dfe('0x3a')]=_['keys'](_0x1f009b[_0x9dfe('0x3a')]);_0x239b72[_0x9dfe('0x38')]=_[_0x9dfe('0x39')](_0x239b72[_0x9dfe('0x35')],_0x239b72[_0x9dfe('0x3a')]);_0x26fc85['attributes']=_[_0x9dfe('0x39')](_0x239b72[_0x9dfe('0x35')],qs[_0x9dfe('0x3b')](_0x1f009b['query'][_0x9dfe('0x3b')]));_0x26fc85[_0x9dfe('0x3c')]=_0x26fc85['attributes'][_0x9dfe('0x3d')]?_0x26fc85[_0x9dfe('0x3c')]:_0x239b72['model'];_0x26fc85[_0x9dfe('0x40')]=qs['sort'](_0x1f009b['query'][_0x9dfe('0x51')]);_0x26fc85[_0x9dfe('0x41')]=qs[_0x9dfe('0x38')](_[_0x9dfe('0x42')](_0x1f009b[_0x9dfe('0x3a')],_0x239b72[_0x9dfe('0x38')]));if(_0x1f009b[_0x9dfe('0x3a')][_0x9dfe('0x45')]){_0x26fc85['where']=_['merge'](_0x26fc85[_0x9dfe('0x41')],{'$or':_[_0x9dfe('0x36')](_0x26fc85[_0x9dfe('0x3c')],function(_0x56daa9){var _0x484a90={};_0x484a90[_0x56daa9]={'$like':'%'+_0x1f009b['query'][_0x9dfe('0x45')]+'%'};return _0x484a90;})});}_0x26fc85=_['merge']({},_0x26fc85,_0x1f009b[_0x9dfe('0x46')]);return _0x4d7d22[_0x9dfe('0x4f')](_0x26fc85);}})[_0x9dfe('0x1c')](function(_0x2757ab){if(_0x2757ab){_0x4dcf32=_0x2757ab['length'];if(!_0x1f009b[_0x9dfe('0x3a')][_0x9dfe('0x3e')](_0x9dfe('0x3f'))){_0x26fc85[_0x9dfe('0x2a')]=qs['limit'](_0x1f009b['query'][_0x9dfe('0x2a')]);_0x26fc85['offset']=qs['offset'](_0x1f009b['query'][_0x9dfe('0x29')]);}return _0x4d7d22[_0x9dfe('0x4f')](_0x26fc85);}})[_0x9dfe('0x1c')](function(_0x178249){if(_0x178249){return _0x178249?{'count':_0x4dcf32,'rows':_0x178249}:null;}})[_0x9dfe('0x1c')](respondWithResult(_0x4c7cce,null))[_0x9dfe('0x24')](handleError(_0x4c7cce,null));};exports[_0x9dfe('0x52')]=function(_0x895e30,_0x4e082c,_0x123daf){if(_0x895e30['body']['id']){delete _0x895e30[_0x9dfe('0x4e')]['id'];}return db[_0x9dfe('0x31')][_0x9dfe('0x53')]({'where':{'id':_0x895e30['params']['id']}})[_0x9dfe('0x1c')](handleEntityNotFound(_0x4e082c,null))[_0x9dfe('0x1c')](function(_0x282ef8){if(_0x282ef8){_0x895e30[_0x9dfe('0x4e')][_0x9dfe('0x54')]=_0x282ef8['id'];_0x895e30['body'][_0x9dfe('0x55')]=integrations[_0x9dfe('0x56')](_0x895e30[_0x9dfe('0x4e')][_0x9dfe('0x57')],_0x895e30['body'][_0x9dfe('0x33')]);_0x895e30[_0x9dfe('0x4e')][_0x9dfe('0x58')]=integrations[_0x9dfe('0x59')](_0x895e30[_0x9dfe('0x4e')][_0x9dfe('0x57')],_0x895e30[_0x9dfe('0x4e')]['type']);return db[_0x9dfe('0x50')]['create'](_0x895e30['body'],{'include':[{'model':db[_0x9dfe('0x5a')],'as':_0x9dfe('0x55')},{'model':db[_0x9dfe('0x5a')],'as':'Descriptions'}]});}return null;})[_0x9dfe('0x1c')](respondWithResult(_0x4e082c,null))[_0x9dfe('0x24')](handleError(_0x4e082c,null));};var md5=require(_0x9dfe('0x5b'));exports[_0x9dfe('0x5c')]=function(_0x2e689c,_0x5e7086,_0x464cd7){var _0x39bf31=null;var _0x4ab797=null;var _0x2bafc3=null;var _0x166dbb=null;var _0x16130b='';return db[_0x9dfe('0x31')][_0x9dfe('0x53')]({'where':{'id':_0x2e689c[_0x9dfe('0x4a')]['id']},'attributes':['id',_0x9dfe('0x2f'),_0x9dfe('0x5d'),_0x9dfe('0x5e'),_0x9dfe('0x5f'),_0x9dfe('0x60'),_0x9dfe('0x61'),_0x9dfe('0x62')]})[_0x9dfe('0x1c')](handleEntityNotFound(_0x5e7086,null))[_0x9dfe('0x1c')](function(_0x107d00){if(_0x107d00){_0x39bf31=_0x107d00[_0x9dfe('0x5d')];_0x4ab797=_0x107d00['accessKey'];_0x2bafc3=_0x107d00[_0x9dfe('0x5f')];_0x16130b=_0x107d00[_0x9dfe('0x60')];var _0x3516f6=_0x16130b[_0x9dfe('0x63')](-0x1);if(_0x3516f6==='/'){_0x16130b=_0x16130b[_0x9dfe('0x64')](0x0,_0x16130b['lastIndexOf'](_0x3516f6));}_0x166dbb=util['format']('%s/webservice.php',_0x16130b);var _0x526c0e={'method':_0x9dfe('0x65'),'uri':_0x166dbb,'qs':{'operation':_0x9dfe('0x66'),'username':_0x107d00[_0x9dfe('0x5d')]},'json':!![]};return rp(_0x526c0e);}})['then'](function(_0x16de3f){if(_0x16de3f['success']){var _0x250411={'method':_0x9dfe('0x67'),'uri':_0x166dbb,'form':{'operation':_0x9dfe('0x68'),'username':_0x39bf31,'accessKey':md5(_0x16de3f['result']['token']+_0x4ab797)},'json':!![]};return rp(_0x250411);}})[_0x9dfe('0x1c')](function(_0x548764){if(_0x548764[_0x9dfe('0x69')]){var _0x4623af={'method':_0x9dfe('0x65'),'uri':_0x166dbb,'qs':{'operation':_0x9dfe('0x6a'),'username':_0x39bf31,'sessionName':_0x548764[_0x9dfe('0x23')][_0x9dfe('0x6b')],'elementType':_0x2bafc3},'json':!![]};return rp(_0x4623af);}})[_0x9dfe('0x1c')](function(_0x17f95b){if(_0x17f95b[_0x9dfe('0x69')]){var _0x383d45=[_0x9dfe('0x6c'),_0x9dfe('0x6d'),'owner'];_[_0x9dfe('0x6e')](_0x17f95b['result']['fields'],function(_0x383d8e){return _0x383d45[_0x9dfe('0x6f')](_0x383d8e[_0x9dfe('0x33')][_0x9dfe('0x2f')]);});_[_0x9dfe('0x6e')](_0x17f95b[_0x9dfe('0x23')][_0x9dfe('0x3b')],function(_0x22cfba){return _0x22cfba['editable']===_0x9dfe('0x70');});return{'count':_0x17f95b[_0x9dfe('0x23')][_0x9dfe('0x3b')]['length'],'rows':_['map'](_0x17f95b['result']['fields'],function(_0x4964df){return{'id':_0x4964df[_0x9dfe('0x2f')],'name':_0x4964df['label'],'custom':_['startsWith'](_0x4964df[_0x9dfe('0x2f')],_0x9dfe('0x71'))?!![]:![],'options':_0x4964df[_0x9dfe('0x33')][_0x9dfe('0x2f')]===_0x9dfe('0x72')&&_0x4964df[_0x9dfe('0x33')]['picklistValues'][_0x9dfe('0x3d')]>0x0?_[_0x9dfe('0x36')](_0x4964df[_0x9dfe('0x33')][_0x9dfe('0x73')],function(_0x16dd23){return{'name':_0x16dd23['label'],'value':_0x16dd23[_0x9dfe('0x74')]};}):[]};})};}})[_0x9dfe('0x1c')](respondWithResult(_0x5e7086,null))[_0x9dfe('0x24')](function(_0xa89f12){console[_0x9dfe('0x75')](_0x9dfe('0x76')+_0xa89f12);var _0x23fec5=_0x2e689c[_0x9dfe('0x3a')][_0x9dfe('0x77')]?0x1f4:_0xa89f12['statusCode']||0x1f4;logger[_0x9dfe('0x21')]('getFields,\x20%s,\x20%s,\x20%s',_0x9dfe('0x5c'),_0x23fec5,JSON[_0x9dfe('0x78')](_0xa89f12));delete _0xa89f12['name'];if(_0x23fec5===0x191){_0x23fec5=0x190;}_0x5e7086[_0x9dfe('0x26')](_0x23fec5)[_0x9dfe('0x79')](_0x2e689c['query'][_0x9dfe('0x77')]?{'message':_0x9dfe('0x7a'),'statusCode':_0xa89f12[_0x9dfe('0x7b')]}:_0xa89f12);});};
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js
index 8975270..48a47ec 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 _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
+var _0xde9d=['./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x50912c,_0x4c29d7){var _0x3f955d=function(_0x15b773){while(--_0x15b773){_0x50912c['push'](_0x50912c['shift']());}};_0x3f955d(++_0x4c29d7);}(_0xde9d,0x156));var _0xdde9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xde9d[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xdde9('0x0'));var util=require(_0xdde9('0x1'));var logger=require(_0xdde9('0x2'))(_0xdde9('0x3'));var moment=require(_0xdde9('0x4'));var BPromise=require('bluebird');var rp=require(_0xdde9('0x5'));var fs=require('fs');var path=require(_0xdde9('0x6'));var rimraf=require(_0xdde9('0x7'));var config=require('../../config/environment');var attributes=require(_0xdde9('0x8'));var integrations=require(_0xdde9('0x9'));module[_0xdde9('0xa')]=function(_0x4c10e9,_0x289ccb){return _0x4c10e9[_0xdde9('0xb')](_0xdde9('0xc'),attributes,{'tableName':_0xdde9('0xd'),'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 bc142cf..95f4a48 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 _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
+var _0x9ff1=['GetVtigerAccount','debug','ShowVtigerAccount','raw','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','VtigerAccount','findAll','options','where','attributes','limit','include','map','model'];(function(_0x38d19d,_0x2cc1ff){var _0x5d9e77=function(_0x4b808b){while(--_0x4b808b){_0x38d19d['push'](_0x38d19d['shift']());}};_0x5d9e77(++_0x2cc1ff);}(_0x9ff1,0x10c));var _0x19ff=function(_0x585234,_0x3ae470){_0x585234=_0x585234-0x0;var _0x28b8a7=_0x9ff1[_0x585234];return _0x28b8a7;};'use strict';var _=require(_0x19ff('0x0'));var util=require(_0x19ff('0x1'));var moment=require(_0x19ff('0x2'));var BPromise=require(_0x19ff('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19ff('0x4'))['db'];var utils=require(_0x19ff('0x5'));var logger=require(_0x19ff('0x6'))(_0x19ff('0x7'));var config=require(_0x19ff('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1395cb,_0x339a74,_0x229fc0){return new BPromise(function(_0x36ff2a,_0x3caeff){return client[_0x19ff('0x9')](_0x1395cb,_0x229fc0)[_0x19ff('0xa')](function(_0x5cc5da){logger[_0x19ff('0xb')](_0x19ff('0xc'),_0x339a74,'request\x20sent');logger['debug'](_0x19ff('0xd'),_0x339a74,_0x19ff('0xe'),JSON[_0x19ff('0xf')](_0x5cc5da));if(_0x5cc5da['error']){if(_0x5cc5da['error']['code']===0x1f4){logger[_0x19ff('0x10')](_0x19ff('0xc'),_0x339a74,_0x5cc5da['error'][_0x19ff('0x11')]);return _0x3caeff(_0x5cc5da[_0x19ff('0x10')][_0x19ff('0x11')]);}logger[_0x19ff('0x10')](_0x19ff('0xc'),_0x339a74,_0x5cc5da[_0x19ff('0x10')][_0x19ff('0x11')]);return _0x36ff2a(_0x5cc5da[_0x19ff('0x10')][_0x19ff('0x11')]);}else{logger[_0x19ff('0xb')](_0x19ff('0xc'),_0x339a74,_0x19ff('0xe'));_0x36ff2a(_0x5cc5da[_0x19ff('0x12')][_0x19ff('0x11')]);}})[_0x19ff('0x13')](function(_0x4550e5){logger[_0x19ff('0x10')](_0x19ff('0xc'),_0x339a74,_0x4550e5);_0x3caeff(_0x4550e5);});});}exports['GetVtigerAccount']=function(_0x1913ec){var _0xe3924a=this;return new Promise(function(_0x30e693,_0x3db9b8){return db[_0x19ff('0x14')][_0x19ff('0x15')]({'raw':_0x1913ec[_0x19ff('0x16')]?_0x1913ec[_0x19ff('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1913ec[_0x19ff('0x16')]?_0x1913ec['options'][_0x19ff('0x17')]||null:null,'attributes':_0x1913ec['options']?_0x1913ec[_0x19ff('0x16')][_0x19ff('0x18')]||null:null,'limit':_0x1913ec['options']?_0x1913ec[_0x19ff('0x16')][_0x19ff('0x19')]||null:null,'include':_0x1913ec[_0x19ff('0x16')]?_0x1913ec[_0x19ff('0x16')][_0x19ff('0x1a')]?_[_0x19ff('0x1b')](_0x1913ec['options'][_0x19ff('0x1a')],function(_0x3b4e8c){return{'model':db[_0x3b4e8c[_0x19ff('0x1c')]],'as':_0x3b4e8c['as'],'attributes':_0x3b4e8c[_0x19ff('0x18')],'include':_0x3b4e8c[_0x19ff('0x1a')]?_[_0x19ff('0x1b')](_0x3b4e8c[_0x19ff('0x1a')],function(_0x113f49){return{'model':db[_0x113f49['model']],'as':_0x113f49['as'],'attributes':_0x113f49[_0x19ff('0x18')],'include':_0x113f49[_0x19ff('0x1a')]?_[_0x19ff('0x1b')](_0x113f49[_0x19ff('0x1a')],function(_0x1928d){return{'model':db[_0x1928d['model']],'as':_0x1928d['as'],'attributes':_0x1928d[_0x19ff('0x18')]};}):[]};}):[]};}):[]:[]})[_0x19ff('0xa')](function(_0x4d4279){logger['info'](_0x19ff('0x1d'),_0x1913ec);logger[_0x19ff('0x1e')](_0x19ff('0x1d'),_0x1913ec,JSON[_0x19ff('0xf')](_0x4d4279));_0x30e693(_0x4d4279);})[_0x19ff('0x13')](function(_0x2c3b83){logger[_0x19ff('0x10')](_0x19ff('0x1d'),_0x2c3b83[_0x19ff('0x11')],_0x1913ec);_0x3db9b8(_0xe3924a[_0x19ff('0x10')](0x1f4,_0x2c3b83[_0x19ff('0x11')]));});});};exports[_0x19ff('0x1f')]=function(_0x566cb3){var _0xe6846c=this;return new Promise(function(_0x2a3111,_0x14e1d1){return db[_0x19ff('0x14')]['find']({'raw':_0x566cb3[_0x19ff('0x16')]?_0x566cb3['options'][_0x19ff('0x20')]===undefined?!![]:![]:!![],'where':_0x566cb3[_0x19ff('0x16')]?_0x566cb3['options'][_0x19ff('0x17')]||null:null,'attributes':_0x566cb3[_0x19ff('0x16')]?_0x566cb3[_0x19ff('0x16')]['attributes']||null:null,'include':_0x566cb3['options']?_0x566cb3['options']['include']?_[_0x19ff('0x1b')](_0x566cb3[_0x19ff('0x16')][_0x19ff('0x1a')],function(_0x347491){return{'model':db[_0x347491[_0x19ff('0x1c')]],'as':_0x347491['as'],'attributes':_0x347491[_0x19ff('0x18')],'include':_0x347491[_0x19ff('0x1a')]?_['map'](_0x347491[_0x19ff('0x1a')],function(_0x3616af){return{'model':db[_0x3616af[_0x19ff('0x1c')]],'as':_0x3616af['as'],'attributes':_0x3616af[_0x19ff('0x18')],'include':_0x3616af[_0x19ff('0x1a')]?_['map'](_0x3616af['include'],function(_0x556bc2){return{'model':db[_0x556bc2[_0x19ff('0x1c')]],'as':_0x556bc2['as'],'attributes':_0x556bc2[_0x19ff('0x18')]};}):[]};}):[]};}):[]:[]})[_0x19ff('0xa')](function(_0x2f7d2f){logger[_0x19ff('0xb')]('ShowVtigerAccount',_0x566cb3);logger['debug'](_0x19ff('0x1f'),_0x566cb3,JSON['stringify'](_0x2f7d2f));_0x2a3111(_0x2f7d2f);})[_0x19ff('0x13')](function(_0x51f640){logger['error'](_0x19ff('0x1f'),_0x51f640[_0x19ff('0x11')],_0x566cb3);_0x14e1d1(_0xe6846c[_0x19ff('0x10')](0x1f4,_0x51f640['message']));});});};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js
index 02f5764..dafd507 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 _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
+var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getDescriptions','post','create'];(function(_0x45781,_0x266641){var _0x10783b=function(_0xd1be3c){while(--_0xd1be3c){_0x45781['push'](_0x45781['shift']());}};_0x10783b(++_0x266641);}(_0x5f2f,0x73));var _0xf5f2=function(_0x48cde8,_0x1eccef){_0x48cde8=_0x48cde8-0x0;var _0x3d7ee5=_0x5f2f[_0x48cde8];return _0x3d7ee5;};'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('./intVtigerConfiguration.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['getFields']);router[_0xf5f2('0x8')](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller['getSubjects']);router[_0xf5f2('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0xf')]('/',auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router[_0xf5f2('0x11')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('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 feb601d..7d887b6 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 _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
+var _0x99ce=['STRING','sequelize','exports'];(function(_0x1f1511,_0x4ea911){var _0x1d9ab8=function(_0x53276a){while(--_0x53276a){_0x1f1511['push'](_0x1f1511['shift']());}};_0x1d9ab8(++_0x4ea911);}(_0x99ce,0x16c));var _0xe99c=function(_0x341b44,_0x1c7131){_0x341b44=_0x341b44-0x0;var _0x1cb37b=_0x99ce[_0x341b44];return _0x1cb37b;};'use strict';var Sequelize=require(_0xe99c('0x0'));module[_0xe99c('0x1')]={'name':{'type':Sequelize[_0xe99c('0x2')]},'description':{'type':Sequelize[_0xe99c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
index 638b392..9658797 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 _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
+var _0x9e2a=['message','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','map','VtigerConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','keys','includeAll','find','create','body','findOne','VtigerField','getFields','getSubjects','getDescriptions','html-pdf','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x3367c1,_0x52ccc2){var _0x3bf1d0=function(_0xe42fd5){while(--_0xe42fd5){_0x3367c1['push'](_0x3367c1['shift']());}};_0x3bf1d0(++_0x52ccc2);}(_0x9e2a,0xe1));var _0xa9e2=function(_0x2d1d2c,_0x23f59a){_0x2d1d2c=_0x2d1d2c-0x0;var _0x3ca6f6=_0x9e2a[_0x2d1d2c];return _0x3ca6f6;};'use strict';var pdf=require(_0xa9e2('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa9e2('0x1'));var moment=require(_0xa9e2('0x2'));var BPromise=require(_0xa9e2('0x3'));var Mustache=require(_0xa9e2('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa9e2('0x5'));var ejs=require(_0xa9e2('0x6'));var fs=require('fs');var _=require(_0xa9e2('0x7'));var squel=require(_0xa9e2('0x8'));var crypto=require(_0xa9e2('0x9'));var jsforce=require(_0xa9e2('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa9e2('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa9e2('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xa9e2('0xc'));var as=require(_0xa9e2('0xd'));var hardwareService=require(_0xa9e2('0xe'));var logger=require('../../config/logger')(_0xa9e2('0xf'));var utils=require(_0xa9e2('0x10'));var config=require(_0xa9e2('0x11'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa9e2('0x12'));var client=jayson[_0xa9e2('0x13')][_0xa9e2('0x14')]({'port':0x232a});function checkPasswordPattern(_0x26774f,_0x9146a6,_0x402bc5){if(_0x402bc5){var _0x3e9ed5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e9ed5[_0xa9e2('0x15')](_0x9146a6)){return _0x26774f;}else{throw new db[(_0xa9e2('0x16'))][(_0xa9e2('0x17'))]('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 _0x26774f;}}function respondWithRpcPromise(_0x2f6e74,_0x4aed84,_0x4a26f3,_0x29b289){return new BPromise(function(_0x5ea885,_0x576cb8){var _0x117c15=_0x29b289||client;return _0x117c15[_0xa9e2('0x18')](_0x2f6e74,_0x4a26f3)[_0xa9e2('0x19')](function(_0x1ecb9d){logger[_0xa9e2('0x1a')](_0xa9e2('0x1b'),_0x4aed84,'request\x20sent');logger[_0xa9e2('0x1c')](_0xa9e2('0x1d'),_0x4aed84,_0xa9e2('0x1e'),JSON['stringify'](_0x1ecb9d));if(_0x1ecb9d[_0xa9e2('0x1f')]){if(_0x1ecb9d['error'][_0xa9e2('0x20')]===0x1f4){logger['error'](_0xa9e2('0x1b'),_0x4aed84,_0x1ecb9d[_0xa9e2('0x1f')]['message']);return _0x576cb8(_0x1ecb9d['error']['message']);}logger['error'](_0xa9e2('0x1b'),_0x4aed84,_0x1ecb9d[_0xa9e2('0x1f')][_0xa9e2('0x21')]);return _0x5ea885(_0x1ecb9d['error'][_0xa9e2('0x21')]);}else{logger[_0xa9e2('0x1a')](_0xa9e2('0x1b'),_0x4aed84,_0xa9e2('0x1e'));_0x5ea885(_0x1ecb9d['result']['message']);}})['catch'](function(_0x53bd8d){logger['error'](_0xa9e2('0x1b'),_0x4aed84,_0x53bd8d);_0x576cb8(_0x53bd8d);});});}function respondWithStatusCode(_0x2cd269,_0x3b12bf){_0x3b12bf=_0x3b12bf||0xcc;return function(_0x443735){if(_0x443735){return _0x2cd269[_0xa9e2('0x22')](_0x3b12bf);}return _0x2cd269[_0xa9e2('0x23')](_0x3b12bf)[_0xa9e2('0x24')]();};}function respondWithResult(_0x5f3e4c,_0x31fdc0){_0x31fdc0=_0x31fdc0||0xc8;return function(_0x196e12){if(_0x196e12){return _0x5f3e4c[_0xa9e2('0x23')](_0x31fdc0)[_0xa9e2('0x25')](_0x196e12);}};}function respondWithFilteredResult(_0x599906,_0x298eb3){return function(_0x4d153a){if(_0x4d153a){var _0x43bc3b=_0x4d153a[_0xa9e2('0x26')],_0x333d8e=_0x298eb3[_0xa9e2('0x27')],_0x233e6b=_0x298eb3['offset']+_0x298eb3[_0xa9e2('0x28')],_0x30b7b2;if(_0x233e6b>=_0x43bc3b){_0x233e6b=_0x43bc3b;_0x30b7b2=0xc8;}else{_0x30b7b2=0xce;}_0x599906[_0xa9e2('0x23')](_0x30b7b2);return _0x599906[_0xa9e2('0x29')](_0xa9e2('0x2a'),_0x333d8e+'-'+_0x233e6b+'/'+_0x43bc3b)[_0xa9e2('0x25')](_0x4d153a);}return null;};}function patchUpdates(_0x4aa6e3){return function(_0x1a3bdb){try{jsonpatch[_0xa9e2('0x2b')](_0x1a3bdb,_0x4aa6e3,!![]);}catch(_0x529d1e){return BPromise['reject'](_0x529d1e);}return _0x1a3bdb[_0xa9e2('0x2c')]();};}function saveUpdates(_0x55393b,_0x220c50){return function(_0x142242){if(_0x142242){return _0x142242[_0xa9e2('0x2d')](_0x55393b)[_0xa9e2('0x19')](function(_0x3d7769){return _0x3d7769;});}return null;};}function removeEntity(_0x190877,_0x517acc){return function(_0x4ce8a1){if(_0x4ce8a1){return _0x4ce8a1[_0xa9e2('0x2e')]()['then'](function(){_0x190877[_0xa9e2('0x23')](0xcc)[_0xa9e2('0x24')]();});}};}function handleEntityNotFound(_0x154b73,_0x3a8ed7){return function(_0x32682c){if(!_0x32682c){_0x154b73['sendStatus'](0x194);}return _0x32682c;};}function handleError(_0x59dbcc,_0x145687){_0x145687=_0x145687||0x1f4;return function(_0x38993f){logger[_0xa9e2('0x1f')](_0x38993f[_0xa9e2('0x2f')]);if(_0x38993f['name']){delete _0x38993f[_0xa9e2('0x30')];}_0x59dbcc[_0xa9e2('0x23')](_0x145687)[_0xa9e2('0x31')](_0x38993f);};}exports['index']=function(_0x25f61e,_0x5982c1){var _0x53d1c0={},_0xd141ec={},_0x4e7f04={'count':0x0,'rows':[]};var _0xc999e3=_[_0xa9e2('0x32')](db[_0xa9e2('0x33')][_0xa9e2('0x34')],function(_0x1a9a39){return{'name':_0x1a9a39['fieldName'],'type':_0x1a9a39[_0xa9e2('0x35')][_0xa9e2('0x36')]};});_0xd141ec[_0xa9e2('0x37')]=_['map'](_0xc999e3,_0xa9e2('0x30'));_0xd141ec[_0xa9e2('0x38')]=_['keys'](_0x25f61e[_0xa9e2('0x38')]);_0xd141ec[_0xa9e2('0x39')]=_[_0xa9e2('0x3a')](_0xd141ec[_0xa9e2('0x37')],_0xd141ec[_0xa9e2('0x38')]);_0x53d1c0[_0xa9e2('0x3b')]=_['intersection'](_0xd141ec['model'],qs[_0xa9e2('0x3c')](_0x25f61e['query'][_0xa9e2('0x3c')]));_0x53d1c0[_0xa9e2('0x3b')]=_0x53d1c0[_0xa9e2('0x3b')][_0xa9e2('0x3d')]?_0x53d1c0[_0xa9e2('0x3b')]:_0xd141ec[_0xa9e2('0x37')];if(!_0x25f61e[_0xa9e2('0x38')][_0xa9e2('0x3e')](_0xa9e2('0x3f'))){_0x53d1c0[_0xa9e2('0x28')]=qs[_0xa9e2('0x28')](_0x25f61e[_0xa9e2('0x38')][_0xa9e2('0x28')]);_0x53d1c0[_0xa9e2('0x27')]=qs[_0xa9e2('0x27')](_0x25f61e['query'][_0xa9e2('0x27')]);}_0x53d1c0[_0xa9e2('0x40')]=qs[_0xa9e2('0x41')](_0x25f61e['query'][_0xa9e2('0x41')]);_0x53d1c0[_0xa9e2('0x42')]=qs['filters'](_[_0xa9e2('0x43')](_0x25f61e[_0xa9e2('0x38')],_0xd141ec[_0xa9e2('0x39')]),_0xc999e3);if(_0x25f61e[_0xa9e2('0x38')][_0xa9e2('0x44')]){_0x53d1c0[_0xa9e2('0x42')]=_['merge'](_0x53d1c0['where'],{'$or':_[_0xa9e2('0x32')](_0xc999e3,function(_0x202d8c){if(_0x202d8c['type']!=='VIRTUAL'){var _0x5d9478={};_0x5d9478[_0x202d8c[_0xa9e2('0x30')]]={'$like':'%'+_0x25f61e[_0xa9e2('0x38')][_0xa9e2('0x44')]+'%'};return _0x5d9478;}})});}_0x53d1c0=_[_0xa9e2('0x45')]({},_0x53d1c0,_0x25f61e[_0xa9e2('0x46')]);var _0x276f74={'where':_0x53d1c0['where']};return db[_0xa9e2('0x33')][_0xa9e2('0x26')](_0x276f74)[_0xa9e2('0x19')](function(_0x3972d6){_0x4e7f04[_0xa9e2('0x26')]=_0x3972d6;if(_0x25f61e[_0xa9e2('0x38')]['includeAll']){_0x53d1c0[_0xa9e2('0x47')]=[{'all':!![]}];}return db[_0xa9e2('0x33')][_0xa9e2('0x48')](_0x53d1c0);})[_0xa9e2('0x19')](function(_0x50f3e0){_0x4e7f04['rows']=_0x50f3e0;return _0x4e7f04;})[_0xa9e2('0x19')](respondWithFilteredResult(_0x5982c1,_0x53d1c0))[_0xa9e2('0x49')](handleError(_0x5982c1,null));};exports[_0xa9e2('0x4a')]=function(_0x36baf1,_0x2ba242){var _0x1b6742={'raw':![],'where':{'id':_0x36baf1[_0xa9e2('0x4b')]['id']}},_0x773375={};_0x773375[_0xa9e2('0x37')]=_[_0xa9e2('0x4c')](db[_0xa9e2('0x33')]['rawAttributes']);_0x773375[_0xa9e2('0x38')]=_['keys'](_0x36baf1[_0xa9e2('0x38')]);_0x773375[_0xa9e2('0x39')]=_[_0xa9e2('0x3a')](_0x773375[_0xa9e2('0x37')],_0x773375[_0xa9e2('0x38')]);_0x1b6742['attributes']=_[_0xa9e2('0x3a')](_0x773375[_0xa9e2('0x37')],qs[_0xa9e2('0x3c')](_0x36baf1[_0xa9e2('0x38')]['fields']));_0x1b6742[_0xa9e2('0x3b')]=_0x1b6742[_0xa9e2('0x3b')]['length']?_0x1b6742[_0xa9e2('0x3b')]:_0x773375[_0xa9e2('0x37')];if(_0x36baf1[_0xa9e2('0x38')][_0xa9e2('0x4d')]){_0x1b6742[_0xa9e2('0x47')]=[{'all':!![]}];}_0x1b6742=_[_0xa9e2('0x45')]({},_0x1b6742,_0x36baf1[_0xa9e2('0x46')]);return db[_0xa9e2('0x33')][_0xa9e2('0x4e')](_0x1b6742)[_0xa9e2('0x19')](handleEntityNotFound(_0x2ba242,null))['then'](respondWithResult(_0x2ba242,null))[_0xa9e2('0x49')](handleError(_0x2ba242,null));};exports[_0xa9e2('0x4f')]=function(_0x2196fe,_0x11c6bc){return db[_0xa9e2('0x33')][_0xa9e2('0x4f')](_0x2196fe['body'],{})[_0xa9e2('0x19')](respondWithResult(_0x11c6bc,0xc9))[_0xa9e2('0x49')](handleError(_0x11c6bc,null));};exports['update']=function(_0x2eb446,_0x3a252b){if(_0x2eb446[_0xa9e2('0x50')]['id']){delete _0x2eb446[_0xa9e2('0x50')]['id'];}return db['VtigerConfiguration'][_0xa9e2('0x4e')]({'where':{'id':_0x2eb446[_0xa9e2('0x4b')]['id']}})[_0xa9e2('0x19')](handleEntityNotFound(_0x3a252b,null))[_0xa9e2('0x19')](saveUpdates(_0x2eb446['body'],null))['then'](respondWithResult(_0x3a252b,null))[_0xa9e2('0x49')](handleError(_0x3a252b,null));};exports[_0xa9e2('0x2e')]=function(_0x201978,_0x608617){return db[_0xa9e2('0x33')][_0xa9e2('0x4e')]({'where':{'id':_0x201978[_0xa9e2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x608617,null))[_0xa9e2('0x19')](removeEntity(_0x608617,null))['catch'](handleError(_0x608617,null));};exports['getFields']=function(_0x1102d7,_0x3b0e37,_0x4de5ae){var _0x4ccadf={};var _0xcead99={};var _0x36cef5;var _0x147078;return db[_0xa9e2('0x33')][_0xa9e2('0x51')]({'where':{'id':_0x1102d7[_0xa9e2('0x4b')]['id']}})[_0xa9e2('0x19')](handleEntityNotFound(_0x3b0e37,null))[_0xa9e2('0x19')](function(_0x258249){if(_0x258249){_0x36cef5=_0x258249;_0xcead99['model']=_[_0xa9e2('0x4c')](db[_0xa9e2('0x52')][_0xa9e2('0x34')]);_0xcead99[_0xa9e2('0x38')]=_[_0xa9e2('0x4c')](_0x1102d7[_0xa9e2('0x38')]);_0xcead99['filters']=_[_0xa9e2('0x3a')](_0xcead99[_0xa9e2('0x37')],_0xcead99[_0xa9e2('0x38')]);_0x4ccadf[_0xa9e2('0x3b')]=_[_0xa9e2('0x3a')](_0xcead99[_0xa9e2('0x37')],qs[_0xa9e2('0x3c')](_0x1102d7[_0xa9e2('0x38')][_0xa9e2('0x3c')]));_0x4ccadf[_0xa9e2('0x3b')]=_0x4ccadf[_0xa9e2('0x3b')]['length']?_0x4ccadf[_0xa9e2('0x3b')]:_0xcead99[_0xa9e2('0x37')];_0x4ccadf[_0xa9e2('0x40')]=qs[_0xa9e2('0x41')](_0x1102d7[_0xa9e2('0x38')][_0xa9e2('0x41')]);_0x4ccadf[_0xa9e2('0x42')]=qs[_0xa9e2('0x39')](_[_0xa9e2('0x43')](_0x1102d7['query'],_0xcead99[_0xa9e2('0x39')]));if(_0x1102d7[_0xa9e2('0x38')][_0xa9e2('0x44')]){_0x4ccadf[_0xa9e2('0x42')]=_['merge'](_0x4ccadf[_0xa9e2('0x42')],{'$or':_[_0xa9e2('0x32')](_0x4ccadf['attributes'],function(_0x257b08){var _0x2bd753={};_0x2bd753[_0x257b08]={'$like':'%'+_0x1102d7[_0xa9e2('0x38')][_0xa9e2('0x44')]+'%'};return _0x2bd753;})});}_0x4ccadf=_['merge']({},_0x4ccadf,_0x1102d7['options']);return _0x36cef5['getFields'](_0x4ccadf);}})[_0xa9e2('0x19')](function(_0xa03096){if(_0xa03096){_0x147078=_0xa03096['length'];if(!_0x1102d7[_0xa9e2('0x38')]['hasOwnProperty'](_0xa9e2('0x3f'))){_0x4ccadf[_0xa9e2('0x28')]=qs[_0xa9e2('0x28')](_0x1102d7[_0xa9e2('0x38')][_0xa9e2('0x28')]);_0x4ccadf[_0xa9e2('0x27')]=qs['offset'](_0x1102d7[_0xa9e2('0x38')][_0xa9e2('0x27')]);}return _0x36cef5[_0xa9e2('0x53')](_0x4ccadf);}})[_0xa9e2('0x19')](function(_0x12f3f7){if(_0x12f3f7){return _0x12f3f7?{'count':_0x147078,'rows':_0x12f3f7}:null;}})[_0xa9e2('0x19')](respondWithResult(_0x3b0e37,null))[_0xa9e2('0x49')](handleError(_0x3b0e37,null));};exports['getSubjects']=function(_0x33e0e7,_0x1c4016,_0xc342d0){var _0x19e620={};var _0x3fcb06={};var _0x328cce;var _0x4df7e9;return db['VtigerConfiguration'][_0xa9e2('0x51')]({'where':{'id':_0x33e0e7[_0xa9e2('0x4b')]['id']}})[_0xa9e2('0x19')](handleEntityNotFound(_0x1c4016,null))[_0xa9e2('0x19')](function(_0x56e720){if(_0x56e720){_0x328cce=_0x56e720;_0x3fcb06[_0xa9e2('0x37')]=_['keys'](db[_0xa9e2('0x52')]['rawAttributes']);_0x3fcb06[_0xa9e2('0x38')]=_[_0xa9e2('0x4c')](_0x33e0e7['query']);_0x3fcb06[_0xa9e2('0x39')]=_[_0xa9e2('0x3a')](_0x3fcb06[_0xa9e2('0x37')],_0x3fcb06[_0xa9e2('0x38')]);_0x19e620[_0xa9e2('0x3b')]=_[_0xa9e2('0x3a')](_0x3fcb06[_0xa9e2('0x37')],qs[_0xa9e2('0x3c')](_0x33e0e7[_0xa9e2('0x38')][_0xa9e2('0x3c')]));_0x19e620[_0xa9e2('0x3b')]=_0x19e620[_0xa9e2('0x3b')][_0xa9e2('0x3d')]?_0x19e620[_0xa9e2('0x3b')]:_0x3fcb06[_0xa9e2('0x37')];_0x19e620[_0xa9e2('0x40')]=qs['sort'](_0x33e0e7[_0xa9e2('0x38')][_0xa9e2('0x41')]);_0x19e620['where']=qs[_0xa9e2('0x39')](_['pick'](_0x33e0e7[_0xa9e2('0x38')],_0x3fcb06['filters']));if(_0x33e0e7[_0xa9e2('0x38')][_0xa9e2('0x44')]){_0x19e620[_0xa9e2('0x42')]=_['merge'](_0x19e620[_0xa9e2('0x42')],{'$or':_[_0xa9e2('0x32')](_0x19e620['attributes'],function(_0x583bb2){var _0x4b3ae6={};_0x4b3ae6[_0x583bb2]={'$like':'%'+_0x33e0e7['query'][_0xa9e2('0x44')]+'%'};return _0x4b3ae6;})});}_0x19e620=_['merge']({},_0x19e620,_0x33e0e7[_0xa9e2('0x46')]);return _0x328cce[_0xa9e2('0x54')](_0x19e620);}})[_0xa9e2('0x19')](function(_0x40e3d3){if(_0x40e3d3){_0x4df7e9=_0x40e3d3[_0xa9e2('0x3d')];if(!_0x33e0e7[_0xa9e2('0x38')][_0xa9e2('0x3e')](_0xa9e2('0x3f'))){_0x19e620[_0xa9e2('0x28')]=qs[_0xa9e2('0x28')](_0x33e0e7[_0xa9e2('0x38')]['limit']);_0x19e620[_0xa9e2('0x27')]=qs[_0xa9e2('0x27')](_0x33e0e7['query'][_0xa9e2('0x27')]);}return _0x328cce[_0xa9e2('0x54')](_0x19e620);}})[_0xa9e2('0x19')](function(_0xc24552){if(_0xc24552){return _0xc24552?{'count':_0x4df7e9,'rows':_0xc24552}:null;}})[_0xa9e2('0x19')](respondWithResult(_0x1c4016,null))['catch'](handleError(_0x1c4016,null));};exports[_0xa9e2('0x55')]=function(_0x5ad6f0,_0x373e89,_0x24630f){var _0x1f1886={};var _0x488942={};var _0x3b05e7;var _0x566b92;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x5ad6f0[_0xa9e2('0x4b')]['id']}})[_0xa9e2('0x19')](handleEntityNotFound(_0x373e89,null))[_0xa9e2('0x19')](function(_0x437a39){if(_0x437a39){_0x3b05e7=_0x437a39;_0x488942[_0xa9e2('0x37')]=_[_0xa9e2('0x4c')](db['VtigerField'][_0xa9e2('0x34')]);_0x488942[_0xa9e2('0x38')]=_['keys'](_0x5ad6f0[_0xa9e2('0x38')]);_0x488942[_0xa9e2('0x39')]=_[_0xa9e2('0x3a')](_0x488942[_0xa9e2('0x37')],_0x488942[_0xa9e2('0x38')]);_0x1f1886[_0xa9e2('0x3b')]=_['intersection'](_0x488942[_0xa9e2('0x37')],qs[_0xa9e2('0x3c')](_0x5ad6f0['query'][_0xa9e2('0x3c')]));_0x1f1886[_0xa9e2('0x3b')]=_0x1f1886[_0xa9e2('0x3b')][_0xa9e2('0x3d')]?_0x1f1886[_0xa9e2('0x3b')]:_0x488942['model'];_0x1f1886[_0xa9e2('0x40')]=qs[_0xa9e2('0x41')](_0x5ad6f0[_0xa9e2('0x38')][_0xa9e2('0x41')]);_0x1f1886[_0xa9e2('0x42')]=qs[_0xa9e2('0x39')](_[_0xa9e2('0x43')](_0x5ad6f0[_0xa9e2('0x38')],_0x488942[_0xa9e2('0x39')]));if(_0x5ad6f0[_0xa9e2('0x38')]['filter']){_0x1f1886[_0xa9e2('0x42')]=_['merge'](_0x1f1886[_0xa9e2('0x42')],{'$or':_[_0xa9e2('0x32')](_0x1f1886[_0xa9e2('0x3b')],function(_0x35fa90){var _0x5141ca={};_0x5141ca[_0x35fa90]={'$like':'%'+_0x5ad6f0[_0xa9e2('0x38')][_0xa9e2('0x44')]+'%'};return _0x5141ca;})});}_0x1f1886=_['merge']({},_0x1f1886,_0x5ad6f0[_0xa9e2('0x46')]);return _0x3b05e7[_0xa9e2('0x55')](_0x1f1886);}})[_0xa9e2('0x19')](function(_0x25e876){if(_0x25e876){_0x566b92=_0x25e876[_0xa9e2('0x3d')];if(!_0x5ad6f0['query'][_0xa9e2('0x3e')](_0xa9e2('0x3f'))){_0x1f1886[_0xa9e2('0x28')]=qs['limit'](_0x5ad6f0[_0xa9e2('0x38')][_0xa9e2('0x28')]);_0x1f1886[_0xa9e2('0x27')]=qs[_0xa9e2('0x27')](_0x5ad6f0['query'][_0xa9e2('0x27')]);}return _0x3b05e7[_0xa9e2('0x55')](_0x1f1886);}})[_0xa9e2('0x19')](function(_0x383023){if(_0x383023){return _0x383023?{'count':_0x566b92,'rows':_0x383023}:null;}})[_0xa9e2('0x19')](respondWithResult(_0x373e89,null))[_0xa9e2('0x49')](handleError(_0x373e89,null));};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
index bda6da0..65c64b9 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 _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
+var _0x1fc8=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','util','api'];(function(_0x59137b,_0x20880e){var _0x267490=function(_0xcec6de){while(--_0xcec6de){_0x59137b['push'](_0x59137b['shift']());}};_0x267490(++_0x20880e);}(_0x1fc8,0x76));var _0x81fc=function(_0x4caa00,_0x2515c9){_0x4caa00=_0x4caa00-0x0;var _0x10d007=_0x1fc8[_0x4caa00];return _0x10d007;};'use strict';var _=require('lodash');var util=require(_0x81fc('0x0'));var logger=require('../../config/logger')(_0x81fc('0x1'));var moment=require('moment');var BPromise=require(_0x81fc('0x2'));var rp=require(_0x81fc('0x3'));var fs=require('fs');var path=require(_0x81fc('0x4'));var rimraf=require(_0x81fc('0x5'));var config=require(_0x81fc('0x6'));var attributes=require(_0x81fc('0x7'));module[_0x81fc('0x8')]=function(_0x28c9d1,_0x2608c8){return _0x28c9d1['define'](_0x81fc('0x9'),attributes,{'tableName':'int_vtiger_configurations','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 5fd6e9d..4777af5 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 _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
+var _0x9b20=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x9b20,0x166));var _0x09b2=function(_0x5120be,_0x57e8de){_0x5120be=_0x5120be-0x0;var _0xd044c6=_0x9b20[_0x5120be];return _0xd044c6;};'use strict';var _=require(_0x09b2('0x0'));var util=require(_0x09b2('0x1'));var moment=require(_0x09b2('0x2'));var BPromise=require(_0x09b2('0x3'));var rs=require(_0x09b2('0x4'));var fs=require('fs');var Redis=require(_0x09b2('0x5'));var db=require(_0x09b2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x09b2('0x7'))('rpc');var config=require(_0x09b2('0x8'));var jayson=require(_0x09b2('0x9'));var client=jayson[_0x09b2('0xa')][_0x09b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43fc7d,_0xa1502,_0x4710c8){return new BPromise(function(_0x5203e6,_0xb915e6){return client['request'](_0x43fc7d,_0x4710c8)[_0x09b2('0xc')](function(_0x228035){logger[_0x09b2('0xd')](_0x09b2('0xe'),_0xa1502,'request\x20sent');logger['debug'](_0x09b2('0xf'),_0xa1502,_0x09b2('0x10'),JSON['stringify'](_0x228035));if(_0x228035[_0x09b2('0x11')]){if(_0x228035[_0x09b2('0x11')][_0x09b2('0x12')]===0x1f4){logger[_0x09b2('0x11')](_0x09b2('0xe'),_0xa1502,_0x228035[_0x09b2('0x11')]['message']);return _0xb915e6(_0x228035['error']['message']);}logger[_0x09b2('0x11')](_0x09b2('0xe'),_0xa1502,_0x228035['error'][_0x09b2('0x13')]);return _0x5203e6(_0x228035[_0x09b2('0x11')]['message']);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0xa1502,'request\x20sent');_0x5203e6(_0x228035['result']['message']);}})['catch'](function(_0x527c5a){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0xa1502,_0x527c5a);_0xb915e6(_0x527c5a);});});}
\ No newline at end of file
diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js
index 18485dd..a98907b 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 _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
+var _0x585d=['../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x55d7c2,_0x4ce6fb){var _0x1755ef=function(_0xddc25c){while(--_0xddc25c){_0x55d7c2['push'](_0x55d7c2['shift']());}};_0x1755ef(++_0x4ce6fb);}(_0x585d,0x93));var _0xd585=function(_0x12bdd6,_0x5e2860){_0x12bdd6=_0x12bdd6-0x0;var _0x599091=_0x585d[_0x12bdd6];return _0x599091;};'use strict';var multer=require('multer');var util=require(_0xd585('0x0'));var path=require('path');var timeout=require(_0xd585('0x1'));var express=require(_0xd585('0x2'));var router=express[_0xd585('0x3')]();var auth=require(_0xd585('0x4'));var interaction=require(_0xd585('0x5'));var config=require(_0xd585('0x6'));var controller=require(_0xd585('0x7'));router[_0xd585('0x8')]('/',auth[_0xd585('0x9')](),controller[_0xd585('0xa')]);router[_0xd585('0x8')](_0xd585('0xb'),auth['isAuthenticated'](),controller[_0xd585('0xc')]);router[_0xd585('0xd')]('/',auth[_0xd585('0x9')](),controller['create']);router[_0xd585('0xe')]('/:id',auth[_0xd585('0x9')](),controller[_0xd585('0xf')]);router[_0xd585('0x10')](_0xd585('0xb'),auth['isAuthenticated'](),controller[_0xd585('0x11')]);module[_0xd585('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js
index 2a44f33..aa2998f 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 _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
+var _0xba2d=['customVariable','exports','string','STRING','ENUM','variable'];(function(_0x405a1f,_0x446aa3){var _0x4fd010=function(_0xc2ed83){while(--_0xc2ed83){_0x405a1f['push'](_0x405a1f['shift']());}};_0x4fd010(++_0x446aa3);}(_0xba2d,0xa3));var _0xdba2=function(_0x18369d,_0x4792cd){_0x18369d=_0x18369d-0x0;var _0x1940ef=_0xba2d[_0x18369d];return _0x1940ef;};'use strict';var Sequelize=require('sequelize');module[_0xdba2('0x0')]={'type':{'type':Sequelize['ENUM']('string','variable','customVariable','keyValue'),'defaultValue':_0xdba2('0x1')},'content':{'type':Sequelize[_0xdba2('0x2')]},'key':{'type':Sequelize[_0xdba2('0x2')]},'keyType':{'type':Sequelize[_0xdba2('0x3')](_0xdba2('0x1'),_0xdba2('0x4'),_0xdba2('0x5'))},'keyContent':{'type':Sequelize[_0xdba2('0x2')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xdba2('0x2')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdba2('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js
index 09b949a..9ff507a 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 _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
+var _0x8e0d=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VtigerField','count','includeAll','findAll','rows','show','params','include','catch','create','body','find','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce'];(function(_0x105278,_0x774ed2){var _0x47b1f=function(_0xf8a100){while(--_0xf8a100){_0x105278['push'](_0x105278['shift']());}};_0x47b1f(++_0x774ed2);}(_0x8e0d,0x82));var _0xd8e0=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x8e0d[_0x16b9ed];return _0x66b1f8;};'use strict';var pdf=require(_0xd8e0('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd8e0('0x1'));var jsonpatch=require(_0xd8e0('0x2'));var rp=require('request-promise');var moment=require(_0xd8e0('0x3'));var BPromise=require(_0xd8e0('0x4'));var Mustache=require(_0xd8e0('0x5'));var util=require(_0xd8e0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd8e0('0x7'));var ejs=require(_0xd8e0('0x8'));var fs=require('fs');var _=require(_0xd8e0('0x9'));var squel=require(_0xd8e0('0xa'));var crypto=require('crypto');var jsforce=require(_0xd8e0('0xb'));var deskjs=require(_0xd8e0('0xc'));var toCsv=require(_0xd8e0('0x7'));var querystring=require(_0xd8e0('0xd'));var Papa=require(_0xd8e0('0xe'));var Redis=require('ioredis');var authService=require(_0xd8e0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd8e0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd8e0('0x11'));var utils=require(_0xd8e0('0x12'));var config=require(_0xd8e0('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57a6df,_0xdc16bd){_0xdc16bd=_0xdc16bd||0xcc;return function(_0x4d968a){if(_0x4d968a){return _0x57a6df[_0xd8e0('0x14')](_0xdc16bd);}return _0x57a6df['status'](_0xdc16bd)['end']();};}function respondWithResult(_0x496593,_0x1557be){_0x1557be=_0x1557be||0xc8;return function(_0x5c983a){if(_0x5c983a){return _0x496593[_0xd8e0('0x15')](_0x1557be)[_0xd8e0('0x16')](_0x5c983a);}};}function respondWithFilteredResult(_0x2f0004,_0x14e38b){return function(_0x2689d3){if(_0x2689d3){var _0x28f3e0=_0x2689d3['count'],_0xe5d019=_0x14e38b[_0xd8e0('0x17')],_0x345e21=_0x14e38b[_0xd8e0('0x17')]+_0x14e38b[_0xd8e0('0x18')],_0x1ce603;if(_0x345e21>=_0x28f3e0){_0x345e21=_0x28f3e0;_0x1ce603=0xc8;}else{_0x1ce603=0xce;}_0x2f0004[_0xd8e0('0x15')](_0x1ce603);return _0x2f0004[_0xd8e0('0x19')](_0xd8e0('0x1a'),_0xe5d019+'-'+_0x345e21+'/'+_0x28f3e0)[_0xd8e0('0x16')](_0x2689d3);}return null;};}function patchUpdates(_0x3dc2d7){return function(_0x4e7238){try{jsonpatch[_0xd8e0('0x1b')](_0x4e7238,_0x3dc2d7,!![]);}catch(_0x4e41d4){return BPromise['reject'](_0x4e41d4);}return _0x4e7238[_0xd8e0('0x1c')]();};}function saveUpdates(_0x4f4b18,_0x55ce9b){return function(_0x50c2a2){if(_0x50c2a2){return _0x50c2a2[_0xd8e0('0x1d')](_0x4f4b18)[_0xd8e0('0x1e')](function(_0x57a7c2){return _0x57a7c2;});}return null;};}function removeEntity(_0xbf80a,_0x4209fb){return function(_0x1d31de){if(_0x1d31de){return _0x1d31de[_0xd8e0('0x1f')]()[_0xd8e0('0x1e')](function(){_0xbf80a[_0xd8e0('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1757f3,_0x340ae1){return function(_0x54c515){if(!_0x54c515){_0x1757f3['sendStatus'](0x194);}return _0x54c515;};}function handleError(_0x5d82f9,_0x309684){_0x309684=_0x309684||0x1f4;return function(_0x1c3aed){logger[_0xd8e0('0x20')](_0x1c3aed[_0xd8e0('0x21')]);if(_0x1c3aed[_0xd8e0('0x22')]){delete _0x1c3aed['name'];}_0x5d82f9['status'](_0x309684)[_0xd8e0('0x23')](_0x1c3aed);};}exports[_0xd8e0('0x24')]=function(_0x15f15b,_0x169373){var _0x51c7b6={},_0x15bd32={},_0x3da15f={'count':0x0,'rows':[]};var _0xd60219=_[_0xd8e0('0x25')](db['VtigerField'][_0xd8e0('0x26')],function(_0x46f3a2){return{'name':_0x46f3a2[_0xd8e0('0x27')],'type':_0x46f3a2[_0xd8e0('0x28')][_0xd8e0('0x29')]};});_0x15bd32[_0xd8e0('0x2a')]=_[_0xd8e0('0x25')](_0xd60219,'name');_0x15bd32[_0xd8e0('0x2b')]=_[_0xd8e0('0x2c')](_0x15f15b[_0xd8e0('0x2b')]);_0x15bd32[_0xd8e0('0x2d')]=_[_0xd8e0('0x2e')](_0x15bd32[_0xd8e0('0x2a')],_0x15bd32[_0xd8e0('0x2b')]);_0x51c7b6[_0xd8e0('0x2f')]=_[_0xd8e0('0x2e')](_0x15bd32[_0xd8e0('0x2a')],qs[_0xd8e0('0x30')](_0x15f15b['query'][_0xd8e0('0x30')]));_0x51c7b6[_0xd8e0('0x2f')]=_0x51c7b6[_0xd8e0('0x2f')][_0xd8e0('0x31')]?_0x51c7b6[_0xd8e0('0x2f')]:_0x15bd32[_0xd8e0('0x2a')];if(!_0x15f15b['query'][_0xd8e0('0x32')](_0xd8e0('0x33'))){_0x51c7b6[_0xd8e0('0x18')]=qs[_0xd8e0('0x18')](_0x15f15b[_0xd8e0('0x2b')][_0xd8e0('0x18')]);_0x51c7b6['offset']=qs[_0xd8e0('0x17')](_0x15f15b[_0xd8e0('0x2b')][_0xd8e0('0x17')]);}_0x51c7b6['order']=qs[_0xd8e0('0x34')](_0x15f15b['query'][_0xd8e0('0x34')]);_0x51c7b6[_0xd8e0('0x35')]=qs[_0xd8e0('0x2d')](_[_0xd8e0('0x36')](_0x15f15b[_0xd8e0('0x2b')],_0x15bd32[_0xd8e0('0x2d')]),_0xd60219);if(_0x15f15b['query'][_0xd8e0('0x37')]){_0x51c7b6[_0xd8e0('0x35')]=_[_0xd8e0('0x38')](_0x51c7b6[_0xd8e0('0x35')],{'$or':_[_0xd8e0('0x25')](_0xd60219,function(_0x576275){if(_0x576275[_0xd8e0('0x28')]!==_0xd8e0('0x39')){var _0x1f6041={};_0x1f6041[_0x576275[_0xd8e0('0x22')]]={'$like':'%'+_0x15f15b[_0xd8e0('0x2b')][_0xd8e0('0x37')]+'%'};return _0x1f6041;}})});}_0x51c7b6=_[_0xd8e0('0x38')]({},_0x51c7b6,_0x15f15b[_0xd8e0('0x3a')]);var _0x1c9c45={'where':_0x51c7b6['where']};return db[_0xd8e0('0x3b')][_0xd8e0('0x3c')](_0x1c9c45)[_0xd8e0('0x1e')](function(_0x304234){_0x3da15f[_0xd8e0('0x3c')]=_0x304234;if(_0x15f15b[_0xd8e0('0x2b')][_0xd8e0('0x3d')]){_0x51c7b6['include']=[{'all':!![]}];}return db[_0xd8e0('0x3b')][_0xd8e0('0x3e')](_0x51c7b6);})[_0xd8e0('0x1e')](function(_0x286035){_0x3da15f[_0xd8e0('0x3f')]=_0x286035;return _0x3da15f;})[_0xd8e0('0x1e')](respondWithFilteredResult(_0x169373,_0x51c7b6))['catch'](handleError(_0x169373,null));};exports[_0xd8e0('0x40')]=function(_0x3f0f31,_0x48e1ec){var _0x371ca7={'raw':!![],'where':{'id':_0x3f0f31[_0xd8e0('0x41')]['id']}},_0x104bed={};_0x104bed[_0xd8e0('0x2a')]=_[_0xd8e0('0x2c')](db[_0xd8e0('0x3b')][_0xd8e0('0x26')]);_0x104bed[_0xd8e0('0x2b')]=_[_0xd8e0('0x2c')](_0x3f0f31[_0xd8e0('0x2b')]);_0x104bed[_0xd8e0('0x2d')]=_[_0xd8e0('0x2e')](_0x104bed[_0xd8e0('0x2a')],_0x104bed['query']);_0x371ca7['attributes']=_[_0xd8e0('0x2e')](_0x104bed['model'],qs[_0xd8e0('0x30')](_0x3f0f31[_0xd8e0('0x2b')]['fields']));_0x371ca7[_0xd8e0('0x2f')]=_0x371ca7[_0xd8e0('0x2f')][_0xd8e0('0x31')]?_0x371ca7[_0xd8e0('0x2f')]:_0x104bed[_0xd8e0('0x2a')];if(_0x3f0f31['query'][_0xd8e0('0x3d')]){_0x371ca7[_0xd8e0('0x42')]=[{'all':!![]}];}_0x371ca7=_[_0xd8e0('0x38')]({},_0x371ca7,_0x3f0f31['options']);return db['VtigerField']['find'](_0x371ca7)[_0xd8e0('0x1e')](handleEntityNotFound(_0x48e1ec,null))[_0xd8e0('0x1e')](respondWithResult(_0x48e1ec,null))[_0xd8e0('0x43')](handleError(_0x48e1ec,null));};exports[_0xd8e0('0x44')]=function(_0x2ddbb7,_0x20234e){return db['VtigerField'][_0xd8e0('0x44')](_0x2ddbb7[_0xd8e0('0x45')],{})[_0xd8e0('0x1e')](respondWithResult(_0x20234e,0xc9))[_0xd8e0('0x43')](handleError(_0x20234e,null));};exports[_0xd8e0('0x1d')]=function(_0x3c6af6,_0x1035ad){if(_0x3c6af6[_0xd8e0('0x45')]['id']){delete _0x3c6af6['body']['id'];}return db[_0xd8e0('0x3b')][_0xd8e0('0x46')]({'where':{'id':_0x3c6af6['params']['id']}})['then'](handleEntityNotFound(_0x1035ad,null))[_0xd8e0('0x1e')](saveUpdates(_0x3c6af6[_0xd8e0('0x45')],null))[_0xd8e0('0x1e')](respondWithResult(_0x1035ad,null))[_0xd8e0('0x43')](handleError(_0x1035ad,null));};exports[_0xd8e0('0x1f')]=function(_0x3abde9,_0x16ecfd){return db[_0xd8e0('0x3b')][_0xd8e0('0x46')]({'where':{'id':_0x3abde9['params']['id']}})[_0xd8e0('0x1e')](handleEntityNotFound(_0x16ecfd,null))[_0xd8e0('0x1e')](removeEntity(_0x16ecfd,null))[_0xd8e0('0x43')](handleError(_0x16ecfd,null));};
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js
index 5082b22..1d5834f 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 _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
+var _0xe706=['rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x414806,_0x12a8c2){var _0x14e039=function(_0x40fb9c){while(--_0x40fb9c){_0x414806['push'](_0x414806['shift']());}};_0x14e039(++_0x12a8c2);}(_0xe706,0xa3));var _0x6e70=function(_0x358fd3,_0x4a9c44){_0x358fd3=_0x358fd3-0x0;var _0x1ad0f3=_0xe706[_0x358fd3];return _0x1ad0f3;};'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':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xf'),_0x6e70('0x10')],'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 ae76889..1faba63 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 _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
+var _0xdef9=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x15503e,_0x2ce699){var _0x271c52=function(_0x39096a){while(--_0x39096a){_0x15503e['push'](_0x15503e['shift']());}};_0x271c52(++_0x2ce699);}(_0xdef9,0x1ed));var _0x9def=function(_0x4a752b,_0x1a8b9a){_0x4a752b=_0x4a752b-0x0;var _0x4696a4=_0xdef9[_0x4a752b];return _0x4696a4;};'use strict';var _=require(_0x9def('0x0'));var util=require(_0x9def('0x1'));var moment=require(_0x9def('0x2'));var BPromise=require(_0x9def('0x3'));var rs=require(_0x9def('0x4'));var fs=require('fs');var Redis=require(_0x9def('0x5'));var db=require(_0x9def('0x6'))['db'];var utils=require(_0x9def('0x7'));var logger=require(_0x9def('0x8'))(_0x9def('0x9'));var config=require(_0x9def('0xa'));var jayson=require(_0x9def('0xb'));var client=jayson[_0x9def('0xc')][_0x9def('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x40c607,_0x25a03e,_0x42296c){return new BPromise(function(_0x1efce0,_0x8262f1){return client['request'](_0x40c607,_0x42296c)[_0x9def('0xe')](function(_0x4f0a0d){logger['info'](_0x9def('0xf'),_0x25a03e,_0x9def('0x10'));logger[_0x9def('0x11')](_0x9def('0x12'),_0x25a03e,'request\x20sent',JSON[_0x9def('0x13')](_0x4f0a0d));if(_0x4f0a0d[_0x9def('0x14')]){if(_0x4f0a0d[_0x9def('0x14')][_0x9def('0x15')]===0x1f4){logger['error'](_0x9def('0xf'),_0x25a03e,_0x4f0a0d[_0x9def('0x14')]['message']);return _0x8262f1(_0x4f0a0d[_0x9def('0x14')]['message']);}logger['error'](_0x9def('0xf'),_0x25a03e,_0x4f0a0d[_0x9def('0x14')][_0x9def('0x16')]);return _0x1efce0(_0x4f0a0d['error'][_0x9def('0x16')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x25a03e,_0x9def('0x10'));_0x1efce0(_0x4f0a0d[_0x9def('0x17')][_0x9def('0x16')]);}})[_0x9def('0x18')](function(_0x463520){logger[_0x9def('0x14')](_0x9def('0xf'),_0x25a03e,_0x463520);_0x8262f1(_0x463520);});});}
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js
index bc18dff..40b00f2 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 _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
+var _0x5611=['/:id','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','create','post','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index'];(function(_0x194f9a,_0x479b58){var _0x559c89=function(_0x243059){while(--_0x243059){_0x194f9a['push'](_0x194f9a['shift']());}};_0x559c89(++_0x479b58);}(_0x5611,0x8f));var _0x1561=function(_0x164ca5,_0x21dd28){_0x164ca5=_0x164ca5-0x0;var _0x516b3f=_0x5611[_0x164ca5];return _0x516b3f;};'use strict';var multer=require(_0x1561('0x0'));var util=require('util');var path=require(_0x1561('0x1'));var timeout=require(_0x1561('0x2'));var express=require(_0x1561('0x3'));var router=express[_0x1561('0x4')]();var auth=require(_0x1561('0x5'));var interaction=require(_0x1561('0x6'));var config=require(_0x1561('0x7'));var controller=require(_0x1561('0x8'));router[_0x1561('0x9')]('/',auth['isAuthenticated'](),controller[_0x1561('0xa')]);router['get'](_0x1561('0xb'),auth[_0x1561('0xc')](),controller[_0x1561('0xd')]);router['get'](_0x1561('0xe'),auth[_0x1561('0xc')](),controller[_0x1561('0xf')]);router[_0x1561('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x1561('0x10')]);router['post']('/',auth[_0x1561('0xc')](),controller[_0x1561('0x11')]);router[_0x1561('0x12')]('/:id/configurations',auth[_0x1561('0xc')](),controller['addConfiguration']);router['put']('/:id',auth[_0x1561('0xc')](),controller[_0x1561('0x13')]);router[_0x1561('0x14')](_0x1561('0xb'),auth[_0x1561('0xc')](),controller[_0x1561('0x15')]);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 619eb4b..4915772 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 _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
+var _0xb75e=['ENUM','password','token','newTab','integrationTab','sequelize','exports','STRING','username','remoteUri'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb75e,0xc3));var _0xeb75=function(_0x8efffa,_0x2e2434){_0x8efffa=_0x8efffa-0x0;var _0x1f5546=_0xb75e[_0x8efffa];return _0x1f5546;};'use strict';var Sequelize=require(_0xeb75('0x0'));module[_0xeb75('0x1')]={'name':{'type':Sequelize[_0xeb75('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xeb75('0x2')],'unique':_0xeb75('0x3')},'password':{'type':Sequelize[_0xeb75('0x2')]},'token':{'type':Sequelize[_0xeb75('0x2')]},'remoteUri':{'type':Sequelize[_0xeb75('0x2')],'unique':_0xeb75('0x4')},'authType':{'type':Sequelize[_0xeb75('0x5')](_0xeb75('0x6'),_0xeb75('0x7')),'defaultValue':_0xeb75('0x6')},'serverUrl':{'type':Sequelize[_0xeb75('0x2')]},'type':{'type':Sequelize[_0xeb75('0x5')]('integrationTab',_0xeb75('0x8')),'defaultValue':_0xeb75('0x9')}};
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js
index 94e34fb..089e95d 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 _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
+var _0x1201=['includeAll','find','create','body','getConfigurations','findOne','ZendeskConfiguration','sort','getSubjects','channel','Descriptions','ZendeskField','Subjects','getFields','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','ticket_fields','Basic\x20%s','username','base64','headers','%s/token:%s','toString','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','remove','includes','position','system_field_options','custom_field_options','statusCode','send','html-pdf','eml-format','rimraf','request-promise','mustache','path','ejs','lodash','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','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','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','destroy','end','stack','name','index','map','ZendeskAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','include','rows','params'];(function(_0x4abc3b,_0x50fbd1){var _0x49c2a5=function(_0x2f7114){while(--_0x2f7114){_0x4abc3b['push'](_0x4abc3b['shift']());}};_0x49c2a5(++_0x50fbd1);}(_0x1201,0xa3));var _0x1120=function(_0x44c5c1,_0x4d9d55){_0x44c5c1=_0x44c5c1-0x0;var _0x467172=_0x1201[_0x44c5c1];return _0x467172;};'use strict';var pdf=require(_0x1120('0x0'));var emlformat=require(_0x1120('0x1'));var rimraf=require(_0x1120('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1120('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1120('0x4'));var util=require('util');var path=require(_0x1120('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1120('0x6'));var fs=require('fs');var _=require(_0x1120('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1120('0x8'));var toCsv=require(_0x1120('0x9'));var querystring=require(_0x1120('0xa'));var Papa=require('papaparse');var Redis=require(_0x1120('0xb'));var authService=require(_0x1120('0xc'));var qs=require(_0x1120('0xd'));var as=require(_0x1120('0xe'));var hardwareService=require(_0x1120('0xf'));var logger=require(_0x1120('0x10'))(_0x1120('0x11'));var utils=require('../../config/utils');var config=require(_0x1120('0x12'));var db=require(_0x1120('0x13'))['db'];var integrations=require(_0x1120('0x14'));var jayson=require('jayson/promise');var client=jayson[_0x1120('0x15')][_0x1120('0x16')]({'port':0x232a});function checkPasswordPattern(_0x171255,_0x5a7d5c,_0xe97d96){if(_0xe97d96){var _0x2b120e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b120e[_0x1120('0x17')](_0x5a7d5c)){return _0x171255;}else{throw new db[(_0x1120('0x18'))]['ValidationError'](_0x1120('0x19'));}}else{return _0x171255;}}function respondWithRpcPromise(_0x470f91,_0x2c47c6,_0x18a120,_0xb30757){return new BPromise(function(_0x5f2861,_0x5a3f66){var _0x697673=_0xb30757||client;return _0x697673[_0x1120('0x1a')](_0x470f91,_0x18a120)[_0x1120('0x1b')](function(_0x4d9af9){logger[_0x1120('0x1c')](_0x1120('0x1d'),_0x2c47c6,_0x1120('0x1e'));logger[_0x1120('0x1f')](_0x1120('0x20'),_0x2c47c6,'request\x20sent',JSON[_0x1120('0x21')](_0x4d9af9));if(_0x4d9af9['error']){if(_0x4d9af9['error'][_0x1120('0x22')]===0x1f4){logger[_0x1120('0x23')]('ZendeskAccount,\x20%s,\x20%s',_0x2c47c6,_0x4d9af9[_0x1120('0x23')][_0x1120('0x24')]);return _0x5a3f66(_0x4d9af9[_0x1120('0x23')][_0x1120('0x24')]);}logger[_0x1120('0x23')]('ZendeskAccount,\x20%s,\x20%s',_0x2c47c6,_0x4d9af9[_0x1120('0x23')]['message']);return _0x5f2861(_0x4d9af9[_0x1120('0x23')]['message']);}else{logger[_0x1120('0x1c')]('ZendeskAccount,\x20%s,\x20%s',_0x2c47c6,'request\x20sent');_0x5f2861(_0x4d9af9[_0x1120('0x25')]['message']);}})[_0x1120('0x26')](function(_0x3fa61b){logger[_0x1120('0x23')](_0x1120('0x1d'),_0x2c47c6,_0x3fa61b);_0x5a3f66(_0x3fa61b);});});}function respondWithStatusCode(_0x14341f,_0x2e5839){_0x2e5839=_0x2e5839||0xcc;return function(_0x1b7d97){if(_0x1b7d97){return _0x14341f[_0x1120('0x27')](_0x2e5839);}return _0x14341f['status'](_0x2e5839)['end']();};}function respondWithResult(_0x12c731,_0x85c130){_0x85c130=_0x85c130||0xc8;return function(_0x350383){if(_0x350383){return _0x12c731[_0x1120('0x28')](_0x85c130)[_0x1120('0x29')](_0x350383);}};}function respondWithFilteredResult(_0x49d72c,_0x4cb0f9){return function(_0x24b9ca){if(_0x24b9ca){var _0x13a0c7=_0x24b9ca['count'],_0xe5616b=_0x4cb0f9[_0x1120('0x2a')],_0x4fe574=_0x4cb0f9[_0x1120('0x2a')]+_0x4cb0f9[_0x1120('0x2b')],_0x145726;if(_0x4fe574>=_0x13a0c7){_0x4fe574=_0x13a0c7;_0x145726=0xc8;}else{_0x145726=0xce;}_0x49d72c['status'](_0x145726);return _0x49d72c[_0x1120('0x2c')](_0x1120('0x2d'),_0xe5616b+'-'+_0x4fe574+'/'+_0x13a0c7)[_0x1120('0x29')](_0x24b9ca);}return null;};}function patchUpdates(_0x4f31cd){return function(_0x4baf9b){try{jsonpatch['apply'](_0x4baf9b,_0x4f31cd,!![]);}catch(_0x20bcc4){return BPromise[_0x1120('0x2e')](_0x20bcc4);}return _0x4baf9b[_0x1120('0x2f')]();};}function saveUpdates(_0x3ead57,_0x296d8e){return function(_0x384468){if(_0x384468){return _0x384468[_0x1120('0x30')](_0x3ead57)[_0x1120('0x1b')](function(_0x3b7168){return _0x3b7168;});}return null;};}function removeEntity(_0x400230,_0x41f8ea){return function(_0x3ebbb6){if(_0x3ebbb6){return _0x3ebbb6[_0x1120('0x31')]()[_0x1120('0x1b')](function(){_0x400230['status'](0xcc)[_0x1120('0x32')]();});}};}function handleEntityNotFound(_0x5c2543,_0x43c555){return function(_0x35b348){if(!_0x35b348){_0x5c2543[_0x1120('0x27')](0x194);}return _0x35b348;};}function handleError(_0x48c18d,_0x3f3655){_0x3f3655=_0x3f3655||0x1f4;return function(_0x4ecaf4){logger['error'](_0x4ecaf4[_0x1120('0x33')]);if(_0x4ecaf4[_0x1120('0x34')]){delete _0x4ecaf4[_0x1120('0x34')];}_0x48c18d[_0x1120('0x28')](_0x3f3655)['send'](_0x4ecaf4);};}exports[_0x1120('0x35')]=function(_0x5e53b1,_0xd7f86e){var _0x1f3ef8={},_0x55354c={},_0x18183b={'count':0x0,'rows':[]};var _0x479939=_[_0x1120('0x36')](db[_0x1120('0x37')][_0x1120('0x38')],function(_0x53b7f5){return{'name':_0x53b7f5[_0x1120('0x39')],'type':_0x53b7f5[_0x1120('0x3a')]['key']};});_0x55354c[_0x1120('0x3b')]=_[_0x1120('0x36')](_0x479939,_0x1120('0x34'));_0x55354c[_0x1120('0x3c')]=_[_0x1120('0x3d')](_0x5e53b1[_0x1120('0x3c')]);_0x55354c[_0x1120('0x3e')]=_[_0x1120('0x3f')](_0x55354c['model'],_0x55354c[_0x1120('0x3c')]);_0x1f3ef8['attributes']=_['intersection'](_0x55354c['model'],qs[_0x1120('0x40')](_0x5e53b1[_0x1120('0x3c')][_0x1120('0x40')]));_0x1f3ef8[_0x1120('0x41')]=_0x1f3ef8[_0x1120('0x41')][_0x1120('0x42')]?_0x1f3ef8[_0x1120('0x41')]:_0x55354c[_0x1120('0x3b')];if(!_0x5e53b1[_0x1120('0x3c')][_0x1120('0x43')](_0x1120('0x44'))){_0x1f3ef8[_0x1120('0x2b')]=qs[_0x1120('0x2b')](_0x5e53b1['query'][_0x1120('0x2b')]);_0x1f3ef8[_0x1120('0x2a')]=qs['offset'](_0x5e53b1[_0x1120('0x3c')][_0x1120('0x2a')]);}_0x1f3ef8[_0x1120('0x45')]=qs['sort'](_0x5e53b1['query']['sort']);_0x1f3ef8['where']=qs[_0x1120('0x3e')](_[_0x1120('0x46')](_0x5e53b1[_0x1120('0x3c')],_0x55354c['filters']),_0x479939);if(_0x5e53b1[_0x1120('0x3c')][_0x1120('0x47')]){_0x1f3ef8[_0x1120('0x48')]=_[_0x1120('0x49')](_0x1f3ef8[_0x1120('0x48')],{'$or':_[_0x1120('0x36')](_0x479939,function(_0x1a8aef){if(_0x1a8aef['type']!==_0x1120('0x4a')){var _0x2a9a28={};_0x2a9a28[_0x1a8aef[_0x1120('0x34')]]={'$like':'%'+_0x5e53b1[_0x1120('0x3c')][_0x1120('0x47')]+'%'};return _0x2a9a28;}})});}_0x1f3ef8=_[_0x1120('0x49')]({},_0x1f3ef8,_0x5e53b1[_0x1120('0x4b')]);var _0x2f2ff3={'where':_0x1f3ef8['where']};return db[_0x1120('0x37')]['count'](_0x2f2ff3)[_0x1120('0x1b')](function(_0x36e137){_0x18183b['count']=_0x36e137;if(_0x5e53b1['query']['includeAll']){_0x1f3ef8[_0x1120('0x4c')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x1f3ef8);})[_0x1120('0x1b')](function(_0x547445){_0x18183b[_0x1120('0x4d')]=_0x547445;return _0x18183b;})['then'](respondWithFilteredResult(_0xd7f86e,_0x1f3ef8))[_0x1120('0x26')](handleError(_0xd7f86e,null));};exports['show']=function(_0x3d1459,_0x5107c7){var _0x2eae56={'raw':![],'where':{'id':_0x3d1459[_0x1120('0x4e')]['id']}},_0x513525={};_0x513525[_0x1120('0x3b')]=_['keys'](db[_0x1120('0x37')]['rawAttributes']);_0x513525['query']=_[_0x1120('0x3d')](_0x3d1459[_0x1120('0x3c')]);_0x513525['filters']=_[_0x1120('0x3f')](_0x513525['model'],_0x513525[_0x1120('0x3c')]);_0x2eae56[_0x1120('0x41')]=_[_0x1120('0x3f')](_0x513525[_0x1120('0x3b')],qs['fields'](_0x3d1459[_0x1120('0x3c')][_0x1120('0x40')]));_0x2eae56[_0x1120('0x41')]=_0x2eae56[_0x1120('0x41')]['length']?_0x2eae56[_0x1120('0x41')]:_0x513525[_0x1120('0x3b')];if(_0x3d1459[_0x1120('0x3c')][_0x1120('0x4f')]){_0x2eae56[_0x1120('0x4c')]=[{'all':!![]}];}_0x2eae56=_['merge']({},_0x2eae56,_0x3d1459['options']);return db['ZendeskAccount'][_0x1120('0x50')](_0x2eae56)[_0x1120('0x1b')](handleEntityNotFound(_0x5107c7,null))[_0x1120('0x1b')](respondWithResult(_0x5107c7,null))[_0x1120('0x26')](handleError(_0x5107c7,null));};exports[_0x1120('0x51')]=function(_0x19fe23,_0x1dad5a){return db[_0x1120('0x37')][_0x1120('0x51')](_0x19fe23[_0x1120('0x52')],{})[_0x1120('0x1b')](respondWithResult(_0x1dad5a,0xc9))['catch'](handleError(_0x1dad5a,null));};exports['update']=function(_0x1d026a,_0x48b3c1){if(_0x1d026a['body']['id']){delete _0x1d026a[_0x1120('0x52')]['id'];}return db['ZendeskAccount'][_0x1120('0x50')]({'where':{'id':_0x1d026a[_0x1120('0x4e')]['id']}})[_0x1120('0x1b')](handleEntityNotFound(_0x48b3c1,null))[_0x1120('0x1b')](saveUpdates(_0x1d026a[_0x1120('0x52')],null))['then'](respondWithResult(_0x48b3c1,null))['catch'](handleError(_0x48b3c1,null));};exports[_0x1120('0x31')]=function(_0x4f02ed,_0x1d3deb){return db[_0x1120('0x37')][_0x1120('0x50')]({'where':{'id':_0x4f02ed[_0x1120('0x4e')]['id']}})[_0x1120('0x1b')](handleEntityNotFound(_0x1d3deb,null))[_0x1120('0x1b')](removeEntity(_0x1d3deb,null))[_0x1120('0x26')](handleError(_0x1d3deb,null));};exports[_0x1120('0x53')]=function(_0x529443,_0x3f1ac6,_0xdeb73d){var _0x4ca7f0={};var _0x34561a={};var _0x304ee6;var _0x2cb058;return db[_0x1120('0x37')][_0x1120('0x54')]({'where':{'id':_0x529443[_0x1120('0x4e')]['id']}})[_0x1120('0x1b')](handleEntityNotFound(_0x3f1ac6,null))['then'](function(_0x4b197e){if(_0x4b197e){_0x304ee6=_0x4b197e;_0x34561a[_0x1120('0x3b')]=_[_0x1120('0x3d')](db[_0x1120('0x55')][_0x1120('0x38')]);_0x34561a[_0x1120('0x3c')]=_['keys'](_0x529443['query']);_0x34561a[_0x1120('0x3e')]=_[_0x1120('0x3f')](_0x34561a[_0x1120('0x3b')],_0x34561a['query']);_0x4ca7f0[_0x1120('0x41')]=_[_0x1120('0x3f')](_0x34561a[_0x1120('0x3b')],qs['fields'](_0x529443[_0x1120('0x3c')][_0x1120('0x40')]));_0x4ca7f0[_0x1120('0x41')]=_0x4ca7f0[_0x1120('0x41')]['length']?_0x4ca7f0[_0x1120('0x41')]:_0x34561a[_0x1120('0x3b')];_0x4ca7f0[_0x1120('0x45')]=qs['sort'](_0x529443[_0x1120('0x3c')][_0x1120('0x56')]);_0x4ca7f0['where']=qs[_0x1120('0x3e')](_['pick'](_0x529443[_0x1120('0x3c')],_0x34561a['filters']));if(_0x529443[_0x1120('0x3c')]['filter']){_0x4ca7f0[_0x1120('0x48')]=_[_0x1120('0x49')](_0x4ca7f0['where'],{'$or':_[_0x1120('0x36')](_0x4ca7f0[_0x1120('0x41')],function(_0x5c48fb){var _0x2511ae={};_0x2511ae[_0x5c48fb]={'$like':'%'+_0x529443[_0x1120('0x3c')][_0x1120('0x47')]+'%'};return _0x2511ae;})});}_0x4ca7f0=_[_0x1120('0x49')]({},_0x4ca7f0,_0x529443['options']);return _0x304ee6[_0x1120('0x53')](_0x4ca7f0);}})[_0x1120('0x1b')](function(_0x1f11bf){if(_0x1f11bf){_0x2cb058=_0x1f11bf[_0x1120('0x42')];if(!_0x529443[_0x1120('0x3c')][_0x1120('0x43')]('nolimit')){_0x4ca7f0[_0x1120('0x2b')]=qs[_0x1120('0x2b')](_0x529443['query']['limit']);_0x4ca7f0[_0x1120('0x2a')]=qs[_0x1120('0x2a')](_0x529443[_0x1120('0x3c')][_0x1120('0x2a')]);}return _0x304ee6[_0x1120('0x53')](_0x4ca7f0);}})[_0x1120('0x1b')](function(_0x4d264f){if(_0x4d264f){return _0x4d264f?{'count':_0x2cb058,'rows':_0x4d264f}:null;}})[_0x1120('0x1b')](respondWithResult(_0x3f1ac6,null))['catch'](handleError(_0x3f1ac6,null));};exports['addConfiguration']=function(_0xe018fe,_0x125bb4,_0x3479be){if(_0xe018fe[_0x1120('0x52')]['id']){delete _0xe018fe['body']['id'];}return db[_0x1120('0x37')]['findOne']({'where':{'id':_0xe018fe[_0x1120('0x4e')]['id']}})[_0x1120('0x1b')](handleEntityNotFound(_0x125bb4,null))[_0x1120('0x1b')](function(_0x52526e){if(_0x52526e){_0xe018fe[_0x1120('0x52')]['AccountId']=_0x52526e['id'];_0xe018fe['body']['Subjects']=integrations[_0x1120('0x57')](_0xe018fe[_0x1120('0x52')][_0x1120('0x58')],_0xe018fe[_0x1120('0x52')][_0x1120('0x3a')]);_0xe018fe[_0x1120('0x52')][_0x1120('0x59')]=integrations['getDescriptions'](_0xe018fe[_0x1120('0x52')][_0x1120('0x58')],_0xe018fe['body']['type']);return db[_0x1120('0x55')][_0x1120('0x51')](_0xe018fe[_0x1120('0x52')],{'include':[{'model':db[_0x1120('0x5a')],'as':_0x1120('0x5b')},{'model':db[_0x1120('0x5a')],'as':_0x1120('0x59')}]});}return null;})[_0x1120('0x1b')](respondWithResult(_0x125bb4,null))[_0x1120('0x26')](handleError(_0x125bb4,null));};exports[_0x1120('0x5c')]=function(_0x2e3202,_0x3f7b8c,_0x1a7b84){var _0x444a7b='';return db[_0x1120('0x37')][_0x1120('0x54')]({'where':{'id':_0x2e3202['params']['id']},'attributes':['id','username',_0x1120('0x5d'),_0x1120('0x5e'),_0x1120('0x5f'),_0x1120('0x60')]})[_0x1120('0x1b')](handleEntityNotFound(_0x3f7b8c,null))[_0x1120('0x1b')](function(_0x41e429){if(_0x41e429){_0x444a7b=_0x41e429[_0x1120('0x60')];var _0x3f56a0=_0x444a7b[_0x1120('0x61')](-0x1);if(_0x3f56a0==='/'){_0x444a7b=_0x444a7b[_0x1120('0x62')](0x0,_0x444a7b[_0x1120('0x63')](_0x3f56a0));}var _0xa1ab4e={'method':_0x1120('0x64'),'uri':util[_0x1120('0x65')]('%s/%s',_0x444a7b,_0x1120('0x66')),'json':!![]};switch(_0x41e429[_0x1120('0x5f')]){case _0x1120('0x5d'):_0xa1ab4e['headers']={'Authorization':util[_0x1120('0x65')](_0x1120('0x67'),new Buffer(util[_0x1120('0x65')]('%s:%s',_0x41e429[_0x1120('0x68')],_0x41e429[_0x1120('0x5d')]))['toString'](_0x1120('0x69')))};break;case _0x1120('0x5e'):_0xa1ab4e[_0x1120('0x6a')]={'Authorization':util[_0x1120('0x65')](_0x1120('0x67'),new Buffer(util[_0x1120('0x65')](_0x1120('0x6b'),_0x41e429[_0x1120('0x68')],_0x41e429[_0x1120('0x5e')]))[_0x1120('0x6c')]('base64'))};break;default:throw new db[(_0x1120('0x18'))][(_0x1120('0x6d'))](_0x1120('0x6e'));}return rp(_0xa1ab4e);}})[_0x1120('0x1b')](function(_0x5fdd8e){if(_0x5fdd8e){var _0x18a71f=[_0x1120('0x6f'),'description',_0x1120('0x70'),_0x1120('0x71')];_[_0x1120('0x72')](_0x5fdd8e[_0x1120('0x66')],function(_0x4744b1){return _0x18a71f[_0x1120('0x73')](_0x4744b1[_0x1120('0x3a')]);});return{'count':_0x5fdd8e[_0x1120('0x66')][_0x1120('0x42')],'rows':_[_0x1120('0x36')](_0x5fdd8e[_0x1120('0x66')],function(_0x2033c1){return{'id':_0x2033c1['id'],'name':_0x2033c1[_0x1120('0x74')]>0x7?_0x2033c1['title']:_0x2033c1[_0x1120('0x3a')],'custom':_0x2033c1[_0x1120('0x74')]>0x7?!![]:![],'options':_0x2033c1[_0x1120('0x75')]?_0x2033c1[_0x1120('0x75')]:_0x2033c1[_0x1120('0x76')]?_0x2033c1[_0x1120('0x76')]:[]};})};}})[_0x1120('0x1b')](respondWithResult(_0x3f7b8c,null))['catch'](function(_0x2fe9d3){var _0x5a8f05=_0x2e3202[_0x1120('0x3c')][_0x1120('0x17')]?0x1f4:_0x2fe9d3[_0x1120('0x77')]||0x1f4;logger[_0x1120('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0x1120('0x5c'),_0x5a8f05,JSON[_0x1120('0x21')](_0x2fe9d3));delete _0x2fe9d3[_0x1120('0x34')];if(_0x5a8f05===0x191){_0x5a8f05=0x190;}_0x3f7b8c[_0x1120('0x28')](_0x5a8f05)[_0x1120('0x78')](_0x2e3202[_0x1120('0x3c')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x2fe9d3['statusCode']}:_0x2fe9d3);});};
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js
index 01f2c36..f3b58f6 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 _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
+var _0x4a45=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','int_zendesk_accounts'];(function(_0x6fa310,_0x577b36){var _0x53ed7f=function(_0x13321d){while(--_0x13321d){_0x6fa310['push'](_0x6fa310['shift']());}};_0x53ed7f(++_0x577b36);}(_0x4a45,0xaa));var _0x54a4=function(_0x4342ca,_0x1f46be){_0x4342ca=_0x4342ca-0x0;var _0x3d9af1=_0x4a45[_0x4342ca];return _0x3d9af1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x54a4('0x0'))(_0x54a4('0x1'));var moment=require('moment');var BPromise=require(_0x54a4('0x2'));var rp=require(_0x54a4('0x3'));var fs=require('fs');var path=require(_0x54a4('0x4'));var rimraf=require(_0x54a4('0x5'));var config=require(_0x54a4('0x6'));var attributes=require(_0x54a4('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x54a4('0x8')]=function(_0x487b92,_0xfa4a2b){return _0x487b92['define']('ZendeskAccount',attributes,{'tableName':_0x54a4('0x9'),'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 e068dcb..984c4f3 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 _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
+var _0xd8b0=['raw','where','include','map','model','attributes','ShowZendeskAccount','find','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','options'];(function(_0x56d124,_0x3f8e9f){var _0x57074b=function(_0x3a4123){while(--_0x3a4123){_0x56d124['push'](_0x56d124['shift']());}};_0x57074b(++_0x3f8e9f);}(_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 moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['findAll']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'limit':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['limit']||null:null,'include':_0x5fecbd['options']?_0x5fecbd['options'][_0x0d8b('0x1b')]?_[_0x0d8b('0x1c')](_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1b')],function(_0x221071){return{'model':db[_0x221071[_0x0d8b('0x1d')]],'as':_0x221071['as'],'attributes':_0x221071[_0x0d8b('0x1e')],'include':_0x221071[_0x0d8b('0x1b')]?_[_0x0d8b('0x1c')](_0x221071['include'],function(_0xe8bbee){return{'model':db[_0xe8bbee[_0x0d8b('0x1d')]],'as':_0xe8bbee['as'],'attributes':_0xe8bbee['attributes'],'include':_0xe8bbee[_0x0d8b('0x1b')]?_['map'](_0xe8bbee[_0x0d8b('0x1b')],function(_0x234bdd){return{'model':db[_0x234bdd[_0x0d8b('0x1d')]],'as':_0x234bdd['as'],'attributes':_0x234bdd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x28f639){logger[_0x0d8b('0xb')]('GetZendeskAccount',_0x5fecbd);logger[_0x0d8b('0xe')]('GetZendeskAccount',_0x5fecbd,JSON[_0x0d8b('0x10')](_0x28f639));_0x18dd2d(_0x28f639);})['catch'](function(_0x97050a){logger['error'](_0x0d8b('0x16'),_0x97050a['message'],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x97050a['message']));});});};exports[_0x0d8b('0x1f')]=function(_0x106e4c){var _0x2c058d=this;return new Promise(function(_0x56120a,_0x4c80a2){return db['ZendeskAccount'][_0x0d8b('0x20')]({'raw':_0x106e4c['options']?_0x106e4c[_0x0d8b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x106e4c['options']?_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x106e4c[_0x0d8b('0x18')]?_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1e')]||null:null,'include':_0x106e4c[_0x0d8b('0x18')]?_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1b')]?_['map'](_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1b')],function(_0x4b3ea0){return{'model':db[_0x4b3ea0[_0x0d8b('0x1d')]],'as':_0x4b3ea0['as'],'attributes':_0x4b3ea0[_0x0d8b('0x1e')],'include':_0x4b3ea0[_0x0d8b('0x1b')]?_['map'](_0x4b3ea0[_0x0d8b('0x1b')],function(_0x2c507e){return{'model':db[_0x2c507e[_0x0d8b('0x1d')]],'as':_0x2c507e['as'],'attributes':_0x2c507e[_0x0d8b('0x1e')],'include':_0x2c507e[_0x0d8b('0x1b')]?_['map'](_0x2c507e[_0x0d8b('0x1b')],function(_0x1649fc){return{'model':db[_0x1649fc['model']],'as':_0x1649fc['as'],'attributes':_0x1649fc[_0x0d8b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0x188af2){logger[_0x0d8b('0xb')](_0x0d8b('0x1f'),_0x106e4c);logger['debug']('ShowZendeskAccount',_0x106e4c,JSON[_0x0d8b('0x10')](_0x188af2));_0x56120a(_0x188af2);})['catch'](function(_0x531c55){logger[_0x0d8b('0x11')](_0x0d8b('0x1f'),_0x531c55[_0x0d8b('0x13')],_0x106e4c);_0x4c80a2(_0x2c058d[_0x0d8b('0x11')](0x1f4,_0x531c55[_0x0d8b('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js
index 3977d6f..987ab1c 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 _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
+var _0x8e85=['Router','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3881f8,_0x1d2c78){var _0x39ec21=function(_0x33bdab){while(--_0x33bdab){_0x3881f8['push'](_0x3881f8['shift']());}};_0x39ec21(++_0x1d2c78);}(_0x8e85,0x14d));var _0x58e8=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x8e85[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0x58e8('0x0'));var util=require(_0x58e8('0x1'));var path=require(_0x58e8('0x2'));var timeout=require(_0x58e8('0x3'));var express=require(_0x58e8('0x4'));var router=express[_0x58e8('0x5')]();var auth=require(_0x58e8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x58e8('0x7'));var controller=require(_0x58e8('0x8'));router[_0x58e8('0x9')]('/',auth[_0x58e8('0xa')](),controller[_0x58e8('0xb')]);router[_0x58e8('0x9')](_0x58e8('0xc'),auth[_0x58e8('0xa')](),controller[_0x58e8('0xd')]);router[_0x58e8('0x9')](_0x58e8('0xe'),auth['isAuthenticated'](),controller[_0x58e8('0xf')]);router['get'](_0x58e8('0x10'),auth[_0x58e8('0xa')](),controller[_0x58e8('0x11')]);router[_0x58e8('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router['get'](_0x58e8('0x12'),auth[_0x58e8('0xa')](),controller[_0x58e8('0x13')]);router[_0x58e8('0x14')]('/',auth[_0x58e8('0xa')](),controller['create']);router[_0x58e8('0x14')](_0x58e8('0x12'),auth[_0x58e8('0xa')](),controller['setTags']);router[_0x58e8('0x15')]('/:id',auth[_0x58e8('0xa')](),controller[_0x58e8('0x16')]);router[_0x58e8('0x17')](_0x58e8('0xc'),auth[_0x58e8('0xa')](),controller[_0x58e8('0x18')]);module[_0x58e8('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
index 4c07b8a..8763167 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 _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
+var _0x253c=['sequelize','STRING'];(function(_0x5ce75c,_0x3f6635){var _0x3a0fbe=function(_0x5045d1){while(--_0x5045d1){_0x5ce75c['push'](_0x5ce75c['shift']());}};_0x3a0fbe(++_0x3f6635);}(_0x253c,0x1ee));var _0xc253=function(_0x4b0008,_0x41218b){_0x4b0008=_0x4b0008-0x0;var _0x401c96=_0x253c[_0x4b0008];return _0x401c96;};'use strict';var Sequelize=require(_0xc253('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc253('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
index fdf69fc..fb65914 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 _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
+var _0xae1b=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','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','then','info','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','stack','name','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','ZendeskConfiguration','find','create','update','body','params','getFields','findOne','ZendeskField','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto'];(function(_0x48a3ae,_0x5214a6){var _0x290aaf=function(_0x257487){while(--_0x257487){_0x48a3ae['push'](_0x48a3ae['shift']());}};_0x290aaf(++_0x5214a6);}(_0xae1b,0xad));var _0xbae1=function(_0x11ac88,_0x17576c){_0x11ac88=_0x11ac88-0x0;var _0x4e2712=_0xae1b[_0x11ac88];return _0x4e2712;};'use strict';var pdf=require(_0xbae1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbae1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbae1('0x2'));var moment=require(_0xbae1('0x3'));var BPromise=require(_0xbae1('0x4'));var Mustache=require(_0xbae1('0x5'));var util=require(_0xbae1('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbae1('0x7'));var ejs=require(_0xbae1('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbae1('0x9'));var crypto=require(_0xbae1('0xa'));var jsforce=require(_0xbae1('0xb'));var deskjs=require(_0xbae1('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbae1('0xd'));var Papa=require(_0xbae1('0xe'));var Redis=require('ioredis');var authService=require(_0xbae1('0xf'));var qs=require(_0xbae1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbae1('0x11'))('api');var utils=require(_0xbae1('0x12'));var config=require(_0xbae1('0x13'));var db=require(_0xbae1('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xbae1('0x15')][_0xbae1('0x16')]({'port':0x232a});function checkPasswordPattern(_0x1e30e3,_0x1541ec,_0x384109){if(_0x384109){var _0x20a109=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20a109['test'](_0x1541ec)){return _0x1e30e3;}else{throw new db['Sequelize'][(_0xbae1('0x17'))](_0xbae1('0x18'));}}else{return _0x1e30e3;}}function respondWithRpcPromise(_0x504ee4,_0x367d20,_0xa5cf99,_0x2859e4){return new BPromise(function(_0x1c1232,_0x23a05e){var _0x55c3be=_0x2859e4||client;return _0x55c3be[_0xbae1('0x19')](_0x504ee4,_0xa5cf99)[_0xbae1('0x1a')](function(_0x2b3696){logger[_0xbae1('0x1b')]('ZendeskConfiguration,\x20%s,\x20%s',_0x367d20,_0xbae1('0x1c'));logger['debug'](_0xbae1('0x1d'),_0x367d20,_0xbae1('0x1c'),JSON['stringify'](_0x2b3696));if(_0x2b3696[_0xbae1('0x1e')]){if(_0x2b3696[_0xbae1('0x1e')][_0xbae1('0x1f')]===0x1f4){logger[_0xbae1('0x1e')](_0xbae1('0x20'),_0x367d20,_0x2b3696[_0xbae1('0x1e')]['message']);return _0x23a05e(_0x2b3696['error'][_0xbae1('0x21')]);}logger[_0xbae1('0x1e')](_0xbae1('0x20'),_0x367d20,_0x2b3696['error'][_0xbae1('0x21')]);return _0x1c1232(_0x2b3696[_0xbae1('0x1e')][_0xbae1('0x21')]);}else{logger[_0xbae1('0x1b')](_0xbae1('0x20'),_0x367d20,_0xbae1('0x1c'));_0x1c1232(_0x2b3696[_0xbae1('0x22')][_0xbae1('0x21')]);}})[_0xbae1('0x23')](function(_0x371f7c){logger[_0xbae1('0x1e')](_0xbae1('0x20'),_0x367d20,_0x371f7c);_0x23a05e(_0x371f7c);});});}function respondWithStatusCode(_0x5b6d88,_0x4ee7cf){_0x4ee7cf=_0x4ee7cf||0xcc;return function(_0x1ba87f){if(_0x1ba87f){return _0x5b6d88[_0xbae1('0x24')](_0x4ee7cf);}return _0x5b6d88[_0xbae1('0x25')](_0x4ee7cf)[_0xbae1('0x26')]();};}function respondWithResult(_0x2ac004,_0x1614d0){_0x1614d0=_0x1614d0||0xc8;return function(_0x2fd41c){if(_0x2fd41c){return _0x2ac004[_0xbae1('0x25')](_0x1614d0)[_0xbae1('0x27')](_0x2fd41c);}};}function respondWithFilteredResult(_0x13aa10,_0x276faa){return function(_0x2457eb){if(_0x2457eb){var _0xef85a4=_0x2457eb[_0xbae1('0x28')],_0x14a935=_0x276faa[_0xbae1('0x29')],_0x365cb6=_0x276faa[_0xbae1('0x29')]+_0x276faa[_0xbae1('0x2a')],_0x41170f;if(_0x365cb6>=_0xef85a4){_0x365cb6=_0xef85a4;_0x41170f=0xc8;}else{_0x41170f=0xce;}_0x13aa10[_0xbae1('0x25')](_0x41170f);return _0x13aa10[_0xbae1('0x2b')](_0xbae1('0x2c'),_0x14a935+'-'+_0x365cb6+'/'+_0xef85a4)[_0xbae1('0x27')](_0x2457eb);}return null;};}function patchUpdates(_0x1c1beb){return function(_0x1dc68f){try{jsonpatch[_0xbae1('0x2d')](_0x1dc68f,_0x1c1beb,!![]);}catch(_0x5d8bd3){return BPromise['reject'](_0x5d8bd3);}return _0x1dc68f[_0xbae1('0x2e')]();};}function saveUpdates(_0x35b657,_0x57b082){return function(_0x1f3d09){if(_0x1f3d09){return _0x1f3d09['update'](_0x35b657)['then'](function(_0x4de9e1){return _0x4de9e1;});}return null;};}function removeEntity(_0x3b8275,_0x4b7624){return function(_0x2e56d1){if(_0x2e56d1){return _0x2e56d1[_0xbae1('0x2f')]()[_0xbae1('0x1a')](function(){_0x3b8275['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eca6c,_0x36481b){return function(_0x1432b6){if(!_0x1432b6){_0x1eca6c[_0xbae1('0x24')](0x194);}return _0x1432b6;};}function handleError(_0x3b3b55,_0xc35f6e){_0xc35f6e=_0xc35f6e||0x1f4;return function(_0x88e333){logger[_0xbae1('0x1e')](_0x88e333[_0xbae1('0x30')]);if(_0x88e333[_0xbae1('0x31')]){delete _0x88e333[_0xbae1('0x31')];}_0x3b3b55[_0xbae1('0x25')](_0xc35f6e)['send'](_0x88e333);};}exports['index']=function(_0x52de95,_0x146b9b){var _0x544556={},_0xd7c3c6={},_0xa50cf0={'count':0x0,'rows':[]};var _0x1c4dcf=_[_0xbae1('0x32')](db['ZendeskConfiguration'][_0xbae1('0x33')],function(_0x26ace2){return{'name':_0x26ace2[_0xbae1('0x34')],'type':_0x26ace2[_0xbae1('0x35')][_0xbae1('0x36')]};});_0xd7c3c6['model']=_[_0xbae1('0x32')](_0x1c4dcf,_0xbae1('0x31'));_0xd7c3c6['query']=_[_0xbae1('0x37')](_0x52de95[_0xbae1('0x38')]);_0xd7c3c6[_0xbae1('0x39')]=_[_0xbae1('0x3a')](_0xd7c3c6['model'],_0xd7c3c6['query']);_0x544556[_0xbae1('0x3b')]=_[_0xbae1('0x3a')](_0xd7c3c6[_0xbae1('0x3c')],qs[_0xbae1('0x3d')](_0x52de95[_0xbae1('0x38')]['fields']));_0x544556[_0xbae1('0x3b')]=_0x544556['attributes'][_0xbae1('0x3e')]?_0x544556[_0xbae1('0x3b')]:_0xd7c3c6[_0xbae1('0x3c')];if(!_0x52de95['query'][_0xbae1('0x3f')](_0xbae1('0x40'))){_0x544556[_0xbae1('0x2a')]=qs[_0xbae1('0x2a')](_0x52de95[_0xbae1('0x38')][_0xbae1('0x2a')]);_0x544556[_0xbae1('0x29')]=qs[_0xbae1('0x29')](_0x52de95[_0xbae1('0x38')]['offset']);}_0x544556[_0xbae1('0x41')]=qs[_0xbae1('0x42')](_0x52de95[_0xbae1('0x38')][_0xbae1('0x42')]);_0x544556['where']=qs[_0xbae1('0x39')](_['pick'](_0x52de95[_0xbae1('0x38')],_0xd7c3c6[_0xbae1('0x39')]),_0x1c4dcf);if(_0x52de95[_0xbae1('0x38')][_0xbae1('0x43')]){_0x544556[_0xbae1('0x44')]=_[_0xbae1('0x45')](_0x544556['where'],{'$or':_['map'](_0x1c4dcf,function(_0x2d5752){if(_0x2d5752['type']!==_0xbae1('0x46')){var _0x2b881d={};_0x2b881d[_0x2d5752['name']]={'$like':'%'+_0x52de95['query'][_0xbae1('0x43')]+'%'};return _0x2b881d;}})});}_0x544556=_[_0xbae1('0x45')]({},_0x544556,_0x52de95[_0xbae1('0x47')]);var _0x38f117={'where':_0x544556[_0xbae1('0x44')]};return db['ZendeskConfiguration'][_0xbae1('0x28')](_0x38f117)[_0xbae1('0x1a')](function(_0x5231a9){_0xa50cf0['count']=_0x5231a9;if(_0x52de95[_0xbae1('0x38')][_0xbae1('0x48')]){_0x544556[_0xbae1('0x49')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xbae1('0x4a')](_0x544556);})[_0xbae1('0x1a')](function(_0x2cc477){_0xa50cf0[_0xbae1('0x4b')]=_0x2cc477;return _0xa50cf0;})['then'](respondWithFilteredResult(_0x146b9b,_0x544556))[_0xbae1('0x23')](handleError(_0x146b9b,null));};exports['show']=function(_0x34f6de,_0x48efd3){var _0x9c1a2f={'raw':![],'where':{'id':_0x34f6de['params']['id']}},_0x3f169d={};_0x3f169d[_0xbae1('0x3c')]=_['keys'](db['ZendeskConfiguration']['rawAttributes']);_0x3f169d[_0xbae1('0x38')]=_[_0xbae1('0x37')](_0x34f6de['query']);_0x3f169d[_0xbae1('0x39')]=_[_0xbae1('0x3a')](_0x3f169d[_0xbae1('0x3c')],_0x3f169d[_0xbae1('0x38')]);_0x9c1a2f['attributes']=_[_0xbae1('0x3a')](_0x3f169d[_0xbae1('0x3c')],qs[_0xbae1('0x3d')](_0x34f6de[_0xbae1('0x38')][_0xbae1('0x3d')]));_0x9c1a2f['attributes']=_0x9c1a2f[_0xbae1('0x3b')][_0xbae1('0x3e')]?_0x9c1a2f['attributes']:_0x3f169d[_0xbae1('0x3c')];if(_0x34f6de[_0xbae1('0x38')][_0xbae1('0x48')]){_0x9c1a2f['include']=[{'all':!![]}];}_0x9c1a2f=_['merge']({},_0x9c1a2f,_0x34f6de[_0xbae1('0x47')]);return db[_0xbae1('0x4c')][_0xbae1('0x4d')](_0x9c1a2f)[_0xbae1('0x1a')](handleEntityNotFound(_0x48efd3,null))[_0xbae1('0x1a')](respondWithResult(_0x48efd3,null))['catch'](handleError(_0x48efd3,null));};exports[_0xbae1('0x4e')]=function(_0x550b55,_0x2af8e4){return db[_0xbae1('0x4c')][_0xbae1('0x4e')](_0x550b55['body'],{})[_0xbae1('0x1a')](respondWithResult(_0x2af8e4,0xc9))[_0xbae1('0x23')](handleError(_0x2af8e4,null));};exports[_0xbae1('0x4f')]=function(_0x1240f0,_0x1ed348){if(_0x1240f0[_0xbae1('0x50')]['id']){delete _0x1240f0[_0xbae1('0x50')]['id'];}return db[_0xbae1('0x4c')][_0xbae1('0x4d')]({'where':{'id':_0x1240f0[_0xbae1('0x51')]['id']}})[_0xbae1('0x1a')](handleEntityNotFound(_0x1ed348,null))[_0xbae1('0x1a')](saveUpdates(_0x1240f0[_0xbae1('0x50')],null))[_0xbae1('0x1a')](respondWithResult(_0x1ed348,null))['catch'](handleError(_0x1ed348,null));};exports['destroy']=function(_0x237370,_0x104872){return db['ZendeskConfiguration'][_0xbae1('0x4d')]({'where':{'id':_0x237370[_0xbae1('0x51')]['id']}})[_0xbae1('0x1a')](handleEntityNotFound(_0x104872,null))[_0xbae1('0x1a')](removeEntity(_0x104872,null))[_0xbae1('0x23')](handleError(_0x104872,null));};exports[_0xbae1('0x52')]=function(_0x425799,_0x2e32a1,_0x11f771){var _0x4970e9={};var _0x339347={};var _0x5d3a73;var _0x155c37;return db['ZendeskConfiguration'][_0xbae1('0x53')]({'where':{'id':_0x425799[_0xbae1('0x51')]['id']}})[_0xbae1('0x1a')](handleEntityNotFound(_0x2e32a1,null))[_0xbae1('0x1a')](function(_0x3ef7bb){if(_0x3ef7bb){_0x5d3a73=_0x3ef7bb;_0x339347[_0xbae1('0x3c')]=_['keys'](db[_0xbae1('0x54')]['rawAttributes']);_0x339347['query']=_[_0xbae1('0x37')](_0x425799['query']);_0x339347[_0xbae1('0x39')]=_[_0xbae1('0x3a')](_0x339347[_0xbae1('0x3c')],_0x339347[_0xbae1('0x38')]);_0x4970e9[_0xbae1('0x3b')]=_['intersection'](_0x339347[_0xbae1('0x3c')],qs['fields'](_0x425799[_0xbae1('0x38')][_0xbae1('0x3d')]));_0x4970e9[_0xbae1('0x3b')]=_0x4970e9['attributes']['length']?_0x4970e9[_0xbae1('0x3b')]:_0x339347[_0xbae1('0x3c')];_0x4970e9[_0xbae1('0x41')]=qs[_0xbae1('0x42')](_0x425799[_0xbae1('0x38')][_0xbae1('0x42')]);_0x4970e9[_0xbae1('0x44')]=qs['filters'](_[_0xbae1('0x55')](_0x425799['query'],_0x339347[_0xbae1('0x39')]));if(_0x425799[_0xbae1('0x38')][_0xbae1('0x43')]){_0x4970e9[_0xbae1('0x44')]=_[_0xbae1('0x45')](_0x4970e9[_0xbae1('0x44')],{'$or':_[_0xbae1('0x32')](_0x4970e9['attributes'],function(_0x7d4c7f){var _0x3de98b={};_0x3de98b[_0x7d4c7f]={'$like':'%'+_0x425799[_0xbae1('0x38')][_0xbae1('0x43')]+'%'};return _0x3de98b;})});}_0x4970e9=_['merge']({},_0x4970e9,_0x425799['options']);return _0x5d3a73['getFields'](_0x4970e9);}})[_0xbae1('0x1a')](function(_0x515ccd){if(_0x515ccd){_0x155c37=_0x515ccd[_0xbae1('0x3e')];if(!_0x425799['query']['hasOwnProperty'](_0xbae1('0x40'))){_0x4970e9[_0xbae1('0x2a')]=qs['limit'](_0x425799[_0xbae1('0x38')][_0xbae1('0x2a')]);_0x4970e9[_0xbae1('0x29')]=qs['offset'](_0x425799['query'][_0xbae1('0x29')]);}return _0x5d3a73[_0xbae1('0x52')](_0x4970e9);}})[_0xbae1('0x1a')](function(_0x49302f){if(_0x49302f){return _0x49302f?{'count':_0x155c37,'rows':_0x49302f}:null;}})[_0xbae1('0x1a')](respondWithResult(_0x2e32a1,null))[_0xbae1('0x23')](handleError(_0x2e32a1,null));};exports[_0xbae1('0x56')]=function(_0x1a7306,_0x2964c4,_0x3d3054){var _0x257088={};var _0x1eb5be={};var _0x2cec5a;var _0x40bee1;return db[_0xbae1('0x4c')][_0xbae1('0x53')]({'where':{'id':_0x1a7306[_0xbae1('0x51')]['id']}})[_0xbae1('0x1a')](handleEntityNotFound(_0x2964c4,null))['then'](function(_0x44b07d){if(_0x44b07d){_0x2cec5a=_0x44b07d;_0x1eb5be[_0xbae1('0x3c')]=_['keys'](db[_0xbae1('0x54')][_0xbae1('0x33')]);_0x1eb5be[_0xbae1('0x38')]=_['keys'](_0x1a7306[_0xbae1('0x38')]);_0x1eb5be[_0xbae1('0x39')]=_[_0xbae1('0x3a')](_0x1eb5be[_0xbae1('0x3c')],_0x1eb5be[_0xbae1('0x38')]);_0x257088[_0xbae1('0x3b')]=_[_0xbae1('0x3a')](_0x1eb5be[_0xbae1('0x3c')],qs[_0xbae1('0x3d')](_0x1a7306[_0xbae1('0x38')][_0xbae1('0x3d')]));_0x257088[_0xbae1('0x3b')]=_0x257088[_0xbae1('0x3b')][_0xbae1('0x3e')]?_0x257088[_0xbae1('0x3b')]:_0x1eb5be['model'];_0x257088['order']=qs[_0xbae1('0x42')](_0x1a7306['query']['sort']);_0x257088[_0xbae1('0x44')]=qs[_0xbae1('0x39')](_[_0xbae1('0x55')](_0x1a7306[_0xbae1('0x38')],_0x1eb5be[_0xbae1('0x39')]));if(_0x1a7306[_0xbae1('0x38')][_0xbae1('0x43')]){_0x257088[_0xbae1('0x44')]=_['merge'](_0x257088['where'],{'$or':_[_0xbae1('0x32')](_0x257088[_0xbae1('0x3b')],function(_0x58393b){var _0x2dfd34={};_0x2dfd34[_0x58393b]={'$like':'%'+_0x1a7306[_0xbae1('0x38')][_0xbae1('0x43')]+'%'};return _0x2dfd34;})});}_0x257088=_[_0xbae1('0x45')]({},_0x257088,_0x1a7306['options']);return _0x2cec5a[_0xbae1('0x56')](_0x257088);}})['then'](function(_0x380299){if(_0x380299){_0x40bee1=_0x380299[_0xbae1('0x3e')];if(!_0x1a7306[_0xbae1('0x38')][_0xbae1('0x3f')](_0xbae1('0x40'))){_0x257088['limit']=qs[_0xbae1('0x2a')](_0x1a7306[_0xbae1('0x38')]['limit']);_0x257088[_0xbae1('0x29')]=qs[_0xbae1('0x29')](_0x1a7306[_0xbae1('0x38')][_0xbae1('0x29')]);}return _0x2cec5a[_0xbae1('0x56')](_0x257088);}})[_0xbae1('0x1a')](function(_0x3f6e97){if(_0x3f6e97){return _0x3f6e97?{'count':_0x40bee1,'rows':_0x3f6e97}:null;}})['then'](respondWithResult(_0x2964c4,null))[_0xbae1('0x23')](handleError(_0x2964c4,null));};exports[_0xbae1('0x57')]=function(_0x289f4f,_0x11d9aa,_0x25d72d){var _0x2cc888={};var _0x15498e={};var _0x288bf7;var _0x4a5b12;return db[_0xbae1('0x4c')][_0xbae1('0x53')]({'where':{'id':_0x289f4f[_0xbae1('0x51')]['id']}})[_0xbae1('0x1a')](handleEntityNotFound(_0x11d9aa,null))['then'](function(_0x3300d9){if(_0x3300d9){_0x288bf7=_0x3300d9;_0x15498e['model']=_['keys'](db[_0xbae1('0x54')][_0xbae1('0x33')]);_0x15498e[_0xbae1('0x38')]=_[_0xbae1('0x37')](_0x289f4f['query']);_0x15498e[_0xbae1('0x39')]=_[_0xbae1('0x3a')](_0x15498e[_0xbae1('0x3c')],_0x15498e['query']);_0x2cc888['attributes']=_[_0xbae1('0x3a')](_0x15498e[_0xbae1('0x3c')],qs[_0xbae1('0x3d')](_0x289f4f['query'][_0xbae1('0x3d')]));_0x2cc888[_0xbae1('0x3b')]=_0x2cc888[_0xbae1('0x3b')][_0xbae1('0x3e')]?_0x2cc888[_0xbae1('0x3b')]:_0x15498e[_0xbae1('0x3c')];_0x2cc888[_0xbae1('0x41')]=qs[_0xbae1('0x42')](_0x289f4f['query'][_0xbae1('0x42')]);_0x2cc888[_0xbae1('0x44')]=qs[_0xbae1('0x39')](_['pick'](_0x289f4f[_0xbae1('0x38')],_0x15498e[_0xbae1('0x39')]));if(_0x289f4f[_0xbae1('0x38')][_0xbae1('0x43')]){_0x2cc888[_0xbae1('0x44')]=_[_0xbae1('0x45')](_0x2cc888[_0xbae1('0x44')],{'$or':_[_0xbae1('0x32')](_0x2cc888[_0xbae1('0x3b')],function(_0x29ccde){var _0x504596={};_0x504596[_0x29ccde]={'$like':'%'+_0x289f4f[_0xbae1('0x38')][_0xbae1('0x43')]+'%'};return _0x504596;})});}_0x2cc888=_['merge']({},_0x2cc888,_0x289f4f[_0xbae1('0x47')]);return _0x288bf7[_0xbae1('0x57')](_0x2cc888);}})[_0xbae1('0x1a')](function(_0x3242bb){if(_0x3242bb){_0x4a5b12=_0x3242bb[_0xbae1('0x3e')];if(!_0x289f4f[_0xbae1('0x38')][_0xbae1('0x3f')]('nolimit')){_0x2cc888[_0xbae1('0x2a')]=qs[_0xbae1('0x2a')](_0x289f4f[_0xbae1('0x38')][_0xbae1('0x2a')]);_0x2cc888[_0xbae1('0x29')]=qs[_0xbae1('0x29')](_0x289f4f[_0xbae1('0x38')][_0xbae1('0x29')]);}return _0x288bf7['getDescriptions'](_0x2cc888);}})[_0xbae1('0x1a')](function(_0x49f8f1){if(_0x49f8f1){return _0x49f8f1?{'count':_0x4a5b12,'rows':_0x49f8f1}:null;}})[_0xbae1('0x1a')](respondWithResult(_0x11d9aa,null))[_0xbae1('0x23')](handleError(_0x11d9aa,null));};exports[_0xbae1('0x58')]=function(_0x3f7877,_0x4238c6,_0x2cd924){var _0x317cc3={};var _0x3e3339={};var _0x1f634b;var _0x4e969c;return db['ZendeskConfiguration'][_0xbae1('0x53')]({'where':{'id':_0x3f7877[_0xbae1('0x51')]['id']}})[_0xbae1('0x1a')](handleEntityNotFound(_0x4238c6,null))[_0xbae1('0x1a')](function(_0x2b7d2c){if(_0x2b7d2c){_0x1f634b=_0x2b7d2c;_0x3e3339['model']=_[_0xbae1('0x37')](db[_0xbae1('0x59')][_0xbae1('0x33')]);_0x3e3339['query']=_[_0xbae1('0x37')](_0x3f7877['query']);_0x3e3339['filters']=_[_0xbae1('0x3a')](_0x3e3339[_0xbae1('0x3c')],_0x3e3339[_0xbae1('0x38')]);_0x317cc3['attributes']=_[_0xbae1('0x3a')](_0x3e3339[_0xbae1('0x3c')],qs[_0xbae1('0x3d')](_0x3f7877[_0xbae1('0x38')][_0xbae1('0x3d')]));_0x317cc3[_0xbae1('0x3b')]=_0x317cc3[_0xbae1('0x3b')][_0xbae1('0x3e')]?_0x317cc3['attributes']:_0x3e3339[_0xbae1('0x3c')];_0x317cc3[_0xbae1('0x41')]=qs[_0xbae1('0x42')](_0x3f7877[_0xbae1('0x38')][_0xbae1('0x42')]);_0x317cc3[_0xbae1('0x44')]=qs['filters'](_['pick'](_0x3f7877['query'],_0x3e3339[_0xbae1('0x39')]));if(_0x3f7877['query'][_0xbae1('0x43')]){_0x317cc3['where']=_['merge'](_0x317cc3[_0xbae1('0x44')],{'$or':_[_0xbae1('0x32')](_0x317cc3[_0xbae1('0x3b')],function(_0x273dab){var _0x57c85c={};_0x57c85c[_0x273dab]={'$like':'%'+_0x3f7877[_0xbae1('0x38')][_0xbae1('0x43')]+'%'};return _0x57c85c;})});}_0x317cc3=_[_0xbae1('0x45')]({},_0x317cc3,_0x3f7877[_0xbae1('0x47')]);return _0x1f634b['getTags'](_0x317cc3);}})[_0xbae1('0x1a')](function(_0x1e614d){if(_0x1e614d){_0x4e969c=_0x1e614d[_0xbae1('0x3e')];if(!_0x3f7877['query'][_0xbae1('0x3f')](_0xbae1('0x40'))){_0x317cc3[_0xbae1('0x2a')]=qs[_0xbae1('0x2a')](_0x3f7877[_0xbae1('0x38')][_0xbae1('0x2a')]);_0x317cc3[_0xbae1('0x29')]=qs['offset'](_0x3f7877['query'][_0xbae1('0x29')]);}return _0x1f634b[_0xbae1('0x58')](_0x317cc3);}})['then'](function(_0x1c2a99){if(_0x1c2a99){return _0x1c2a99?{'count':_0x4e969c,'rows':_0x1c2a99}:null;}})[_0xbae1('0x1a')](respondWithResult(_0x4238c6,null))[_0xbae1('0x23')](handleError(_0x4238c6,null));};exports[_0xbae1('0x5a')]=function(_0x3072b6,_0x5bf8a5,_0x2d36f8){if(_0x3072b6[_0xbae1('0x50')]['id']){delete _0x3072b6['body']['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x3072b6[_0xbae1('0x51')]['id']}})[_0xbae1('0x1a')](handleEntityNotFound(_0x5bf8a5,null))[_0xbae1('0x1a')](function(_0x1fc05f){if(_0x1fc05f){return _0x1fc05f[_0xbae1('0x5a')](_0x3072b6[_0xbae1('0x50')][_0xbae1('0x5b')]||[]);}return null;})[_0xbae1('0x1a')](respondWithResult(_0x5bf8a5,null))[_0xbae1('0x23')](handleError(_0x5bf8a5,null));};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
index 9b264ca..863d204 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 _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
+var _0xf5d0=['api','moment','request-promise','path','rimraf','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations','util','../../config/logger'];(function(_0x111252,_0x4a7856){var _0x504145=function(_0x1e7bd1){while(--_0x1e7bd1){_0x111252['push'](_0x111252['shift']());}};_0x504145(++_0x4a7856);}(_0xf5d0,0xc4));var _0x0f5d=function(_0x366cde,_0x47b7cf){_0x366cde=_0x366cde-0x0;var _0x4331df=_0xf5d0[_0x366cde];return _0x4331df;};'use strict';var _=require('lodash');var util=require(_0x0f5d('0x0'));var logger=require(_0x0f5d('0x1'))(_0x0f5d('0x2'));var moment=require(_0x0f5d('0x3'));var BPromise=require('bluebird');var rp=require(_0x0f5d('0x4'));var fs=require('fs');var path=require(_0x0f5d('0x5'));var rimraf=require(_0x0f5d('0x6'));var config=require('../../config/environment');var attributes=require(_0x0f5d('0x7'));module[_0x0f5d('0x8')]=function(_0x13e5ef,_0x474b00){return _0x13e5ef[_0x0f5d('0x9')]('ZendeskConfiguration',attributes,{'tableName':_0x0f5d('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 ad911ed..b7026bb 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 _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
+var _0x417d=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','debug','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','info','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x417d,0xdf));var _0xd417=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x417d[_0x4953da];return _0x2d3780;};'use strict';var _=require(_0xd417('0x0'));var util=require(_0xd417('0x1'));var moment=require(_0xd417('0x2'));var BPromise=require(_0xd417('0x3'));var rs=require(_0xd417('0x4'));var fs=require('fs');var Redis=require(_0xd417('0x5'));var db=require(_0xd417('0x6'))['db'];var utils=require(_0xd417('0x7'));var logger=require(_0xd417('0x8'))(_0xd417('0x9'));var config=require('../../config/environment');var jayson=require(_0xd417('0xa'));var client=jayson[_0xd417('0xb')][_0xd417('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e8eaa,_0x1a90c6,_0x2439b4){return new BPromise(function(_0x51e629,_0xf50acf){return client[_0xd417('0xd')](_0x2e8eaa,_0x2439b4)['then'](function(_0x6674aa){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x1a90c6,'request\x20sent');logger[_0xd417('0xe')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1a90c6,'request\x20sent',JSON[_0xd417('0xf')](_0x6674aa));if(_0x6674aa[_0xd417('0x10')]){if(_0x6674aa[_0xd417('0x10')][_0xd417('0x11')]===0x1f4){logger['error'](_0xd417('0x12'),_0x1a90c6,_0x6674aa[_0xd417('0x10')]['message']);return _0xf50acf(_0x6674aa[_0xd417('0x10')][_0xd417('0x13')]);}logger['error'](_0xd417('0x12'),_0x1a90c6,_0x6674aa[_0xd417('0x10')][_0xd417('0x13')]);return _0x51e629(_0x6674aa[_0xd417('0x10')][_0xd417('0x13')]);}else{logger[_0xd417('0x14')](_0xd417('0x12'),_0x1a90c6,_0xd417('0x15'));_0x51e629(_0x6674aa[_0xd417('0x16')]['message']);}})['catch'](function(_0x5d186a){logger[_0xd417('0x10')](_0xd417('0x12'),_0x1a90c6,_0x5d186a);_0xf50acf(_0x5d186a);});});}
\ No newline at end of file
diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js
index 3b03232..cafb7d2 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 _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
+var _0x5296=['destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','post','create','put','/:id','update','delete'];(function(_0x499c60,_0x30e75e){var _0x41a5f2=function(_0x38aefe){while(--_0x38aefe){_0x499c60['push'](_0x499c60['shift']());}};_0x41a5f2(++_0x30e75e);}(_0x5296,0x17d));var _0x6529=function(_0x321e65,_0x38fc67){_0x321e65=_0x321e65-0x0;var _0xef93a8=_0x5296[_0x321e65];return _0xef93a8;};'use strict';var multer=require(_0x6529('0x0'));var util=require(_0x6529('0x1'));var path=require(_0x6529('0x2'));var timeout=require(_0x6529('0x3'));var express=require(_0x6529('0x4'));var router=express['Router']();var auth=require(_0x6529('0x5'));var interaction=require(_0x6529('0x6'));var config=require(_0x6529('0x7'));var controller=require(_0x6529('0x8'));router[_0x6529('0x9')]('/',auth[_0x6529('0xa')](),controller[_0x6529('0xb')]);router[_0x6529('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6529('0xc')]('/',auth['isAuthenticated'](),controller[_0x6529('0xd')]);router[_0x6529('0xe')](_0x6529('0xf'),auth[_0x6529('0xa')](),controller[_0x6529('0x10')]);router[_0x6529('0x11')](_0x6529('0xf'),auth[_0x6529('0xa')](),controller[_0x6529('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js
index 3979f4a..6943464 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 _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
+var _0x8147=['exports','string','variable','customVariable','STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8147,0x179));var _0x7814=function(_0x363049,_0x233d74){_0x363049=_0x363049-0x0;var _0x1a0357=_0x8147[_0x363049];return _0x1a0357;};'use strict';var Sequelize=require(_0x7814('0x0'));module[_0x7814('0x1')]={'type':{'type':Sequelize['ENUM'](_0x7814('0x2'),_0x7814('0x3'),_0x7814('0x4'),'keyValue'),'defaultValue':_0x7814('0x2')},'content':{'type':Sequelize[_0x7814('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x7814('0x2'),_0x7814('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7814('0x5')]},'nameField':{'type':Sequelize[_0x7814('0x5')]},'customField':{'type':Sequelize[_0x7814('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js
index 367986c..2ca95be 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 _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
+var _0x240b=['offset','set','Content-Range','json','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','where','pick','filter','VIRTUAL','options','ZendeskField','includeAll','include','findAll','rows','show','params','rawAttributes','length','merge','find','catch','create','body','destroy','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count'];(function(_0x3be5d2,_0x2e9740){var _0x440de1=function(_0x15b672){while(--_0x15b672){_0x3be5d2['push'](_0x3be5d2['shift']());}};_0x440de1(++_0x2e9740);}(_0x240b,0x1a9));var _0xb240=function(_0x1f22d4,_0x2b0d0e){_0x1f22d4=_0x1f22d4-0x0;var _0x4843ee=_0x240b[_0x1f22d4];return _0x4843ee;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb240('0x0'));var jsonpatch=require(_0xb240('0x1'));var rp=require('request-promise');var moment=require(_0xb240('0x2'));var BPromise=require(_0xb240('0x3'));var Mustache=require(_0xb240('0x4'));var util=require(_0xb240('0x5'));var path=require(_0xb240('0x6'));var sox=require(_0xb240('0x7'));var csv=require(_0xb240('0x8'));var ejs=require(_0xb240('0x9'));var fs=require('fs');var _=require(_0xb240('0xa'));var squel=require(_0xb240('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb240('0x8'));var querystring=require(_0xb240('0xc'));var Papa=require(_0xb240('0xd'));var Redis=require('ioredis');var authService=require(_0xb240('0xe'));var qs=require(_0xb240('0xf'));var as=require(_0xb240('0x10'));var hardwareService=require(_0xb240('0x11'));var logger=require(_0xb240('0x12'))(_0xb240('0x13'));var utils=require(_0xb240('0x14'));var config=require(_0xb240('0x15'));var db=require(_0xb240('0x16'))['db'];function respondWithStatusCode(_0x2df03f,_0x25d9b9){_0x25d9b9=_0x25d9b9||0xcc;return function(_0x6b12f6){if(_0x6b12f6){return _0x2df03f['sendStatus'](_0x25d9b9);}return _0x2df03f[_0xb240('0x17')](_0x25d9b9)['end']();};}function respondWithResult(_0x3b26d8,_0x2d9edb){_0x2d9edb=_0x2d9edb||0xc8;return function(_0x64739){if(_0x64739){return _0x3b26d8['status'](_0x2d9edb)['json'](_0x64739);}};}function respondWithFilteredResult(_0x597406,_0x1c39dc){return function(_0x5919a0){if(_0x5919a0){var _0x1c4b4f=_0x5919a0[_0xb240('0x18')],_0x915c7d=_0x1c39dc['offset'],_0x3c6f06=_0x1c39dc[_0xb240('0x19')]+_0x1c39dc['limit'],_0x2b03cb;if(_0x3c6f06>=_0x1c4b4f){_0x3c6f06=_0x1c4b4f;_0x2b03cb=0xc8;}else{_0x2b03cb=0xce;}_0x597406[_0xb240('0x17')](_0x2b03cb);return _0x597406[_0xb240('0x1a')](_0xb240('0x1b'),_0x915c7d+'-'+_0x3c6f06+'/'+_0x1c4b4f)[_0xb240('0x1c')](_0x5919a0);}return null;};}function patchUpdates(_0x3167df){return function(_0x58d015){try{jsonpatch[_0xb240('0x1d')](_0x58d015,_0x3167df,!![]);}catch(_0x6d80aa){return BPromise[_0xb240('0x1e')](_0x6d80aa);}return _0x58d015[_0xb240('0x1f')]();};}function saveUpdates(_0x29fe93,_0x260ca3){return function(_0x5084bf){if(_0x5084bf){return _0x5084bf[_0xb240('0x20')](_0x29fe93)[_0xb240('0x21')](function(_0x480445){return _0x480445;});}return null;};}function removeEntity(_0x38ffbe,_0x18d588){return function(_0x36dce9){if(_0x36dce9){return _0x36dce9['destroy']()[_0xb240('0x21')](function(){_0x38ffbe[_0xb240('0x17')](0xcc)[_0xb240('0x22')]();});}};}function handleEntityNotFound(_0x5e7a17,_0x3887a3){return function(_0x30172d){if(!_0x30172d){_0x5e7a17[_0xb240('0x23')](0x194);}return _0x30172d;};}function handleError(_0x3b8b02,_0x5f170e){_0x5f170e=_0x5f170e||0x1f4;return function(_0x20f296){logger[_0xb240('0x24')](_0x20f296[_0xb240('0x25')]);if(_0x20f296[_0xb240('0x26')]){delete _0x20f296['name'];}_0x3b8b02[_0xb240('0x17')](_0x5f170e)[_0xb240('0x27')](_0x20f296);};}exports[_0xb240('0x28')]=function(_0xe3fdc9,_0x590be1){var _0x42395a={},_0x42f924={},_0x54c1e8={'count':0x0,'rows':[]};var _0x1d62c6=_[_0xb240('0x29')](db['ZendeskField']['rawAttributes'],function(_0x2e29d2){return{'name':_0x2e29d2[_0xb240('0x2a')],'type':_0x2e29d2[_0xb240('0x2b')][_0xb240('0x2c')]};});_0x42f924[_0xb240('0x2d')]=_[_0xb240('0x29')](_0x1d62c6,_0xb240('0x26'));_0x42f924[_0xb240('0x2e')]=_[_0xb240('0x2f')](_0xe3fdc9[_0xb240('0x2e')]);_0x42f924[_0xb240('0x30')]=_[_0xb240('0x31')](_0x42f924[_0xb240('0x2d')],_0x42f924[_0xb240('0x2e')]);_0x42395a[_0xb240('0x32')]=_['intersection'](_0x42f924[_0xb240('0x2d')],qs[_0xb240('0x33')](_0xe3fdc9[_0xb240('0x2e')][_0xb240('0x33')]));_0x42395a[_0xb240('0x32')]=_0x42395a['attributes']['length']?_0x42395a[_0xb240('0x32')]:_0x42f924[_0xb240('0x2d')];if(!_0xe3fdc9[_0xb240('0x2e')][_0xb240('0x34')]('nolimit')){_0x42395a[_0xb240('0x35')]=qs[_0xb240('0x35')](_0xe3fdc9[_0xb240('0x2e')][_0xb240('0x35')]);_0x42395a[_0xb240('0x19')]=qs[_0xb240('0x19')](_0xe3fdc9[_0xb240('0x2e')]['offset']);}_0x42395a[_0xb240('0x36')]=qs['sort'](_0xe3fdc9[_0xb240('0x2e')]['sort']);_0x42395a[_0xb240('0x37')]=qs[_0xb240('0x30')](_[_0xb240('0x38')](_0xe3fdc9[_0xb240('0x2e')],_0x42f924[_0xb240('0x30')]),_0x1d62c6);if(_0xe3fdc9[_0xb240('0x2e')][_0xb240('0x39')]){_0x42395a[_0xb240('0x37')]=_['merge'](_0x42395a[_0xb240('0x37')],{'$or':_[_0xb240('0x29')](_0x1d62c6,function(_0x1b6421){if(_0x1b6421[_0xb240('0x2b')]!==_0xb240('0x3a')){var _0x457dfa={};_0x457dfa[_0x1b6421[_0xb240('0x26')]]={'$like':'%'+_0xe3fdc9[_0xb240('0x2e')][_0xb240('0x39')]+'%'};return _0x457dfa;}})});}_0x42395a=_['merge']({},_0x42395a,_0xe3fdc9[_0xb240('0x3b')]);var _0x2177dc={'where':_0x42395a['where']};return db[_0xb240('0x3c')]['count'](_0x2177dc)['then'](function(_0x5b3523){_0x54c1e8['count']=_0x5b3523;if(_0xe3fdc9['query'][_0xb240('0x3d')]){_0x42395a[_0xb240('0x3e')]=[{'all':!![]}];}return db[_0xb240('0x3c')][_0xb240('0x3f')](_0x42395a);})['then'](function(_0x261cf4){_0x54c1e8[_0xb240('0x40')]=_0x261cf4;return _0x54c1e8;})[_0xb240('0x21')](respondWithFilteredResult(_0x590be1,_0x42395a))['catch'](handleError(_0x590be1,null));};exports[_0xb240('0x41')]=function(_0x75ba34,_0x6995e){var _0x4193b1={'raw':!![],'where':{'id':_0x75ba34[_0xb240('0x42')]['id']}},_0x39f1c9={};_0x39f1c9[_0xb240('0x2d')]=_[_0xb240('0x2f')](db['ZendeskField'][_0xb240('0x43')]);_0x39f1c9[_0xb240('0x2e')]=_[_0xb240('0x2f')](_0x75ba34[_0xb240('0x2e')]);_0x39f1c9[_0xb240('0x30')]=_[_0xb240('0x31')](_0x39f1c9[_0xb240('0x2d')],_0x39f1c9[_0xb240('0x2e')]);_0x4193b1[_0xb240('0x32')]=_[_0xb240('0x31')](_0x39f1c9['model'],qs['fields'](_0x75ba34[_0xb240('0x2e')][_0xb240('0x33')]));_0x4193b1['attributes']=_0x4193b1['attributes'][_0xb240('0x44')]?_0x4193b1[_0xb240('0x32')]:_0x39f1c9[_0xb240('0x2d')];if(_0x75ba34[_0xb240('0x2e')][_0xb240('0x3d')]){_0x4193b1[_0xb240('0x3e')]=[{'all':!![]}];}_0x4193b1=_[_0xb240('0x45')]({},_0x4193b1,_0x75ba34[_0xb240('0x3b')]);return db[_0xb240('0x3c')][_0xb240('0x46')](_0x4193b1)[_0xb240('0x21')](handleEntityNotFound(_0x6995e,null))[_0xb240('0x21')](respondWithResult(_0x6995e,null))[_0xb240('0x47')](handleError(_0x6995e,null));};exports[_0xb240('0x48')]=function(_0x2d7423,_0x1c2eb6){return db[_0xb240('0x3c')][_0xb240('0x48')](_0x2d7423[_0xb240('0x49')],{})[_0xb240('0x21')](respondWithResult(_0x1c2eb6,0xc9))[_0xb240('0x47')](handleError(_0x1c2eb6,null));};exports[_0xb240('0x20')]=function(_0x3e6a9e,_0x15f844){if(_0x3e6a9e[_0xb240('0x49')]['id']){delete _0x3e6a9e[_0xb240('0x49')]['id'];}return db[_0xb240('0x3c')][_0xb240('0x46')]({'where':{'id':_0x3e6a9e['params']['id']}})['then'](handleEntityNotFound(_0x15f844,null))['then'](saveUpdates(_0x3e6a9e['body'],null))[_0xb240('0x21')](respondWithResult(_0x15f844,null))[_0xb240('0x47')](handleError(_0x15f844,null));};exports[_0xb240('0x4a')]=function(_0xde2332,_0x3f48bc){return db[_0xb240('0x3c')][_0xb240('0x46')]({'where':{'id':_0xde2332[_0xb240('0x42')]['id']}})[_0xb240('0x21')](handleEntityNotFound(_0x3f48bc,null))[_0xb240('0x21')](removeEntity(_0x3f48bc,null))[_0xb240('0x47')](handleError(_0x3f48bc,null));};
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js
index 2a97c3c..c8c2cc9 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 _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
+var _0x9ffd=['ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes','define'];(function(_0x5a0d48,_0x3b8a2b){var _0x5852ac=function(_0x35b4c6){while(--_0x35b4c6){_0x5a0d48['push'](_0x5a0d48['shift']());}};_0x5852ac(++_0x3b8a2b);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x159f1f,_0xc8e8b1){_0x159f1f=_0x159f1f-0x0;var _0x187d7d=_0x9ffd[_0x159f1f];return _0x187d7d;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('api');var moment=require(_0xd9ff('0x3'));var BPromise=require(_0xd9ff('0x4'));var rp=require(_0xd9ff('0x5'));var fs=require('fs');var path=require(_0xd9ff('0x6'));var rimraf=require('rimraf');var config=require(_0xd9ff('0x7'));var attributes=require(_0xd9ff('0x8'));module['exports']=function(_0x3aa26b,_0x2982c3){return _0x3aa26b[_0xd9ff('0x9')](_0xd9ff('0xa'),attributes,{'tableName':_0xd9ff('0xb'),'paranoid':![],'indexes':[{'name':_0xd9ff('0xc'),'fields':[_0xd9ff('0xd'),_0xd9ff('0xe')],'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 211d72d..d9ae2c9 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 _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
+var _0x9828=['rpc','../../config/environment','jayson/promise','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4569d7,_0x56e87f){var _0x37bc44=function(_0x38943b){while(--_0x38943b){_0x4569d7['push'](_0x4569d7['shift']());}};_0x37bc44(++_0x56e87f);}(_0x9828,0x1c4));var _0x8982=function(_0x406a37,_0x10c6ab){_0x406a37=_0x406a37-0x0;var _0xc09724=_0x9828[_0x406a37];return _0xc09724;};'use strict';var _=require('lodash');var util=require(_0x8982('0x0'));var moment=require(_0x8982('0x1'));var BPromise=require(_0x8982('0x2'));var rs=require(_0x8982('0x3'));var fs=require('fs');var Redis=require(_0x8982('0x4'));var db=require(_0x8982('0x5'))['db'];var utils=require(_0x8982('0x6'));var logger=require(_0x8982('0x7'))(_0x8982('0x8'));var config=require(_0x8982('0x9'));var jayson=require(_0x8982('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x434e80,_0x32c797,_0x46d705){return new BPromise(function(_0x34105d,_0x162959){return client[_0x8982('0xb')](_0x434e80,_0x46d705)[_0x8982('0xc')](function(_0x3c7439){logger[_0x8982('0xd')](_0x8982('0xe'),_0x32c797,_0x8982('0xf'));logger['debug'](_0x8982('0x10'),_0x32c797,_0x8982('0xf'),JSON[_0x8982('0x11')](_0x3c7439));if(_0x3c7439[_0x8982('0x12')]){if(_0x3c7439[_0x8982('0x12')][_0x8982('0x13')]===0x1f4){logger[_0x8982('0x12')](_0x8982('0xe'),_0x32c797,_0x3c7439[_0x8982('0x12')][_0x8982('0x14')]);return _0x162959(_0x3c7439[_0x8982('0x12')][_0x8982('0x14')]);}logger[_0x8982('0x12')](_0x8982('0xe'),_0x32c797,_0x3c7439['error']['message']);return _0x34105d(_0x3c7439[_0x8982('0x12')][_0x8982('0x14')]);}else{logger['info'](_0x8982('0xe'),_0x32c797,_0x8982('0xf'));_0x34105d(_0x3c7439[_0x8982('0x15')]['message']);}})[_0x8982('0x16')](function(_0x4890ff){logger[_0x8982('0x12')](_0x8982('0xe'),_0x32c797,_0x4890ff);_0x162959(_0x4890ff);});});}
\ No newline at end of file
diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js
index 9f07fff..80ff60a 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 _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
+var _0x8c78=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./intZohoAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete'];(function(_0x289891,_0x49a0fa){var _0x31cf2e=function(_0x8cebce){while(--_0x8cebce){_0x289891['push'](_0x289891['shift']());}};_0x31cf2e(++_0x49a0fa);}(_0x8c78,0xda));var _0x88c7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x8c78[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require('multer');var util=require(_0x88c7('0x0'));var path=require(_0x88c7('0x1'));var timeout=require(_0x88c7('0x2'));var express=require(_0x88c7('0x3'));var router=express[_0x88c7('0x4')]();var auth=require(_0x88c7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x88c7('0x6'));router[_0x88c7('0x7')]('/',auth['isAuthenticated'](),controller[_0x88c7('0x8')]);router[_0x88c7('0x7')](_0x88c7('0x9'),auth[_0x88c7('0xa')](),controller[_0x88c7('0xb')]);router[_0x88c7('0x7')](_0x88c7('0xc'),auth[_0x88c7('0xa')](),controller[_0x88c7('0xd')]);router[_0x88c7('0x7')](_0x88c7('0xe'),auth[_0x88c7('0xa')](),controller[_0x88c7('0xf')]);router[_0x88c7('0x10')]('/',auth[_0x88c7('0xa')](),controller[_0x88c7('0x11')]);router[_0x88c7('0x10')]('/:id/configurations',auth[_0x88c7('0xa')](),controller[_0x88c7('0x12')]);router[_0x88c7('0x13')](_0x88c7('0x9'),auth[_0x88c7('0xa')](),controller[_0x88c7('0x14')]);router[_0x88c7('0x15')](_0x88c7('0x9'),auth['isAuthenticated'](),controller[_0x88c7('0x16')]);module[_0x88c7('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js
index 6a1caa9..ad4d5b5 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 _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
+var _0x9acd=['exports','STRING','sequelize'];(function(_0x2103fa,_0xe60333){var _0x4c135e=function(_0x414567){while(--_0x414567){_0x2103fa['push'](_0x2103fa['shift']());}};_0x4c135e(++_0xe60333);}(_0x9acd,0xb9));var _0xd9ac=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9acd[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0xd9ac('0x0'));module[_0xd9ac('0x1')]={'name':{'type':Sequelize[_0xd9ac('0x2')]},'description':{'type':Sequelize[_0xd9ac('0x2')]},'host':{'type':Sequelize[_0xd9ac('0x2')]},'zone':{'type':Sequelize[_0xd9ac('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xd9ac('0x2')]},'serverUrl':{'type':Sequelize[_0xd9ac('0x2')]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js
index 8fc4a41..109fcbe 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 _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
+var _0xe6d5=['../../config/license/hardware','api','../../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','request\x20sent','debug','stringify','error','ZohoAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','destroy','stack','name','send','map','ZohoAccount','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','params','rawAttributes','intersection','create','body','update','find','getConfigurations','findOne','ZohoConfiguration','order','length','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','clientId','clientSecret','refresh_token','access_token','getFields','host','zone','code','zoho.eu','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5de5df,_0x4cb0da){var _0x1f0f8b=function(_0x1a7acd){while(--_0x1a7acd){_0x5de5df['push'](_0x5de5df['shift']());}};_0x1f0f8b(++_0x4cb0da);}(_0xe6d5,0x18a));var _0x5e6d=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0xe6d5[_0x46f1a6];return _0x38429a;};'use strict';var pdf=require(_0x5e6d('0x0'));var emlformat=require(_0x5e6d('0x1'));var rimraf=require(_0x5e6d('0x2'));var zipdir=require(_0x5e6d('0x3'));var jsonpatch=require(_0x5e6d('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5e6d('0x5'));var Mustache=require(_0x5e6d('0x6'));var util=require(_0x5e6d('0x7'));var path=require(_0x5e6d('0x8'));var sox=require('sox');var csv=require(_0x5e6d('0x9'));var ejs=require(_0x5e6d('0xa'));var fs=require('fs');var _=require(_0x5e6d('0xb'));var squel=require(_0x5e6d('0xc'));var crypto=require(_0x5e6d('0xd'));var jsforce=require(_0x5e6d('0xe'));var deskjs=require(_0x5e6d('0xf'));var toCsv=require(_0x5e6d('0x9'));var querystring=require(_0x5e6d('0x10'));var Papa=require('papaparse');var Redis=require(_0x5e6d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5e6d('0x12'));var as=require(_0x5e6d('0x13'));var hardwareService=require(_0x5e6d('0x14'));var logger=require('../../config/logger')(_0x5e6d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x5e6d('0x16'));var jayson=require(_0x5e6d('0x17'));var client=jayson[_0x5e6d('0x18')][_0x5e6d('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5df682,_0x4d7c23,_0x7ce45d){if(_0x7ce45d){var _0x46b9f7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x46b9f7[_0x5e6d('0x1a')](_0x4d7c23)){return _0x5df682;}else{throw new db[(_0x5e6d('0x1b'))][(_0x5e6d('0x1c'))](_0x5e6d('0x1d'));}}else{return _0x5df682;}}function respondWithRpcPromise(_0x530f4c,_0x242069,_0x3b54f6,_0x38c443){return new BPromise(function(_0xb492b8,_0x288f4d){var _0x314a8e=_0x38c443||client;return _0x314a8e[_0x5e6d('0x1e')](_0x530f4c,_0x3b54f6)[_0x5e6d('0x1f')](function(_0x3c9330){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x242069,_0x5e6d('0x20'));logger[_0x5e6d('0x21')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x242069,_0x5e6d('0x20'),JSON[_0x5e6d('0x22')](_0x3c9330));if(_0x3c9330[_0x5e6d('0x23')]){if(_0x3c9330[_0x5e6d('0x23')]['code']===0x1f4){logger[_0x5e6d('0x23')](_0x5e6d('0x24'),_0x242069,_0x3c9330['error'][_0x5e6d('0x25')]);return _0x288f4d(_0x3c9330[_0x5e6d('0x23')][_0x5e6d('0x25')]);}logger['error'](_0x5e6d('0x24'),_0x242069,_0x3c9330[_0x5e6d('0x23')][_0x5e6d('0x25')]);return _0xb492b8(_0x3c9330[_0x5e6d('0x23')]['message']);}else{logger[_0x5e6d('0x26')]('ZohoAccount,\x20%s,\x20%s',_0x242069,_0x5e6d('0x20'));_0xb492b8(_0x3c9330[_0x5e6d('0x27')]['message']);}})[_0x5e6d('0x28')](function(_0x4c7ff8){logger[_0x5e6d('0x23')](_0x5e6d('0x24'),_0x242069,_0x4c7ff8);_0x288f4d(_0x4c7ff8);});});}function respondWithStatusCode(_0x18c460,_0x1217d3){_0x1217d3=_0x1217d3||0xcc;return function(_0x41ad70){if(_0x41ad70){return _0x18c460[_0x5e6d('0x29')](_0x1217d3);}return _0x18c460[_0x5e6d('0x2a')](_0x1217d3)['end']();};}function respondWithResult(_0x144d59,_0x2ed5be){_0x2ed5be=_0x2ed5be||0xc8;return function(_0x5b4a00){if(_0x5b4a00){return _0x144d59[_0x5e6d('0x2a')](_0x2ed5be)[_0x5e6d('0x2b')](_0x5b4a00);}};}function respondWithFilteredResult(_0x350849,_0x3fc083){return function(_0x24a4f6){if(_0x24a4f6){var _0x2a4e67=_0x24a4f6[_0x5e6d('0x2c')],_0x5b662f=_0x3fc083[_0x5e6d('0x2d')],_0x859dec=_0x3fc083[_0x5e6d('0x2d')]+_0x3fc083[_0x5e6d('0x2e')],_0x1beb9b;if(_0x859dec>=_0x2a4e67){_0x859dec=_0x2a4e67;_0x1beb9b=0xc8;}else{_0x1beb9b=0xce;}_0x350849[_0x5e6d('0x2a')](_0x1beb9b);return _0x350849[_0x5e6d('0x2f')](_0x5e6d('0x30'),_0x5b662f+'-'+_0x859dec+'/'+_0x2a4e67)[_0x5e6d('0x2b')](_0x24a4f6);}return null;};}function patchUpdates(_0x3cd3c6){return function(_0x4f4f77){try{jsonpatch[_0x5e6d('0x31')](_0x4f4f77,_0x3cd3c6,!![]);}catch(_0x3f77a3){return BPromise['reject'](_0x3f77a3);}return _0x4f4f77['save']();};}function saveUpdates(_0x57e0b6,_0x36c67e){return function(_0x22a899){if(_0x22a899){return _0x22a899['update'](_0x57e0b6)[_0x5e6d('0x1f')](function(_0x4fd9b4){return _0x4fd9b4;});}return null;};}function removeEntity(_0x31ba74,_0x165e9e){return function(_0x9af096){if(_0x9af096){return _0x9af096[_0x5e6d('0x32')]()[_0x5e6d('0x1f')](function(){_0x31ba74['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa2a283,_0x2735d9){return function(_0x25973e){if(!_0x25973e){_0xa2a283[_0x5e6d('0x29')](0x194);}return _0x25973e;};}function handleError(_0xdbe73c,_0x4f134e){_0x4f134e=_0x4f134e||0x1f4;return function(_0x57d9b3){logger[_0x5e6d('0x23')](_0x57d9b3[_0x5e6d('0x33')]);if(_0x57d9b3[_0x5e6d('0x34')]){delete _0x57d9b3['name'];}_0xdbe73c[_0x5e6d('0x2a')](_0x4f134e)[_0x5e6d('0x35')](_0x57d9b3);};}exports['index']=function(_0x4da82f,_0x1e9a51){var _0x30f7f8={},_0xc00775={},_0x335baf={'count':0x0,'rows':[]};var _0x9c419a=_[_0x5e6d('0x36')](db[_0x5e6d('0x37')]['rawAttributes'],function(_0x29617a){return{'name':_0x29617a[_0x5e6d('0x38')],'type':_0x29617a[_0x5e6d('0x39')][_0x5e6d('0x3a')]};});_0xc00775[_0x5e6d('0x3b')]=_[_0x5e6d('0x36')](_0x9c419a,'name');_0xc00775[_0x5e6d('0x3c')]=_[_0x5e6d('0x3d')](_0x4da82f['query']);_0xc00775[_0x5e6d('0x3e')]=_['intersection'](_0xc00775['model'],_0xc00775['query']);_0x30f7f8[_0x5e6d('0x3f')]=_['intersection'](_0xc00775[_0x5e6d('0x3b')],qs['fields'](_0x4da82f[_0x5e6d('0x3c')][_0x5e6d('0x40')]));_0x30f7f8[_0x5e6d('0x3f')]=_0x30f7f8[_0x5e6d('0x3f')]['length']?_0x30f7f8[_0x5e6d('0x3f')]:_0xc00775[_0x5e6d('0x3b')];if(!_0x4da82f[_0x5e6d('0x3c')][_0x5e6d('0x41')](_0x5e6d('0x42'))){_0x30f7f8[_0x5e6d('0x2e')]=qs['limit'](_0x4da82f[_0x5e6d('0x3c')]['limit']);_0x30f7f8['offset']=qs['offset'](_0x4da82f[_0x5e6d('0x3c')]['offset']);}_0x30f7f8['order']=qs['sort'](_0x4da82f[_0x5e6d('0x3c')][_0x5e6d('0x43')]);_0x30f7f8[_0x5e6d('0x44')]=qs['filters'](_[_0x5e6d('0x45')](_0x4da82f['query'],_0xc00775[_0x5e6d('0x3e')]),_0x9c419a);if(_0x4da82f[_0x5e6d('0x3c')]['filter']){_0x30f7f8[_0x5e6d('0x44')]=_[_0x5e6d('0x46')](_0x30f7f8[_0x5e6d('0x44')],{'$or':_[_0x5e6d('0x36')](_0x9c419a,function(_0x4bef1e){if(_0x4bef1e['type']!=='VIRTUAL'){var _0x3ff2f6={};_0x3ff2f6[_0x4bef1e[_0x5e6d('0x34')]]={'$like':'%'+_0x4da82f[_0x5e6d('0x3c')][_0x5e6d('0x47')]+'%'};return _0x3ff2f6;}})});}_0x30f7f8=_['merge']({},_0x30f7f8,_0x4da82f[_0x5e6d('0x48')]);var _0x22bc43={'where':_0x30f7f8['where']};return db[_0x5e6d('0x37')]['count'](_0x22bc43)[_0x5e6d('0x1f')](function(_0x58d666){_0x335baf[_0x5e6d('0x2c')]=_0x58d666;if(_0x4da82f['query'][_0x5e6d('0x49')]){_0x30f7f8[_0x5e6d('0x4a')]=[{'all':!![]}];}return db[_0x5e6d('0x37')][_0x5e6d('0x4b')](_0x30f7f8);})['then'](function(_0x2fb7bb){_0x335baf[_0x5e6d('0x4c')]=_0x2fb7bb;return _0x335baf;})[_0x5e6d('0x1f')](respondWithFilteredResult(_0x1e9a51,_0x30f7f8))[_0x5e6d('0x28')](handleError(_0x1e9a51,null));};exports['show']=function(_0x105921,_0x71867c){var _0x1124ad={'raw':![],'where':{'id':_0x105921[_0x5e6d('0x4d')]['id']}},_0x275ef1={};_0x275ef1[_0x5e6d('0x3b')]=_['keys'](db[_0x5e6d('0x37')][_0x5e6d('0x4e')]);_0x275ef1[_0x5e6d('0x3c')]=_['keys'](_0x105921[_0x5e6d('0x3c')]);_0x275ef1[_0x5e6d('0x3e')]=_[_0x5e6d('0x4f')](_0x275ef1['model'],_0x275ef1['query']);_0x1124ad['attributes']=_[_0x5e6d('0x4f')](_0x275ef1[_0x5e6d('0x3b')],qs['fields'](_0x105921[_0x5e6d('0x3c')][_0x5e6d('0x40')]));_0x1124ad[_0x5e6d('0x3f')]=_0x1124ad['attributes']['length']?_0x1124ad[_0x5e6d('0x3f')]:_0x275ef1[_0x5e6d('0x3b')];if(_0x105921[_0x5e6d('0x3c')][_0x5e6d('0x49')]){_0x1124ad[_0x5e6d('0x4a')]=[{'all':!![]}];}_0x1124ad=_[_0x5e6d('0x46')]({},_0x1124ad,_0x105921[_0x5e6d('0x48')]);return db[_0x5e6d('0x37')]['find'](_0x1124ad)['then'](handleEntityNotFound(_0x71867c,null))[_0x5e6d('0x1f')](respondWithResult(_0x71867c,null))['catch'](handleError(_0x71867c,null));};exports[_0x5e6d('0x50')]=function(_0x41aa33,_0x5ba45){return db['ZohoAccount'][_0x5e6d('0x50')](_0x41aa33[_0x5e6d('0x51')],{})[_0x5e6d('0x1f')](respondWithResult(_0x5ba45,0xc9))[_0x5e6d('0x28')](handleError(_0x5ba45,null));};exports[_0x5e6d('0x52')]=function(_0x46a6f4,_0x117d9d){if(_0x46a6f4[_0x5e6d('0x51')]['id']){delete _0x46a6f4[_0x5e6d('0x51')]['id'];}return db['ZohoAccount'][_0x5e6d('0x53')]({'where':{'id':_0x46a6f4[_0x5e6d('0x4d')]['id']}})[_0x5e6d('0x1f')](handleEntityNotFound(_0x117d9d,null))[_0x5e6d('0x1f')](saveUpdates(_0x46a6f4['body'],null))[_0x5e6d('0x1f')](respondWithResult(_0x117d9d,null))[_0x5e6d('0x28')](handleError(_0x117d9d,null));};exports[_0x5e6d('0x32')]=function(_0x1fc129,_0x2e8725){return db[_0x5e6d('0x37')][_0x5e6d('0x53')]({'where':{'id':_0x1fc129[_0x5e6d('0x4d')]['id']}})[_0x5e6d('0x1f')](handleEntityNotFound(_0x2e8725,null))[_0x5e6d('0x1f')](removeEntity(_0x2e8725,null))[_0x5e6d('0x28')](handleError(_0x2e8725,null));};exports[_0x5e6d('0x54')]=function(_0x5d7319,_0x2870f3,_0x247c49){var _0xa42b80={};var _0x369cc4={};var _0x2de175;var _0x34b3f8;return db[_0x5e6d('0x37')][_0x5e6d('0x55')]({'where':{'id':_0x5d7319['params']['id']}})[_0x5e6d('0x1f')](handleEntityNotFound(_0x2870f3,null))[_0x5e6d('0x1f')](function(_0x11370d){if(_0x11370d){_0x2de175=_0x11370d;_0x369cc4[_0x5e6d('0x3b')]=_[_0x5e6d('0x3d')](db[_0x5e6d('0x56')][_0x5e6d('0x4e')]);_0x369cc4[_0x5e6d('0x3c')]=_[_0x5e6d('0x3d')](_0x5d7319[_0x5e6d('0x3c')]);_0x369cc4[_0x5e6d('0x3e')]=_['intersection'](_0x369cc4[_0x5e6d('0x3b')],_0x369cc4[_0x5e6d('0x3c')]);_0xa42b80[_0x5e6d('0x3f')]=_['intersection'](_0x369cc4[_0x5e6d('0x3b')],qs[_0x5e6d('0x40')](_0x5d7319[_0x5e6d('0x3c')][_0x5e6d('0x40')]));_0xa42b80['attributes']=_0xa42b80[_0x5e6d('0x3f')]['length']?_0xa42b80['attributes']:_0x369cc4[_0x5e6d('0x3b')];_0xa42b80[_0x5e6d('0x57')]=qs[_0x5e6d('0x43')](_0x5d7319[_0x5e6d('0x3c')]['sort']);_0xa42b80[_0x5e6d('0x44')]=qs[_0x5e6d('0x3e')](_['pick'](_0x5d7319[_0x5e6d('0x3c')],_0x369cc4[_0x5e6d('0x3e')]));if(_0x5d7319[_0x5e6d('0x3c')][_0x5e6d('0x47')]){_0xa42b80[_0x5e6d('0x44')]=_[_0x5e6d('0x46')](_0xa42b80[_0x5e6d('0x44')],{'$or':_[_0x5e6d('0x36')](_0xa42b80[_0x5e6d('0x3f')],function(_0x6545ed){var _0x44008e={};_0x44008e[_0x6545ed]={'$like':'%'+_0x5d7319['query'][_0x5e6d('0x47')]+'%'};return _0x44008e;})});}_0xa42b80=_[_0x5e6d('0x46')]({},_0xa42b80,_0x5d7319[_0x5e6d('0x48')]);return _0x2de175[_0x5e6d('0x54')](_0xa42b80);}})[_0x5e6d('0x1f')](function(_0x3db3d6){if(_0x3db3d6){_0x34b3f8=_0x3db3d6[_0x5e6d('0x58')];if(!_0x5d7319[_0x5e6d('0x3c')][_0x5e6d('0x41')](_0x5e6d('0x42'))){_0xa42b80[_0x5e6d('0x2e')]=qs[_0x5e6d('0x2e')](_0x5d7319[_0x5e6d('0x3c')][_0x5e6d('0x2e')]);_0xa42b80[_0x5e6d('0x2d')]=qs[_0x5e6d('0x2d')](_0x5d7319[_0x5e6d('0x3c')][_0x5e6d('0x2d')]);}return _0x2de175[_0x5e6d('0x54')](_0xa42b80);}})[_0x5e6d('0x1f')](function(_0x4eb12a){if(_0x4eb12a){return _0x4eb12a?{'count':_0x34b3f8,'rows':_0x4eb12a}:null;}})['then'](respondWithResult(_0x2870f3,null))[_0x5e6d('0x28')](handleError(_0x2870f3,null));};exports['addConfiguration']=function(_0x3d34b1,_0x44240e,_0x5872c5){if(_0x3d34b1[_0x5e6d('0x51')]['id']){delete _0x3d34b1[_0x5e6d('0x51')]['id'];}return db['ZohoAccount'][_0x5e6d('0x55')]({'where':{'id':_0x3d34b1[_0x5e6d('0x4d')]['id']}})[_0x5e6d('0x1f')](handleEntityNotFound(_0x44240e,null))['then'](function(_0x833a2f){if(_0x833a2f){_0x3d34b1[_0x5e6d('0x51')][_0x5e6d('0x59')]=_0x833a2f['id'];_0x3d34b1['body'][_0x5e6d('0x5a')]=integrations[_0x5e6d('0x5b')](_0x3d34b1[_0x5e6d('0x51')][_0x5e6d('0x5c')],_0x3d34b1['body'][_0x5e6d('0x39')]);_0x3d34b1[_0x5e6d('0x51')][_0x5e6d('0x5d')]=integrations[_0x5e6d('0x5e')](_0x3d34b1[_0x5e6d('0x51')][_0x5e6d('0x5c')],_0x3d34b1[_0x5e6d('0x51')][_0x5e6d('0x39')]);return db[_0x5e6d('0x56')][_0x5e6d('0x50')](_0x3d34b1[_0x5e6d('0x51')],{'include':[{'model':db[_0x5e6d('0x5f')],'as':_0x5e6d('0x5a')},{'model':db[_0x5e6d('0x5f')],'as':_0x5e6d('0x5d')}]});}return null;})[_0x5e6d('0x1f')](respondWithResult(_0x44240e,null))['catch'](handleError(_0x44240e,null));};function getAccessToken(_0x108c3a){return new Promise(function(_0x3379ce,_0x521ba5){var _0x30d1d7;switch(_0x108c3a['zone']){case'US':_0x30d1d7=_0x5e6d('0x60');break;case'AU':_0x30d1d7=_0x5e6d('0x61');break;case'EU':_0x30d1d7='https://accounts.zoho.eu';break;case'IN':_0x30d1d7=_0x5e6d('0x62');break;case'CN':_0x30d1d7=_0x5e6d('0x63');break;default:_0x30d1d7=_0x5e6d('0x64');break;}var _0xe3e842={'method':_0x5e6d('0x65'),'uri':_0x30d1d7+'/oauth/v2/token','qs':{'refresh_token':_0x108c3a['refreshToken'],'client_id':_0x108c3a[_0x5e6d('0x66')],'client_secret':_0x108c3a[_0x5e6d('0x67')],'grant_type':_0x5e6d('0x68')},'json':!![]};return rp(_0xe3e842)[_0x5e6d('0x1f')](function(_0x3c3181){if(_0x3c3181[_0x5e6d('0x69')]){_0x3379ce(_0x3c3181[_0x5e6d('0x69')]);}else{_0x521ba5('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x5e6d('0x28')](function(_0x32c5da){_0x521ba5(_0x32c5da);});});}exports[_0x5e6d('0x6a')]=function(_0x45e354,_0x3dd950,_0x13f98b){var _0x248166,_0x5da22f,_0x4c1def,_0x10386c,_0x4afb73;return db[_0x5e6d('0x37')]['findOne']({'where':{'id':_0x45e354[_0x5e6d('0x4d')]['id']},'attributes':['id',_0x5e6d('0x6b'),_0x5e6d('0x6c'),_0x5e6d('0x66'),_0x5e6d('0x67'),'serverUrl',_0x5e6d('0x6d'),'refreshToken']})['then'](handleEntityNotFound(_0x3dd950,null))['then'](function(_0x3578b8){_0x4afb73=_0x3578b8;_0x248166=_0x4afb73[_0x5e6d('0x6b')];_0x5da22f=_0x248166===_0x5e6d('0x6e')?'eu':'com';_0x4c1def=_0x4afb73[_0x5e6d('0x6f')];var _0x513422=_0x4c1def[_0x5e6d('0x70')](-0x1);if(_0x513422==='/'||_0x513422==='\x5c'||_0x513422===':'){_0x4c1def=_0x4c1def[_0x5e6d('0x71')](0x0,_0x4c1def[_0x5e6d('0x72')](_0x513422));}if(!_0x4afb73['refreshToken']){throw new Error(_0x5e6d('0x73'));}return getAccessToken(_0x4afb73);})[_0x5e6d('0x1f')](function(_0x5de193){if(_0x5de193){return rp({'method':'GET','uri':util[_0x5e6d('0x74')](_0x5e6d('0x75'),_0x5da22f),'qs':{'module':_0x5e6d('0x76')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5de193},'json':!![]});}})[_0x5e6d('0x1f')](function(_0x7f5d7f){if(_0x7f5d7f){if(_0x7f5d7f[_0x5e6d('0x77')]&&_0x7f5d7f[_0x5e6d('0x77')][_0x5e6d('0x23')]){throw new Error(_0x7f5d7f[_0x5e6d('0x77')][_0x5e6d('0x23')]['message']);}var _0x1e4bb5=[];var _0x51b7c3=[];var _0x3c68b7=[_0x5e6d('0x78'),_0x5e6d('0x79'),_0x5e6d('0x7a'),_0x5e6d('0x7b'),'Call_Duration',_0x5e6d('0x7c'),_0x5e6d('0x7d'),_0x5e6d('0x7e')];_0x51b7c3=_[_0x5e6d('0x7f')](_0x7f5d7f['fields'],function(_0x52126f){return _0x3c68b7['includes'](_0x52126f[_0x5e6d('0x80')]);});for(var _0x6705a6=0x0;_0x6705a6<_0x51b7c3[_0x5e6d('0x58')];_0x6705a6++){if(_0x51b7c3[_0x6705a6][_0x5e6d('0x81')]===![]){_0x1e4bb5[_0x5e6d('0x82')]({'id':_0x51b7c3[_0x6705a6]['id'],'name':_0x51b7c3[_0x6705a6][_0x5e6d('0x83')],'custom':_0x51b7c3[_0x6705a6]['custom_field'],'options':_0x51b7c3[_0x6705a6][_0x5e6d('0x84')]===_0x5e6d('0x85')&&_0x51b7c3[_0x6705a6][_0x5e6d('0x86')][_0x5e6d('0x58')]>-0x1?_[_0x5e6d('0x36')](_0x51b7c3[_0x6705a6][_0x5e6d('0x86')],function(_0x3d3ef4){return{'name':_0x3d3ef4,'value':_0x3d3ef4};}):[]});}}return{'count':_0x1e4bb5['length'],'rows':_0x1e4bb5};}else{return{'count':0x0,'rows':[]};}})[_0x5e6d('0x1f')](respondWithResult(_0x3dd950,null))[_0x5e6d('0x28')](function(_0x250b42){var _0x51633b=_0x45e354[_0x5e6d('0x3c')][_0x5e6d('0x1a')]?0x1f4:_0x250b42[_0x5e6d('0x87')]||0x1f4;logger[_0x5e6d('0x23')](_0x5e6d('0x88'),'getFields',_0x51633b,JSON[_0x5e6d('0x22')](_0x250b42));delete _0x250b42['name'];if(_0x51633b===0x191){_0x51633b=0x190;}_0x3dd950[_0x5e6d('0x2a')](_0x51633b)[_0x5e6d('0x35')](_0x45e354[_0x5e6d('0x3c')]['test']?{'message':_0x5e6d('0x89'),'statusCode':_0x250b42[_0x5e6d('0x87')]}:_0x250b42);});};
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js
index 7a65298..4c98dfc 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 _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
+var _0x5720=['https://accounts.zoho.eu','/oauth/v2/token','application/x-www-form-urlencoded','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','define','int_zoho_accounts','changed','clientId','clientSecret','code','host','serverUrl','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','authorization_code','then','parse','refresh_token','refreshToken','info','format','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','zone'];(function(_0x578eae,_0xc5cd36){var _0x184fb5=function(_0x3fd249){while(--_0x3fd249){_0x578eae['push'](_0x578eae['shift']());}};_0x184fb5(++_0xc5cd36);}(_0x5720,0x81));var _0x0572=function(_0x3e589a,_0xf8df5a){_0x3e589a=_0x3e589a-0x0;var _0x511383=_0x5720[_0x3e589a];return _0x511383;};'use strict';var _=require(_0x0572('0x0'));var util=require(_0x0572('0x1'));var logger=require(_0x0572('0x2'))(_0x0572('0x3'));var moment=require(_0x0572('0x4'));var BPromise=require(_0x0572('0x5'));var rp=require(_0x0572('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0572('0x7'));var config=require(_0x0572('0x8'));var attributes=require(_0x0572('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x7a3bd2,_0x5836f9){return _0x7a3bd2[_0x0572('0xa')]('ZohoAccount',attributes,{'tableName':_0x0572('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x392ac5,_0x4f838b,_0x51adf0){if(_0x392ac5[_0x0572('0xc')]('zone')||_0x392ac5[_0x0572('0xc')]('serverUrl')||_0x392ac5[_0x0572('0xc')](_0x0572('0xd'))||_0x392ac5['changed'](_0x0572('0xe'))||_0x392ac5['changed'](_0x0572('0xf'))||_0x392ac5['changed'](_0x0572('0x10'))){var _0x365038,_0x524e68;_0x365038=_0x392ac5[_0x0572('0x11')];var _0xa7ad80=_0x365038[_0x0572('0x12')](-0x1);if(_0xa7ad80==='/'||_0xa7ad80==='\x5c'||_0xa7ad80===':'){_0x365038=_0x365038[_0x0572('0x13')](0x0,_0x365038[_0x0572('0x14')](_0xa7ad80));}switch(_0x392ac5['zone']){case'US':_0x524e68=_0x0572('0x15');break;case'AU':_0x524e68=_0x0572('0x16');break;case'IN':_0x524e68=_0x0572('0x17');break;case'CN':_0x524e68=_0x0572('0x18');break;default:_0x524e68='https://accounts.zoho.eu';break;}var _0x12f503={'method':_0x0572('0x19'),'uri':_0x524e68+'/oauth/v2/token','form':{'grant_type':_0x0572('0x1a'),'client_id':_0x392ac5[_0x0572('0xd')],'client_secret':_0x392ac5[_0x0572('0xe')],'redirect_uri':_0x392ac5[_0x0572('0x11')],'code':_0x392ac5[_0x0572('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x12f503)[_0x0572('0x1b')](function(_0x188319){var _0x54e310=JSON[_0x0572('0x1c')](_0x188319);if(_0x54e310[_0x0572('0x1d')]){_0x392ac5[_0x0572('0x1e')]=_0x54e310[_0x0572('0x1d')];logger[_0x0572('0x1f')](util[_0x0572('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x392ac5[_0x0572('0x21')],_0x392ac5['id']));}else{logger[_0x0572('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x392ac5[_0x0572('0x21')],_0x392ac5['id']),util[_0x0572('0x23')](_0x54e310,{'showHidden':![],'depth':null}));}return _0x51adf0(null,_0x4f838b);})[_0x0572('0x24')](function(_0x30a274){logger['error'](util['format'](_0x0572('0x25'),_0x392ac5[_0x0572('0x21')],_0x392ac5['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x51adf0(_0x30a274);});}else{return _0x51adf0(null,_0x4f838b);}},'beforeUpdate':function(_0x45c03b,_0x4ed323,_0x5a00d8){if(_0x45c03b['changed'](_0x0572('0x26'))||_0x45c03b[_0x0572('0xc')](_0x0572('0x11'))||_0x45c03b[_0x0572('0xc')](_0x0572('0xd'))||_0x45c03b[_0x0572('0xc')]('clientSecret')||_0x45c03b[_0x0572('0xc')](_0x0572('0xf'))||_0x45c03b['changed'](_0x0572('0x10'))){var _0x1e1ac2,_0x50be0d;_0x1e1ac2=_0x45c03b['serverUrl'];var _0x53c73e=_0x1e1ac2[_0x0572('0x12')](-0x1);if(_0x53c73e==='/'||_0x53c73e==='\x5c'||_0x53c73e===':'){_0x1e1ac2=_0x1e1ac2[_0x0572('0x13')](0x0,_0x1e1ac2[_0x0572('0x14')](_0x53c73e));}switch(_0x45c03b[_0x0572('0x26')]){case'US':_0x50be0d='https://accounts.zoho.com';break;case'AU':_0x50be0d=_0x0572('0x16');break;case'IN':_0x50be0d=_0x0572('0x17');break;case'CN':_0x50be0d=_0x0572('0x18');break;default:_0x50be0d=_0x0572('0x27');break;}var _0x23673e={'method':_0x0572('0x19'),'uri':_0x50be0d+_0x0572('0x28'),'form':{'grant_type':'authorization_code','client_id':_0x45c03b[_0x0572('0xd')],'client_secret':_0x45c03b[_0x0572('0xe')],'redirect_uri':_0x45c03b[_0x0572('0x11')],'code':_0x45c03b['code']},'headers':{'Content-Type':_0x0572('0x29')}};return rp(_0x23673e)[_0x0572('0x1b')](function(_0x55e95a){var _0x35e262=JSON['parse'](_0x55e95a);if(_0x35e262[_0x0572('0x1d')]){_0x45c03b[_0x0572('0x1e')]=_0x35e262['refresh_token'];logger[_0x0572('0x1f')](util[_0x0572('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x45c03b['name'],_0x45c03b['id']));}else{logger[_0x0572('0x22')](util[_0x0572('0x20')](_0x0572('0x25'),_0x45c03b['name'],_0x45c03b['id']),util[_0x0572('0x23')](_0x35e262,{'showHidden':![],'depth':null}));}return _0x5a00d8(null,_0x4ed323);})[_0x0572('0x24')](function(_0x1a2c1b){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x45c03b[_0x0572('0x21')],_0x45c03b['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x5a00d8(_0x1a2c1b);});}else{return _0x5a00d8(null,_0x4ed323);}}}});};
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js
index 5cb828b..be42903 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 _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
+var _0x229c=['include','map','model','attributes','ShowZohoAccount','find','raw','where','then','util','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','limit'];(function(_0x53ce18,_0x51ff4e){var _0x253e5a=function(_0x1663a4){while(--_0x1663a4){_0x53ce18['push'](_0x53ce18['shift']());}};_0x253e5a(++_0x51ff4e);}(_0x229c,0xcf));var _0xc229=function(_0x381d88,_0x187470){_0x381d88=_0x381d88-0x0;var _0x10c0c1=_0x229c[_0x381d88];return _0x10c0c1;};'use strict';var _=require('lodash');var util=require(_0xc229('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc229('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc229('0x2'));var logger=require('../../config/logger')(_0xc229('0x3'));var config=require(_0xc229('0x4'));var jayson=require(_0xc229('0x5'));var client=jayson['client'][_0xc229('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x52978a,_0x41ede5,_0x14cd26){return new BPromise(function(_0x504d48,_0x3fb59d){return client[_0xc229('0x7')](_0x52978a,_0x14cd26)['then'](function(_0x529822){logger[_0xc229('0x8')]('ZohoAccount,\x20%s,\x20%s',_0x41ede5,'request\x20sent');logger[_0xc229('0x9')](_0xc229('0xa'),_0x41ede5,_0xc229('0xb'),JSON[_0xc229('0xc')](_0x529822));if(_0x529822[_0xc229('0xd')]){if(_0x529822[_0xc229('0xd')][_0xc229('0xe')]===0x1f4){logger[_0xc229('0xd')](_0xc229('0xf'),_0x41ede5,_0x529822[_0xc229('0xd')][_0xc229('0x10')]);return _0x3fb59d(_0x529822[_0xc229('0xd')][_0xc229('0x10')]);}logger['error'](_0xc229('0xf'),_0x41ede5,_0x529822['error'][_0xc229('0x10')]);return _0x504d48(_0x529822[_0xc229('0xd')][_0xc229('0x10')]);}else{logger[_0xc229('0x8')](_0xc229('0xf'),_0x41ede5,_0xc229('0xb'));_0x504d48(_0x529822[_0xc229('0x11')][_0xc229('0x10')]);}})[_0xc229('0x12')](function(_0x3c3b1c){logger[_0xc229('0xd')](_0xc229('0xf'),_0x41ede5,_0x3c3b1c);_0x3fb59d(_0x3c3b1c);});});}exports[_0xc229('0x13')]=function(_0x4cae05){var _0x379e41=this;return new Promise(function(_0x10339a,_0x393e8c){return db[_0xc229('0x14')][_0xc229('0x15')]({'raw':_0x4cae05[_0xc229('0x16')]?_0x4cae05[_0xc229('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4cae05['options']?_0x4cae05[_0xc229('0x16')]['where']||null:null,'attributes':_0x4cae05[_0xc229('0x16')]?_0x4cae05[_0xc229('0x16')]['attributes']||null:null,'limit':_0x4cae05['options']?_0x4cae05[_0xc229('0x16')][_0xc229('0x17')]||null:null,'include':_0x4cae05[_0xc229('0x16')]?_0x4cae05[_0xc229('0x16')][_0xc229('0x18')]?_[_0xc229('0x19')](_0x4cae05[_0xc229('0x16')]['include'],function(_0x5cb52f){return{'model':db[_0x5cb52f[_0xc229('0x1a')]],'as':_0x5cb52f['as'],'attributes':_0x5cb52f[_0xc229('0x1b')],'include':_0x5cb52f['include']?_['map'](_0x5cb52f[_0xc229('0x18')],function(_0x30c711){return{'model':db[_0x30c711[_0xc229('0x1a')]],'as':_0x30c711['as'],'attributes':_0x30c711[_0xc229('0x1b')],'include':_0x30c711[_0xc229('0x18')]?_[_0xc229('0x19')](_0x30c711['include'],function(_0x103d43){return{'model':db[_0x103d43[_0xc229('0x1a')]],'as':_0x103d43['as'],'attributes':_0x103d43[_0xc229('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x524908){logger[_0xc229('0x8')]('GetZohoAccount',_0x4cae05);logger[_0xc229('0x9')](_0xc229('0x13'),_0x4cae05,JSON[_0xc229('0xc')](_0x524908));_0x10339a(_0x524908);})[_0xc229('0x12')](function(_0xfa1ba2){logger[_0xc229('0xd')](_0xc229('0x13'),_0xfa1ba2[_0xc229('0x10')],_0x4cae05);_0x393e8c(_0x379e41[_0xc229('0xd')](0x1f4,_0xfa1ba2[_0xc229('0x10')]));});});};exports[_0xc229('0x1c')]=function(_0x3aef16){var _0x4192d0=this;return new Promise(function(_0x25cd16,_0x2e7fe7){return db[_0xc229('0x14')][_0xc229('0x1d')]({'raw':_0x3aef16[_0xc229('0x16')]?_0x3aef16[_0xc229('0x16')][_0xc229('0x1e')]===undefined?!![]:![]:!![],'where':_0x3aef16[_0xc229('0x16')]?_0x3aef16['options'][_0xc229('0x1f')]||null:null,'attributes':_0x3aef16['options']?_0x3aef16[_0xc229('0x16')][_0xc229('0x1b')]||null:null,'include':_0x3aef16['options']?_0x3aef16[_0xc229('0x16')][_0xc229('0x18')]?_[_0xc229('0x19')](_0x3aef16[_0xc229('0x16')][_0xc229('0x18')],function(_0x42b7a3){return{'model':db[_0x42b7a3['model']],'as':_0x42b7a3['as'],'attributes':_0x42b7a3[_0xc229('0x1b')],'include':_0x42b7a3[_0xc229('0x18')]?_[_0xc229('0x19')](_0x42b7a3[_0xc229('0x18')],function(_0x39a7c2){return{'model':db[_0x39a7c2[_0xc229('0x1a')]],'as':_0x39a7c2['as'],'attributes':_0x39a7c2[_0xc229('0x1b')],'include':_0x39a7c2[_0xc229('0x18')]?_[_0xc229('0x19')](_0x39a7c2[_0xc229('0x18')],function(_0x31d5bb){return{'model':db[_0x31d5bb['model']],'as':_0x31d5bb['as'],'attributes':_0x31d5bb[_0xc229('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc229('0x20')](function(_0x251b4b){logger['info'](_0xc229('0x1c'),_0x3aef16);logger[_0xc229('0x9')]('ShowZohoAccount',_0x3aef16,JSON['stringify'](_0x251b4b));_0x25cd16(_0x251b4b);})[_0xc229('0x12')](function(_0x4eafbd){logger['error']('ShowZohoAccount',_0x4eafbd[_0xc229('0x10')],_0x3aef16);_0x2e7fe7(_0x4192d0['error'](0x1f4,_0x4eafbd['message']));});});};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js
index 326f0a0..ebf06cf 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 _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
+var _0x2a41=['getDescriptions','post','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x4ffbef,_0x2c7f88){var _0xc25296=function(_0x516f3b){while(--_0x516f3b){_0x4ffbef['push'](_0x4ffbef['shift']());}};_0xc25296(++_0x2c7f88);}(_0x2a41,0x126));var _0x12a4=function(_0x3c8168,_0x461028){_0x3c8168=_0x3c8168-0x0;var _0x20d28a=_0x2a41[_0x3c8168];return _0x20d28a;};'use strict';var multer=require(_0x12a4('0x0'));var util=require('util');var path=require(_0x12a4('0x1'));var timeout=require(_0x12a4('0x2'));var express=require(_0x12a4('0x3'));var router=express[_0x12a4('0x4')]();var auth=require(_0x12a4('0x5'));var interaction=require(_0x12a4('0x6'));var config=require(_0x12a4('0x7'));var controller=require(_0x12a4('0x8'));router[_0x12a4('0x9')]('/',auth['isAuthenticated'](),controller[_0x12a4('0xa')]);router[_0x12a4('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x12a4('0xb')]);router['get'](_0x12a4('0xc'),auth[_0x12a4('0xd')](),controller[_0x12a4('0xe')]);router[_0x12a4('0x9')](_0x12a4('0xf'),auth['isAuthenticated'](),controller[_0x12a4('0x10')]);router[_0x12a4('0x9')](_0x12a4('0x11'),auth[_0x12a4('0xd')](),controller[_0x12a4('0x12')]);router[_0x12a4('0x13')]('/',auth[_0x12a4('0xd')](),controller[_0x12a4('0x14')]);router[_0x12a4('0x15')](_0x12a4('0x16'),auth[_0x12a4('0xd')](),controller[_0x12a4('0x17')]);router['delete'](_0x12a4('0x16'),auth[_0x12a4('0xd')](),controller[_0x12a4('0x18')]);module[_0x12a4('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
index 896ea57..5d35f74 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 _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
+var _0x02e8=['contact_lead','sequelize','exports','STRING','ENUM','lead','contact'];(function(_0x2f8306,_0x34c68a){var _0x2f7248=function(_0x7828e9){while(--_0x7828e9){_0x2f8306['push'](_0x2f8306['shift']());}};_0x2f7248(++_0x34c68a);}(_0x02e8,0x1c1));var _0x802e=function(_0x38cf3d,_0x2b8f37){_0x38cf3d=_0x38cf3d-0x0;var _0x4b97f0=_0x02e8[_0x38cf3d];return _0x4b97f0;};'use strict';var Sequelize=require(_0x802e('0x0'));module[_0x802e('0x1')]={'name':{'type':Sequelize[_0x802e('0x2')]},'moduleCreate':{'type':Sequelize[_0x802e('0x3')](_0x802e('0x4'),_0x802e('0x5'),'nothing'),'defaultValue':_0x802e('0x4')},'moduleSearch':{'type':Sequelize[_0x802e('0x3')]('contact_lead',_0x802e('0x5'),_0x802e('0x4')),'defaultValue':_0x802e('0x6')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js
index c63feb6..edf1056 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 _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
+var _0xc023=['send','rawAttributes','fieldName','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','ZohoConfiguration','includeAll','include','show','find','create','body','params','ZohoField','filter','getFields','getSubjects','findOne','getDescriptions','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','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~!@#$%^&-_=+[{]}.','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','destroy','end','stack','name'];(function(_0xa261f5,_0x37ed4e){var _0x4a889b=function(_0x2e1c9f){while(--_0x2e1c9f){_0xa261f5['push'](_0xa261f5['shift']());}};_0x4a889b(++_0x37ed4e);}(_0xc023,0x18b));var _0x3c02=function(_0x1f15cb,_0x16f055){_0x1f15cb=_0x1f15cb-0x0;var _0x171557=_0xc023[_0x1f15cb];return _0x171557;};'use strict';var pdf=require(_0x3c02('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3c02('0x1'));var jsonpatch=require(_0x3c02('0x2'));var rp=require(_0x3c02('0x3'));var moment=require(_0x3c02('0x4'));var BPromise=require(_0x3c02('0x5'));var Mustache=require(_0x3c02('0x6'));var util=require(_0x3c02('0x7'));var path=require(_0x3c02('0x8'));var sox=require(_0x3c02('0x9'));var csv=require(_0x3c02('0xa'));var ejs=require(_0x3c02('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3c02('0xc'));var crypto=require(_0x3c02('0xd'));var jsforce=require(_0x3c02('0xe'));var deskjs=require(_0x3c02('0xf'));var toCsv=require(_0x3c02('0xa'));var querystring=require(_0x3c02('0x10'));var Papa=require(_0x3c02('0x11'));var Redis=require(_0x3c02('0x12'));var authService=require(_0x3c02('0x13'));var qs=require(_0x3c02('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c02('0x15'));var logger=require('../../config/logger')(_0x3c02('0x16'));var utils=require(_0x3c02('0x17'));var config=require(_0x3c02('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x3c02('0x19'));var client=jayson['client'][_0x3c02('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3252ef,_0x3501fb,_0x7ad08){if(_0x7ad08){var _0xbe5471=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xbe5471['test'](_0x3501fb)){return _0x3252ef;}else{throw new db['Sequelize'][(_0x3c02('0x1b'))](_0x3c02('0x1c'));}}else{return _0x3252ef;}}function respondWithRpcPromise(_0x2453e6,_0x1a9cb6,_0x4913e5,_0x327adb){return new BPromise(function(_0x5828b3,_0x29c813){var _0x13ad1a=_0x327adb||client;return _0x13ad1a['request'](_0x2453e6,_0x4913e5)[_0x3c02('0x1d')](function(_0x403f74){logger[_0x3c02('0x1e')](_0x3c02('0x1f'),_0x1a9cb6,_0x3c02('0x20'));logger[_0x3c02('0x21')](_0x3c02('0x22'),_0x1a9cb6,_0x3c02('0x20'),JSON['stringify'](_0x403f74));if(_0x403f74[_0x3c02('0x23')]){if(_0x403f74['error'][_0x3c02('0x24')]===0x1f4){logger[_0x3c02('0x23')](_0x3c02('0x1f'),_0x1a9cb6,_0x403f74[_0x3c02('0x23')][_0x3c02('0x25')]);return _0x29c813(_0x403f74[_0x3c02('0x23')][_0x3c02('0x25')]);}logger[_0x3c02('0x23')](_0x3c02('0x1f'),_0x1a9cb6,_0x403f74[_0x3c02('0x23')][_0x3c02('0x25')]);return _0x5828b3(_0x403f74[_0x3c02('0x23')][_0x3c02('0x25')]);}else{logger[_0x3c02('0x1e')]('ZohoConfiguration,\x20%s,\x20%s',_0x1a9cb6,_0x3c02('0x20'));_0x5828b3(_0x403f74[_0x3c02('0x26')][_0x3c02('0x25')]);}})[_0x3c02('0x27')](function(_0x2671ca){logger[_0x3c02('0x23')]('ZohoConfiguration,\x20%s,\x20%s',_0x1a9cb6,_0x2671ca);_0x29c813(_0x2671ca);});});}function respondWithStatusCode(_0xcbc994,_0x4022ed){_0x4022ed=_0x4022ed||0xcc;return function(_0x486eb5){if(_0x486eb5){return _0xcbc994[_0x3c02('0x28')](_0x4022ed);}return _0xcbc994[_0x3c02('0x29')](_0x4022ed)['end']();};}function respondWithResult(_0x3fc776,_0x1ab82b){_0x1ab82b=_0x1ab82b||0xc8;return function(_0x5025f5){if(_0x5025f5){return _0x3fc776['status'](_0x1ab82b)[_0x3c02('0x2a')](_0x5025f5);}};}function respondWithFilteredResult(_0x9efa74,_0x328fd7){return function(_0x1b5960){if(_0x1b5960){var _0x416909=_0x1b5960[_0x3c02('0x2b')],_0x48b956=_0x328fd7[_0x3c02('0x2c')],_0x3b8b48=_0x328fd7[_0x3c02('0x2c')]+_0x328fd7[_0x3c02('0x2d')],_0x49c828;if(_0x3b8b48>=_0x416909){_0x3b8b48=_0x416909;_0x49c828=0xc8;}else{_0x49c828=0xce;}_0x9efa74[_0x3c02('0x29')](_0x49c828);return _0x9efa74[_0x3c02('0x2e')]('Content-Range',_0x48b956+'-'+_0x3b8b48+'/'+_0x416909)['json'](_0x1b5960);}return null;};}function patchUpdates(_0xb56146){return function(_0xa3ff17){try{jsonpatch[_0x3c02('0x2f')](_0xa3ff17,_0xb56146,!![]);}catch(_0x29dd7a){return BPromise[_0x3c02('0x30')](_0x29dd7a);}return _0xa3ff17[_0x3c02('0x31')]();};}function saveUpdates(_0x487193,_0x514035){return function(_0x151fb2){if(_0x151fb2){return _0x151fb2[_0x3c02('0x32')](_0x487193)[_0x3c02('0x1d')](function(_0x574834){return _0x574834;});}return null;};}function removeEntity(_0x5381dc,_0x4f3e79){return function(_0x23619f){if(_0x23619f){return _0x23619f[_0x3c02('0x33')]()['then'](function(){_0x5381dc['status'](0xcc)[_0x3c02('0x34')]();});}};}function handleEntityNotFound(_0x2d660d,_0x25a27f){return function(_0x312855){if(!_0x312855){_0x2d660d[_0x3c02('0x28')](0x194);}return _0x312855;};}function handleError(_0x137468,_0x5c6367){_0x5c6367=_0x5c6367||0x1f4;return function(_0x5ea5a3){logger[_0x3c02('0x23')](_0x5ea5a3[_0x3c02('0x35')]);if(_0x5ea5a3[_0x3c02('0x36')]){delete _0x5ea5a3[_0x3c02('0x36')];}_0x137468[_0x3c02('0x29')](_0x5c6367)[_0x3c02('0x37')](_0x5ea5a3);};}exports['index']=function(_0x3b0a8d,_0x54b7d0){var _0x20c635={},_0x1e76de={},_0x5e5f3b={'count':0x0,'rows':[]};var _0x581d68=_['map'](db['ZohoConfiguration'][_0x3c02('0x38')],function(_0x53ca3c){return{'name':_0x53ca3c[_0x3c02('0x39')],'type':_0x53ca3c['type']['key']};});_0x1e76de[_0x3c02('0x3a')]=_[_0x3c02('0x3b')](_0x581d68,_0x3c02('0x36'));_0x1e76de[_0x3c02('0x3c')]=_[_0x3c02('0x3d')](_0x3b0a8d['query']);_0x1e76de[_0x3c02('0x3e')]=_[_0x3c02('0x3f')](_0x1e76de['model'],_0x1e76de[_0x3c02('0x3c')]);_0x20c635['attributes']=_[_0x3c02('0x3f')](_0x1e76de[_0x3c02('0x3a')],qs[_0x3c02('0x40')](_0x3b0a8d['query']['fields']));_0x20c635[_0x3c02('0x41')]=_0x20c635[_0x3c02('0x41')][_0x3c02('0x42')]?_0x20c635[_0x3c02('0x41')]:_0x1e76de[_0x3c02('0x3a')];if(!_0x3b0a8d['query'][_0x3c02('0x43')](_0x3c02('0x44'))){_0x20c635[_0x3c02('0x2d')]=qs['limit'](_0x3b0a8d[_0x3c02('0x3c')][_0x3c02('0x2d')]);_0x20c635[_0x3c02('0x2c')]=qs['offset'](_0x3b0a8d[_0x3c02('0x3c')][_0x3c02('0x2c')]);}_0x20c635[_0x3c02('0x45')]=qs[_0x3c02('0x46')](_0x3b0a8d[_0x3c02('0x3c')][_0x3c02('0x46')]);_0x20c635[_0x3c02('0x47')]=qs['filters'](_[_0x3c02('0x48')](_0x3b0a8d['query'],_0x1e76de['filters']),_0x581d68);if(_0x3b0a8d[_0x3c02('0x3c')]['filter']){_0x20c635[_0x3c02('0x47')]=_['merge'](_0x20c635[_0x3c02('0x47')],{'$or':_[_0x3c02('0x3b')](_0x581d68,function(_0x509634){if(_0x509634['type']!==_0x3c02('0x49')){var _0x5ddee7={};_0x5ddee7[_0x509634[_0x3c02('0x36')]]={'$like':'%'+_0x3b0a8d[_0x3c02('0x3c')]['filter']+'%'};return _0x5ddee7;}})});}_0x20c635=_[_0x3c02('0x4a')]({},_0x20c635,_0x3b0a8d[_0x3c02('0x4b')]);var _0x1c8a7a={'where':_0x20c635[_0x3c02('0x47')]};return db[_0x3c02('0x4c')][_0x3c02('0x2b')](_0x1c8a7a)[_0x3c02('0x1d')](function(_0xd1d590){_0x5e5f3b['count']=_0xd1d590;if(_0x3b0a8d[_0x3c02('0x3c')][_0x3c02('0x4d')]){_0x20c635[_0x3c02('0x4e')]=[{'all':!![]}];}return db[_0x3c02('0x4c')]['findAll'](_0x20c635);})[_0x3c02('0x1d')](function(_0x1bce47){_0x5e5f3b['rows']=_0x1bce47;return _0x5e5f3b;})['then'](respondWithFilteredResult(_0x54b7d0,_0x20c635))[_0x3c02('0x27')](handleError(_0x54b7d0,null));};exports[_0x3c02('0x4f')]=function(_0x337388,_0x1310bf){var _0x1de4cc={'raw':![],'where':{'id':_0x337388['params']['id']}},_0x554750={};_0x554750[_0x3c02('0x3a')]=_[_0x3c02('0x3d')](db[_0x3c02('0x4c')][_0x3c02('0x38')]);_0x554750[_0x3c02('0x3c')]=_[_0x3c02('0x3d')](_0x337388[_0x3c02('0x3c')]);_0x554750[_0x3c02('0x3e')]=_['intersection'](_0x554750[_0x3c02('0x3a')],_0x554750[_0x3c02('0x3c')]);_0x1de4cc[_0x3c02('0x41')]=_['intersection'](_0x554750[_0x3c02('0x3a')],qs[_0x3c02('0x40')](_0x337388[_0x3c02('0x3c')]['fields']));_0x1de4cc['attributes']=_0x1de4cc[_0x3c02('0x41')][_0x3c02('0x42')]?_0x1de4cc[_0x3c02('0x41')]:_0x554750[_0x3c02('0x3a')];if(_0x337388[_0x3c02('0x3c')]['includeAll']){_0x1de4cc[_0x3c02('0x4e')]=[{'all':!![]}];}_0x1de4cc=_[_0x3c02('0x4a')]({},_0x1de4cc,_0x337388[_0x3c02('0x4b')]);return db[_0x3c02('0x4c')][_0x3c02('0x50')](_0x1de4cc)[_0x3c02('0x1d')](handleEntityNotFound(_0x1310bf,null))[_0x3c02('0x1d')](respondWithResult(_0x1310bf,null))[_0x3c02('0x27')](handleError(_0x1310bf,null));};exports[_0x3c02('0x51')]=function(_0x2fb8e7,_0x5fcefe){return db[_0x3c02('0x4c')][_0x3c02('0x51')](_0x2fb8e7[_0x3c02('0x52')],{})[_0x3c02('0x1d')](respondWithResult(_0x5fcefe,0xc9))[_0x3c02('0x27')](handleError(_0x5fcefe,null));};exports['update']=function(_0x210135,_0x3d128d){if(_0x210135['body']['id']){delete _0x210135[_0x3c02('0x52')]['id'];}return db[_0x3c02('0x4c')][_0x3c02('0x50')]({'where':{'id':_0x210135['params']['id']}})[_0x3c02('0x1d')](handleEntityNotFound(_0x3d128d,null))[_0x3c02('0x1d')](saveUpdates(_0x210135[_0x3c02('0x52')],null))[_0x3c02('0x1d')](respondWithResult(_0x3d128d,null))[_0x3c02('0x27')](handleError(_0x3d128d,null));};exports['destroy']=function(_0x11bee9,_0x53a1ee){return db[_0x3c02('0x4c')][_0x3c02('0x50')]({'where':{'id':_0x11bee9[_0x3c02('0x53')]['id']}})[_0x3c02('0x1d')](handleEntityNotFound(_0x53a1ee,null))[_0x3c02('0x1d')](removeEntity(_0x53a1ee,null))[_0x3c02('0x27')](handleError(_0x53a1ee,null));};exports['getFields']=function(_0x473153,_0x246006,_0x26bb89){var _0x4d93b3={};var _0x21f202={};var _0x3e5f86;var _0x14b48;return db[_0x3c02('0x4c')]['findOne']({'where':{'id':_0x473153[_0x3c02('0x53')]['id']}})[_0x3c02('0x1d')](handleEntityNotFound(_0x246006,null))[_0x3c02('0x1d')](function(_0x18e447){if(_0x18e447){_0x3e5f86=_0x18e447;_0x21f202[_0x3c02('0x3a')]=_[_0x3c02('0x3d')](db[_0x3c02('0x54')][_0x3c02('0x38')]);_0x21f202[_0x3c02('0x3c')]=_[_0x3c02('0x3d')](_0x473153[_0x3c02('0x3c')]);_0x21f202['filters']=_[_0x3c02('0x3f')](_0x21f202['model'],_0x21f202[_0x3c02('0x3c')]);_0x4d93b3[_0x3c02('0x41')]=_[_0x3c02('0x3f')](_0x21f202[_0x3c02('0x3a')],qs[_0x3c02('0x40')](_0x473153['query'][_0x3c02('0x40')]));_0x4d93b3[_0x3c02('0x41')]=_0x4d93b3['attributes']['length']?_0x4d93b3[_0x3c02('0x41')]:_0x21f202[_0x3c02('0x3a')];_0x4d93b3[_0x3c02('0x45')]=qs[_0x3c02('0x46')](_0x473153[_0x3c02('0x3c')][_0x3c02('0x46')]);_0x4d93b3[_0x3c02('0x47')]=qs[_0x3c02('0x3e')](_[_0x3c02('0x48')](_0x473153['query'],_0x21f202[_0x3c02('0x3e')]));if(_0x473153[_0x3c02('0x3c')][_0x3c02('0x55')]){_0x4d93b3[_0x3c02('0x47')]=_[_0x3c02('0x4a')](_0x4d93b3[_0x3c02('0x47')],{'$or':_[_0x3c02('0x3b')](_0x4d93b3[_0x3c02('0x41')],function(_0x1dbec4){var _0x48245e={};_0x48245e[_0x1dbec4]={'$like':'%'+_0x473153[_0x3c02('0x3c')]['filter']+'%'};return _0x48245e;})});}_0x4d93b3=_[_0x3c02('0x4a')]({},_0x4d93b3,_0x473153[_0x3c02('0x4b')]);return _0x3e5f86['getFields'](_0x4d93b3);}})[_0x3c02('0x1d')](function(_0x5c23bb){if(_0x5c23bb){_0x14b48=_0x5c23bb['length'];if(!_0x473153['query'][_0x3c02('0x43')]('nolimit')){_0x4d93b3[_0x3c02('0x2d')]=qs['limit'](_0x473153['query'][_0x3c02('0x2d')]);_0x4d93b3['offset']=qs['offset'](_0x473153['query'][_0x3c02('0x2c')]);}return _0x3e5f86[_0x3c02('0x56')](_0x4d93b3);}})[_0x3c02('0x1d')](function(_0x4a9525){if(_0x4a9525){return _0x4a9525?{'count':_0x14b48,'rows':_0x4a9525}:null;}})[_0x3c02('0x1d')](respondWithResult(_0x246006,null))['catch'](handleError(_0x246006,null));};exports[_0x3c02('0x57')]=function(_0xb73876,_0x14a97d,_0x2c927f){var _0x336e15={};var _0x126441={};var _0x3de802;var _0x302c94;return db['ZohoConfiguration'][_0x3c02('0x58')]({'where':{'id':_0xb73876[_0x3c02('0x53')]['id']}})[_0x3c02('0x1d')](handleEntityNotFound(_0x14a97d,null))[_0x3c02('0x1d')](function(_0x1a53c5){if(_0x1a53c5){_0x3de802=_0x1a53c5;_0x126441['model']=_['keys'](db['ZohoField']['rawAttributes']);_0x126441[_0x3c02('0x3c')]=_[_0x3c02('0x3d')](_0xb73876[_0x3c02('0x3c')]);_0x126441[_0x3c02('0x3e')]=_[_0x3c02('0x3f')](_0x126441[_0x3c02('0x3a')],_0x126441[_0x3c02('0x3c')]);_0x336e15[_0x3c02('0x41')]=_[_0x3c02('0x3f')](_0x126441['model'],qs['fields'](_0xb73876[_0x3c02('0x3c')][_0x3c02('0x40')]));_0x336e15[_0x3c02('0x41')]=_0x336e15[_0x3c02('0x41')][_0x3c02('0x42')]?_0x336e15[_0x3c02('0x41')]:_0x126441[_0x3c02('0x3a')];_0x336e15['order']=qs['sort'](_0xb73876[_0x3c02('0x3c')][_0x3c02('0x46')]);_0x336e15[_0x3c02('0x47')]=qs['filters'](_[_0x3c02('0x48')](_0xb73876[_0x3c02('0x3c')],_0x126441[_0x3c02('0x3e')]));if(_0xb73876[_0x3c02('0x3c')]['filter']){_0x336e15[_0x3c02('0x47')]=_[_0x3c02('0x4a')](_0x336e15[_0x3c02('0x47')],{'$or':_[_0x3c02('0x3b')](_0x336e15[_0x3c02('0x41')],function(_0x1df34e){var _0x1fa2d2={};_0x1fa2d2[_0x1df34e]={'$like':'%'+_0xb73876[_0x3c02('0x3c')][_0x3c02('0x55')]+'%'};return _0x1fa2d2;})});}_0x336e15=_[_0x3c02('0x4a')]({},_0x336e15,_0xb73876[_0x3c02('0x4b')]);return _0x3de802['getSubjects'](_0x336e15);}})['then'](function(_0x2c3171){if(_0x2c3171){_0x302c94=_0x2c3171[_0x3c02('0x42')];if(!_0xb73876[_0x3c02('0x3c')][_0x3c02('0x43')](_0x3c02('0x44'))){_0x336e15[_0x3c02('0x2d')]=qs[_0x3c02('0x2d')](_0xb73876['query'][_0x3c02('0x2d')]);_0x336e15[_0x3c02('0x2c')]=qs[_0x3c02('0x2c')](_0xb73876[_0x3c02('0x3c')]['offset']);}return _0x3de802['getSubjects'](_0x336e15);}})[_0x3c02('0x1d')](function(_0x136b05){if(_0x136b05){return _0x136b05?{'count':_0x302c94,'rows':_0x136b05}:null;}})[_0x3c02('0x1d')](respondWithResult(_0x14a97d,null))[_0x3c02('0x27')](handleError(_0x14a97d,null));};exports[_0x3c02('0x59')]=function(_0x3422b0,_0x5c7cab,_0x5abcfa){var _0x47fcfa={};var _0xc1bfe8={};var _0x366dfd;var _0x57be7e;return db[_0x3c02('0x4c')][_0x3c02('0x58')]({'where':{'id':_0x3422b0[_0x3c02('0x53')]['id']}})['then'](handleEntityNotFound(_0x5c7cab,null))[_0x3c02('0x1d')](function(_0x40875f){if(_0x40875f){_0x366dfd=_0x40875f;_0xc1bfe8[_0x3c02('0x3a')]=_[_0x3c02('0x3d')](db[_0x3c02('0x54')][_0x3c02('0x38')]);_0xc1bfe8[_0x3c02('0x3c')]=_[_0x3c02('0x3d')](_0x3422b0[_0x3c02('0x3c')]);_0xc1bfe8[_0x3c02('0x3e')]=_[_0x3c02('0x3f')](_0xc1bfe8[_0x3c02('0x3a')],_0xc1bfe8['query']);_0x47fcfa['attributes']=_[_0x3c02('0x3f')](_0xc1bfe8['model'],qs[_0x3c02('0x40')](_0x3422b0[_0x3c02('0x3c')]['fields']));_0x47fcfa[_0x3c02('0x41')]=_0x47fcfa[_0x3c02('0x41')][_0x3c02('0x42')]?_0x47fcfa[_0x3c02('0x41')]:_0xc1bfe8[_0x3c02('0x3a')];_0x47fcfa['order']=qs[_0x3c02('0x46')](_0x3422b0[_0x3c02('0x3c')]['sort']);_0x47fcfa[_0x3c02('0x47')]=qs['filters'](_[_0x3c02('0x48')](_0x3422b0[_0x3c02('0x3c')],_0xc1bfe8[_0x3c02('0x3e')]));if(_0x3422b0[_0x3c02('0x3c')][_0x3c02('0x55')]){_0x47fcfa[_0x3c02('0x47')]=_[_0x3c02('0x4a')](_0x47fcfa[_0x3c02('0x47')],{'$or':_[_0x3c02('0x3b')](_0x47fcfa[_0x3c02('0x41')],function(_0x3405c8){var _0x27f88f={};_0x27f88f[_0x3405c8]={'$like':'%'+_0x3422b0[_0x3c02('0x3c')][_0x3c02('0x55')]+'%'};return _0x27f88f;})});}_0x47fcfa=_[_0x3c02('0x4a')]({},_0x47fcfa,_0x3422b0[_0x3c02('0x4b')]);return _0x366dfd[_0x3c02('0x59')](_0x47fcfa);}})[_0x3c02('0x1d')](function(_0x21a41b){if(_0x21a41b){_0x57be7e=_0x21a41b[_0x3c02('0x42')];if(!_0x3422b0[_0x3c02('0x3c')][_0x3c02('0x43')](_0x3c02('0x44'))){_0x47fcfa[_0x3c02('0x2d')]=qs[_0x3c02('0x2d')](_0x3422b0[_0x3c02('0x3c')][_0x3c02('0x2d')]);_0x47fcfa[_0x3c02('0x2c')]=qs[_0x3c02('0x2c')](_0x3422b0[_0x3c02('0x3c')]['offset']);}return _0x366dfd[_0x3c02('0x59')](_0x47fcfa);}})[_0x3c02('0x1d')](function(_0x4b0ce0){if(_0x4b0ce0){return _0x4b0ce0?{'count':_0x57be7e,'rows':_0x4b0ce0}:null;}})[_0x3c02('0x1d')](respondWithResult(_0x5c7cab,null))[_0x3c02('0x27')](handleError(_0x5c7cab,null));};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js
index 375ddef..aa50e57 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 _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
+var _0x46b2=['./intZohoConfiguration.attributes','exports','define','int_zoho_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2d2b31,_0x458476){var _0x455e23=function(_0x2169ea){while(--_0x2169ea){_0x2d2b31['push'](_0x2d2b31['shift']());}};_0x455e23(++_0x458476);}(_0x46b2,0xf4));var _0x246b=function(_0x222731,_0x396036){_0x222731=_0x222731-0x0;var _0x32606f=_0x46b2[_0x222731];return _0x32606f;};'use strict';var _=require(_0x246b('0x0'));var util=require(_0x246b('0x1'));var logger=require(_0x246b('0x2'))(_0x246b('0x3'));var moment=require('moment');var BPromise=require(_0x246b('0x4'));var rp=require(_0x246b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x246b('0x6'));var config=require(_0x246b('0x7'));var attributes=require(_0x246b('0x8'));module[_0x246b('0x9')]=function(_0x34bb64,_0x33485a){return _0x34bb64[_0x246b('0xa')]('ZohoConfiguration',attributes,{'tableName':_0x246b('0xb'),'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 96accc0..56c0066 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 _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
+var _0x7fc7=['http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xcc47fd,_0x3f5165){var _0x5e952d=function(_0x3826bc){while(--_0x3826bc){_0xcc47fd['push'](_0xcc47fd['shift']());}};_0x5e952d(++_0x3f5165);}(_0x7fc7,0x198));var _0x77fc=function(_0x7a9ba7,_0x206167){_0x7a9ba7=_0x7a9ba7-0x0;var _0x330270=_0x7fc7[_0x7a9ba7];return _0x330270;};'use strict';var _=require(_0x77fc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x77fc('0x1'));var rs=require(_0x77fc('0x2'));var fs=require('fs');var Redis=require(_0x77fc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x77fc('0x4'));var logger=require(_0x77fc('0x5'))(_0x77fc('0x6'));var config=require(_0x77fc('0x7'));var jayson=require(_0x77fc('0x8'));var client=jayson[_0x77fc('0x9')][_0x77fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x421c00,_0x37f282,_0x11c9ba){return new BPromise(function(_0xfc5b69,_0x2e13b2){return client[_0x77fc('0xb')](_0x421c00,_0x11c9ba)[_0x77fc('0xc')](function(_0x142eb5){logger[_0x77fc('0xd')](_0x77fc('0xe'),_0x37f282,_0x77fc('0xf'));logger['debug'](_0x77fc('0x10'),_0x37f282,_0x77fc('0xf'),JSON['stringify'](_0x142eb5));if(_0x142eb5['error']){if(_0x142eb5[_0x77fc('0x11')][_0x77fc('0x12')]===0x1f4){logger[_0x77fc('0x11')](_0x77fc('0xe'),_0x37f282,_0x142eb5['error']['message']);return _0x2e13b2(_0x142eb5['error'][_0x77fc('0x13')]);}logger[_0x77fc('0x11')](_0x77fc('0xe'),_0x37f282,_0x142eb5['error']['message']);return _0xfc5b69(_0x142eb5[_0x77fc('0x11')][_0x77fc('0x13')]);}else{logger[_0x77fc('0xd')](_0x77fc('0xe'),_0x37f282,_0x77fc('0xf'));_0xfc5b69(_0x142eb5[_0x77fc('0x14')][_0x77fc('0x13')]);}})[_0x77fc('0x15')](function(_0x480147){logger['error'](_0x77fc('0xe'),_0x37f282,_0x480147);_0x2e13b2(_0x480147);});});}
\ No newline at end of file
diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js
index 2722541..7ec0c69 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 _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
+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(_0x3f84eb,_0x2afb16){var _0x44b09b=function(_0x48587a){while(--_0x48587a){_0x3f84eb['push'](_0x3f84eb['shift']());}};_0x44b09b(++_0x2afb16);}(_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 2ee8e7f..a9f6ea0 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 _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
+var _0x7fec=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x3be303,_0x10039a){var _0x128775=function(_0x3828e6){while(--_0x3828e6){_0x3be303['push'](_0x3be303['shift']());}};_0x128775(++_0x10039a);}(_0x7fec,0x6e));var _0xc7fe=function(_0x53c1db,_0x4c8c69){_0x53c1db=_0x53c1db-0x0;var _0x187700=_0x7fec[_0x53c1db];return _0x187700;};'use strict';var Sequelize=require(_0xc7fe('0x0'));module[_0xc7fe('0x1')]={'type':{'type':Sequelize[_0xc7fe('0x2')](_0xc7fe('0x3'),_0xc7fe('0x4'),_0xc7fe('0x5'),_0xc7fe('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc7fe('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc7fe('0x2')](_0xc7fe('0x3'),_0xc7fe('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc7fe('0x7')]},'nameField':{'type':Sequelize[_0xc7fe('0x7')]},'customField':{'type':Sequelize[_0xc7fe('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js
index 294de93..5227c96 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(_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
+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(_0xe64990,_0x1934d7){var _0x5a19bc=function(_0x331904){while(--_0x331904){_0xe64990['push'](_0xe64990['shift']());}};_0x5a19bc(++_0x1934d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 a2479f4..c795e6a 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 _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
+var _0x7c19=['./intZohoField.attributes','define','zoho_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x7c19,0xeb));var _0x97c1=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x7c19[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x97c1('0x0'));var util=require(_0x97c1('0x1'));var logger=require(_0x97c1('0x2'))('api');var moment=require(_0x97c1('0x3'));var BPromise=require(_0x97c1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x97c1('0x5'));var rimraf=require('rimraf');var config=require(_0x97c1('0x6'));var attributes=require(_0x97c1('0x7'));module['exports']=function(_0x2ad7ae,_0x5a57a8){return _0x2ad7ae[_0x97c1('0x8')]('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x97c1('0x9'),'fields':['idField',_0x97c1('0xa')],'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 d6f92bb..14b5d76 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 _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
+var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x331ff2,_0x240018){var _0x5864d7=function(_0x2f4cd8){while(--_0x2f4cd8){_0x331ff2['push'](_0x331ff2['shift']());}};_0x5864d7(++_0x240018);}(_0x55ca,0x126));var _0xa55c=function(_0x5967c0,_0x452377){_0x5967c0=_0x5967c0-0x0;var _0x2ad249=_0x55ca[_0x5967c0];return _0x2ad249;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('ZohoField,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('ZohoField,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}
\ No newline at end of file
diff --git a/server/api/integration/index.js b/server/api/integration/index.js
index 768031c..be8b00b 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 _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
+var _0x5c1c=['connect-timeout','express','../../components/auth/service','../../config/environment','exports','multer','path'];(function(_0x4f6f84,_0x31e197){var _0x20d989=function(_0x34db70){while(--_0x34db70){_0x4f6f84['push'](_0x4f6f84['shift']());}};_0x20d989(++_0x31e197);}(_0x5c1c,0x1e8));var _0xc5c1=function(_0x1ec4a1,_0x32292e){_0x1ec4a1=_0x1ec4a1-0x0;var _0x59e9c4=_0x5c1c[_0x1ec4a1];return _0x59e9c4;};'use strict';var multer=require(_0xc5c1('0x0'));var util=require('util');var path=require(_0xc5c1('0x1'));var timeout=require(_0xc5c1('0x2'));var express=require(_0xc5c1('0x3'));var router=express['Router']();var auth=require(_0xc5c1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc5c1('0x5'));module[_0xc5c1('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js
index b89383f..72355c1 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 _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
+var _0x9cef=['unique_name_and_version','app.js','BOOLEAN','sequelize','exports','STRING'];(function(_0x9ed5c7,_0x236445){var _0x480ca6=function(_0x44a915){while(--_0x44a915){_0x9ed5c7['push'](_0x9ed5c7['shift']());}};_0x480ca6(++_0x236445);}(_0x9cef,0x129));var _0xf9ce=function(_0x15833e,_0x58a046){_0x15833e=_0x15833e-0x0;var _0x5c4745=_0x9cef[_0x15833e];return _0x5c4745;};'use strict';var Sequelize=require(_0xf9ce('0x0'));module[_0xf9ce('0x1')]={'name':{'type':Sequelize[_0xf9ce('0x2')],'allowNull':![],'unique':_0xf9ce('0x3')},'version':{'type':Sequelize[_0xf9ce('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xf9ce('0x2')],'defaultValue':_0xf9ce('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf9ce('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xf9ce('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xf9ce('0x2')]},'logo':{'type':Sequelize[_0xf9ce('0x2')]},'state':{'type':Sequelize[_0xf9ce('0x2')],'unique':'state'},'description':{'type':Sequelize[_0xf9ce('0x2')]},'title':{'type':Sequelize[_0xf9ce('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'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 e25f84c..54d1f33 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 _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
+var _0x7782=['find','create','body','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','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','update','then','destroy','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Integration','count','includeAll','findAll','rows','catch','show','params','include'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x7782,0x123));var _0x2778=function(_0x4d310e,_0xc1e573){_0x4d310e=_0x4d310e-0x0;var _0x45dc79=_0x7782[_0x4d310e];return _0x45dc79;};'use strict';var pdf=require(_0x2778('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2778('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2778('0x2'));var rp=require('request-promise');var moment=require(_0x2778('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2778('0x4'));var util=require(_0x2778('0x5'));var path=require(_0x2778('0x6'));var sox=require(_0x2778('0x7'));var csv=require(_0x2778('0x8'));var ejs=require(_0x2778('0x9'));var fs=require('fs');var _=require(_0x2778('0xa'));var squel=require('squel');var crypto=require(_0x2778('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2778('0xc'));var toCsv=require(_0x2778('0x8'));var querystring=require(_0x2778('0xd'));var Papa=require('papaparse');var Redis=require(_0x2778('0xe'));var authService=require(_0x2778('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2778('0x10'));var hardwareService=require(_0x2778('0x11'));var logger=require('../../config/logger')(_0x2778('0x12'));var utils=require(_0x2778('0x13'));var config=require(_0x2778('0x14'));var db=require(_0x2778('0x15'))['db'];function respondWithStatusCode(_0xc7cef3,_0x45f954){_0x45f954=_0x45f954||0xcc;return function(_0x72aa13){if(_0x72aa13){return _0xc7cef3[_0x2778('0x16')](_0x45f954);}return _0xc7cef3[_0x2778('0x17')](_0x45f954)[_0x2778('0x18')]();};}function respondWithResult(_0x31ee7b,_0x16033d){_0x16033d=_0x16033d||0xc8;return function(_0x10e3d4){if(_0x10e3d4){return _0x31ee7b['status'](_0x16033d)[_0x2778('0x19')](_0x10e3d4);}};}function respondWithFilteredResult(_0x3737d3,_0x50945d){return function(_0x270a37){if(_0x270a37){var _0x4a26a0=_0x270a37['count'],_0x248cb6=_0x50945d[_0x2778('0x1a')],_0x212629=_0x50945d[_0x2778('0x1a')]+_0x50945d[_0x2778('0x1b')],_0x2717a3;if(_0x212629>=_0x4a26a0){_0x212629=_0x4a26a0;_0x2717a3=0xc8;}else{_0x2717a3=0xce;}_0x3737d3[_0x2778('0x17')](_0x2717a3);return _0x3737d3[_0x2778('0x1c')](_0x2778('0x1d'),_0x248cb6+'-'+_0x212629+'/'+_0x4a26a0)[_0x2778('0x19')](_0x270a37);}return null;};}function patchUpdates(_0xca7ff){return function(_0x38c417){try{jsonpatch[_0x2778('0x1e')](_0x38c417,_0xca7ff,!![]);}catch(_0x448aa5){return BPromise[_0x2778('0x1f')](_0x448aa5);}return _0x38c417[_0x2778('0x20')]();};}function saveUpdates(_0x27deb2,_0x1a83d7){return function(_0x429177){if(_0x429177){return _0x429177[_0x2778('0x21')](_0x27deb2)[_0x2778('0x22')](function(_0x21134f){return _0x21134f;});}return null;};}function removeEntity(_0x3cd973,_0x3d67af){return function(_0x3fb3a){if(_0x3fb3a){return _0x3fb3a[_0x2778('0x23')]()[_0x2778('0x22')](function(){_0x3cd973['status'](0xcc)[_0x2778('0x18')]();});}};}function handleEntityNotFound(_0x389c21,_0x262afe){return function(_0x51ccaa){if(!_0x51ccaa){_0x389c21[_0x2778('0x16')](0x194);}return _0x51ccaa;};}function handleError(_0x3a26d6,_0x3da615){_0x3da615=_0x3da615||0x1f4;return function(_0x34af22){logger['error'](_0x34af22[_0x2778('0x24')]);if(_0x34af22[_0x2778('0x25')]){delete _0x34af22['name'];}_0x3a26d6[_0x2778('0x17')](_0x3da615)[_0x2778('0x26')](_0x34af22);};}exports['index']=function(_0x4d59bd,_0x91bd27){var _0x4e52af={},_0x515225={},_0xe5234a={'count':0x0,'rows':[]};var _0x563251=_[_0x2778('0x27')](db['Integration']['rawAttributes'],function(_0x11f89a){return{'name':_0x11f89a[_0x2778('0x28')],'type':_0x11f89a[_0x2778('0x29')][_0x2778('0x2a')]};});_0x515225[_0x2778('0x2b')]=_['map'](_0x563251,_0x2778('0x25'));_0x515225[_0x2778('0x2c')]=_[_0x2778('0x2d')](_0x4d59bd[_0x2778('0x2c')]);_0x515225[_0x2778('0x2e')]=_[_0x2778('0x2f')](_0x515225['model'],_0x515225[_0x2778('0x2c')]);_0x4e52af[_0x2778('0x30')]=_[_0x2778('0x2f')](_0x515225[_0x2778('0x2b')],qs[_0x2778('0x31')](_0x4d59bd[_0x2778('0x2c')][_0x2778('0x31')]));_0x4e52af[_0x2778('0x30')]=_0x4e52af[_0x2778('0x30')][_0x2778('0x32')]?_0x4e52af['attributes']:_0x515225[_0x2778('0x2b')];if(!_0x4d59bd[_0x2778('0x2c')][_0x2778('0x33')]('nolimit')){_0x4e52af[_0x2778('0x1b')]=qs[_0x2778('0x1b')](_0x4d59bd[_0x2778('0x2c')][_0x2778('0x1b')]);_0x4e52af[_0x2778('0x1a')]=qs[_0x2778('0x1a')](_0x4d59bd[_0x2778('0x2c')]['offset']);}_0x4e52af[_0x2778('0x34')]=qs[_0x2778('0x35')](_0x4d59bd['query'][_0x2778('0x35')]);_0x4e52af[_0x2778('0x36')]=qs[_0x2778('0x2e')](_[_0x2778('0x37')](_0x4d59bd[_0x2778('0x2c')],_0x515225[_0x2778('0x2e')]),_0x563251);if(_0x4d59bd['query'][_0x2778('0x38')]){_0x4e52af[_0x2778('0x36')]=_[_0x2778('0x39')](_0x4e52af[_0x2778('0x36')],{'$or':_[_0x2778('0x27')](_0x563251,function(_0x40f2a0){if(_0x40f2a0[_0x2778('0x29')]!==_0x2778('0x3a')){var _0x4ad235={};_0x4ad235[_0x40f2a0[_0x2778('0x25')]]={'$like':'%'+_0x4d59bd[_0x2778('0x2c')]['filter']+'%'};return _0x4ad235;}})});}_0x4e52af=_[_0x2778('0x39')]({},_0x4e52af,_0x4d59bd[_0x2778('0x3b')]);var _0x36760b={'where':_0x4e52af[_0x2778('0x36')]};return db[_0x2778('0x3c')][_0x2778('0x3d')](_0x36760b)[_0x2778('0x22')](function(_0x3c549b){_0xe5234a['count']=_0x3c549b;if(_0x4d59bd['query'][_0x2778('0x3e')]){_0x4e52af['include']=[{'all':!![]}];}return db[_0x2778('0x3c')][_0x2778('0x3f')](_0x4e52af);})[_0x2778('0x22')](function(_0x3e6cc0){_0xe5234a[_0x2778('0x40')]=_0x3e6cc0;return _0xe5234a;})['then'](respondWithFilteredResult(_0x91bd27,_0x4e52af))[_0x2778('0x41')](handleError(_0x91bd27,null));};exports[_0x2778('0x42')]=function(_0x3e96b2,_0x2b20f4){var _0x5db510={'raw':![],'where':{'id':_0x3e96b2[_0x2778('0x43')]['id']}},_0x1f8c72={};_0x1f8c72[_0x2778('0x2b')]=_['keys'](db[_0x2778('0x3c')]['rawAttributes']);_0x1f8c72[_0x2778('0x2c')]=_[_0x2778('0x2d')](_0x3e96b2['query']);_0x1f8c72[_0x2778('0x2e')]=_[_0x2778('0x2f')](_0x1f8c72[_0x2778('0x2b')],_0x1f8c72[_0x2778('0x2c')]);_0x5db510['attributes']=_[_0x2778('0x2f')](_0x1f8c72[_0x2778('0x2b')],qs[_0x2778('0x31')](_0x3e96b2[_0x2778('0x2c')]['fields']));_0x5db510[_0x2778('0x30')]=_0x5db510[_0x2778('0x30')][_0x2778('0x32')]?_0x5db510[_0x2778('0x30')]:_0x1f8c72[_0x2778('0x2b')];if(_0x3e96b2[_0x2778('0x2c')][_0x2778('0x3e')]){_0x5db510[_0x2778('0x44')]=[{'all':!![]}];}_0x5db510=_[_0x2778('0x39')]({},_0x5db510,_0x3e96b2['options']);return db[_0x2778('0x3c')][_0x2778('0x45')](_0x5db510)['then'](handleEntityNotFound(_0x2b20f4,null))['then'](respondWithResult(_0x2b20f4,null))['catch'](handleError(_0x2b20f4,null));};exports[_0x2778('0x46')]=function(_0x448995,_0x3c88c0){return db[_0x2778('0x3c')][_0x2778('0x46')](_0x448995[_0x2778('0x47')],{})['then'](respondWithResult(_0x3c88c0,0xc9))[_0x2778('0x41')](handleError(_0x3c88c0,null));};exports['update']=function(_0x1a044,_0x2a8942){if(_0x1a044['body']['id']){delete _0x1a044[_0x2778('0x47')]['id'];}return db[_0x2778('0x3c')]['find']({'where':{'id':_0x1a044[_0x2778('0x43')]['id']}})[_0x2778('0x22')](handleEntityNotFound(_0x2a8942,null))[_0x2778('0x22')](saveUpdates(_0x1a044[_0x2778('0x47')],null))['then'](respondWithResult(_0x2a8942,null))[_0x2778('0x41')](handleError(_0x2a8942,null));};exports[_0x2778('0x23')]=function(_0xa26431,_0x137701){return db[_0x2778('0x3c')][_0x2778('0x45')]({'where':{'id':_0xa26431['params']['id']}})[_0x2778('0x22')](handleEntityNotFound(_0x137701,null))[_0x2778('0x22')](removeEntity(_0x137701,null))[_0x2778('0x41')](handleError(_0x137701,null));};
\ No newline at end of file
diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js
index 3ab00a0..c99644d 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 _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
+var _0xd6bd=['integrations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./integration.attributes','define'];(function(_0x31bcdf,_0x1fe0b8){var _0x195066=function(_0x5c047b){while(--_0x5c047b){_0x31bcdf['push'](_0x31bcdf['shift']());}};_0x195066(++_0x1fe0b8);}(_0xd6bd,0xf1));var _0xdd6b=function(_0x2e9199,_0x1cedf5){_0x2e9199=_0x2e9199-0x0;var _0x46dc64=_0xd6bd[_0x2e9199];return _0x46dc64;};'use strict';var _=require(_0xdd6b('0x0'));var util=require(_0xdd6b('0x1'));var logger=require(_0xdd6b('0x2'))(_0xdd6b('0x3'));var moment=require(_0xdd6b('0x4'));var BPromise=require('bluebird');var rp=require(_0xdd6b('0x5'));var fs=require('fs');var path=require(_0xdd6b('0x6'));var rimraf=require(_0xdd6b('0x7'));var config=require(_0xdd6b('0x8'));var attributes=require(_0xdd6b('0x9'));module['exports']=function(_0x5da82d,_0x53f33f){return _0x5da82d[_0xdd6b('0xa')]('Integration',attributes,{'tableName':_0xdd6b('0xb'),'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 ecd0569..32e55eb 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 _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
+var _0x7dbc=['debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','Integration,\x20%s,\x20%s','request\x20sent'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0x7dbc,0xe2));var _0xc7db=function(_0x5a0290,_0x27cf74){_0x5a0290=_0x5a0290-0x0;var _0x176674=_0x7dbc[_0x5a0290];return _0x176674;};'use strict';var _=require(_0xc7db('0x0'));var util=require(_0xc7db('0x1'));var moment=require('moment');var BPromise=require(_0xc7db('0x2'));var rs=require(_0xc7db('0x3'));var fs=require('fs');var Redis=require(_0xc7db('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc7db('0x5'));var logger=require(_0xc7db('0x6'))(_0xc7db('0x7'));var config=require(_0xc7db('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc7db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x256ea6,_0x4f8491,_0x51dd2c){return new BPromise(function(_0x9eff32,_0x3429f3){return client['request'](_0x256ea6,_0x51dd2c)[_0xc7db('0xa')](function(_0x3e41ad){logger[_0xc7db('0xb')](_0xc7db('0xc'),_0x4f8491,_0xc7db('0xd'));logger[_0xc7db('0xe')](_0xc7db('0xf'),_0x4f8491,'request\x20sent',JSON[_0xc7db('0x10')](_0x3e41ad));if(_0x3e41ad['error']){if(_0x3e41ad[_0xc7db('0x11')][_0xc7db('0x12')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x4f8491,_0x3e41ad[_0xc7db('0x11')][_0xc7db('0x13')]);return _0x3429f3(_0x3e41ad[_0xc7db('0x11')][_0xc7db('0x13')]);}logger[_0xc7db('0x11')](_0xc7db('0xc'),_0x4f8491,_0x3e41ad['error'][_0xc7db('0x13')]);return _0x9eff32(_0x3e41ad['error'][_0xc7db('0x13')]);}else{logger['info'](_0xc7db('0xc'),_0x4f8491,_0xc7db('0xd'));_0x9eff32(_0x3e41ad['result'][_0xc7db('0x13')]);}})['catch'](function(_0x57e07d){logger[_0xc7db('0x11')](_0xc7db('0xc'),_0x4f8491,_0x57e07d);_0x3429f3(_0x57e07d);});});}
\ No newline at end of file
diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js
index 40d7429..04b11a0 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 _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
+var _0xc916=['express','Router','../../components/auth/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','destroy','exports','path','connect-timeout'];(function(_0x5db2b5,_0x24e4c5){var _0x2fd39f=function(_0x17f679){while(--_0x17f679){_0x5db2b5['push'](_0x5db2b5['shift']());}};_0x2fd39f(++_0x24e4c5);}(_0xc916,0x1d2));var _0x6c91=function(_0x118653,_0x50ef26){_0x118653=_0x118653-0x0;var _0xc11fa6=_0xc916[_0x118653];return _0xc11fa6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6c91('0x0'));var timeout=require(_0x6c91('0x1'));var express=require(_0x6c91('0x2'));var router=express[_0x6c91('0x3')]();var auth=require(_0x6c91('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6c91('0x5'));var controller=require(_0x6c91('0x6'));router[_0x6c91('0x7')]('/',auth[_0x6c91('0x8')](),controller[_0x6c91('0x9')]);router[_0x6c91('0x7')](_0x6c91('0xa'),auth[_0x6c91('0x8')](),controller[_0x6c91('0xb')]);router[_0x6c91('0x7')](_0x6c91('0xc'),auth['isAuthenticated'](),controller[_0x6c91('0xd')]);router['post']('/',auth[_0x6c91('0x8')](),controller[_0x6c91('0xe')]);router[_0x6c91('0xf')]('/:id',auth[_0x6c91('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6c91('0x10')]);module[_0x6c91('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js
index 2f795fb..eeaa717 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 _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
+var _0x88e1=['exports','STRING','INTEGER','DATE','BOOLEAN','RECEIVED','FAILED'];(function(_0x2bbf53,_0x10ba24){var _0x46447a=function(_0x3a644c){while(--_0x3a644c){_0x2bbf53['push'](_0x2bbf53['shift']());}};_0x46447a(++_0x10ba24);}(_0x88e1,0x18f));var _0x188e=function(_0x2f7270,_0x307af1){_0x2f7270=_0x2f7270-0x0;var _0xe1d89a=_0x88e1[_0x2f7270];return _0xe1d89a;};'use strict';var Sequelize=require('sequelize');module[_0x188e('0x0')]={'integration':{'type':Sequelize[_0x188e('0x1')]},'eventChannel':{'type':Sequelize[_0x188e('0x1')]},'exitStatus':{'type':Sequelize[_0x188e('0x1')]},'ticketId':{'type':Sequelize[_0x188e('0x1')]},'integrationId':{'type':Sequelize[_0x188e('0x2')]},'contacts':{'type':Sequelize[_0x188e('0x1')]},'uniqueid':{'type':Sequelize[_0x188e('0x1')]},'calleridnum':{'type':Sequelize[_0x188e('0x1')]},'calleridname':{'type':Sequelize[_0x188e('0x1')]},'queue':{'type':Sequelize[_0x188e('0x1')]},'interface':{'type':Sequelize[_0x188e('0x1')]},'membername':{'type':Sequelize[_0x188e('0x1')]},'agentcalledAt':{'type':Sequelize[_0x188e('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x188e('0x2')]},'agentcomplete':{'type':Sequelize[_0x188e('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x188e('0x2')]},'agentacw':{'type':Sequelize[_0x188e('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x188e('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x188e('0x3')]},'lastevent':{'type':Sequelize[_0x188e('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x188e('0x2')]},'channelstatedesc':{'type':Sequelize[_0x188e('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x188e('0x1')]},'language':{'type':Sequelize[_0x188e('0x1')]},'accountcode':{'type':Sequelize[_0x188e('0x1')]},'context':{'type':Sequelize[_0x188e('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x188e('0x1')]},'destchannel':{'type':Sequelize[_0x188e('0x1')]},'destchannelstate':{'type':Sequelize[_0x188e('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x188e('0x1')]},'destcalleridnum':{'type':Sequelize[_0x188e('0x1')]},'destcalleridname':{'type':Sequelize[_0x188e('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x188e('0x1')]},'destlanguage':{'type':Sequelize[_0x188e('0x1')]},'destaccountcode':{'type':Sequelize[_0x188e('0x1')]},'destcontext':{'type':Sequelize[_0x188e('0x1')]},'destexten':{'type':Sequelize[_0x188e('0x1')]},'destpriority':{'type':Sequelize[_0x188e('0x1')]},'destuniqueid':{'type':Sequelize[_0x188e('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x188e('0x1')]},'subject':{'type':Sequelize[_0x188e('0x1')]},'from':{'type':Sequelize[_0x188e('0x1')]},'to':{'type':Sequelize[_0x188e('0x1')]},'cc':{'type':Sequelize[_0x188e('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM']('SENT','SENDING',_0x188e('0x5'),_0x188e('0x6'))},'url':{'type':Sequelize[_0x188e('0x1')]},'app':{'type':Sequelize[_0x188e('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x188e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js
index 695912e..553740c 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 _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
+var _0x5806=['model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','length','catch','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','set','json','reject','save','update','then','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','query','keys','filters'];(function(_0x371ac2,_0xc5961c){var _0x37d93d=function(_0x26b927){while(--_0x26b927){_0x371ac2['push'](_0x371ac2['shift']());}};_0x37d93d(++_0xc5961c);}(_0x5806,0x187));var _0x6580=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0x5806[_0x2850c0];return _0x21e830;};'use strict';var pdf=require(_0x6580('0x0'));var emlformat=require(_0x6580('0x1'));var rimraf=require(_0x6580('0x2'));var zipdir=require(_0x6580('0x3'));var jsonpatch=require(_0x6580('0x4'));var rp=require('request-promise');var moment=require(_0x6580('0x5'));var BPromise=require(_0x6580('0x6'));var Mustache=require(_0x6580('0x7'));var util=require(_0x6580('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x6580('0x9'));var ejs=require(_0x6580('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6580('0xb'));var crypto=require(_0x6580('0xc'));var jsforce=require(_0x6580('0xd'));var deskjs=require(_0x6580('0xe'));var toCsv=require(_0x6580('0x9'));var querystring=require('querystring');var Papa=require(_0x6580('0xf'));var Redis=require(_0x6580('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6580('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6580('0x12'))(_0x6580('0x13'));var utils=require(_0x6580('0x14'));var config=require(_0x6580('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d07f7,_0xbdc726){_0xbdc726=_0xbdc726||0xcc;return function(_0x35d9ec){if(_0x35d9ec){return _0x4d07f7[_0x6580('0x16')](_0xbdc726);}return _0x4d07f7[_0x6580('0x17')](_0xbdc726)[_0x6580('0x18')]();};}function respondWithResult(_0x4440cb,_0x16a2c5){_0x16a2c5=_0x16a2c5||0xc8;return function(_0x145e86){if(_0x145e86){return _0x4440cb[_0x6580('0x17')](_0x16a2c5)['json'](_0x145e86);}};}function respondWithFilteredResult(_0x491809,_0x521cfd){return function(_0x4e18c5){if(_0x4e18c5){var _0x1def1d=_0x4e18c5['count'],_0xd0a2b7=_0x521cfd[_0x6580('0x19')],_0x5f073b=_0x521cfd[_0x6580('0x19')]+_0x521cfd[_0x6580('0x1a')],_0x394402;if(_0x5f073b>=_0x1def1d){_0x5f073b=_0x1def1d;_0x394402=0xc8;}else{_0x394402=0xce;}_0x491809['status'](_0x394402);return _0x491809[_0x6580('0x1b')]('Content-Range',_0xd0a2b7+'-'+_0x5f073b+'/'+_0x1def1d)[_0x6580('0x1c')](_0x4e18c5);}return null;};}function patchUpdates(_0x41a689){return function(_0x184d61){try{jsonpatch['apply'](_0x184d61,_0x41a689,!![]);}catch(_0xe90498){return BPromise[_0x6580('0x1d')](_0xe90498);}return _0x184d61[_0x6580('0x1e')]();};}function saveUpdates(_0x198012,_0x343ba4){return function(_0x132b72){if(_0x132b72){return _0x132b72[_0x6580('0x1f')](_0x198012)['then'](function(_0x476584){return _0x476584;});}return null;};}function removeEntity(_0x4f0387,_0x260fe8){return function(_0x1bcd5a){if(_0x1bcd5a){return _0x1bcd5a['destroy']()[_0x6580('0x20')](function(){_0x4f0387[_0x6580('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x412845,_0x2f1937){return function(_0x4f00ae){if(!_0x4f00ae){_0x412845[_0x6580('0x16')](0x194);}return _0x4f00ae;};}function handleError(_0x2d6091,_0x11fa33){_0x11fa33=_0x11fa33||0x1f4;return function(_0x56c28d){logger[_0x6580('0x21')](_0x56c28d[_0x6580('0x22')]);if(_0x56c28d[_0x6580('0x23')]){delete _0x56c28d[_0x6580('0x23')];}_0x2d6091[_0x6580('0x17')](_0x11fa33)[_0x6580('0x24')](_0x56c28d);};}exports[_0x6580('0x25')]=function(_0x20fd19,_0x5b3ab2){var _0x481b2c={},_0x2509a6={},_0xdac12e={'count':0x0,'rows':[]};var _0x5aee14=_[_0x6580('0x26')](db[_0x6580('0x27')][_0x6580('0x28')],function(_0x38b08a){return{'name':_0x38b08a[_0x6580('0x29')],'type':_0x38b08a[_0x6580('0x2a')][_0x6580('0x2b')]};});_0x2509a6['model']=_[_0x6580('0x26')](_0x5aee14,_0x6580('0x23'));_0x2509a6[_0x6580('0x2c')]=_[_0x6580('0x2d')](_0x20fd19['query']);_0x2509a6[_0x6580('0x2e')]=_['intersection'](_0x2509a6[_0x6580('0x2f')],_0x2509a6[_0x6580('0x2c')]);_0x481b2c[_0x6580('0x30')]=_[_0x6580('0x31')](_0x2509a6[_0x6580('0x2f')],qs[_0x6580('0x32')](_0x20fd19[_0x6580('0x2c')]['fields']));_0x481b2c[_0x6580('0x30')]=_0x481b2c[_0x6580('0x30')]['length']?_0x481b2c[_0x6580('0x30')]:_0x2509a6[_0x6580('0x2f')];if(!_0x20fd19[_0x6580('0x2c')][_0x6580('0x33')](_0x6580('0x34'))){_0x481b2c[_0x6580('0x1a')]=qs['limit'](_0x20fd19[_0x6580('0x2c')][_0x6580('0x1a')]);_0x481b2c['offset']=qs['offset'](_0x20fd19[_0x6580('0x2c')][_0x6580('0x19')]);}_0x481b2c[_0x6580('0x35')]=qs[_0x6580('0x36')](_0x20fd19['query'][_0x6580('0x36')]);_0x481b2c[_0x6580('0x37')]=qs[_0x6580('0x2e')](_['pick'](_0x20fd19[_0x6580('0x2c')],_0x2509a6['filters']),_0x5aee14);if(_0x20fd19['query'][_0x6580('0x38')]){_0x481b2c[_0x6580('0x37')]=_[_0x6580('0x39')](_0x481b2c['where'],{'$or':_[_0x6580('0x26')](_0x5aee14,function(_0xe207e5){if(_0xe207e5[_0x6580('0x2a')]!==_0x6580('0x3a')){var _0x1373ac={};_0x1373ac[_0xe207e5['name']]={'$like':'%'+_0x20fd19['query'][_0x6580('0x38')]+'%'};return _0x1373ac;}})});}_0x481b2c=_['merge']({},_0x481b2c,_0x20fd19[_0x6580('0x3b')]);var _0x46828d={'where':_0x481b2c['where']};return db[_0x6580('0x27')][_0x6580('0x3c')](_0x46828d)[_0x6580('0x20')](function(_0x4749ec){_0xdac12e[_0x6580('0x3c')]=_0x4749ec;if(_0x20fd19[_0x6580('0x2c')][_0x6580('0x3d')]){_0x481b2c[_0x6580('0x3e')]=[{'all':!![]}];}return db[_0x6580('0x27')][_0x6580('0x3f')](_0x481b2c);})['then'](function(_0x33aa06){_0xdac12e['rows']=_0x33aa06;return _0xdac12e;})[_0x6580('0x20')](respondWithFilteredResult(_0x5b3ab2,_0x481b2c))['catch'](handleError(_0x5b3ab2,null));};exports[_0x6580('0x40')]=function(_0x34a549,_0x241b22){var _0x16a440={'raw':![],'where':{'id':_0x34a549[_0x6580('0x41')]['id']}},_0x5174da={};_0x5174da[_0x6580('0x2f')]=_['keys'](db[_0x6580('0x27')][_0x6580('0x28')]);_0x5174da[_0x6580('0x2c')]=_['keys'](_0x34a549[_0x6580('0x2c')]);_0x5174da[_0x6580('0x2e')]=_[_0x6580('0x31')](_0x5174da[_0x6580('0x2f')],_0x5174da[_0x6580('0x2c')]);_0x16a440[_0x6580('0x30')]=_[_0x6580('0x31')](_0x5174da['model'],qs[_0x6580('0x32')](_0x34a549['query'][_0x6580('0x32')]));_0x16a440[_0x6580('0x30')]=_0x16a440[_0x6580('0x30')][_0x6580('0x42')]?_0x16a440[_0x6580('0x30')]:_0x5174da[_0x6580('0x2f')];if(_0x34a549['query'][_0x6580('0x3d')]){_0x16a440['include']=[{'all':!![]}];}_0x16a440=_[_0x6580('0x39')]({},_0x16a440,_0x34a549[_0x6580('0x3b')]);return db[_0x6580('0x27')]['find'](_0x16a440)[_0x6580('0x20')](handleEntityNotFound(_0x241b22,null))[_0x6580('0x20')](respondWithResult(_0x241b22,null))[_0x6580('0x43')](handleError(_0x241b22,null));};exports[_0x6580('0x44')]=function(_0x25df06,_0x2950c3){return db[_0x6580('0x27')][_0x6580('0x44')](_0x25df06[_0x6580('0x45')],{})['then'](respondWithResult(_0x2950c3,0xc9))[_0x6580('0x43')](handleError(_0x2950c3,null));};exports[_0x6580('0x1f')]=function(_0x1aef4f,_0xff0654){if(_0x1aef4f[_0x6580('0x45')]['id']){delete _0x1aef4f[_0x6580('0x45')]['id'];}return db[_0x6580('0x27')][_0x6580('0x46')]({'where':{'id':_0x1aef4f[_0x6580('0x41')]['id']}})[_0x6580('0x20')](handleEntityNotFound(_0xff0654,null))[_0x6580('0x20')](saveUpdates(_0x1aef4f[_0x6580('0x45')],null))[_0x6580('0x20')](respondWithResult(_0xff0654,null))[_0x6580('0x43')](handleError(_0xff0654,null));};exports[_0x6580('0x47')]=function(_0x47d103,_0x49065e){return db[_0x6580('0x27')]['find']({'where':{'id':_0x47d103[_0x6580('0x41')]['id']}})['then'](handleEntityNotFound(_0x49065e,null))[_0x6580('0x20')](removeEntity(_0x49065e,null))['catch'](handleError(_0x49065e,null));};exports[_0x6580('0x48')]=function(_0x1aa473,_0x95c379){return db[_0x6580('0x27')][_0x6580('0x48')]()[_0x6580('0x20')](respondWithResult(_0x95c379,null))[_0x6580('0x43')](handleError(_0x95c379,null));};
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js
index 0986ce5..0a1f0ec 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 _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
+var _0x7a72=['./integrationReport.attributes','exports','define','report_integration','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a72,0x13a));var _0x27a7=function(_0xedbb63,_0x4419bc){_0xedbb63=_0xedbb63-0x0;var _0x10fed5=_0x7a72[_0xedbb63];return _0x10fed5;};'use strict';var _=require('lodash');var util=require(_0x27a7('0x0'));var logger=require('../../config/logger')(_0x27a7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x27a7('0x2'));var fs=require('fs');var path=require(_0x27a7('0x3'));var rimraf=require(_0x27a7('0x4'));var config=require(_0x27a7('0x5'));var attributes=require(_0x27a7('0x6'));module[_0x27a7('0x7')]=function(_0x5a2ab0,_0x3cfd01){return _0x5a2ab0[_0x27a7('0x8')]('IntegrationReport',attributes,{'tableName':_0x27a7('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 dd50581..cdb98d8 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 _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
+var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x22bfa5,_0x38cb2e){var _0x5b49b5=function(_0x31892e){while(--_0x31892e){_0x22bfa5['push'](_0x22bfa5['shift']());}};_0x5b49b5(++_0x38cb2e);}(_0xb10b,0x12a));var _0xbb10=function(_0x349ac1,_0x443243){_0x349ac1=_0x349ac1-0x0;var _0x77840a=_0xb10b[_0x349ac1];return _0x77840a;};'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
diff --git a/server/api/interval/index.js b/server/api/interval/index.js
index 8a5f465..084cda0 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 _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
+var _0x9c44=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','addInterval','addIntervals','put','update','destroy','exports','path','connect-timeout','express','Router'];(function(_0xbc928d,_0x25ede0){var _0xe86803=function(_0x3ec45){while(--_0x3ec45){_0xbc928d['push'](_0xbc928d['shift']());}};_0xe86803(++_0x25ede0);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x49c4('0xd')](_0x49c4('0xb'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);router[_0x49c4('0xd')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0x11')]);router['delete'](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x12')]);module[_0x49c4('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js
index 57ad676..0156951 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 _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
+var _0x35a5=['sequelize','exports','STRING'];(function(_0x59fdd0,_0x2fcb06){var _0x1f7490=function(_0x52b035){while(--_0x52b035){_0x59fdd0['push'](_0x59fdd0['shift']());}};_0x1f7490(++_0x2fcb06);}(_0x35a5,0x1c2));var _0x535a=function(_0x20c983,_0x5230f2){_0x20c983=_0x20c983-0x0;var _0x3b747a=_0x35a5[_0x20c983];return _0x3b747a;};'use strict';var Sequelize=require(_0x535a('0x0'));module[_0x535a('0x1')]={'name':{'type':Sequelize[_0x535a('0x2')]},'description':{'type':Sequelize[_0x535a('0x2')]},'interval':{'type':Sequelize[_0x535a('0x2')],'allowNull':!![]}};
\ No newline at end of file
diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js
index d4358ec..2b72271 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 _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
+var _0x00bb=['query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','getIntervals','hasOwnProperty','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/extensions/rewrite','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','update','then','Intervals','UserProfileResource','destroy','end','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key'];(function(_0x3d141f,_0x436724){var _0x4e214b=function(_0x467151){while(--_0x467151){_0x3d141f['push'](_0x3d141f['shift']());}};_0x4e214b(++_0x436724);}(_0x00bb,0x18c));var _0xb00b=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x00bb[_0x30ae5e];return _0x1f2e93;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb00b('0x3'));var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require(_0xb00b('0x6'));var path=require(_0xb00b('0x7'));var sox=require(_0xb00b('0x8'));var csv=require(_0xb00b('0x9'));var ejs=require(_0xb00b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb00b('0xb'));var crypto=require('crypto');var jsforce=require(_0xb00b('0xc'));var deskjs=require(_0xb00b('0xd'));var toCsv=require(_0xb00b('0x9'));var querystring=require(_0xb00b('0xe'));var Papa=require(_0xb00b('0xf'));var Redis=require('ioredis');var authService=require(_0xb00b('0x10'));var qs=require(_0xb00b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb00b('0x12'));var logger=require(_0xb00b('0x13'))(_0xb00b('0x14'));var utils=require(_0xb00b('0x15'));var config=require(_0xb00b('0x16'));var db=require('../../mysqldb')['db'];var extensions=require(_0xb00b('0x17'));function respondWithStatusCode(_0x8cdf19,_0x51a000){_0x51a000=_0x51a000||0xcc;return function(_0x2ce845){if(_0x2ce845){return _0x8cdf19[_0xb00b('0x18')](_0x51a000);}return _0x8cdf19['status'](_0x51a000)['end']();};}function respondWithResult(_0x1e0663,_0x383a13){_0x383a13=_0x383a13||0xc8;return function(_0x676df3){if(_0x676df3){return _0x1e0663[_0xb00b('0x19')](_0x383a13)[_0xb00b('0x1a')](_0x676df3);}};}function respondWithFilteredResult(_0x317754,_0x399801){return function(_0x2fa153){if(_0x2fa153){var _0x38dc46=_0x2fa153[_0xb00b('0x1b')],_0x39ac6e=_0x399801[_0xb00b('0x1c')],_0x344b36=_0x399801[_0xb00b('0x1c')]+_0x399801[_0xb00b('0x1d')],_0xa9e43b;if(_0x344b36>=_0x38dc46){_0x344b36=_0x38dc46;_0xa9e43b=0xc8;}else{_0xa9e43b=0xce;}_0x317754[_0xb00b('0x19')](_0xa9e43b);return _0x317754['set'](_0xb00b('0x1e'),_0x39ac6e+'-'+_0x344b36+'/'+_0x38dc46)['json'](_0x2fa153);}return null;};}function patchUpdates(_0x104b49){return function(_0x3a88d6){try{jsonpatch['apply'](_0x3a88d6,_0x104b49,!![]);}catch(_0x4c984d){return BPromise[_0xb00b('0x1f')](_0x4c984d);}return _0x3a88d6[_0xb00b('0x20')]();};}function saveUpdates(_0x93ae7f,_0x51f6e1){return function(_0x4672d9){if(_0x4672d9){return _0x4672d9[_0xb00b('0x21')](_0x93ae7f)[_0xb00b('0x22')](function(_0x57e4b4){return _0x57e4b4;});}return null;};}function removeEntity(_0x1140a9,_0x4072b5){return function(_0x20ae7a){if(_0x20ae7a){return _0x20ae7a['destroy']()['then'](function(){var _0xdc2d34=_0x20ae7a['get']({'plain':!![]});var _0x1b0f22=_0xb00b('0x23');return db[_0xb00b('0x24')][_0xb00b('0x25')]({'where':{'type':_0x1b0f22,'resourceId':_0xdc2d34['id']}})[_0xb00b('0x22')](function(){return _0x20ae7a;});})[_0xb00b('0x22')](function(){_0x1140a9[_0xb00b('0x19')](0xcc)[_0xb00b('0x26')]();});}};}function handleEntityNotFound(_0x5e3f4d,_0x16c61d){return function(_0xe18c3f){if(!_0xe18c3f){_0x5e3f4d[_0xb00b('0x18')](0x194);}return _0xe18c3f;};}function handleError(_0x18b8d2,_0x299c5b){_0x299c5b=_0x299c5b||0x1f4;return function(_0x3c9787){logger['error'](_0x3c9787[_0xb00b('0x27')]);if(_0x3c9787[_0xb00b('0x28')]){delete _0x3c9787['name'];}_0x18b8d2[_0xb00b('0x19')](_0x299c5b)[_0xb00b('0x29')](_0x3c9787);};}exports[_0xb00b('0x2a')]=function(_0x32b54c,_0x34bff1){var _0x4d4c02={},_0xbc45a8={},_0x132814={'count':0x0,'rows':[]};var _0x244c95=_[_0xb00b('0x2b')](db[_0xb00b('0x2c')][_0xb00b('0x2d')],function(_0x50725a){return{'name':_0x50725a[_0xb00b('0x2e')],'type':_0x50725a[_0xb00b('0x2f')][_0xb00b('0x30')]};});_0xbc45a8['model']=_[_0xb00b('0x2b')](_0x244c95,'name');_0xbc45a8[_0xb00b('0x31')]=_[_0xb00b('0x32')](_0x32b54c[_0xb00b('0x31')]);_0xbc45a8[_0xb00b('0x33')]=_['intersection'](_0xbc45a8[_0xb00b('0x34')],_0xbc45a8['query']);_0x4d4c02[_0xb00b('0x35')]=_[_0xb00b('0x36')](_0xbc45a8[_0xb00b('0x34')],qs[_0xb00b('0x37')](_0x32b54c[_0xb00b('0x31')][_0xb00b('0x37')]));_0x4d4c02[_0xb00b('0x35')]=_0x4d4c02[_0xb00b('0x35')][_0xb00b('0x38')]?_0x4d4c02[_0xb00b('0x35')]:_0xbc45a8[_0xb00b('0x34')];if(!_0x32b54c[_0xb00b('0x31')]['hasOwnProperty'](_0xb00b('0x39'))){_0x4d4c02[_0xb00b('0x1d')]=qs['limit'](_0x32b54c[_0xb00b('0x31')]['limit']);_0x4d4c02[_0xb00b('0x1c')]=qs['offset'](_0x32b54c['query'][_0xb00b('0x1c')]);}_0x4d4c02[_0xb00b('0x3a')]=qs['sort'](_0x32b54c['query'][_0xb00b('0x3b')]);_0x4d4c02[_0xb00b('0x3c')]=qs[_0xb00b('0x33')](_[_0xb00b('0x3d')](_0x32b54c['query'],_0xbc45a8[_0xb00b('0x33')]),_0x244c95);if(_0x32b54c[_0xb00b('0x31')]['filter']){_0x4d4c02[_0xb00b('0x3c')]=_[_0xb00b('0x3e')](_0x4d4c02[_0xb00b('0x3c')],{'$or':_[_0xb00b('0x2b')](_0x244c95,function(_0x2f4878){if(_0x2f4878[_0xb00b('0x2f')]!==_0xb00b('0x3f')){var _0x2ee4e7={};_0x2ee4e7[_0x2f4878['name']]={'$like':'%'+_0x32b54c[_0xb00b('0x31')][_0xb00b('0x40')]+'%'};return _0x2ee4e7;}})});}_0x4d4c02=_[_0xb00b('0x3e')]({},_0x4d4c02,_0x32b54c[_0xb00b('0x41')]);var _0x56682b={'where':_0x4d4c02[_0xb00b('0x3c')]};return db[_0xb00b('0x2c')][_0xb00b('0x1b')](_0x56682b)[_0xb00b('0x22')](function(_0x3759e1){_0x132814['count']=_0x3759e1;if(_0x32b54c['query'][_0xb00b('0x42')]){_0x4d4c02[_0xb00b('0x43')]=[{'all':!![]}];}return db[_0xb00b('0x2c')]['findAll'](_0x4d4c02);})['then'](function(_0x393508){_0x132814[_0xb00b('0x44')]=_0x393508;return _0x132814;})['then'](respondWithFilteredResult(_0x34bff1,_0x4d4c02))[_0xb00b('0x45')](handleError(_0x34bff1,null));};exports[_0xb00b('0x46')]=function(_0x3634ca,_0x4b50a8){var _0x11a686={'raw':!![],'where':{'id':_0x3634ca[_0xb00b('0x47')]['id']}},_0x53505b={};_0x53505b[_0xb00b('0x34')]=_[_0xb00b('0x32')](db[_0xb00b('0x2c')][_0xb00b('0x2d')]);_0x53505b[_0xb00b('0x31')]=_['keys'](_0x3634ca['query']);_0x53505b[_0xb00b('0x33')]=_['intersection'](_0x53505b['model'],_0x53505b[_0xb00b('0x31')]);_0x11a686[_0xb00b('0x35')]=_[_0xb00b('0x36')](_0x53505b[_0xb00b('0x34')],qs[_0xb00b('0x37')](_0x3634ca[_0xb00b('0x31')][_0xb00b('0x37')]));_0x11a686[_0xb00b('0x35')]=_0x11a686[_0xb00b('0x35')][_0xb00b('0x38')]?_0x11a686['attributes']:_0x53505b['model'];if(_0x3634ca[_0xb00b('0x31')][_0xb00b('0x42')]){_0x11a686[_0xb00b('0x43')]=[{'all':!![]}];}_0x11a686=_[_0xb00b('0x3e')]({},_0x11a686,_0x3634ca[_0xb00b('0x41')]);return db[_0xb00b('0x2c')][_0xb00b('0x48')](_0x11a686)['then'](handleEntityNotFound(_0x4b50a8,null))[_0xb00b('0x22')](respondWithResult(_0x4b50a8,null))[_0xb00b('0x45')](handleError(_0x4b50a8,null));};exports[_0xb00b('0x49')]=function(_0x401129,_0x16d8e7){return db[_0xb00b('0x2c')][_0xb00b('0x49')](_0x401129[_0xb00b('0x4a')],{})[_0xb00b('0x22')](function(_0xb2783d){var _0x729955=_0x401129[_0xb00b('0x4b')][_0xb00b('0x4c')]({'plain':!![]});if(!_0x729955)throw new Error(_0xb00b('0x4d'));if(_0x729955['role']==='user'){var _0x578955=_0xb2783d[_0xb00b('0x4c')]({'plain':!![]});var _0x384cc8=_0xb00b('0x23');return db[_0xb00b('0x4e')][_0xb00b('0x48')]({'where':{'name':_0x384cc8,'userProfileId':_0x729955[_0xb00b('0x4f')]},'raw':!![]})['then'](function(_0xa3ec89){if(_0xa3ec89&&_0xa3ec89[_0xb00b('0x50')]===0x0){return db[_0xb00b('0x24')]['create']({'name':_0x578955[_0xb00b('0x28')],'resourceId':_0x578955['id'],'type':_0xa3ec89[_0xb00b('0x28')],'sectionId':_0xa3ec89['id']},{})[_0xb00b('0x22')](function(){return _0xb2783d;});}else{return _0xb2783d;}})[_0xb00b('0x45')](function(_0x405c8b){logger[_0xb00b('0x51')](_0xb00b('0x52'),_0x405c8b);throw _0x405c8b;});}return _0xb2783d;})[_0xb00b('0x22')](respondWithResult(_0x16d8e7,0xc9))[_0xb00b('0x45')](handleError(_0x16d8e7,null));};exports['update']=function(_0x79b11,_0x36b25e){if(_0x79b11[_0xb00b('0x4a')]['id']){delete _0x79b11[_0xb00b('0x4a')]['id'];}return db[_0xb00b('0x2c')][_0xb00b('0x48')]({'where':{'id':_0x79b11[_0xb00b('0x47')]['id']}})[_0xb00b('0x22')](handleEntityNotFound(_0x36b25e,null))[_0xb00b('0x22')](saveUpdates(_0x79b11['body'],null))[_0xb00b('0x22')](respondWithResult(_0x36b25e,null))[_0xb00b('0x45')](handleError(_0x36b25e,null));};exports[_0xb00b('0x25')]=function(_0x1e7356,_0x527f80){return db[_0xb00b('0x2c')]['find']({'where':{'id':_0x1e7356['params']['id']}})[_0xb00b('0x22')](handleEntityNotFound(_0x527f80,null))[_0xb00b('0x22')](removeEntity(_0x527f80,null))[_0xb00b('0x45')](handleError(_0x527f80,null));};exports['addInterval']=function(_0x2cd46a,_0x1d484a,_0x3dd5fd){if(_0x2cd46a[_0xb00b('0x4a')]['id']){delete _0x2cd46a[_0xb00b('0x4a')]['id'];}return db['Interval'][_0xb00b('0x48')]({'where':{'id':_0x2cd46a['params']['id']}})['then'](handleEntityNotFound(_0x1d484a,null))[_0xb00b('0x22')](function(_0x52b02b){if(_0x52b02b){_0x2cd46a[_0xb00b('0x4a')][_0xb00b('0x53')]=_0x52b02b['id'];return db[_0xb00b('0x2c')][_0xb00b('0x49')](_0x2cd46a[_0xb00b('0x4a')]);}})[_0xb00b('0x22')](respondWithResult(_0x1d484a,null))[_0xb00b('0x45')](handleError(_0x1d484a,null));};exports['getIntervals']=function(_0xc3cf64,_0x3abd98,_0x575397){var _0x4557e6={};var _0x30c759={};var _0x2e6077;var _0x31c559;return db['Interval']['findOne']({'where':{'id':_0xc3cf64[_0xb00b('0x47')]['id']}})[_0xb00b('0x22')](handleEntityNotFound(_0x3abd98,null))[_0xb00b('0x22')](function(_0x5d6306){if(_0x5d6306){_0x2e6077=_0x5d6306;_0x30c759[_0xb00b('0x34')]=_['keys'](db['Interval'][_0xb00b('0x2d')]);_0x30c759[_0xb00b('0x31')]=_[_0xb00b('0x32')](_0xc3cf64[_0xb00b('0x31')]);_0x30c759[_0xb00b('0x33')]=_[_0xb00b('0x36')](_0x30c759[_0xb00b('0x34')],_0x30c759[_0xb00b('0x31')]);_0x4557e6[_0xb00b('0x35')]=_['intersection'](_0x30c759[_0xb00b('0x34')],qs[_0xb00b('0x37')](_0xc3cf64[_0xb00b('0x31')][_0xb00b('0x37')]));_0x4557e6[_0xb00b('0x35')]=_0x4557e6[_0xb00b('0x35')][_0xb00b('0x38')]?_0x4557e6[_0xb00b('0x35')]:_0x30c759[_0xb00b('0x34')];_0x4557e6[_0xb00b('0x3a')]=qs[_0xb00b('0x3b')](_0xc3cf64[_0xb00b('0x31')]['sort']);_0x4557e6[_0xb00b('0x3c')]=qs['filters'](_['pick'](_0xc3cf64[_0xb00b('0x31')],_0x30c759[_0xb00b('0x33')]));if(_0xc3cf64[_0xb00b('0x31')][_0xb00b('0x40')]){_0x4557e6['where']=_['merge'](_0x4557e6[_0xb00b('0x3c')],{'$or':_['map'](_0x4557e6[_0xb00b('0x35')],function(_0x172498){var _0x150e09={};_0x150e09[_0x172498]={'$like':'%'+_0xc3cf64[_0xb00b('0x31')]['filter']+'%'};return _0x150e09;})});}_0x4557e6=_[_0xb00b('0x3e')]({},_0x4557e6,_0xc3cf64[_0xb00b('0x41')]);return _0x2e6077[_0xb00b('0x54')](_0x4557e6);}})[_0xb00b('0x22')](function(_0x2a707f){if(_0x2a707f){_0x31c559=_0x2a707f[_0xb00b('0x38')];if(!_0xc3cf64[_0xb00b('0x31')][_0xb00b('0x55')](_0xb00b('0x39'))){_0x4557e6[_0xb00b('0x1d')]=qs['limit'](_0xc3cf64[_0xb00b('0x31')][_0xb00b('0x1d')]);_0x4557e6['offset']=qs[_0xb00b('0x1c')](_0xc3cf64['query'][_0xb00b('0x1c')]);}return _0x2e6077[_0xb00b('0x54')](_0x4557e6);}})[_0xb00b('0x22')](function(_0x140080){if(_0x140080){return _0x140080?{'count':_0x31c559,'rows':_0x140080}:null;}})[_0xb00b('0x22')](respondWithResult(_0x3abd98,null))[_0xb00b('0x45')](handleError(_0x3abd98,null));};exports['addIntervals']=function(_0x397a5a,_0x43a8af,_0x287f83){return db[_0xb00b('0x2c')]['findOne']({'where':{'id':_0x397a5a[_0xb00b('0x47')]['id']}})[_0xb00b('0x22')](handleEntityNotFound(_0x43a8af,null))[_0xb00b('0x22')](function(_0x4d9f1f){if(_0x4d9f1f){return db[_0xb00b('0x56')][_0xb00b('0x57')](function(_0x5b7aee){return db[_0xb00b('0x2c')][_0xb00b('0x25')]({'where':{'IntervalId':_0x397a5a[_0xb00b('0x47')]['id']},'transaction':_0x5b7aee})[_0xb00b('0x22')](function(_0x44c123){var _0x19593e=_[_0xb00b('0x2b')](_0x397a5a[_0xb00b('0x4a')],function(_0x1be0af){delete _0x1be0af['id'];_0x1be0af[_0xb00b('0x53')]=_0x397a5a[_0xb00b('0x47')]['id'];return _0x1be0af;});return db['Interval'][_0xb00b('0x58')](_0x19593e,{'transaction':_0x5b7aee});});})[_0xb00b('0x22')](function(){return db[_0xb00b('0x2c')]['findAll']({'where':{'IntervalId':_0x397a5a['params']['id']}});});}})['then'](respondWithResult(_0x43a8af,null))[_0xb00b('0x45')](handleError(_0x43a8af,null));};
\ No newline at end of file
diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js
index b134663..2da9f9a 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 _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
+var _0x6f7a=['bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','rewrite','lodash','util','../../config/logger','api'];(function(_0x49e2b8,_0x5cf700){var _0x1f2213=function(_0x51f2bb){while(--_0x51f2bb){_0x49e2b8['push'](_0x49e2b8['shift']());}};_0x1f2213(++_0x5cf700);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x459a33,_0x445736){_0x459a33=_0x459a33-0x0;var _0x44d366=_0x6f7a[_0x459a33];return _0x44d366;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var logger=require(_0xa6f7('0x2'))(_0xa6f7('0x3'));var moment=require('moment');var BPromise=require(_0xa6f7('0x4'));var rp=require(_0xa6f7('0x5'));var fs=require('fs');var path=require(_0xa6f7('0x6'));var rimraf=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var attributes=require(_0xa6f7('0x9'));var extensions=require(_0xa6f7('0xa'));module[_0xa6f7('0xb')]=function(_0x1fdd5f,_0x335aaa){return _0x1fdd5f[_0xa6f7('0xc')]('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x30f2a7,_0x2674c9){extensions[_0xa6f7('0xd')](_0x1fdd5f,_0x30f2a7);},'afterBulkCreate':function(_0x362404,_0x23bb05,_0x49a451){_0x49a451();extensions['rewrite'](_0x1fdd5f,_0x362404[0x0]);},'afterUpdate':function(_0x2fd1d0,_0x225da4){extensions['rewrite'](_0x1fdd5f,_0x2fd1d0);},'afterDestroy':function(_0x178f20,_0x5623bf){extensions[_0xa6f7('0xd')](_0x1fdd5f,_0x178f20);}}});};
\ No newline at end of file
diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js
index c2aa0f7..bf45118 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 _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
+var _0xd9c6=['error','code','message','catch','GetInterval','findAll','options','raw','where','attributes','limit','include','map','model','ShowInterval','Interval','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5a41e9,_0x545f66){var _0x209919=function(_0x48f915){while(--_0x48f915){_0x5a41e9['push'](_0x5a41e9['shift']());}};_0x209919(++_0x545f66);}(_0xd9c6,0x1c0));var _0x6d9c=function(_0x798a03,_0xff9c94){_0x798a03=_0x798a03-0x0;var _0x5881e4=_0xd9c6[_0x798a03];return _0x5881e4;};'use strict';var _=require(_0x6d9c('0x0'));var util=require(_0x6d9c('0x1'));var moment=require(_0x6d9c('0x2'));var BPromise=require(_0x6d9c('0x3'));var rs=require(_0x6d9c('0x4'));var fs=require('fs');var Redis=require(_0x6d9c('0x5'));var db=require(_0x6d9c('0x6'))['db'];var utils=require(_0x6d9c('0x7'));var logger=require(_0x6d9c('0x8'))(_0x6d9c('0x9'));var config=require('../../config/environment');var jayson=require(_0x6d9c('0xa'));var client=jayson[_0x6d9c('0xb')][_0x6d9c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x373b12,_0x510606,_0x28ce2d){return new BPromise(function(_0x40551c,_0x41124a){return client[_0x6d9c('0xd')](_0x373b12,_0x28ce2d)[_0x6d9c('0xe')](function(_0x341a8b){logger[_0x6d9c('0xf')](_0x6d9c('0x10'),_0x510606,_0x6d9c('0x11'));logger[_0x6d9c('0x12')]('Interval,\x20%s,\x20%s,\x20%s',_0x510606,_0x6d9c('0x11'),JSON[_0x6d9c('0x13')](_0x341a8b));if(_0x341a8b[_0x6d9c('0x14')]){if(_0x341a8b['error'][_0x6d9c('0x15')]===0x1f4){logger['error']('Interval,\x20%s,\x20%s',_0x510606,_0x341a8b[_0x6d9c('0x14')][_0x6d9c('0x16')]);return _0x41124a(_0x341a8b[_0x6d9c('0x14')][_0x6d9c('0x16')]);}logger[_0x6d9c('0x14')](_0x6d9c('0x10'),_0x510606,_0x341a8b[_0x6d9c('0x14')][_0x6d9c('0x16')]);return _0x40551c(_0x341a8b['error'][_0x6d9c('0x16')]);}else{logger[_0x6d9c('0xf')](_0x6d9c('0x10'),_0x510606,_0x6d9c('0x11'));_0x40551c(_0x341a8b['result'][_0x6d9c('0x16')]);}})[_0x6d9c('0x17')](function(_0x1a624d){logger['error'](_0x6d9c('0x10'),_0x510606,_0x1a624d);_0x41124a(_0x1a624d);});});}exports[_0x6d9c('0x18')]=function(_0x57993e){var _0x4ef744=this;return new Promise(function(_0x1e72d0,_0x2a0be0){return db['Interval'][_0x6d9c('0x19')]({'raw':_0x57993e[_0x6d9c('0x1a')]?_0x57993e[_0x6d9c('0x1a')][_0x6d9c('0x1b')]===undefined?!![]:![]:!![],'where':_0x57993e[_0x6d9c('0x1a')]?_0x57993e['options'][_0x6d9c('0x1c')]||null:null,'attributes':_0x57993e[_0x6d9c('0x1a')]?_0x57993e[_0x6d9c('0x1a')][_0x6d9c('0x1d')]||null:null,'limit':_0x57993e[_0x6d9c('0x1a')]?_0x57993e['options'][_0x6d9c('0x1e')]||null:null,'include':_0x57993e['options']?_0x57993e[_0x6d9c('0x1a')][_0x6d9c('0x1f')]?_[_0x6d9c('0x20')](_0x57993e[_0x6d9c('0x1a')]['include'],function(_0x55b343){return{'model':db[_0x55b343[_0x6d9c('0x21')]],'as':_0x55b343['as'],'attributes':_0x55b343[_0x6d9c('0x1d')],'include':_0x55b343[_0x6d9c('0x1f')]?_[_0x6d9c('0x20')](_0x55b343[_0x6d9c('0x1f')],function(_0x1e32f9){return{'model':db[_0x1e32f9[_0x6d9c('0x21')]],'as':_0x1e32f9['as'],'attributes':_0x1e32f9['attributes'],'include':_0x1e32f9[_0x6d9c('0x1f')]?_['map'](_0x1e32f9[_0x6d9c('0x1f')],function(_0x4506b5){return{'model':db[_0x4506b5[_0x6d9c('0x21')]],'as':_0x4506b5['as'],'attributes':_0x4506b5[_0x6d9c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6d9c('0xe')](function(_0x3b5fdf){logger[_0x6d9c('0xf')]('GetInterval',_0x57993e);logger[_0x6d9c('0x12')](_0x6d9c('0x18'),_0x57993e,JSON[_0x6d9c('0x13')](_0x3b5fdf));_0x1e72d0(_0x3b5fdf);})[_0x6d9c('0x17')](function(_0x4b20d7){logger[_0x6d9c('0x14')](_0x6d9c('0x18'),_0x4b20d7[_0x6d9c('0x16')],_0x57993e);_0x2a0be0(_0x4ef744[_0x6d9c('0x14')](0x1f4,_0x4b20d7[_0x6d9c('0x16')]));});});};exports[_0x6d9c('0x22')]=function(_0x423f88){var _0x1027d4=this;return new Promise(function(_0x14fa6c,_0x3aef1e){return db[_0x6d9c('0x23')]['find']({'raw':_0x423f88[_0x6d9c('0x1a')]?_0x423f88['options'][_0x6d9c('0x1b')]===undefined?!![]:![]:!![],'where':_0x423f88[_0x6d9c('0x1a')]?_0x423f88['options'][_0x6d9c('0x1c')]||null:null,'attributes':_0x423f88[_0x6d9c('0x1a')]?_0x423f88[_0x6d9c('0x1a')]['attributes']||null:null,'include':_0x423f88[_0x6d9c('0x1a')]?_0x423f88['options'][_0x6d9c('0x1f')]?_[_0x6d9c('0x20')](_0x423f88['options'][_0x6d9c('0x1f')],function(_0x848a38){return{'model':db[_0x848a38[_0x6d9c('0x21')]],'as':_0x848a38['as'],'attributes':_0x848a38[_0x6d9c('0x1d')],'include':_0x848a38['include']?_[_0x6d9c('0x20')](_0x848a38[_0x6d9c('0x1f')],function(_0x1ac4a5){return{'model':db[_0x1ac4a5['model']],'as':_0x1ac4a5['as'],'attributes':_0x1ac4a5[_0x6d9c('0x1d')],'include':_0x1ac4a5[_0x6d9c('0x1f')]?_[_0x6d9c('0x20')](_0x1ac4a5['include'],function(_0x4aa04f){return{'model':db[_0x4aa04f[_0x6d9c('0x21')]],'as':_0x4aa04f['as'],'attributes':_0x4aa04f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xe04670){logger[_0x6d9c('0xf')](_0x6d9c('0x22'),_0x423f88);logger[_0x6d9c('0x12')](_0x6d9c('0x22'),_0x423f88,JSON[_0x6d9c('0x13')](_0xe04670));_0x14fa6c(_0xe04670);})[_0x6d9c('0x17')](function(_0x5f46e6){logger['error'](_0x6d9c('0x22'),_0x5f46e6[_0x6d9c('0x16')],_0x423f88);_0x3aef1e(_0x1027d4[_0x6d9c('0x14')](0x1f4,_0x5f46e6[_0x6d9c('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/jira/index.js b/server/api/jira/index.js
index 700e97d..bd37c4d 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 _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
+var _0xc42f=['express','Router','../../components/auth/service','./jira.controller','post','isAuthenticated','send','exports'];(function(_0x396629,_0x24efaa){var _0xd523d7=function(_0x109768){while(--_0x109768){_0x396629['push'](_0x396629['shift']());}};_0xd523d7(++_0x24efaa);}(_0xc42f,0x1d0));var _0xfc42=function(_0x5b9878,_0x1a331c){_0x5b9878=_0x5b9878-0x0;var _0x2307bf=_0xc42f[_0x5b9878];return _0x2307bf;};'use strict';var express=require(_0xfc42('0x0'));var router=express[_0xfc42('0x1')]();var auth=require(_0xfc42('0x2'));var controller=require(_0xfc42('0x3'));router[_0xfc42('0x4')]('/',auth[_0xfc42('0x5')](),controller[_0xfc42('0x6')]);module[_0xfc42('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js
index 1a9d8b4..d9298a3 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 _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
+var _0x98b6=['openIssue','send','body','headers','connection','remoteAddress','socket','https','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','summary','Report','\x20from\x20','description','issuetype','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','base64','setEncoding','utf8','data','end','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write'];(function(_0x4c3422,_0x4cda71){var _0x2bbe92=function(_0x337351){while(--_0x337351){_0x4c3422['push'](_0x4c3422['shift']());}};_0x2bbe92(++_0x4cda71);}(_0x98b6,0x103));var _0x698b=function(_0x10c4e9,_0x386a2e){_0x10c4e9=_0x10c4e9-0x0;var _0x3f39de=_0x98b6[_0x10c4e9];return _0x3f39de;};'use strict';var BPromise=require('bluebird');var https=require(_0x698b('0x0'));var logger=require(_0x698b('0x1'))(_0x698b('0x2'));var USERNAME=_0x698b('0x3');var PASSWORD=_0x698b('0x4');function openIssue(_0x1317ac,_0x39d677){var _0x56b4d={'fields':{'project':{'key':_0x1317ac['key']||_0x698b('0x5')},'summary':(_0x1317ac[_0x698b('0x6')]||_0x698b('0x7'))+_0x698b('0x8')+_0x1317ac['ip'],'description':_0x1317ac[_0x698b('0x9')]||JSON['stringify'](_0x1317ac),'issuetype':{'name':_0x1317ac[_0x698b('0xa')]||_0x698b('0xb')}}};_0x56b4d[_0x698b('0xc')][_0x698b('0xd')]=_0x1317ac[_0x698b('0xe')];_0x56b4d[_0x698b('0xc')][_0x698b('0xf')]=_0x1317ac['oldToken'];_0x56b4d[_0x698b('0xc')][_0x698b('0x10')]=_0x1317ac['newToken'];_0x56b4d[_0x698b('0xc')][_0x698b('0x11')]=_0x1317ac[_0x698b('0x12')];_0x56b4d['fields']['customfield_11504']=_0x1317ac[_0x698b('0x13')];_0x56b4d[_0x698b('0xc')][_0x698b('0x14')]=_0x1317ac['ip'];var _0x449da1={'host':_0x698b('0x15'),'port':0x1bb,'path':_0x698b('0x16'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x698b('0x17'),'Authorization':_0x698b('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x698b('0x19')](_0x698b('0x1a'))}};var _0xc834b6=JSON['stringify'](_0x56b4d);var _0x271f88=https['request'](_0x449da1,function(_0x1daa1c){_0x1daa1c[_0x698b('0x1b')](_0x698b('0x1c'));var _0xa8e827='';_0x1daa1c['on'](_0x698b('0x1d'),function(_0x3e0a04){_0xa8e827+=_0x3e0a04;});_0x1daa1c['on'](_0x698b('0x1e'),function(){if(_0x39d677){return _0x39d677['status'](_0x1daa1c['statusCode'])[_0x698b('0x1f')](JSON[_0x698b('0x20')](_0xa8e827));}});});_0x271f88['on']('error',function(_0x46736a){if(_0x39d677){return _0x39d677['status'](0x1f4)[_0x698b('0x1f')]({'errors':[{'message':_0x698b('0x21'),'type':'api.jira'}]});}});_0x271f88[_0x698b('0x22')](_0xc834b6);_0x271f88['end']();}exports[_0x698b('0x23')]=openIssue;exports[_0x698b('0x24')]=function(_0x12f2ed,_0x346b0d){_0x12f2ed[_0x698b('0x25')]['ip']=_0x12f2ed[_0x698b('0x26')]['x-forwarded-for']||_0x12f2ed[_0x698b('0x27')][_0x698b('0x28')]||_0x12f2ed[_0x698b('0x29')][_0x698b('0x28')]||_0x12f2ed[_0x698b('0x27')][_0x698b('0x29')][_0x698b('0x28')];return openIssue(_0x12f2ed[_0x698b('0x25')],_0x346b0d);};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js
index fe6eed8..a707c29 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 _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
+var _0xe42c=['Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','create','/:id','update','delete','multer','path','connect-timeout','express'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xe42c,0x172));var _0xce42=function(_0x32e4c9,_0x54a38c){_0x32e4c9=_0x32e4c9-0x0;var _0x2591b5=_0xe42c[_0x32e4c9];return _0x2591b5;};'use strict';var multer=require(_0xce42('0x0'));var util=require('util');var path=require(_0xce42('0x1'));var timeout=require(_0xce42('0x2'));var express=require(_0xce42('0x3'));var router=express[_0xce42('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xce42('0x5'));var config=require(_0xce42('0x6'));var controller=require('./jscriptyAnswerReport.controller');router['get']('/',auth[_0xce42('0x7')](),controller[_0xce42('0x8')]);router[_0xce42('0x9')](_0xce42('0xa'),auth[_0xce42('0x7')](),controller[_0xce42('0xb')]);router[_0xce42('0x9')]('/:id',auth[_0xce42('0x7')](),controller[_0xce42('0xc')]);router['post']('/',auth[_0xce42('0x7')](),controller[_0xce42('0xd')]);router['put'](_0xce42('0xe'),auth[_0xce42('0x7')](),controller[_0xce42('0xf')]);router[_0xce42('0x10')](_0xce42('0xe'),auth[_0xce42('0x7')](),controller['destroy']);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 70efaea..e8c3b36 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 _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
+var _0xa473=['STRING','long','sequelize','exports'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa473,0x18a));var _0x3a47=function(_0x51d3e4,_0x4f422f){_0x51d3e4=_0x51d3e4-0x0;var _0x1e0a0e=_0xa473[_0x51d3e4];return _0x1e0a0e;};'use strict';var Sequelize=require(_0x3a47('0x0'));module[_0x3a47('0x1')]={'question':{'type':Sequelize[_0x3a47('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x3a47('0x3'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x3a47('0x2')]},'queue':{'type':Sequelize[_0x3a47('0x2')]},'uniqueid':{'type':Sequelize[_0x3a47('0x2')]},'calleridname':{'type':Sequelize[_0x3a47('0x2')]},'calleridnum':{'type':Sequelize[_0x3a47('0x2')]},'questionId':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
index 2a716d9..83bdf09 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 _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
+var _0x2084=['findAll','rows','catch','show','params','model','find','create','body','destroy','describe','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','filter','merge','VIRTUAL','options','include'];(function(_0x2b9ab7,_0x1d3a6d){var _0x4da4a4=function(_0x4651c3){while(--_0x4651c3){_0x2b9ab7['push'](_0x2b9ab7['shift']());}};_0x4da4a4(++_0x1d3a6d);}(_0x2084,0xec));var _0x4208=function(_0x13f72d,_0x40874d){_0x13f72d=_0x13f72d-0x0;var _0x3ebfdf=_0x2084[_0x13f72d];return _0x3ebfdf;};'use strict';var pdf=require(_0x4208('0x0'));var emlformat=require(_0x4208('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4208('0x2'));var jsonpatch=require(_0x4208('0x3'));var rp=require('request-promise');var moment=require(_0x4208('0x4'));var BPromise=require(_0x4208('0x5'));var Mustache=require(_0x4208('0x6'));var util=require(_0x4208('0x7'));var path=require('path');var sox=require(_0x4208('0x8'));var csv=require(_0x4208('0x9'));var ejs=require(_0x4208('0xa'));var fs=require('fs');var _=require(_0x4208('0xb'));var squel=require(_0x4208('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4208('0xd'));var toCsv=require(_0x4208('0x9'));var querystring=require('querystring');var Papa=require(_0x4208('0xe'));var Redis=require(_0x4208('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4208('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4208('0x11'));var logger=require(_0x4208('0x12'))(_0x4208('0x13'));var utils=require(_0x4208('0x14'));var config=require(_0x4208('0x15'));var db=require(_0x4208('0x16'))['db'];function respondWithStatusCode(_0xcfd2fb,_0x103981){_0x103981=_0x103981||0xcc;return function(_0x54b5fb){if(_0x54b5fb){return _0xcfd2fb[_0x4208('0x17')](_0x103981);}return _0xcfd2fb[_0x4208('0x18')](_0x103981)['end']();};}function respondWithResult(_0xfbe6d9,_0x4fb507){_0x4fb507=_0x4fb507||0xc8;return function(_0x4f818e){if(_0x4f818e){return _0xfbe6d9['status'](_0x4fb507)[_0x4208('0x19')](_0x4f818e);}};}function respondWithFilteredResult(_0x2c69ff,_0xc7e9a8){return function(_0x35886f){if(_0x35886f){var _0x579b08=_0x35886f[_0x4208('0x1a')],_0x3593ab=_0xc7e9a8[_0x4208('0x1b')],_0x291775=_0xc7e9a8[_0x4208('0x1b')]+_0xc7e9a8['limit'],_0x1059ef;if(_0x291775>=_0x579b08){_0x291775=_0x579b08;_0x1059ef=0xc8;}else{_0x1059ef=0xce;}_0x2c69ff['status'](_0x1059ef);return _0x2c69ff[_0x4208('0x1c')](_0x4208('0x1d'),_0x3593ab+'-'+_0x291775+'/'+_0x579b08)['json'](_0x35886f);}return null;};}function patchUpdates(_0x50ebe4){return function(_0x327892){try{jsonpatch[_0x4208('0x1e')](_0x327892,_0x50ebe4,!![]);}catch(_0x514f10){return BPromise[_0x4208('0x1f')](_0x514f10);}return _0x327892[_0x4208('0x20')]();};}function saveUpdates(_0x47f4ab,_0xb1713c){return function(_0x3b28ec){if(_0x3b28ec){return _0x3b28ec[_0x4208('0x21')](_0x47f4ab)[_0x4208('0x22')](function(_0x4156f1){return _0x4156f1;});}return null;};}function removeEntity(_0x23f8c7,_0x20885f){return function(_0x107854){if(_0x107854){return _0x107854['destroy']()['then'](function(){_0x23f8c7['status'](0xcc)[_0x4208('0x23')]();});}};}function handleEntityNotFound(_0x1aac36,_0x1b12d6){return function(_0x5c9785){if(!_0x5c9785){_0x1aac36[_0x4208('0x17')](0x194);}return _0x5c9785;};}function handleError(_0x5e8dc4,_0x41d3bb){_0x41d3bb=_0x41d3bb||0x1f4;return function(_0x1ce9b1){logger[_0x4208('0x24')](_0x1ce9b1[_0x4208('0x25')]);if(_0x1ce9b1[_0x4208('0x26')]){delete _0x1ce9b1[_0x4208('0x26')];}_0x5e8dc4['status'](_0x41d3bb)[_0x4208('0x27')](_0x1ce9b1);};}exports[_0x4208('0x28')]=function(_0x306814,_0x145680){var _0x893a27={},_0x470755={},_0x593965={'count':0x0,'rows':[]};var _0x20bed2=_[_0x4208('0x29')](db[_0x4208('0x2a')][_0x4208('0x2b')],function(_0x3ab0e2){return{'name':_0x3ab0e2[_0x4208('0x2c')],'type':_0x3ab0e2[_0x4208('0x2d')][_0x4208('0x2e')]};});_0x470755['model']=_[_0x4208('0x29')](_0x20bed2,'name');_0x470755[_0x4208('0x2f')]=_[_0x4208('0x30')](_0x306814[_0x4208('0x2f')]);_0x470755[_0x4208('0x31')]=_[_0x4208('0x32')](_0x470755['model'],_0x470755['query']);_0x893a27['attributes']=_[_0x4208('0x32')](_0x470755['model'],qs['fields'](_0x306814['query'][_0x4208('0x33')]));_0x893a27[_0x4208('0x34')]=_0x893a27[_0x4208('0x34')][_0x4208('0x35')]?_0x893a27[_0x4208('0x34')]:_0x470755['model'];if(!_0x306814[_0x4208('0x2f')][_0x4208('0x36')](_0x4208('0x37'))){_0x893a27['limit']=qs['limit'](_0x306814[_0x4208('0x2f')][_0x4208('0x38')]);_0x893a27[_0x4208('0x1b')]=qs[_0x4208('0x1b')](_0x306814['query'][_0x4208('0x1b')]);}_0x893a27[_0x4208('0x39')]=qs['sort'](_0x306814['query']['sort']);_0x893a27[_0x4208('0x3a')]=qs[_0x4208('0x31')](_['pick'](_0x306814[_0x4208('0x2f')],_0x470755[_0x4208('0x31')]),_0x20bed2);if(_0x306814[_0x4208('0x2f')][_0x4208('0x3b')]){_0x893a27[_0x4208('0x3a')]=_[_0x4208('0x3c')](_0x893a27[_0x4208('0x3a')],{'$or':_[_0x4208('0x29')](_0x20bed2,function(_0x8cfdf6){if(_0x8cfdf6['type']!==_0x4208('0x3d')){var _0x155836={};_0x155836[_0x8cfdf6['name']]={'$like':'%'+_0x306814[_0x4208('0x2f')][_0x4208('0x3b')]+'%'};return _0x155836;}})});}_0x893a27=_[_0x4208('0x3c')]({},_0x893a27,_0x306814[_0x4208('0x3e')]);var _0x4456fb={'where':_0x893a27[_0x4208('0x3a')]};return db[_0x4208('0x2a')][_0x4208('0x1a')](_0x4456fb)[_0x4208('0x22')](function(_0x48f72b){_0x593965['count']=_0x48f72b;if(_0x306814[_0x4208('0x2f')]['includeAll']){_0x893a27[_0x4208('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x4208('0x40')](_0x893a27);})['then'](function(_0x442b95){_0x593965[_0x4208('0x41')]=_0x442b95;return _0x593965;})[_0x4208('0x22')](respondWithFilteredResult(_0x145680,_0x893a27))[_0x4208('0x42')](handleError(_0x145680,null));};exports[_0x4208('0x43')]=function(_0x2ef7b2,_0x514ea8){var _0x3a44c5={'raw':!![],'where':{'id':_0x2ef7b2[_0x4208('0x44')]['id']}},_0x1ae06e={};_0x1ae06e[_0x4208('0x45')]=_[_0x4208('0x30')](db[_0x4208('0x2a')]['rawAttributes']);_0x1ae06e['query']=_[_0x4208('0x30')](_0x2ef7b2['query']);_0x1ae06e[_0x4208('0x31')]=_['intersection'](_0x1ae06e['model'],_0x1ae06e[_0x4208('0x2f')]);_0x3a44c5[_0x4208('0x34')]=_[_0x4208('0x32')](_0x1ae06e['model'],qs['fields'](_0x2ef7b2[_0x4208('0x2f')]['fields']));_0x3a44c5['attributes']=_0x3a44c5[_0x4208('0x34')]['length']?_0x3a44c5[_0x4208('0x34')]:_0x1ae06e['model'];if(_0x2ef7b2[_0x4208('0x2f')]['includeAll']){_0x3a44c5[_0x4208('0x3f')]=[{'all':!![]}];}_0x3a44c5=_[_0x4208('0x3c')]({},_0x3a44c5,_0x2ef7b2[_0x4208('0x3e')]);return db[_0x4208('0x2a')][_0x4208('0x46')](_0x3a44c5)[_0x4208('0x22')](handleEntityNotFound(_0x514ea8,null))[_0x4208('0x22')](respondWithResult(_0x514ea8,null))[_0x4208('0x42')](handleError(_0x514ea8,null));};exports[_0x4208('0x47')]=function(_0x2ce84a,_0x2d344a){return db[_0x4208('0x2a')][_0x4208('0x47')](_0x2ce84a[_0x4208('0x48')],{})[_0x4208('0x22')](respondWithResult(_0x2d344a,0xc9))[_0x4208('0x42')](handleError(_0x2d344a,null));};exports[_0x4208('0x21')]=function(_0x5db37a,_0x34c78f){if(_0x5db37a['body']['id']){delete _0x5db37a[_0x4208('0x48')]['id'];}return db[_0x4208('0x2a')][_0x4208('0x46')]({'where':{'id':_0x5db37a[_0x4208('0x44')]['id']}})[_0x4208('0x22')](handleEntityNotFound(_0x34c78f,null))[_0x4208('0x22')](saveUpdates(_0x5db37a['body'],null))[_0x4208('0x22')](respondWithResult(_0x34c78f,null))[_0x4208('0x42')](handleError(_0x34c78f,null));};exports[_0x4208('0x49')]=function(_0x4da665,_0x5f455b){return db[_0x4208('0x2a')][_0x4208('0x46')]({'where':{'id':_0x4da665['params']['id']}})[_0x4208('0x22')](handleEntityNotFound(_0x5f455b,null))[_0x4208('0x22')](removeEntity(_0x5f455b,null))[_0x4208('0x42')](handleError(_0x5f455b,null));};exports[_0x4208('0x4a')]=function(_0x15eb63,_0x4dc2fd){return db[_0x4208('0x2a')][_0x4208('0x4a')]()['then'](respondWithResult(_0x4dc2fd,null))['catch'](handleError(_0x4dc2fd,null));};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
index 23ce4e5..7355923 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 _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
+var _0x0938=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0xb84491,_0x406f70){var _0x248f40=function(_0x535ad9){while(--_0x535ad9){_0xb84491['push'](_0xb84491['shift']());}};_0x248f40(++_0x406f70);}(_0x0938,0x144));var _0x8093=function(_0x277415,_0x38968b){_0x277415=_0x277415-0x0;var _0x376342=_0x0938[_0x277415];return _0x376342;};'use strict';var _=require('lodash');var util=require(_0x8093('0x0'));var logger=require('../../config/logger')(_0x8093('0x1'));var moment=require(_0x8093('0x2'));var BPromise=require(_0x8093('0x3'));var rp=require(_0x8093('0x4'));var fs=require('fs');var path=require(_0x8093('0x5'));var rimraf=require(_0x8093('0x6'));var config=require(_0x8093('0x7'));var attributes=require(_0x8093('0x8'));module['exports']=function(_0x366ca8,_0x41e4dd){return _0x366ca8[_0x8093('0x9')](_0x8093('0xa'),attributes,{'tableName':_0x8093('0xb'),'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 17d1892..c662f3b 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 _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
+var _0xa093=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x1cb115,_0x55cac1){var _0x27dd09=function(_0x46d60f){while(--_0x46d60f){_0x1cb115['push'](_0x1cb115['shift']());}};_0x27dd09(++_0x55cac1);}(_0xa093,0x18e));var _0x3a09=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa093[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3a09('0x0'));var util=require(_0x3a09('0x1'));var moment=require(_0x3a09('0x2'));var BPromise=require(_0x3a09('0x3'));var rs=require(_0x3a09('0x4'));var fs=require('fs');var Redis=require(_0x3a09('0x5'));var db=require(_0x3a09('0x6'))['db'];var utils=require(_0x3a09('0x7'));var logger=require(_0x3a09('0x8'))(_0x3a09('0x9'));var config=require(_0x3a09('0xa'));var jayson=require(_0x3a09('0xb'));var client=jayson[_0x3a09('0xc')][_0x3a09('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x21a1e2,_0x12f0ad,_0x146a17){return new BPromise(function(_0x5265fc,_0x2a0a8a){return client['request'](_0x21a1e2,_0x146a17)[_0x3a09('0xe')](function(_0xf39682){logger[_0x3a09('0xf')](_0x3a09('0x10'),_0x12f0ad,_0x3a09('0x11'));logger[_0x3a09('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x12f0ad,_0x3a09('0x11'),JSON[_0x3a09('0x13')](_0xf39682));if(_0xf39682[_0x3a09('0x14')]){if(_0xf39682[_0x3a09('0x14')][_0x3a09('0x15')]===0x1f4){logger[_0x3a09('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x12f0ad,_0xf39682[_0x3a09('0x14')][_0x3a09('0x16')]);return _0x2a0a8a(_0xf39682[_0x3a09('0x14')][_0x3a09('0x16')]);}logger[_0x3a09('0x14')](_0x3a09('0x10'),_0x12f0ad,_0xf39682[_0x3a09('0x14')][_0x3a09('0x16')]);return _0x5265fc(_0xf39682['error'][_0x3a09('0x16')]);}else{logger[_0x3a09('0xf')](_0x3a09('0x10'),_0x12f0ad,_0x3a09('0x11'));_0x5265fc(_0xf39682[_0x3a09('0x17')][_0x3a09('0x16')]);}})[_0x3a09('0x18')](function(_0x5e58c8){logger[_0x3a09('0x14')](_0x3a09('0x10'),_0x12f0ad,_0x5e58c8);_0x2a0a8a(_0x5e58c8);});});}
\ No newline at end of file
diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js
index 9f044b6..bca6f48 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 _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
+var _0x3bf9=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','post','/:id/clone','clone','update','delete','destroy'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x3bf9,0x8b));var _0x93bf=function(_0x23c217,_0x3aee12){_0x23c217=_0x23c217-0x0;var _0x53fcf8=_0x3bf9[_0x23c217];return _0x53fcf8;};'use strict';var multer=require('multer');var util=require(_0x93bf('0x0'));var path=require(_0x93bf('0x1'));var timeout=require(_0x93bf('0x2'));var express=require('express');var router=express[_0x93bf('0x3')]();var auth=require(_0x93bf('0x4'));var interaction=require(_0x93bf('0x5'));var config=require(_0x93bf('0x6'));var controller=require(_0x93bf('0x7'));router[_0x93bf('0x8')]('/',auth[_0x93bf('0x9')](),controller['index']);router['get'](_0x93bf('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x93bf('0x8')](_0x93bf('0xb'),auth[_0x93bf('0x9')](),controller[_0x93bf('0xc')]);router[_0x93bf('0x8')](_0x93bf('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x93bf('0xe'),auth['isAuthenticated'](),timeout(_0x93bf('0xf')),controller['getSummary']);router[_0x93bf('0x10')]('/',auth[_0x93bf('0x9')](),controller['create']);router['post'](_0x93bf('0x11'),auth[_0x93bf('0x9')](),controller[_0x93bf('0x12')]);router['put'](_0x93bf('0xa'),auth['isAuthenticated'](),controller[_0x93bf('0x13')]);router[_0x93bf('0x14')](_0x93bf('0xa'),auth['isAuthenticated'](),controller[_0x93bf('0x15')]);module[_0x93bf('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js
index 11b727a..2ee9d74 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 _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
+var _0x4bc0=['isString','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','name','STRING','isObjectLike','setDataValue','formData'];(function(_0x39ae21,_0x1ffcde){var _0x47d8f2=function(_0x2d6729){while(--_0x2d6729){_0x39ae21['push'](_0x39ae21['shift']());}};_0x47d8f2(++_0x1ffcde);}(_0x4bc0,0x115));var _0x04bc=function(_0x460f40,_0x1149a4){_0x460f40=_0x460f40-0x0;var _0x3c0ac8=_0x4bc0[_0x460f40];return _0x3c0ac8;};'use strict';var Sequelize=require(_0x04bc('0x0'));var _=require(_0x04bc('0x1'));var util=require(_0x04bc('0x2'));module[_0x04bc('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0x04bc('0x4')},'description':{'type':Sequelize[_0x04bc('0x5')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x2d54cc){if(_[_0x04bc('0x6')](_0x2d54cc)){this[_0x04bc('0x7')](_0x04bc('0x8'),JSON['stringify'](_0x2d54cc));}else if(_[_0x04bc('0x9')](_0x2d54cc)){this[_0x04bc('0x7')](_0x04bc('0x8'),_0x2d54cc);}else{this[_0x04bc('0x7')]('formData',util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x04bc('0xa')](_0x04bc('0x4'))||'',this[_0x04bc('0xa')](_0x04bc('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x04bc('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x04bc('0xc')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js
index af33925..5956cb2 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 _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
+var _0x89c8=['questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','writeFileSync','/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','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','Projects','UserProfileResource','end','name','send','index','map','JscriptyProject','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','rows','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','find','omit','createdAt','updatedAt','error','getSessions','JscriptySessionReport','nolimit','order','ProjectId','include','findAll','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport'];(function(_0x5bd398,_0x1973fa){var _0x5c552f=function(_0x2245b3){while(--_0x2245b3){_0x5bd398['push'](_0x5bd398['shift']());}};_0x5c552f(++_0x1973fa);}(_0x89c8,0xfc));var _0x889c=function(_0x1802f5,_0x3c969c){_0x1802f5=_0x1802f5-0x0;var _0xc6ec4c=_0x89c8[_0x1802f5];return _0xc6ec4c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x889c('0x0'));var rimraf=require(_0x889c('0x1'));var zipdir=require(_0x889c('0x2'));var jsonpatch=require(_0x889c('0x3'));var rp=require(_0x889c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x889c('0x5'));var util=require(_0x889c('0x6'));var path=require(_0x889c('0x7'));var sox=require('sox');var csv=require(_0x889c('0x8'));var ejs=require(_0x889c('0x9'));var fs=require('fs');var _=require(_0x889c('0xa'));var squel=require(_0x889c('0xb'));var crypto=require('crypto');var jsforce=require(_0x889c('0xc'));var deskjs=require(_0x889c('0xd'));var toCsv=require(_0x889c('0x8'));var querystring=require('querystring');var Papa=require(_0x889c('0xe'));var Redis=require(_0x889c('0xf'));var authService=require(_0x889c('0x10'));var qs=require(_0x889c('0x11'));var as=require(_0x889c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x889c('0x13'))(_0x889c('0x14'));var utils=require(_0x889c('0x15'));var config=require(_0x889c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4915f8,_0x3edfa2){_0x3edfa2=_0x3edfa2||0xcc;return function(_0x1f53b){if(_0x1f53b){return _0x4915f8[_0x889c('0x17')](_0x3edfa2);}return _0x4915f8[_0x889c('0x18')](_0x3edfa2)['end']();};}function respondWithResult(_0x2fe1e5,_0x14b193){_0x14b193=_0x14b193||0xc8;return function(_0x4ecddb){if(_0x4ecddb){return _0x2fe1e5['status'](_0x14b193)['json'](_0x4ecddb);}};}function respondWithFilteredResult(_0x22085a,_0x1c8f8d){return function(_0x747a90){if(_0x747a90){var _0x248198=_0x747a90[_0x889c('0x19')],_0x16d22a=_0x1c8f8d[_0x889c('0x1a')],_0x2558a7=_0x1c8f8d['offset']+_0x1c8f8d[_0x889c('0x1b')],_0x21e244;if(_0x2558a7>=_0x248198){_0x2558a7=_0x248198;_0x21e244=0xc8;}else{_0x21e244=0xce;}_0x22085a['status'](_0x21e244);return _0x22085a[_0x889c('0x1c')](_0x889c('0x1d'),_0x16d22a+'-'+_0x2558a7+'/'+_0x248198)[_0x889c('0x1e')](_0x747a90);}return null;};}function patchUpdates(_0x5241e3){return function(_0xa987c3){try{jsonpatch[_0x889c('0x1f')](_0xa987c3,_0x5241e3,!![]);}catch(_0x5dbc96){return BPromise[_0x889c('0x20')](_0x5dbc96);}return _0xa987c3['save']();};}function saveUpdates(_0x2c60ba,_0x2d6f98){return function(_0x3dab42){if(_0x3dab42){return _0x3dab42[_0x889c('0x21')](_0x2c60ba)[_0x889c('0x22')](function(_0x309c8a){return _0x309c8a;});}return null;};}function removeEntity(_0x271cd5,_0x286ecb){return function(_0x401e00){if(_0x401e00){return _0x401e00[_0x889c('0x23')]()[_0x889c('0x22')](function(){var _0x39cdc9=_0x401e00['get']({'plain':!![]});var _0x21bf8a=_0x889c('0x24');return db[_0x889c('0x25')][_0x889c('0x23')]({'where':{'type':_0x21bf8a,'resourceId':_0x39cdc9['id']}})['then'](function(){return _0x401e00;});})[_0x889c('0x22')](function(){_0x271cd5[_0x889c('0x18')](0xcc)[_0x889c('0x26')]();});}};}function handleEntityNotFound(_0x5e81e5,_0x158052){return function(_0x2e24a1){if(!_0x2e24a1){_0x5e81e5['sendStatus'](0x194);}return _0x2e24a1;};}function handleError(_0x207471,_0x3c4800){_0x3c4800=_0x3c4800||0x1f4;return function(_0x5ef072){logger['error'](_0x5ef072['stack']);if(_0x5ef072[_0x889c('0x27')]){delete _0x5ef072[_0x889c('0x27')];}_0x207471[_0x889c('0x18')](_0x3c4800)[_0x889c('0x28')](_0x5ef072);};}exports[_0x889c('0x29')]=function(_0xe0370b,_0x4b2431){var _0x5505d1={},_0x2efb41={},_0x3d5938={'count':0x0,'rows':[]};var _0x5a54ed=_[_0x889c('0x2a')](db[_0x889c('0x2b')][_0x889c('0x2c')],function(_0x1b704b){return{'name':_0x1b704b[_0x889c('0x2d')],'type':_0x1b704b['type'][_0x889c('0x2e')]};});_0x2efb41[_0x889c('0x2f')]=_[_0x889c('0x2a')](_0x5a54ed,'name');_0x2efb41[_0x889c('0x30')]=_[_0x889c('0x31')](_0xe0370b['query']);_0x2efb41[_0x889c('0x32')]=_[_0x889c('0x33')](_0x2efb41['model'],_0x2efb41[_0x889c('0x30')]);_0x5505d1[_0x889c('0x34')]=_[_0x889c('0x33')](_0x2efb41[_0x889c('0x2f')],qs[_0x889c('0x35')](_0xe0370b[_0x889c('0x30')][_0x889c('0x35')]));_0x5505d1['attributes']=_0x5505d1[_0x889c('0x34')][_0x889c('0x36')]?_0x5505d1['attributes']:_0x2efb41[_0x889c('0x2f')];if(!_0xe0370b[_0x889c('0x30')][_0x889c('0x37')]('nolimit')){_0x5505d1[_0x889c('0x1b')]=qs[_0x889c('0x1b')](_0xe0370b['query'][_0x889c('0x1b')]);_0x5505d1[_0x889c('0x1a')]=qs[_0x889c('0x1a')](_0xe0370b[_0x889c('0x30')]['offset']);}_0x5505d1['order']=qs[_0x889c('0x38')](_0xe0370b['query'][_0x889c('0x38')]);_0x5505d1[_0x889c('0x39')]=qs[_0x889c('0x32')](_[_0x889c('0x3a')](_0xe0370b[_0x889c('0x30')],_0x2efb41[_0x889c('0x32')]),_0x5a54ed);if(_0xe0370b[_0x889c('0x30')]['filter']){_0x5505d1[_0x889c('0x39')]=_[_0x889c('0x3b')](_0x5505d1[_0x889c('0x39')],{'$or':_[_0x889c('0x2a')](_0x5a54ed,function(_0x158e8f){if(_0x158e8f[_0x889c('0x3c')]!==_0x889c('0x3d')){var _0x29fa30={};_0x29fa30[_0x158e8f[_0x889c('0x27')]]={'$like':'%'+_0xe0370b[_0x889c('0x30')][_0x889c('0x3e')]+'%'};return _0x29fa30;}})});}_0x5505d1=_['merge']({},_0x5505d1,_0xe0370b[_0x889c('0x3f')]);var _0x8fad46={'where':_0x5505d1['where']};return db[_0x889c('0x2b')][_0x889c('0x19')](_0x8fad46)[_0x889c('0x22')](function(_0x51ce26){_0x3d5938[_0x889c('0x19')]=_0x51ce26;if(_0xe0370b[_0x889c('0x30')][_0x889c('0x40')]){_0x5505d1['include']=[{'all':!![]}];}return db[_0x889c('0x2b')]['findAll'](_0x5505d1);})['then'](function(_0x3a5381){_0x3d5938[_0x889c('0x41')]=_0x3a5381;return _0x3d5938;})[_0x889c('0x22')](respondWithFilteredResult(_0x4b2431,_0x5505d1))['catch'](handleError(_0x4b2431,null));};exports['show']=function(_0x1e8614,_0x1e0349){var _0x24680={'raw':![],'where':{'id':_0x1e8614[_0x889c('0x42')]['id']}},_0x1ab6e5={};_0x1ab6e5[_0x889c('0x2f')]=_[_0x889c('0x31')](db[_0x889c('0x2b')][_0x889c('0x2c')]);_0x1ab6e5[_0x889c('0x30')]=_[_0x889c('0x31')](_0x1e8614['query']);_0x1ab6e5[_0x889c('0x32')]=_['intersection'](_0x1ab6e5[_0x889c('0x2f')],_0x1ab6e5[_0x889c('0x30')]);_0x24680[_0x889c('0x34')]=_[_0x889c('0x33')](_0x1ab6e5[_0x889c('0x2f')],qs[_0x889c('0x35')](_0x1e8614[_0x889c('0x30')][_0x889c('0x35')]));_0x24680[_0x889c('0x34')]=_0x24680[_0x889c('0x34')]['length']?_0x24680[_0x889c('0x34')]:_0x1ab6e5[_0x889c('0x2f')];if(_0x1e8614[_0x889c('0x30')][_0x889c('0x40')]){_0x24680['include']=[{'all':!![]}];}_0x24680=_[_0x889c('0x3b')]({},_0x24680,_0x1e8614[_0x889c('0x3f')]);return db[_0x889c('0x2b')]['find'](_0x24680)[_0x889c('0x22')](handleEntityNotFound(_0x1e0349,null))['then'](respondWithResult(_0x1e0349,null))['catch'](handleError(_0x1e0349,null));};exports[_0x889c('0x43')]=function(_0x515820,_0x41a67e){return db[_0x889c('0x2b')][_0x889c('0x43')](_0x515820[_0x889c('0x44')],{})['then'](function(_0x14fb9b){var _0x5aaecf=_0x515820[_0x889c('0x45')][_0x889c('0x46')]({'plain':!![]});if(!_0x5aaecf)throw new Error(_0x889c('0x47'));if(_0x5aaecf[_0x889c('0x48')]===_0x889c('0x45')){var _0x23a73c=_0x14fb9b[_0x889c('0x46')]({'plain':!![]});var _0xa921bd='Projects';return db[_0x889c('0x49')]['find']({'where':{'name':_0xa921bd,'userProfileId':_0x5aaecf[_0x889c('0x4a')]},'raw':!![]})['then'](function(_0x54f0c0){if(_0x54f0c0&&_0x54f0c0[_0x889c('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x23a73c[_0x889c('0x27')],'resourceId':_0x23a73c['id'],'type':_0x54f0c0[_0x889c('0x27')],'sectionId':_0x54f0c0['id']},{})[_0x889c('0x22')](function(){return _0x14fb9b;});}else{return _0x14fb9b;}})['catch'](function(_0x57acad){logger['error'](_0x889c('0x4c'),_0x57acad);throw _0x57acad;});}return _0x14fb9b;})[_0x889c('0x22')](respondWithResult(_0x41a67e,0xc9))[_0x889c('0x4d')](handleError(_0x41a67e,null));};exports[_0x889c('0x4e')]=function(_0x523b87,_0x4fe56f){var _0x57855d={'where':{'id':_0x523b87[_0x889c('0x42')]['id']}},_0x4790a6={};_0x4790a6['model']=_[_0x889c('0x31')](db[_0x889c('0x2b')][_0x889c('0x2c')]);_0x57855d[_0x889c('0x34')]=_[_0x889c('0x33')](_0x4790a6[_0x889c('0x2f')],qs['fields'](_0x523b87[_0x889c('0x30')]['fields']));_0x57855d['attributes']=_0x57855d['attributes']['length']?_0x57855d['attributes']:_0x4790a6['model'];if(_0x523b87[_0x889c('0x30')][_0x889c('0x40')]){_0x57855d['include']=[{'all':!![]}];}_0x57855d=_[_0x889c('0x3b')]({},_0x57855d,_0x523b87['options']);return db[_0x889c('0x2b')][_0x889c('0x4f')](_0x57855d)[_0x889c('0x22')](handleEntityNotFound(_0x4fe56f,null))['then'](function(_0x4292aa){if(_0x4292aa){var _0x27757=_0x4292aa[_0x889c('0x46')]({'plain':!![]});_0x27757=qs[_0x889c('0x50')](_0x27757,['id',_0x889c('0x51'),_0x889c('0x52')]);_0x523b87[_0x889c('0x44')]=_[_0x889c('0x50')](_0x523b87['body'],['id',_0x889c('0x51'),_0x889c('0x52')]);return db['JscriptyProject'][_0x889c('0x43')](_[_0x889c('0x3b')](_0x27757,_0x523b87[_0x889c('0x44')]),{'include':_0x523b87[_0x889c('0x30')][_0x889c('0x40')]?[{'all':!![]}]:undefined})[_0x889c('0x22')](function(_0x4415dd){var _0x40c2bd=_0x523b87[_0x889c('0x45')][_0x889c('0x46')]({'plain':!![]});if(!_0x40c2bd)throw new Error(_0x889c('0x47'));if(_0x40c2bd[_0x889c('0x48')]===_0x889c('0x45')){var _0x136c71=_0x4415dd[_0x889c('0x46')]({'plain':!![]});var _0x2688c2='Projects';return db[_0x889c('0x49')][_0x889c('0x4f')]({'where':{'name':_0x2688c2,'userProfileId':_0x40c2bd[_0x889c('0x4a')]},'raw':!![]})['then'](function(_0x18b65d){if(_0x18b65d&&_0x18b65d[_0x889c('0x4b')]===0x0){return db[_0x889c('0x25')][_0x889c('0x43')]({'name':_0x136c71[_0x889c('0x27')],'resourceId':_0x136c71['id'],'type':_0x18b65d[_0x889c('0x27')],'sectionId':_0x18b65d['id']},{})[_0x889c('0x22')](function(){return _0x4415dd;});}else{return _0x4415dd;}})['catch'](function(_0x5b8c7d){logger[_0x889c('0x53')](_0x889c('0x4c'),_0x5b8c7d);throw _0x5b8c7d;});}return _0x4415dd;});}})[_0x889c('0x22')](respondWithResult(_0x4fe56f,0xc9))[_0x889c('0x4d')](handleError(_0x4fe56f,null));};exports['update']=function(_0x29b0ad,_0xe00508){if(_0x29b0ad[_0x889c('0x44')]['id']){delete _0x29b0ad[_0x889c('0x44')]['id'];}return db['JscriptyProject'][_0x889c('0x4f')]({'where':{'id':_0x29b0ad[_0x889c('0x42')]['id']}})['then'](handleEntityNotFound(_0xe00508,null))['then'](saveUpdates(_0x29b0ad[_0x889c('0x44')],null))[_0x889c('0x22')](respondWithResult(_0xe00508,null))[_0x889c('0x4d')](handleError(_0xe00508,null));};exports['destroy']=function(_0x1f3a80,_0x2bedb3){return db['JscriptyProject'][_0x889c('0x4f')]({'where':{'id':_0x1f3a80['params']['id']}})['then'](handleEntityNotFound(_0x2bedb3,null))[_0x889c('0x22')](removeEntity(_0x2bedb3,null))[_0x889c('0x4d')](handleError(_0x2bedb3,null));};exports[_0x889c('0x54')]=function(_0x379bb5,_0x151a5f,_0x5d5a4a){var _0x221fcf={'raw':!![],'where':{}};var _0x1c90c7={};var _0x5e3d9e={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x379bb5[_0x889c('0x42')]['id']}})['then'](handleEntityNotFound(_0x151a5f,null))[_0x889c('0x22')](function(_0x4228e1){if(_0x4228e1){_0x1c90c7[_0x889c('0x2f')]=_[_0x889c('0x31')](db[_0x889c('0x55')][_0x889c('0x2c')]);_0x1c90c7[_0x889c('0x30')]=_[_0x889c('0x31')](_0x379bb5[_0x889c('0x30')]);_0x1c90c7[_0x889c('0x32')]=_['intersection'](_0x1c90c7[_0x889c('0x2f')],_0x1c90c7[_0x889c('0x30')]);_0x221fcf[_0x889c('0x34')]=_['intersection'](_0x1c90c7[_0x889c('0x2f')],qs[_0x889c('0x35')](_0x379bb5['query'][_0x889c('0x35')]));_0x221fcf[_0x889c('0x34')]=_0x221fcf[_0x889c('0x34')][_0x889c('0x36')]?_0x221fcf[_0x889c('0x34')]:_0x1c90c7[_0x889c('0x2f')];if(!_0x379bb5[_0x889c('0x30')][_0x889c('0x37')](_0x889c('0x56'))){_0x221fcf[_0x889c('0x1b')]=qs[_0x889c('0x1b')](_0x379bb5[_0x889c('0x30')][_0x889c('0x1b')]);_0x221fcf[_0x889c('0x1a')]=qs[_0x889c('0x1a')](_0x379bb5[_0x889c('0x30')][_0x889c('0x1a')]);}_0x221fcf[_0x889c('0x57')]=qs[_0x889c('0x38')](_0x379bb5[_0x889c('0x30')][_0x889c('0x38')]);_0x221fcf[_0x889c('0x39')]=qs[_0x889c('0x32')](_[_0x889c('0x3a')](_0x379bb5[_0x889c('0x30')],_0x1c90c7[_0x889c('0x32')]));_0x221fcf[_0x889c('0x39')][_0x889c('0x58')]=_0x4228e1['id'];if(_0x379bb5[_0x889c('0x30')][_0x889c('0x3e')]){_0x221fcf[_0x889c('0x39')]=_[_0x889c('0x3b')](_0x221fcf[_0x889c('0x39')],{'$or':_[_0x889c('0x2a')](_0x221fcf[_0x889c('0x34')],function(_0x2618b3){var _0x102df4={};_0x102df4[_0x2618b3]={'$like':'%'+_0x379bb5['query']['filter']+'%'};return _0x102df4;})});}_0x221fcf=_['merge']({},_0x221fcf,_0x379bb5[_0x889c('0x3f')]);return db['JscriptySessionReport'][_0x889c('0x19')]({'where':_0x221fcf['where']})[_0x889c('0x22')](function(_0x2f5ce7){_0x5e3d9e[_0x889c('0x19')]=_0x2f5ce7;if(_0x379bb5[_0x889c('0x30')][_0x889c('0x40')]){_0x221fcf[_0x889c('0x59')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x889c('0x5a')](_0x221fcf);})[_0x889c('0x22')](function(_0x563873){_0x5e3d9e[_0x889c('0x41')]=_0x563873;return _0x5e3d9e;});}})[_0x889c('0x22')](respondWithFilteredResult(_0x151a5f,_0x221fcf))['catch'](handleError(_0x151a5f,null));};exports[_0x889c('0x5b')]=function(_0x183bd3,_0x387ab9,_0x3bc411){var _0x2cdd14={'raw':!![],'where':{}};var _0x597e75={};var _0x26e032={'count':0x0,'rows':[]};return db[_0x889c('0x2b')]['findOne']({'where':{'id':_0x183bd3[_0x889c('0x42')]['id']}})['then'](handleEntityNotFound(_0x387ab9,null))[_0x889c('0x22')](function(_0x1257ab){if(_0x1257ab){_0x597e75[_0x889c('0x2f')]=_['keys'](db[_0x889c('0x5c')]['rawAttributes']);_0x597e75[_0x889c('0x30')]=_['keys'](_0x183bd3[_0x889c('0x30')]);_0x597e75['filters']=_[_0x889c('0x33')](_0x597e75[_0x889c('0x2f')],_0x597e75['query']);_0x2cdd14[_0x889c('0x34')]=_[_0x889c('0x33')](_0x597e75['model'],qs[_0x889c('0x35')](_0x183bd3[_0x889c('0x30')][_0x889c('0x35')]));_0x2cdd14[_0x889c('0x34')]=_0x2cdd14[_0x889c('0x34')][_0x889c('0x36')]?_0x2cdd14['attributes']:_0x597e75[_0x889c('0x2f')];if(!_0x183bd3[_0x889c('0x30')]['hasOwnProperty'](_0x889c('0x56'))){_0x2cdd14[_0x889c('0x1b')]=qs['limit'](_0x183bd3[_0x889c('0x30')][_0x889c('0x1b')]);_0x2cdd14[_0x889c('0x1a')]=qs[_0x889c('0x1a')](_0x183bd3['query'][_0x889c('0x1a')]);}_0x2cdd14[_0x889c('0x57')]=qs[_0x889c('0x38')](_0x183bd3[_0x889c('0x30')][_0x889c('0x38')]);_0x2cdd14[_0x889c('0x39')]=qs['filters'](_[_0x889c('0x3a')](_0x183bd3[_0x889c('0x30')],_0x597e75['filters']));_0x2cdd14[_0x889c('0x39')]['ProjectId']=_0x1257ab['id'];if(_0x183bd3[_0x889c('0x30')][_0x889c('0x3e')]){_0x2cdd14[_0x889c('0x39')]=_['merge'](_0x2cdd14[_0x889c('0x39')],{'$or':_[_0x889c('0x2a')](_0x2cdd14[_0x889c('0x34')],function(_0x20e52c){var _0x5d5f22={};_0x5d5f22[_0x20e52c]={'$like':'%'+_0x183bd3[_0x889c('0x30')][_0x889c('0x3e')]+'%'};return _0x5d5f22;})});}_0x2cdd14=_[_0x889c('0x3b')]({},_0x2cdd14,_0x183bd3[_0x889c('0x3f')]);return db['JscriptyAnswerReport']['count']({'where':_0x2cdd14[_0x889c('0x39')]})[_0x889c('0x22')](function(_0xad2244){_0x26e032[_0x889c('0x19')]=_0xad2244;if(_0x183bd3[_0x889c('0x30')][_0x889c('0x40')]){_0x2cdd14[_0x889c('0x59')]=[{'all':!![]}];}return db[_0x889c('0x5c')][_0x889c('0x5a')](_0x2cdd14);})[_0x889c('0x22')](function(_0xdfa61d){_0x26e032[_0x889c('0x41')]=_0xdfa61d;return _0x26e032;});}})[_0x889c('0x22')](respondWithFilteredResult(_0x387ab9,_0x2cdd14))[_0x889c('0x4d')](handleError(_0x387ab9,null));};function char(_0x5e6c48){return _0x889c('0x5d')===typeof _0x5e6c48?String[_0x889c('0x5e')]['apply'](null,arguments):_0x5e6c48;}function needsEncapsulation(_0x5a6c18){return!!_0x5a6c18&&(_0x5a6c18[_0x889c('0x5f')]()[_0x889c('0x60')](char(0xd))>=0x0||_0x5a6c18[_0x889c('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x5a6c18[_0x889c('0x5f')]()[_0x889c('0x60')](char(0x2c))>=0x0||_0x5a6c18[_0x889c('0x5f')]()[_0x889c('0x60')](char(0x22))>=0x0);}function encapsulate(_0x129ac0){var _0x592347=char(0x22),_0x579979='\x5c'+char(0x22),_0x9422e3=_0x129ac0[_0x889c('0x5f')]()[_0x889c('0x61')](new RegExp(_0x592347,'g'),_0x579979);return _0x592347+_0x9422e3+_0x592347;}exports[_0x889c('0x62')]=function(_0xc692c0,_0x447b55,_0x274628){var _0x58a5e2,_0x11c4b3;var _0x49c33b={'where':{'ProjectId':_0xc692c0['params']['id']}};if(_0xc692c0['query'][_0x889c('0x63')]){_0x49c33b['where'][_0x889c('0x64')]=JSON['parse'](_0xc692c0['query'][_0x889c('0x63')]);}return db[_0x889c('0x55')][_0x889c('0x5a')](_0x49c33b)[_0x889c('0x22')](handleEntityNotFound(_0x447b55,null))[_0x889c('0x22')](function(_0x3193c9){if(_0x3193c9){_0x58a5e2=_0x3193c9;return db[_0x889c('0x65')][_0x889c('0x5a')]({'where':{'SessionId':{'$in':_[_0x889c('0x2a')](_0x58a5e2,'id')},'ProjectId':_0xc692c0[_0x889c('0x42')]['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x447b55,null))[_0x889c('0x22')](function(_0x15a5af){if(_0x15a5af){_0x11c4b3=_0x15a5af;var _0x1813be={};for(var _0x3ad52c=0x0,_0x5ed7c2=_0x11c4b3[_0x889c('0x36')];_0x3ad52c<_0x5ed7c2;_0x3ad52c++){if(!_0x1813be[_0x889c('0x37')](_0x11c4b3[_0x3ad52c][_0x889c('0x66')])){_0x1813be[_0x11c4b3[_0x3ad52c][_0x889c('0x66')]]=needsEncapsulation(_0x11c4b3[_0x3ad52c][_0x889c('0x67')])?encapsulate(_0x11c4b3[_0x3ad52c][_0x889c('0x67')]):_0x11c4b3[_0x3ad52c][_0x889c('0x67')];}}var _0x4137f4=[],_0x4d934a={};for(var _0x438c43=0x0,_0x3822e7=_0x58a5e2[_0x889c('0x36')];_0x438c43<_0x3822e7;_0x438c43++){_0x4d934a={'ProjectId':_0xc692c0[_0x889c('0x42')]['id'],'SessionId':_0x58a5e2[_0x438c43]['id'],'StartTime':moment(_0x58a5e2[_0x438c43]['starttime'])[_0x889c('0x68')](_0x889c('0x69'))};for(var _0xb62932=0x0,_0x3e1c45=_0x11c4b3[_0x889c('0x36')];_0xb62932<_0x3e1c45;_0xb62932++){if(_0x11c4b3[_0xb62932][_0x889c('0x6a')]==_0x58a5e2[_0x438c43]['id']&&_0x1813be[_0x889c('0x37')](_0x11c4b3[_0xb62932]['questionId'])){_0x4d934a[_0x1813be[_0x11c4b3[_0xb62932][_0x889c('0x66')]]]=_0x11c4b3[_0xb62932]['answer'];}}for(var _0x9b532b in _0x1813be){if(!_0x4d934a[_0x889c('0x37')](_0x1813be[_0x9b532b])){_0x4d934a[_0x1813be[_0x9b532b]]=null;}}_0x4137f4[_0x889c('0x6b')](_0x4d934a);}return _0x4137f4;}})[_0x889c('0x22')](function(_0x172d79){if(!_[_0x889c('0x6c')](_0x172d79)){var _0x11e7d9=toCsv(_0x172d79);var _0x3352ae=Date[_0x889c('0x6d')]();fs[_0x889c('0x6e')](util[_0x889c('0x68')](_0x889c('0x6f'),_0xc692c0[_0x889c('0x42')]['id'],_0x3352ae),_0x11e7d9);_0x447b55[_0x889c('0x70')](_0x889c('0x71'),_0x889c('0x72')+util[_0x889c('0x68')](_0x889c('0x73'),_0xc692c0[_0x889c('0x42')]['id'],_0x3352ae));_0x447b55['setHeader'](_0x889c('0x74'),'text/csv');return _0x447b55[_0x889c('0x75')](util[_0x889c('0x68')](_0x889c('0x6f'),_0xc692c0[_0x889c('0x42')]['id'],_0x3352ae));}else{return _0x447b55[_0x889c('0x17')](0xcc);}})[_0x889c('0x4d')](handleError(_0x447b55,null));};
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js
index 287175b..4212d90 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 _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
+var _0x8eba=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','JscriptyProject','lodash','../../config/logger','api'];(function(_0x137815,_0x78dd4b){var _0x29ded1=function(_0x32d620){while(--_0x32d620){_0x137815['push'](_0x137815['shift']());}};_0x29ded1(++_0x78dd4b);}(_0x8eba,0xc3));var _0xa8eb=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0x8eba[_0x419e17];return _0x1f2044;};'use strict';var _=require(_0xa8eb('0x0'));var util=require('util');var logger=require(_0xa8eb('0x1'))(_0xa8eb('0x2'));var moment=require(_0xa8eb('0x3'));var BPromise=require(_0xa8eb('0x4'));var rp=require(_0xa8eb('0x5'));var fs=require('fs');var path=require(_0xa8eb('0x6'));var rimraf=require(_0xa8eb('0x7'));var config=require(_0xa8eb('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0xa8eb('0x9')]=function(_0x45219f,_0x43551f){return _0x45219f['define'](_0xa8eb('0xa'),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 2b8eea6..ab66203 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 _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
+var _0xe17b=['error','code','message','result','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0xcb8fa7,_0x22e0cb){var _0x3d0976=function(_0x36897e){while(--_0x36897e){_0xcb8fa7['push'](_0xcb8fa7['shift']());}};_0x3d0976(++_0x22e0cb);}(_0xe17b,0x1df));var _0xbe17=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0xe17b[_0x28a5ad];return _0x176b8a;};'use strict';var _=require(_0xbe17('0x0'));var util=require(_0xbe17('0x1'));var moment=require('moment');var BPromise=require(_0xbe17('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe17('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbe17('0x4'))(_0xbe17('0x5'));var config=require(_0xbe17('0x6'));var jayson=require(_0xbe17('0x7'));var client=jayson['client'][_0xbe17('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36bca3,_0xdc9b43,_0x23a8a7){return new BPromise(function(_0x67c809,_0x3b4691){return client['request'](_0x36bca3,_0x23a8a7)[_0xbe17('0x9')](function(_0x5f53fb){logger[_0xbe17('0xa')](_0xbe17('0xb'),_0xdc9b43,_0xbe17('0xc'));logger[_0xbe17('0xd')](_0xbe17('0xe'),_0xdc9b43,_0xbe17('0xc'),JSON['stringify'](_0x5f53fb));if(_0x5f53fb['error']){if(_0x5f53fb[_0xbe17('0xf')][_0xbe17('0x10')]===0x1f4){logger['error'](_0xbe17('0xb'),_0xdc9b43,_0x5f53fb[_0xbe17('0xf')][_0xbe17('0x11')]);return _0x3b4691(_0x5f53fb[_0xbe17('0xf')]['message']);}logger[_0xbe17('0xf')](_0xbe17('0xb'),_0xdc9b43,_0x5f53fb['error'][_0xbe17('0x11')]);return _0x67c809(_0x5f53fb['error'][_0xbe17('0x11')]);}else{logger[_0xbe17('0xa')](_0xbe17('0xb'),_0xdc9b43,_0xbe17('0xc'));_0x67c809(_0x5f53fb[_0xbe17('0x12')][_0xbe17('0x11')]);}})['catch'](function(_0x263fd0){logger['error'](_0xbe17('0xb'),_0xdc9b43,_0x263fd0);_0x3b4691(_0x263fd0);});});}
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js
index 577c5d7..37a032a 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 _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
+var _0xe6ee=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put','delete'];(function(_0xa9c826,_0x4b53f9){var _0x392e76=function(_0x341b09){while(--_0x341b09){_0xa9c826['push'](_0xa9c826['shift']());}};_0x392e76(++_0x4b53f9);}(_0xe6ee,0x1ca));var _0xee6e=function(_0x259252,_0x2ce1bf){_0x259252=_0x259252-0x0;var _0x49f20f=_0xe6ee[_0x259252];return _0x49f20f;};'use strict';var multer=require(_0xee6e('0x0'));var util=require('util');var path=require(_0xee6e('0x1'));var timeout=require(_0xee6e('0x2'));var express=require(_0xee6e('0x3'));var router=express[_0xee6e('0x4')]();var auth=require(_0xee6e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xee6e('0x6'));var controller=require(_0xee6e('0x7'));router[_0xee6e('0x8')]('/',auth[_0xee6e('0x9')](),controller[_0xee6e('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xee6e('0xb')]);router[_0xee6e('0x8')](_0xee6e('0xc'),auth['isAuthenticated'](),controller[_0xee6e('0xd')]);router['post']('/',auth[_0xee6e('0x9')](),controller[_0xee6e('0xe')]);router[_0xee6e('0xf')](_0xee6e('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xee6e('0x10')](_0xee6e('0xc'),auth['isAuthenticated'](),controller[_0xee6e('0x11')]);module[_0xee6e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
index 806bd72..3240694 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 _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
+var _0x0bb9=['TEXT','long','sequelize','exports','STRING'];(function(_0x5263c6,_0x6b9a73){var _0x2f86fd=function(_0x39c470){while(--_0x39c470){_0x5263c6['push'](_0x5263c6['shift']());}};_0x2f86fd(++_0x6b9a73);}(_0x0bb9,0x8e));var _0x90bb=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x0bb9[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require(_0x90bb('0x0'));module[_0x90bb('0x1')]={'question':{'type':Sequelize[_0x90bb('0x2')]},'answer':{'type':Sequelize[_0x90bb('0x3')](_0x90bb('0x4'))},'membername':{'type':Sequelize[_0x90bb('0x2')]},'projectname':{'type':Sequelize[_0x90bb('0x2')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x90bb('0x2')]},'calleridnum':{'type':Sequelize[_0x90bb('0x2')]},'questionId':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
index b6fb967..b4ad1c3 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 _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
+var _0xf949=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','map','JscriptyQuestionReport','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','keys','options','find','create','body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring'];(function(_0xf17775,_0x57fa65){var _0x4bf3b2=function(_0xb54e71){while(--_0xb54e71){_0xf17775['push'](_0xf17775['shift']());}};_0x4bf3b2(++_0x57fa65);}(_0xf949,0x1ac));var _0x9f94=function(_0x19d0ed,_0x5b5ccb){_0x19d0ed=_0x19d0ed-0x0;var _0x4218bf=_0xf949[_0x19d0ed];return _0x4218bf;};'use strict';var pdf=require(_0x9f94('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9f94('0x1'));var zipdir=require(_0x9f94('0x2'));var jsonpatch=require(_0x9f94('0x3'));var rp=require(_0x9f94('0x4'));var moment=require(_0x9f94('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9f94('0x6'));var path=require(_0x9f94('0x7'));var sox=require(_0x9f94('0x8'));var csv=require(_0x9f94('0x9'));var ejs=require(_0x9f94('0xa'));var fs=require('fs');var _=require(_0x9f94('0xb'));var squel=require('squel');var crypto=require(_0x9f94('0xc'));var jsforce=require(_0x9f94('0xd'));var deskjs=require(_0x9f94('0xe'));var toCsv=require(_0x9f94('0x9'));var querystring=require(_0x9f94('0xf'));var Papa=require(_0x9f94('0x10'));var Redis=require(_0x9f94('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f94('0x12'));var as=require(_0x9f94('0x13'));var hardwareService=require(_0x9f94('0x14'));var logger=require('../../config/logger')(_0x9f94('0x15'));var utils=require(_0x9f94('0x16'));var config=require(_0x9f94('0x17'));var db=require(_0x9f94('0x18'))['db'];function respondWithStatusCode(_0x209b0e,_0x16408d){_0x16408d=_0x16408d||0xcc;return function(_0x2b9020){if(_0x2b9020){return _0x209b0e[_0x9f94('0x19')](_0x16408d);}return _0x209b0e[_0x9f94('0x1a')](_0x16408d)[_0x9f94('0x1b')]();};}function respondWithResult(_0x374501,_0x46fd23){_0x46fd23=_0x46fd23||0xc8;return function(_0x141cc1){if(_0x141cc1){return _0x374501[_0x9f94('0x1a')](_0x46fd23)[_0x9f94('0x1c')](_0x141cc1);}};}function respondWithFilteredResult(_0x60de61,_0x3074cc){return function(_0x1218ab){if(_0x1218ab){var _0x467ae1=_0x1218ab[_0x9f94('0x1d')],_0x5d7eeb=_0x3074cc['offset'],_0x135b35=_0x3074cc[_0x9f94('0x1e')]+_0x3074cc[_0x9f94('0x1f')],_0x4b4745;if(_0x135b35>=_0x467ae1){_0x135b35=_0x467ae1;_0x4b4745=0xc8;}else{_0x4b4745=0xce;}_0x60de61[_0x9f94('0x1a')](_0x4b4745);return _0x60de61[_0x9f94('0x20')](_0x9f94('0x21'),_0x5d7eeb+'-'+_0x135b35+'/'+_0x467ae1)[_0x9f94('0x1c')](_0x1218ab);}return null;};}function patchUpdates(_0x584ff9){return function(_0x4cb707){try{jsonpatch[_0x9f94('0x22')](_0x4cb707,_0x584ff9,!![]);}catch(_0x10f8a7){return BPromise[_0x9f94('0x23')](_0x10f8a7);}return _0x4cb707[_0x9f94('0x24')]();};}function saveUpdates(_0x32f26e,_0x334b33){return function(_0x2abc3e){if(_0x2abc3e){return _0x2abc3e[_0x9f94('0x25')](_0x32f26e)[_0x9f94('0x26')](function(_0x51896f){return _0x51896f;});}return null;};}function removeEntity(_0x45be6e,_0x339fbd){return function(_0xee1b41){if(_0xee1b41){return _0xee1b41['destroy']()[_0x9f94('0x26')](function(){_0x45be6e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x477124,_0x1299a8){return function(_0x3e5382){if(!_0x3e5382){_0x477124[_0x9f94('0x19')](0x194);}return _0x3e5382;};}function handleError(_0x489c5a,_0x44d325){_0x44d325=_0x44d325||0x1f4;return function(_0x1a373a){logger[_0x9f94('0x27')](_0x1a373a['stack']);if(_0x1a373a[_0x9f94('0x28')]){delete _0x1a373a[_0x9f94('0x28')];}_0x489c5a['status'](_0x44d325)['send'](_0x1a373a);};}exports['index']=function(_0x107d2a,_0xdf069a){var _0x44e49a={},_0x22c025={},_0x36ed88={'count':0x0,'rows':[]};var _0x31ef36=_[_0x9f94('0x29')](db[_0x9f94('0x2a')][_0x9f94('0x2b')],function(_0x45b503){return{'name':_0x45b503[_0x9f94('0x2c')],'type':_0x45b503['type']['key']};});_0x22c025[_0x9f94('0x2d')]=_['map'](_0x31ef36,_0x9f94('0x28'));_0x22c025[_0x9f94('0x2e')]=_['keys'](_0x107d2a[_0x9f94('0x2e')]);_0x22c025[_0x9f94('0x2f')]=_[_0x9f94('0x30')](_0x22c025[_0x9f94('0x2d')],_0x22c025[_0x9f94('0x2e')]);_0x44e49a['attributes']=_['intersection'](_0x22c025[_0x9f94('0x2d')],qs[_0x9f94('0x31')](_0x107d2a['query'][_0x9f94('0x31')]));_0x44e49a[_0x9f94('0x32')]=_0x44e49a[_0x9f94('0x32')][_0x9f94('0x33')]?_0x44e49a[_0x9f94('0x32')]:_0x22c025['model'];if(!_0x107d2a[_0x9f94('0x2e')][_0x9f94('0x34')](_0x9f94('0x35'))){_0x44e49a[_0x9f94('0x1f')]=qs[_0x9f94('0x1f')](_0x107d2a['query'][_0x9f94('0x1f')]);_0x44e49a[_0x9f94('0x1e')]=qs[_0x9f94('0x1e')](_0x107d2a['query'][_0x9f94('0x1e')]);}_0x44e49a[_0x9f94('0x36')]=qs[_0x9f94('0x37')](_0x107d2a[_0x9f94('0x2e')][_0x9f94('0x37')]);_0x44e49a[_0x9f94('0x38')]=qs[_0x9f94('0x2f')](_[_0x9f94('0x39')](_0x107d2a[_0x9f94('0x2e')],_0x22c025[_0x9f94('0x2f')]),_0x31ef36);if(_0x107d2a[_0x9f94('0x2e')]['filter']){_0x44e49a['where']=_[_0x9f94('0x3a')](_0x44e49a['where'],{'$or':_[_0x9f94('0x29')](_0x31ef36,function(_0x2c28a3){if(_0x2c28a3[_0x9f94('0x3b')]!==_0x9f94('0x3c')){var _0x4c6b70={};_0x4c6b70[_0x2c28a3[_0x9f94('0x28')]]={'$like':'%'+_0x107d2a[_0x9f94('0x2e')][_0x9f94('0x3d')]+'%'};return _0x4c6b70;}})});}_0x44e49a=_[_0x9f94('0x3a')]({},_0x44e49a,_0x107d2a['options']);var _0x4e90d7={'where':_0x44e49a[_0x9f94('0x38')]};return db[_0x9f94('0x2a')][_0x9f94('0x1d')](_0x4e90d7)[_0x9f94('0x26')](function(_0x3c7c53){_0x36ed88[_0x9f94('0x1d')]=_0x3c7c53;if(_0x107d2a[_0x9f94('0x2e')][_0x9f94('0x3e')]){_0x44e49a[_0x9f94('0x3f')]=[{'all':!![]}];}return db[_0x9f94('0x2a')]['findAll'](_0x44e49a);})[_0x9f94('0x26')](function(_0x558f1f){_0x36ed88[_0x9f94('0x40')]=_0x558f1f;return _0x36ed88;})[_0x9f94('0x26')](respondWithFilteredResult(_0xdf069a,_0x44e49a))[_0x9f94('0x41')](handleError(_0xdf069a,null));};exports[_0x9f94('0x42')]=function(_0x37043e,_0x54dfa6){var _0x695780={'raw':!![],'where':{'id':_0x37043e['params']['id']}},_0x210c69={};_0x210c69[_0x9f94('0x2d')]=_[_0x9f94('0x43')](db[_0x9f94('0x2a')][_0x9f94('0x2b')]);_0x210c69[_0x9f94('0x2e')]=_[_0x9f94('0x43')](_0x37043e[_0x9f94('0x2e')]);_0x210c69[_0x9f94('0x2f')]=_[_0x9f94('0x30')](_0x210c69[_0x9f94('0x2d')],_0x210c69['query']);_0x695780['attributes']=_[_0x9f94('0x30')](_0x210c69[_0x9f94('0x2d')],qs['fields'](_0x37043e[_0x9f94('0x2e')]['fields']));_0x695780[_0x9f94('0x32')]=_0x695780[_0x9f94('0x32')][_0x9f94('0x33')]?_0x695780[_0x9f94('0x32')]:_0x210c69[_0x9f94('0x2d')];if(_0x37043e[_0x9f94('0x2e')]['includeAll']){_0x695780['include']=[{'all':!![]}];}_0x695780=_[_0x9f94('0x3a')]({},_0x695780,_0x37043e[_0x9f94('0x44')]);return db[_0x9f94('0x2a')][_0x9f94('0x45')](_0x695780)[_0x9f94('0x26')](handleEntityNotFound(_0x54dfa6,null))['then'](respondWithResult(_0x54dfa6,null))[_0x9f94('0x41')](handleError(_0x54dfa6,null));};exports[_0x9f94('0x46')]=function(_0xff121e,_0x203013){return db[_0x9f94('0x2a')]['create'](_0xff121e[_0x9f94('0x47')],{})[_0x9f94('0x26')](respondWithResult(_0x203013,0xc9))[_0x9f94('0x41')](handleError(_0x203013,null));};exports[_0x9f94('0x25')]=function(_0x3fbf1b,_0x400125){if(_0x3fbf1b[_0x9f94('0x47')]['id']){delete _0x3fbf1b[_0x9f94('0x47')]['id'];}return db[_0x9f94('0x2a')][_0x9f94('0x45')]({'where':{'id':_0x3fbf1b[_0x9f94('0x48')]['id']}})[_0x9f94('0x26')](handleEntityNotFound(_0x400125,null))[_0x9f94('0x26')](saveUpdates(_0x3fbf1b['body'],null))[_0x9f94('0x26')](respondWithResult(_0x400125,null))[_0x9f94('0x41')](handleError(_0x400125,null));};exports['destroy']=function(_0x5ea33,_0x1cf6f3){return db[_0x9f94('0x2a')][_0x9f94('0x45')]({'where':{'id':_0x5ea33[_0x9f94('0x48')]['id']}})[_0x9f94('0x26')](handleEntityNotFound(_0x1cf6f3,null))[_0x9f94('0x26')](removeEntity(_0x1cf6f3,null))[_0x9f94('0x41')](handleError(_0x1cf6f3,null));};exports['describe']=function(_0x998d6d,_0x97714a){return db[_0x9f94('0x2a')][_0x9f94('0x49')]()[_0x9f94('0x26')](respondWithResult(_0x97714a,null))['catch'](handleError(_0x97714a,null));};
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
index 04f2df4..cde29f1 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 _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
+var _0x21e9=['api','moment','bluebird','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','util','../../config/logger'];(function(_0x575dbb,_0x4ed18c){var _0x5acfd8=function(_0x29a54d){while(--_0x29a54d){_0x575dbb['push'](_0x575dbb['shift']());}};_0x5acfd8(++_0x4ed18c);}(_0x21e9,0x98));var _0x921e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x21e9[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x921e('0x0'));var logger=require(_0x921e('0x1'))(_0x921e('0x2'));var moment=require(_0x921e('0x3'));var BPromise=require(_0x921e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x921e('0x5'));var config=require(_0x921e('0x6'));var attributes=require(_0x921e('0x7'));module[_0x921e('0x8')]=function(_0x13903f,_0x3d338d){return _0x13903f[_0x921e('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0x921e('0xa'),'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 69cc44e..e27361c 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 _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
+var _0x5895=['debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x290c31,_0x534b8a){var _0x2eb0ac=function(_0x54bd7){while(--_0x54bd7){_0x290c31['push'](_0x290c31['shift']());}};_0x2eb0ac(++_0x534b8a);}(_0x5895,0xf6));var _0x5589=function(_0x5d7917,_0x1014a3){_0x5d7917=_0x5d7917-0x0;var _0x5eca82=_0x5895[_0x5d7917];return _0x5eca82;};'use strict';var _=require(_0x5589('0x0'));var util=require(_0x5589('0x1'));var moment=require(_0x5589('0x2'));var BPromise=require(_0x5589('0x3'));var rs=require(_0x5589('0x4'));var fs=require('fs');var Redis=require(_0x5589('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5589('0x6'));var logger=require(_0x5589('0x7'))(_0x5589('0x8'));var config=require(_0x5589('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5589('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55e12a,_0x5bcd08,_0x9a02b3){return new BPromise(function(_0x4dff39,_0xa133ef){return client['request'](_0x55e12a,_0x9a02b3)['then'](function(_0x2c4ec9){logger[_0x5589('0xb')](_0x5589('0xc'),_0x5bcd08,_0x5589('0xd'));logger[_0x5589('0xe')](_0x5589('0xf'),_0x5bcd08,'request\x20sent',JSON['stringify'](_0x2c4ec9));if(_0x2c4ec9[_0x5589('0x10')]){if(_0x2c4ec9[_0x5589('0x10')][_0x5589('0x11')]===0x1f4){logger[_0x5589('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5bcd08,_0x2c4ec9['error'][_0x5589('0x12')]);return _0xa133ef(_0x2c4ec9[_0x5589('0x10')]['message']);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x5bcd08,_0x2c4ec9['error'][_0x5589('0x12')]);return _0x4dff39(_0x2c4ec9['error'][_0x5589('0x12')]);}else{logger[_0x5589('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5bcd08,_0x5589('0xd'));_0x4dff39(_0x2c4ec9[_0x5589('0x13')]['message']);}})['catch'](function(_0x34a464){logger[_0x5589('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5bcd08,_0x34a464);_0xa133ef(_0x34a464);});});}
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js
index 748b8d5..9702b5b 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 _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
+var _0x8b7c=['delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/questions','getQuestions','post','update'];(function(_0x38c3fb,_0x3ee22c){var _0x3d6929=function(_0x268a54){while(--_0x268a54){_0x38c3fb['push'](_0x38c3fb['shift']());}};_0x3d6929(++_0x3ee22c);}(_0x8b7c,0x119));var _0xc8b7=function(_0x540160,_0x24c6b6){_0x540160=_0x540160-0x0;var _0x476120=_0x8b7c[_0x540160];return _0x476120;};'use strict';var multer=require(_0xc8b7('0x0'));var util=require(_0xc8b7('0x1'));var path=require(_0xc8b7('0x2'));var timeout=require(_0xc8b7('0x3'));var express=require(_0xc8b7('0x4'));var router=express[_0xc8b7('0x5')]();var auth=require(_0xc8b7('0x6'));var interaction=require(_0xc8b7('0x7'));var config=require('../../config/environment');var controller=require(_0xc8b7('0x8'));router[_0xc8b7('0x9')]('/',auth[_0xc8b7('0xa')](),controller['index']);router[_0xc8b7('0x9')](_0xc8b7('0xb'),auth[_0xc8b7('0xa')](),controller[_0xc8b7('0xc')]);router[_0xc8b7('0x9')](_0xc8b7('0xd'),auth['isAuthenticated'](),controller[_0xc8b7('0xe')]);router['get'](_0xc8b7('0xf'),auth[_0xc8b7('0xa')](),controller[_0xc8b7('0x10')]);router[_0xc8b7('0x11')]('/',auth[_0xc8b7('0xa')](),controller['create']);router['put']('/:id',auth[_0xc8b7('0xa')](),controller[_0xc8b7('0x12')]);router[_0xc8b7('0x13')](_0xc8b7('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
index a8db6c0..c7bee45 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 _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
+var _0x11c4=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','DATE','setDataValue','starttime','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11c4,0xf1));var _0x411c=function(_0x484e19,_0x2a94ff){_0x484e19=_0x484e19-0x0;var _0x59ac8d=_0x11c4[_0x484e19];return _0x59ac8d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0x411c('0x0')],'set':function(_0x47beb8){this[_0x411c('0x1')](_0x411c('0x2'),_0x47beb8);this[_0x411c('0x1')]('endtime',moment()[_0x411c('0x3')](_0x411c('0x4')));}},'endtime':{'type':Sequelize[_0x411c('0x0')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x411c('0x5')]},'uniqueid':{'type':Sequelize[_0x411c('0x5')]},'calleridname':{'type':Sequelize[_0x411c('0x5')]},'calleridnum':{'type':Sequelize[_0x411c('0x5')]},'completed':{'type':Sequelize[_0x411c('0x6')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js
index 562526d..7de20ca 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 _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
+var _0x752f=['keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','getQuestions','SessionId','JscriptyQuestionReport','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query'];(function(_0x4b07b7,_0x3bb016){var _0x642a62=function(_0x490219){while(--_0x490219){_0x4b07b7['push'](_0x4b07b7['shift']());}};_0x642a62(++_0x3bb016);}(_0x752f,0x1f0));var _0xf752=function(_0x5b0421,_0x22bc4c){_0x5b0421=_0x5b0421-0x0;var _0x50a184=_0x752f[_0x5b0421];return _0x50a184;};'use strict';var pdf=require(_0xf752('0x0'));var emlformat=require(_0xf752('0x1'));var rimraf=require(_0xf752('0x2'));var zipdir=require(_0xf752('0x3'));var jsonpatch=require(_0xf752('0x4'));var rp=require('request-promise');var moment=require(_0xf752('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf752('0x6'));var util=require(_0xf752('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf752('0x8'));var ejs=require(_0xf752('0x9'));var fs=require('fs');var _=require(_0xf752('0xa'));var squel=require(_0xf752('0xb'));var crypto=require(_0xf752('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf752('0xd'));var toCsv=require(_0xf752('0x8'));var querystring=require(_0xf752('0xe'));var Papa=require(_0xf752('0xf'));var Redis=require(_0xf752('0x10'));var authService=require(_0xf752('0x11'));var qs=require(_0xf752('0x12'));var as=require(_0xf752('0x13'));var hardwareService=require(_0xf752('0x14'));var logger=require(_0xf752('0x15'))(_0xf752('0x16'));var utils=require('../../config/utils');var config=require(_0xf752('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44161d,_0xb42818){_0xb42818=_0xb42818||0xcc;return function(_0x59d5ad){if(_0x59d5ad){return _0x44161d['sendStatus'](_0xb42818);}return _0x44161d[_0xf752('0x18')](_0xb42818)[_0xf752('0x19')]();};}function respondWithResult(_0x57b47f,_0x26e16c){_0x26e16c=_0x26e16c||0xc8;return function(_0x502d66){if(_0x502d66){return _0x57b47f[_0xf752('0x18')](_0x26e16c)[_0xf752('0x1a')](_0x502d66);}};}function respondWithFilteredResult(_0x35a5f8,_0x40998d){return function(_0xbd8a3){if(_0xbd8a3){var _0x466163=_0xbd8a3[_0xf752('0x1b')],_0x111410=_0x40998d[_0xf752('0x1c')],_0x4fae46=_0x40998d[_0xf752('0x1c')]+_0x40998d[_0xf752('0x1d')],_0x41364d;if(_0x4fae46>=_0x466163){_0x4fae46=_0x466163;_0x41364d=0xc8;}else{_0x41364d=0xce;}_0x35a5f8[_0xf752('0x18')](_0x41364d);return _0x35a5f8[_0xf752('0x1e')](_0xf752('0x1f'),_0x111410+'-'+_0x4fae46+'/'+_0x466163)['json'](_0xbd8a3);}return null;};}function patchUpdates(_0x4ae795){return function(_0x30ce54){try{jsonpatch['apply'](_0x30ce54,_0x4ae795,!![]);}catch(_0x32bd35){return BPromise[_0xf752('0x20')](_0x32bd35);}return _0x30ce54[_0xf752('0x21')]();};}function saveUpdates(_0x21f1c0,_0x1f0955){return function(_0x45aaef){if(_0x45aaef){return _0x45aaef[_0xf752('0x22')](_0x21f1c0)[_0xf752('0x23')](function(_0x7c1f91){return _0x7c1f91;});}return null;};}function removeEntity(_0x41aa77,_0x22a693){return function(_0x4c2d2b){if(_0x4c2d2b){return _0x4c2d2b[_0xf752('0x24')]()[_0xf752('0x23')](function(){_0x41aa77[_0xf752('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf04d34,_0x467dcb){return function(_0x1037db){if(!_0x1037db){_0xf04d34[_0xf752('0x25')](0x194);}return _0x1037db;};}function handleError(_0x4715e4,_0x5a8962){_0x5a8962=_0x5a8962||0x1f4;return function(_0x13794f){logger[_0xf752('0x26')](_0x13794f[_0xf752('0x27')]);if(_0x13794f['name']){delete _0x13794f[_0xf752('0x28')];}_0x4715e4[_0xf752('0x18')](_0x5a8962)['send'](_0x13794f);};}exports[_0xf752('0x29')]=function(_0x3e42c0,_0x536b67){var _0x4cb939={},_0x38a56e={},_0x43a201={'count':0x0,'rows':[]};var _0x508571=_[_0xf752('0x2a')](db[_0xf752('0x2b')][_0xf752('0x2c')],function(_0x5847d0){return{'name':_0x5847d0[_0xf752('0x2d')],'type':_0x5847d0[_0xf752('0x2e')][_0xf752('0x2f')]};});_0x38a56e[_0xf752('0x30')]=_['map'](_0x508571,_0xf752('0x28'));_0x38a56e[_0xf752('0x31')]=_[_0xf752('0x32')](_0x3e42c0[_0xf752('0x31')]);_0x38a56e['filters']=_[_0xf752('0x33')](_0x38a56e[_0xf752('0x30')],_0x38a56e[_0xf752('0x31')]);_0x4cb939[_0xf752('0x34')]=_[_0xf752('0x33')](_0x38a56e[_0xf752('0x30')],qs[_0xf752('0x35')](_0x3e42c0[_0xf752('0x31')][_0xf752('0x35')]));_0x4cb939[_0xf752('0x34')]=_0x4cb939[_0xf752('0x34')][_0xf752('0x36')]?_0x4cb939[_0xf752('0x34')]:_0x38a56e[_0xf752('0x30')];if(!_0x3e42c0[_0xf752('0x31')][_0xf752('0x37')](_0xf752('0x38'))){_0x4cb939[_0xf752('0x1d')]=qs[_0xf752('0x1d')](_0x3e42c0['query'][_0xf752('0x1d')]);_0x4cb939[_0xf752('0x1c')]=qs[_0xf752('0x1c')](_0x3e42c0['query'][_0xf752('0x1c')]);}_0x4cb939[_0xf752('0x39')]=qs['sort'](_0x3e42c0['query'][_0xf752('0x3a')]);_0x4cb939['where']=qs[_0xf752('0x3b')](_['pick'](_0x3e42c0['query'],_0x38a56e[_0xf752('0x3b')]),_0x508571);if(_0x3e42c0[_0xf752('0x31')][_0xf752('0x3c')]){_0x4cb939[_0xf752('0x3d')]=_[_0xf752('0x3e')](_0x4cb939[_0xf752('0x3d')],{'$or':_[_0xf752('0x2a')](_0x508571,function(_0x350646){if(_0x350646[_0xf752('0x2e')]!==_0xf752('0x3f')){var _0x33f2ad={};_0x33f2ad[_0x350646['name']]={'$like':'%'+_0x3e42c0[_0xf752('0x31')][_0xf752('0x3c')]+'%'};return _0x33f2ad;}})});}_0x4cb939=_[_0xf752('0x3e')]({},_0x4cb939,_0x3e42c0[_0xf752('0x40')]);var _0x43a9e1={'where':_0x4cb939[_0xf752('0x3d')]};return db[_0xf752('0x2b')]['count'](_0x43a9e1)['then'](function(_0x568012){_0x43a201[_0xf752('0x1b')]=_0x568012;if(_0x3e42c0[_0xf752('0x31')][_0xf752('0x41')]){_0x4cb939[_0xf752('0x42')]=[{'all':!![]}];}return db[_0xf752('0x2b')][_0xf752('0x43')](_0x4cb939);})[_0xf752('0x23')](function(_0x30fcb4){_0x43a201[_0xf752('0x44')]=_0x30fcb4;return _0x43a201;})[_0xf752('0x23')](respondWithFilteredResult(_0x536b67,_0x4cb939))[_0xf752('0x45')](handleError(_0x536b67,null));};exports['show']=function(_0x965641,_0x41d2db){var _0x4b3edd={'raw':!![],'where':{'id':_0x965641[_0xf752('0x46')]['id']}},_0x10db84={};_0x10db84[_0xf752('0x30')]=_[_0xf752('0x32')](db[_0xf752('0x2b')][_0xf752('0x2c')]);_0x10db84[_0xf752('0x31')]=_['keys'](_0x965641[_0xf752('0x31')]);_0x10db84['filters']=_[_0xf752('0x33')](_0x10db84[_0xf752('0x30')],_0x10db84[_0xf752('0x31')]);_0x4b3edd[_0xf752('0x34')]=_[_0xf752('0x33')](_0x10db84[_0xf752('0x30')],qs[_0xf752('0x35')](_0x965641[_0xf752('0x31')]['fields']));_0x4b3edd[_0xf752('0x34')]=_0x4b3edd[_0xf752('0x34')]['length']?_0x4b3edd[_0xf752('0x34')]:_0x10db84[_0xf752('0x30')];if(_0x965641[_0xf752('0x31')][_0xf752('0x41')]){_0x4b3edd['include']=[{'all':!![]}];}_0x4b3edd=_['merge']({},_0x4b3edd,_0x965641[_0xf752('0x40')]);return db['JscriptySessionReport'][_0xf752('0x47')](_0x4b3edd)['then'](handleEntityNotFound(_0x41d2db,null))[_0xf752('0x23')](respondWithResult(_0x41d2db,null))[_0xf752('0x45')](handleError(_0x41d2db,null));};exports['create']=function(_0x1fcaa6,_0x5f15e4){return db[_0xf752('0x2b')][_0xf752('0x48')](_0x1fcaa6[_0xf752('0x49')],{})[_0xf752('0x23')](respondWithResult(_0x5f15e4,0xc9))[_0xf752('0x45')](handleError(_0x5f15e4,null));};exports[_0xf752('0x22')]=function(_0x30c730,_0x4f5094){if(_0x30c730[_0xf752('0x49')]['id']){delete _0x30c730['body']['id'];}return db['JscriptySessionReport'][_0xf752('0x47')]({'where':{'id':_0x30c730[_0xf752('0x46')]['id']}})['then'](handleEntityNotFound(_0x4f5094,null))[_0xf752('0x23')](saveUpdates(_0x30c730[_0xf752('0x49')],null))[_0xf752('0x23')](respondWithResult(_0x4f5094,null))[_0xf752('0x45')](handleError(_0x4f5094,null));};exports[_0xf752('0x24')]=function(_0x32ce39,_0xffa44){return db[_0xf752('0x2b')]['find']({'where':{'id':_0x32ce39[_0xf752('0x46')]['id']}})[_0xf752('0x23')](handleEntityNotFound(_0xffa44,null))[_0xf752('0x23')](removeEntity(_0xffa44,null))[_0xf752('0x45')](handleError(_0xffa44,null));};exports[_0xf752('0x4a')]=function(_0x20b2de,_0x2c0a6a){return db[_0xf752('0x2b')][_0xf752('0x4a')]()[_0xf752('0x23')](respondWithResult(_0x2c0a6a,null))[_0xf752('0x45')](handleError(_0x2c0a6a,null));};exports[_0xf752('0x4b')]=function(_0x488330,_0x31856d,_0x4409fa){var _0x325607={'raw':!![],'where':{}};var _0x22185f={};var _0x53faea={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x488330[_0xf752('0x46')]['id']}})['then'](handleEntityNotFound(_0x31856d,null))[_0xf752('0x23')](function(_0x2d64ae){if(_0x2d64ae){_0x22185f[_0xf752('0x30')]=_['keys'](db['JscriptyQuestionReport'][_0xf752('0x2c')]);_0x22185f[_0xf752('0x31')]=_[_0xf752('0x32')](_0x488330[_0xf752('0x31')]);_0x22185f['filters']=_[_0xf752('0x33')](_0x22185f[_0xf752('0x30')],_0x22185f[_0xf752('0x31')]);_0x325607['attributes']=_['intersection'](_0x22185f[_0xf752('0x30')],qs[_0xf752('0x35')](_0x488330['query']['fields']));_0x325607['attributes']=_0x325607[_0xf752('0x34')][_0xf752('0x36')]?_0x325607[_0xf752('0x34')]:_0x22185f['model'];if(!_0x488330[_0xf752('0x31')][_0xf752('0x37')](_0xf752('0x38'))){_0x325607[_0xf752('0x1d')]=qs[_0xf752('0x1d')](_0x488330['query'][_0xf752('0x1d')]);_0x325607[_0xf752('0x1c')]=qs['offset'](_0x488330[_0xf752('0x31')][_0xf752('0x1c')]);}_0x325607[_0xf752('0x39')]=qs['sort'](_0x488330[_0xf752('0x31')][_0xf752('0x3a')]);_0x325607[_0xf752('0x3d')]=qs['filters'](_['pick'](_0x488330[_0xf752('0x31')],_0x22185f[_0xf752('0x3b')]));_0x325607[_0xf752('0x3d')][_0xf752('0x4c')]=_0x2d64ae['id'];if(_0x488330[_0xf752('0x31')]['filter']){_0x325607[_0xf752('0x3d')]=_[_0xf752('0x3e')](_0x325607[_0xf752('0x3d')],{'$or':_[_0xf752('0x2a')](_0x325607[_0xf752('0x34')],function(_0x289e02){var _0x3905d9={};_0x3905d9[_0x289e02]={'$like':'%'+_0x488330[_0xf752('0x31')][_0xf752('0x3c')]+'%'};return _0x3905d9;})});}_0x325607=_[_0xf752('0x3e')]({},_0x325607,_0x488330[_0xf752('0x40')]);return db[_0xf752('0x4d')]['count']({'where':_0x325607['where']})[_0xf752('0x23')](function(_0x3993e1){_0x53faea[_0xf752('0x1b')]=_0x3993e1;if(_0x488330[_0xf752('0x31')][_0xf752('0x41')]){_0x325607[_0xf752('0x42')]=[{'all':!![]}];}return db[_0xf752('0x4d')][_0xf752('0x43')](_0x325607);})['then'](function(_0x209c2d){_0x53faea[_0xf752('0x44')]=_0x209c2d;return _0x53faea;});}})[_0xf752('0x23')](respondWithFilteredResult(_0x31856d,_0x325607))[_0xf752('0x45')](handleError(_0x31856d,null));};
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js
index 97bf61b..a6f6afa 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 _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
+var _0xcb22=['./jscriptySessionReport.attributes','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x336d54,_0x4cb876){var _0x571a8d=function(_0x3746f6){while(--_0x3746f6){_0x336d54['push'](_0x336d54['shift']());}};_0x571a8d(++_0x4cb876);}(_0xcb22,0xc8));var _0x2cb2=function(_0x232497,_0x1b15a3){_0x232497=_0x232497-0x0;var _0x27e7a8=_0xcb22[_0x232497];return _0x27e7a8;};'use strict';var _=require(_0x2cb2('0x0'));var util=require(_0x2cb2('0x1'));var logger=require(_0x2cb2('0x2'))(_0x2cb2('0x3'));var moment=require(_0x2cb2('0x4'));var BPromise=require(_0x2cb2('0x5'));var rp=require(_0x2cb2('0x6'));var fs=require('fs');var path=require(_0x2cb2('0x7'));var rimraf=require(_0x2cb2('0x8'));var config=require(_0x2cb2('0x9'));var attributes=require(_0x2cb2('0xa'));module['exports']=function(_0x77ae56,_0x3582d7){return _0x77ae56[_0x2cb2('0xb')](_0x2cb2('0xc'),attributes,{'tableName':_0x2cb2('0xd'),'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 e26687c..0a5b754 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 _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
+var _0xccda=['../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x3289fe,_0x30c98a){var _0x27e5bd=function(_0x299ff5){while(--_0x299ff5){_0x3289fe['push'](_0x3289fe['shift']());}};_0x27e5bd(++_0x30c98a);}(_0xccda,0x14f));var _0xaccd=function(_0xfc2644,_0x4a3b13){_0xfc2644=_0xfc2644-0x0;var _0x4873b7=_0xccda[_0xfc2644];return _0x4873b7;};'use strict';var _=require(_0xaccd('0x0'));var util=require('util');var moment=require(_0xaccd('0x1'));var BPromise=require(_0xaccd('0x2'));var rs=require(_0xaccd('0x3'));var fs=require('fs');var Redis=require(_0xaccd('0x4'));var db=require(_0xaccd('0x5'))['db'];var utils=require(_0xaccd('0x6'));var logger=require('../../config/logger')(_0xaccd('0x7'));var config=require('../../config/environment');var jayson=require(_0xaccd('0x8'));var client=jayson['client'][_0xaccd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ff2ff,_0x4ee70,_0xa116de){return new BPromise(function(_0x5c0ec5,_0x3f6fd4){return client['request'](_0x4ff2ff,_0xa116de)[_0xaccd('0xa')](function(_0x1f205d){logger[_0xaccd('0xb')](_0xaccd('0xc'),_0x4ee70,_0xaccd('0xd'));logger[_0xaccd('0xe')](_0xaccd('0xf'),_0x4ee70,'request\x20sent',JSON[_0xaccd('0x10')](_0x1f205d));if(_0x1f205d[_0xaccd('0x11')]){if(_0x1f205d[_0xaccd('0x11')]['code']===0x1f4){logger[_0xaccd('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x4ee70,_0x1f205d[_0xaccd('0x11')][_0xaccd('0x12')]);return _0x3f6fd4(_0x1f205d['error'][_0xaccd('0x12')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x4ee70,_0x1f205d['error'][_0xaccd('0x12')]);return _0x5c0ec5(_0x1f205d[_0xaccd('0x11')][_0xaccd('0x12')]);}else{logger[_0xaccd('0xb')](_0xaccd('0xc'),_0x4ee70,'request\x20sent');_0x5c0ec5(_0x1f205d[_0xaccd('0x13')][_0xaccd('0x12')]);}})['catch'](function(_0x4de380){logger[_0xaccd('0x11')](_0xaccd('0xc'),_0x4ee70,_0x4de380);_0x3f6fd4(_0x4de380);});});}
\ No newline at end of file
diff --git a/server/api/license/index.js b/server/api/license/index.js
index 969680c..b67ebde 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 _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
+var _0x5c41=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./license.controller','get','index','put','/:id','isAuthenticated','update','exports'];(function(_0xdd7a7b,_0x254b3a){var _0x40ca7d=function(_0x4c2744){while(--_0x4c2744){_0xdd7a7b['push'](_0xdd7a7b['shift']());}};_0x40ca7d(++_0x254b3a);}(_0x5c41,0x1ce));var _0x15c4=function(_0x6e822b,_0x287586){_0x6e822b=_0x6e822b-0x0;var _0xf74bd8=_0x5c41[_0x6e822b];return _0xf74bd8;};'use strict';var multer=require('multer');var util=require(_0x15c4('0x0'));var path=require('path');var timeout=require(_0x15c4('0x1'));var express=require(_0x15c4('0x2'));var router=express[_0x15c4('0x3')]();var auth=require(_0x15c4('0x4'));var interaction=require(_0x15c4('0x5'));var config=require('../../config/environment');var controller=require(_0x15c4('0x6'));router[_0x15c4('0x7')]('/',controller[_0x15c4('0x8')]);router[_0x15c4('0x9')](_0x15c4('0xa'),auth[_0x15c4('0xb')](),controller[_0x15c4('0xc')]);module[_0x15c4('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 372415f..a6e7fc0 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 _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
+var _0xf494=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x24c2ac,_0x1d3748){var _0x4db65f=function(_0x1bb4cb){while(--_0x1bb4cb){_0x24c2ac['push'](_0x24c2ac['shift']());}};_0x4db65f(++_0x1d3748);}(_0xf494,0x1c6));var _0x4f49=function(_0x27fa52,_0x347642){_0x27fa52=_0x27fa52-0x0;var _0x332b19=_0xf494[_0x27fa52];return _0x332b19;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'license':{'type':Sequelize[_0x4f49('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x4f49('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x4f49('0x4')],'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 1ac3217..5eacfae 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 _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
+var _0x2cd4=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','error','stack','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','length','merge','options','getLicense','then','catch','body','find','params','get','key','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x41f475,_0x1fcf9a){var _0x4bc0bf=function(_0x53d8c5){while(--_0x53d8c5){_0x41f475['push'](_0x41f475['shift']());}};_0x4bc0bf(++_0x1fcf9a);}(_0x2cd4,0x159));var _0x42cd=function(_0x547add,_0x387042){_0x547add=_0x547add-0x0;var _0x2ed1f3=_0x2cd4[_0x547add];return _0x2ed1f3;};'use strict';var pdf=require(_0x42cd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x42cd('0x1'));var zipdir=require(_0x42cd('0x2'));var jsonpatch=require(_0x42cd('0x3'));var rp=require(_0x42cd('0x4'));var moment=require('moment');var BPromise=require(_0x42cd('0x5'));var Mustache=require(_0x42cd('0x6'));var util=require(_0x42cd('0x7'));var path=require(_0x42cd('0x8'));var sox=require('sox');var csv=require(_0x42cd('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x42cd('0xa'));var jsforce=require(_0x42cd('0xb'));var deskjs=require(_0x42cd('0xc'));var toCsv=require(_0x42cd('0x9'));var querystring=require(_0x42cd('0xd'));var Papa=require(_0x42cd('0xe'));var Redis=require(_0x42cd('0xf'));var authService=require(_0x42cd('0x10'));var qs=require(_0x42cd('0x11'));var as=require(_0x42cd('0x12'));var hardwareService=require(_0x42cd('0x13'));var logger=require(_0x42cd('0x14'))(_0x42cd('0x15'));var utils=require(_0x42cd('0x16'));var config=require('../../config/environment');var db=require(_0x42cd('0x17'))['db'];function respondWithStatusCode(_0x442879,_0x380c73){_0x380c73=_0x380c73||0xcc;return function(_0x1d39e5){if(_0x1d39e5){return _0x442879[_0x42cd('0x18')](_0x380c73);}return _0x442879[_0x42cd('0x19')](_0x380c73)[_0x42cd('0x1a')]();};}function respondWithResult(_0x520df5,_0x50797b){_0x50797b=_0x50797b||0xc8;return function(_0x239111){if(_0x239111){return _0x520df5[_0x42cd('0x19')](_0x50797b)[_0x42cd('0x1b')](_0x239111);}};}function respondWithFilteredResult(_0x1414ab,_0x1e45a6){return function(_0x30b630){if(_0x30b630){var _0xed6b3a=_0x30b630['count'],_0x200c36=_0x1e45a6[_0x42cd('0x1c')],_0x3f721a=_0x1e45a6['offset']+_0x1e45a6[_0x42cd('0x1d')],_0x4ec3c7;if(_0x3f721a>=_0xed6b3a){_0x3f721a=_0xed6b3a;_0x4ec3c7=0xc8;}else{_0x4ec3c7=0xce;}_0x1414ab[_0x42cd('0x19')](_0x4ec3c7);return _0x1414ab[_0x42cd('0x1e')](_0x42cd('0x1f'),_0x200c36+'-'+_0x3f721a+'/'+_0xed6b3a)['json'](_0x30b630);}return null;};}function patchUpdates(_0x233bd6){return function(_0x4e5c3f){try{jsonpatch[_0x42cd('0x20')](_0x4e5c3f,_0x233bd6,!![]);}catch(_0x4ea885){return BPromise[_0x42cd('0x21')](_0x4ea885);}return _0x4e5c3f[_0x42cd('0x22')]();};}function saveUpdates(_0x363c8d,_0x8726ce){return function(_0x21cb2f){if(_0x21cb2f){return _0x21cb2f['update'](_0x363c8d)['then'](function(_0x3a640e){return _0x3a640e;});}return null;};}function removeEntity(_0x1ecf6a,_0x31688e){return function(_0x4d5556){if(_0x4d5556){return _0x4d5556['destroy']()['then'](function(){_0x1ecf6a['status'](0xcc)[_0x42cd('0x1a')]();});}};}function handleEntityNotFound(_0x233a72,_0x56b688){return function(_0x5ef0ea){if(!_0x5ef0ea){_0x233a72['sendStatus'](0x194);}return _0x5ef0ea;};}function handleError(_0x12a284,_0x2ac2a6){_0x2ac2a6=_0x2ac2a6||0x1f4;return function(_0x2d3999){logger[_0x42cd('0x23')](_0x2d3999[_0x42cd('0x24')]);if(_0x2d3999[_0x42cd('0x25')]){delete _0x2d3999[_0x42cd('0x25')];}_0x12a284[_0x42cd('0x19')](_0x2ac2a6)[_0x42cd('0x26')](_0x2d3999);};}var utilLicense=require(_0x42cd('0x27'));exports[_0x42cd('0x28')]=function(_0x509aa3,_0x5cf2f8){var _0x45d9fa={'raw':!![],'where':{'id':0x1}},_0xd30faf={};_0xd30faf[_0x42cd('0x29')]=_[_0x42cd('0x2a')](db[_0x42cd('0x2b')][_0x42cd('0x2c')]);_0xd30faf['query']=_[_0x42cd('0x2a')](_0x509aa3[_0x42cd('0x2d')]);_0xd30faf[_0x42cd('0x2e')]=_[_0x42cd('0x2f')](_0xd30faf[_0x42cd('0x29')],_0xd30faf[_0x42cd('0x2d')]);_0x45d9fa[_0x42cd('0x30')]=_[_0x42cd('0x2f')](_0xd30faf[_0x42cd('0x29')],qs['fields'](_0x509aa3[_0x42cd('0x2d')]['fields']));_0x45d9fa['attributes']=_0x45d9fa[_0x42cd('0x30')][_0x42cd('0x31')]?_0x45d9fa[_0x42cd('0x30')]:_0xd30faf[_0x42cd('0x29')];_0x45d9fa=_[_0x42cd('0x32')]({},_0x45d9fa,_0x509aa3[_0x42cd('0x33')]);return utilLicense[_0x42cd('0x34')](_0x45d9fa)[_0x42cd('0x35')](respondWithResult(_0x5cf2f8,null))[_0x42cd('0x36')](handleError(_0x5cf2f8,null));};exports['update']=function(_0xc78dc6,_0x31b3e0){if(_0xc78dc6[_0x42cd('0x37')]['id']){delete _0xc78dc6[_0x42cd('0x37')]['id'];}return db['License'][_0x42cd('0x38')]({'where':{'id':_0xc78dc6[_0x42cd('0x39')]['id']}})[_0x42cd('0x35')](handleEntityNotFound(_0x31b3e0,null))[_0x42cd('0x35')](function(_0x3f1bd7){var _0x580c17=_0x3f1bd7[_0x42cd('0x3a')]({'plain':!![]});return utilLicense['checkLicense'](_0x580c17,_0xc78dc6['body'][_0x42cd('0x3b')]);})[_0x42cd('0x35')](function(_0x54c3db){if(!_0x54c3db['demo']){return saveUpdates(_0xc78dc6[_0x42cd('0x37')],null);}return _0x54c3db;})[_0x42cd('0x35')](respondWithResult(_0x31b3e0,null))[_0x42cd('0x36')](handleError(_0x31b3e0,null));};
\ No newline at end of file
diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js
index fe847d9..0108152 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 _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
+var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','license','lodash','../../config/logger'];(function(_0x5db313,_0x3c8f0c){var _0x36d503=function(_0x5d1ff6){while(--_0x5d1ff6){_0x5db313['push'](_0x5db313['shift']());}};_0x36d503(++_0x3c8f0c);}(_0xb10b,0x12a));var _0xbb10=function(_0x5515a7,_0x2c4af1){_0x5515a7=_0x5515a7-0x0;var _0x43f4bf=_0xb10b[_0x5515a7];return _0x43f4bf;};'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
diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js
index a8f8596..876809f 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 _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
+var _0x4a1d=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x4c5d3a,_0x42ae15){var _0x3f5227=function(_0x31d9a1){while(--_0x31d9a1){_0x4c5d3a['push'](_0x4c5d3a['shift']());}};_0x3f5227(++_0x42ae15);}(_0x4a1d,0x77));var _0xd4a1=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4a1d[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xd4a1('0x0'));var util=require(_0xd4a1('0x1'));var moment=require(_0xd4a1('0x2'));var BPromise=require(_0xd4a1('0x3'));var rs=require(_0xd4a1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4a1('0x5'))['db'];var utils=require(_0xd4a1('0x6'));var logger=require(_0xd4a1('0x7'))(_0xd4a1('0x8'));var config=require(_0xd4a1('0x9'));var jayson=require(_0xd4a1('0xa'));var client=jayson[_0xd4a1('0xb')][_0xd4a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5cfa45,_0x3140b8,_0x1c2e6f){return new BPromise(function(_0x2b91a6,_0x3a9ecc){return client[_0xd4a1('0xd')](_0x5cfa45,_0x1c2e6f)['then'](function(_0x503a27){logger[_0xd4a1('0xe')](_0xd4a1('0xf'),_0x3140b8,_0xd4a1('0x10'));logger[_0xd4a1('0x11')]('License,\x20%s,\x20%s,\x20%s',_0x3140b8,_0xd4a1('0x10'),JSON[_0xd4a1('0x12')](_0x503a27));if(_0x503a27[_0xd4a1('0x13')]){if(_0x503a27['error'][_0xd4a1('0x14')]===0x1f4){logger[_0xd4a1('0x13')](_0xd4a1('0xf'),_0x3140b8,_0x503a27[_0xd4a1('0x13')]['message']);return _0x3a9ecc(_0x503a27[_0xd4a1('0x13')][_0xd4a1('0x15')]);}logger[_0xd4a1('0x13')]('License,\x20%s,\x20%s',_0x3140b8,_0x503a27[_0xd4a1('0x13')][_0xd4a1('0x15')]);return _0x2b91a6(_0x503a27[_0xd4a1('0x13')][_0xd4a1('0x15')]);}else{logger['info']('License,\x20%s,\x20%s',_0x3140b8,_0xd4a1('0x10'));_0x2b91a6(_0x503a27[_0xd4a1('0x16')][_0xd4a1('0x15')]);}})[_0xd4a1('0x17')](function(_0x212d0c){logger['error'](_0xd4a1('0xf'),_0x3140b8,_0x212d0c);_0x3a9ecc(_0x212d0c);});});}
\ No newline at end of file
diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js
index 7106aa7..ac3676c 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 _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
+var _0x38f8=['removeDispositions','delete','removeAnswers','removeImap','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addAnswer','create','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','put','update'];(function(_0x2c499e,_0x27795d){var _0x32ff6c=function(_0x4459b0){while(--_0x4459b0){_0x2c499e['push'](_0x2c499e['shift']());}};_0x32ff6c(++_0x27795d);}(_0x38f8,0x197));var _0x838f=function(_0x2e1ccf,_0x132102){_0x2e1ccf=_0x2e1ccf-0x0;var _0x3befc6=_0x38f8[_0x2e1ccf];return _0x3befc6;};'use strict';var multer=require(_0x838f('0x0'));var util=require(_0x838f('0x1'));var path=require(_0x838f('0x2'));var timeout=require(_0x838f('0x3'));var express=require(_0x838f('0x4'));var router=express[_0x838f('0x5')]();var auth=require(_0x838f('0x6'));var interaction=require(_0x838f('0x7'));var config=require(_0x838f('0x8'));var controller=require('./mailAccount.controller');router['get']('/',auth[_0x838f('0x9')](),controller[_0x838f('0xa')]);router['get'](_0x838f('0xb'),auth[_0x838f('0x9')](),controller[_0x838f('0xc')]);router[_0x838f('0xd')](_0x838f('0xe'),auth[_0x838f('0x9')](),controller[_0x838f('0xf')]);router[_0x838f('0xd')](_0x838f('0x10'),auth['isAuthenticated'](),controller[_0x838f('0x11')]);router[_0x838f('0xd')]('/:id/canned_answers',auth[_0x838f('0x9')](),controller[_0x838f('0x12')]);router['get'](_0x838f('0x13'),auth[_0x838f('0x9')](),controller[_0x838f('0x14')]);router['get'](_0x838f('0x15'),auth[_0x838f('0x9')](),controller['getSmtp']);router[_0x838f('0xd')]('/:id/interactions',auth[_0x838f('0x9')](),controller[_0x838f('0x16')]);router[_0x838f('0xd')](_0x838f('0x17'),auth[_0x838f('0x9')](),controller[_0x838f('0x18')]);router[_0x838f('0xd')](_0x838f('0x19'),auth[_0x838f('0x9')](),controller[_0x838f('0x1a')]);router[_0x838f('0xd')](_0x838f('0x1b'),auth[_0x838f('0x9')](),controller[_0x838f('0x1c')]);router[_0x838f('0xd')](_0x838f('0x1d'),auth[_0x838f('0x9')](),controller[_0x838f('0x1e')]);router[_0x838f('0x1f')](_0x838f('0x10'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x838f('0x1f')]('/:id/canned_answers',auth[_0x838f('0x9')](),controller[_0x838f('0x20')]);router[_0x838f('0x1f')]('/',auth[_0x838f('0x9')](),controller[_0x838f('0x21')]);router[_0x838f('0x1f')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x838f('0x22')]);router[_0x838f('0x1f')]('/:id/out_servers',auth[_0x838f('0x9')](),controller[_0x838f('0x23')]);router[_0x838f('0x1f')](_0x838f('0x24'),auth[_0x838f('0x9')](),controller[_0x838f('0x25')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x838f('0x26')]);router[_0x838f('0x1f')](_0x838f('0x27'),auth['isAuthenticated'](),controller[_0x838f('0x28')]);router[_0x838f('0x1f')](_0x838f('0x1d'),auth[_0x838f('0x9')](),controller['addAgents']);router[_0x838f('0x29')]('/:id',auth[_0x838f('0x9')](),controller[_0x838f('0x2a')]);router['delete'](_0x838f('0x10'),auth[_0x838f('0x9')](),controller[_0x838f('0x2b')]);router[_0x838f('0x2c')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x838f('0x2d')]);router[_0x838f('0x2c')](_0x838f('0x13'),auth['isAuthenticated'](),controller[_0x838f('0x2e')]);router[_0x838f('0x2c')]('/:id/out_servers',auth[_0x838f('0x9')](),controller['removeSmtp']);router[_0x838f('0x2c')](_0x838f('0xe'),auth[_0x838f('0x9')](),controller[_0x838f('0x2f')]);router[_0x838f('0x2c')](_0x838f('0x1d'),auth[_0x838f('0x9')](),controller[_0x838f('0x30')]);module[_0x838f('0x31')]=router;
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js
index f8b3c6d..241a51d 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 _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
+var _0x1e8b=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}} Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x421b57,_0x4984d0){var _0x1afd30=function(_0x56fdff){while(--_0x56fdff){_0x421b57['push'](_0x421b57['shift']());}};_0x1afd30(++_0x4984d0);}(_0x1e8b,0x14c));var _0xb1e8=function(_0x3cc3e7,_0x14d25b){_0x3cc3e7=_0x3cc3e7-0x0;var _0x481539=_0x1e8b[_0x3cc3e7];return _0x481539;};'use strict';var Sequelize=require(_0xb1e8('0x0'));module['exports']={'description':{'type':Sequelize[_0xb1e8('0x1')]},'name':{'type':Sequelize[_0xb1e8('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xb1e8('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xb1e8('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xb1e8('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xb1e8('0x3')]},'markAsUnread':{'type':Sequelize[_0xb1e8('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xb1e8('0x1')],'allowNull':![],'defaultValue':_0xb1e8('0x4')},'fontSize':{'type':Sequelize[_0xb1e8('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xb1e8('0x3')],'defaultValue':function(){return _0xb1e8('0x6');}},'notificationSound':{'type':Sequelize[_0xb1e8('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb1e8('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb1e8('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb1e8('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb1e8('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb1e8('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb1e8('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb1e8('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb1e8('0x2')],'defaultValue':![],'comment':_0xb1e8('0x7'),'set':function(_0x147168){if(!_0x147168)this[_0xb1e8('0x8')](_0xb1e8('0x9'),null);this['setDataValue'](_0xb1e8('0xa'),_0x147168);}}};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js
index 8ddf9e4..5188e7d 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 _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
+var _0xcbd9=['status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','get','MailAccounts','UserProfileResource','end','sendStatus','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','MailAccount','includeAll','include','findAll','show','params','rawAttributes','find','body','describe','MailAccountId','Disposition','create','getDispositions','findOne','rows','removeDispositions','ids','CannedAnswer','order','ListId','description','isNil','cauthentication','user','cuser','password','cpassword','authentication','host','port','service','pass','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','getImap','addImap','getSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','internal','Tags','tag','addApplications','sequelize','transaction','destroy','bulkCreate','priority','getApplications','MailApplication','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','auth','SendMail','sendMail','List\x20not\x20found','messageId','subject','out','Interaction','verifySmtp','secure','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','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~!@#$%^&-_=+[{]}.','then','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x175a55,_0x4082fd){var _0x167adf=function(_0x18ef07){while(--_0x18ef07){_0x175a55['push'](_0x175a55['shift']());}};_0x167adf(++_0x4082fd);}(_0xcbd9,0x91));var _0x9cbd=function(_0x1c0adf,_0xe1d577){_0x1c0adf=_0x1c0adf-0x0;var _0x40d45e=_0xcbd9[_0x1c0adf];return _0x40d45e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9cbd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9cbd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9cbd('0x2'));var moment=require(_0x9cbd('0x3'));var BPromise=require(_0x9cbd('0x4'));var Mustache=require(_0x9cbd('0x5'));var util=require(_0x9cbd('0x6'));var path=require(_0x9cbd('0x7'));var sox=require(_0x9cbd('0x8'));var csv=require(_0x9cbd('0x9'));var ejs=require(_0x9cbd('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9cbd('0xb'));var crypto=require(_0x9cbd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9cbd('0xd'));var toCsv=require(_0x9cbd('0x9'));var querystring=require(_0x9cbd('0xe'));var Papa=require(_0x9cbd('0xf'));var Redis=require(_0x9cbd('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9cbd('0x11'));var hardwareService=require(_0x9cbd('0x12'));var logger=require(_0x9cbd('0x13'))(_0x9cbd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x9cbd('0x15'))['db'];config[_0x9cbd('0x16')]=_[_0x9cbd('0x17')](config[_0x9cbd('0x16')],{'host':_0x9cbd('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9cbd('0x19')]({'port':0x232b});function checkPasswordPattern(_0x549e71,_0x774c26,_0x1d7a42){if(_0x1d7a42){var _0x5894ff=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5894ff['test'](_0x774c26)){return _0x549e71;}else{throw new db[(_0x9cbd('0x1a'))][(_0x9cbd('0x1b'))](_0x9cbd('0x1c'));}}else{return _0x549e71;}}function respondWithRpcPromise(_0x5c0d88,_0x30971c,_0x2e6501,_0x4b15bb){return new BPromise(function(_0x3cd679,_0x45b291){var _0x31cc8d=_0x4b15bb||client;return _0x31cc8d['request'](_0x5c0d88,_0x2e6501)[_0x9cbd('0x1d')](function(_0x1cafd9){logger[_0x9cbd('0x1e')](_0x9cbd('0x1f'),_0x30971c,'request\x20sent');logger[_0x9cbd('0x20')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x30971c,_0x9cbd('0x21'),JSON[_0x9cbd('0x22')](_0x1cafd9));if(_0x1cafd9[_0x9cbd('0x23')]){if(_0x1cafd9['error'][_0x9cbd('0x24')]===0x1f4){logger['error'](_0x9cbd('0x1f'),_0x30971c,_0x1cafd9[_0x9cbd('0x23')]['message']);return _0x45b291(_0x1cafd9[_0x9cbd('0x23')][_0x9cbd('0x25')]);}logger[_0x9cbd('0x23')](_0x9cbd('0x1f'),_0x30971c,_0x1cafd9[_0x9cbd('0x23')][_0x9cbd('0x25')]);return _0x3cd679(_0x1cafd9[_0x9cbd('0x23')][_0x9cbd('0x25')]);}else{logger['info'](_0x9cbd('0x1f'),_0x30971c,_0x9cbd('0x21'));_0x3cd679(_0x1cafd9[_0x9cbd('0x26')]['message']);}})[_0x9cbd('0x27')](function(_0x14c759){logger[_0x9cbd('0x23')](_0x9cbd('0x1f'),_0x30971c,_0x14c759);_0x45b291(_0x14c759);});});}function respondWithStatusCode(_0x15a932,_0x3a8b6d){_0x3a8b6d=_0x3a8b6d||0xcc;return function(_0x496f34){if(_0x496f34){return _0x15a932['sendStatus'](_0x3a8b6d);}return _0x15a932[_0x9cbd('0x28')](_0x3a8b6d)['end']();};}function respondWithResult(_0x193a0d,_0x351eae){_0x351eae=_0x351eae||0xc8;return function(_0x2b5f43){if(_0x2b5f43){return _0x193a0d[_0x9cbd('0x28')](_0x351eae)[_0x9cbd('0x29')](_0x2b5f43);}};}function respondWithFilteredResult(_0x46e337,_0x1b45be){return function(_0xced4c8){if(_0xced4c8){var _0x441ecc=_0xced4c8[_0x9cbd('0x2a')],_0x3d1a4f=_0x1b45be[_0x9cbd('0x2b')],_0x3987dd=_0x1b45be[_0x9cbd('0x2b')]+_0x1b45be[_0x9cbd('0x2c')],_0xb7c2fb;if(_0x3987dd>=_0x441ecc){_0x3987dd=_0x441ecc;_0xb7c2fb=0xc8;}else{_0xb7c2fb=0xce;}_0x46e337[_0x9cbd('0x28')](_0xb7c2fb);return _0x46e337[_0x9cbd('0x2d')](_0x9cbd('0x2e'),_0x3d1a4f+'-'+_0x3987dd+'/'+_0x441ecc)[_0x9cbd('0x29')](_0xced4c8);}return null;};}function patchUpdates(_0x782d49){return function(_0x1e695f){try{jsonpatch[_0x9cbd('0x2f')](_0x1e695f,_0x782d49,!![]);}catch(_0x238552){return BPromise[_0x9cbd('0x30')](_0x238552);}return _0x1e695f[_0x9cbd('0x31')]();};}function saveUpdates(_0x4e7c4a,_0x382ddd){return function(_0x517178){if(_0x517178){return _0x517178[_0x9cbd('0x32')](_0x4e7c4a)[_0x9cbd('0x1d')](function(_0x4f68c0){return _0x4f68c0;});}return null;};}function removeEntity(_0x3ec1da,_0x4d37cf){return function(_0x4c7e18){if(_0x4c7e18){return _0x4c7e18['destroy']()[_0x9cbd('0x1d')](function(){var _0xa27ac0=_0x4c7e18[_0x9cbd('0x33')]({'plain':!![]});var _0x1c09c0=_0x9cbd('0x34');return db[_0x9cbd('0x35')]['destroy']({'where':{'type':_0x1c09c0,'resourceId':_0xa27ac0['id']}})[_0x9cbd('0x1d')](function(){return _0x4c7e18;});})[_0x9cbd('0x1d')](function(){_0x3ec1da[_0x9cbd('0x28')](0xcc)[_0x9cbd('0x36')]();});}};}function handleEntityNotFound(_0x256ea2,_0x1651c9){return function(_0x3a8cec){if(!_0x3a8cec){_0x256ea2[_0x9cbd('0x37')](0x194);}return _0x3a8cec;};}function handleError(_0x15ee46,_0x4ac7f6){_0x4ac7f6=_0x4ac7f6||0x1f4;return function(_0x17a4d6){logger[_0x9cbd('0x23')](_0x17a4d6[_0x9cbd('0x38')]);if(_0x17a4d6['name']){delete _0x17a4d6[_0x9cbd('0x39')];}_0x15ee46[_0x9cbd('0x28')](_0x4ac7f6)[_0x9cbd('0x3a')](_0x17a4d6);};}exports[_0x9cbd('0x3b')]=function(_0x1c3214,_0x3790ee){var _0x31cefa={'include':[{'model':db[_0x9cbd('0x3c')],'as':_0x9cbd('0x3d')},{'model':db[_0x9cbd('0x3e')],'as':_0x9cbd('0x3f')},{'model':db[_0x9cbd('0x40')],'as':_0x9cbd('0x41')}]},_0x4e13db={},_0x1bbcf5={'count':0x0,'rows':[]};var _0x486020=_[_0x9cbd('0x42')](db['MailAccount']['rawAttributes'],function(_0x3340f6){return{'name':_0x3340f6[_0x9cbd('0x43')],'type':_0x3340f6[_0x9cbd('0x44')][_0x9cbd('0x45')]};});_0x4e13db[_0x9cbd('0x46')]=_[_0x9cbd('0x42')](_0x486020,'name');_0x4e13db[_0x9cbd('0x47')]=_[_0x9cbd('0x48')](_0x1c3214[_0x9cbd('0x47')]);_0x4e13db[_0x9cbd('0x49')]=_['intersection'](_0x4e13db[_0x9cbd('0x46')],_0x4e13db[_0x9cbd('0x47')]);_0x31cefa[_0x9cbd('0x4a')]=_[_0x9cbd('0x4b')](_0x4e13db['model'],qs[_0x9cbd('0x4c')](_0x1c3214[_0x9cbd('0x47')][_0x9cbd('0x4c')]));_0x31cefa[_0x9cbd('0x4a')]=_0x31cefa[_0x9cbd('0x4a')][_0x9cbd('0x4d')]?_0x31cefa[_0x9cbd('0x4a')]:_0x4e13db[_0x9cbd('0x46')];if(!_0x1c3214[_0x9cbd('0x47')][_0x9cbd('0x4e')](_0x9cbd('0x4f'))){_0x31cefa[_0x9cbd('0x2c')]=qs[_0x9cbd('0x2c')](_0x1c3214[_0x9cbd('0x47')]['limit']);_0x31cefa[_0x9cbd('0x2b')]=qs[_0x9cbd('0x2b')](_0x1c3214[_0x9cbd('0x47')]['offset']);}_0x31cefa['order']=qs[_0x9cbd('0x50')](_0x1c3214[_0x9cbd('0x47')][_0x9cbd('0x50')]);_0x31cefa[_0x9cbd('0x51')]=qs[_0x9cbd('0x49')](_[_0x9cbd('0x52')](_0x1c3214['query'],_0x4e13db[_0x9cbd('0x49')]),_0x486020);if(_0x1c3214[_0x9cbd('0x47')][_0x9cbd('0x53')]){_0x31cefa[_0x9cbd('0x51')]=_[_0x9cbd('0x54')](_0x31cefa[_0x9cbd('0x51')],{'$or':_['map'](_0x486020,function(_0x48b13b){if(_0x48b13b['type']!==_0x9cbd('0x55')){var _0x2e120a={};_0x2e120a[_0x48b13b[_0x9cbd('0x39')]]={'$like':'%'+_0x1c3214[_0x9cbd('0x47')][_0x9cbd('0x53')]+'%'};return _0x2e120a;}})});}_0x31cefa=_['merge']({},_0x31cefa,_0x1c3214[_0x9cbd('0x56')]);var _0x1d9a24={'where':_0x31cefa[_0x9cbd('0x51')]};return db[_0x9cbd('0x57')][_0x9cbd('0x2a')](_0x1d9a24)[_0x9cbd('0x1d')](function(_0x479ddc){_0x1bbcf5['count']=_0x479ddc;if(_0x1c3214['query'][_0x9cbd('0x58')]){_0x31cefa[_0x9cbd('0x59')]=[{'all':!![]}];}return db['MailAccount'][_0x9cbd('0x5a')](_0x31cefa);})[_0x9cbd('0x1d')](function(_0x214e9e){_0x1bbcf5['rows']=_0x214e9e;return _0x1bbcf5;})[_0x9cbd('0x1d')](respondWithFilteredResult(_0x3790ee,_0x31cefa))[_0x9cbd('0x27')](handleError(_0x3790ee,null));};exports[_0x9cbd('0x5b')]=function(_0x3e3cc1,_0x21f306){var _0x3283c2={'raw':![],'where':{'id':_0x3e3cc1[_0x9cbd('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x9cbd('0x3d')},{'model':db[_0x9cbd('0x3e')],'as':_0x9cbd('0x3f')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x405199={};_0x405199['model']=_[_0x9cbd('0x48')](db['MailAccount'][_0x9cbd('0x5d')]);_0x405199['query']=_[_0x9cbd('0x48')](_0x3e3cc1['query']);_0x405199[_0x9cbd('0x49')]=_[_0x9cbd('0x4b')](_0x405199[_0x9cbd('0x46')],_0x405199[_0x9cbd('0x47')]);_0x3283c2[_0x9cbd('0x4a')]=_[_0x9cbd('0x4b')](_0x405199[_0x9cbd('0x46')],qs['fields'](_0x3e3cc1[_0x9cbd('0x47')][_0x9cbd('0x4c')]));_0x3283c2[_0x9cbd('0x4a')]=_0x3283c2[_0x9cbd('0x4a')][_0x9cbd('0x4d')]?_0x3283c2[_0x9cbd('0x4a')]:_0x405199['model'];if(_0x3e3cc1['query']['includeAll']){_0x3283c2[_0x9cbd('0x59')]=[{'all':!![]}];}_0x3283c2=_[_0x9cbd('0x54')]({},_0x3283c2,_0x3e3cc1[_0x9cbd('0x56')]);return db[_0x9cbd('0x57')][_0x9cbd('0x5e')](_0x3283c2)[_0x9cbd('0x1d')](handleEntityNotFound(_0x21f306,null))[_0x9cbd('0x1d')](respondWithResult(_0x21f306,null))[_0x9cbd('0x27')](handleError(_0x21f306,null));};exports['update']=function(_0x2b1a87,_0x43bab9){if(_0x2b1a87[_0x9cbd('0x5f')]['id']){delete _0x2b1a87[_0x9cbd('0x5f')]['id'];}return db['MailAccount'][_0x9cbd('0x5e')]({'where':{'id':_0x2b1a87['params']['id']},'include':[{'model':db[_0x9cbd('0x3c')],'as':_0x9cbd('0x3d')},{'model':db[_0x9cbd('0x3e')],'as':_0x9cbd('0x3f')},{'model':db[_0x9cbd('0x40')],'as':_0x9cbd('0x41')}]})[_0x9cbd('0x1d')](handleEntityNotFound(_0x43bab9,null))[_0x9cbd('0x1d')](saveUpdates(_0x2b1a87[_0x9cbd('0x5f')],null))[_0x9cbd('0x1d')](function(_0x4b4615){if(_0x4b4615&&_0x2b1a87[_0x9cbd('0x5f')][_0x9cbd('0x3d')]){return db[_0x9cbd('0x3c')][_0x9cbd('0x32')](_0x2b1a87['body']['Imap'],{'where':{'MailAccountId':_0x4b4615['id']}})[_0x9cbd('0x1d')](function(){return _0x4b4615;});}return _0x4b4615;})[_0x9cbd('0x1d')](function(_0x1691c5){if(_0x1691c5&&_0x2b1a87[_0x9cbd('0x5f')]['Smtp']){return db['MailServerOut'][_0x9cbd('0x32')](_0x2b1a87[_0x9cbd('0x5f')][_0x9cbd('0x3f')],{'where':{'MailAccountId':_0x1691c5['id']}})[_0x9cbd('0x1d')](function(){return _0x1691c5;});}return _0x1691c5;})[_0x9cbd('0x1d')](respondWithResult(_0x43bab9,null))[_0x9cbd('0x27')](handleError(_0x43bab9,null));};exports['describe']=function(_0x19f184,_0x50367f){return db['MailAccount'][_0x9cbd('0x60')]()['then'](respondWithResult(_0x50367f,null))[_0x9cbd('0x27')](handleError(_0x50367f,null));};exports['addDisposition']=function(_0x224c95,_0x5e6459,_0x2b3bb5){if(_0x224c95[_0x9cbd('0x5f')]['id']){delete _0x224c95[_0x9cbd('0x5f')]['id'];}return db['MailAccount'][_0x9cbd('0x5e')]({'where':{'id':_0x224c95[_0x9cbd('0x5c')]['id']}})[_0x9cbd('0x1d')](handleEntityNotFound(_0x5e6459,null))[_0x9cbd('0x1d')](function(_0x9a452b){if(_0x9a452b){_0x224c95['body'][_0x9cbd('0x61')]=_0x9a452b['id'];return db[_0x9cbd('0x62')][_0x9cbd('0x63')](_0x224c95['body']);}})[_0x9cbd('0x1d')](respondWithResult(_0x5e6459,null))[_0x9cbd('0x27')](handleError(_0x5e6459,null));};exports[_0x9cbd('0x64')]=function(_0x58dc9d,_0x15334d,_0x5cf9e0){var _0x424c0b={'raw':![],'where':{}};var _0x2af3be={};var _0x510e02={'count':0x0,'rows':[]};return db[_0x9cbd('0x57')][_0x9cbd('0x65')]({'where':{'id':_0x58dc9d['params']['id']}})['then'](handleEntityNotFound(_0x15334d,null))[_0x9cbd('0x1d')](function(_0x566004){if(_0x566004){_0x2af3be[_0x9cbd('0x46')]=_['keys'](db[_0x9cbd('0x62')][_0x9cbd('0x5d')]);_0x2af3be[_0x9cbd('0x47')]=_[_0x9cbd('0x48')](_0x58dc9d['query']);_0x2af3be[_0x9cbd('0x49')]=_[_0x9cbd('0x4b')](_0x2af3be['model'],_0x2af3be[_0x9cbd('0x47')]);_0x424c0b['attributes']=_['intersection'](_0x2af3be[_0x9cbd('0x46')],qs[_0x9cbd('0x4c')](_0x58dc9d[_0x9cbd('0x47')][_0x9cbd('0x4c')]));_0x424c0b[_0x9cbd('0x4a')]=_0x424c0b[_0x9cbd('0x4a')][_0x9cbd('0x4d')]?_0x424c0b[_0x9cbd('0x4a')]:_0x2af3be[_0x9cbd('0x46')];if(!_0x58dc9d[_0x9cbd('0x47')][_0x9cbd('0x4e')](_0x9cbd('0x4f'))){_0x424c0b[_0x9cbd('0x2c')]=qs[_0x9cbd('0x2c')](_0x58dc9d[_0x9cbd('0x47')]['limit']);_0x424c0b[_0x9cbd('0x2b')]=qs[_0x9cbd('0x2b')](_0x58dc9d['query'][_0x9cbd('0x2b')]);}_0x424c0b['order']=qs[_0x9cbd('0x50')](_0x58dc9d[_0x9cbd('0x47')]['sort']);_0x424c0b['where']=qs[_0x9cbd('0x49')](_[_0x9cbd('0x52')](_0x58dc9d[_0x9cbd('0x47')],_0x2af3be[_0x9cbd('0x49')]));_0x424c0b[_0x9cbd('0x51')][_0x9cbd('0x61')]=_0x566004['id'];if(_0x58dc9d[_0x9cbd('0x47')]['filter']){_0x424c0b[_0x9cbd('0x51')]=_['merge'](_0x424c0b[_0x9cbd('0x51')],{'$or':_['map'](_0x424c0b['attributes'],function(_0xe03f50){var _0x43b6d1={};_0x43b6d1[_0xe03f50]={'$like':'%'+_0x58dc9d[_0x9cbd('0x47')][_0x9cbd('0x53')]+'%'};return _0x43b6d1;})});}_0x424c0b=_[_0x9cbd('0x54')]({},_0x424c0b,_0x58dc9d['options']);return db[_0x9cbd('0x62')][_0x9cbd('0x2a')]({'where':_0x424c0b[_0x9cbd('0x51')]})['then'](function(_0x1a39f4){_0x510e02[_0x9cbd('0x2a')]=_0x1a39f4;if(_0x58dc9d[_0x9cbd('0x47')][_0x9cbd('0x58')]){_0x424c0b[_0x9cbd('0x59')]=[{'all':!![]}];}return db['Disposition'][_0x9cbd('0x5a')](_0x424c0b);})['then'](function(_0x590341){_0x510e02[_0x9cbd('0x66')]=_0x590341;return _0x510e02;});}})['then'](respondWithFilteredResult(_0x15334d,_0x424c0b))[_0x9cbd('0x27')](handleError(_0x15334d,null));};exports['removeDispositions']=function(_0x527307,_0x3a2ccd,_0x3d7ab2){return db['MailAccount'][_0x9cbd('0x5e')]({'where':{'id':_0x527307[_0x9cbd('0x5c')]['id']}})[_0x9cbd('0x1d')](handleEntityNotFound(_0x3a2ccd,null))[_0x9cbd('0x1d')](function(_0x52342a){if(_0x52342a){return _0x52342a[_0x9cbd('0x67')](_0x527307[_0x9cbd('0x47')][_0x9cbd('0x68')]);}})[_0x9cbd('0x1d')](respondWithStatusCode(_0x3a2ccd,null))[_0x9cbd('0x27')](handleError(_0x3a2ccd,null));};exports['addAnswer']=function(_0x35794b,_0x1a88c0,_0x155424){if(_0x35794b[_0x9cbd('0x5f')]['id']){delete _0x35794b[_0x9cbd('0x5f')]['id'];}return db[_0x9cbd('0x57')][_0x9cbd('0x5e')]({'where':{'id':_0x35794b[_0x9cbd('0x5c')]['id']}})[_0x9cbd('0x1d')](handleEntityNotFound(_0x1a88c0,null))[_0x9cbd('0x1d')](function(_0x3a747c){if(_0x3a747c){_0x35794b['body'][_0x9cbd('0x61')]=_0x3a747c['id'];return db[_0x9cbd('0x69')][_0x9cbd('0x63')](_0x35794b[_0x9cbd('0x5f')]);}})['then'](respondWithResult(_0x1a88c0,null))[_0x9cbd('0x27')](handleError(_0x1a88c0,null));};exports['getAnswers']=function(_0x4d30a4,_0x27c998,_0x420017){var _0x3548d6={'raw':![],'where':{}};var _0x494d68={};var _0x41ae98={'count':0x0,'rows':[]};return db[_0x9cbd('0x57')][_0x9cbd('0x65')]({'where':{'id':_0x4d30a4[_0x9cbd('0x5c')]['id']}})[_0x9cbd('0x1d')](handleEntityNotFound(_0x27c998,null))[_0x9cbd('0x1d')](function(_0x58231e){if(_0x58231e){_0x494d68[_0x9cbd('0x46')]=_[_0x9cbd('0x48')](db['CannedAnswer'][_0x9cbd('0x5d')]);_0x494d68[_0x9cbd('0x47')]=_[_0x9cbd('0x48')](_0x4d30a4[_0x9cbd('0x47')]);_0x494d68['filters']=_[_0x9cbd('0x4b')](_0x494d68[_0x9cbd('0x46')],_0x494d68[_0x9cbd('0x47')]);_0x3548d6[_0x9cbd('0x4a')]=_[_0x9cbd('0x4b')](_0x494d68[_0x9cbd('0x46')],qs[_0x9cbd('0x4c')](_0x4d30a4[_0x9cbd('0x47')][_0x9cbd('0x4c')]));_0x3548d6['attributes']=_0x3548d6[_0x9cbd('0x4a')][_0x9cbd('0x4d')]?_0x3548d6['attributes']:_0x494d68['model'];if(!_0x4d30a4[_0x9cbd('0x47')][_0x9cbd('0x4e')]('nolimit')){_0x3548d6[_0x9cbd('0x2c')]=qs[_0x9cbd('0x2c')](_0x4d30a4[_0x9cbd('0x47')][_0x9cbd('0x2c')]);_0x3548d6[_0x9cbd('0x2b')]=qs[_0x9cbd('0x2b')](_0x4d30a4[_0x9cbd('0x47')][_0x9cbd('0x2b')]);}_0x3548d6[_0x9cbd('0x6a')]=qs[_0x9cbd('0x50')](_0x4d30a4['query'][_0x9cbd('0x50')]);_0x3548d6[_0x9cbd('0x51')]=qs['filters'](_[_0x9cbd('0x52')](_0x4d30a4['query'],_0x494d68[_0x9cbd('0x49')]));_0x3548d6['where']['MailAccountId']=_0x58231e['id'];if(_0x4d30a4[_0x9cbd('0x47')][_0x9cbd('0x53')]){_0x3548d6[_0x9cbd('0x51')]=_['merge'](_0x3548d6['where'],{'$or':_[_0x9cbd('0x42')](_0x3548d6[_0x9cbd('0x4a')],function(_0x368320){var _0x37a2b0={};_0x37a2b0[_0x368320]={'$like':'%'+_0x4d30a4[_0x9cbd('0x47')]['filter']+'%'};return _0x37a2b0;})});}_0x3548d6=_[_0x9cbd('0x54')]({},_0x3548d6,_0x4d30a4[_0x9cbd('0x56')]);return db['CannedAnswer'][_0x9cbd('0x2a')]({'where':_0x3548d6[_0x9cbd('0x51')]})[_0x9cbd('0x1d')](function(_0x4e1491){_0x41ae98[_0x9cbd('0x2a')]=_0x4e1491;if(_0x4d30a4[_0x9cbd('0x47')][_0x9cbd('0x58')]){_0x3548d6[_0x9cbd('0x59')]=[{'all':!![]}];}return db[_0x9cbd('0x69')]['findAll'](_0x3548d6);})['then'](function(_0x1586ba){_0x41ae98[_0x9cbd('0x66')]=_0x1586ba;return _0x41ae98;});}})[_0x9cbd('0x1d')](respondWithFilteredResult(_0x27c998,_0x3548d6))[_0x9cbd('0x27')](handleError(_0x27c998,null));};exports['removeAnswers']=function(_0x564fd5,_0xe7c477,_0x257fd0){return db[_0x9cbd('0x57')][_0x9cbd('0x5e')]({'where':{'id':_0x564fd5[_0x9cbd('0x5c')]['id']}})['then'](handleEntityNotFound(_0xe7c477,null))[_0x9cbd('0x1d')](function(_0x3b1c38){if(_0x3b1c38){return _0x3b1c38['removeAnswers'](_0x564fd5[_0x9cbd('0x47')][_0x9cbd('0x68')]);}})[_0x9cbd('0x1d')](respondWithStatusCode(_0xe7c477,null))['catch'](handleError(_0xe7c477,null));};exports[_0x9cbd('0x63')]=function(_0x2b49ff,_0x244eb7){var _0x4cf579={'name':_0x2b49ff[_0x9cbd('0x5f')][_0x9cbd('0x39')],'key':_0x2b49ff[_0x9cbd('0x5f')][_0x9cbd('0x45')],'email':_0x2b49ff[_0x9cbd('0x5f')]['email'],'ListId':_0x2b49ff['body'][_0x9cbd('0x6b')],'active':!_['isNil'](_0x2b49ff[_0x9cbd('0x5f')]['active'])?_0x2b49ff['body']['active']:!![],'description':_0x2b49ff[_0x9cbd('0x5f')][_0x9cbd('0x6c')]||null,'Imap':{},'Smtp':{}};if(_[_0x9cbd('0x6d')](_0x2b49ff[_0x9cbd('0x5f')]['cservice'])){if(_0x2b49ff['body'][_0x9cbd('0x6e')]){_0x4cf579[_0x9cbd('0x3d')][_0x9cbd('0x6f')]=_0x4cf579[_0x9cbd('0x3f')][_0x9cbd('0x6f')]=_0x2b49ff['body'][_0x9cbd('0x70')];_0x4cf579['Imap'][_0x9cbd('0x71')]=_0x4cf579[_0x9cbd('0x3f')]['pass']=_0x2b49ff[_0x9cbd('0x5f')][_0x9cbd('0x72')];}else{_0x4cf579[_0x9cbd('0x3d')][_0x9cbd('0x73')]=_0x4cf579['Smtp']['authentication']=![];}_0x4cf579[_0x9cbd('0x3d')][_0x9cbd('0x74')]=_0x2b49ff[_0x9cbd('0x5f')][_0x9cbd('0x3d')]['host'];_0x4cf579[_0x9cbd('0x3d')]['port']=_0x2b49ff[_0x9cbd('0x5f')]['Imap'][_0x9cbd('0x75')];_0x4cf579[_0x9cbd('0x3f')][_0x9cbd('0x74')]=_0x2b49ff['body'][_0x9cbd('0x3f')]['host'];_0x4cf579['Smtp'][_0x9cbd('0x75')]=_0x2b49ff[_0x9cbd('0x5f')][_0x9cbd('0x3f')]['port'];}else{_0x4cf579[_0x9cbd('0x3d')]['service']=_0x4cf579[_0x9cbd('0x3f')][_0x9cbd('0x76')]=_0x2b49ff[_0x9cbd('0x5f')]['cservice'];_0x4cf579[_0x9cbd('0x3d')][_0x9cbd('0x6f')]=_0x4cf579[_0x9cbd('0x3f')][_0x9cbd('0x6f')]=_0x2b49ff['body'][_0x9cbd('0x70')];_0x4cf579[_0x9cbd('0x3d')][_0x9cbd('0x71')]=_0x4cf579[_0x9cbd('0x3f')][_0x9cbd('0x77')]=_0x2b49ff[_0x9cbd('0x5f')][_0x9cbd('0x72')];}return db[_0x9cbd('0x57')][_0x9cbd('0x63')](_0x4cf579,{'include':[{'model':db[_0x9cbd('0x3e')],'as':'Smtp'},{'model':db[_0x9cbd('0x3c')],'as':_0x9cbd('0x3d')}]})[_0x9cbd('0x1d')](function(_0x5e2def){var _0x305c5e=_0x2b49ff[_0x9cbd('0x6f')][_0x9cbd('0x33')]({'plain':!![]});if(!_0x305c5e)throw new Error(_0x9cbd('0x78'));if(_0x305c5e[_0x9cbd('0x79')]==='user'){var _0x1ef815=_0x5e2def[_0x9cbd('0x33')]({'plain':!![]});return db[_0x9cbd('0x7a')][_0x9cbd('0x5e')]({'where':{'name':_0x9cbd('0x34'),'userProfileId':_0x305c5e[_0x9cbd('0x7b')]},'raw':!![]})[_0x9cbd('0x1d')](function(_0x56577f){if(_0x56577f&&_0x56577f[_0x9cbd('0x7c')]===0x0){return db['UserProfileResource']['create']({'name':_0x1ef815[_0x9cbd('0x39')],'resourceId':_0x1ef815['id'],'type':_0x56577f['name'],'sectionId':_0x56577f['id']},{})[_0x9cbd('0x1d')](function(){return _0x5e2def;});}else{return _0x5e2def;}})[_0x9cbd('0x27')](function(_0x4d99df){logger[_0x9cbd('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d99df);throw _0x4d99df;});}return _0x5e2def;})[_0x9cbd('0x1d')](respondWithResult(_0x244eb7,0xc9))[_0x9cbd('0x27')](handleError(_0x244eb7,null));};exports[_0x9cbd('0x7d')]=function(_0x437851,_0x5e9822,_0x1cd00f){return db[_0x9cbd('0x57')]['findOne']({'where':{'id':_0x437851[_0x9cbd('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5e9822,null))['then'](function(_0x17d804){if(_0x17d804){return _0x17d804[_0x9cbd('0x7d')]();}return null;})[_0x9cbd('0x1d')](respondWithResult(_0x5e9822,null))[_0x9cbd('0x27')](handleError(_0x5e9822,null));};exports[_0x9cbd('0x7e')]=function(_0x35ddf8,_0x157375,_0x3b84cb){if(_0x35ddf8[_0x9cbd('0x5f')]['id']){delete _0x35ddf8[_0x9cbd('0x5f')]['id'];}return db[_0x9cbd('0x57')][_0x9cbd('0x5e')]({'where':{'id':_0x35ddf8[_0x9cbd('0x5c')]['id']}})[_0x9cbd('0x1d')](handleEntityNotFound(_0x157375,null))[_0x9cbd('0x1d')](function(_0x1ccc08){if(_0x1ccc08){_0x35ddf8[_0x9cbd('0x5f')][_0x9cbd('0x61')]=_0x1ccc08['id'];return db[_0x9cbd('0x3c')][_0x9cbd('0x63')](_0x35ddf8[_0x9cbd('0x5f')]);}})[_0x9cbd('0x1d')](respondWithResult(_0x157375,null))['catch'](handleError(_0x157375,null));};exports['removeImap']=function(_0x59978d,_0x3edc9b,_0x44c1de){return db[_0x9cbd('0x57')][_0x9cbd('0x65')]({'where':{'id':_0x59978d[_0x9cbd('0x5c')]['id']}})[_0x9cbd('0x1d')](handleEntityNotFound(_0x3edc9b,null))[_0x9cbd('0x1d')](function(_0x52771b){if(_0x52771b){return _0x52771b['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x3edc9b,null))[_0x9cbd('0x27')](handleError(_0x3edc9b,null));};exports[_0x9cbd('0x7f')]=function(_0x4ae61d,_0x1c1f68,_0xed9d54){return db['MailAccount'][_0x9cbd('0x65')]({'where':{'id':_0x4ae61d[_0x9cbd('0x5c')]['id']}})[_0x9cbd('0x1d')](handleEntityNotFound(_0x1c1f68,null))['then'](function(_0x37673d){if(_0x37673d){return _0x37673d['getSmtp']();}return null;})[_0x9cbd('0x1d')](respondWithResult(_0x1c1f68,null))[_0x9cbd('0x27')](handleError(_0x1c1f68,null));};exports['addSmtp']=function(_0x85a8a5,_0xb2723d,_0x361359){if(_0x85a8a5['body']['id']){delete _0x85a8a5[_0x9cbd('0x5f')]['id'];}return db[_0x9cbd('0x57')][_0x9cbd('0x5e')]({'where':{'id':_0x85a8a5[_0x9cbd('0x5c')]['id']}})[_0x9cbd('0x1d')](handleEntityNotFound(_0xb2723d,null))[_0x9cbd('0x1d')](function(_0x568a91){if(_0x568a91){_0x85a8a5[_0x9cbd('0x5f')]['MailAccountId']=_0x568a91['id'];return db[_0x9cbd('0x3e')][_0x9cbd('0x63')](_0x85a8a5[_0x9cbd('0x5f')]);}})[_0x9cbd('0x1d')](respondWithResult(_0xb2723d,null))[_0x9cbd('0x27')](handleError(_0xb2723d,null));};exports['removeSmtp']=function(_0x2e3b08,_0x1883c3,_0x818ab9){return db['MailAccount'][_0x9cbd('0x65')]({'where':{'id':_0x2e3b08[_0x9cbd('0x5c')]['id']}})[_0x9cbd('0x1d')](handleEntityNotFound(_0x1883c3,null))[_0x9cbd('0x1d')](function(_0x4f325c){if(_0x4f325c){return _0x4f325c[_0x9cbd('0x80')](null);}return null;})[_0x9cbd('0x1d')](respondWithStatusCode(_0x1883c3,null))[_0x9cbd('0x27')](handleError(_0x1883c3,null));};exports[_0x9cbd('0x81')]=function(_0x233d13,_0x4ea0ce,_0x3c1770){return db['MailInteraction'][_0x9cbd('0x5e')]({'where':{'id':_0x233d13[_0x9cbd('0x5c')]['id']}})[_0x9cbd('0x1d')](handleEntityNotFound(_0x4ea0ce,null))[_0x9cbd('0x1d')](function(_0x4d1e14){if(_0x4d1e14){return _0x4d1e14[_0x9cbd('0x81')](_0x233d13[_0x9cbd('0x5f')][_0x9cbd('0x68')],_[_0x9cbd('0x82')](_0x233d13[_0x9cbd('0x5f')],[_0x9cbd('0x68'),'id'])||{});}})[_0x9cbd('0x1d')](respondWithResult(_0x4ea0ce,null))['catch'](handleError(_0x4ea0ce,null));};exports[_0x9cbd('0x83')]=function(_0x5364f2,_0xe5fde3,_0xc8c579){var _0x31151d={'raw':![],'where':{}};var _0x25d02c={};var _0x55ffc6={'count':0x0,'rows':[]};return db[_0x9cbd('0x57')]['findOne']({'where':{'id':_0x5364f2[_0x9cbd('0x5c')]['id']}})['then'](handleEntityNotFound(_0xe5fde3,null))[_0x9cbd('0x1d')](function(_0x5acd3d){if(_0x5acd3d){_0x25d02c[_0x9cbd('0x46')]=_[_0x9cbd('0x48')](db[_0x9cbd('0x84')][_0x9cbd('0x5d')]);_0x25d02c[_0x9cbd('0x47')]=_[_0x9cbd('0x48')](_0x5364f2[_0x9cbd('0x47')]);_0x25d02c[_0x9cbd('0x49')]=_['intersection'](_0x25d02c[_0x9cbd('0x46')],_0x25d02c['query']);_0x31151d[_0x9cbd('0x4a')]=_['intersection'](_0x25d02c[_0x9cbd('0x46')],qs[_0x9cbd('0x4c')](_0x5364f2[_0x9cbd('0x47')][_0x9cbd('0x4c')]));_0x31151d['attributes']=_0x31151d['attributes'][_0x9cbd('0x4d')]?_0x31151d[_0x9cbd('0x4a')]:_0x25d02c[_0x9cbd('0x46')];if(!_0x5364f2['query'][_0x9cbd('0x4e')]('nolimit')){_0x31151d[_0x9cbd('0x2c')]=qs[_0x9cbd('0x2c')](_0x5364f2[_0x9cbd('0x47')][_0x9cbd('0x2c')]);_0x31151d[_0x9cbd('0x2b')]=qs['offset'](_0x5364f2[_0x9cbd('0x47')][_0x9cbd('0x2b')]);}_0x31151d[_0x9cbd('0x6a')]=qs[_0x9cbd('0x50')](_0x5364f2['query'][_0x9cbd('0x50')]);_0x31151d['where']=qs[_0x9cbd('0x49')](_[_0x9cbd('0x52')](_0x5364f2[_0x9cbd('0x47')],_0x25d02c['filters']));_0x31151d[_0x9cbd('0x51')][_0x9cbd('0x61')]=_0x5acd3d['id'];if(_0x5364f2[_0x9cbd('0x47')]['filter']){_0x31151d[_0x9cbd('0x51')]=_[_0x9cbd('0x54')](_0x31151d['where'],{'$or':_[_0x9cbd('0x42')](_0x31151d[_0x9cbd('0x4a')],function(_0x26cc6e){var _0x1f5773={};_0x1f5773[_0x26cc6e]={'$like':'%'+_0x5364f2['query'][_0x9cbd('0x53')]+'%'};return _0x1f5773;})});}_0x31151d=_[_0x9cbd('0x54')]({},_0x31151d,_0x5364f2[_0x9cbd('0x56')]);return db[_0x9cbd('0x84')][_0x9cbd('0x2a')]({'where':_0x31151d[_0x9cbd('0x51')]})['then'](function(_0x65878a){_0x55ffc6[_0x9cbd('0x2a')]=_0x65878a;if(_0x5364f2['query'][_0x9cbd('0x58')]){_0x31151d[_0x9cbd('0x59')]=[{'model':db[_0x9cbd('0x85')],'as':_0x9cbd('0x86'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x9cbd('0x39'),'fullname',_0x9cbd('0x87')],'required':![]},{'model':db['Tag'],'as':_0x9cbd('0x88'),'attributes':['id',_0x9cbd('0x39'),'color'],'where':_0x5364f2[_0x9cbd('0x47')][_0x9cbd('0x89')]?{'id':_0x5364f2[_0x9cbd('0x47')][_0x9cbd('0x89')]}:undefined,'required':_0x5364f2[_0x9cbd('0x47')]['tag']?!![]:![]}];}return db[_0x9cbd('0x84')]['findAll'](_0x31151d);})[_0x9cbd('0x1d')](function(_0x541138){_0x55ffc6[_0x9cbd('0x66')]=_0x541138;return _0x55ffc6;});}})[_0x9cbd('0x1d')](respondWithFilteredResult(_0xe5fde3,_0x31151d))['catch'](handleError(_0xe5fde3,null));};exports[_0x9cbd('0x8a')]=function(_0x5257ff,_0x1fa95b,_0x48fcd8){return db[_0x9cbd('0x57')][_0x9cbd('0x65')]({'where':{'id':_0x5257ff['params']['id']}})[_0x9cbd('0x1d')](handleEntityNotFound(_0x1fa95b,null))['then'](function(_0x46041c){if(_0x46041c){return db[_0x9cbd('0x8b')][_0x9cbd('0x8c')](function(_0x448974){return db['MailApplication'][_0x9cbd('0x8d')]({'where':{'MailAccountId':_0x5257ff[_0x9cbd('0x5c')]['id']},'transaction':_0x448974})[_0x9cbd('0x1d')](function(_0x41b0e8){var _0x4ade61=_[_0x9cbd('0x42')](_0x5257ff[_0x9cbd('0x5f')],function(_0xab7d42){_0xab7d42['MailAccountId']=_0x5257ff[_0x9cbd('0x5c')]['id'];return _0xab7d42;});return db['MailApplication'][_0x9cbd('0x8e')](_0x4ade61,{'transaction':_0x448974});});})[_0x9cbd('0x1d')](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x5257ff['params']['id']},'order':_0x9cbd('0x8f')});});}})[_0x9cbd('0x1d')](respondWithResult(_0x1fa95b,null))[_0x9cbd('0x27')](handleError(_0x1fa95b,null));};exports[_0x9cbd('0x90')]=function(_0x4c20d9,_0x5d635c,_0x3077e3){var _0x214279={};var _0x583b10={};var _0x38ff07;var _0x20f191;return db[_0x9cbd('0x57')][_0x9cbd('0x65')]({'where':{'id':_0x4c20d9[_0x9cbd('0x5c')]['id']}})[_0x9cbd('0x1d')](handleEntityNotFound(_0x5d635c,null))[_0x9cbd('0x1d')](function(_0x451b10){if(_0x451b10){_0x38ff07=_0x451b10;_0x583b10[_0x9cbd('0x46')]=_[_0x9cbd('0x48')](db[_0x9cbd('0x91')][_0x9cbd('0x5d')]);_0x583b10[_0x9cbd('0x47')]=_['keys'](_0x4c20d9[_0x9cbd('0x47')]);_0x583b10[_0x9cbd('0x49')]=_[_0x9cbd('0x4b')](_0x583b10[_0x9cbd('0x46')],_0x583b10[_0x9cbd('0x47')]);_0x214279[_0x9cbd('0x4a')]=_[_0x9cbd('0x4b')](_0x583b10['model'],qs[_0x9cbd('0x4c')](_0x4c20d9[_0x9cbd('0x47')][_0x9cbd('0x4c')]));_0x214279[_0x9cbd('0x4a')]=_0x214279[_0x9cbd('0x4a')]['length']?_0x214279[_0x9cbd('0x4a')]:_0x583b10['model'];_0x214279[_0x9cbd('0x6a')]=qs[_0x9cbd('0x50')](_0x4c20d9[_0x9cbd('0x47')][_0x9cbd('0x50')]);_0x214279[_0x9cbd('0x51')]=qs[_0x9cbd('0x49')](_['pick'](_0x4c20d9[_0x9cbd('0x47')],_0x583b10[_0x9cbd('0x49')]));if(_0x4c20d9[_0x9cbd('0x47')][_0x9cbd('0x53')]){_0x214279[_0x9cbd('0x51')]=_[_0x9cbd('0x54')](_0x214279[_0x9cbd('0x51')],{'$or':_[_0x9cbd('0x42')](_0x214279[_0x9cbd('0x4a')],function(_0x47d4ad){var _0x690276={};_0x690276[_0x47d4ad]={'$like':'%'+_0x4c20d9[_0x9cbd('0x47')][_0x9cbd('0x53')]+'%'};return _0x690276;})});}_0x214279=_[_0x9cbd('0x54')]({},_0x214279,_0x4c20d9[_0x9cbd('0x56')]);return _0x38ff07['getApplications'](_0x214279);}})['then'](function(_0x5db5ed){if(_0x5db5ed){_0x20f191=_0x5db5ed['length'];if(!_0x4c20d9[_0x9cbd('0x47')][_0x9cbd('0x4e')](_0x9cbd('0x4f'))){_0x214279[_0x9cbd('0x2c')]=qs['limit'](_0x4c20d9[_0x9cbd('0x47')][_0x9cbd('0x2c')]);_0x214279[_0x9cbd('0x2b')]=qs['offset'](_0x4c20d9[_0x9cbd('0x47')]['offset']);}return _0x38ff07[_0x9cbd('0x90')](_0x214279);}})[_0x9cbd('0x1d')](function(_0x1aed30){if(_0x1aed30){return _0x1aed30?{'count':_0x20f191,'rows':_0x1aed30}:null;}})[_0x9cbd('0x1d')](respondWithResult(_0x5d635c,null))[_0x9cbd('0x27')](handleError(_0x5d635c,null));};exports['getMessages']=function(_0x2d1594,_0x51f503,_0x783a79){var _0xa9ce7d={'raw':!![],'where':{}};var _0x13f5f6={};var _0x1c816c={'count':0x0,'rows':[]};return db[_0x9cbd('0x57')][_0x9cbd('0x65')]({'where':{'id':_0x2d1594[_0x9cbd('0x5c')]['id']}})[_0x9cbd('0x1d')](handleEntityNotFound(_0x51f503,null))['then'](function(_0x221334){if(_0x221334){_0x13f5f6[_0x9cbd('0x46')]=_['keys'](db[_0x9cbd('0x92')][_0x9cbd('0x5d')]);_0x13f5f6[_0x9cbd('0x47')]=_[_0x9cbd('0x48')](_0x2d1594['query']);_0x13f5f6[_0x9cbd('0x49')]=_[_0x9cbd('0x4b')](_0x13f5f6[_0x9cbd('0x46')],_0x13f5f6[_0x9cbd('0x47')]);_0xa9ce7d[_0x9cbd('0x4a')]=_[_0x9cbd('0x4b')](_0x13f5f6[_0x9cbd('0x46')],qs[_0x9cbd('0x4c')](_0x2d1594[_0x9cbd('0x47')][_0x9cbd('0x4c')]));_0xa9ce7d['attributes']=_0xa9ce7d[_0x9cbd('0x4a')]['length']?_0xa9ce7d[_0x9cbd('0x4a')]:_0x13f5f6[_0x9cbd('0x46')];if(!_0x2d1594[_0x9cbd('0x47')][_0x9cbd('0x4e')](_0x9cbd('0x4f'))){_0xa9ce7d['limit']=qs[_0x9cbd('0x2c')](_0x2d1594[_0x9cbd('0x47')][_0x9cbd('0x2c')]);_0xa9ce7d[_0x9cbd('0x2b')]=qs[_0x9cbd('0x2b')](_0x2d1594[_0x9cbd('0x47')][_0x9cbd('0x2b')]);}_0xa9ce7d[_0x9cbd('0x6a')]=qs[_0x9cbd('0x50')](_0x2d1594[_0x9cbd('0x47')][_0x9cbd('0x50')]);_0xa9ce7d[_0x9cbd('0x51')]=qs[_0x9cbd('0x49')](_['pick'](_0x2d1594[_0x9cbd('0x47')],_0x13f5f6[_0x9cbd('0x49')]));_0xa9ce7d[_0x9cbd('0x51')][_0x9cbd('0x61')]=_0x221334['id'];if(_0x2d1594['query'][_0x9cbd('0x53')]){_0xa9ce7d[_0x9cbd('0x51')]=_[_0x9cbd('0x54')](_0xa9ce7d[_0x9cbd('0x51')],{'$or':_[_0x9cbd('0x42')](_0xa9ce7d[_0x9cbd('0x4a')],function(_0x2f9230){var _0x193bc2={};_0x193bc2[_0x2f9230]={'$like':'%'+_0x2d1594[_0x9cbd('0x47')][_0x9cbd('0x53')]+'%'};return _0x193bc2;})});}if(_0x2d1594[_0x9cbd('0x47')][_0x9cbd('0x93')]){var _0x1c0c82=_0x2d1594[_0x9cbd('0x47')][_0x9cbd('0x93')][_0x9cbd('0x94')](',');var _0x515651={};_0x515651[_0x1c0c82[0x0]]={'$gte':moment(_0x1c0c82[0x1])[_0x9cbd('0x95')](_0x9cbd('0x96'))};_0xa9ce7d['where']=_[_0x9cbd('0x54')](_0xa9ce7d[_0x9cbd('0x51')],_0x515651);}_0xa9ce7d=_['merge']({},_0xa9ce7d,_0x2d1594[_0x9cbd('0x56')]);return db[_0x9cbd('0x92')][_0x9cbd('0x2a')]({'where':_0xa9ce7d['where']})[_0x9cbd('0x1d')](function(_0x32e0e6){_0x1c816c[_0x9cbd('0x2a')]=_0x32e0e6;if(_0x2d1594[_0x9cbd('0x47')][_0x9cbd('0x58')]){_0xa9ce7d['include']=[{'all':!![]}];}return db[_0x9cbd('0x92')][_0x9cbd('0x5a')](_0xa9ce7d);})[_0x9cbd('0x1d')](function(_0xfa16d){_0x1c816c[_0x9cbd('0x66')]=_0xfa16d;return _0x1c816c;});}})['then'](respondWithFilteredResult(_0x51f503,_0xa9ce7d))['catch'](handleError(_0x51f503,null));};exports[_0x9cbd('0x3a')]=function(_0x3f1846,_0x33519c,_0x30fb4d){var _0x1703c8,_0x46ebbb={},_0x3673ea;if(_0x3f1846[_0x9cbd('0x5f')]['to']){_0x3673ea=_0x3f1846[_0x9cbd('0x5f')]['to'][_0x9cbd('0x94')](',')[0x0];}return db['MailAccount'][_0x9cbd('0x5e')]({'where':{'id':_0x3f1846[_0x9cbd('0x5c')]['id']},'include':[{'model':db[_0x9cbd('0x97')],'as':_0x9cbd('0x98'),'include':[{'model':db[_0x9cbd('0x85')],'as':_0x9cbd('0x99'),'where':{'email':_0x3673ea},'limit':0x1,'order':[[_0x9cbd('0x9a'),_0x9cbd('0x9b')]]}]},{'model':db[_0x9cbd('0x3e')],'as':_0x9cbd('0x3f'),'raw':!![]}]})[_0x9cbd('0x1d')](handleEntityNotFound(_0x33519c,null))[_0x9cbd('0x1d')](function(_0x263a95){if(_0x263a95){_0x1703c8=_0x263a95;if(_0x263a95[_0x9cbd('0x3f')]){if(_[_0x9cbd('0x6d')](_0x3f1846[_0x9cbd('0x5f')][_0x9cbd('0x9c')])){_0x3f1846[_0x9cbd('0x5f')][_0x9cbd('0x9c')]=util['format'](_0x9cbd('0x9d'),_0x263a95[_0x9cbd('0x39')],_0x263a95[_0x9cbd('0x9e')]||_0x263a95[_0x9cbd('0x3f')][_0x9cbd('0x6f')]);}if(_0x3f1846['body'][_0x9cbd('0x9f')]&&_0x3f1846[_0x9cbd('0x5f')][_0x9cbd('0x9f')]['length']){for(var _0x5cb454=0x0;_0x5cb454<_0x3f1846[_0x9cbd('0x5f')][_0x9cbd('0x9f')][_0x9cbd('0x4d')];_0x5cb454+=0x1){_0x3f1846[_0x9cbd('0x5f')][_0x9cbd('0x9f')][_0x5cb454]={'filename':_0x3f1846['body']['attachments'][_0x5cb454][_0x9cbd('0x39')],'path':path[_0x9cbd('0xa0')](config[_0x9cbd('0xa1')],_0x9cbd('0xa2'),_0x3f1846['body'][_0x9cbd('0x9f')][_0x5cb454][_0x9cbd('0xa3')])};}}var _0x1ddc97={'tls':{'rejectUnauthorized':![]}};if(_[_0x9cbd('0x6d')](_0x263a95['Smtp']['service'])){if(_0x263a95[_0x9cbd('0x3f')][_0x9cbd('0x73')]){_0x1ddc97[_0x9cbd('0xa4')]={'user':_0x263a95[_0x9cbd('0x3f')][_0x9cbd('0x6f')],'pass':_0x263a95[_0x9cbd('0x3f')]['pass']};}_0x1ddc97[_0x9cbd('0x74')]=_0x263a95[_0x9cbd('0x3f')][_0x9cbd('0x74')];_0x1ddc97[_0x9cbd('0x75')]=_0x263a95[_0x9cbd('0x3f')]['port'];_0x1ddc97['secure']=_0x263a95[_0x9cbd('0x3f')]['secure'];}else{_0x1ddc97[_0x9cbd('0x76')]=_0x263a95[_0x9cbd('0x3f')][_0x9cbd('0x76')];_0x1ddc97[_0x9cbd('0xa4')]={'user':_0x263a95[_0x9cbd('0x3f')][_0x9cbd('0x6f')],'pass':_0x263a95[_0x9cbd('0x3f')][_0x9cbd('0x77')]};}return respondWithRpcPromise(_0x9cbd('0xa5'),_0x9cbd('0xa6'),{'account':_0x1ddc97,'message':_0x3f1846[_0x9cbd('0x5f')]});}else{throw new Error('List\x20not\x20found');}}})[_0x9cbd('0x1d')](function(_0x15b9b8){if(_0x15b9b8){_0x46ebbb=_0x15b9b8;if(_0x1703c8[_0x9cbd('0x98')]){if(_0x1703c8[_0x9cbd('0x98')][_0x9cbd('0x99')][_0x9cbd('0x4d')]){return _0x1703c8['List'][_0x9cbd('0x99')][0x0];}else{return db[_0x9cbd('0x85')][_0x9cbd('0x63')](_[_0x9cbd('0x17')](_0x3f1846[_0x9cbd('0x5f')],{'firstName':_0x3f1846[_0x9cbd('0x5f')]['to'],'email':_0x3f1846[_0x9cbd('0x5f')]['to'],'phone':_0x3f1846[_0x9cbd('0x5f')]['to'],'ListId':_0x1703c8[_0x9cbd('0x6b')]}));}}else{throw new Error(_0x9cbd('0xa7'));}}})[_0x9cbd('0x1d')](function(_0x141f50){if(_0x141f50){var _0x451f19={'UserId':_0x3f1846[_0x9cbd('0x6f')]['id'],'ContactId':_0x141f50['id'],'MailAccountId':_0x1703c8['id'],'inReplyTo':_0x46ebbb[_0x9cbd('0xa8')],'to':_0x3f1846[_0x9cbd('0x5f')][_0x9cbd('0x9c')],'cc':_0x3f1846[_0x9cbd('0x5f')]['cc'],'subject':_0x3f1846['body'][_0x9cbd('0xa9')],'attach':_0x3f1846[_0x9cbd('0x5f')]['attach'],'firstMsgDirection':_0x9cbd('0xaa'),'lastMsgAt':moment()[_0x9cbd('0x95')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x9cbd('0xaa'),'lastMsgBody':_0x3f1846[_0x9cbd('0x5f')][_0x9cbd('0x5f')],'Messages':[_[_0x9cbd('0x54')](_0x3f1846[_0x9cbd('0x5f')],{'messageId':_0x46ebbb[_0x9cbd('0xa8')],'sentAt':moment()[_0x9cbd('0x95')](_0x9cbd('0x96')),'read':!![],'MailAccountId':_0x1703c8['id'],'UserId':_0x3f1846[_0x9cbd('0x6f')]['id'],'ContactId':_0x141f50['id']})]};if(_0x3f1846[_0x9cbd('0x5f')][_0x9cbd('0xab')]){_0x451f19=_[_0x9cbd('0x54')](_0x451f19,_0x3f1846['body'][_0x9cbd('0xab')]);}return db[_0x9cbd('0x84')]['create'](_0x451f19,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})[_0x9cbd('0x1d')](respondWithResult(_0x33519c,null))[_0x9cbd('0x27')](handleError(_0x33519c,null));};exports[_0x9cbd('0xac')]=function(_0x51b23b,_0x443f59,_0x28af1e){return db[_0x9cbd('0x57')]['find']({'where':{'id':_0x51b23b[_0x9cbd('0x5c')]['id']},'include':[{'model':db[_0x9cbd('0x3e')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x443f59,null))[_0x9cbd('0x1d')](function(_0x35d68a){if(_0x35d68a&&_0x35d68a[_0x9cbd('0x3f')]){var _0x5aca2a={'id':_0x35d68a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x35d68a[_0x9cbd('0x3f')]['service']){_0x5aca2a['service']=_0x35d68a[_0x9cbd('0x3f')][_0x9cbd('0x76')];}else{_0x5aca2a['host']=_0x35d68a[_0x9cbd('0x3f')]['host'];_0x5aca2a[_0x9cbd('0x75')]=_0x35d68a[_0x9cbd('0x3f')][_0x9cbd('0x75')];_0x5aca2a[_0x9cbd('0xad')]=_0x35d68a['Smtp'][_0x9cbd('0xad')];}if(_0x35d68a[_0x9cbd('0x3f')][_0x9cbd('0x73')]){_0x5aca2a[_0x9cbd('0xa4')]={'user':_0x35d68a[_0x9cbd('0x3f')][_0x9cbd('0x6f')],'pass':_0x35d68a[_0x9cbd('0x3f')][_0x9cbd('0x77')]};}return respondWithRpcPromise(_0x9cbd('0xae'),_0x9cbd('0xac'),{'account':_0x5aca2a});}})[_0x9cbd('0x1d')](respondWithResult(_0x443f59,null))[_0x9cbd('0x27')](handleError(_0x443f59,null));};exports[_0x9cbd('0x8d')]=function(_0x40fcc1,_0x2de9d4){return db[_0x9cbd('0x57')]['find']({'where':{'id':_0x40fcc1[_0x9cbd('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2de9d4,null))[_0x9cbd('0x1d')](function(_0x13f5b7){if(_0x13f5b7&&_0x13f5b7[_0x9cbd('0x76')]){throw new db[(_0x9cbd('0x1a'))][(_0x9cbd('0x1b'))](_0x9cbd('0xaf'));}return _0x13f5b7;})[_0x9cbd('0x1d')](removeEntity(_0x2de9d4,null))[_0x9cbd('0x27')](handleError(_0x2de9d4,null));};exports[_0x9cbd('0xb0')]=function(_0x22160a,_0x365502,_0x2b4e3d){return db[_0x9cbd('0x57')][_0x9cbd('0x5e')]({'where':{'id':_0x22160a['params']['id']}})[_0x9cbd('0x1d')](handleEntityNotFound(_0x365502,null))[_0x9cbd('0x1d')](function(_0x1946a0){if(_0x1946a0){return _0x1946a0[_0x9cbd('0xb0')](_0x22160a['body'][_0x9cbd('0x68')],_[_0x9cbd('0x82')](_0x22160a[_0x9cbd('0x5f')],['ids','id'])||{})[_0x9cbd('0xb1')](function(_0xdb0d36){for(var _0x4e92dd=0x0;_0x4e92dd<_0x22160a[_0x9cbd('0x5f')][_0x9cbd('0x68')][_0x9cbd('0x4d')];_0x4e92dd+=0x1){socket[_0x9cbd('0xb2')](_0x9cbd('0xb3'),{'UserId':_0x22160a['body'][_0x9cbd('0x68')][_0x4e92dd],'MailAccountId':_0x22160a[_0x9cbd('0x5c')]['id']});}return _0xdb0d36;});}})[_0x9cbd('0x1d')](respondWithResult(_0x365502,null))['catch'](handleError(_0x365502,null));};exports['removeAgents']=function(_0x254917,_0x3b44b6,_0x2e6b7e){return db['MailAccount']['find']({'where':{'id':_0x254917['params']['id']}})['then'](handleEntityNotFound(_0x3b44b6,null))[_0x9cbd('0x1d')](function(_0x51dde9){if(_0x51dde9){return _0x51dde9[_0x9cbd('0xb4')](_0x254917[_0x9cbd('0x47')][_0x9cbd('0x68')])[_0x9cbd('0x1d')](function(){if(_[_0x9cbd('0xb5')](_0x254917['query'][_0x9cbd('0x68')])){for(var _0x310cdc=0x0;_0x310cdc<_0x254917[_0x9cbd('0x47')]['ids']['length'];_0x310cdc+=0x1){socket['emit'](_0x9cbd('0xb6'),{'UserId':Number(_0x254917['query'][_0x9cbd('0x68')][_0x310cdc]),'MailAccountId':Number(_0x254917[_0x9cbd('0x5c')]['id'])});}}else{socket['emit'](_0x9cbd('0xb6'),{'UserId':Number(_0x254917[_0x9cbd('0x47')]['ids']),'MailAccountId':Number(_0x254917['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3b44b6,null))['catch'](handleError(_0x3b44b6,null));};exports[_0x9cbd('0xb7')]=function(_0x220894,_0x1106b8,_0x38a337){var _0x165b99={};var _0x37ee75={};var _0x41687b;var _0x50f38b;return db[_0x9cbd('0x57')]['findOne']({'where':{'id':_0x220894[_0x9cbd('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1106b8,null))[_0x9cbd('0x1d')](function(_0x5d9802){if(_0x5d9802){_0x41687b=_0x5d9802;_0x37ee75[_0x9cbd('0x46')]=_['keys'](db[_0x9cbd('0xb8')][_0x9cbd('0x5d')]);_0x37ee75[_0x9cbd('0x47')]=_[_0x9cbd('0x48')](_0x220894[_0x9cbd('0x47')]);_0x37ee75[_0x9cbd('0x49')]=_[_0x9cbd('0x4b')](_0x37ee75['model'],_0x37ee75[_0x9cbd('0x47')]);_0x165b99[_0x9cbd('0x4a')]=_[_0x9cbd('0x4b')](_0x37ee75[_0x9cbd('0x46')],qs[_0x9cbd('0x4c')](_0x220894['query'][_0x9cbd('0x4c')]));_0x165b99['attributes']=_0x165b99['attributes']['length']?_0x165b99[_0x9cbd('0x4a')]:_0x37ee75['model'];_0x165b99[_0x9cbd('0x6a')]=qs[_0x9cbd('0x50')](_0x220894[_0x9cbd('0x47')][_0x9cbd('0x50')]);_0x165b99[_0x9cbd('0x51')]=qs[_0x9cbd('0x49')](_[_0x9cbd('0x52')](_0x220894[_0x9cbd('0x47')],_0x37ee75[_0x9cbd('0x49')]));if(_0x220894[_0x9cbd('0x47')][_0x9cbd('0x53')]){_0x165b99[_0x9cbd('0x51')]=_[_0x9cbd('0x54')](_0x165b99[_0x9cbd('0x51')],{'$or':_[_0x9cbd('0x42')](_0x165b99['attributes'],function(_0x1d173f){var _0x5abc80={};_0x5abc80[_0x1d173f]={'$like':'%'+_0x220894[_0x9cbd('0x47')][_0x9cbd('0x53')]+'%'};return _0x5abc80;})});}_0x165b99=_[_0x9cbd('0x54')]({},_0x165b99,_0x220894['options']);return _0x41687b[_0x9cbd('0xb7')](_0x165b99);}})[_0x9cbd('0x1d')](function(_0x1d233b){if(_0x1d233b){_0x50f38b=_0x1d233b[_0x9cbd('0x4d')];if(!_0x220894['query'][_0x9cbd('0x4e')](_0x9cbd('0x4f'))){_0x165b99['limit']=qs['limit'](_0x220894[_0x9cbd('0x47')][_0x9cbd('0x2c')]);_0x165b99[_0x9cbd('0x2b')]=qs[_0x9cbd('0x2b')](_0x220894[_0x9cbd('0x47')][_0x9cbd('0x2b')]);}return _0x41687b[_0x9cbd('0xb7')](_0x165b99);}})[_0x9cbd('0x1d')](function(_0x522537){if(_0x522537){return _0x522537?{'count':_0x50f38b,'rows':_0x522537}:null;}})['then'](respondWithResult(_0x1106b8,null))[_0x9cbd('0x27')](handleError(_0x1106b8,null));};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js
index 1cceb2a..bcf2934 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 _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
+var _0x7953=['remove','emit','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','update'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0x7953,0x1b4));var _0x3795=function(_0x834bb6,_0x1c5e35){_0x834bb6=_0x834bb6-0x0;var _0xa35d00=_0x7953[_0x834bb6];return _0xa35d00;};'use strict';var EventEmitter=require(_0x3795('0x0'));var MailAccount=require(_0x3795('0x1'))['db'][_0x3795('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3795('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3795('0x4'),'afterDestroy':_0x3795('0x5')};function emitEvent(_0x8dc0c8){return function(_0x3dc39b,_0x2e454d,_0x3ee41d){MailAccountEvents[_0x3795('0x6')](_0x8dc0c8+':'+_0x3dc39b['id'],_0x3dc39b);MailAccountEvents[_0x3795('0x6')](_0x8dc0c8,_0x3dc39b);_0x3ee41d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x3795('0x7')](e,emitEvent(event));}}module[_0x3795('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 1ca8303..8e2bc61 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 _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
+var _0xbe77=['MailAccount','mail_accounts','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailAccount.attributes'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xbe77,0x9c));var _0x7be7=function(_0x174400,_0x3a166e){_0x174400=_0x174400-0x0;var _0x52ef78=_0xbe77[_0x174400];return _0x52ef78;};'use strict';var _=require('lodash');var util=require(_0x7be7('0x0'));var logger=require(_0x7be7('0x1'))(_0x7be7('0x2'));var moment=require(_0x7be7('0x3'));var BPromise=require(_0x7be7('0x4'));var rp=require(_0x7be7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7be7('0x6'));var config=require(_0x7be7('0x7'));var attributes=require(_0x7be7('0x8'));module['exports']=function(_0x205c05,_0xcdd1c4){return _0x205c05['define'](_0x7be7('0x9'),attributes,{'tableName':_0x7be7('0xa'),'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 25584f7..0d150fb 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 _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
+var _0xe5b5=['stringify','error','code','MailAccount,\x20%s,\x20%s','message','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','info','ShowMailAccount','NotifyMailAccount','body','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','MailApplication','Applications','MailServerOut','account','omit','list','applications','orderBy','priority','asc','autoclose','length','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','find','MailMessage','Messages','Contact\x20not\x20found','spread','update','attach','interaction','get','created','attachments','originTo','originCc','Attachment','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5a6983,_0x38627f){var _0x516234=function(_0x22fcdc){while(--_0x22fcdc){_0x5a6983['push'](_0x5a6983['shift']());}};_0x516234(++_0x38627f);}(_0xe5b5,0x12b));var _0x5e5b=function(_0xb6e43,_0x1568fc){_0xb6e43=_0xb6e43-0x0;var _0x47c40f=_0xe5b5[_0xb6e43];return _0x47c40f;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var moment=require(_0x5e5b('0x2'));var BPromise=require(_0x5e5b('0x3'));var rs=require(_0x5e5b('0x4'));var fs=require('fs');var Redis=require(_0x5e5b('0x5'));var db=require(_0x5e5b('0x6'))['db'];var utils=require(_0x5e5b('0x7'));var logger=require(_0x5e5b('0x8'))(_0x5e5b('0x9'));var config=require(_0x5e5b('0xa'));var jayson=require(_0x5e5b('0xb'));var client=jayson[_0x5e5b('0xc')][_0x5e5b('0xd')]({'port':0x232c});config[_0x5e5b('0xe')]=_[_0x5e5b('0xf')](config[_0x5e5b('0xe')],{'host':_0x5e5b('0x10'),'port':0x18eb});var socket=require(_0x5e5b('0x11'))(new Redis(config[_0x5e5b('0xe')]));require(_0x5e5b('0x12'))[_0x5e5b('0x13')](socket);function respondWithRpcPromise(_0x3f8534,_0x492a0e,_0x300890){return new BPromise(function(_0x59112d,_0x108c34){return client[_0x5e5b('0x14')](_0x3f8534,_0x300890)[_0x5e5b('0x15')](function(_0x3f64b6){logger['info']('MailAccount,\x20%s,\x20%s',_0x492a0e,'request\x20sent');logger[_0x5e5b('0x16')](_0x5e5b('0x17'),_0x492a0e,_0x5e5b('0x18'),JSON[_0x5e5b('0x19')](_0x3f64b6));if(_0x3f64b6[_0x5e5b('0x1a')]){if(_0x3f64b6[_0x5e5b('0x1a')][_0x5e5b('0x1b')]===0x1f4){logger['error'](_0x5e5b('0x1c'),_0x492a0e,_0x3f64b6[_0x5e5b('0x1a')]['message']);return _0x108c34(_0x3f64b6[_0x5e5b('0x1a')]['message']);}logger['error'](_0x5e5b('0x1c'),_0x492a0e,_0x3f64b6[_0x5e5b('0x1a')][_0x5e5b('0x1d')]);return _0x59112d(_0x3f64b6['error'][_0x5e5b('0x1d')]);}else{logger['info'](_0x5e5b('0x1c'),_0x492a0e,_0x5e5b('0x18'));_0x59112d(_0x3f64b6['result'][_0x5e5b('0x1d')]);}})[_0x5e5b('0x1e')](function(_0x2281c8){logger['error'](_0x5e5b('0x1c'),_0x492a0e,_0x2281c8);_0x108c34(_0x2281c8);});});}exports[_0x5e5b('0x1f')]=function(_0x490e2b){var _0x2fdc38=this;return new Promise(function(_0x1aa0c2,_0x3c488e){return db[_0x5e5b('0x20')][_0x5e5b('0x21')]({'raw':_0x490e2b[_0x5e5b('0x22')]?_0x490e2b[_0x5e5b('0x22')][_0x5e5b('0x23')]===undefined?!![]:![]:!![],'where':_0x490e2b['options']?_0x490e2b['options'][_0x5e5b('0x24')]||null:null,'attributes':_0x490e2b[_0x5e5b('0x22')]?_0x490e2b[_0x5e5b('0x22')][_0x5e5b('0x25')]||null:null,'limit':_0x490e2b[_0x5e5b('0x22')]?_0x490e2b[_0x5e5b('0x22')][_0x5e5b('0x26')]||null:null,'include':_0x490e2b[_0x5e5b('0x22')]?_0x490e2b[_0x5e5b('0x22')][_0x5e5b('0x27')]?_[_0x5e5b('0x28')](_0x490e2b['options'][_0x5e5b('0x27')],function(_0x75800d){return{'model':db[_0x75800d[_0x5e5b('0x29')]],'as':_0x75800d['as'],'attributes':_0x75800d['attributes'],'include':_0x75800d[_0x5e5b('0x27')]?_[_0x5e5b('0x28')](_0x75800d['include'],function(_0x13ff91){return{'model':db[_0x13ff91[_0x5e5b('0x29')]],'as':_0x13ff91['as'],'attributes':_0x13ff91[_0x5e5b('0x25')],'include':_0x13ff91[_0x5e5b('0x27')]?_[_0x5e5b('0x28')](_0x13ff91[_0x5e5b('0x27')],function(_0x2cb695){return{'model':db[_0x2cb695[_0x5e5b('0x29')]],'as':_0x2cb695['as'],'attributes':_0x2cb695[_0x5e5b('0x25')]};}):[]};}):[]};}):[]:[]})[_0x5e5b('0x15')](function(_0xcb272c){logger[_0x5e5b('0x2a')]('GetMailAccount',_0x490e2b);logger['debug'](_0x5e5b('0x1f'),_0x490e2b,JSON[_0x5e5b('0x19')](_0xcb272c));_0x1aa0c2(_0xcb272c);})[_0x5e5b('0x1e')](function(_0x3dcdab){logger[_0x5e5b('0x1a')]('GetMailAccount',_0x3dcdab[_0x5e5b('0x1d')],_0x490e2b);_0x3c488e(_0x2fdc38['error'](0x1f4,_0x3dcdab[_0x5e5b('0x1d')]));});});};exports[_0x5e5b('0x2b')]=function(_0x11fa95){var _0xc2bc09=this;return new Promise(function(_0x4b9801,_0x22e906){return db[_0x5e5b('0x20')]['find']({'raw':_0x11fa95[_0x5e5b('0x22')]?_0x11fa95[_0x5e5b('0x22')][_0x5e5b('0x23')]===undefined?!![]:![]:!![],'where':_0x11fa95[_0x5e5b('0x22')]?_0x11fa95[_0x5e5b('0x22')][_0x5e5b('0x24')]||null:null,'attributes':_0x11fa95[_0x5e5b('0x22')]?_0x11fa95[_0x5e5b('0x22')]['attributes']||null:null,'include':_0x11fa95[_0x5e5b('0x22')]?_0x11fa95[_0x5e5b('0x22')][_0x5e5b('0x27')]?_[_0x5e5b('0x28')](_0x11fa95[_0x5e5b('0x22')][_0x5e5b('0x27')],function(_0x4fec9e){return{'model':db[_0x4fec9e['model']],'as':_0x4fec9e['as'],'attributes':_0x4fec9e[_0x5e5b('0x25')],'include':_0x4fec9e[_0x5e5b('0x27')]?_[_0x5e5b('0x28')](_0x4fec9e['include'],function(_0x2c23f4){return{'model':db[_0x2c23f4[_0x5e5b('0x29')]],'as':_0x2c23f4['as'],'attributes':_0x2c23f4[_0x5e5b('0x25')],'include':_0x2c23f4[_0x5e5b('0x27')]?_['map'](_0x2c23f4[_0x5e5b('0x27')],function(_0x44c6d2){return{'model':db[_0x44c6d2['model']],'as':_0x44c6d2['as'],'attributes':_0x44c6d2['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e5b('0x15')](function(_0x2c8b04){logger[_0x5e5b('0x2a')]('ShowMailAccount',_0x11fa95);logger[_0x5e5b('0x16')]('ShowMailAccount',_0x11fa95,JSON['stringify'](_0x2c8b04));_0x4b9801(_0x2c8b04);})[_0x5e5b('0x1e')](function(_0x2bcfaa){logger[_0x5e5b('0x1a')](_0x5e5b('0x2b'),_0x2bcfaa[_0x5e5b('0x1d')],_0x11fa95);_0x22e906(_0xc2bc09[_0x5e5b('0x1a')](0x1f4,_0x2bcfaa[_0x5e5b('0x1d')]));});});};exports[_0x5e5b('0x2c')]=function(_0x1034fa){var _0x53b88f=this;return new Promise(function(_0x1f1907,_0xc02f70){var _0x4b0ec9={'body':_0x1034fa[_0x5e5b('0x2d')],'channel':'mail'};var _0x125f95=_[_0x5e5b('0x2e')](_[_0x5e5b('0x2f')](db[_0x5e5b('0x30')][_0x5e5b('0x31')]),[_0x5e5b('0x32'),_0x5e5b('0x33'),_0x5e5b('0x34'),_0x5e5b('0x35')]);var _0x397ba4=![];if(_0x1034fa[_0x5e5b('0x2d')]['id']){delete _0x1034fa['body']['id'];}if(_[_0x5e5b('0x36')](_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x37')])){return _0xc02f70(_0x53b88f['error'](0x1f4,_0x5e5b('0x38')));}if(_[_0x5e5b('0x36')](_0x1034fa['body'][_0x5e5b('0x2d')])||_0x1034fa[_0x5e5b('0x2d')]['body']===''){return _0xc02f70(_0x53b88f[_0x5e5b('0x1a')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x1034fa['body'][_0x5e5b('0x39')])){return _0xc02f70(_0x53b88f['error'](0x1f4,_0x5e5b('0x3a')+_0x125f95));}if(!_['includes'](_0x125f95,_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x39')])){return _0xc02f70(_0x53b88f[_0x5e5b('0x1a')](0x1f4,_0x5e5b('0x3b')+_0x125f95));}var _0x172503={};_0x172503[_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x39')]]=_0x1034fa['body']['from'];return db[_0x5e5b('0x20')]['find']({'where':{'id':_0x1034fa['account']['id']},'include':[{'model':db['CmList'],'as':_0x5e5b('0x3c'),'include':[{'model':db['CmContact'],'as':_0x5e5b('0x3d'),'where':_0x172503,'limit':0x1,'order':[[_0x5e5b('0x33'),_0x5e5b('0x3e')]]}]},{'model':db[_0x5e5b('0x3f')],'as':_0x5e5b('0x40')},{'model':db[_0x5e5b('0x41')],'as':'Smtp'}]})[_0x5e5b('0x15')](function(_0x3ae495){if(_0x3ae495&&_0x3ae495['List']){var _0x4765ab=_0x3ae495['get']({'plain':!![]});_0x4b0ec9[_0x5e5b('0x42')]=_[_0x5e5b('0x43')](_0x4765ab,[_0x5e5b('0x40'),_0x5e5b('0x3c')]);_0x4b0ec9['applications']=_0x4765ab[_0x5e5b('0x40')];_0x4b0ec9[_0x5e5b('0x44')]=_0x4765ab['List'];_0x4b0ec9[_0x5e5b('0x45')]=_[_0x5e5b('0x46')](_0x4b0ec9[_0x5e5b('0x45')],[_0x5e5b('0x47')],[_0x5e5b('0x48')]);if(_0x4b0ec9[_0x5e5b('0x42')]&&_0x4b0ec9['account'][_0x5e5b('0x49')]){_0x4b0ec9[_0x5e5b('0x45')]['push']({'id':0x0,'priority':_0x4b0ec9[_0x5e5b('0x45')][_0x5e5b('0x4a')]+0x1,'app':_0x5e5b('0x4b'),'appdata':'autoclose','interval':_0x5e5b('0x4c')});}if(_0x4b0ec9[_0x5e5b('0x42')][_0x5e5b('0x40')]){delete _0x4b0ec9['account'][_0x5e5b('0x40')];}if(_0x4b0ec9[_0x5e5b('0x42')][_0x5e5b('0x3c')]){delete _0x4b0ec9['account']['List'];}if(_0x4765ab[_0x5e5b('0x3c')]['Contacts']['length']){return _0x4765ab[_0x5e5b('0x3c')][_0x5e5b('0x3d')][0x0];}var _0x4774ee=_['defaults'](_0x1034fa[_0x5e5b('0x2d')],{'firstName':_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x37')],'ListId':_0x4765ab[_0x5e5b('0x35')]});_0x4774ee[_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x39')]]=_0x1034fa['body']['from'];return db[_0x5e5b('0x30')][_0x5e5b('0x4d')](_0x4774ee);}else{throw new Error(_0x5e5b('0x4e'));}})[_0x5e5b('0x15')](function(_0x54542b){_0x4b0ec9[_0x5e5b('0x4f')]=_0x54542b;if(_0x54542b){if(!_0x1034fa['body'][_0x5e5b('0x1d')][_0x5e5b('0x50')]){_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x1d')][_0x5e5b('0x50')]=rs[_0x5e5b('0x51')]()+'\x20'+_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x1d')]['from'];}var _0x3963eb={'ContactId':_0x54542b['id'],'MailAccountId':_0x1034fa[_0x5e5b('0x42')]['id'],'inReplyTo':_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x1d')][_0x5e5b('0x50')],'to':_0x1034fa['body'][_0x5e5b('0x1d')][_0x5e5b('0x37')],'cc':_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x1d')]['cc'],'subject':_0x1034fa[_0x5e5b('0x2d')]['message'][_0x5e5b('0x52')],'attach':_0x1034fa['body'][_0x5e5b('0x1d')]['attach'],'lastMsgAt':moment()[_0x5e5b('0x53')](_0x5e5b('0x54')),'lastMsgDirection':'in','lastMsgBody':_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x2d')]};return db[_0x5e5b('0x55')][_0x5e5b('0x56')]({'where':{'closed':![],'MailAccountId':_0x1034fa['account']['id']},'include':[{'model':db[_0x5e5b('0x57')],'as':_0x5e5b('0x58'),'attributes':[_0x5e5b('0x50')],'where':{'messageId':_0x1034fa[_0x5e5b('0x2d')]['message']['inReplyTo']}}]})[_0x5e5b('0x15')](function(_0x12287f){if(_0x12287f){return[_0x12287f,![]];}return db['MailInteraction'][_0x5e5b('0x4d')](_0x3963eb)[_0x5e5b('0x15')](function(_0x517f76){return[_0x517f76,!![]];});});}else{throw new Error(_0x5e5b('0x59'));}})[_0x5e5b('0x5a')](function(_0x5d2c8f,_0x470658){if(_0x5d2c8f){_0x397ba4=_0x470658;if(!_0x470658){return _0x5d2c8f[_0x5e5b('0x5b')]({'inReplyTo':_0x1034fa['body']['message']['messageId'],'to':_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x1d')][_0x5e5b('0x37')],'cc':_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x1d')]['cc'],'subject':_0x1034fa['body'][_0x5e5b('0x1d')][_0x5e5b('0x52')],'attach':_0x5d2c8f['attach']?_0x5d2c8f[_0x5e5b('0x5c')]:_0x1034fa['body']['message'][_0x5e5b('0x5c')],'substatus':null,'substatusAt':moment()[_0x5e5b('0x53')](_0x5e5b('0x54')),'lastMsgAt':moment()[_0x5e5b('0x53')](_0x5e5b('0x54')),'lastMsgDirection':'in','lastMsgBody':_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x2d')]});}else{return _0x5d2c8f;}}})['then'](function(_0x37146f){_0x4b0ec9[_0x5e5b('0x5d')]=_0x37146f[_0x5e5b('0x5e')]({'plain':!![]});_0x4b0ec9[_0x5e5b('0x5d')][_0x5e5b('0x5f')]=_0x397ba4;return db[_0x5e5b('0x57')][_0x5e5b('0x4d')]({'body':_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x2d')],'MailAccountId':_0x1034fa[_0x5e5b('0x42')]['id'],'MailInteractionId':_0x37146f['id'],'direction':'in','ContactId':_0x4b0ec9[_0x5e5b('0x4f')]['id'],'messageId':_0x1034fa['body'][_0x5e5b('0x1d')][_0x5e5b('0x50')],'from':_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x1d')][_0x5e5b('0x37')],'to':_0x1034fa['body'][_0x5e5b('0x1d')]['to'],'cc':_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x1d')]['cc'],'subject':_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x1d')][_0x5e5b('0x52')],'attach':_0x1034fa['body'][_0x5e5b('0x1d')][_0x5e5b('0x5c')],'Attachments':_0x1034fa[_0x5e5b('0x2d')]['message'][_0x5e5b('0x60')],'originTo':_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x1d')][_0x5e5b('0x61')],'originCc':_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x1d')][_0x5e5b('0x62')],'bcc':_0x1034fa[_0x5e5b('0x2d')][_0x5e5b('0x1d')]['bcc']},{'include':[{'model':db[_0x5e5b('0x63')],'as':'Attachments'}]});})[_0x5e5b('0x15')](function(_0xd054eb){_0x4b0ec9['message']=_0xd054eb;if(_0x4b0ec9['interaction'][_0x5e5b('0x64')]){return db[_0x5e5b('0x65')]['find']({'attributes':['id',_0x5e5b('0x66')],'where':{'id':_0x4b0ec9['interaction']['UserId']}})[_0x5e5b('0x15')](function(_0x5cb712){if(_0x5cb712){_0x4b0ec9[_0x5e5b('0x45')][_0x5e5b('0x67')]({'id':0x0,'priority':0x0,'app':_0x5e5b('0x68'),'appdata':_0x5cb712['name']+','+(_0x4b0ec9[_0x5e5b('0x42')][_0x5e5b('0x69')]||0xa),'interval':_0x5e5b('0x4c')});}return respondWithRpcPromise('Start',_0x5e5b('0x6a'),_0x4b0ec9);});}return respondWithRpcPromise(_0x5e5b('0x6b'),'startRouting',_0x4b0ec9);})[_0x5e5b('0x15')](function(_0x4d28cb){_0x1f1907(_0x4d28cb);})['catch'](function(_0x1e6f7c){_0xc02f70(_0x53b88f[_0x5e5b('0x1a')](0x1f4,_0x1e6f7c[_0x5e5b('0x1d')]));});});};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js
index 3e0494a..8bf8a20 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 _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
+var _0xc906=['register','mailAccount:','./mailAccount.events','save','update','emit','removeListener'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xc906,0x1ad));var _0x6c90=function(_0x4a10dc,_0x18293e){_0x4a10dc=_0x4a10dc-0x0;var _0x5f50a1=_0xc906[_0x4a10dc];return _0x5f50a1;};'use strict';var MailAccountEvents=require(_0x6c90('0x0'));var events=[_0x6c90('0x1'),'remove',_0x6c90('0x2')];function createListener(_0x29fa26,_0xc65efc){return function(_0x52d2ec){_0xc65efc[_0x6c90('0x3')](_0x29fa26,_0x52d2ec);};}function removeListener(_0x237d5d,_0x3bb133){return function(){MailAccountEvents[_0x6c90('0x4')](_0x237d5d,_0x3bb133);};}exports[_0x6c90('0x5')]=function(_0x2b55b8){for(var _0x5491d9=0x0,_0x4c1d85=events['length'];_0x5491d9<_0x4c1d85;_0x5491d9++){var _0x2a960d=events[_0x5491d9];var _0x54d440=createListener(_0x6c90('0x6')+_0x2a960d,_0x2b55b8);MailAccountEvents['on'](_0x2a960d,_0x54d440);}};
\ No newline at end of file
diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js
index c7b805f..03288d3 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 _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
+var _0xbf6e=['get','/:id','isAuthenticated','show','put','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xb0724a,_0x3f3393){var _0x31104c=function(_0x48f309){while(--_0x48f309){_0xb0724a['push'](_0xb0724a['shift']());}};_0x31104c(++_0x3f3393);}(_0xbf6e,0x149));var _0xebf6=function(_0x86b9b,_0x3bee57){_0x86b9b=_0x86b9b-0x0;var _0x42a820=_0xbf6e[_0x86b9b];return _0x42a820;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xebf6('0x0'));var timeout=require(_0xebf6('0x1'));var express=require(_0xebf6('0x2'));var router=express[_0xebf6('0x3')]();var auth=require(_0xebf6('0x4'));var interaction=require(_0xebf6('0x5'));var config=require(_0xebf6('0x6'));var controller=require('./mailApplication.controller');router[_0xebf6('0x7')](_0xebf6('0x8'),auth[_0xebf6('0x9')](),controller[_0xebf6('0xa')]);router[_0xebf6('0xb')](_0xebf6('0x8'),auth[_0xebf6('0x9')](),controller['update']);router[_0xebf6('0xc')](_0xebf6('0x8'),auth[_0xebf6('0x9')](),controller['destroy']);module[_0xebf6('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js
index d5d540f..48d5122 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 _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
+var _0x5e39=['noop','TEXT','*,*,*,*','exports'];(function(_0x176fe6,_0x4c4886){var _0x2b85f5=function(_0x2cba9c){while(--_0x2cba9c){_0x176fe6['push'](_0x176fe6['shift']());}};_0x2b85f5(++_0x4c4886);}(_0x5e39,0x15b));var _0x95e3=function(_0x1a345e,_0x48f11d){_0x1a345e=_0x1a345e-0x0;var _0x505e93=_0x5e39[_0x1a345e];return _0x505e93;};'use strict';var Sequelize=require('sequelize');module[_0x95e3('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x95e3('0x1')},'appdata':{'type':Sequelize[_0x95e3('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x95e3('0x3')}};
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js
index fa5cead..07bae8d 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 _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
+var _0x35c8=['rimraf','zip-dir','fast-json-patch','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','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','update','end','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','attributes','fields','include','merge','find','then','catch','body','destroy','html-pdf','eml-format'];(function(_0x39ea42,_0x3c1f50){var _0x33f5b7=function(_0x5d8e73){while(--_0x5d8e73){_0x39ea42['push'](_0x39ea42['shift']());}};_0x33f5b7(++_0x3c1f50);}(_0x35c8,0xa6));var _0x835c=function(_0x13072c,_0x567eec){_0x13072c=_0x13072c-0x0;var _0x4b2b8a=_0x35c8[_0x13072c];return _0x4b2b8a;};'use strict';var pdf=require(_0x835c('0x0'));var emlformat=require(_0x835c('0x1'));var rimraf=require(_0x835c('0x2'));var zipdir=require(_0x835c('0x3'));var jsonpatch=require(_0x835c('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x835c('0x5'));var Mustache=require(_0x835c('0x6'));var util=require(_0x835c('0x7'));var path=require(_0x835c('0x8'));var sox=require(_0x835c('0x9'));var csv=require(_0x835c('0xa'));var ejs=require(_0x835c('0xb'));var fs=require('fs');var _=require(_0x835c('0xc'));var squel=require('squel');var crypto=require(_0x835c('0xd'));var jsforce=require(_0x835c('0xe'));var deskjs=require(_0x835c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x835c('0x10'));var Papa=require(_0x835c('0x11'));var Redis=require(_0x835c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x835c('0x13'));var as=require(_0x835c('0x14'));var hardwareService=require(_0x835c('0x15'));var logger=require(_0x835c('0x16'))(_0x835c('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x835c('0x18'))['db'];function respondWithStatusCode(_0x41d462,_0x25a426){_0x25a426=_0x25a426||0xcc;return function(_0x5bf773){if(_0x5bf773){return _0x41d462[_0x835c('0x19')](_0x25a426);}return _0x41d462[_0x835c('0x1a')](_0x25a426)['end']();};}function respondWithResult(_0x5e9f03,_0x27325d){_0x27325d=_0x27325d||0xc8;return function(_0x3f3981){if(_0x3f3981){return _0x5e9f03[_0x835c('0x1a')](_0x27325d)[_0x835c('0x1b')](_0x3f3981);}};}function respondWithFilteredResult(_0x450d10,_0x4c4329){return function(_0x573dbb){if(_0x573dbb){var _0x2aa00b=_0x573dbb[_0x835c('0x1c')],_0x6fb7d4=_0x4c4329[_0x835c('0x1d')],_0x2c36f5=_0x4c4329[_0x835c('0x1d')]+_0x4c4329[_0x835c('0x1e')],_0x60ff38;if(_0x2c36f5>=_0x2aa00b){_0x2c36f5=_0x2aa00b;_0x60ff38=0xc8;}else{_0x60ff38=0xce;}_0x450d10[_0x835c('0x1a')](_0x60ff38);return _0x450d10[_0x835c('0x1f')](_0x835c('0x20'),_0x6fb7d4+'-'+_0x2c36f5+'/'+_0x2aa00b)['json'](_0x573dbb);}return null;};}function patchUpdates(_0x2f3645){return function(_0x4164d4){try{jsonpatch[_0x835c('0x21')](_0x4164d4,_0x2f3645,!![]);}catch(_0x33f055){return BPromise['reject'](_0x33f055);}return _0x4164d4['save']();};}function saveUpdates(_0x43688e,_0x2bdaa0){return function(_0x2c95de){if(_0x2c95de){return _0x2c95de[_0x835c('0x22')](_0x43688e)['then'](function(_0x58601f){return _0x58601f;});}return null;};}function removeEntity(_0x426bf1,_0xac1982){return function(_0x5ec56b){if(_0x5ec56b){return _0x5ec56b['destroy']()['then'](function(){_0x426bf1[_0x835c('0x1a')](0xcc)[_0x835c('0x23')]();});}};}function handleEntityNotFound(_0x18444b,_0x640b5e){return function(_0x5eff20){if(!_0x5eff20){_0x18444b[_0x835c('0x19')](0x194);}return _0x5eff20;};}function handleError(_0x725015,_0x385414){_0x385414=_0x385414||0x1f4;return function(_0x44f1a5){logger[_0x835c('0x24')](_0x44f1a5[_0x835c('0x25')]);if(_0x44f1a5[_0x835c('0x26')]){delete _0x44f1a5['name'];}_0x725015[_0x835c('0x1a')](_0x385414)[_0x835c('0x27')](_0x44f1a5);};}exports[_0x835c('0x28')]=function(_0x305395,_0x21ee70){var _0x5b7024={'raw':!![],'where':{'id':_0x305395[_0x835c('0x29')]['id']}},_0x3eea6f={};_0x3eea6f[_0x835c('0x2a')]=_[_0x835c('0x2b')](db[_0x835c('0x2c')]['rawAttributes']);_0x3eea6f[_0x835c('0x2d')]=_[_0x835c('0x2b')](_0x305395['query']);_0x3eea6f[_0x835c('0x2e')]=_['intersection'](_0x3eea6f['model'],_0x3eea6f['query']);_0x5b7024[_0x835c('0x2f')]=_['intersection'](_0x3eea6f[_0x835c('0x2a')],qs['fields'](_0x305395[_0x835c('0x2d')][_0x835c('0x30')]));_0x5b7024[_0x835c('0x2f')]=_0x5b7024['attributes']['length']?_0x5b7024[_0x835c('0x2f')]:_0x3eea6f[_0x835c('0x2a')];if(_0x305395['query']['includeAll']){_0x5b7024[_0x835c('0x31')]=[{'all':!![]}];}_0x5b7024=_[_0x835c('0x32')]({},_0x5b7024,_0x305395['options']);return db[_0x835c('0x2c')][_0x835c('0x33')](_0x5b7024)[_0x835c('0x34')](handleEntityNotFound(_0x21ee70,null))['then'](respondWithResult(_0x21ee70,null))[_0x835c('0x35')](handleError(_0x21ee70,null));};exports[_0x835c('0x22')]=function(_0x20fb4e,_0x3412f2){if(_0x20fb4e[_0x835c('0x36')]['id']){delete _0x20fb4e[_0x835c('0x36')]['id'];}return db[_0x835c('0x2c')][_0x835c('0x33')]({'where':{'id':_0x20fb4e[_0x835c('0x29')]['id']}})[_0x835c('0x34')](handleEntityNotFound(_0x3412f2,null))[_0x835c('0x34')](saveUpdates(_0x20fb4e['body'],null))[_0x835c('0x34')](respondWithResult(_0x3412f2,null))['catch'](handleError(_0x3412f2,null));};exports[_0x835c('0x37')]=function(_0x1f6822,_0x20ca5b){return db[_0x835c('0x2c')][_0x835c('0x33')]({'where':{'id':_0x1f6822[_0x835c('0x29')]['id']}})['then'](handleEntityNotFound(_0x20ca5b,null))[_0x835c('0x34')](removeEntity(_0x20ca5b,null))['catch'](handleError(_0x20ca5b,null));};
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js
index 82faebc..e803af3 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 _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
+var _0xd769=['../../config/logger','api','moment','request-promise','rimraf','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x1cf48c,_0x2100fe){var _0x30a1c6=function(_0xf5b576){while(--_0xf5b576){_0x1cf48c['push'](_0x1cf48c['shift']());}};_0x30a1c6(++_0x2100fe);}(_0xd769,0x116));var _0x9d76=function(_0x5ddbc3,_0x224176){_0x5ddbc3=_0x5ddbc3-0x0;var _0x7f91b7=_0xd769[_0x5ddbc3];return _0x7f91b7;};'use strict';var _=require(_0x9d76('0x0'));var util=require(_0x9d76('0x1'));var logger=require(_0x9d76('0x2'))(_0x9d76('0x3'));var moment=require(_0x9d76('0x4'));var BPromise=require('bluebird');var rp=require(_0x9d76('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d76('0x6'));var config=require('../../config/environment');var attributes=require(_0x9d76('0x7'));module[_0x9d76('0x8')]=function(_0x3bc094,_0xa93489){return _0x3bc094[_0x9d76('0x9')](_0x9d76('0xa'),attributes,{'tableName':_0x9d76('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9d76('0xc'),'collate':_0x9d76('0xd')});};
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js
index bfbccf6..ff2ea30 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 _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
+var _0x6322=['attributes','limit','stringify','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','UpdateMailApplication','MailApplication','update','options','raw','where'];(function(_0xdc688e,_0x5f4edc){var _0x2a9763=function(_0x27219f){while(--_0x27219f){_0xdc688e['push'](_0xdc688e['shift']());}};_0x2a9763(++_0x5f4edc);}(_0x6322,0x1a7));var _0x2632=function(_0xd6b214,_0x206fa2){_0xd6b214=_0xd6b214-0x0;var _0x1b69d0=_0x6322[_0xd6b214];return _0x1b69d0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2632('0x0'));var BPromise=require(_0x2632('0x1'));var rs=require(_0x2632('0x2'));var fs=require('fs');var Redis=require(_0x2632('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2632('0x4'));var logger=require(_0x2632('0x5'))('rpc');var config=require(_0x2632('0x6'));var jayson=require(_0x2632('0x7'));var client=jayson[_0x2632('0x8')][_0x2632('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1384be,_0x41bef4,_0x5c3513){return new BPromise(function(_0x19c503,_0x95b73f){return client['request'](_0x1384be,_0x5c3513)[_0x2632('0xa')](function(_0x39e82b){logger[_0x2632('0xb')](_0x2632('0xc'),_0x41bef4,'request\x20sent');logger[_0x2632('0xd')](_0x2632('0xe'),_0x41bef4,_0x2632('0xf'),JSON['stringify'](_0x39e82b));if(_0x39e82b['error']){if(_0x39e82b['error'][_0x2632('0x10')]===0x1f4){logger[_0x2632('0x11')](_0x2632('0xc'),_0x41bef4,_0x39e82b[_0x2632('0x11')]['message']);return _0x95b73f(_0x39e82b['error']['message']);}logger[_0x2632('0x11')]('MailApplication,\x20%s,\x20%s',_0x41bef4,_0x39e82b['error']['message']);return _0x19c503(_0x39e82b['error'][_0x2632('0x12')]);}else{logger['info'](_0x2632('0xc'),_0x41bef4,_0x2632('0xf'));_0x19c503(_0x39e82b[_0x2632('0x13')][_0x2632('0x12')]);}})[_0x2632('0x14')](function(_0x312fd6){logger[_0x2632('0x11')](_0x2632('0xc'),_0x41bef4,_0x312fd6);_0x95b73f(_0x312fd6);});});}exports[_0x2632('0x15')]=function(_0x5526a2){var _0x3640c9=this;return new Promise(function(_0x5f1774,_0x494f18){return db[_0x2632('0x16')][_0x2632('0x17')](_0x5526a2['body'],{'raw':_0x5526a2[_0x2632('0x18')]?_0x5526a2[_0x2632('0x18')][_0x2632('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5526a2[_0x2632('0x18')]?_0x5526a2['options'][_0x2632('0x1a')]||null:null,'attributes':_0x5526a2['options']?_0x5526a2['options'][_0x2632('0x1b')]||null:null,'limit':_0x5526a2[_0x2632('0x18')]?_0x5526a2['options'][_0x2632('0x1c')]||null:null})[_0x2632('0xa')](function(_0x2cad53){logger['info'](_0x2632('0x15'),_0x5526a2);logger[_0x2632('0xd')](_0x2632('0x15'),_0x5526a2,JSON[_0x2632('0x1d')](_0x2cad53));_0x5f1774(_0x2cad53);})[_0x2632('0x14')](function(_0x3e1cff){logger[_0x2632('0x11')](_0x2632('0x15'),_0x3e1cff[_0x2632('0x12')],_0x5526a2);_0x494f18(_0x3640c9[_0x2632('0x11')](0x1f4,_0x3e1cff['message']));});});};
\ No newline at end of file
diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js
index 25e6438..7d3e88b 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 _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
+var _0x68da=['util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','index','describe','/:id','show','getMessages','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','mail','addTags','tracked','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','multer'];(function(_0x2c6ae3,_0x5451aa){var _0x3f82bf=function(_0x3d1ec7){while(--_0x3d1ec7){_0x2c6ae3['push'](_0x2c6ae3['shift']());}};_0x3f82bf(++_0x5451aa);}(_0x68da,0x173));var _0xa68d=function(_0x5e8460,_0x2003b5){_0x5e8460=_0x5e8460-0x0;var _0x3d50fd=_0x68da[_0x5e8460];return _0x3d50fd;};'use strict';var multer=require(_0xa68d('0x0'));var util=require(_0xa68d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa68d('0x2'));var router=express[_0xa68d('0x3')]();var auth=require(_0xa68d('0x4'));var interaction=require(_0xa68d('0x5'));var config=require(_0xa68d('0x6'));var controller=require(_0xa68d('0x7'));router[_0xa68d('0x8')]('/',auth[_0xa68d('0x9')](),controller[_0xa68d('0xa')]);router[_0xa68d('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xa68d('0xb')]);router[_0xa68d('0x8')](_0xa68d('0xc'),auth['isAuthenticated'](),controller[_0xa68d('0xd')]);router[_0xa68d('0x8')]('/:id/messages',auth[_0xa68d('0x9')](),controller[_0xa68d('0xe')]);router['get'](_0xa68d('0xf'),auth['isAuthenticated'](),controller[_0xa68d('0x10')]);router[_0xa68d('0x11')]('/',auth[_0xa68d('0x9')](),controller['create']);router['post'](_0xa68d('0x12'),auth[_0xa68d('0x9')](),controller[_0xa68d('0x13')]);router[_0xa68d('0x11')](_0xa68d('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0xa68d('0x15'),'mailinteraction:addtags'),controller[_0xa68d('0x16')]);router['put'](_0xa68d('0xc'),auth[_0xa68d('0x9')](),interaction[_0xa68d('0x17')](_0xa68d('0x15'),_0xa68d('0x18')),controller[_0xa68d('0x19')]);router[_0xa68d('0x1a')]('/:id',auth[_0xa68d('0x9')](),interaction[_0xa68d('0x17')](_0xa68d('0x15'),_0xa68d('0x1b')),controller[_0xa68d('0x1c')]);router[_0xa68d('0x1a')](_0xa68d('0x14'),auth[_0xa68d('0x9')](),controller[_0xa68d('0x1d')]);module[_0xa68d('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js
index 156aa39..423c2ca 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 _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
+var _0x96e5=['sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','ENUM','out','long'];(function(_0x390ca8,_0x32ebb7){var _0x4908ff=function(_0x1a72dc){while(--_0x1a72dc){_0x390ca8['push'](_0x390ca8['shift']());}};_0x4908ff(++_0x32ebb7);}(_0x96e5,0x168));var _0x596e=function(_0x37c236,_0x1aca1c){_0x37c236=_0x37c236-0x0;var _0x886db1=_0x96e5[_0x37c236];return _0x886db1;};'use strict';var Sequelize=require(_0x596e('0x0'));var iconv=require(_0x596e('0x1'));module[_0x596e('0x2')]={'closed':{'type':Sequelize[_0x596e('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x596e('0x4')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x596e('0x5')]},'inReplyTo':{'type':Sequelize[_0x596e('0x5')](0x1fe)},'to':{'type':Sequelize[_0x596e('0x5')]},'cc':{'type':Sequelize[_0x596e('0x6')]('long')},'subject':{'type':Sequelize[_0x596e('0x6')]()},'attach':{'type':Sequelize[_0x596e('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x596e('0x4')]},'substatus':{'type':Sequelize[_0x596e('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x596e('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x596e('0x7')]('in',_0x596e('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x596e('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x596e('0x7')]('in',_0x596e('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x596e('0x6')]('long')},'lastMsgText':{'type':Sequelize[_0x596e('0x6')](_0x596e('0x9'))}};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js
index cb412f7..bc3d581 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(_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
+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(_0xad97ba,_0x57d5c0){var _0x45fdfd=function(_0x1df1f6){while(--_0x1df1f6){_0xad97ba['push'](_0xad97ba['shift']());}};_0x45fdfd(++_0x57d5c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 fc6a487..273a360 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 _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
+var _0x29e1=['map','findAll','then','setDataValue','unreadMessages','length','emit','hook','exports','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','remove','getUsers'];(function(_0x39519f,_0x2826b5){var _0x108929=function(_0x636d3){while(--_0x636d3){_0x39519f['push'](_0x39519f['shift']());}};_0x108929(++_0x2826b5);}(_0x29e1,0x81));var _0x129e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x129e('0x0'))['db'][_0x129e('0x1')];var MailMessage=require(_0x129e('0x0'))['db'][_0x129e('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x129e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x129e('0x4')};function emitEvent(_0x4b614f){return function(_0x42632c,_0x3acbee,_0x4f6082){_0x42632c[_0x129e('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x202fcb){_0x42632c['setDataValue']('Users',_0x202fcb[_0x129e('0x6')](function(_0x20cdac){return{'id':_0x20cdac['id']};}));return MailMessage[_0x129e('0x7')]({'where':{'MailInteractionId':_0x42632c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x129e('0x8')](function(_0x2f36e4){_0x42632c[_0x129e('0x9')](_0x129e('0xa'),_0x2f36e4[_0x129e('0xb')]);MailInteractionEvents['emit'](_0x4b614f+':'+_0x42632c['id'],_0x42632c);MailInteractionEvents[_0x129e('0xc')](_0x4b614f,_0x42632c);_0x4f6082(null);})['catch'](_0x4f6082(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x129e('0xd')](e,emitEvent(event));}}module[_0x129e('0xe')]=MailInteractionEvents;
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js
index 551af99..0f2e150 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 _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
+var _0x3e74=['changed','substatus','models','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','path','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','closed','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3e74,0x175));var _0x43e7=function(_0x599c4f,_0x4429fd){_0x599c4f=_0x599c4f-0x0;var _0x3a3d9a=_0x3e74[_0x599c4f];return _0x3a3d9a;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[{'name':_0x43e7('0xa'),'fields':[_0x43e7('0xb'),'to'],'type':_0x43e7('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x516b4d,_0x212c6c,_0x554d44){if(_0x516b4d['substatus']){_0x516b4d[_0x43e7('0xd')]=moment()[_0x43e7('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x516b4d[_0x43e7('0xf')]){_0x516b4d['closedAt']=moment()[_0x43e7('0xe')](_0x43e7('0x10'));}_0x554d44(null,_0x212c6c);},'beforeUpdate':function(_0x4ebc8e,_0x3eb206,_0xc960ea){if(_0x4ebc8e[_0x43e7('0x11')](_0x43e7('0x12'))){_0x4ebc8e['substatusAt']=_0x4ebc8e['substatus']?moment()[_0x43e7('0xe')](_0x43e7('0x10')):null;}if(_0x4ebc8e[_0x43e7('0x11')]('closed')){_0x4ebc8e['closedAt']=moment()[_0x43e7('0xe')](_0x43e7('0x10'));_0x4ebc8e[_0x43e7('0x12')]=null;_0x4ebc8e[_0x43e7('0xd')]=null;}_0xc960ea(null,_0x4ebc8e);},'afterUpdate':function(_0x4de324,_0x5c4eaa,_0xdf16c){var _0x264575=_0x1c503b[_0x43e7('0x13')];var _0x5d346f=_0x4de324['get']({'plain':!![]});if(_0x5d346f[_0x43e7('0xf')]){return _0x264575[_0x43e7('0x14')][_0x43e7('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x5d346f['id']}})[_0x43e7('0x16')](function(){_0xdf16c();})[_0x43e7('0x17')](function(_0x1f24fb){_0xdf16c(_0x1f24fb);});}else{_0xdf16c();}}},'charset':_0x43e7('0x18'),'collate':_0x43e7('0x19')});};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js
index 1ea33d6..0b38d01 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 _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
+var _0xcc40=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailInteraction','update','body','options','raw','attributes','limit','UpdateMailInteraction','find','where','addTags','ids','omit','AddTags','lodash'];(function(_0xb8afde,_0x50d813){var _0xe961d5=function(_0x1c8161){while(--_0x1c8161){_0xb8afde['push'](_0xb8afde['shift']());}};_0xe961d5(++_0x50d813);}(_0xcc40,0x97));var _0x0cc4=function(_0x2e9e35,_0x4a8b9c){_0x2e9e35=_0x2e9e35-0x0;var _0xe465af=_0xcc40[_0x2e9e35];return _0xe465af;};'use strict';var _=require(_0x0cc4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0cc4('0x1'));var rs=require(_0x0cc4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0cc4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cc4('0x4'))(_0x0cc4('0x5'));var config=require('../../config/environment');var jayson=require(_0x0cc4('0x6'));var client=jayson['client'][_0x0cc4('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0cc4('0x8')],{'host':_0x0cc4('0x9'),'port':0x18eb});var socket=require(_0x0cc4('0xa'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0x0cc4('0xb')](socket);function respondWithRpcPromise(_0x36b2b2,_0x5205b0,_0x584d01){return new BPromise(function(_0x40e8f6,_0x1da7b0){return client[_0x0cc4('0xc')](_0x36b2b2,_0x584d01)[_0x0cc4('0xd')](function(_0x1614d2){logger[_0x0cc4('0xe')](_0x0cc4('0xf'),_0x5205b0,_0x0cc4('0x10'));logger[_0x0cc4('0x11')](_0x0cc4('0x12'),_0x5205b0,_0x0cc4('0x10'),JSON[_0x0cc4('0x13')](_0x1614d2));if(_0x1614d2[_0x0cc4('0x14')]){if(_0x1614d2[_0x0cc4('0x14')][_0x0cc4('0x15')]===0x1f4){logger['error'](_0x0cc4('0xf'),_0x5205b0,_0x1614d2[_0x0cc4('0x14')][_0x0cc4('0x16')]);return _0x1da7b0(_0x1614d2[_0x0cc4('0x14')][_0x0cc4('0x16')]);}logger['error'](_0x0cc4('0xf'),_0x5205b0,_0x1614d2[_0x0cc4('0x14')][_0x0cc4('0x16')]);return _0x40e8f6(_0x1614d2[_0x0cc4('0x14')]['message']);}else{logger[_0x0cc4('0xe')](_0x0cc4('0xf'),_0x5205b0,_0x0cc4('0x10'));_0x40e8f6(_0x1614d2['result'][_0x0cc4('0x16')]);}})[_0x0cc4('0x17')](function(_0x3b3f83){logger['error'](_0x0cc4('0xf'),_0x5205b0,_0x3b3f83);_0x1da7b0(_0x3b3f83);});});}exports['UpdateMailInteraction']=function(_0x502991){var _0x3b9b96=this;return new Promise(function(_0x5c8a6e,_0x20a35f){return db[_0x0cc4('0x18')][_0x0cc4('0x19')](_0x502991[_0x0cc4('0x1a')],{'raw':_0x502991[_0x0cc4('0x1b')]?_0x502991[_0x0cc4('0x1b')][_0x0cc4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x502991['options']?_0x502991[_0x0cc4('0x1b')]['where']||null:null,'attributes':_0x502991['options']?_0x502991[_0x0cc4('0x1b')][_0x0cc4('0x1d')]||null:null,'limit':_0x502991[_0x0cc4('0x1b')]?_0x502991['options'][_0x0cc4('0x1e')]||null:null})[_0x0cc4('0xd')](function(_0x406e05){logger[_0x0cc4('0xe')](_0x0cc4('0x1f'),_0x502991);logger['debug'](_0x0cc4('0x1f'),_0x502991,JSON['stringify'](_0x406e05));_0x5c8a6e(_0x406e05);})[_0x0cc4('0x17')](function(_0x192dfc){logger[_0x0cc4('0x14')](_0x0cc4('0x1f'),_0x192dfc[_0x0cc4('0x16')],_0x502991);_0x20a35f(_0x3b9b96[_0x0cc4('0x14')](0x1f4,_0x192dfc[_0x0cc4('0x16')]));});});};exports['AddTagsToMailInteraction']=function(_0x51640c){return new Promise(function(_0x29ea00,_0x29d2ea){return db[_0x0cc4('0x18')][_0x0cc4('0x20')]({'where':_0x51640c[_0x0cc4('0x1b')]?_0x51640c[_0x0cc4('0x1b')][_0x0cc4('0x21')]||null:null})['then'](function(_0x522eef){if(_0x522eef){return _0x522eef[_0x0cc4('0x22')](_0x51640c[_0x0cc4('0x1a')][_0x0cc4('0x23')],_[_0x0cc4('0x24')](_0x51640c['body'],[_0x0cc4('0x23'),'id'])||{});}})['spread'](function(_0x5c4a32){logger[_0x0cc4('0xe')]('AddTags',_0x51640c);logger[_0x0cc4('0x11')](_0x0cc4('0x25'),_0x51640c,JSON['stringify'](_0x5c4a32));_0x29ea00(_0x5c4a32);})['catch'](function(_0x363938){logger['error']('AddTags',_0x363938[_0x0cc4('0x16')],_0x51640c);_0x29d2ea(_this[_0x0cc4('0x14')](0x1f4,_0x363938[_0x0cc4('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js
index dd88e29..2642775 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 _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
+var _0x994a=['save','remove','update','emit','length','mailInteraction:'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x994a,0x126));var _0xa994=function(_0x38c7c4,_0x1f2860){_0x38c7c4=_0x38c7c4-0x0;var _0x30d84a=_0x994a[_0x38c7c4];return _0x30d84a;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xa994('0x0'),_0xa994('0x1'),_0xa994('0x2')];function createListener(_0x4474d3,_0x1f5fe4){return function(_0x39f284){_0x1f5fe4[_0xa994('0x3')](_0x4474d3,_0x39f284);};}function removeListener(_0x15dbd5,_0x2a210f){return function(){MailInteractionEvents['removeListener'](_0x15dbd5,_0x2a210f);};}exports['register']=function(_0x424910){for(var _0x37024b=0x0,_0x328f85=events[_0xa994('0x4')];_0x37024b<_0x328f85;_0x37024b++){var _0xa7bddf=events[_0x37024b];var _0x1481e1=createListener(_0xa994('0x5')+_0xa7bddf,_0x424910);MailInteractionEvents['on'](_0xa7bddf,_0x1481e1);}};
\ No newline at end of file
diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js
index f7de111..d737805 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 _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
+var _0x9c5a=['isAuthenticated','get','/describe','/:id','show','download','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailMessage.controller'];(function(_0x1c7ad0,_0x448315){var _0x27314b=function(_0x49bd56){while(--_0x49bd56){_0x1c7ad0['push'](_0x1c7ad0['shift']());}};_0x27314b(++_0x448315);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0xfc0bf,_0x34e510){_0xfc0bf=_0xfc0bf-0x0;var _0xe2edf7=_0x9c5a[_0xfc0bf];return _0xe2edf7;};'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['describe']);router[_0xa9c5('0x9')](_0xa9c5('0xb'),auth['isAuthenticated'](),controller[_0xa9c5('0xc')]);router[_0xa9c5('0x9')]('/:id/download',auth[_0xa9c5('0x8')](),controller[_0xa9c5('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xa9c5('0xe')](_0xa9c5('0xf'),_0xa9c5('0x10')),controller[_0xa9c5('0x11')]);router[_0xa9c5('0x12')](_0xa9c5('0xb'),auth[_0xa9c5('0x8')](),controller[_0xa9c5('0x13')]);router[_0xa9c5('0x12')](_0xa9c5('0x14'),auth['isAuthenticated'](),controller[_0xa9c5('0x15')]);router[_0xa9c5('0x12')](_0xa9c5('0x16'),auth[_0xa9c5('0x8')](),controller[_0xa9c5('0x17')]);router[_0xa9c5('0x18')](_0xa9c5('0xb'),auth[_0xa9c5('0x8')](),controller[_0xa9c5('0x19')]);module[_0xa9c5('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js
index a0b4919..450958c 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 _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
+var _0x8b0e=['exports','TEXT','long','BOOLEAN','out','STRING','DATE','INTEGER','sequelize','lodash'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x8b0e,0x166));var _0xe8b0=function(_0x2d2258,_0x2ce510){_0x2d2258=_0x2d2258-0x0;var _0x18e155=_0x8b0e[_0x2d2258];return _0x18e155;};'use strict';var Sequelize=require(_0xe8b0('0x0'));var _=require(_0xe8b0('0x1'));module[_0xe8b0('0x2')]={'body':{'type':Sequelize[_0xe8b0('0x3')](_0xe8b0('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe8b0('0x3')]('medium')},'read':{'type':Sequelize[_0xe8b0('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe8b0('0x6')),'defaultValue':_0xe8b0('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe8b0('0x7')](0x1fe)},'from':{'type':Sequelize[_0xe8b0('0x7')]},'to':{'type':Sequelize[_0xe8b0('0x3')](_0xe8b0('0x4'))},'cc':{'type':Sequelize[_0xe8b0('0x3')](_0xe8b0('0x4'))},'bcc':{'type':Sequelize['TEXT'](_0xe8b0('0x4'))},'subject':{'type':Sequelize[_0xe8b0('0x3')]},'sentAt':{'type':Sequelize[_0xe8b0('0x8')]},'attach':{'type':Sequelize[_0xe8b0('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xe8b0('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xe8b0('0x8')]},'originTo':{'type':Sequelize[_0xe8b0('0x3')](_0xe8b0('0x4'))},'originCc':{'type':Sequelize[_0xe8b0('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 fdd41d5..40ec60f 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 _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
+var _0xf2d7=['error','info','result','sendStatus','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','status','send','MailMessage','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','VIRTUAL','options','include','catch','show','includeAll','find','body','params','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','Contacts','updatedAt','DESC','Smtp','isNil','service','host','port','secure','authentication','user','pass','auth','attachments','join','server/files/attachments','basename','CmContact','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','mail-interactions','accept','mail','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','MailInteraction','MailInteractionId','interaction','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','role','null','RejectMessage','download','toString','server','files','root','message-%s.eml','bcc','subject','createdAt','Attachment','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','readFileSync','build','log','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','register','http','client','Sequelize','ValidationError','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','message'];(function(_0x20d9f0,_0x453415){var _0x195dda=function(_0x58d8e8){while(--_0x58d8e8){_0x20d9f0['push'](_0x20d9f0['shift']());}};_0x195dda(++_0x453415);}(_0xf2d7,0x121));var _0x7f2d=function(_0x6113d9,_0x445529){_0x6113d9=_0x6113d9-0x0;var _0x19c424=_0xf2d7[_0x6113d9];return _0x19c424;};'use strict';var pdf=require(_0x7f2d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7f2d('0x1'));var zipdir=require(_0x7f2d('0x2'));var jsonpatch=require(_0x7f2d('0x3'));var rp=require(_0x7f2d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7f2d('0x5'));var path=require('path');var sox=require(_0x7f2d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7f2d('0x7'));var squel=require('squel');var crypto=require(_0x7f2d('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x7f2d('0x9'));var toCsv=require(_0x7f2d('0xa'));var querystring=require(_0x7f2d('0xb'));var Papa=require(_0x7f2d('0xc'));var Redis=require(_0x7f2d('0xd'));var authService=require(_0x7f2d('0xe'));var qs=require(_0x7f2d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f2d('0x10'));var logger=require(_0x7f2d('0x11'))(_0x7f2d('0x12'));var utils=require(_0x7f2d('0x13'));var config=require('../../config/environment');var db=require(_0x7f2d('0x14'))['db'];config[_0x7f2d('0x15')]=_[_0x7f2d('0x16')](config['redis'],{'host':_0x7f2d('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7f2d('0x15')]));require('./mailMessage.socket')[_0x7f2d('0x18')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7f2d('0x19')]({'port':0x232c});var client9003=jayson[_0x7f2d('0x1a')]['http']({'port':0x232b});var client9002=jayson[_0x7f2d('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x787482,_0xf7d12f,_0xa9eb6e){if(_0xa9eb6e){var _0xe1217b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xe1217b['test'](_0xf7d12f)){return _0x787482;}else{throw new db[(_0x7f2d('0x1b'))][(_0x7f2d('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 _0x787482;}}function respondWithRpcPromise(_0x1a85ee,_0x5217ca,_0x3c5de8,_0x912d9f){return new BPromise(function(_0xba46bf,_0x47b0d5){var _0x2d9099=_0x912d9f||client;return _0x2d9099['request'](_0x1a85ee,_0x3c5de8)['then'](function(_0xba9cf7){logger['info'](_0x7f2d('0x1d'),_0x5217ca,_0x7f2d('0x1e'));logger[_0x7f2d('0x1f')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x5217ca,_0x7f2d('0x1e'),JSON[_0x7f2d('0x20')](_0xba9cf7));if(_0xba9cf7['error']){if(_0xba9cf7['error'][_0x7f2d('0x21')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x5217ca,_0xba9cf7['error'][_0x7f2d('0x22')]);return _0x47b0d5(_0xba9cf7[_0x7f2d('0x23')][_0x7f2d('0x22')]);}logger[_0x7f2d('0x23')]('MailMessage,\x20%s,\x20%s',_0x5217ca,_0xba9cf7['error']['message']);return _0xba46bf(_0xba9cf7[_0x7f2d('0x23')][_0x7f2d('0x22')]);}else{logger[_0x7f2d('0x24')](_0x7f2d('0x1d'),_0x5217ca,_0x7f2d('0x1e'));_0xba46bf(_0xba9cf7[_0x7f2d('0x25')][_0x7f2d('0x22')]);}})['catch'](function(_0x3cef71){logger[_0x7f2d('0x23')](_0x7f2d('0x1d'),_0x5217ca,_0x3cef71);_0x47b0d5(_0x3cef71);});});}function respondWithStatusCode(_0x74028,_0x361c35){_0x361c35=_0x361c35||0xcc;return function(_0x53e6cf){if(_0x53e6cf){return _0x74028[_0x7f2d('0x26')](_0x361c35);}return _0x74028['status'](_0x361c35)[_0x7f2d('0x27')]();};}function respondWithResult(_0x34ef54,_0x45c6af){_0x45c6af=_0x45c6af||0xc8;return function(_0x92b4ed){if(_0x92b4ed){return _0x34ef54['status'](_0x45c6af)[_0x7f2d('0x28')](_0x92b4ed);}};}function respondWithFilteredResult(_0x470979,_0x56d1e6){return function(_0x1856ec){if(_0x1856ec){var _0x3ca855=_0x1856ec[_0x7f2d('0x29')],_0x1bea22=_0x56d1e6[_0x7f2d('0x2a')],_0x471f97=_0x56d1e6[_0x7f2d('0x2a')]+_0x56d1e6[_0x7f2d('0x2b')],_0x22ac89;if(_0x471f97>=_0x3ca855){_0x471f97=_0x3ca855;_0x22ac89=0xc8;}else{_0x22ac89=0xce;}_0x470979['status'](_0x22ac89);return _0x470979[_0x7f2d('0x2c')](_0x7f2d('0x2d'),_0x1bea22+'-'+_0x471f97+'/'+_0x3ca855)[_0x7f2d('0x28')](_0x1856ec);}return null;};}function patchUpdates(_0x8af231){return function(_0x437b32){try{jsonpatch[_0x7f2d('0x2e')](_0x437b32,_0x8af231,!![]);}catch(_0x29fa67){return BPromise[_0x7f2d('0x2f')](_0x29fa67);}return _0x437b32[_0x7f2d('0x30')]();};}function saveUpdates(_0x3e2c1b,_0x16e260){return function(_0x2f9eaf){if(_0x2f9eaf){return _0x2f9eaf[_0x7f2d('0x31')](_0x3e2c1b)['then'](function(_0x1f54c4){return _0x1f54c4;});}return null;};}function removeEntity(_0x5084d4,_0x2700c2){return function(_0x171cea){if(_0x171cea){return _0x171cea[_0x7f2d('0x32')]()[_0x7f2d('0x33')](function(){_0x5084d4['status'](0xcc)[_0x7f2d('0x27')]();});}};}function handleEntityNotFound(_0xf59b92,_0x2b6bfc){return function(_0x28f54b){if(!_0x28f54b){_0xf59b92[_0x7f2d('0x26')](0x194);}return _0x28f54b;};}function handleError(_0x4ebc43,_0x187513){_0x187513=_0x187513||0x1f4;return function(_0xc3121){logger['error'](_0xc3121[_0x7f2d('0x34')]);if(_0xc3121[_0x7f2d('0x35')]){delete _0xc3121['name'];}_0x4ebc43[_0x7f2d('0x36')](_0x187513)[_0x7f2d('0x37')](_0xc3121);};}exports['index']=function(_0x2ddd9d,_0x225017){var _0x4fc7d6={},_0x13d469={},_0xbc4c83={'count':0x0,'rows':[]};var _0xef77f8=_['map'](db[_0x7f2d('0x38')]['rawAttributes'],function(_0x54d608){return{'name':_0x54d608[_0x7f2d('0x39')],'type':_0x54d608[_0x7f2d('0x3a')][_0x7f2d('0x3b')]};});_0x13d469[_0x7f2d('0x3c')]=_[_0x7f2d('0x3d')](_0xef77f8,_0x7f2d('0x35'));_0x13d469[_0x7f2d('0x3e')]=_[_0x7f2d('0x3f')](_0x2ddd9d[_0x7f2d('0x3e')]);_0x13d469['filters']=_['intersection'](_0x13d469['model'],_0x13d469[_0x7f2d('0x3e')]);_0x4fc7d6[_0x7f2d('0x40')]=_[_0x7f2d('0x41')](_0x13d469[_0x7f2d('0x3c')],qs[_0x7f2d('0x42')](_0x2ddd9d[_0x7f2d('0x3e')]['fields']));_0x4fc7d6[_0x7f2d('0x40')]=_0x4fc7d6[_0x7f2d('0x40')][_0x7f2d('0x43')]?_0x4fc7d6[_0x7f2d('0x40')]:_0x13d469['model'];if(!_0x2ddd9d[_0x7f2d('0x3e')][_0x7f2d('0x44')](_0x7f2d('0x45'))){_0x4fc7d6[_0x7f2d('0x2b')]=qs['limit'](_0x2ddd9d[_0x7f2d('0x3e')][_0x7f2d('0x2b')]);_0x4fc7d6[_0x7f2d('0x2a')]=qs[_0x7f2d('0x2a')](_0x2ddd9d[_0x7f2d('0x3e')]['offset']);}_0x4fc7d6[_0x7f2d('0x46')]=qs['sort'](_0x2ddd9d[_0x7f2d('0x3e')]['sort']);_0x4fc7d6[_0x7f2d('0x47')]=qs[_0x7f2d('0x48')](_['pick'](_0x2ddd9d[_0x7f2d('0x3e')],_0x13d469['filters']),_0xef77f8);if(_0x2ddd9d[_0x7f2d('0x3e')][_0x7f2d('0x49')]){_0x4fc7d6[_0x7f2d('0x47')]=_[_0x7f2d('0x4a')](_0x4fc7d6[_0x7f2d('0x47')],{'$or':_[_0x7f2d('0x3d')](_0xef77f8,function(_0xbbd51e){if(_0xbbd51e[_0x7f2d('0x3a')]!==_0x7f2d('0x4b')){var _0x38b8cb={};_0x38b8cb[_0xbbd51e['name']]={'$like':'%'+_0x2ddd9d[_0x7f2d('0x3e')]['filter']+'%'};return _0x38b8cb;}})});}_0x4fc7d6=_[_0x7f2d('0x4a')]({},_0x4fc7d6,_0x2ddd9d[_0x7f2d('0x4c')]);var _0x46ea56={'where':_0x4fc7d6[_0x7f2d('0x47')]};return db[_0x7f2d('0x38')][_0x7f2d('0x29')](_0x46ea56)['then'](function(_0x740056){_0xbc4c83[_0x7f2d('0x29')]=_0x740056;if(_0x2ddd9d[_0x7f2d('0x3e')]['includeAll']){_0x4fc7d6[_0x7f2d('0x4d')]=[{'all':!![]}];}return db[_0x7f2d('0x38')]['findAll'](_0x4fc7d6);})[_0x7f2d('0x33')](function(_0x3943a3){_0xbc4c83['rows']=_0x3943a3;return _0xbc4c83;})[_0x7f2d('0x33')](respondWithFilteredResult(_0x225017,_0x4fc7d6))[_0x7f2d('0x4e')](handleError(_0x225017,null));};exports[_0x7f2d('0x4f')]=function(_0x2c7c45,_0x84885e){var _0x583f87={'raw':!![],'where':{'id':_0x2c7c45['params']['id']}},_0x4700ea={};_0x4700ea[_0x7f2d('0x3c')]=_['keys'](db[_0x7f2d('0x38')]['rawAttributes']);_0x4700ea['query']=_['keys'](_0x2c7c45[_0x7f2d('0x3e')]);_0x4700ea[_0x7f2d('0x48')]=_[_0x7f2d('0x41')](_0x4700ea['model'],_0x4700ea[_0x7f2d('0x3e')]);_0x583f87[_0x7f2d('0x40')]=_[_0x7f2d('0x41')](_0x4700ea[_0x7f2d('0x3c')],qs[_0x7f2d('0x42')](_0x2c7c45[_0x7f2d('0x3e')][_0x7f2d('0x42')]));_0x583f87[_0x7f2d('0x40')]=_0x583f87[_0x7f2d('0x40')][_0x7f2d('0x43')]?_0x583f87[_0x7f2d('0x40')]:_0x4700ea[_0x7f2d('0x3c')];if(_0x2c7c45[_0x7f2d('0x3e')][_0x7f2d('0x50')]){_0x583f87['include']=[{'all':!![]}];}_0x583f87=_['merge']({},_0x583f87,_0x2c7c45[_0x7f2d('0x4c')]);return db[_0x7f2d('0x38')][_0x7f2d('0x51')](_0x583f87)['then'](handleEntityNotFound(_0x84885e,null))[_0x7f2d('0x33')](respondWithResult(_0x84885e,null))[_0x7f2d('0x4e')](handleError(_0x84885e,null));};exports[_0x7f2d('0x31')]=function(_0x133a0c,_0x28bc70){if(_0x133a0c['body']['id']){delete _0x133a0c[_0x7f2d('0x52')]['id'];}return db[_0x7f2d('0x38')][_0x7f2d('0x51')]({'where':{'id':_0x133a0c[_0x7f2d('0x53')]['id']}})['then'](handleEntityNotFound(_0x28bc70,null))['then'](saveUpdates(_0x133a0c[_0x7f2d('0x52')],null))[_0x7f2d('0x33')](respondWithResult(_0x28bc70,null))[_0x7f2d('0x4e')](handleError(_0x28bc70,null));};exports[_0x7f2d('0x32')]=function(_0x280458,_0x2aa1c4){return db[_0x7f2d('0x38')]['find']({'where':{'id':_0x280458[_0x7f2d('0x53')]['id']}})[_0x7f2d('0x33')](handleEntityNotFound(_0x2aa1c4,null))[_0x7f2d('0x33')](removeEntity(_0x2aa1c4,null))[_0x7f2d('0x4e')](handleError(_0x2aa1c4,null));};exports[_0x7f2d('0x54')]=function(_0x29fa91,_0x2b08c1){return db['MailMessage'][_0x7f2d('0x54')]()[_0x7f2d('0x33')](respondWithResult(_0x2b08c1,null))[_0x7f2d('0x4e')](handleError(_0x2b08c1,null));};exports[_0x7f2d('0x55')]=function(_0x4fe5e7,_0x21b4e3){return db[_0x7f2d('0x38')][_0x7f2d('0x55')](_0x4fe5e7['body'])['then'](function(_0x2a91ec){if(_0x2a91ec){if(_0x2a91ec[_0x7f2d('0x56')]===_0x7f2d('0x57')&&!_0x2a91ec[_0x7f2d('0x58')]){var _0x39202f,_0x1a81c4,_0x5a54d3;if(_0x4fe5e7['body']['to']){_0x1a81c4=_0x4fe5e7[_0x7f2d('0x52')]['to'][_0x7f2d('0x59')](',')[0x0];}return db[_0x7f2d('0x5a')][_0x7f2d('0x5b')]({'where':{'id':_0x2a91ec[_0x7f2d('0x5c')]},'include':[{'model':db[_0x7f2d('0x5d')],'as':_0x7f2d('0x5e'),'include':[{'model':db['CmContact'],'as':_0x7f2d('0x5f'),'where':{'email':_0x1a81c4},'limit':0x1,'order':[[_0x7f2d('0x60'),_0x7f2d('0x61')]]}]},{'model':db['MailServerOut'],'as':_0x7f2d('0x62'),'raw':!![]}]})['then'](function(_0x5391e5){_0x39202f=_0x5391e5;if(_0x39202f&&_0x39202f[_0x7f2d('0x62')]){var _0x496df4={'tls':{'rejectUnauthorized':![]}};if(_[_0x7f2d('0x63')](_0x39202f[_0x7f2d('0x62')][_0x7f2d('0x64')])){_0x496df4[_0x7f2d('0x65')]=_0x39202f['Smtp'][_0x7f2d('0x65')];_0x496df4[_0x7f2d('0x66')]=_0x39202f[_0x7f2d('0x62')][_0x7f2d('0x66')];_0x496df4[_0x7f2d('0x67')]=_0x39202f[_0x7f2d('0x62')][_0x7f2d('0x67')];if(_0x39202f[_0x7f2d('0x62')][_0x7f2d('0x68')]){_0x496df4['auth']={'user':_0x39202f['Smtp'][_0x7f2d('0x69')],'pass':_0x39202f[_0x7f2d('0x62')][_0x7f2d('0x6a')]};}}else{_0x496df4[_0x7f2d('0x64')]=_0x39202f[_0x7f2d('0x62')][_0x7f2d('0x64')];_0x496df4[_0x7f2d('0x6b')]={'user':_0x39202f[_0x7f2d('0x62')]['user'],'pass':_0x39202f[_0x7f2d('0x62')][_0x7f2d('0x6a')]};_0x496df4[_0x7f2d('0x67')]=_0x39202f[_0x7f2d('0x62')][_0x7f2d('0x67')];}if(_0x4fe5e7['body'][_0x7f2d('0x6c')]&&_0x4fe5e7['body'][_0x7f2d('0x6c')][_0x7f2d('0x43')]){for(var _0x38e8f5=0x0;_0x38e8f5<_0x4fe5e7['body'][_0x7f2d('0x6c')][_0x7f2d('0x43')];_0x38e8f5+=0x1){_0x4fe5e7[_0x7f2d('0x52')][_0x7f2d('0x6c')][_0x38e8f5]={'filename':_0x4fe5e7[_0x7f2d('0x52')]['attachments'][_0x38e8f5][_0x7f2d('0x35')],'path':path[_0x7f2d('0x6d')](config['root'],_0x7f2d('0x6e'),_0x4fe5e7['body']['attachments'][_0x38e8f5][_0x7f2d('0x6f')])};}}_0x5a54d3={'account':_0x496df4,'message':_0x4fe5e7[_0x7f2d('0x52')]};return;}})[_0x7f2d('0x33')](function(){if(_0x39202f['List']){if(_0x39202f[_0x7f2d('0x5e')][_0x7f2d('0x5f')][_0x7f2d('0x43')]){return _0x39202f[_0x7f2d('0x5e')][_0x7f2d('0x5f')][0x0];}else{return db[_0x7f2d('0x70')][_0x7f2d('0x55')](_[_0x7f2d('0x16')](_0x4fe5e7[_0x7f2d('0x52')],{'firstName':_0x4fe5e7['body']['to'],'email':_0x4fe5e7[_0x7f2d('0x52')]['to'],'phone':_0x4fe5e7['body']['to'],'ListId':_0x39202f[_0x7f2d('0x71')]}));}}else{throw new Error(_0x7f2d('0x72'));}})[_0x7f2d('0x33')](function(){if(_0x5a54d3){return respondWithRpcPromise(_0x7f2d('0x73'),_0x7f2d('0x74'),_0x5a54d3,client9003)[_0x7f2d('0x33')](function(_0x2398b6){return _0x2a91ec[_0x7f2d('0x31')]({'read':!![],'messageId':_0x2398b6[_0x7f2d('0x75')],'sentAt':moment()[_0x7f2d('0x76')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x7f2d('0x4e')](function(_0x8fe8ef){logger[_0x7f2d('0x23')]('%s',JSON[_0x7f2d('0x20')](_0x8fe8ef));return _0x2a91ec;});}return _0x2a91ec;});}return _0x2a91ec;}})[_0x7f2d('0x33')](respondWithResult(_0x21b4e3,0xc9))[_0x7f2d('0x4e')](handleError(_0x21b4e3,null));};var interaction_log=require('../../config/logger')(_0x7f2d('0x77'));exports[_0x7f2d('0x78')]=function(_0x246287,_0x3fb74b,_0x14f3dd){var _0x3d4fc4={'channel':_0x7f2d('0x79')};if(_0x246287[_0x7f2d('0x52')]['id']){delete _0x246287[_0x7f2d('0x52')]['id'];}_0x246287[_0x7f2d('0x52')]['read']=!![];_0x246287[_0x7f2d('0x52')][_0x7f2d('0x7a')]=moment()[_0x7f2d('0x76')](_0x7f2d('0x7b'));_0x246287[_0x7f2d('0x52')][_0x7f2d('0x7c')]=_0x246287[_0x7f2d('0x52')][_0x7f2d('0x7c')]||_0x246287['user']['id'];return db['MailMessage']['find']({'where':{'id':_0x246287[_0x7f2d('0x53')]['id'],'UserId':null},'include':[{'model':db[_0x7f2d('0x70')],'as':_0x7f2d('0x7d')}]})['then'](handleEntityNotFound(_0x3fb74b,null))[_0x7f2d('0x33')](saveUpdates(_0x246287[_0x7f2d('0x52')],null))[_0x7f2d('0x33')](function(_0x5e1fa0){if(_0x5e1fa0){_0x3d4fc4[_0x7f2d('0x22')]=_0x5e1fa0[_0x7f2d('0x7e')]({'plain':!![]});return db[_0x7f2d('0x7f')][_0x7f2d('0x51')]({'where':{'id':_0x5e1fa0[_0x7f2d('0x80')]}});}return null;})[_0x7f2d('0x33')](handleEntityNotFound(_0x3fb74b,null))[_0x7f2d('0x33')](function(_0x3f7429){if(_0x3f7429){return _0x3f7429[_0x7f2d('0x31')]({'UserId':_0x246287[_0x7f2d('0x52')][_0x7f2d('0x7c')],'read1stAt':_[_0x7f2d('0x63')](_0x3f7429['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7f2d('0x33')](function(_0x4bcbbe){if(_0x4bcbbe){_0x3d4fc4[_0x7f2d('0x81')]=_0x4bcbbe[_0x7f2d('0x7e')]({'plain':!![]});interaction_log[_0x7f2d('0x24')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x246287[_0x7f2d('0x69')]['id'],_0x246287[_0x7f2d('0x69')][_0x7f2d('0x35')],_0x246287[_0x7f2d('0x69')]['role'],_0x3d4fc4[_0x7f2d('0x81')]['id'],_0x246287[_0x7f2d('0x52')]?JSON[_0x7f2d('0x20')](_0x246287[_0x7f2d('0x52')]):'null');return respondWithRpcPromise('AcceptMessage',_0x7f2d('0x82'),_0x3d4fc4);}return null;})['then'](function(_0x121551){if(_0x121551){if(_0x246287[_0x7f2d('0x52')][_0x7f2d('0x83')]){_0x3d4fc4[_0x7f2d('0x22')][_0x7f2d('0x84')]=util[_0x7f2d('0x76')](_0x7f2d('0x85'),_0x246287[_0x7f2d('0x69')][_0x7f2d('0x35')]);_0x3d4fc4[_0x7f2d('0x22')]['channel']=_0x3d4fc4[_0x7f2d('0x86')];_0x3d4fc4[_0x7f2d('0x22')][_0x7f2d('0x87')]=_0x7f2d('0x78');return respondWithRpcPromise(_0x7f2d('0x88'),_0x7f2d('0x88'),{'event':_0x7f2d('0x89'),'message':_0x3d4fc4['message']},client9002)[_0x7f2d('0x33')](function(){return _0x3d4fc4;});}return _0x3d4fc4;}return null;})[_0x7f2d('0x33')](respondWithResult(_0x3fb74b,null))[_0x7f2d('0x4e')](handleError(_0x3fb74b,null));};var interaction_log=require(_0x7f2d('0x11'))(_0x7f2d('0x77'));exports[_0x7f2d('0x2f')]=function(_0x2ad695,_0x493b5f,_0x2f8cf9){var _0x454d0d={'agent':{},'channel':_0x7f2d('0x79')};if(_0x2ad695[_0x7f2d('0x52')]['id']){delete _0x2ad695[_0x7f2d('0x52')]['id'];}_0x2ad695[_0x7f2d('0x52')][_0x7f2d('0x7c')]=_0x2ad695[_0x7f2d('0x52')][_0x7f2d('0x7c')]||_0x2ad695[_0x7f2d('0x69')]['id'];_0x454d0d['agent']['id']=_0x2ad695['body'][_0x7f2d('0x7c')];return db[_0x7f2d('0x38')][_0x7f2d('0x51')]({'where':{'id':_0x2ad695[_0x7f2d('0x53')]['id'],'UserId':null}})[_0x7f2d('0x33')](handleEntityNotFound(_0x493b5f,null))[_0x7f2d('0x33')](function(_0x578564){if(_0x578564){_0x454d0d[_0x7f2d('0x22')]=_0x578564['get']({'plain':!![]});return db[_0x7f2d('0x7f')][_0x7f2d('0x51')]({'where':{'id':_0x578564[_0x7f2d('0x80')]}});}return null;})[_0x7f2d('0x33')](handleEntityNotFound(_0x493b5f,null))[_0x7f2d('0x33')](function(_0x3e0e66){if(_0x3e0e66){_0x454d0d[_0x7f2d('0x81')]=_0x3e0e66[_0x7f2d('0x7e')]({'plain':!![]});interaction_log[_0x7f2d('0x24')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2ad695['user']['id'],_0x2ad695[_0x7f2d('0x69')][_0x7f2d('0x35')],_0x2ad695[_0x7f2d('0x69')][_0x7f2d('0x8a')],_0x454d0d['interaction']['id'],_0x2ad695[_0x7f2d('0x52')]?JSON[_0x7f2d('0x20')](_0x2ad695[_0x7f2d('0x52')]):_0x7f2d('0x8b'));return respondWithRpcPromise(_0x7f2d('0x8c'),'rejectMessage',_0x454d0d);}return null;})[_0x7f2d('0x33')](function(_0x18194c){if(_0x18194c){_0x18194c[_0x7f2d('0x22')]['interface']=util['format'](_0x7f2d('0x85'),_0x2ad695[_0x7f2d('0x69')][_0x7f2d('0x35')]);_0x18194c[_0x7f2d('0x22')][_0x7f2d('0x86')]=_0x454d0d[_0x7f2d('0x86')];_0x18194c[_0x7f2d('0x22')]['event']='reject';respondWithRpcPromise(_0x7f2d('0x88'),_0x7f2d('0x88'),{'event':'rejectmessage','message':_0x18194c['message']},client9002);return _0x454d0d;}return null;})[_0x7f2d('0x33')](respondWithResult(_0x493b5f,null))['catch'](handleError(_0x493b5f,null));};exports[_0x7f2d('0x8d')]=function(_0x2ee829,_0x6fe352){var _0x32b442=moment()['unix']()[_0x7f2d('0x8e')]();var _0x4c8154=path['join'](config['root'],_0x7f2d('0x8f'),_0x7f2d('0x90'),'tmp');var _0x2e032f=path[_0x7f2d('0x6d')](config[_0x7f2d('0x91')],'server',_0x7f2d('0x90'),_0x7f2d('0x6c'));var _0x3cb7bc=util[_0x7f2d('0x76')](_0x7f2d('0x92'),_0x32b442);return db[_0x7f2d('0x38')][_0x7f2d('0x51')]({'where':{'id':_0x2ee829[_0x7f2d('0x53')]['id']},'attributes':['id',_0x7f2d('0x52'),'from','to','cc',_0x7f2d('0x93'),_0x7f2d('0x94'),_0x7f2d('0x95')],'include':_0x2ee829[_0x7f2d('0x3e')][_0x7f2d('0x6c')]?[{'model':db[_0x7f2d('0x96')],'as':'Attachments'}]:undefined})[_0x7f2d('0x33')](handleEntityNotFound(_0x6fe352,null))[_0x7f2d('0x33')](function(_0x123970){if(_0x123970){var _0x55baf8=_0x123970;var _0x324380={'from':_0x55baf8[_0x7f2d('0x97')],'to':_0x55baf8['to'],'subject':_0x55baf8[_0x7f2d('0x94')],'html':_0x55baf8['body'],'headers':{'Date':moment(_0x55baf8[_0x7f2d('0x95')])[_0x7f2d('0x76')](_0x7f2d('0x98'))},'attachments':[]};if(_0x123970['cc']){_0x324380['headers']['Cc']=_0x123970['cc'];}if(_0x123970[_0x7f2d('0x93')]){_0x324380[_0x7f2d('0x99')][_0x7f2d('0x9a')]=_0x123970[_0x7f2d('0x93')];}return new BPromise(function(_0x4c4d89,_0x424d84){if(_0x123970[_0x7f2d('0x9b')]){for(var _0x439ba6=0x0;_0x439ba6<_0x123970[_0x7f2d('0x9b')][_0x7f2d('0x43')];_0x439ba6++){var _0x654d6c=_0x123970[_0x7f2d('0x9b')][_0x439ba6];var _0x5a4069=path[_0x7f2d('0x6d')](_0x2e032f,_0x654d6c['basename']);if(fs[_0x7f2d('0x9c')](_0x5a4069)){_0x324380[_0x7f2d('0x6c')][_0x7f2d('0x9d')]({'name':_0x654d6c['name'],'contentType':_0x654d6c[_0x7f2d('0x3a')],'data':fs[_0x7f2d('0x9e')](_0x5a4069)});}}}emlformat[_0x7f2d('0x9f')](_0x324380,function(_0x418a26,_0x3251e8){if(_0x418a26)return _0x424d84(_0x418a26);fs['writeFileSync'](path[_0x7f2d('0x6d')](_0x4c8154,_0x3cb7bc),_0x3251e8);return _0x4c4d89(_0x3251e8);});});}})[_0x7f2d('0x33')](function(_0x485838){if(_0x485838){return _0x6fe352[_0x7f2d('0x8d')](path[_0x7f2d('0x6d')](_0x4c8154,_0x3cb7bc),_0x3cb7bc,function(_0x1ac7bc){if(_0x1ac7bc){console[_0x7f2d('0xa0')]('err',_0x1ac7bc);}else{fs[_0x7f2d('0xa1')](path['join'](_0x4c8154,_0x3cb7bc));}});}})[_0x7f2d('0x4e')](handleError(_0x6fe352,null));};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js
index dd8c17f..172c0e7 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 _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
+var _0x4eb2=['setMaxListeners','save','remove','emit','hook','exports','events','../../mysqldb','MailMessage'];(function(_0x5564aa,_0x521816){var _0x42fcd4=function(_0x3d657){while(--_0x3d657){_0x5564aa['push'](_0x5564aa['shift']());}};_0x42fcd4(++_0x521816);}(_0x4eb2,0xcc));var _0x24eb=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x4eb2[_0x173d7e];return _0x2220d6;};'use strict';var EventEmitter=require(_0x24eb('0x0'));var MailMessage=require(_0x24eb('0x1'))['db'][_0x24eb('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x24eb('0x3')](0x0);var events={'afterCreate':_0x24eb('0x4'),'afterUpdate':'update','afterDestroy':_0x24eb('0x5')};function emitEvent(_0xadaff0){return function(_0x4c6dbd,_0x2269fd,_0x3cfde8){MailMessageEvents['emit'](_0xadaff0+':'+_0x4c6dbd['id'],_0x4c6dbd);MailMessageEvents[_0x24eb('0x6')](_0xadaff0,_0x4c6dbd);_0x3cfde8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x24eb('0x7')](e,emitEvent(event));}}module[_0x24eb('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 1ab9e93..fcbce52 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 _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
+var _0x3670=['request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','get','direction','toLowerCase','out','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3670,0xd4));var _0x0367=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3670[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x0367('0x0'));var util=require(_0x0367('0x1'));var logger=require(_0x0367('0x2'))('api');var moment=require(_0x0367('0x3'));var BPromise=require(_0x0367('0x4'));var rp=require(_0x0367('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x0367('0x6'));var rimraf=require(_0x0367('0x7'));var config=require(_0x0367('0x8'));var attributes=require(_0x0367('0x9'));module['exports']=function(_0x4e00cc,_0x5c2aa3){return _0x4e00cc[_0x0367('0xa')]('MailMessage',attributes,{'tableName':_0x0367('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x0367('0xc')]},{'name':_0x0367('0xd'),'fields':[_0x0367('0xe'),_0x0367('0xf')],'type':_0x0367('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3f0203,_0x51de62,_0x33718c){if(_0x3f0203[_0x0367('0x11')]){_0x3f0203[_0x0367('0xe')]=htmlToText['fromString'](_0x3f0203[_0x0367('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x33718c(null,_0x51de62);},'afterCreate':function(_0x42756f,_0x33b6b2,_0xd59ee9){var _0x29128c=_0x4e00cc['models'];var _0x3b8195=_0x42756f[_0x0367('0x12')]({'plain':!![]});if(_0x3b8195[_0x0367('0x13')][_0x0367('0x14')]()==='in'||_0x3b8195['direction'][_0x0367('0x14')]()===_0x0367('0x15')&&!_0x3b8195['secret']&&!_['isNil'](_0x3b8195[_0x0367('0x16')])){_0x29128c[_0x0367('0x17')][_0x0367('0x18')]({'where':{'id':_0x3b8195[_0x0367('0x19')]}})[_0x0367('0x1a')](function(_0x2c6f5a){if(_0x2c6f5a){_0x2c6f5a[_0x0367('0x1b')]({'lastMsgAt':_0x3b8195[_0x0367('0x1c')],'lastMsgDirection':_0x3b8195[_0x0367('0x13')][_0x0367('0x14')](),'lastMsgBody':_0x3b8195[_0x0367('0x11')]});}})[_0x0367('0x1d')](function(_0x27e7e0){console['error'](_0x27e7e0);});}_0xd59ee9();}},'charset':_0x0367('0x1e'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js
index b7daf16..fd35f36 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 _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
+var _0xd819=['message','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','then','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s'];(function(_0x3bb4fe,_0x37dbb9){var _0x2e28f2=function(_0x497654){while(--_0x497654){_0x3bb4fe['push'](_0x3bb4fe['shift']());}};_0x2e28f2(++_0x37dbb9);}(_0xd819,0x181));var _0x9d81=function(_0x26f68f,_0x125079){_0x26f68f=_0x26f68f-0x0;var _0x3047dd=_0xd819[_0x26f68f];return _0x3047dd;};'use strict';var _=require('lodash');var util=require(_0x9d81('0x0'));var moment=require(_0x9d81('0x1'));var BPromise=require(_0x9d81('0x2'));var rs=require(_0x9d81('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d81('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9d81('0x5'))('rpc');var config=require(_0x9d81('0x6'));var jayson=require(_0x9d81('0x7'));var client=jayson[_0x9d81('0x8')]['http']({'port':0x232a});config[_0x9d81('0x9')]=_[_0x9d81('0xa')](config[_0x9d81('0x9')],{'host':_0x9d81('0xb'),'port':0x18eb});var socket=require(_0x9d81('0xc'))(new Redis(config[_0x9d81('0x9')]));require(_0x9d81('0xd'))[_0x9d81('0xe')](socket);function respondWithRpcPromise(_0x25a4c0,_0x3932e7,_0x17a3a3){return new BPromise(function(_0x44bba4,_0x404b15){return client[_0x9d81('0xf')](_0x25a4c0,_0x17a3a3)['then'](function(_0x139d28){logger[_0x9d81('0x10')]('MailMessage,\x20%s,\x20%s',_0x3932e7,_0x9d81('0x11'));logger[_0x9d81('0x12')](_0x9d81('0x13'),_0x3932e7,_0x9d81('0x11'),JSON['stringify'](_0x139d28));if(_0x139d28[_0x9d81('0x14')]){if(_0x139d28['error'][_0x9d81('0x15')]===0x1f4){logger['error'](_0x9d81('0x16'),_0x3932e7,_0x139d28[_0x9d81('0x14')]['message']);return _0x404b15(_0x139d28[_0x9d81('0x14')][_0x9d81('0x17')]);}logger[_0x9d81('0x14')](_0x9d81('0x16'),_0x3932e7,_0x139d28[_0x9d81('0x14')][_0x9d81('0x17')]);return _0x44bba4(_0x139d28[_0x9d81('0x14')][_0x9d81('0x17')]);}else{logger['info'](_0x9d81('0x16'),_0x3932e7,_0x9d81('0x11'));_0x44bba4(_0x139d28[_0x9d81('0x18')][_0x9d81('0x17')]);}})[_0x9d81('0x19')](function(_0x49e4c9){logger['error'](_0x9d81('0x16'),_0x3932e7,_0x49e4c9);_0x404b15(_0x49e4c9);});});}exports[_0x9d81('0x1a')]=function(_0x3104ad){var _0x40960c=this;return new Promise(function(_0x409720,_0x175d4f){return db[_0x9d81('0x1b')][_0x9d81('0x1c')](_0x3104ad[_0x9d81('0x1d')],{'raw':_0x3104ad[_0x9d81('0x1e')]?_0x3104ad[_0x9d81('0x1e')][_0x9d81('0x1f')]===undefined?!![]:![]:!![]})[_0x9d81('0x20')](function(_0x4a9c9c){logger[_0x9d81('0x10')](_0x9d81('0x1a'),_0x3104ad);logger[_0x9d81('0x12')](_0x9d81('0x1a'),_0x3104ad,JSON[_0x9d81('0x21')](_0x4a9c9c));_0x409720(_0x4a9c9c);})[_0x9d81('0x19')](function(_0x3d7be7){logger[_0x9d81('0x14')]('CreateMailMessage',_0x3d7be7[_0x9d81('0x17')],_0x3104ad);_0x175d4f(_0x40960c[_0x9d81('0x14')](0x1f4,_0x3d7be7[_0x9d81('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js
index 19b0a70..68fdd07 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 _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
+var _0x45a0=['length','mailMessage:','./mailMessage.events','save','update','emit'];(function(_0x1b6d5a,_0x5e1ebe){var _0x3a601c=function(_0x341f43){while(--_0x341f43){_0x1b6d5a['push'](_0x1b6d5a['shift']());}};_0x3a601c(++_0x5e1ebe);}(_0x45a0,0x1e8));var _0x045a=function(_0x369c01,_0x2acc02){_0x369c01=_0x369c01-0x0;var _0x50cbbf=_0x45a0[_0x369c01];return _0x50cbbf;};'use strict';var MailMessageEvents=require(_0x045a('0x0'));var events=[_0x045a('0x1'),'remove',_0x045a('0x2')];function createListener(_0x559991,_0x4b39ae){return function(_0x51295f){_0x4b39ae[_0x045a('0x3')](_0x559991,_0x51295f);};}function removeListener(_0x19f6c5,_0x34c3cd){return function(){MailMessageEvents['removeListener'](_0x19f6c5,_0x34c3cd);};}exports['register']=function(_0x5ada11){for(var _0x2f94ff=0x0,_0x2af007=events[_0x045a('0x4')];_0x2f94ff<_0x2af007;_0x2f94ff++){var _0x31014f=events[_0x2f94ff];var _0x35cad9=createListener(_0x045a('0x5')+_0x31014f,_0x5ada11);MailMessageEvents['on'](_0x31014f,_0x35cad9);}};
\ No newline at end of file
diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js
index 578ac87..56891d1 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 _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
+var _0xb56c=['Router','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express'];(function(_0x349819,_0x2d5a50){var _0x478c0d=function(_0x2e50a3){while(--_0x2e50a3){_0x349819['push'](_0x349819['shift']());}};_0x478c0d(++_0x2d5a50);}(_0xb56c,0x18f));var _0xcb56=function(_0x3299d1,_0x545733){_0x3299d1=_0x3299d1-0x0;var _0x44356e=_0xb56c[_0x3299d1];return _0x44356e;};'use strict';var multer=require(_0xcb56('0x0'));var util=require(_0xcb56('0x1'));var path=require('path');var timeout=require(_0xcb56('0x2'));var express=require(_0xcb56('0x3'));var router=express[_0xcb56('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xcb56('0x5'));var config=require(_0xcb56('0x6'));var controller=require(_0xcb56('0x7'));router[_0xcb56('0x8')]('/',auth['isAuthenticated'](),controller[_0xcb56('0x9')]);router[_0xcb56('0x8')](_0xcb56('0xa'),auth[_0xcb56('0xb')](),controller[_0xcb56('0xc')]);router[_0xcb56('0x8')](_0xcb56('0xd'),auth[_0xcb56('0xb')](),controller[_0xcb56('0xe')]);router[_0xcb56('0x8')](_0xcb56('0xf'),auth[_0xcb56('0xb')](),controller[_0xcb56('0x10')]);router[_0xcb56('0x8')](_0xcb56('0x11'),auth[_0xcb56('0xb')](),controller[_0xcb56('0x12')]);router[_0xcb56('0x8')](_0xcb56('0x13'),auth[_0xcb56('0xb')](),controller[_0xcb56('0x14')]);router[_0xcb56('0x15')]('/',auth[_0xcb56('0xb')](),controller[_0xcb56('0x16')]);router[_0xcb56('0x15')](_0xcb56('0x11'),auth[_0xcb56('0xb')](),controller[_0xcb56('0x17')]);router[_0xcb56('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0xcb56('0x18')]);router[_0xcb56('0x19')](_0xcb56('0xd'),auth[_0xcb56('0xb')](),controller[_0xcb56('0x1a')]);router[_0xcb56('0x1b')](_0xcb56('0xd'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xcb56('0x11'),auth[_0xcb56('0xb')](),controller[_0xcb56('0x1c')]);router[_0xcb56('0x1b')](_0xcb56('0x13'),auth[_0xcb56('0xb')](),controller[_0xcb56('0x1d')]);module[_0xcb56('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js
index 3cc3abb..a5993fa 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 _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
+var _0x09d2=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x3125d4,_0x4e2faa){var _0x4d87e9=function(_0xa18ff1){while(--_0xa18ff1){_0x3125d4['push'](_0x3125d4['shift']());}};_0x4d87e9(++_0x4e2faa);}(_0x09d2,0x1d2));var _0x209d=function(_0x3fb178,_0x33631b){_0x3fb178=_0x3fb178-0x0;var _0x512966=_0x09d2[_0x3fb178];return _0x512966;};'use strict';var Sequelize=require(_0x209d('0x0'));module[_0x209d('0x1')]={'name':{'type':Sequelize[_0x209d('0x2')],'unique':_0x209d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x209d('0x2')]},'timeout':{'type':Sequelize[_0x209d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x209d('0x5')](_0x209d('0x6'),_0x209d('0x7'),_0x209d('0x8'))}};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js
index 7c65918..b739d1e 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 _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
+var _0xad96=['send','MailQueue','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','user','role','MailQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserMailQueue','MailQueueId','findAndCountAll','agent','mailPause','updatedAt','createdAt','%s/%s','getTeams','Team','ids','Agents','online','voicePause','flatMap','get','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','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','QueryTypes','SELECT','includes','all','union','value','isEmpty','userMailQueue:remove','addAgents','spread','userMailQueue:save','removeAgents','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','stack','name'];(function(_0x105642,_0x7d2cac){var _0x507156=function(_0x43767f){while(--_0x43767f){_0x105642['push'](_0x105642['shift']());}};_0x507156(++_0x7d2cac);}(_0xad96,0x17b));var _0x6ad9=function(_0x3a0a97,_0x82ccf2){_0x3a0a97=_0x3a0a97-0x0;var _0x46f4e1=_0xad96[_0x3a0a97];return _0x46f4e1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6ad9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6ad9('0x1'));var jsonpatch=require(_0x6ad9('0x2'));var rp=require(_0x6ad9('0x3'));var moment=require('moment');var BPromise=require(_0x6ad9('0x4'));var Mustache=require(_0x6ad9('0x5'));var util=require(_0x6ad9('0x6'));var path=require('path');var sox=require(_0x6ad9('0x7'));var csv=require(_0x6ad9('0x8'));var ejs=require(_0x6ad9('0x9'));var fs=require('fs');var _=require(_0x6ad9('0xa'));var squel=require('squel');var crypto=require(_0x6ad9('0xb'));var jsforce=require(_0x6ad9('0xc'));var deskjs=require(_0x6ad9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6ad9('0xe'));var Papa=require(_0x6ad9('0xf'));var Redis=require(_0x6ad9('0x10'));var authService=require(_0x6ad9('0x11'));var qs=require(_0x6ad9('0x12'));var as=require(_0x6ad9('0x13'));var hardwareService=require(_0x6ad9('0x14'));var logger=require(_0x6ad9('0x15'))(_0x6ad9('0x16'));var utils=require('../../config/utils');var config=require(_0x6ad9('0x17'));var db=require('../../mysqldb')['db'];config[_0x6ad9('0x18')]=_[_0x6ad9('0x19')](config['redis'],{'host':_0x6ad9('0x1a'),'port':0x18eb});var socket=require(_0x6ad9('0x1b'))(new Redis(config[_0x6ad9('0x18')]));require(_0x6ad9('0x1c'))[_0x6ad9('0x1d')](socket);function respondWithStatusCode(_0x279a83,_0x2de8a1){_0x2de8a1=_0x2de8a1||0xcc;return function(_0x2e58e6){if(_0x2e58e6){return _0x279a83[_0x6ad9('0x1e')](_0x2de8a1);}return _0x279a83[_0x6ad9('0x1f')](_0x2de8a1)[_0x6ad9('0x20')]();};}function respondWithResult(_0x3c24b2,_0x2e6b38){_0x2e6b38=_0x2e6b38||0xc8;return function(_0x2f40ef){if(_0x2f40ef){return _0x3c24b2[_0x6ad9('0x1f')](_0x2e6b38)[_0x6ad9('0x21')](_0x2f40ef);}};}function respondWithFilteredResult(_0x22921c,_0x390287){return function(_0x5c9452){if(_0x5c9452){var _0x35d3d9=_0x5c9452[_0x6ad9('0x22')],_0x55c417=_0x390287['offset'],_0x36aee7=_0x390287[_0x6ad9('0x23')]+_0x390287['limit'],_0x5383a7;if(_0x36aee7>=_0x35d3d9){_0x36aee7=_0x35d3d9;_0x5383a7=0xc8;}else{_0x5383a7=0xce;}_0x22921c[_0x6ad9('0x1f')](_0x5383a7);return _0x22921c[_0x6ad9('0x24')](_0x6ad9('0x25'),_0x55c417+'-'+_0x36aee7+'/'+_0x35d3d9)[_0x6ad9('0x21')](_0x5c9452);}return null;};}function patchUpdates(_0x31b85d){return function(_0x44f240){try{jsonpatch[_0x6ad9('0x26')](_0x44f240,_0x31b85d,!![]);}catch(_0x2b8f01){return BPromise[_0x6ad9('0x27')](_0x2b8f01);}return _0x44f240[_0x6ad9('0x28')]();};}function saveUpdates(_0x5cd72a,_0xffe200){return function(_0x208091){if(_0x208091){return _0x208091[_0x6ad9('0x29')](_0x5cd72a)[_0x6ad9('0x2a')](function(_0x89813){return _0x89813;});}return null;};}function removeEntity(_0x1691b1,_0x551360){return function(_0x3887ca){if(_0x3887ca){return _0x3887ca[_0x6ad9('0x2b')]()[_0x6ad9('0x2a')](function(){var _0x1dc549=_0x3887ca['get']({'plain':!![]});var _0x5bf431='MailQueues';return db[_0x6ad9('0x2c')][_0x6ad9('0x2b')]({'where':{'type':_0x5bf431,'resourceId':_0x1dc549['id']}})[_0x6ad9('0x2a')](function(){return _0x3887ca;});})[_0x6ad9('0x2a')](function(){_0x1691b1[_0x6ad9('0x1f')](0xcc)[_0x6ad9('0x20')]();});}};}function handleEntityNotFound(_0x593c59,_0x496ec0){return function(_0x151512){if(!_0x151512){_0x593c59[_0x6ad9('0x1e')](0x194);}return _0x151512;};}function handleError(_0x126cca,_0x14e7f5){_0x14e7f5=_0x14e7f5||0x1f4;return function(_0x17c19d){logger['error'](_0x17c19d[_0x6ad9('0x2d')]);if(_0x17c19d[_0x6ad9('0x2e')]){delete _0x17c19d[_0x6ad9('0x2e')];}_0x126cca[_0x6ad9('0x1f')](_0x14e7f5)[_0x6ad9('0x2f')](_0x17c19d);};}exports['index']=function(_0x78fc7c,_0x4d424b){var _0x52dcab={},_0x7ed1ab={},_0x39daa3={'count':0x0,'rows':[]};var _0x541325=_['map'](db[_0x6ad9('0x30')][_0x6ad9('0x31')],function(_0x40ea15){return{'name':_0x40ea15['fieldName'],'type':_0x40ea15['type'][_0x6ad9('0x32')]};});_0x7ed1ab[_0x6ad9('0x33')]=_[_0x6ad9('0x34')](_0x541325,'name');_0x7ed1ab[_0x6ad9('0x35')]=_[_0x6ad9('0x36')](_0x78fc7c[_0x6ad9('0x35')]);_0x7ed1ab[_0x6ad9('0x37')]=_[_0x6ad9('0x38')](_0x7ed1ab[_0x6ad9('0x33')],_0x7ed1ab[_0x6ad9('0x35')]);_0x52dcab[_0x6ad9('0x39')]=_['intersection'](_0x7ed1ab[_0x6ad9('0x33')],qs[_0x6ad9('0x3a')](_0x78fc7c[_0x6ad9('0x35')][_0x6ad9('0x3a')]));_0x52dcab['attributes']=_0x52dcab[_0x6ad9('0x39')][_0x6ad9('0x3b')]?_0x52dcab['attributes']:_0x7ed1ab[_0x6ad9('0x33')];if(!_0x78fc7c[_0x6ad9('0x35')][_0x6ad9('0x3c')](_0x6ad9('0x3d'))){_0x52dcab['limit']=qs[_0x6ad9('0x3e')](_0x78fc7c[_0x6ad9('0x35')][_0x6ad9('0x3e')]);_0x52dcab[_0x6ad9('0x23')]=qs['offset'](_0x78fc7c[_0x6ad9('0x35')][_0x6ad9('0x23')]);}_0x52dcab[_0x6ad9('0x3f')]=qs[_0x6ad9('0x40')](_0x78fc7c[_0x6ad9('0x35')][_0x6ad9('0x40')]);_0x52dcab[_0x6ad9('0x41')]=qs[_0x6ad9('0x37')](_[_0x6ad9('0x42')](_0x78fc7c[_0x6ad9('0x35')],_0x7ed1ab['filters']),_0x541325);if(_0x78fc7c[_0x6ad9('0x35')][_0x6ad9('0x43')]){_0x52dcab[_0x6ad9('0x41')]=_['merge'](_0x52dcab[_0x6ad9('0x41')],{'$or':_[_0x6ad9('0x34')](_0x541325,function(_0x407162){if(_0x407162[_0x6ad9('0x44')]!=='VIRTUAL'){var _0x5a80c5={};_0x5a80c5[_0x407162[_0x6ad9('0x2e')]]={'$like':'%'+_0x78fc7c['query'][_0x6ad9('0x43')]+'%'};return _0x5a80c5;}})});}_0x52dcab=_[_0x6ad9('0x45')]({},_0x52dcab,_0x78fc7c['options']);var _0x6ff46e={'where':_0x52dcab['where']};return db[_0x6ad9('0x30')][_0x6ad9('0x22')](_0x6ff46e)[_0x6ad9('0x2a')](function(_0x204e53){_0x39daa3[_0x6ad9('0x22')]=_0x204e53;if(_0x78fc7c[_0x6ad9('0x35')]['includeAll']){_0x52dcab[_0x6ad9('0x46')]=[{'all':!![]}];}return db[_0x6ad9('0x30')][_0x6ad9('0x47')](_0x52dcab);})[_0x6ad9('0x2a')](function(_0x4ec8cd){_0x39daa3[_0x6ad9('0x48')]=_0x4ec8cd;return _0x39daa3;})[_0x6ad9('0x2a')](respondWithFilteredResult(_0x4d424b,_0x52dcab))[_0x6ad9('0x49')](handleError(_0x4d424b,null));};exports[_0x6ad9('0x4a')]=function(_0x556b33,_0x2aded0){var _0x21d767={'raw':!![],'where':{'id':_0x556b33[_0x6ad9('0x4b')]['id']}},_0x5ac249={};_0x5ac249[_0x6ad9('0x33')]=_[_0x6ad9('0x36')](db['MailQueue'][_0x6ad9('0x31')]);_0x5ac249[_0x6ad9('0x35')]=_[_0x6ad9('0x36')](_0x556b33[_0x6ad9('0x35')]);_0x5ac249['filters']=_['intersection'](_0x5ac249[_0x6ad9('0x33')],_0x5ac249[_0x6ad9('0x35')]);_0x21d767[_0x6ad9('0x39')]=_[_0x6ad9('0x38')](_0x5ac249[_0x6ad9('0x33')],qs[_0x6ad9('0x3a')](_0x556b33[_0x6ad9('0x35')][_0x6ad9('0x3a')]));_0x21d767['attributes']=_0x21d767['attributes'][_0x6ad9('0x3b')]?_0x21d767[_0x6ad9('0x39')]:_0x5ac249[_0x6ad9('0x33')];if(_0x556b33['query'][_0x6ad9('0x4c')]){_0x21d767[_0x6ad9('0x46')]=[{'all':!![]}];}_0x21d767=_[_0x6ad9('0x45')]({},_0x21d767,_0x556b33[_0x6ad9('0x4d')]);return db[_0x6ad9('0x30')][_0x6ad9('0x4e')](_0x21d767)[_0x6ad9('0x2a')](handleEntityNotFound(_0x2aded0,null))[_0x6ad9('0x2a')](respondWithResult(_0x2aded0,null))[_0x6ad9('0x49')](handleError(_0x2aded0,null));};exports[_0x6ad9('0x4f')]=function(_0x53206e,_0x252ef8){return db['MailQueue']['create'](_0x53206e['body'],{})[_0x6ad9('0x2a')](function(_0x3e65d5){var _0x2e81ea=_0x53206e[_0x6ad9('0x50')]['get']({'plain':!![]});if(!_0x2e81ea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e81ea[_0x6ad9('0x51')]===_0x6ad9('0x50')){var _0x2cea96=_0x3e65d5['get']({'plain':!![]});var _0x50fd7c=_0x6ad9('0x52');return db[_0x6ad9('0x53')]['find']({'where':{'name':_0x50fd7c,'userProfileId':_0x2e81ea[_0x6ad9('0x54')]},'raw':!![]})['then'](function(_0x311f7d){if(_0x311f7d&&_0x311f7d[_0x6ad9('0x55')]===0x0){return db[_0x6ad9('0x2c')]['create']({'name':_0x2cea96['name'],'resourceId':_0x2cea96['id'],'type':_0x311f7d[_0x6ad9('0x2e')],'sectionId':_0x311f7d['id']},{})[_0x6ad9('0x2a')](function(){return _0x3e65d5;});}else{return _0x3e65d5;}})[_0x6ad9('0x49')](function(_0x235fa2){logger[_0x6ad9('0x56')](_0x6ad9('0x57'),_0x235fa2);throw _0x235fa2;});}return _0x3e65d5;})[_0x6ad9('0x2a')](respondWithResult(_0x252ef8,0xc9))[_0x6ad9('0x49')](handleError(_0x252ef8,null));};exports[_0x6ad9('0x29')]=function(_0x59919a,_0x99325){if(_0x59919a[_0x6ad9('0x58')]['id']){delete _0x59919a[_0x6ad9('0x58')]['id'];}return db[_0x6ad9('0x30')][_0x6ad9('0x4e')]({'where':{'id':_0x59919a[_0x6ad9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x99325,null))['then'](saveUpdates(_0x59919a[_0x6ad9('0x58')],null))[_0x6ad9('0x2a')](respondWithResult(_0x99325,null))[_0x6ad9('0x49')](handleError(_0x99325,null));};exports[_0x6ad9('0x2b')]=function(_0x296af3,_0x4c976d){return db[_0x6ad9('0x30')]['find']({'where':{'id':_0x296af3[_0x6ad9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4c976d,null))['then'](removeEntity(_0x4c976d,null))['catch'](handleError(_0x4c976d,null));};exports[_0x6ad9('0x59')]=function(_0x509478,_0x1eac45){return db[_0x6ad9('0x30')][_0x6ad9('0x59')]()['then'](respondWithResult(_0x1eac45,null))[_0x6ad9('0x49')](handleError(_0x1eac45,null));};exports[_0x6ad9('0x5a')]=function(_0x5f230e,_0x34677b,_0x16cce3){var _0x4940ae={'raw':!![],'where':{}},_0xeee3e3={},_0x467fe1;return db['MailQueue'][_0x6ad9('0x5b')]({'where':{'id':_0x5f230e['params']['id']}})[_0x6ad9('0x2a')](handleEntityNotFound(_0x34677b,null))[_0x6ad9('0x2a')](function(_0x25e441){if(_0x25e441){_0x467fe1=_0x25e441['get']({'plain':!![]});_0xeee3e3[_0x6ad9('0x33')]=_[_0x6ad9('0x36')](db[_0x6ad9('0x5c')]['rawAttributes']);_0xeee3e3[_0x6ad9('0x35')]=_[_0x6ad9('0x36')](_0x5f230e[_0x6ad9('0x35')]);_0xeee3e3[_0x6ad9('0x37')]=_[_0x6ad9('0x38')](_0xeee3e3[_0x6ad9('0x33')],_0xeee3e3[_0x6ad9('0x35')]);_0x4940ae[_0x6ad9('0x39')]=_[_0x6ad9('0x38')](_0xeee3e3[_0x6ad9('0x33')],qs[_0x6ad9('0x3a')](_0x5f230e['query'][_0x6ad9('0x3a')]));_0x4940ae[_0x6ad9('0x39')]=_0x4940ae['attributes']['length']?_0x4940ae['attributes']:_0xeee3e3[_0x6ad9('0x33')];if(!_0x5f230e[_0x6ad9('0x35')][_0x6ad9('0x3c')](_0x6ad9('0x3d'))){_0x4940ae[_0x6ad9('0x3e')]=qs[_0x6ad9('0x3e')](_0x5f230e[_0x6ad9('0x35')][_0x6ad9('0x3e')]);_0x4940ae['offset']=qs[_0x6ad9('0x23')](_0x5f230e['query']['offset']);}_0x4940ae[_0x6ad9('0x3f')]=qs['sort'](_0x5f230e[_0x6ad9('0x35')][_0x6ad9('0x40')]);_0x4940ae[_0x6ad9('0x41')]=qs[_0x6ad9('0x37')](_['pick'](_0x5f230e[_0x6ad9('0x35')],_0xeee3e3[_0x6ad9('0x37')]));_0x4940ae['where'][_0x6ad9('0x5d')]=_0x25e441['id'];if(_0x5f230e[_0x6ad9('0x35')][_0x6ad9('0x43')]){_0x4940ae[_0x6ad9('0x41')]=_[_0x6ad9('0x45')](_0x4940ae[_0x6ad9('0x41')],{'$or':_[_0x6ad9('0x34')](_0x4940ae[_0x6ad9('0x39')],function(_0x49bb4a){var _0x16fef7={};_0x16fef7[_0x49bb4a]={'$like':'%'+_0x5f230e[_0x6ad9('0x35')][_0x6ad9('0x43')]+'%'};return _0x16fef7;})});}_0x4940ae=_['merge']({},_0x4940ae,_0x5f230e['options']);return db[_0x6ad9('0x5c')][_0x6ad9('0x47')](_0x4940ae);}})['then'](function(_0x22ce1f){if(_0x22ce1f){return db['User'][_0x6ad9('0x5e')]({'where':{'id':_[_0x6ad9('0x34')](_0x22ce1f,'UserId'),'role':_0x6ad9('0x5f')},'attributes':['id',_0x6ad9('0x2e'),_0x6ad9('0x60'),_0x6ad9('0x61'),_0x6ad9('0x62')]});}})[_0x6ad9('0x2a')](function(_0x2fbf45){if(_0x2fbf45){return{'count':_0x2fbf45[_0x6ad9('0x22')],'rows':_[_0x6ad9('0x34')](_0x2fbf45[_0x6ad9('0x48')],function(_0x9824c1){return{'membername':_0x9824c1[_0x6ad9('0x2e')],'UserId':_0x9824c1['id'],'queue_name':_0x467fe1['name'],'MailQueueId':_0x467fe1['id'],'interface':util['format'](_0x6ad9('0x63'),'SIP',_0x9824c1[_0x6ad9('0x2e')]),'penalty':0x0,'paused':_0x9824c1[_0x6ad9('0x60')],'createdAt':_0x9824c1['createdAt'],'updatedAt':_0x9824c1[_0x6ad9('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6ad9('0x2a')](respondWithFilteredResult(_0x34677b,_0x4940ae))['catch'](handleError(_0x34677b,null));};exports[_0x6ad9('0x64')]=function(_0x3220f2,_0x10ff2c,_0x9ee8c5){var _0x308280={};var _0x237a30={};var _0x35f95d;var _0x113a8c;return db[_0x6ad9('0x30')][_0x6ad9('0x5b')]({'where':{'id':_0x3220f2[_0x6ad9('0x4b')]['id']}})[_0x6ad9('0x2a')](handleEntityNotFound(_0x10ff2c,null))[_0x6ad9('0x2a')](function(_0x4da05c){if(_0x4da05c){_0x35f95d=_0x4da05c;_0x237a30[_0x6ad9('0x33')]=_[_0x6ad9('0x36')](db[_0x6ad9('0x65')][_0x6ad9('0x31')]);_0x237a30[_0x6ad9('0x35')]=_[_0x6ad9('0x36')](_0x3220f2['query']);_0x237a30[_0x6ad9('0x37')]=_[_0x6ad9('0x38')](_0x237a30['model'],_0x237a30[_0x6ad9('0x35')]);_0x308280[_0x6ad9('0x39')]=_['intersection'](_0x237a30['model'],qs['fields'](_0x3220f2[_0x6ad9('0x35')]['fields']));_0x308280[_0x6ad9('0x39')]=_0x308280[_0x6ad9('0x39')][_0x6ad9('0x3b')]?_0x308280[_0x6ad9('0x39')]:_0x237a30['model'];_0x308280[_0x6ad9('0x3f')]=qs[_0x6ad9('0x40')](_0x3220f2[_0x6ad9('0x35')]['sort']);_0x308280['where']=qs[_0x6ad9('0x37')](_['pick'](_0x3220f2[_0x6ad9('0x35')],_0x237a30[_0x6ad9('0x37')]));if(_0x3220f2['query']['filter']){_0x308280[_0x6ad9('0x41')]=_['merge'](_0x308280['where'],{'$or':_[_0x6ad9('0x34')](_0x308280['attributes'],function(_0x588fac){var _0x26eb17={};_0x26eb17[_0x588fac]={'$like':'%'+_0x3220f2[_0x6ad9('0x35')]['filter']+'%'};return _0x26eb17;})});}_0x308280=_[_0x6ad9('0x45')]({},_0x308280,_0x3220f2['options']);return _0x35f95d[_0x6ad9('0x64')](_0x308280);}})[_0x6ad9('0x2a')](function(_0x122041){if(_0x122041){_0x113a8c=_0x122041['length'];if(!_0x3220f2[_0x6ad9('0x35')][_0x6ad9('0x3c')](_0x6ad9('0x3d'))){_0x308280[_0x6ad9('0x3e')]=qs[_0x6ad9('0x3e')](_0x3220f2[_0x6ad9('0x35')][_0x6ad9('0x3e')]);_0x308280[_0x6ad9('0x23')]=qs['offset'](_0x3220f2[_0x6ad9('0x35')][_0x6ad9('0x23')]);}return _0x35f95d[_0x6ad9('0x64')](_0x308280);}})['then'](function(_0x4f22a0){if(_0x4f22a0){return _0x4f22a0?{'count':_0x113a8c,'rows':_0x4f22a0}:null;}})[_0x6ad9('0x2a')](respondWithResult(_0x10ff2c,null))['catch'](handleError(_0x10ff2c,null));};exports['addTeams']=function(_0x509f88,_0x2e140e,_0x3eb136){var _0x35245c=_0x509f88['body'][_0x6ad9('0x66')];return db[_0x6ad9('0x65')][_0x6ad9('0x47')]({'where':{'id':_0x35245c},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6ad9('0x67'),'attributes':['id',_0x6ad9('0x2e'),_0x6ad9('0x68'),_0x6ad9('0x69'),'interface'],'raw':!![]}]})[_0x6ad9('0x2a')](function(_0x27d695){if(_0x27d695){var _0xe3fb3a=_[_0x6ad9('0x6a')](_0x27d695,function(_0x33ab4d){var _0x2f8bdc=_0x33ab4d[_0x6ad9('0x6b')]({'plain':!![]});return _0x2f8bdc[_0x6ad9('0x67')];});return db['MailQueue'][_0x6ad9('0x4e')]({'where':{'id':_0x509f88[_0x6ad9('0x4b')]['id']}})['then'](function(_0xc3d509){return db[_0x6ad9('0x6c')][_0x6ad9('0x6d')](function(_0x158ea5){return _0xc3d509[_0x6ad9('0x6e')](_0x35245c,{'transaction':_0x158ea5})[_0x6ad9('0x2a')](function(){return BPromise[_0x6ad9('0x6f')](_0xe3fb3a,function(_0xa7d631){return db['UserMailQueue'][_0x6ad9('0x70')]({'where':{'UserId':_0xa7d631['id'],'MailQueueId':_0x509f88[_0x6ad9('0x4b')]['id']},'transaction':_0x158ea5});});})['then'](function(){_0xe3fb3a[_0x6ad9('0x71')](function(_0x540d95){socket[_0x6ad9('0x72')]('userMailQueue:save',{'UserId':_0x540d95['id'],'MailQueueId':_0xc3d509['id']});});});});});}})[_0x6ad9('0x2a')](respondWithStatusCode(_0x2e140e,null))[_0x6ad9('0x49')](handleError(_0x2e140e,null));};exports[_0x6ad9('0x73')]=function(_0x3b8d80,_0x569bb2,_0x2bd11c){return db[_0x6ad9('0x65')][_0x6ad9('0x47')]({'where':{'id':_0x3b8d80[_0x6ad9('0x35')][_0x6ad9('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6ad9('0x2a')](handleEntityNotFound(_0x569bb2,null))[_0x6ad9('0x2a')](function(_0x16abd2){var _0x3239d8=_['map'](_0x16abd2,'id');var _0x2732d9=[];var _0x4fdc69=[];var _0x135a87=squel[_0x6ad9('0x74')]();_0x135a87[_0x6ad9('0x75')](_0x6ad9('0x76'))[_0x6ad9('0x77')](_0x6ad9('0x78'),'tq')[_0x6ad9('0x79')](_0x6ad9('0x7a'),'ut',_0x6ad9('0x7b'))['where'](_0x6ad9('0x7c'),_0x3b8d80[_0x6ad9('0x4b')]['id']);for(var _0x1179c3=0x0;_0x1179c3<_0x16abd2[_0x6ad9('0x3b')];_0x1179c3+=0x1){let _0x555c62=_0x16abd2[_0x1179c3];for(var _0x4c14fe=0x0;_0x4c14fe<_0x555c62['Agents']['length'];_0x4c14fe+=0x1){let _0x34d996=_0x555c62[_0x6ad9('0x67')][_0x4c14fe];var _0x25ae96=_0x135a87[_0x6ad9('0x7d')]();_0x25ae96[_0x6ad9('0x41')](_0x6ad9('0x7e'),_0x34d996['id']);_0x4fdc69[_0x6ad9('0x7f')](db['sequelize'][_0x6ad9('0x35')](_0x25ae96['toString'](),{'type':db['sequelize'][_0x6ad9('0x80')][_0x6ad9('0x81')]})[_0x6ad9('0x2a')](function(_0x5eb101){if(_0x5eb101[_0x6ad9('0x3b')]===0x1){return _0x34d996['id'];}else{var _0x3547b9=_['every'](_[_0x6ad9('0x34')](_0x5eb101,'TeamId'),function(_0x351110){return _[_0x6ad9('0x82')](_0x3239d8,_0x351110);});if(_0x3547b9){return _0x34d996['id'];}}}));}}return BPromise[_0x6ad9('0x83')](_0x4fdc69)[_0x6ad9('0x2a')](function(_0x1a0a50){_0x2732d9=_(_0x2732d9)[_0x6ad9('0x84')](_0x1a0a50)['compact']()[_0x6ad9('0x85')]();return db[_0x6ad9('0x30')][_0x6ad9('0x4e')]({'where':{'id':_0x3b8d80[_0x6ad9('0x4b')]['id']}})[_0x6ad9('0x2a')](function(_0x230251){return db['sequelize']['transaction'](function(_0x5b3ea2){return _0x230251['removeTeams'](_0x3b8d80[_0x6ad9('0x35')][_0x6ad9('0x66')],{'transaction':_0x5b3ea2})[_0x6ad9('0x2a')](function(){if(!_[_0x6ad9('0x86')](_0x2732d9)){return _0x230251['removeAgents'](_0x2732d9,{'transaction':_0x5b3ea2});}})[_0x6ad9('0x2a')](function(){_0x2732d9[_0x6ad9('0x71')](function(_0x1da185){socket['emit'](_0x6ad9('0x87'),{'UserId':_0x1da185,'MailQueueId':_0x230251['id']});});});});});});})['then'](respondWithStatusCode(_0x569bb2,null))[_0x6ad9('0x49')](handleError(_0x569bb2,null));};exports[_0x6ad9('0x88')]=function(_0x1bd9e1,_0x3b8127,_0x1d9425){return db['MailQueue']['find']({'where':{'id':_0x1bd9e1['params']['id']}})['then'](handleEntityNotFound(_0x3b8127,null))[_0x6ad9('0x2a')](function(_0x42b925){if(_0x42b925){return _0x42b925[_0x6ad9('0x88')](_0x1bd9e1[_0x6ad9('0x58')][_0x6ad9('0x66')],_['omit'](_0x1bd9e1[_0x6ad9('0x58')],[_0x6ad9('0x66'),'id'])||{})[_0x6ad9('0x89')](function(_0x2dd8c8){for(var _0xee9e12=0x0;_0xee9e12<_0x1bd9e1['body']['ids']['length'];_0xee9e12+=0x1){socket['emit'](_0x6ad9('0x8a'),{'UserId':_0x1bd9e1[_0x6ad9('0x58')][_0x6ad9('0x66')][_0xee9e12],'MailQueueId':_0x1bd9e1[_0x6ad9('0x4b')]['id']});}return _0x2dd8c8;});}})[_0x6ad9('0x2a')](respondWithResult(_0x3b8127,null))[_0x6ad9('0x49')](handleError(_0x3b8127,null));};exports[_0x6ad9('0x8b')]=function(_0x51f154,_0x15340a,_0x16db9e){return db[_0x6ad9('0x30')][_0x6ad9('0x4e')]({'where':{'id':_0x51f154[_0x6ad9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x15340a,null))[_0x6ad9('0x2a')](function(_0x13905e){if(_0x13905e){return _0x13905e[_0x6ad9('0x8b')](_0x51f154[_0x6ad9('0x35')][_0x6ad9('0x66')])[_0x6ad9('0x2a')](function(){if(_['isArray'](_0x51f154[_0x6ad9('0x35')][_0x6ad9('0x66')])){for(var _0x5b8031=0x0;_0x5b8031<_0x51f154[_0x6ad9('0x35')][_0x6ad9('0x66')][_0x6ad9('0x3b')];_0x5b8031+=0x1){socket['emit'](_0x6ad9('0x87'),{'UserId':Number(_0x51f154[_0x6ad9('0x35')][_0x6ad9('0x66')][_0x5b8031]),'MailQueueId':Number(_0x51f154[_0x6ad9('0x4b')]['id'])});}}else{socket['emit'](_0x6ad9('0x87'),{'UserId':Number(_0x51f154[_0x6ad9('0x35')][_0x6ad9('0x66')]),'MailQueueId':Number(_0x51f154[_0x6ad9('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x15340a,null))[_0x6ad9('0x49')](handleError(_0x15340a,null));};exports[_0x6ad9('0x8c')]=function(_0x41d097,_0x480c74,_0x16af2c){var _0xe4d0f8={};var _0x4cfa1a={};var _0x420030;var _0x4427b2;return db['MailQueue'][_0x6ad9('0x5b')]({'where':{'id':_0x41d097[_0x6ad9('0x4b')]['id']}})[_0x6ad9('0x2a')](handleEntityNotFound(_0x480c74,null))[_0x6ad9('0x2a')](function(_0x4d1c8a){if(_0x4d1c8a){_0x420030=_0x4d1c8a;_0x4cfa1a[_0x6ad9('0x33')]=_['keys'](db[_0x6ad9('0x8d')][_0x6ad9('0x31')]);_0x4cfa1a[_0x6ad9('0x35')]=_[_0x6ad9('0x36')](_0x41d097[_0x6ad9('0x35')]);_0x4cfa1a['filters']=_['intersection'](_0x4cfa1a[_0x6ad9('0x33')],_0x4cfa1a[_0x6ad9('0x35')]);_0xe4d0f8['attributes']=_['intersection'](_0x4cfa1a['model'],qs[_0x6ad9('0x3a')](_0x41d097[_0x6ad9('0x35')][_0x6ad9('0x3a')]));_0xe4d0f8[_0x6ad9('0x39')]=_0xe4d0f8[_0x6ad9('0x39')]['length']?_0xe4d0f8[_0x6ad9('0x39')]:_0x4cfa1a[_0x6ad9('0x33')];_0xe4d0f8[_0x6ad9('0x3f')]=qs[_0x6ad9('0x40')](_0x41d097[_0x6ad9('0x35')][_0x6ad9('0x40')]);_0xe4d0f8[_0x6ad9('0x41')]=qs[_0x6ad9('0x37')](_[_0x6ad9('0x42')](_0x41d097[_0x6ad9('0x35')],_0x4cfa1a['filters']));if(_0x41d097[_0x6ad9('0x35')][_0x6ad9('0x43')]){_0xe4d0f8['where']=_['merge'](_0xe4d0f8[_0x6ad9('0x41')],{'$or':_[_0x6ad9('0x34')](_0xe4d0f8[_0x6ad9('0x39')],function(_0x2bedfe){var _0x42f418={};_0x42f418[_0x2bedfe]={'$like':'%'+_0x41d097[_0x6ad9('0x35')]['filter']+'%'};return _0x42f418;})});}_0xe4d0f8=_[_0x6ad9('0x45')]({},_0xe4d0f8,_0x41d097['options']);return _0x420030[_0x6ad9('0x8c')](_0xe4d0f8);}})[_0x6ad9('0x2a')](function(_0x209cda){if(_0x209cda){_0x4427b2=_0x209cda['length'];if(!_0x41d097['query'][_0x6ad9('0x3c')](_0x6ad9('0x3d'))){_0xe4d0f8['limit']=qs[_0x6ad9('0x3e')](_0x41d097[_0x6ad9('0x35')][_0x6ad9('0x3e')]);_0xe4d0f8[_0x6ad9('0x23')]=qs[_0x6ad9('0x23')](_0x41d097['query'][_0x6ad9('0x23')]);}return _0x420030[_0x6ad9('0x8c')](_0xe4d0f8);}})[_0x6ad9('0x2a')](function(_0x2adba5){if(_0x2adba5){return _0x2adba5?{'count':_0x4427b2,'rows':_0x2adba5}:null;}})['then'](respondWithResult(_0x480c74,null))[_0x6ad9('0x49')](handleError(_0x480c74,null));};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js
index 75284c3..e3d5e18 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 _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
+var _0xae64=['events','setMaxListeners','save','update','remove','hasOwnProperty','exports'];(function(_0xe266af,_0x4388b0){var _0x9f775d=function(_0x5ce7bb){while(--_0x5ce7bb){_0xe266af['push'](_0xe266af['shift']());}};_0x9f775d(++_0x4388b0);}(_0xae64,0x149));var _0x4ae6=function(_0x4a1353,_0x2fbe86){_0x4a1353=_0x4a1353-0x0;var _0x3805cc=_0xae64[_0x4a1353];return _0x3805cc;};'use strict';var EventEmitter=require(_0x4ae6('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x4ae6('0x1')](0x0);var events={'afterCreate':_0x4ae6('0x2'),'afterUpdate':_0x4ae6('0x3'),'afterDestroy':_0x4ae6('0x4')};function emitEvent(_0x5f54e9){return function(_0x50374c,_0x4bcc95,_0x57b9e8){MailQueueEvents['emit'](_0x5f54e9+':'+_0x50374c['id'],_0x50374c);MailQueueEvents['emit'](_0x5f54e9,_0x50374c);_0x57b9e8(null);};}for(var e in events){if(events[_0x4ae6('0x5')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x4ae6('0x6')]=MailQueueEvents;
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js
index 9d6d532..3ff0d93 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 _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
+var _0xc1a6=['bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','mail_queues','lodash','util','api','moment'];(function(_0x427ea5,_0x33b039){var _0xa3c8b7=function(_0x596870){while(--_0x596870){_0x427ea5['push'](_0x427ea5['shift']());}};_0xa3c8b7(++_0x33b039);}(_0xc1a6,0x80));var _0x6c1a=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xc1a6[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x6c1a('0x0'));var util=require(_0x6c1a('0x1'));var logger=require('../../config/logger')(_0x6c1a('0x2'));var moment=require(_0x6c1a('0x3'));var BPromise=require(_0x6c1a('0x4'));var rp=require(_0x6c1a('0x5'));var fs=require('fs');var path=require(_0x6c1a('0x6'));var rimraf=require(_0x6c1a('0x7'));var config=require(_0x6c1a('0x8'));var attributes=require(_0x6c1a('0x9'));module[_0x6c1a('0xa')]=function(_0x2dfab8,_0xc7b989){return _0x2dfab8['define']('MailQueue',attributes,{'tableName':_0x6c1a('0xb'),'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 4886d43..3f36cba 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 _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
+var _0x4967=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetMailQueue','MailQueue','findAll','options','raw','limit','include','model','map','attributes','ShowMailQueue','find','where','util','moment','bluebird','randomstring'];(function(_0x1b92a6,_0x14444b){var _0x24be5b=function(_0x3a5fb5){while(--_0x3a5fb5){_0x1b92a6['push'](_0x1b92a6['shift']());}};_0x24be5b(++_0x14444b);}(_0x4967,0x11b));var _0x7496=function(_0x52598d,_0x10fb73){_0x52598d=_0x52598d-0x0;var _0x170309=_0x4967[_0x52598d];return _0x170309;};'use strict';var _=require('lodash');var util=require(_0x7496('0x0'));var moment=require(_0x7496('0x1'));var BPromise=require(_0x7496('0x2'));var rs=require(_0x7496('0x3'));var fs=require('fs');var Redis=require(_0x7496('0x4'));var db=require(_0x7496('0x5'))['db'];var utils=require(_0x7496('0x6'));var logger=require(_0x7496('0x7'))(_0x7496('0x8'));var config=require(_0x7496('0x9'));var jayson=require(_0x7496('0xa'));var client=jayson['client'][_0x7496('0xb')]({'port':0x232a});config[_0x7496('0xc')]=_[_0x7496('0xd')](config['redis'],{'host':_0x7496('0xe'),'port':0x18eb});var socket=require(_0x7496('0xf'))(new Redis(config[_0x7496('0xc')]));require(_0x7496('0x10'))['register'](socket);function respondWithRpcPromise(_0xe6c790,_0x530e6c,_0x461a4f){return new BPromise(function(_0x4ca54a,_0x37b185){return client[_0x7496('0x11')](_0xe6c790,_0x461a4f)[_0x7496('0x12')](function(_0x3a55ee){logger[_0x7496('0x13')](_0x7496('0x14'),_0x530e6c,_0x7496('0x15'));logger[_0x7496('0x16')](_0x7496('0x17'),_0x530e6c,_0x7496('0x15'),JSON[_0x7496('0x18')](_0x3a55ee));if(_0x3a55ee[_0x7496('0x19')]){if(_0x3a55ee[_0x7496('0x19')]['code']===0x1f4){logger[_0x7496('0x19')](_0x7496('0x14'),_0x530e6c,_0x3a55ee[_0x7496('0x19')][_0x7496('0x1a')]);return _0x37b185(_0x3a55ee['error'][_0x7496('0x1a')]);}logger['error'](_0x7496('0x14'),_0x530e6c,_0x3a55ee['error']['message']);return _0x4ca54a(_0x3a55ee['error'][_0x7496('0x1a')]);}else{logger[_0x7496('0x13')](_0x7496('0x14'),_0x530e6c,'request\x20sent');_0x4ca54a(_0x3a55ee['result'][_0x7496('0x1a')]);}})[_0x7496('0x1b')](function(_0x2db3a8){logger[_0x7496('0x19')](_0x7496('0x14'),_0x530e6c,_0x2db3a8);_0x37b185(_0x2db3a8);});});}exports[_0x7496('0x1c')]=function(_0x3c3860){var _0x23f943=this;return new Promise(function(_0x3ace2d,_0x27d350){return db[_0x7496('0x1d')][_0x7496('0x1e')]({'raw':_0x3c3860[_0x7496('0x1f')]?_0x3c3860['options'][_0x7496('0x20')]===undefined?!![]:![]:!![],'where':_0x3c3860[_0x7496('0x1f')]?_0x3c3860[_0x7496('0x1f')]['where']||null:null,'attributes':_0x3c3860['options']?_0x3c3860['options']['attributes']||null:null,'limit':_0x3c3860['options']?_0x3c3860[_0x7496('0x1f')][_0x7496('0x21')]||null:null,'include':_0x3c3860[_0x7496('0x1f')]?_0x3c3860['options'][_0x7496('0x22')]?_['map'](_0x3c3860[_0x7496('0x1f')][_0x7496('0x22')],function(_0x7cbade){return{'model':db[_0x7cbade[_0x7496('0x23')]],'as':_0x7cbade['as'],'attributes':_0x7cbade['attributes'],'include':_0x7cbade[_0x7496('0x22')]?_[_0x7496('0x24')](_0x7cbade[_0x7496('0x22')],function(_0xc3e5a0){return{'model':db[_0xc3e5a0[_0x7496('0x23')]],'as':_0xc3e5a0['as'],'attributes':_0xc3e5a0['attributes'],'include':_0xc3e5a0['include']?_[_0x7496('0x24')](_0xc3e5a0[_0x7496('0x22')],function(_0x13bf44){return{'model':db[_0x13bf44[_0x7496('0x23')]],'as':_0x13bf44['as'],'attributes':_0x13bf44[_0x7496('0x25')]};}):[]};}):[]};}):[]:[]})[_0x7496('0x12')](function(_0x5ab814){logger[_0x7496('0x13')](_0x7496('0x1c'),_0x3c3860);logger['debug'](_0x7496('0x1c'),_0x3c3860,JSON[_0x7496('0x18')](_0x5ab814));_0x3ace2d(_0x5ab814);})['catch'](function(_0x4627d9){logger['error'](_0x7496('0x1c'),_0x4627d9[_0x7496('0x1a')],_0x3c3860);_0x27d350(_0x23f943['error'](0x1f4,_0x4627d9[_0x7496('0x1a')]));});});};exports[_0x7496('0x26')]=function(_0xee05da){var _0x37eb1d=this;return new Promise(function(_0x2ae579,_0x8f67f2){return db[_0x7496('0x1d')][_0x7496('0x27')]({'raw':_0xee05da['options']?_0xee05da[_0x7496('0x1f')][_0x7496('0x20')]===undefined?!![]:![]:!![],'where':_0xee05da['options']?_0xee05da[_0x7496('0x1f')][_0x7496('0x28')]||null:null,'attributes':_0xee05da[_0x7496('0x1f')]?_0xee05da[_0x7496('0x1f')][_0x7496('0x25')]||null:null,'include':_0xee05da['options']?_0xee05da[_0x7496('0x1f')][_0x7496('0x22')]?_[_0x7496('0x24')](_0xee05da['options']['include'],function(_0x15a147){return{'model':db[_0x15a147[_0x7496('0x23')]],'as':_0x15a147['as'],'attributes':_0x15a147['attributes'],'include':_0x15a147[_0x7496('0x22')]?_[_0x7496('0x24')](_0x15a147[_0x7496('0x22')],function(_0x4bbaf2){return{'model':db[_0x4bbaf2['model']],'as':_0x4bbaf2['as'],'attributes':_0x4bbaf2[_0x7496('0x25')],'include':_0x4bbaf2[_0x7496('0x22')]?_[_0x7496('0x24')](_0x4bbaf2['include'],function(_0x1a5e65){return{'model':db[_0x1a5e65[_0x7496('0x23')]],'as':_0x1a5e65['as'],'attributes':_0x1a5e65[_0x7496('0x25')]};}):[]};}):[]};}):[]:[]})[_0x7496('0x12')](function(_0x4a7504){logger['info']('ShowMailQueue',_0xee05da);logger['debug'](_0x7496('0x26'),_0xee05da,JSON[_0x7496('0x18')](_0x4a7504));_0x2ae579(_0x4a7504);})[_0x7496('0x1b')](function(_0x2edc70){logger[_0x7496('0x19')](_0x7496('0x26'),_0x2edc70[_0x7496('0x1a')],_0xee05da);_0x8f67f2(_0x37eb1d[_0x7496('0x19')](0x1f4,_0x2edc70[_0x7496('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js
index 0b32f1e..5de45eb 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 _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
+var _0x1de6=['length','save','remove','emit','removeListener'];(function(_0x2b7076,_0x4887e6){var _0x1af53b=function(_0x2632bb){while(--_0x2632bb){_0x2b7076['push'](_0x2b7076['shift']());}};_0x1af53b(++_0x4887e6);}(_0x1de6,0x105));var _0x61de=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x1de6[_0x43b08];return _0x5e05f4;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x61de('0x0'),_0x61de('0x1'),'update'];function createListener(_0x4237dd,_0x13a0be){return function(_0x57965e){_0x13a0be[_0x61de('0x2')](_0x4237dd,_0x57965e);};}function removeListener(_0x1b7488,_0x2ac687){return function(){MailQueueEvents[_0x61de('0x3')](_0x1b7488,_0x2ac687);};}exports['register']=function(_0x559306){for(var _0x37f07e=0x0,_0x29ff10=events[_0x61de('0x4')];_0x37f07e<_0x29ff10;_0x37f07e++){var _0x5da6af=events[_0x37f07e];var _0x19408e=createListener('mailQueue:'+_0x5da6af,_0x559306);MailQueueEvents['on'](_0x5da6af,_0x19408e);}};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js
index 0ecf9bb..36ec0eb 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 _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
+var _0xa1db=['multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','index','isAuthenticated','describe','get','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x40c5a5,_0x34dcd3){var _0x17396a=function(_0x143304){while(--_0x143304){_0x40c5a5['push'](_0x40c5a5['shift']());}};_0x17396a(++_0x34dcd3);}(_0xa1db,0x1b5));var _0xba1d=function(_0x16d644,_0x46545e){_0x16d644=_0x16d644-0x0;var _0xf808cc=_0xa1db[_0x16d644];return _0xf808cc;};'use strict';var multer=require(_0xba1d('0x0'));var util=require(_0xba1d('0x1'));var path=require('path');var timeout=require(_0xba1d('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xba1d('0x3'));var interaction=require(_0xba1d('0x4'));var config=require(_0xba1d('0x5'));var controller=require(_0xba1d('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xba1d('0x7')]);router['get']('/describe',auth[_0xba1d('0x8')](),controller[_0xba1d('0x9')]);router[_0xba1d('0xa')](_0xba1d('0xb'),auth[_0xba1d('0x8')](),controller['show']);router[_0xba1d('0xc')]('/',auth[_0xba1d('0x8')](),controller[_0xba1d('0xd')]);router[_0xba1d('0xe')](_0xba1d('0xb'),auth[_0xba1d('0x8')](),controller[_0xba1d('0xf')]);router[_0xba1d('0x10')]('/:id',auth[_0xba1d('0x8')](),controller[_0xba1d('0x11')]);module[_0xba1d('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js
index 0ed5fe9..25bade8 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 _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
+var _0x5bde=['DATE','moment','sequelize','exports','STRING'];(function(_0x3bc44d,_0x47f40a){var _0x5e9b5b=function(_0x46492d){while(--_0x46492d){_0x3bc44d['push'](_0x3bc44d['shift']());}};_0x5e9b5b(++_0x47f40a);}(_0x5bde,0xd3));var _0xe5bd=function(_0x13fd88,_0x252227){_0x13fd88=_0x13fd88-0x0;var _0x59557d=_0x5bde[_0x13fd88];return _0x59557d;};'use strict';var moment=require(_0xe5bd('0x0'));var Sequelize=require(_0xe5bd('0x1'));module[_0xe5bd('0x2')]={'uniqueid':{'type':Sequelize[_0xe5bd('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xe5bd('0x3')]},'joinAt':{'type':Sequelize[_0xe5bd('0x4')]},'leaveAt':{'type':Sequelize[_0xe5bd('0x4')]},'acceptAt':{'type':Sequelize[_0xe5bd('0x4')]},'exitAt':{'type':Sequelize[_0xe5bd('0x4')]},'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 73f004c..1219721 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 _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
+var _0x2a1d=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset','Content-Range','json','apply','reject','save','destroy','then','sendStatus','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','show','params','find','catch','create','update','body','describe','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x131cb4,_0x240196){var _0x6a1bf3=function(_0xe4dff7){while(--_0xe4dff7){_0x131cb4['push'](_0x131cb4['shift']());}};_0x6a1bf3(++_0x240196);}(_0x2a1d,0x113));var _0xd2a1=function(_0x51a21f,_0x585342){_0x51a21f=_0x51a21f-0x0;var _0x2b388c=_0x2a1d[_0x51a21f];return _0x2b388c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd2a1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd2a1('0x1'));var rp=require(_0xd2a1('0x2'));var moment=require('moment');var BPromise=require(_0xd2a1('0x3'));var Mustache=require('mustache');var util=require(_0xd2a1('0x4'));var path=require('path');var sox=require(_0xd2a1('0x5'));var csv=require(_0xd2a1('0x6'));var ejs=require(_0xd2a1('0x7'));var fs=require('fs');var _=require(_0xd2a1('0x8'));var squel=require(_0xd2a1('0x9'));var crypto=require(_0xd2a1('0xa'));var jsforce=require(_0xd2a1('0xb'));var deskjs=require(_0xd2a1('0xc'));var toCsv=require(_0xd2a1('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd2a1('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd2a1('0xe'));var hardwareService=require(_0xd2a1('0xf'));var logger=require(_0xd2a1('0x10'))(_0xd2a1('0x11'));var utils=require(_0xd2a1('0x12'));var config=require('../../config/environment');var db=require(_0xd2a1('0x13'))['db'];function respondWithStatusCode(_0x278851,_0x6d0136){_0x6d0136=_0x6d0136||0xcc;return function(_0x4db042){if(_0x4db042){return _0x278851['sendStatus'](_0x6d0136);}return _0x278851[_0xd2a1('0x14')](_0x6d0136)[_0xd2a1('0x15')]();};}function respondWithResult(_0x4dd6bf,_0xb84f04){_0xb84f04=_0xb84f04||0xc8;return function(_0x2d094c){if(_0x2d094c){return _0x4dd6bf[_0xd2a1('0x14')](_0xb84f04)['json'](_0x2d094c);}};}function respondWithFilteredResult(_0x47b62f,_0x63bf7f){return function(_0x58cc46){if(_0x58cc46){var _0xfb1b42=_0x58cc46['count'],_0x4340cb=_0x63bf7f[_0xd2a1('0x16')],_0x4fc1c3=_0x63bf7f[_0xd2a1('0x16')]+_0x63bf7f['limit'],_0x1fa50e;if(_0x4fc1c3>=_0xfb1b42){_0x4fc1c3=_0xfb1b42;_0x1fa50e=0xc8;}else{_0x1fa50e=0xce;}_0x47b62f[_0xd2a1('0x14')](_0x1fa50e);return _0x47b62f['set'](_0xd2a1('0x17'),_0x4340cb+'-'+_0x4fc1c3+'/'+_0xfb1b42)[_0xd2a1('0x18')](_0x58cc46);}return null;};}function patchUpdates(_0x2c05db){return function(_0x227f74){try{jsonpatch[_0xd2a1('0x19')](_0x227f74,_0x2c05db,!![]);}catch(_0xe08217){return BPromise[_0xd2a1('0x1a')](_0xe08217);}return _0x227f74[_0xd2a1('0x1b')]();};}function saveUpdates(_0x252f2f,_0x3e7639){return function(_0x246499){if(_0x246499){return _0x246499['update'](_0x252f2f)['then'](function(_0x4d9274){return _0x4d9274;});}return null;};}function removeEntity(_0x4faffe,_0x5934d3){return function(_0x16a62e){if(_0x16a62e){return _0x16a62e[_0xd2a1('0x1c')]()[_0xd2a1('0x1d')](function(){_0x4faffe['status'](0xcc)[_0xd2a1('0x15')]();});}};}function handleEntityNotFound(_0x3a5839,_0x439451){return function(_0x299a9c){if(!_0x299a9c){_0x3a5839[_0xd2a1('0x1e')](0x194);}return _0x299a9c;};}function handleError(_0x32960f,_0xb91dfe){_0xb91dfe=_0xb91dfe||0x1f4;return function(_0xb1be8a){logger[_0xd2a1('0x1f')](_0xb1be8a['stack']);if(_0xb1be8a[_0xd2a1('0x20')]){delete _0xb1be8a[_0xd2a1('0x20')];}_0x32960f[_0xd2a1('0x14')](_0xb91dfe)[_0xd2a1('0x21')](_0xb1be8a);};}exports[_0xd2a1('0x22')]=function(_0x570ed7,_0x288643){var _0x533a71={},_0x378484={},_0x30935b={'count':0x0,'rows':[]};var _0xb86c0d=_[_0xd2a1('0x23')](db[_0xd2a1('0x24')][_0xd2a1('0x25')],function(_0x1f9b79){return{'name':_0x1f9b79[_0xd2a1('0x26')],'type':_0x1f9b79['type'][_0xd2a1('0x27')]};});_0x378484[_0xd2a1('0x28')]=_[_0xd2a1('0x23')](_0xb86c0d,_0xd2a1('0x20'));_0x378484['query']=_[_0xd2a1('0x29')](_0x570ed7['query']);_0x378484[_0xd2a1('0x2a')]=_['intersection'](_0x378484[_0xd2a1('0x28')],_0x378484[_0xd2a1('0x2b')]);_0x533a71[_0xd2a1('0x2c')]=_[_0xd2a1('0x2d')](_0x378484[_0xd2a1('0x28')],qs['fields'](_0x570ed7[_0xd2a1('0x2b')][_0xd2a1('0x2e')]));_0x533a71['attributes']=_0x533a71[_0xd2a1('0x2c')][_0xd2a1('0x2f')]?_0x533a71[_0xd2a1('0x2c')]:_0x378484['model'];if(!_0x570ed7[_0xd2a1('0x2b')][_0xd2a1('0x30')](_0xd2a1('0x31'))){_0x533a71['limit']=qs['limit'](_0x570ed7[_0xd2a1('0x2b')][_0xd2a1('0x32')]);_0x533a71[_0xd2a1('0x16')]=qs[_0xd2a1('0x16')](_0x570ed7['query'][_0xd2a1('0x16')]);}_0x533a71[_0xd2a1('0x33')]=qs[_0xd2a1('0x34')](_0x570ed7['query'][_0xd2a1('0x34')]);_0x533a71[_0xd2a1('0x35')]=qs[_0xd2a1('0x2a')](_[_0xd2a1('0x36')](_0x570ed7[_0xd2a1('0x2b')],_0x378484[_0xd2a1('0x2a')]),_0xb86c0d);if(_0x570ed7[_0xd2a1('0x2b')][_0xd2a1('0x37')]){_0x533a71[_0xd2a1('0x35')]=_[_0xd2a1('0x38')](_0x533a71[_0xd2a1('0x35')],{'$or':_[_0xd2a1('0x23')](_0xb86c0d,function(_0x2a2f2e){if(_0x2a2f2e[_0xd2a1('0x39')]!==_0xd2a1('0x3a')){var _0x2beab1={};_0x2beab1[_0x2a2f2e[_0xd2a1('0x20')]]={'$like':'%'+_0x570ed7['query'][_0xd2a1('0x37')]+'%'};return _0x2beab1;}})});}_0x533a71=_[_0xd2a1('0x38')]({},_0x533a71,_0x570ed7[_0xd2a1('0x3b')]);var _0x35c989={'where':_0x533a71[_0xd2a1('0x35')]};return db[_0xd2a1('0x24')]['count'](_0x35c989)[_0xd2a1('0x1d')](function(_0x7d31f6){_0x30935b[_0xd2a1('0x3c')]=_0x7d31f6;if(_0x570ed7['query'][_0xd2a1('0x3d')]){_0x533a71[_0xd2a1('0x3e')]=[{'all':!![]}];}return db[_0xd2a1('0x24')]['findAll'](_0x533a71);})['then'](function(_0x4bc362){_0x30935b[_0xd2a1('0x3f')]=_0x4bc362;return _0x30935b;})[_0xd2a1('0x1d')](respondWithFilteredResult(_0x288643,_0x533a71))['catch'](handleError(_0x288643,null));};exports[_0xd2a1('0x40')]=function(_0x239ab2,_0x4a48b3){var _0x421d94={'raw':!![],'where':{'id':_0x239ab2[_0xd2a1('0x41')]['id']}},_0xaf6ece={};_0xaf6ece[_0xd2a1('0x28')]=_[_0xd2a1('0x29')](db[_0xd2a1('0x24')][_0xd2a1('0x25')]);_0xaf6ece['query']=_[_0xd2a1('0x29')](_0x239ab2[_0xd2a1('0x2b')]);_0xaf6ece[_0xd2a1('0x2a')]=_[_0xd2a1('0x2d')](_0xaf6ece[_0xd2a1('0x28')],_0xaf6ece[_0xd2a1('0x2b')]);_0x421d94[_0xd2a1('0x2c')]=_[_0xd2a1('0x2d')](_0xaf6ece[_0xd2a1('0x28')],qs[_0xd2a1('0x2e')](_0x239ab2['query'][_0xd2a1('0x2e')]));_0x421d94[_0xd2a1('0x2c')]=_0x421d94['attributes'][_0xd2a1('0x2f')]?_0x421d94['attributes']:_0xaf6ece[_0xd2a1('0x28')];if(_0x239ab2['query'][_0xd2a1('0x3d')]){_0x421d94[_0xd2a1('0x3e')]=[{'all':!![]}];}_0x421d94=_[_0xd2a1('0x38')]({},_0x421d94,_0x239ab2['options']);return db['MailQueueReport'][_0xd2a1('0x42')](_0x421d94)[_0xd2a1('0x1d')](handleEntityNotFound(_0x4a48b3,null))[_0xd2a1('0x1d')](respondWithResult(_0x4a48b3,null))[_0xd2a1('0x43')](handleError(_0x4a48b3,null));};exports[_0xd2a1('0x44')]=function(_0x3d0fec,_0x12bddd){return db['MailQueueReport']['create'](_0x3d0fec['body'],{})[_0xd2a1('0x1d')](respondWithResult(_0x12bddd,0xc9))[_0xd2a1('0x43')](handleError(_0x12bddd,null));};exports[_0xd2a1('0x45')]=function(_0x1aa413,_0xc7a684){if(_0x1aa413['body']['id']){delete _0x1aa413[_0xd2a1('0x46')]['id'];}return db['MailQueueReport']['find']({'where':{'id':_0x1aa413[_0xd2a1('0x41')]['id']}})[_0xd2a1('0x1d')](handleEntityNotFound(_0xc7a684,null))['then'](saveUpdates(_0x1aa413[_0xd2a1('0x46')],null))[_0xd2a1('0x1d')](respondWithResult(_0xc7a684,null))[_0xd2a1('0x43')](handleError(_0xc7a684,null));};exports['destroy']=function(_0x315836,_0x3b86da){return db[_0xd2a1('0x24')][_0xd2a1('0x42')]({'where':{'id':_0x315836[_0xd2a1('0x41')]['id']}})['then'](handleEntityNotFound(_0x3b86da,null))[_0xd2a1('0x1d')](removeEntity(_0x3b86da,null))[_0xd2a1('0x43')](handleError(_0x3b86da,null));};exports[_0xd2a1('0x47')]=function(_0x5f182b,_0xf7dc19){return db[_0xd2a1('0x24')][_0xd2a1('0x47')]()[_0xd2a1('0x1d')](respondWithResult(_0xf7dc19,null))[_0xd2a1('0x43')](handleError(_0xf7dc19,null));};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js
index 15c9b9f..ebd15ce 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 _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
+var _0xbdfb=['../../config/environment','exports','define','MailQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x551254,_0x4248f8){var _0x4d72f3=function(_0x1a47af){while(--_0x1a47af){_0x551254['push'](_0x551254['shift']());}};_0x4d72f3(++_0x4248f8);}(_0xbdfb,0x1ef));var _0xbbdf=function(_0x239904,_0x4b11e2){_0x239904=_0x239904-0x0;var _0x259609=_0xbdfb[_0x239904];return _0x259609;};'use strict';var _=require(_0xbbdf('0x0'));var util=require(_0xbbdf('0x1'));var logger=require(_0xbbdf('0x2'))(_0xbbdf('0x3'));var moment=require(_0xbbdf('0x4'));var BPromise=require(_0xbbdf('0x5'));var rp=require(_0xbbdf('0x6'));var fs=require('fs');var path=require(_0xbbdf('0x7'));var rimraf=require(_0xbbdf('0x8'));var config=require(_0xbbdf('0x9'));var attributes=require('./mailQueueReport.attributes');module[_0xbbdf('0xa')]=function(_0x3184ff,_0x54d048){return _0x3184ff[_0xbbdf('0xb')](_0xbbdf('0xc'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xbbdf('0xd'),'fields':[_0xbbdf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js
index 7c10de8..1a5fc19 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 _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
+var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x17d0b3,_0x3700d9){var _0x5582a5=function(_0x38d09c){while(--_0x38d09c){_0x17d0b3['push'](_0x17d0b3['shift']());}};_0x5582a5(++_0x3700d9);}(_0x7a54,0x106));var _0x47a5=function(_0x3fff2f,_0x41306b){_0x3fff2f=_0x3fff2f-0x0;var _0x22d477=_0x7a54[_0x3fff2f];return _0x22d477;};'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')]('MailQueueReport,\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);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js
index 7eb934e..591ed7d 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 _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
+var _0x8c73=['../../components/auth/service','../../components/interaction/service','exports','util','path','connect-timeout','express','Router'];(function(_0x334672,_0x42f550){var _0x7cb6dc=function(_0x212934){while(--_0x212934){_0x334672['push'](_0x334672['shift']());}};_0x7cb6dc(++_0x42f550);}(_0x8c73,0xbb));var _0x38c7=function(_0x3eb2ea,_0x401c21){_0x3eb2ea=_0x3eb2ea-0x0;var _0x516fe4=_0x8c73[_0x3eb2ea];return _0x516fe4;};'use strict';var multer=require('multer');var util=require(_0x38c7('0x0'));var path=require(_0x38c7('0x1'));var timeout=require(_0x38c7('0x2'));var express=require(_0x38c7('0x3'));var router=express[_0x38c7('0x4')]();var auth=require(_0x38c7('0x5'));var interaction=require(_0x38c7('0x6'));var config=require('../../config/environment');module[_0x38c7('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js
index 8463469..a2c0d4c 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 _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
+var _0x075e=['INTEGER','exports','STRING','BOOLEAN','INBOX'];(function(_0x29fba8,_0x2b16f2){var _0x42f260=function(_0x2800a5){while(--_0x2800a5){_0x29fba8['push'](_0x29fba8['shift']());}};_0x42f260(++_0x2b16f2);}(_0x075e,0x11e));var _0xe075=function(_0x5e8097,_0x2dc885){_0x5e8097=_0x5e8097-0x0;var _0x218521=_0x075e[_0x5e8097];return _0x218521;};'use strict';var Sequelize=require('sequelize');module[_0xe075('0x0')]={'description':{'type':Sequelize[_0xe075('0x1')]},'host':{'type':Sequelize[_0xe075('0x1')]},'authentication':{'type':Sequelize[_0xe075('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xe075('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xe075('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xe075('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xe075('0x1')],'defaultValue':_0xe075('0x3')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xe075('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xe075('0x1')]}};
\ No newline at end of file
diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js
index d8518b1..c79dbae 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 _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
+var _0xd2f5=['../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x27c785,_0x47218c){var _0x437331=function(_0x3fe408){while(--_0x3fe408){_0x27c785['push'](_0x27c785['shift']());}};_0x437331(++_0x47218c);}(_0xd2f5,0x144));var _0x5d2f=function(_0x4d8a5a,_0x3523cd){_0x4d8a5a=_0x4d8a5a-0x0;var _0x1dc2a9=_0xd2f5[_0x4d8a5a];return _0x1dc2a9;};'use strict';var _=require(_0x5d2f('0x0'));var util=require('util');var logger=require(_0x5d2f('0x1'))('api');var moment=require(_0x5d2f('0x2'));var BPromise=require('bluebird');var rp=require(_0x5d2f('0x3'));var fs=require('fs');var path=require(_0x5d2f('0x4'));var rimraf=require(_0x5d2f('0x5'));var config=require(_0x5d2f('0x6'));var attributes=require(_0x5d2f('0x7'));module[_0x5d2f('0x8')]=function(_0x2392df,_0x16e9fa){return _0x2392df['define'](_0x5d2f('0x9'),attributes,{'tableName':_0x5d2f('0xa'),'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 d7f2206..a5a7064 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 _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
+var _0xa3a3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','GetMailServerIn','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x329f9e,_0x162883){var _0x4dc956=function(_0x56b271){while(--_0x56b271){_0x329f9e['push'](_0x329f9e['shift']());}};_0x4dc956(++_0x162883);}(_0xa3a3,0x1c0));var _0x3a3a=function(_0x408626,_0x421fc6){_0x408626=_0x408626-0x0;var _0x36ef72=_0xa3a3[_0x408626];return _0x36ef72;};'use strict';var _=require(_0x3a3a('0x0'));var util=require(_0x3a3a('0x1'));var moment=require(_0x3a3a('0x2'));var BPromise=require(_0x3a3a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a3a('0x4'));var db=require(_0x3a3a('0x5'))['db'];var utils=require(_0x3a3a('0x6'));var logger=require(_0x3a3a('0x7'))(_0x3a3a('0x8'));var config=require(_0x3a3a('0x9'));var jayson=require(_0x3a3a('0xa'));var client=jayson[_0x3a3a('0xb')][_0x3a3a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a7f97,_0x4ada40,_0x5eb6b6){return new BPromise(function(_0x10ba52,_0x5919e4){return client['request'](_0x1a7f97,_0x5eb6b6)['then'](function(_0x28b6fc){logger[_0x3a3a('0xd')]('MailServerIn,\x20%s,\x20%s',_0x4ada40,_0x3a3a('0xe'));logger['debug'](_0x3a3a('0xf'),_0x4ada40,_0x3a3a('0xe'),JSON[_0x3a3a('0x10')](_0x28b6fc));if(_0x28b6fc[_0x3a3a('0x11')]){if(_0x28b6fc[_0x3a3a('0x11')][_0x3a3a('0x12')]===0x1f4){logger[_0x3a3a('0x11')](_0x3a3a('0x13'),_0x4ada40,_0x28b6fc['error'][_0x3a3a('0x14')]);return _0x5919e4(_0x28b6fc[_0x3a3a('0x11')]['message']);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x4ada40,_0x28b6fc[_0x3a3a('0x11')][_0x3a3a('0x14')]);return _0x10ba52(_0x28b6fc[_0x3a3a('0x11')]['message']);}else{logger[_0x3a3a('0xd')](_0x3a3a('0x13'),_0x4ada40,_0x3a3a('0xe'));_0x10ba52(_0x28b6fc[_0x3a3a('0x15')][_0x3a3a('0x14')]);}})[_0x3a3a('0x16')](function(_0x259d2e){logger[_0x3a3a('0x11')](_0x3a3a('0x13'),_0x4ada40,_0x259d2e);_0x5919e4(_0x259d2e);});});}exports['GetMailServerIn']=function(_0x4631f9){var _0x23b2cc=this;return new Promise(function(_0x404120,_0x449780){return db[_0x3a3a('0x17')][_0x3a3a('0x18')]({'raw':_0x4631f9['options']?_0x4631f9[_0x3a3a('0x19')][_0x3a3a('0x1a')]===undefined?!![]:![]:!![],'where':_0x4631f9[_0x3a3a('0x19')]?_0x4631f9[_0x3a3a('0x19')][_0x3a3a('0x1b')]||null:null,'attributes':_0x4631f9[_0x3a3a('0x19')]?_0x4631f9[_0x3a3a('0x19')][_0x3a3a('0x1c')]||null:null,'limit':_0x4631f9['options']?_0x4631f9['options'][_0x3a3a('0x1d')]||null:null,'include':_0x4631f9['options']?_0x4631f9[_0x3a3a('0x19')][_0x3a3a('0x1e')]?_[_0x3a3a('0x1f')](_0x4631f9[_0x3a3a('0x19')][_0x3a3a('0x1e')],function(_0x47a5fa){return{'model':db[_0x47a5fa[_0x3a3a('0x20')]],'as':_0x47a5fa['as'],'attributes':_0x47a5fa[_0x3a3a('0x1c')],'include':_0x47a5fa[_0x3a3a('0x1e')]?_[_0x3a3a('0x1f')](_0x47a5fa[_0x3a3a('0x1e')],function(_0x377fd9){return{'model':db[_0x377fd9[_0x3a3a('0x20')]],'as':_0x377fd9['as'],'attributes':_0x377fd9[_0x3a3a('0x1c')],'include':_0x377fd9[_0x3a3a('0x1e')]?_[_0x3a3a('0x1f')](_0x377fd9[_0x3a3a('0x1e')],function(_0x41af5c){return{'model':db[_0x41af5c[_0x3a3a('0x20')]],'as':_0x41af5c['as'],'attributes':_0x41af5c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4667b8){logger[_0x3a3a('0xd')](_0x3a3a('0x21'),_0x4631f9);logger[_0x3a3a('0x22')](_0x3a3a('0x21'),_0x4631f9,JSON[_0x3a3a('0x10')](_0x4667b8));_0x404120(_0x4667b8);})[_0x3a3a('0x16')](function(_0x5473c1){logger[_0x3a3a('0x11')](_0x3a3a('0x21'),_0x5473c1[_0x3a3a('0x14')],_0x4631f9);_0x449780(_0x23b2cc['error'](0x1f4,_0x5473c1[_0x3a3a('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js
index 2011f7f..b54d37b 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 _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
+var _0x2544=['./mailServerOut.controller','get','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x46a6c7,_0x496ccc){var _0x13fe5e=function(_0x2ec8c0){while(--_0x2ec8c0){_0x46a6c7['push'](_0x46a6c7['shift']());}};_0x13fe5e(++_0x496ccc);}(_0x2544,0xdc));var _0x4254=function(_0x5c6339,_0x30d01a){_0x5c6339=_0x5c6339-0x0;var _0x40bd71=_0x2544[_0x5c6339];return _0x40bd71;};'use strict';var multer=require(_0x4254('0x0'));var util=require(_0x4254('0x1'));var path=require(_0x4254('0x2'));var timeout=require(_0x4254('0x3'));var express=require(_0x4254('0x4'));var router=express[_0x4254('0x5')]();var auth=require(_0x4254('0x6'));var interaction=require(_0x4254('0x7'));var config=require('../../config/environment');var controller=require(_0x4254('0x8'));router[_0x4254('0x9')]('/',auth[_0x4254('0xa')](),controller['index']);router[_0x4254('0x9')]('/:id',auth[_0x4254('0xa')](),controller[_0x4254('0xb')]);router[_0x4254('0xc')]('/',auth['isAuthenticated'](),controller[_0x4254('0xd')]);router[_0x4254('0xe')](_0x4254('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x4254('0x10')](_0x4254('0xf'),auth['isAuthenticated'](),controller[_0x4254('0x11')]);module[_0x4254('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js
index c8a95c3..d808273 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 _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
+var _0xc17d=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xc17d,0x96));var _0xdc17=function(_0x3254cd,_0x3b4ea0){_0x3254cd=_0x3254cd-0x0;var _0x729d06=_0xc17d[_0x3254cd];return _0x729d06;};'use strict';var Sequelize=require(_0xdc17('0x0'));module[_0xdc17('0x1')]={'description':{'type':Sequelize[_0xdc17('0x2')]},'host':{'type':Sequelize[_0xdc17('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xdc17('0x2')]},'port':{'type':Sequelize[_0xdc17('0x3')]},'secure':{'type':Sequelize[_0xdc17('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xdc17('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js
index 25f649e..2553c32 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 _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
+var _0xd058=['intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','includeAll','catch','show','params','keys','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','MailServerOut','rawAttributes','fieldName','type','key','query'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xd058,0xe7));var _0x8d05=function(_0x4aa838,_0x4aa14f){_0x4aa838=_0x4aa838-0x0;var _0x3abff0=_0xd058[_0x4aa838];return _0x3abff0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8d05('0x0'));var rimraf=require(_0x8d05('0x1'));var zipdir=require(_0x8d05('0x2'));var jsonpatch=require(_0x8d05('0x3'));var rp=require(_0x8d05('0x4'));var moment=require('moment');var BPromise=require(_0x8d05('0x5'));var Mustache=require(_0x8d05('0x6'));var util=require(_0x8d05('0x7'));var path=require(_0x8d05('0x8'));var sox=require(_0x8d05('0x9'));var csv=require(_0x8d05('0xa'));var ejs=require(_0x8d05('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8d05('0xc'));var crypto=require(_0x8d05('0xd'));var jsforce=require(_0x8d05('0xe'));var deskjs=require(_0x8d05('0xf'));var toCsv=require(_0x8d05('0xa'));var querystring=require(_0x8d05('0x10'));var Papa=require(_0x8d05('0x11'));var Redis=require(_0x8d05('0x12'));var authService=require(_0x8d05('0x13'));var qs=require(_0x8d05('0x14'));var as=require(_0x8d05('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d05('0x16'))(_0x8d05('0x17'));var utils=require('../../config/utils');var config=require(_0x8d05('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14e6c7,_0x1dd6b3){_0x1dd6b3=_0x1dd6b3||0xcc;return function(_0x429073){if(_0x429073){return _0x14e6c7['sendStatus'](_0x1dd6b3);}return _0x14e6c7[_0x8d05('0x19')](_0x1dd6b3)['end']();};}function respondWithResult(_0x497a98,_0x4e92f8){_0x4e92f8=_0x4e92f8||0xc8;return function(_0x82ec17){if(_0x82ec17){return _0x497a98[_0x8d05('0x19')](_0x4e92f8)[_0x8d05('0x1a')](_0x82ec17);}};}function respondWithFilteredResult(_0x1a7a94,_0x469d75){return function(_0x17c4f6){if(_0x17c4f6){var _0x3277ce=_0x17c4f6[_0x8d05('0x1b')],_0x2706c0=_0x469d75['offset'],_0x24562f=_0x469d75[_0x8d05('0x1c')]+_0x469d75[_0x8d05('0x1d')],_0x32662a;if(_0x24562f>=_0x3277ce){_0x24562f=_0x3277ce;_0x32662a=0xc8;}else{_0x32662a=0xce;}_0x1a7a94['status'](_0x32662a);return _0x1a7a94['set'](_0x8d05('0x1e'),_0x2706c0+'-'+_0x24562f+'/'+_0x3277ce)[_0x8d05('0x1a')](_0x17c4f6);}return null;};}function patchUpdates(_0x40e226){return function(_0x5384a6){try{jsonpatch[_0x8d05('0x1f')](_0x5384a6,_0x40e226,!![]);}catch(_0x212ac7){return BPromise[_0x8d05('0x20')](_0x212ac7);}return _0x5384a6[_0x8d05('0x21')]();};}function saveUpdates(_0x4c7bd3,_0x3f6aa9){return function(_0x318285){if(_0x318285){return _0x318285[_0x8d05('0x22')](_0x4c7bd3)[_0x8d05('0x23')](function(_0x1571ce){return _0x1571ce;});}return null;};}function removeEntity(_0x32ac4a,_0x1dce4d){return function(_0x36e358){if(_0x36e358){return _0x36e358[_0x8d05('0x24')]()[_0x8d05('0x23')](function(){_0x32ac4a[_0x8d05('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d5eb,_0x1198c0){return function(_0x16e15a){if(!_0x16e15a){_0x2d5eb[_0x8d05('0x25')](0x194);}return _0x16e15a;};}function handleError(_0x508843,_0x33a6d7){_0x33a6d7=_0x33a6d7||0x1f4;return function(_0x2b425c){logger[_0x8d05('0x26')](_0x2b425c[_0x8d05('0x27')]);if(_0x2b425c[_0x8d05('0x28')]){delete _0x2b425c[_0x8d05('0x28')];}_0x508843[_0x8d05('0x19')](_0x33a6d7)['send'](_0x2b425c);};}exports[_0x8d05('0x29')]=function(_0x38d534,_0x27bd68){var _0x20563c={},_0x3b682a={},_0x29271b={'count':0x0,'rows':[]};var _0x4f1b5a=_[_0x8d05('0x2a')](db[_0x8d05('0x2b')][_0x8d05('0x2c')],function(_0xcc0683){return{'name':_0xcc0683[_0x8d05('0x2d')],'type':_0xcc0683[_0x8d05('0x2e')][_0x8d05('0x2f')]};});_0x3b682a['model']=_['map'](_0x4f1b5a,_0x8d05('0x28'));_0x3b682a[_0x8d05('0x30')]=_['keys'](_0x38d534[_0x8d05('0x30')]);_0x3b682a['filters']=_[_0x8d05('0x31')](_0x3b682a['model'],_0x3b682a[_0x8d05('0x30')]);_0x20563c['attributes']=_['intersection'](_0x3b682a[_0x8d05('0x32')],qs[_0x8d05('0x33')](_0x38d534[_0x8d05('0x30')]['fields']));_0x20563c[_0x8d05('0x34')]=_0x20563c['attributes']['length']?_0x20563c[_0x8d05('0x34')]:_0x3b682a[_0x8d05('0x32')];if(!_0x38d534[_0x8d05('0x30')][_0x8d05('0x35')](_0x8d05('0x36'))){_0x20563c[_0x8d05('0x1d')]=qs['limit'](_0x38d534[_0x8d05('0x30')]['limit']);_0x20563c[_0x8d05('0x1c')]=qs[_0x8d05('0x1c')](_0x38d534[_0x8d05('0x30')][_0x8d05('0x1c')]);}_0x20563c[_0x8d05('0x37')]=qs[_0x8d05('0x38')](_0x38d534[_0x8d05('0x30')][_0x8d05('0x38')]);_0x20563c['where']=qs[_0x8d05('0x39')](_[_0x8d05('0x3a')](_0x38d534[_0x8d05('0x30')],_0x3b682a[_0x8d05('0x39')]),_0x4f1b5a);if(_0x38d534[_0x8d05('0x30')]['filter']){_0x20563c['where']=_[_0x8d05('0x3b')](_0x20563c[_0x8d05('0x3c')],{'$or':_[_0x8d05('0x2a')](_0x4f1b5a,function(_0x954738){if(_0x954738[_0x8d05('0x2e')]!=='VIRTUAL'){var _0x507fe1={};_0x507fe1[_0x954738[_0x8d05('0x28')]]={'$like':'%'+_0x38d534[_0x8d05('0x30')]['filter']+'%'};return _0x507fe1;}})});}_0x20563c=_[_0x8d05('0x3b')]({},_0x20563c,_0x38d534['options']);var _0x25b367={'where':_0x20563c[_0x8d05('0x3c')]};return db['MailServerOut']['count'](_0x25b367)[_0x8d05('0x23')](function(_0x187936){_0x29271b['count']=_0x187936;if(_0x38d534[_0x8d05('0x30')][_0x8d05('0x3d')]){_0x20563c['include']=[{'all':!![]}];}return db[_0x8d05('0x2b')]['findAll'](_0x20563c);})[_0x8d05('0x23')](function(_0x5490c2){_0x29271b['rows']=_0x5490c2;return _0x29271b;})['then'](respondWithFilteredResult(_0x27bd68,_0x20563c))[_0x8d05('0x3e')](handleError(_0x27bd68,null));};exports[_0x8d05('0x3f')]=function(_0x1cfe5c,_0x274b11){var _0x2a4458={'raw':!![],'where':{'id':_0x1cfe5c[_0x8d05('0x40')]['id']}},_0x31857c={};_0x31857c['model']=_[_0x8d05('0x41')](db[_0x8d05('0x2b')][_0x8d05('0x2c')]);_0x31857c['query']=_[_0x8d05('0x41')](_0x1cfe5c[_0x8d05('0x30')]);_0x31857c['filters']=_[_0x8d05('0x31')](_0x31857c[_0x8d05('0x32')],_0x31857c[_0x8d05('0x30')]);_0x2a4458[_0x8d05('0x34')]=_['intersection'](_0x31857c[_0x8d05('0x32')],qs[_0x8d05('0x33')](_0x1cfe5c[_0x8d05('0x30')][_0x8d05('0x33')]));_0x2a4458['attributes']=_0x2a4458[_0x8d05('0x34')]['length']?_0x2a4458[_0x8d05('0x34')]:_0x31857c[_0x8d05('0x32')];if(_0x1cfe5c[_0x8d05('0x30')][_0x8d05('0x3d')]){_0x2a4458['include']=[{'all':!![]}];}_0x2a4458=_[_0x8d05('0x3b')]({},_0x2a4458,_0x1cfe5c[_0x8d05('0x42')]);return db[_0x8d05('0x2b')][_0x8d05('0x43')](_0x2a4458)['then'](handleEntityNotFound(_0x274b11,null))['then'](respondWithResult(_0x274b11,null))[_0x8d05('0x3e')](handleError(_0x274b11,null));};exports[_0x8d05('0x44')]=function(_0x224d69,_0x2c4581){return db[_0x8d05('0x2b')]['create'](_0x224d69[_0x8d05('0x45')],{})[_0x8d05('0x23')](respondWithResult(_0x2c4581,0xc9))[_0x8d05('0x3e')](handleError(_0x2c4581,null));};exports[_0x8d05('0x22')]=function(_0x55cf39,_0x296502){if(_0x55cf39['body']['id']){delete _0x55cf39[_0x8d05('0x45')]['id'];}return db[_0x8d05('0x2b')]['find']({'where':{'id':_0x55cf39[_0x8d05('0x40')]['id']}})[_0x8d05('0x23')](handleEntityNotFound(_0x296502,null))[_0x8d05('0x23')](saveUpdates(_0x55cf39[_0x8d05('0x45')],null))['then'](respondWithResult(_0x296502,null))[_0x8d05('0x3e')](handleError(_0x296502,null));};exports[_0x8d05('0x24')]=function(_0x482a2e,_0x599451){return db[_0x8d05('0x2b')][_0x8d05('0x43')]({'where':{'id':_0x482a2e[_0x8d05('0x40')]['id']}})[_0x8d05('0x23')](handleEntityNotFound(_0x599451,null))[_0x8d05('0x23')](removeEntity(_0x599451,null))[_0x8d05('0x3e')](handleError(_0x599451,null));};
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js
index 987435f..9e71514 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 _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
+var _0x4f6c=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','MailServerOut','mail_servers_out','util'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0x4f6c,0x1c7));var _0xc4f6=function(_0x2ec0e1,_0x4f6c92){_0x2ec0e1=_0x2ec0e1-0x0;var _0x1d6d2c=_0x4f6c[_0x2ec0e1];return _0x1d6d2c;};'use strict';var _=require('lodash');var util=require(_0xc4f6('0x0'));var logger=require(_0xc4f6('0x1'))(_0xc4f6('0x2'));var moment=require(_0xc4f6('0x3'));var BPromise=require(_0xc4f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4f6('0x5'));var rimraf=require(_0xc4f6('0x6'));var config=require(_0xc4f6('0x7'));var attributes=require('./mailServerOut.attributes');module[_0xc4f6('0x8')]=function(_0x311393,_0x57d4f5){return _0x311393[_0xc4f6('0x9')](_0xc4f6('0xa'),attributes,{'tableName':_0xc4f6('0xb'),'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 bc968da..d095332 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 _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
+var _0xc8ea=['request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s'];(function(_0x48c1a9,_0xd865e6){var _0x4cad7d=function(_0x1dfdc4){while(--_0x1dfdc4){_0x48c1a9['push'](_0x48c1a9['shift']());}};_0x4cad7d(++_0xd865e6);}(_0xc8ea,0x10e));var _0xac8e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xc8ea[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0xac8e('0x0'));var util=require(_0xac8e('0x1'));var moment=require(_0xac8e('0x2'));var BPromise=require(_0xac8e('0x3'));var rs=require(_0xac8e('0x4'));var fs=require('fs');var Redis=require(_0xac8e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xac8e('0x6'));var logger=require(_0xac8e('0x7'))(_0xac8e('0x8'));var config=require(_0xac8e('0x9'));var jayson=require(_0xac8e('0xa'));var client=jayson[_0xac8e('0xb')][_0xac8e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f42b8,_0x358ebc,_0xd0aae2){return new BPromise(function(_0x15d01e,_0x5938e3){return client[_0xac8e('0xd')](_0x4f42b8,_0xd0aae2)['then'](function(_0x48ef67){logger[_0xac8e('0xe')](_0xac8e('0xf'),_0x358ebc,_0xac8e('0x10'));logger['debug'](_0xac8e('0x11'),_0x358ebc,_0xac8e('0x10'),JSON[_0xac8e('0x12')](_0x48ef67));if(_0x48ef67[_0xac8e('0x13')]){if(_0x48ef67[_0xac8e('0x13')]['code']===0x1f4){logger['error'](_0xac8e('0xf'),_0x358ebc,_0x48ef67[_0xac8e('0x13')][_0xac8e('0x14')]);return _0x5938e3(_0x48ef67['error'][_0xac8e('0x14')]);}logger[_0xac8e('0x13')]('MailServerOut,\x20%s,\x20%s',_0x358ebc,_0x48ef67[_0xac8e('0x13')][_0xac8e('0x14')]);return _0x15d01e(_0x48ef67['error'][_0xac8e('0x14')]);}else{logger[_0xac8e('0xe')](_0xac8e('0xf'),_0x358ebc,_0xac8e('0x10'));_0x15d01e(_0x48ef67['result'][_0xac8e('0x14')]);}})[_0xac8e('0x15')](function(_0x3338a0){logger[_0xac8e('0x13')](_0xac8e('0xf'),_0x358ebc,_0x3338a0);_0x5938e3(_0x3338a0);});});}
\ No newline at end of file
diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js
index 21c973a..528eacc 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 _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
+var _0xa5f4=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','post','put','/:id','update','delete','destroy','multer','path'];(function(_0x31de3c,_0x55a229){var _0x58e00d=function(_0x2b4a12){while(--_0x2b4a12){_0x31de3c['push'](_0x31de3c['shift']());}};_0x58e00d(++_0x55a229);}(_0xa5f4,0x1f2));var _0x4a5f=function(_0x1534a7,_0x28dc30){_0x1534a7=_0x1534a7-0x0;var _0x4735ce=_0xa5f4[_0x1534a7];return _0x4735ce;};'use strict';var multer=require(_0x4a5f('0x0'));var util=require('util');var path=require(_0x4a5f('0x1'));var timeout=require(_0x4a5f('0x2'));var express=require(_0x4a5f('0x3'));var router=express[_0x4a5f('0x4')]();var auth=require(_0x4a5f('0x5'));var interaction=require(_0x4a5f('0x6'));var config=require(_0x4a5f('0x7'));var controller=require(_0x4a5f('0x8'));router['get']('/',auth[_0x4a5f('0x9')](),controller[_0x4a5f('0xa')]);router[_0x4a5f('0xb')](_0x4a5f('0xc'),auth[_0x4a5f('0x9')](),controller[_0x4a5f('0xd')]);router['get']('/:id',auth[_0x4a5f('0x9')](),controller['show']);router[_0x4a5f('0xe')]('/',auth[_0x4a5f('0x9')](),controller['create']);router[_0x4a5f('0xf')](_0x4a5f('0x10'),auth[_0x4a5f('0x9')](),controller[_0x4a5f('0x11')]);router[_0x4a5f('0x12')](_0x4a5f('0x10'),auth[_0x4a5f('0x9')](),controller[_0x4a5f('0x13')]);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 f6436db..ea7fde9 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 _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
+var _0x323f=['name','STRING','exports'];(function(_0x58ab22,_0x42c988){var _0x3bedba=function(_0x121f16){while(--_0x121f16){_0x58ab22['push'](_0x58ab22['shift']());}};_0x3bedba(++_0x42c988);}(_0x323f,0x1ee));var _0xf323=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x323f[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require('sequelize');module[_0xf323('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf323('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf323('0x2')]}};
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js
index 12d6313..1576d3a 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 _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
+var _0x9b30=['rawAttributes','fields','length','find','create','body','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','MailSubstatus','includeAll','include','findAll','catch','show','params'];(function(_0x19f5fc,_0x4c658a){var _0x315fa3=function(_0x2198b5){while(--_0x2198b5){_0x19f5fc['push'](_0x19f5fc['shift']());}};_0x315fa3(++_0x4c658a);}(_0x9b30,0xee));var _0x09b3=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x9b30[_0x13b8f3];return _0x1a6d06;};'use strict';var pdf=require(_0x09b3('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x09b3('0x1'));var jsonpatch=require(_0x09b3('0x2'));var rp=require(_0x09b3('0x3'));var moment=require(_0x09b3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x09b3('0x5'));var util=require(_0x09b3('0x6'));var path=require(_0x09b3('0x7'));var sox=require(_0x09b3('0x8'));var csv=require(_0x09b3('0x9'));var ejs=require(_0x09b3('0xa'));var fs=require('fs');var _=require(_0x09b3('0xb'));var squel=require(_0x09b3('0xc'));var crypto=require('crypto');var jsforce=require(_0x09b3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x09b3('0x9'));var querystring=require('querystring');var Papa=require(_0x09b3('0xe'));var Redis=require(_0x09b3('0xf'));var authService=require(_0x09b3('0x10'));var qs=require(_0x09b3('0x11'));var as=require(_0x09b3('0x12'));var hardwareService=require(_0x09b3('0x13'));var logger=require(_0x09b3('0x14'))(_0x09b3('0x15'));var utils=require(_0x09b3('0x16'));var config=require(_0x09b3('0x17'));var db=require(_0x09b3('0x18'))['db'];function respondWithStatusCode(_0x8ec91a,_0x483bff){_0x483bff=_0x483bff||0xcc;return function(_0x36ce2f){if(_0x36ce2f){return _0x8ec91a['sendStatus'](_0x483bff);}return _0x8ec91a['status'](_0x483bff)[_0x09b3('0x19')]();};}function respondWithResult(_0x186590,_0x224a58){_0x224a58=_0x224a58||0xc8;return function(_0x1c305f){if(_0x1c305f){return _0x186590['status'](_0x224a58)[_0x09b3('0x1a')](_0x1c305f);}};}function respondWithFilteredResult(_0x21d75f,_0x132330){return function(_0x3d7da9){if(_0x3d7da9){var _0x3d46c9=_0x3d7da9[_0x09b3('0x1b')],_0x2137cd=_0x132330[_0x09b3('0x1c')],_0xb822cc=_0x132330[_0x09b3('0x1c')]+_0x132330[_0x09b3('0x1d')],_0x3c73e7;if(_0xb822cc>=_0x3d46c9){_0xb822cc=_0x3d46c9;_0x3c73e7=0xc8;}else{_0x3c73e7=0xce;}_0x21d75f[_0x09b3('0x1e')](_0x3c73e7);return _0x21d75f['set'](_0x09b3('0x1f'),_0x2137cd+'-'+_0xb822cc+'/'+_0x3d46c9)['json'](_0x3d7da9);}return null;};}function patchUpdates(_0x550d79){return function(_0x2316dc){try{jsonpatch[_0x09b3('0x20')](_0x2316dc,_0x550d79,!![]);}catch(_0x5cd790){return BPromise[_0x09b3('0x21')](_0x5cd790);}return _0x2316dc[_0x09b3('0x22')]();};}function saveUpdates(_0x175640,_0x486b3e){return function(_0x3d9b2a){if(_0x3d9b2a){return _0x3d9b2a[_0x09b3('0x23')](_0x175640)[_0x09b3('0x24')](function(_0x1e1a58){return _0x1e1a58;});}return null;};}function removeEntity(_0x12f5a6,_0x4362a9){return function(_0x1cbe98){if(_0x1cbe98){return _0x1cbe98[_0x09b3('0x25')]()[_0x09b3('0x24')](function(){_0x12f5a6[_0x09b3('0x1e')](0xcc)[_0x09b3('0x19')]();});}};}function handleEntityNotFound(_0x209b4f,_0xe3d2eb){return function(_0x15039f){if(!_0x15039f){_0x209b4f[_0x09b3('0x26')](0x194);}return _0x15039f;};}function handleError(_0xb24313,_0x3cc212){_0x3cc212=_0x3cc212||0x1f4;return function(_0x8b23e0){logger[_0x09b3('0x27')](_0x8b23e0[_0x09b3('0x28')]);if(_0x8b23e0['name']){delete _0x8b23e0[_0x09b3('0x29')];}_0xb24313['status'](_0x3cc212)[_0x09b3('0x2a')](_0x8b23e0);};}exports[_0x09b3('0x2b')]=function(_0x365504,_0x36f47a){var _0xb46cff={},_0x4b1635={},_0x30ed0b={'count':0x0,'rows':[]};var _0x1cc1d0=_[_0x09b3('0x2c')](db['MailSubstatus']['rawAttributes'],function(_0x468b93){return{'name':_0x468b93['fieldName'],'type':_0x468b93['type'][_0x09b3('0x2d')]};});_0x4b1635[_0x09b3('0x2e')]=_[_0x09b3('0x2c')](_0x1cc1d0,_0x09b3('0x29'));_0x4b1635[_0x09b3('0x2f')]=_[_0x09b3('0x30')](_0x365504['query']);_0x4b1635[_0x09b3('0x31')]=_[_0x09b3('0x32')](_0x4b1635[_0x09b3('0x2e')],_0x4b1635['query']);_0xb46cff['attributes']=_[_0x09b3('0x32')](_0x4b1635[_0x09b3('0x2e')],qs['fields'](_0x365504['query']['fields']));_0xb46cff[_0x09b3('0x33')]=_0xb46cff[_0x09b3('0x33')]['length']?_0xb46cff[_0x09b3('0x33')]:_0x4b1635[_0x09b3('0x2e')];if(!_0x365504[_0x09b3('0x2f')][_0x09b3('0x34')](_0x09b3('0x35'))){_0xb46cff['limit']=qs[_0x09b3('0x1d')](_0x365504[_0x09b3('0x2f')][_0x09b3('0x1d')]);_0xb46cff['offset']=qs[_0x09b3('0x1c')](_0x365504['query'][_0x09b3('0x1c')]);}_0xb46cff[_0x09b3('0x36')]=qs[_0x09b3('0x37')](_0x365504[_0x09b3('0x2f')][_0x09b3('0x37')]);_0xb46cff[_0x09b3('0x38')]=qs[_0x09b3('0x31')](_[_0x09b3('0x39')](_0x365504[_0x09b3('0x2f')],_0x4b1635[_0x09b3('0x31')]),_0x1cc1d0);if(_0x365504[_0x09b3('0x2f')][_0x09b3('0x3a')]){_0xb46cff[_0x09b3('0x38')]=_[_0x09b3('0x3b')](_0xb46cff[_0x09b3('0x38')],{'$or':_[_0x09b3('0x2c')](_0x1cc1d0,function(_0x35f524){if(_0x35f524[_0x09b3('0x3c')]!==_0x09b3('0x3d')){var _0x3e3a28={};_0x3e3a28[_0x35f524[_0x09b3('0x29')]]={'$like':'%'+_0x365504[_0x09b3('0x2f')][_0x09b3('0x3a')]+'%'};return _0x3e3a28;}})});}_0xb46cff=_[_0x09b3('0x3b')]({},_0xb46cff,_0x365504[_0x09b3('0x3e')]);var _0x166c06={'where':_0xb46cff['where']};return db[_0x09b3('0x3f')]['count'](_0x166c06)[_0x09b3('0x24')](function(_0x3fc96d){_0x30ed0b[_0x09b3('0x1b')]=_0x3fc96d;if(_0x365504[_0x09b3('0x2f')][_0x09b3('0x40')]){_0xb46cff[_0x09b3('0x41')]=[{'all':!![]}];}return db['MailSubstatus'][_0x09b3('0x42')](_0xb46cff);})[_0x09b3('0x24')](function(_0x4fece0){_0x30ed0b['rows']=_0x4fece0;return _0x30ed0b;})['then'](respondWithFilteredResult(_0x36f47a,_0xb46cff))[_0x09b3('0x43')](handleError(_0x36f47a,null));};exports[_0x09b3('0x44')]=function(_0x80d419,_0x39ecda){var _0x5dc899={'raw':!![],'where':{'id':_0x80d419[_0x09b3('0x45')]['id']}},_0x32f262={};_0x32f262[_0x09b3('0x2e')]=_[_0x09b3('0x30')](db['MailSubstatus'][_0x09b3('0x46')]);_0x32f262[_0x09b3('0x2f')]=_[_0x09b3('0x30')](_0x80d419[_0x09b3('0x2f')]);_0x32f262['filters']=_[_0x09b3('0x32')](_0x32f262[_0x09b3('0x2e')],_0x32f262[_0x09b3('0x2f')]);_0x5dc899['attributes']=_['intersection'](_0x32f262[_0x09b3('0x2e')],qs['fields'](_0x80d419[_0x09b3('0x2f')][_0x09b3('0x47')]));_0x5dc899[_0x09b3('0x33')]=_0x5dc899[_0x09b3('0x33')][_0x09b3('0x48')]?_0x5dc899[_0x09b3('0x33')]:_0x32f262[_0x09b3('0x2e')];if(_0x80d419[_0x09b3('0x2f')]['includeAll']){_0x5dc899['include']=[{'all':!![]}];}_0x5dc899=_[_0x09b3('0x3b')]({},_0x5dc899,_0x80d419['options']);return db['MailSubstatus'][_0x09b3('0x49')](_0x5dc899)[_0x09b3('0x24')](handleEntityNotFound(_0x39ecda,null))[_0x09b3('0x24')](respondWithResult(_0x39ecda,null))[_0x09b3('0x43')](handleError(_0x39ecda,null));};exports[_0x09b3('0x4a')]=function(_0x3f4e13,_0x5be3fa){return db[_0x09b3('0x3f')][_0x09b3('0x4a')](_0x3f4e13['body'],{})[_0x09b3('0x24')](respondWithResult(_0x5be3fa,0xc9))[_0x09b3('0x43')](handleError(_0x5be3fa,null));};exports[_0x09b3('0x23')]=function(_0x57ba5e,_0x209691){if(_0x57ba5e[_0x09b3('0x4b')]['id']){delete _0x57ba5e[_0x09b3('0x4b')]['id'];}return db[_0x09b3('0x3f')][_0x09b3('0x49')]({'where':{'id':_0x57ba5e[_0x09b3('0x45')]['id']}})[_0x09b3('0x24')](handleEntityNotFound(_0x209691,null))[_0x09b3('0x24')](saveUpdates(_0x57ba5e[_0x09b3('0x4b')],null))[_0x09b3('0x24')](respondWithResult(_0x209691,null))[_0x09b3('0x43')](handleError(_0x209691,null));};exports[_0x09b3('0x25')]=function(_0x53bf28,_0x35eb57){return db[_0x09b3('0x3f')][_0x09b3('0x49')]({'where':{'id':_0x53bf28[_0x09b3('0x45')]['id']}})[_0x09b3('0x24')](handleEntityNotFound(_0x35eb57,null))[_0x09b3('0x24')](removeEntity(_0x35eb57,null))[_0x09b3('0x43')](handleError(_0x35eb57,null));};exports[_0x09b3('0x4c')]=function(_0x23cfdd,_0x241c6e){return db[_0x09b3('0x3f')][_0x09b3('0x4c')]()[_0x09b3('0x24')](respondWithResult(_0x241c6e,null))[_0x09b3('0x43')](handleError(_0x241c6e,null));};
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js
index a12bef3..ab07ac3 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 _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
+var _0x8d98=['rimraf','../../config/environment','exports','define','MailSubstatus','mail_substatuses','util','../../config/logger','api','moment','request-promise','path'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x8d98,0xc6));var _0x88d9=function(_0x5d5da5,_0x530556){_0x5d5da5=_0x5d5da5-0x0;var _0x3e5ec5=_0x8d98[_0x5d5da5];return _0x3e5ec5;};'use strict';var _=require('lodash');var util=require(_0x88d9('0x0'));var logger=require(_0x88d9('0x1'))(_0x88d9('0x2'));var moment=require(_0x88d9('0x3'));var BPromise=require('bluebird');var rp=require(_0x88d9('0x4'));var fs=require('fs');var path=require(_0x88d9('0x5'));var rimraf=require(_0x88d9('0x6'));var config=require(_0x88d9('0x7'));var attributes=require('./mailSubstatus.attributes');module[_0x88d9('0x8')]=function(_0x14e686,_0x48b56e){return _0x14e686[_0x88d9('0x9')](_0x88d9('0xa'),attributes,{'tableName':_0x88d9('0xb'),'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 0838184..ba8ee62 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 _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
+var _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x3fbb0a,_0x28a2dd){var _0x57139e=function(_0x209c0c){while(--_0x209c0c){_0x3fbb0a['push'](_0x3fbb0a['shift']());}};_0x57139e(++_0x28a2dd);}(_0x54ef,0x112));var _0xf54e=function(_0x1c3372,_0x2de696){_0x1c3372=_0x1c3372-0x0;var _0x4c5a76=_0x54ef[_0x1c3372];return _0x4c5a76;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});}
\ No newline at end of file
diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js
index 68afdbb..a4d829b 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 _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
+var _0x4606=['/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x31de92,_0x2e2469){var _0x3bd859=function(_0x5097ba){while(--_0x5097ba){_0x31de92['push'](_0x31de92['shift']());}};_0x3bd859(++_0x2e2469);}(_0x4606,0xc5));var _0x6460=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4606[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6460('0x0'));var util=require(_0x6460('0x1'));var path=require('path');var timeout=require(_0x6460('0x2'));var express=require(_0x6460('0x3'));var router=express[_0x6460('0x4')]();var auth=require(_0x6460('0x5'));var interaction=require(_0x6460('0x6'));var config=require(_0x6460('0x7'));var controller=require('./mailTransferReport.controller');router[_0x6460('0x8')]('/',auth[_0x6460('0x9')](),controller[_0x6460('0xa')]);router['get'](_0x6460('0xb'),auth[_0x6460('0x9')](),controller[_0x6460('0xc')]);router[_0x6460('0x8')](_0x6460('0xd'),auth[_0x6460('0x9')](),controller[_0x6460('0xe')]);router[_0x6460('0xf')]('/',auth['isAuthenticated'](),controller[_0x6460('0x10')]);router[_0x6460('0x11')](_0x6460('0xd'),auth[_0x6460('0x9')](),controller[_0x6460('0x12')]);router[_0x6460('0x13')](_0x6460('0xd'),auth[_0x6460('0x9')](),controller[_0x6460('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js
index e6099a8..4a51dd0 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 _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
+var _0x4323=['STRING','account','agent','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x145042,_0x458dd4){var _0x214a0c=function(_0x4c88ac){while(--_0x4c88ac){_0x145042['push'](_0x145042['shift']());}};_0x214a0c(++_0x458dd4);}(_0x4323,0x84));var _0x3432=function(_0x31055b,_0x112394){_0x31055b=_0x31055b-0x0;var _0xb3e22f=_0x4323[_0x31055b];return _0xb3e22f;};'use strict';var moment=require(_0x3432('0x0'));var Sequelize=require(_0x3432('0x1'));module[_0x3432('0x2')]={'uniqueid':{'type':Sequelize[_0x3432('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3432('0x4'),_0x3432('0x5'),_0x3432('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x3432('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x3432('0x8')]}};
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js
index 7d7d42e..4b30c11 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 _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
+var _0x8824=['describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','status','end','offset','limit','set','Content-Range','json','save','update','destroy','then','sendStatus','error','name','send','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','count','includeAll','include','MailTransferReport','rows','catch','params','keys','options','find','create','body'];(function(_0x31dd7e,_0x72d5da){var _0x2a6bfd=function(_0x34a241){while(--_0x34a241){_0x31dd7e['push'](_0x31dd7e['shift']());}};_0x2a6bfd(++_0x72d5da);}(_0x8824,0x169));var _0x4882=function(_0x58a0f2,_0xda36f5){_0x58a0f2=_0x58a0f2-0x0;var _0x590bb=_0x8824[_0x58a0f2];return _0x590bb;};'use strict';var pdf=require(_0x4882('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4882('0x1'));var zipdir=require(_0x4882('0x2'));var jsonpatch=require(_0x4882('0x3'));var rp=require(_0x4882('0x4'));var moment=require(_0x4882('0x5'));var BPromise=require(_0x4882('0x6'));var Mustache=require(_0x4882('0x7'));var util=require(_0x4882('0x8'));var path=require('path');var sox=require(_0x4882('0x9'));var csv=require(_0x4882('0xa'));var ejs=require(_0x4882('0xb'));var fs=require('fs');var _=require(_0x4882('0xc'));var squel=require('squel');var crypto=require(_0x4882('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4882('0xe'));var toCsv=require(_0x4882('0xa'));var querystring=require(_0x4882('0xf'));var Papa=require(_0x4882('0x10'));var Redis=require(_0x4882('0x11'));var authService=require(_0x4882('0x12'));var qs=require(_0x4882('0x13'));var as=require(_0x4882('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4882('0x15'))(_0x4882('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9a9250,_0x405a9f){_0x405a9f=_0x405a9f||0xcc;return function(_0x41577d){if(_0x41577d){return _0x9a9250['sendStatus'](_0x405a9f);}return _0x9a9250[_0x4882('0x17')](_0x405a9f)[_0x4882('0x18')]();};}function respondWithResult(_0x1a283d,_0x12e84a){_0x12e84a=_0x12e84a||0xc8;return function(_0x2fae21){if(_0x2fae21){return _0x1a283d[_0x4882('0x17')](_0x12e84a)['json'](_0x2fae21);}};}function respondWithFilteredResult(_0xe5b5f3,_0xf0ef1d){return function(_0x43dfa9){if(_0x43dfa9){var _0x528379=_0x43dfa9['count'],_0x2360c3=_0xf0ef1d['offset'],_0x57e1dd=_0xf0ef1d[_0x4882('0x19')]+_0xf0ef1d[_0x4882('0x1a')],_0x139080;if(_0x57e1dd>=_0x528379){_0x57e1dd=_0x528379;_0x139080=0xc8;}else{_0x139080=0xce;}_0xe5b5f3[_0x4882('0x17')](_0x139080);return _0xe5b5f3[_0x4882('0x1b')](_0x4882('0x1c'),_0x2360c3+'-'+_0x57e1dd+'/'+_0x528379)[_0x4882('0x1d')](_0x43dfa9);}return null;};}function patchUpdates(_0x2a7128){return function(_0x1be32f){try{jsonpatch['apply'](_0x1be32f,_0x2a7128,!![]);}catch(_0x283d0e){return BPromise['reject'](_0x283d0e);}return _0x1be32f[_0x4882('0x1e')]();};}function saveUpdates(_0x30fd3f,_0x4d2832){return function(_0x105701){if(_0x105701){return _0x105701[_0x4882('0x1f')](_0x30fd3f)['then'](function(_0x4915bd){return _0x4915bd;});}return null;};}function removeEntity(_0x3efc7f,_0x50ede6){return function(_0x7eadf0){if(_0x7eadf0){return _0x7eadf0[_0x4882('0x20')]()[_0x4882('0x21')](function(){_0x3efc7f[_0x4882('0x17')](0xcc)[_0x4882('0x18')]();});}};}function handleEntityNotFound(_0x267e0e,_0x586abb){return function(_0x4480ec){if(!_0x4480ec){_0x267e0e[_0x4882('0x22')](0x194);}return _0x4480ec;};}function handleError(_0x604430,_0x157cf8){_0x157cf8=_0x157cf8||0x1f4;return function(_0x3b58f4){logger[_0x4882('0x23')](_0x3b58f4['stack']);if(_0x3b58f4[_0x4882('0x24')]){delete _0x3b58f4[_0x4882('0x24')];}_0x604430[_0x4882('0x17')](_0x157cf8)[_0x4882('0x25')](_0x3b58f4);};}exports['index']=function(_0x248b2c,_0x4e33f8){var _0x3334b9={},_0x211f22={},_0x38bdc3={'count':0x0,'rows':[]};var _0x353cf9=_['map'](db['MailTransferReport'][_0x4882('0x26')],function(_0x239176){return{'name':_0x239176[_0x4882('0x27')],'type':_0x239176['type'][_0x4882('0x28')]};});_0x211f22['model']=_['map'](_0x353cf9,_0x4882('0x24'));_0x211f22[_0x4882('0x29')]=_['keys'](_0x248b2c[_0x4882('0x29')]);_0x211f22[_0x4882('0x2a')]=_[_0x4882('0x2b')](_0x211f22[_0x4882('0x2c')],_0x211f22['query']);_0x3334b9['attributes']=_[_0x4882('0x2b')](_0x211f22['model'],qs[_0x4882('0x2d')](_0x248b2c[_0x4882('0x29')]['fields']));_0x3334b9['attributes']=_0x3334b9[_0x4882('0x2e')][_0x4882('0x2f')]?_0x3334b9[_0x4882('0x2e')]:_0x211f22[_0x4882('0x2c')];if(!_0x248b2c[_0x4882('0x29')][_0x4882('0x30')](_0x4882('0x31'))){_0x3334b9[_0x4882('0x1a')]=qs[_0x4882('0x1a')](_0x248b2c['query']['limit']);_0x3334b9['offset']=qs[_0x4882('0x19')](_0x248b2c[_0x4882('0x29')]['offset']);}_0x3334b9[_0x4882('0x32')]=qs[_0x4882('0x33')](_0x248b2c[_0x4882('0x29')][_0x4882('0x33')]);_0x3334b9[_0x4882('0x34')]=qs[_0x4882('0x2a')](_[_0x4882('0x35')](_0x248b2c[_0x4882('0x29')],_0x211f22[_0x4882('0x2a')]),_0x353cf9);if(_0x248b2c[_0x4882('0x29')][_0x4882('0x36')]){_0x3334b9[_0x4882('0x34')]=_[_0x4882('0x37')](_0x3334b9[_0x4882('0x34')],{'$or':_[_0x4882('0x38')](_0x353cf9,function(_0x2a6e11){if(_0x2a6e11[_0x4882('0x39')]!==_0x4882('0x3a')){var _0x417b6f={};_0x417b6f[_0x2a6e11[_0x4882('0x24')]]={'$like':'%'+_0x248b2c['query'][_0x4882('0x36')]+'%'};return _0x417b6f;}})});}_0x3334b9=_[_0x4882('0x37')]({},_0x3334b9,_0x248b2c['options']);var _0x2874a4={'where':_0x3334b9[_0x4882('0x34')]};return db['MailTransferReport'][_0x4882('0x3b')](_0x2874a4)[_0x4882('0x21')](function(_0x975770){_0x38bdc3[_0x4882('0x3b')]=_0x975770;if(_0x248b2c[_0x4882('0x29')][_0x4882('0x3c')]){_0x3334b9[_0x4882('0x3d')]=[{'all':!![]}];}return db[_0x4882('0x3e')]['findAll'](_0x3334b9);})[_0x4882('0x21')](function(_0xecfaea){_0x38bdc3[_0x4882('0x3f')]=_0xecfaea;return _0x38bdc3;})[_0x4882('0x21')](respondWithFilteredResult(_0x4e33f8,_0x3334b9))[_0x4882('0x40')](handleError(_0x4e33f8,null));};exports['show']=function(_0x4d21cd,_0x3618de){var _0x512408={'raw':!![],'where':{'id':_0x4d21cd[_0x4882('0x41')]['id']}},_0x286dfd={};_0x286dfd[_0x4882('0x2c')]=_[_0x4882('0x42')](db['MailTransferReport'][_0x4882('0x26')]);_0x286dfd[_0x4882('0x29')]=_[_0x4882('0x42')](_0x4d21cd[_0x4882('0x29')]);_0x286dfd[_0x4882('0x2a')]=_[_0x4882('0x2b')](_0x286dfd[_0x4882('0x2c')],_0x286dfd[_0x4882('0x29')]);_0x512408[_0x4882('0x2e')]=_['intersection'](_0x286dfd[_0x4882('0x2c')],qs[_0x4882('0x2d')](_0x4d21cd[_0x4882('0x29')][_0x4882('0x2d')]));_0x512408[_0x4882('0x2e')]=_0x512408['attributes'][_0x4882('0x2f')]?_0x512408['attributes']:_0x286dfd[_0x4882('0x2c')];if(_0x4d21cd[_0x4882('0x29')][_0x4882('0x3c')]){_0x512408[_0x4882('0x3d')]=[{'all':!![]}];}_0x512408=_['merge']({},_0x512408,_0x4d21cd[_0x4882('0x43')]);return db[_0x4882('0x3e')][_0x4882('0x44')](_0x512408)[_0x4882('0x21')](handleEntityNotFound(_0x3618de,null))['then'](respondWithResult(_0x3618de,null))[_0x4882('0x40')](handleError(_0x3618de,null));};exports[_0x4882('0x45')]=function(_0x72dee0,_0x4e5e2b){return db[_0x4882('0x3e')][_0x4882('0x45')](_0x72dee0[_0x4882('0x46')],{})[_0x4882('0x21')](respondWithResult(_0x4e5e2b,0xc9))['catch'](handleError(_0x4e5e2b,null));};exports[_0x4882('0x1f')]=function(_0x47c8c6,_0xeefa8c){if(_0x47c8c6['body']['id']){delete _0x47c8c6[_0x4882('0x46')]['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x47c8c6[_0x4882('0x41')]['id']}})['then'](handleEntityNotFound(_0xeefa8c,null))[_0x4882('0x21')](saveUpdates(_0x47c8c6[_0x4882('0x46')],null))['then'](respondWithResult(_0xeefa8c,null))['catch'](handleError(_0xeefa8c,null));};exports[_0x4882('0x20')]=function(_0x12c88c,_0x3273ec){return db[_0x4882('0x3e')][_0x4882('0x44')]({'where':{'id':_0x12c88c[_0x4882('0x41')]['id']}})[_0x4882('0x21')](handleEntityNotFound(_0x3273ec,null))[_0x4882('0x21')](removeEntity(_0x3273ec,null))[_0x4882('0x40')](handleError(_0x3273ec,null));};exports[_0x4882('0x47')]=function(_0x1f160c,_0x3b1f17){return db[_0x4882('0x3e')][_0x4882('0x47')]()[_0x4882('0x21')](respondWithResult(_0x3b1f17,null))[_0x4882('0x40')](handleError(_0x3b1f17,null));};
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js
index 4d9b4cd..c2f0d86 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 _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
+var _0xaa83=['./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','lodash','util','request-promise','rimraf','../../config/environment'];(function(_0x3dbd97,_0x5a0738){var _0x44f649=function(_0x2e5498){while(--_0x2e5498){_0x3dbd97['push'](_0x3dbd97['shift']());}};_0x44f649(++_0x5a0738);}(_0xaa83,0xaf));var _0x3aa8=function(_0x478743,_0x54127e){_0x478743=_0x478743-0x0;var _0x499e70=_0xaa83[_0x478743];return _0x499e70;};'use strict';var _=require(_0x3aa8('0x0'));var util=require(_0x3aa8('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3aa8('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3aa8('0x3'));var config=require(_0x3aa8('0x4'));var attributes=require(_0x3aa8('0x5'));module[_0x3aa8('0x6')]=function(_0x12fd2d,_0x355e3b){return _0x12fd2d[_0x3aa8('0x7')](_0x3aa8('0x8'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x3aa8('0x9'),'fields':[_0x3aa8('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js
index f890730..96fff29 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 _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
+var _0x1be6=['info','MailTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x1be6,0x162));var _0x61be=function(_0x216ce7,_0xb65bdd){_0x216ce7=_0x216ce7-0x0;var _0x15181d=_0x1be6[_0x216ce7];return _0x15181d;};'use strict';var _=require(_0x61be('0x0'));var util=require(_0x61be('0x1'));var moment=require(_0x61be('0x2'));var BPromise=require(_0x61be('0x3'));var rs=require(_0x61be('0x4'));var fs=require('fs');var Redis=require(_0x61be('0x5'));var db=require(_0x61be('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x61be('0x7'))(_0x61be('0x8'));var config=require(_0x61be('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x61be('0xa')][_0x61be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12da33,_0x1781d7,_0x3bffcd){return new BPromise(function(_0x5065bf,_0x4b0984){return client[_0x61be('0xc')](_0x12da33,_0x3bffcd)[_0x61be('0xd')](function(_0x4d2db2){logger[_0x61be('0xe')](_0x61be('0xf'),_0x1781d7,'request\x20sent');logger[_0x61be('0x10')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x1781d7,_0x61be('0x11'),JSON[_0x61be('0x12')](_0x4d2db2));if(_0x4d2db2[_0x61be('0x13')]){if(_0x4d2db2['error'][_0x61be('0x14')]===0x1f4){logger[_0x61be('0x13')](_0x61be('0xf'),_0x1781d7,_0x4d2db2[_0x61be('0x13')][_0x61be('0x15')]);return _0x4b0984(_0x4d2db2['error'][_0x61be('0x15')]);}logger[_0x61be('0x13')](_0x61be('0xf'),_0x1781d7,_0x4d2db2[_0x61be('0x13')][_0x61be('0x15')]);return _0x5065bf(_0x4d2db2[_0x61be('0x13')][_0x61be('0x15')]);}else{logger[_0x61be('0xe')](_0x61be('0xf'),_0x1781d7,_0x61be('0x11'));_0x5065bf(_0x4d2db2['result'][_0x61be('0x15')]);}})[_0x61be('0x16')](function(_0x444499){logger[_0x61be('0x13')](_0x61be('0xf'),_0x1781d7,_0x444499);_0x4b0984(_0x444499);});});}
\ No newline at end of file
diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js
index 78e5458..b80bb18 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 _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
+var _0x1649=['delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x2e2eab,_0x2e609a){var _0x2357bc=function(_0x2235ad){while(--_0x2235ad){_0x2e2eab['push'](_0x2e2eab['shift']());}};_0x2357bc(++_0x2e609a);}(_0x1649,0x1b7));var _0x9164=function(_0x2d9485,_0x34061a){_0x2d9485=_0x2d9485-0x0;var _0x22f905=_0x1649[_0x2d9485];return _0x22f905;};'use strict';var multer=require('multer');var util=require(_0x9164('0x0'));var path=require(_0x9164('0x1'));var timeout=require(_0x9164('0x2'));var express=require('express');var router=express[_0x9164('0x3')]();var auth=require(_0x9164('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9164('0x5'));var controller=require(_0x9164('0x6'));router[_0x9164('0x7')]('/',auth[_0x9164('0x8')](),controller[_0x9164('0x9')]);router[_0x9164('0x7')](_0x9164('0xa'),auth[_0x9164('0x8')](),controller[_0x9164('0xb')]);router['get'](_0x9164('0xc'),auth[_0x9164('0x8')](),controller[_0x9164('0xd')]);router[_0x9164('0xe')]('/',auth[_0x9164('0x8')](),controller[_0x9164('0xf')]);router[_0x9164('0x10')](_0x9164('0xc'),auth[_0x9164('0x8')](),controller['update']);router[_0x9164('0x11')](_0x9164('0xc'),auth[_0x9164('0x8')](),controller['destroy']);module[_0x9164('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js
index 6d03b54..4339aa5 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 _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
+var _0x485e=['seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff'];(function(_0x4ec13d,_0x358a8f){var _0x3c3fa7=function(_0x2615f6){while(--_0x2615f6){_0x4ec13d['push'](_0x4ec13d['shift']());}};_0x3c3fa7(++_0x358a8f);}(_0x485e,0x1c2));var _0xe485=function(_0x4f32de,_0x5bd4a){_0x4f32de=_0x4f32de-0x0;var _0x149821=_0x485e[_0x4f32de];return _0x149821;};'use strict';var Sequelize=require(_0xe485('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0xe485('0x1')]},'membername':{'type':Sequelize[_0xe485('0x1')]},'interface':{'type':Sequelize[_0xe485('0x1')]},'type':{'type':Sequelize[_0xe485('0x1')],'defaultValue':_0xe485('0x2'),'comment':_0xe485('0x3')},'duration':{'type':Sequelize[_0xe485('0x4')]},'enterAt':{'type':Sequelize[_0xe485('0x5')]},'exitAt':{'type':Sequelize[_0xe485('0x5')],'set':function(_0x27bb3f){var _0x3fdf86=moment(_0x27bb3f);var _0x1e54cc=moment(this[_0xe485('0x6')](_0xe485('0x7')));var _0x4c5e74=_0x3fdf86[_0xe485('0x8')](_0x1e54cc,_0xe485('0x9'));this[_0xe485('0xa')](_0xe485('0xb'),_0x27bb3f);this['setDataValue'](_0xe485('0xc'),_0x4c5e74||null);}},'data1':{'type':Sequelize[_0xe485('0x1')],'comment':_0xe485('0xd')},'data2':{'type':Sequelize[_0xe485('0x1')],'comment':_0xe485('0xe')},'data3':{'type':Sequelize[_0xe485('0x1')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xe485('0x1')],'comment':_0xe485('0xf')},'data5':{'type':Sequelize['STRING'],'comment':_0xe485('0x10')},'role':{'type':Sequelize[_0xe485('0x1')]},'internal':{'type':Sequelize[_0xe485('0x4')]},'uniqueid':{'type':Sequelize[_0xe485('0x1')]}};
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js
index db660b0..3fa794f 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 _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
+var _0xebb4=['length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','type','options','MemberReport','includeAll','include','find','catch','create','body','params','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','update','then','error','stack','name','send','index','map','fieldName','key','keys','query','model','attributes','intersection','fields'];(function(_0x57dc85,_0x3a6d51){var _0x563a2e=function(_0x5713b2){while(--_0x5713b2){_0x57dc85['push'](_0x57dc85['shift']());}};_0x563a2e(++_0x3a6d51);}(_0xebb4,0x1bf));var _0x4ebb=function(_0x4efed9,_0x1ccd6a){_0x4efed9=_0x4efed9-0x0;var _0x7aafbc=_0xebb4[_0x4efed9];return _0x7aafbc;};'use strict';var pdf=require(_0x4ebb('0x0'));var emlformat=require(_0x4ebb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4ebb('0x2'));var jsonpatch=require(_0x4ebb('0x3'));var rp=require(_0x4ebb('0x4'));var moment=require('moment');var BPromise=require(_0x4ebb('0x5'));var Mustache=require(_0x4ebb('0x6'));var util=require(_0x4ebb('0x7'));var path=require(_0x4ebb('0x8'));var sox=require('sox');var csv=require(_0x4ebb('0x9'));var ejs=require(_0x4ebb('0xa'));var fs=require('fs');var _=require(_0x4ebb('0xb'));var squel=require(_0x4ebb('0xc'));var crypto=require(_0x4ebb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4ebb('0xe'));var toCsv=require(_0x4ebb('0x9'));var querystring=require(_0x4ebb('0xf'));var Papa=require(_0x4ebb('0x10'));var Redis=require(_0x4ebb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ebb('0x12'));var as=require(_0x4ebb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ebb('0x14'))(_0x4ebb('0x15'));var utils=require('../../config/utils');var config=require(_0x4ebb('0x16'));var db=require(_0x4ebb('0x17'))['db'];function respondWithStatusCode(_0x876931,_0x22d925){_0x22d925=_0x22d925||0xcc;return function(_0x1540a8){if(_0x1540a8){return _0x876931[_0x4ebb('0x18')](_0x22d925);}return _0x876931['status'](_0x22d925)[_0x4ebb('0x19')]();};}function respondWithResult(_0x2f3000,_0x87dd98){_0x87dd98=_0x87dd98||0xc8;return function(_0x4f0e46){if(_0x4f0e46){return _0x2f3000[_0x4ebb('0x1a')](_0x87dd98)[_0x4ebb('0x1b')](_0x4f0e46);}};}function respondWithFilteredResult(_0x24d1f4,_0x142688){return function(_0x39e66d){if(_0x39e66d){var _0x2c81c2=_0x39e66d[_0x4ebb('0x1c')],_0x503430=_0x142688[_0x4ebb('0x1d')],_0x4bd8f8=_0x142688['offset']+_0x142688[_0x4ebb('0x1e')],_0x52e108;if(_0x4bd8f8>=_0x2c81c2){_0x4bd8f8=_0x2c81c2;_0x52e108=0xc8;}else{_0x52e108=0xce;}_0x24d1f4[_0x4ebb('0x1a')](_0x52e108);return _0x24d1f4[_0x4ebb('0x1f')](_0x4ebb('0x20'),_0x503430+'-'+_0x4bd8f8+'/'+_0x2c81c2)[_0x4ebb('0x1b')](_0x39e66d);}return null;};}function patchUpdates(_0x19dee9){return function(_0x237710){try{jsonpatch['apply'](_0x237710,_0x19dee9,!![]);}catch(_0x331eea){return BPromise[_0x4ebb('0x21')](_0x331eea);}return _0x237710['save']();};}function saveUpdates(_0x164d22,_0x680174){return function(_0x1ca10f){if(_0x1ca10f){return _0x1ca10f[_0x4ebb('0x22')](_0x164d22)['then'](function(_0x3a68eb){return _0x3a68eb;});}return null;};}function removeEntity(_0x46789b,_0x2d3330){return function(_0x17b7f2){if(_0x17b7f2){return _0x17b7f2['destroy']()[_0x4ebb('0x23')](function(){_0x46789b[_0x4ebb('0x1a')](0xcc)[_0x4ebb('0x19')]();});}};}function handleEntityNotFound(_0x37f3e2,_0x43d665){return function(_0x136b4c){if(!_0x136b4c){_0x37f3e2['sendStatus'](0x194);}return _0x136b4c;};}function handleError(_0x5d2a45,_0x398341){_0x398341=_0x398341||0x1f4;return function(_0x582721){logger[_0x4ebb('0x24')](_0x582721[_0x4ebb('0x25')]);if(_0x582721[_0x4ebb('0x26')]){delete _0x582721[_0x4ebb('0x26')];}_0x5d2a45['status'](_0x398341)[_0x4ebb('0x27')](_0x582721);};}exports[_0x4ebb('0x28')]=function(_0x1c8f76,_0xbeec55){var _0x8bd613={},_0x5303e3={},_0x29173a={'count':0x0,'rows':[]};var _0x2a6d75=_[_0x4ebb('0x29')](db['MemberReport']['rawAttributes'],function(_0x441823){return{'name':_0x441823[_0x4ebb('0x2a')],'type':_0x441823['type'][_0x4ebb('0x2b')]};});_0x5303e3['model']=_[_0x4ebb('0x29')](_0x2a6d75,_0x4ebb('0x26'));_0x5303e3['query']=_[_0x4ebb('0x2c')](_0x1c8f76[_0x4ebb('0x2d')]);_0x5303e3['filters']=_['intersection'](_0x5303e3[_0x4ebb('0x2e')],_0x5303e3[_0x4ebb('0x2d')]);_0x8bd613[_0x4ebb('0x2f')]=_[_0x4ebb('0x30')](_0x5303e3['model'],qs[_0x4ebb('0x31')](_0x1c8f76['query']['fields']));_0x8bd613[_0x4ebb('0x2f')]=_0x8bd613['attributes'][_0x4ebb('0x32')]?_0x8bd613['attributes']:_0x5303e3[_0x4ebb('0x2e')];if(!_0x1c8f76['query'][_0x4ebb('0x33')]('nolimit')){_0x8bd613['limit']=qs[_0x4ebb('0x1e')](_0x1c8f76[_0x4ebb('0x2d')][_0x4ebb('0x1e')]);_0x8bd613['offset']=qs[_0x4ebb('0x1d')](_0x1c8f76[_0x4ebb('0x2d')][_0x4ebb('0x1d')]);}_0x8bd613[_0x4ebb('0x34')]=qs[_0x4ebb('0x35')](_0x1c8f76[_0x4ebb('0x2d')][_0x4ebb('0x35')]);_0x8bd613['where']=qs[_0x4ebb('0x36')](_[_0x4ebb('0x37')](_0x1c8f76['query'],_0x5303e3[_0x4ebb('0x36')]),_0x2a6d75);if(_0x1c8f76[_0x4ebb('0x2d')][_0x4ebb('0x38')]){_0x8bd613[_0x4ebb('0x39')]=_[_0x4ebb('0x3a')](_0x8bd613[_0x4ebb('0x39')],{'$or':_['map'](_0x2a6d75,function(_0x44c910){if(_0x44c910[_0x4ebb('0x3b')]!=='VIRTUAL'){var _0x29cfbb={};_0x29cfbb[_0x44c910[_0x4ebb('0x26')]]={'$like':'%'+_0x1c8f76['query'][_0x4ebb('0x38')]+'%'};return _0x29cfbb;}})});}_0x8bd613=_[_0x4ebb('0x3a')]({},_0x8bd613,_0x1c8f76[_0x4ebb('0x3c')]);var _0x4ef866={'where':_0x8bd613[_0x4ebb('0x39')]};return db[_0x4ebb('0x3d')][_0x4ebb('0x1c')](_0x4ef866)[_0x4ebb('0x23')](function(_0x493b38){_0x29173a[_0x4ebb('0x1c')]=_0x493b38;if(_0x1c8f76[_0x4ebb('0x2d')][_0x4ebb('0x3e')]){_0x8bd613[_0x4ebb('0x3f')]=[{'all':!![]}];}return db[_0x4ebb('0x3d')]['findAll'](_0x8bd613);})[_0x4ebb('0x23')](function(_0x1204a2){_0x29173a['rows']=_0x1204a2;return _0x29173a;})[_0x4ebb('0x23')](respondWithFilteredResult(_0xbeec55,_0x8bd613))['catch'](handleError(_0xbeec55,null));};exports['show']=function(_0x55d14b,_0x5c3dd6){var _0x412eac={'raw':!![],'where':{'id':_0x55d14b['params']['id']}},_0x461547={};_0x461547[_0x4ebb('0x2e')]=_[_0x4ebb('0x2c')](db['MemberReport']['rawAttributes']);_0x461547[_0x4ebb('0x2d')]=_[_0x4ebb('0x2c')](_0x55d14b[_0x4ebb('0x2d')]);_0x461547[_0x4ebb('0x36')]=_[_0x4ebb('0x30')](_0x461547[_0x4ebb('0x2e')],_0x461547[_0x4ebb('0x2d')]);_0x412eac[_0x4ebb('0x2f')]=_[_0x4ebb('0x30')](_0x461547['model'],qs[_0x4ebb('0x31')](_0x55d14b['query'][_0x4ebb('0x31')]));_0x412eac['attributes']=_0x412eac[_0x4ebb('0x2f')][_0x4ebb('0x32')]?_0x412eac[_0x4ebb('0x2f')]:_0x461547['model'];if(_0x55d14b[_0x4ebb('0x2d')]['includeAll']){_0x412eac[_0x4ebb('0x3f')]=[{'all':!![]}];}_0x412eac=_[_0x4ebb('0x3a')]({},_0x412eac,_0x55d14b[_0x4ebb('0x3c')]);return db['MemberReport'][_0x4ebb('0x40')](_0x412eac)[_0x4ebb('0x23')](handleEntityNotFound(_0x5c3dd6,null))['then'](respondWithResult(_0x5c3dd6,null))[_0x4ebb('0x41')](handleError(_0x5c3dd6,null));};exports['create']=function(_0x3abe0f,_0x5b4440){return db[_0x4ebb('0x3d')][_0x4ebb('0x42')](_0x3abe0f['body'],{})[_0x4ebb('0x23')](respondWithResult(_0x5b4440,0xc9))['catch'](handleError(_0x5b4440,null));};exports['update']=function(_0x2095e3,_0x4ee287){if(_0x2095e3[_0x4ebb('0x43')]['id']){delete _0x2095e3[_0x4ebb('0x43')]['id'];}return db[_0x4ebb('0x3d')]['find']({'where':{'id':_0x2095e3[_0x4ebb('0x44')]['id']}})[_0x4ebb('0x23')](handleEntityNotFound(_0x4ee287,null))[_0x4ebb('0x23')](saveUpdates(_0x2095e3[_0x4ebb('0x43')],null))[_0x4ebb('0x23')](respondWithResult(_0x4ee287,null))[_0x4ebb('0x41')](handleError(_0x4ee287,null));};exports[_0x4ebb('0x45')]=function(_0x4176e2,_0x15531c){return db['MemberReport'][_0x4ebb('0x40')]({'where':{'id':_0x4176e2[_0x4ebb('0x44')]['id']}})[_0x4ebb('0x23')](handleEntityNotFound(_0x15531c,null))['then'](removeEntity(_0x15531c,null))[_0x4ebb('0x41')](handleError(_0x15531c,null));};exports[_0x4ebb('0x46')]=function(_0x508d2f,_0x1a27cb){return db[_0x4ebb('0x3d')][_0x4ebb('0x46')]()[_0x4ebb('0x23')](respondWithResult(_0x1a27cb,null))[_0x4ebb('0x41')](handleError(_0x1a27cb,null));};
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js
index 9f39edc..91c522c 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 _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
+var _0x5ad3=['membername_interface','membername','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','report_member'];(function(_0x423f32,_0xa71a18){var _0x512afc=function(_0x5b65b9){while(--_0x5b65b9){_0x423f32['push'](_0x423f32['shift']());}};_0x512afc(++_0xa71a18);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x5ad3[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var logger=require(_0x35ad('0x2'))(_0x35ad('0x3'));var moment=require('moment');var BPromise=require(_0x35ad('0x4'));var rp=require(_0x35ad('0x5'));var fs=require('fs');var path=require(_0x35ad('0x6'));var rimraf=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var attributes=require(_0x35ad('0x9'));module[_0x35ad('0xa')]=function(_0x436dcb,_0x36c606){return _0x436dcb[_0x35ad('0xb')]('MemberReport',attributes,{'tableName':_0x35ad('0xc'),'paranoid':![],'indexes':[{'name':_0x35ad('0xd'),'fields':[_0x35ad('0xe'),'interface']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js
index e3bb78c..2852792 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 _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
+var _0x5494=['findAll','options','raw','where','attributes','limit','include','model','map','CreateMemberReport','body','UpdateMemberReport','MemberReport','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMemberReport'];(function(_0x2534f5,_0x1f65ce){var _0x41d078=function(_0x336df0){while(--_0x336df0){_0x2534f5['push'](_0x2534f5['shift']());}};_0x41d078(++_0x1f65ce);}(_0x5494,0xfb));var _0x4549=function(_0x51380e,_0x55b897){_0x51380e=_0x51380e-0x0;var _0x2ed390=_0x5494[_0x51380e];return _0x2ed390;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4549('0x0'));var rs=require(_0x4549('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4549('0x2'))['db'];var utils=require(_0x4549('0x3'));var logger=require(_0x4549('0x4'))('rpc');var config=require(_0x4549('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4549('0x6')][_0x4549('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37dbb6,_0x4c6563,_0x2a19de){return new BPromise(function(_0x4b6392,_0x5da90c){return client['request'](_0x37dbb6,_0x2a19de)[_0x4549('0x8')](function(_0x3c0e6e){logger['info'](_0x4549('0x9'),_0x4c6563,_0x4549('0xa'));logger[_0x4549('0xb')](_0x4549('0xc'),_0x4c6563,_0x4549('0xa'),JSON[_0x4549('0xd')](_0x3c0e6e));if(_0x3c0e6e['error']){if(_0x3c0e6e[_0x4549('0xe')][_0x4549('0xf')]===0x1f4){logger[_0x4549('0xe')]('MemberReport,\x20%s,\x20%s',_0x4c6563,_0x3c0e6e['error']['message']);return _0x5da90c(_0x3c0e6e[_0x4549('0xe')][_0x4549('0x10')]);}logger[_0x4549('0xe')](_0x4549('0x9'),_0x4c6563,_0x3c0e6e['error'][_0x4549('0x10')]);return _0x4b6392(_0x3c0e6e[_0x4549('0xe')][_0x4549('0x10')]);}else{logger[_0x4549('0x11')](_0x4549('0x9'),_0x4c6563,'request\x20sent');_0x4b6392(_0x3c0e6e[_0x4549('0x12')]['message']);}})[_0x4549('0x13')](function(_0x202c4d){logger[_0x4549('0xe')](_0x4549('0x9'),_0x4c6563,_0x202c4d);_0x5da90c(_0x202c4d);});});}exports[_0x4549('0x14')]=function(_0x455d93){var _0x53eeb9=this;return new Promise(function(_0x3e3ae3,_0x2929dd){return db['MemberReport'][_0x4549('0x15')]({'raw':_0x455d93[_0x4549('0x16')]?_0x455d93[_0x4549('0x16')][_0x4549('0x17')]===undefined?!![]:![]:!![],'where':_0x455d93[_0x4549('0x16')]?_0x455d93[_0x4549('0x16')][_0x4549('0x18')]||null:null,'attributes':_0x455d93[_0x4549('0x16')]?_0x455d93['options'][_0x4549('0x19')]||null:null,'limit':_0x455d93[_0x4549('0x16')]?_0x455d93[_0x4549('0x16')][_0x4549('0x1a')]||null:null,'include':_0x455d93['options']?_0x455d93[_0x4549('0x16')][_0x4549('0x1b')]?_['map'](_0x455d93[_0x4549('0x16')][_0x4549('0x1b')],function(_0x2b0a14){return{'model':db[_0x2b0a14[_0x4549('0x1c')]],'as':_0x2b0a14['as'],'attributes':_0x2b0a14[_0x4549('0x19')],'include':_0x2b0a14[_0x4549('0x1b')]?_[_0x4549('0x1d')](_0x2b0a14[_0x4549('0x1b')],function(_0x43d2f4){return{'model':db[_0x43d2f4[_0x4549('0x1c')]],'as':_0x43d2f4['as'],'attributes':_0x43d2f4[_0x4549('0x19')],'include':_0x43d2f4[_0x4549('0x1b')]?_[_0x4549('0x1d')](_0x43d2f4['include'],function(_0x376dcb){return{'model':db[_0x376dcb[_0x4549('0x1c')]],'as':_0x376dcb['as'],'attributes':_0x376dcb[_0x4549('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15660e){logger[_0x4549('0x11')]('GetMemberReport',_0x455d93);logger['debug'](_0x4549('0x14'),_0x455d93,JSON[_0x4549('0xd')](_0x15660e));_0x3e3ae3(_0x15660e);})['catch'](function(_0x526f3b){logger[_0x4549('0xe')](_0x4549('0x14'),_0x526f3b[_0x4549('0x10')],_0x455d93);_0x2929dd(_0x53eeb9[_0x4549('0xe')](0x1f4,_0x526f3b[_0x4549('0x10')]));});});};exports[_0x4549('0x1e')]=function(_0x365651){var _0x2c1b49=this;return new Promise(function(_0x202ad5,_0x168bc7){return db['MemberReport']['create'](_0x365651[_0x4549('0x1f')],{'raw':_0x365651[_0x4549('0x16')]?_0x365651[_0x4549('0x16')][_0x4549('0x17')]===undefined?!![]:![]:!![]})[_0x4549('0x8')](function(_0x48fec8){logger[_0x4549('0x11')](_0x4549('0x1e'),_0x365651);logger[_0x4549('0xb')]('CreateMemberReport',_0x365651,JSON[_0x4549('0xd')](_0x48fec8));_0x202ad5(_0x48fec8);})[_0x4549('0x13')](function(_0x7d071a){logger[_0x4549('0xe')]('CreateMemberReport',_0x7d071a[_0x4549('0x10')],_0x365651);_0x168bc7(_0x2c1b49[_0x4549('0xe')](0x1f4,_0x7d071a[_0x4549('0x10')]));});});};exports[_0x4549('0x20')]=function(_0x4bee37){var _0x4ec514=this;return new Promise(function(_0xe65fb9,_0x3b7bf0){return db[_0x4549('0x21')]['update'](_0x4bee37[_0x4549('0x1f')],{'raw':_0x4bee37[_0x4549('0x16')]?_0x4bee37[_0x4549('0x16')][_0x4549('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bee37[_0x4549('0x16')]?_0x4bee37['options'][_0x4549('0x18')]||null:null,'attributes':_0x4bee37[_0x4549('0x16')]?_0x4bee37[_0x4549('0x16')][_0x4549('0x19')]||null:null,'limit':_0x4bee37[_0x4549('0x16')]?_0x4bee37[_0x4549('0x16')][_0x4549('0x1a')]||null:null})['then'](function(_0x483faa){logger[_0x4549('0x11')](_0x4549('0x20'),_0x4bee37);logger[_0x4549('0xb')]('UpdateMemberReport',_0x4bee37,JSON[_0x4549('0xd')](_0x483faa));_0xe65fb9(_0x483faa);})[_0x4549('0x13')](function(_0x137f37){logger[_0x4549('0xe')](_0x4549('0x20'),_0x137f37[_0x4549('0x10')],_0x4bee37);_0x3b7bf0(_0x4ec514['error'](0x1f4,_0x137f37[_0x4549('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/migration/index.js b/server/api/migration/index.js
index 2b85ea5..a0dfcd3 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 _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
+var _0x5eb8=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports'];(function(_0x513f27,_0x1cbc87){var _0xa316b7=function(_0x3b592d){while(--_0x3b592d){_0x513f27['push'](_0x513f27['shift']());}};_0xa316b7(++_0x1cbc87);}(_0x5eb8,0xb0));var _0x85eb=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0x5eb8[_0x218972];return _0x1bb1a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var auth=require(_0x85eb('0x4'));var interaction=require(_0x85eb('0x5'));var config=require(_0x85eb('0x6'));var controller=require(_0x85eb('0x7'));router[_0x85eb('0x8')]('/',controller[_0x85eb('0x9')]);module[_0x85eb('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js
index 3037633..8c10f55 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 _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
+var _0x2dcb=['STRING','version'];(function(_0x45bda8,_0x373600){var _0x2d7daf=function(_0x231fc7){while(--_0x231fc7){_0x45bda8['push'](_0x45bda8['shift']());}};_0x2d7daf(++_0x373600);}(_0x2dcb,0x172));var _0xb2dc=function(_0x5981b9,_0x1250f8){_0x5981b9=_0x5981b9-0x0;var _0x2ea4ad=_0x2dcb[_0x5981b9];return _0x2ea4ad;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize[_0xb2dc('0x0')],'unique':_0xb2dc('0x1')}};
\ No newline at end of file
diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js
index e1151b5..d16acea 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 _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
+var _0x008c=['../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','destroy','then','name','send','index','map','Migration','fieldName','type','key','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x4a5a01,_0x225785){var _0x518f32=function(_0x96fd45){while(--_0x96fd45){_0x4a5a01['push'](_0x4a5a01['shift']());}};_0x518f32(++_0x225785);}(_0x008c,0x188));var _0xc008=function(_0x588c33,_0xe686f7){_0x588c33=_0x588c33-0x0;var _0x5c639c=_0x008c[_0x588c33];return _0x5c639c;};'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));};
\ No newline at end of file
diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js
index 901a9f7..a2c9cb6 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 _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
+var _0xb945=['path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','../../config/logger','moment'];(function(_0x35a04d,_0x466c33){var _0x56d5cd=function(_0x5687cc){while(--_0x5687cc){_0x35a04d['push'](_0x35a04d['shift']());}};_0x56d5cd(++_0x466c33);}(_0xb945,0x97));var _0x5b94=function(_0x163374,_0x1b0054){_0x163374=_0x163374-0x0;var _0x445d96=_0xb945[_0x163374];return _0x445d96;};'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
diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js
index 20c41e9..c0fb10b 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 _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
+var _0xf4e9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x1ca5c0,_0x45c0b0){var _0x42071c=function(_0x54c516){while(--_0x54c516){_0x1ca5c0['push'](_0x1ca5c0['shift']());}};_0x42071c(++_0x45c0b0);}(_0xf4e9,0x174));var _0x9f4e=function(_0x26594c,_0x42df64){_0x26594c=_0x26594c-0x0;var _0x3bbccc=_0xf4e9[_0x26594c];return _0x3bbccc;};'use strict';var _=require(_0x9f4e('0x0'));var util=require(_0x9f4e('0x1'));var moment=require(_0x9f4e('0x2'));var BPromise=require(_0x9f4e('0x3'));var rs=require(_0x9f4e('0x4'));var fs=require('fs');var Redis=require(_0x9f4e('0x5'));var db=require(_0x9f4e('0x6'))['db'];var utils=require(_0x9f4e('0x7'));var logger=require('../../config/logger')(_0x9f4e('0x8'));var config=require(_0x9f4e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9f4e('0xa')][_0x9f4e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13fb06,_0x384af9,_0x26387c){return new BPromise(function(_0x45cf1f,_0x2e0549){return client[_0x9f4e('0xc')](_0x13fb06,_0x26387c)['then'](function(_0x589d4f){logger[_0x9f4e('0xd')](_0x9f4e('0xe'),_0x384af9,_0x9f4e('0xf'));logger['debug'](_0x9f4e('0x10'),_0x384af9,_0x9f4e('0xf'),JSON[_0x9f4e('0x11')](_0x589d4f));if(_0x589d4f[_0x9f4e('0x12')]){if(_0x589d4f['error']['code']===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x384af9,_0x589d4f[_0x9f4e('0x12')][_0x9f4e('0x13')]);return _0x2e0549(_0x589d4f[_0x9f4e('0x12')][_0x9f4e('0x13')]);}logger[_0x9f4e('0x12')]('Migration,\x20%s,\x20%s',_0x384af9,_0x589d4f[_0x9f4e('0x12')][_0x9f4e('0x13')]);return _0x45cf1f(_0x589d4f[_0x9f4e('0x12')][_0x9f4e('0x13')]);}else{logger[_0x9f4e('0xd')](_0x9f4e('0xe'),_0x384af9,_0x9f4e('0xf'));_0x45cf1f(_0x589d4f[_0x9f4e('0x14')][_0x9f4e('0x13')]);}})[_0x9f4e('0x15')](function(_0x50747b){logger[_0x9f4e('0x12')](_0x9f4e('0xe'),_0x384af9,_0x50747b);_0x2e0549(_0x50747b);});});}
\ No newline at end of file
diff --git a/server/api/network/index.js b/server/api/network/index.js
index 794511f..6fc2b04 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 _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
+var _0x80a3=['get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x339504,_0x4a3525){var _0x22810f=function(_0x194081){while(--_0x194081){_0x339504['push'](_0x339504['shift']());}};_0x22810f(++_0x4a3525);}(_0x80a3,0x1e6));var _0x380a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x80a3[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x380a('0x0'));var util=require(_0x380a('0x1'));var path=require(_0x380a('0x2'));var timeout=require('connect-timeout');var express=require(_0x380a('0x3'));var router=express['Router']();var auth=require(_0x380a('0x4'));var interaction=require(_0x380a('0x5'));var config=require(_0x380a('0x6'));var controller=require('./network.controller');router[_0x380a('0x7')]('/',auth[_0x380a('0x8')](),controller[_0x380a('0x9')]);router[_0x380a('0x7')](_0x380a('0xa'),auth[_0x380a('0x8')](),controller[_0x380a('0xb')]);router[_0x380a('0xc')]('/',auth[_0x380a('0x8')](),controller[_0x380a('0xd')]);router[_0x380a('0xe')](_0x380a('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x380a('0xf')](_0x380a('0xa'),auth[_0x380a('0x8')](),controller['destroy']);module[_0x380a('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js
index c20f7f8..2fd9eef 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(_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
+var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x138031,_0x1dfde5){var _0x25bc69=function(_0x5f34b0){while(--_0x5f34b0){_0x138031['push'](_0x138031['shift']());}};_0x25bc69(++_0x1dfde5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 7a97602..bcd06bc 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 _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
+var _0x8b04=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','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','Network,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','set','apply','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','sort','pick','where','VIRTUAL','filter','options','Network','count','includeAll','include','findAll','rows','show','params','keys','length','merge','find','create','sequelize','transaction','body','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','update','destroy','/etc/asterisk/sip_xcally_%s.conf','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto'];(function(_0x1bd037,_0x17669f){var _0x581e27=function(_0x5aea0b){while(--_0x5aea0b){_0x1bd037['push'](_0x1bd037['shift']());}};_0x581e27(++_0x17669f);}(_0x8b04,0x130));var _0x48b0=function(_0x146ed6,_0x356f88){_0x146ed6=_0x146ed6-0x0;var _0x2dd649=_0x8b04[_0x146ed6];return _0x2dd649;};'use strict';var pdf=require(_0x48b0('0x0'));var emlformat=require(_0x48b0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x48b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x48b0('0x3'));var moment=require(_0x48b0('0x4'));var BPromise=require(_0x48b0('0x5'));var Mustache=require(_0x48b0('0x6'));var util=require(_0x48b0('0x7'));var path=require(_0x48b0('0x8'));var sox=require(_0x48b0('0x9'));var csv=require(_0x48b0('0xa'));var ejs=require(_0x48b0('0xb'));var fs=require('fs');var _=require(_0x48b0('0xc'));var squel=require('squel');var crypto=require(_0x48b0('0xd'));var jsforce=require(_0x48b0('0xe'));var deskjs=require(_0x48b0('0xf'));var toCsv=require(_0x48b0('0xa'));var querystring=require(_0x48b0('0x10'));var Papa=require(_0x48b0('0x11'));var Redis=require(_0x48b0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x48b0('0x13'));var as=require(_0x48b0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x48b0('0x15'))(_0x48b0('0x16'));var utils=require('../../config/utils');var config=require(_0x48b0('0x17'));var db=require(_0x48b0('0x18'))['db'];var jayson=require(_0x48b0('0x19'));var client=jayson[_0x48b0('0x1a')][_0x48b0('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3f7c29,_0x52bb16,_0x5bcd8b){if(_0x5bcd8b){var _0x43e9e9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x43e9e9['test'](_0x52bb16)){return _0x3f7c29;}else{throw new db[(_0x48b0('0x1c'))]['ValidationError'](_0x48b0('0x1d'));}}else{return _0x3f7c29;}}function respondWithRpcPromise(_0x341566,_0x2e736d,_0x37110c,_0x57154e){return new BPromise(function(_0x377f65,_0x29e511){var _0x23840e=_0x57154e||client;return _0x23840e['request'](_0x341566,_0x37110c)[_0x48b0('0x1e')](function(_0x4f796f){logger['info'](_0x48b0('0x1f'),_0x2e736d,'request\x20sent');logger[_0x48b0('0x20')]('Network,\x20%s,\x20%s,\x20%s',_0x2e736d,_0x48b0('0x21'),JSON['stringify'](_0x4f796f));if(_0x4f796f[_0x48b0('0x22')]){if(_0x4f796f[_0x48b0('0x22')][_0x48b0('0x23')]===0x1f4){logger[_0x48b0('0x22')](_0x48b0('0x1f'),_0x2e736d,_0x4f796f['error']['message']);return _0x29e511(_0x4f796f['error']['message']);}logger['error'](_0x48b0('0x1f'),_0x2e736d,_0x4f796f[_0x48b0('0x22')][_0x48b0('0x24')]);return _0x377f65(_0x4f796f[_0x48b0('0x22')]['message']);}else{logger[_0x48b0('0x25')]('Network,\x20%s,\x20%s',_0x2e736d,_0x48b0('0x21'));_0x377f65(_0x4f796f[_0x48b0('0x26')][_0x48b0('0x24')]);}})[_0x48b0('0x27')](function(_0x3761b0){logger['error']('Network,\x20%s,\x20%s',_0x2e736d,_0x3761b0);_0x29e511(_0x3761b0);});});}function respondWithStatusCode(_0x57012b,_0x5609fb){_0x5609fb=_0x5609fb||0xcc;return function(_0x4dace2){if(_0x4dace2){return _0x57012b[_0x48b0('0x28')](_0x5609fb);}return _0x57012b[_0x48b0('0x29')](_0x5609fb)[_0x48b0('0x2a')]();};}function respondWithResult(_0x379d13,_0x590eb4){_0x590eb4=_0x590eb4||0xc8;return function(_0x5b747f){if(_0x5b747f){return _0x379d13[_0x48b0('0x29')](_0x590eb4)[_0x48b0('0x2b')](_0x5b747f);}};}function respondWithFilteredResult(_0x52451b,_0x50e7cf){return function(_0x450bcf){if(_0x450bcf){var _0x3b4b3c=_0x450bcf['count'],_0x47e6a6=_0x50e7cf['offset'],_0x175f52=_0x50e7cf[_0x48b0('0x2c')]+_0x50e7cf[_0x48b0('0x2d')],_0x3d1ff3;if(_0x175f52>=_0x3b4b3c){_0x175f52=_0x3b4b3c;_0x3d1ff3=0xc8;}else{_0x3d1ff3=0xce;}_0x52451b[_0x48b0('0x29')](_0x3d1ff3);return _0x52451b[_0x48b0('0x2e')]('Content-Range',_0x47e6a6+'-'+_0x175f52+'/'+_0x3b4b3c)[_0x48b0('0x2b')](_0x450bcf);}return null;};}function patchUpdates(_0x50a2a1){return function(_0x1c872d){try{jsonpatch[_0x48b0('0x2f')](_0x1c872d,_0x50a2a1,!![]);}catch(_0x3498b9){return BPromise['reject'](_0x3498b9);}return _0x1c872d['save']();};}function saveUpdates(_0x42c45d,_0x265c34){return function(_0x254220){if(_0x254220){return _0x254220['update'](_0x42c45d)['then'](function(_0x299832){return _0x299832;});}return null;};}function removeEntity(_0x238f24,_0x1fe08b){return function(_0x1dc474){if(_0x1dc474){return _0x1dc474['destroy']()[_0x48b0('0x1e')](function(){_0x238f24['status'](0xcc)[_0x48b0('0x2a')]();});}};}function handleEntityNotFound(_0x348019,_0x33781a){return function(_0x12b909){if(!_0x12b909){_0x348019[_0x48b0('0x28')](0x194);}return _0x12b909;};}function handleError(_0x3f873e,_0x24bf60){_0x24bf60=_0x24bf60||0x1f4;return function(_0x226463){logger[_0x48b0('0x22')](_0x226463['stack']);if(_0x226463[_0x48b0('0x30')]){delete _0x226463[_0x48b0('0x30')];}_0x3f873e[_0x48b0('0x29')](_0x24bf60)[_0x48b0('0x31')](_0x226463);};}exports[_0x48b0('0x32')]=function(_0x288712,_0x46f4ff){var _0x2310d5={},_0x380080={},_0x5d932e={'count':0x0,'rows':[]};var _0x3d3dd3=_[_0x48b0('0x33')](db['Network'][_0x48b0('0x34')],function(_0x28c3b1){return{'name':_0x28c3b1[_0x48b0('0x35')],'type':_0x28c3b1[_0x48b0('0x36')][_0x48b0('0x37')]};});_0x380080[_0x48b0('0x38')]=_[_0x48b0('0x33')](_0x3d3dd3,'name');_0x380080['query']=_['keys'](_0x288712[_0x48b0('0x39')]);_0x380080[_0x48b0('0x3a')]=_[_0x48b0('0x3b')](_0x380080[_0x48b0('0x38')],_0x380080['query']);_0x2310d5[_0x48b0('0x3c')]=_[_0x48b0('0x3b')](_0x380080[_0x48b0('0x38')],qs['fields'](_0x288712[_0x48b0('0x39')][_0x48b0('0x3d')]));_0x2310d5[_0x48b0('0x3c')]=_0x2310d5[_0x48b0('0x3c')]['length']?_0x2310d5['attributes']:_0x380080['model'];if(!_0x288712['query']['hasOwnProperty']('nolimit')){_0x2310d5[_0x48b0('0x2d')]=qs[_0x48b0('0x2d')](_0x288712[_0x48b0('0x39')][_0x48b0('0x2d')]);_0x2310d5['offset']=qs[_0x48b0('0x2c')](_0x288712['query'][_0x48b0('0x2c')]);}_0x2310d5['order']=qs[_0x48b0('0x3e')](_0x288712[_0x48b0('0x39')][_0x48b0('0x3e')]);_0x2310d5['where']=qs['filters'](_[_0x48b0('0x3f')](_0x288712[_0x48b0('0x39')],_0x380080[_0x48b0('0x3a')]),_0x3d3dd3);if(_0x288712['query']['filter']){_0x2310d5[_0x48b0('0x40')]=_['merge'](_0x2310d5[_0x48b0('0x40')],{'$or':_['map'](_0x3d3dd3,function(_0x32b532){if(_0x32b532[_0x48b0('0x36')]!==_0x48b0('0x41')){var _0x4d22f8={};_0x4d22f8[_0x32b532[_0x48b0('0x30')]]={'$like':'%'+_0x288712[_0x48b0('0x39')][_0x48b0('0x42')]+'%'};return _0x4d22f8;}})});}_0x2310d5=_['merge']({},_0x2310d5,_0x288712[_0x48b0('0x43')]);var _0x3bae9f={'where':_0x2310d5[_0x48b0('0x40')]};return db[_0x48b0('0x44')][_0x48b0('0x45')](_0x3bae9f)[_0x48b0('0x1e')](function(_0x121f8d){_0x5d932e[_0x48b0('0x45')]=_0x121f8d;if(_0x288712['query'][_0x48b0('0x46')]){_0x2310d5[_0x48b0('0x47')]=[{'all':!![]}];}return db[_0x48b0('0x44')][_0x48b0('0x48')](_0x2310d5);})['then'](function(_0x42041a){_0x5d932e[_0x48b0('0x49')]=_0x42041a;return _0x5d932e;})[_0x48b0('0x1e')](respondWithFilteredResult(_0x46f4ff,_0x2310d5))[_0x48b0('0x27')](handleError(_0x46f4ff,null));};exports[_0x48b0('0x4a')]=function(_0x1952b2,_0x41cc12){var _0x163f5e={'raw':!![],'where':{'id':_0x1952b2[_0x48b0('0x4b')]['id']}},_0x4a255c={};_0x4a255c[_0x48b0('0x38')]=_[_0x48b0('0x4c')](db[_0x48b0('0x44')]['rawAttributes']);_0x4a255c['query']=_[_0x48b0('0x4c')](_0x1952b2[_0x48b0('0x39')]);_0x4a255c[_0x48b0('0x3a')]=_[_0x48b0('0x3b')](_0x4a255c['model'],_0x4a255c[_0x48b0('0x39')]);_0x163f5e['attributes']=_['intersection'](_0x4a255c['model'],qs['fields'](_0x1952b2[_0x48b0('0x39')]['fields']));_0x163f5e[_0x48b0('0x3c')]=_0x163f5e['attributes'][_0x48b0('0x4d')]?_0x163f5e['attributes']:_0x4a255c[_0x48b0('0x38')];if(_0x1952b2[_0x48b0('0x39')][_0x48b0('0x46')]){_0x163f5e[_0x48b0('0x47')]=[{'all':!![]}];}_0x163f5e=_[_0x48b0('0x4e')]({},_0x163f5e,_0x1952b2[_0x48b0('0x43')]);return db[_0x48b0('0x44')][_0x48b0('0x4f')](_0x163f5e)[_0x48b0('0x1e')](handleEntityNotFound(_0x41cc12,null))[_0x48b0('0x1e')](respondWithResult(_0x41cc12,null))[_0x48b0('0x27')](handleError(_0x41cc12,null));};exports[_0x48b0('0x50')]=function(_0x51b434,_0x5b637b,_0x429f00){var _0x3fc439;return db[_0x48b0('0x51')][_0x48b0('0x52')](function(_0xf81273){return db[_0x48b0('0x44')][_0x48b0('0x50')](_0x51b434[_0x48b0('0x53')],{'raw':!![]})['then'](function(_0x178ef7){_0x3fc439=_0x178ef7;return db[_0x48b0('0x44')][_0x48b0('0x48')]({'where':{'type':_0x51b434['body'][_0x48b0('0x36')]},'raw':!![]});})[_0x48b0('0x1e')](function(_0x13e1f9){if(_0x3fc439[_0x48b0('0x36')]['toUpperCase']()==_0x48b0('0x54')){var _0x13ce14=fs[_0x48b0('0x55')](path[_0x48b0('0x56')](config[_0x48b0('0x57')],_0x48b0('0x58')),'utf8');var _0x2e63c1=ejs[_0x48b0('0x59')](_0x13ce14,{'networks':_0x13e1f9||[]});fs['writeFileSync'](_0x48b0('0x5a'),_0x2e63c1);return respondWithRpcPromise(_0x48b0('0x5b'),_0x48b0('0x50'),{'module':_0x48b0('0x5c')});}else if(_0x3fc439[_0x48b0('0x36')][_0x48b0('0x5d')]()==_0x48b0('0x5e')){var _0x281d01=fs[_0x48b0('0x55')](path[_0x48b0('0x56')](config['root'],_0x48b0('0x5f')),_0x48b0('0x60'));var _0x5507c5=ejs[_0x48b0('0x59')](_0x281d01,{'networks':_0x13e1f9||[]});fs[_0x48b0('0x61')](_0x48b0('0x62'),_0x5507c5);return respondWithRpcPromise(_0x48b0('0x5b'),'create',{'module':_0x48b0('0x5c')});}else{var _0x20739b=fs[_0x48b0('0x55')](path[_0x48b0('0x56')](config['root'],_0x48b0('0x63')),'utf8');var _0x2c6858=ejs[_0x48b0('0x59')](_0x20739b,{'networks':_0x13e1f9||[]});fs[_0x48b0('0x61')](util[_0x48b0('0x64')]('/etc/asterisk/sip_xcally_%s.conf',_0x51b434['body']['type'][_0x48b0('0x65')]()),_0x2c6858);return respondWithRpcPromise('Reload',_0x48b0('0x50'),{'module':_0x48b0('0x66')});}return null;})['then'](function(){return _0x3fc439;});})[_0x48b0('0x1e')](respondWithResult(_0x5b637b,0xc9))[_0x48b0('0x27')](handleError(_0x5b637b,null));};exports[_0x48b0('0x67')]=function(_0x3cb221,_0x17eb8a,_0x152412){var _0x1c85b7;return db[_0x48b0('0x51')][_0x48b0('0x52')](function(_0x1492a3){return db['Network'][_0x48b0('0x4f')]({'where':{'id':_0x3cb221['params']['id']}})[_0x48b0('0x1e')](handleEntityNotFound(_0x17eb8a,null))[_0x48b0('0x1e')](saveUpdates(_0x3cb221['body'],null))['then'](function(_0x1431a5){if(_0x1431a5){_0x1c85b7=_0x1431a5;return db['Network'][_0x48b0('0x48')]({'where':{'type':_0x1c85b7[_0x48b0('0x36')]},'raw':!![]});}return null;})['then'](function(_0x1b76ad){if(_0x1c85b7[_0x48b0('0x36')]['toUpperCase']()==_0x48b0('0x54')){var _0x3dd8b9=fs[_0x48b0('0x55')](path[_0x48b0('0x56')](config[_0x48b0('0x57')],_0x48b0('0x58')),_0x48b0('0x60'));var _0x45acec=ejs[_0x48b0('0x59')](_0x3dd8b9,{'networks':_0x1b76ad||[]});fs[_0x48b0('0x61')]('/etc/asterisk/stun_xcally.conf',_0x45acec);return respondWithRpcPromise('Reload',_0x48b0('0x67'),{'module':_0x48b0('0x5c')});}else if(_0x1c85b7[_0x48b0('0x36')][_0x48b0('0x5d')]()==_0x48b0('0x5e')){var _0x3b9557=fs[_0x48b0('0x55')](path[_0x48b0('0x56')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x48b0('0x60'));var _0x329aab=ejs[_0x48b0('0x59')](_0x3b9557,{'networks':_0x1b76ad||[]});fs[_0x48b0('0x61')]('/etc/asterisk/turn_xcally.conf',_0x329aab);return respondWithRpcPromise(_0x48b0('0x5b'),'update',{'module':_0x48b0('0x5c')});}else{var _0x2de122=fs[_0x48b0('0x55')](path[_0x48b0('0x56')](config[_0x48b0('0x57')],_0x48b0('0x63')),_0x48b0('0x60'));var _0x329f4d=ejs['render'](_0x2de122,{'networks':_0x1b76ad||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x3cb221[_0x48b0('0x53')][_0x48b0('0x36')][_0x48b0('0x65')]()),_0x329f4d);return respondWithRpcPromise('Reload','update',{'module':_0x48b0('0x66')});}return null;})[_0x48b0('0x1e')](function(_0x322cb2){if(_0x322cb2){return _0x1c85b7;}return null;});})[_0x48b0('0x1e')](respondWithResult(_0x17eb8a,null))[_0x48b0('0x27')](handleError(_0x17eb8a,null));};exports[_0x48b0('0x68')]=function(_0x3631af,_0x442b60,_0x4a903d){var _0x1fa1d8;return db['Network'][_0x48b0('0x4f')]({'where':{'id':_0x3631af[_0x48b0('0x4b')]['id']}})[_0x48b0('0x1e')](function(_0x4e2c6a){_0x1fa1d8=_0x4e2c6a;return _0x4e2c6a;})[_0x48b0('0x1e')](handleEntityNotFound(_0x442b60,null))[_0x48b0('0x1e')](removeEntity(_0x442b60,null))[_0x48b0('0x1e')](function(){if(_0x1fa1d8){return db[_0x48b0('0x44')]['findAll']({'where':{'type':_0x1fa1d8['type']},'raw':!![]});}})['then'](function(_0x1e63a0){if(_0x1fa1d8['type'][_0x48b0('0x5d')]()==_0x48b0('0x54')){var _0x15d950=fs[_0x48b0('0x55')](path[_0x48b0('0x56')](config['root'],_0x48b0('0x58')),_0x48b0('0x60'));var _0x2c1645=ejs[_0x48b0('0x59')](_0x15d950,{'networks':_0x1e63a0||[]});fs[_0x48b0('0x61')]('/etc/asterisk/stun_xcally.conf',_0x2c1645);return respondWithRpcPromise(_0x48b0('0x5b'),'destroy',{'module':_0x48b0('0x5c')});}else if(_0x1fa1d8[_0x48b0('0x36')][_0x48b0('0x5d')]()==_0x48b0('0x5e')){var _0x55d04f=fs[_0x48b0('0x55')](path[_0x48b0('0x56')](config['root'],_0x48b0('0x5f')),_0x48b0('0x60'));var _0x5e2fb5=ejs[_0x48b0('0x59')](_0x55d04f,{'networks':_0x1e63a0||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x5e2fb5);return respondWithRpcPromise(_0x48b0('0x5b'),_0x48b0('0x68'),{'module':_0x48b0('0x5c')});}else{var _0x462126=fs[_0x48b0('0x55')](path[_0x48b0('0x56')](config[_0x48b0('0x57')],_0x48b0('0x63')),_0x48b0('0x60'));var _0x295a3d=ejs[_0x48b0('0x59')](_0x462126,{'networks':_0x1e63a0||[]});fs[_0x48b0('0x61')](util[_0x48b0('0x64')](_0x48b0('0x69'),_0x3631af[_0x48b0('0x53')][_0x48b0('0x36')][_0x48b0('0x65')]()),_0x295a3d);return respondWithRpcPromise('Reload','destroy',{'module':_0x48b0('0x66')});}return null;})['catch'](handleError(_0x442b60,null));};
\ No newline at end of file
diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js
index 3e4b3ec..4413034 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 _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
+var _0xd3d1=['../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x588fd3,_0x40b0ac){var _0x396015=function(_0x25e5d1){while(--_0x25e5d1){_0x588fd3['push'](_0x588fd3['shift']());}};_0x396015(++_0x40b0ac);}(_0xd3d1,0x172));var _0x1d3d=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xd3d1[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1d3d('0x2'));var BPromise=require(_0x1d3d('0x3'));var rp=require(_0x1d3d('0x4'));var fs=require('fs');var path=require(_0x1d3d('0x5'));var rimraf=require(_0x1d3d('0x6'));var config=require(_0x1d3d('0x7'));var attributes=require(_0x1d3d('0x8'));module[_0x1d3d('0x9')]=function(_0x1cbe06,_0x449475){return _0x1cbe06[_0x1d3d('0xa')](_0x1d3d('0xb'),attributes,{'tableName':_0x1d3d('0xc'),'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 dca430a..04e6cbd 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 _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
+var _0x5ec4=['result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x5ec4,0x145));var _0x45ec=function(_0xf6459e,_0x46ce62){_0xf6459e=_0xf6459e-0x0;var _0x5d4dc2=_0x5ec4[_0xf6459e];return _0x5d4dc2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x45ec('0x0'));var rs=require(_0x45ec('0x1'));var fs=require('fs');var Redis=require(_0x45ec('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x45ec('0x3'));var logger=require(_0x45ec('0x4'))(_0x45ec('0x5'));var config=require(_0x45ec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x45ec('0x7')][_0x45ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x230aae,_0x3bfcc4,_0x125e9f){return new BPromise(function(_0x274b39,_0x1a70e9){return client['request'](_0x230aae,_0x125e9f)[_0x45ec('0x9')](function(_0x5606af){logger['info'](_0x45ec('0xa'),_0x3bfcc4,_0x45ec('0xb'));logger[_0x45ec('0xc')]('Network,\x20%s,\x20%s,\x20%s',_0x3bfcc4,_0x45ec('0xb'),JSON[_0x45ec('0xd')](_0x5606af));if(_0x5606af['error']){if(_0x5606af[_0x45ec('0xe')][_0x45ec('0xf')]===0x1f4){logger[_0x45ec('0xe')](_0x45ec('0xa'),_0x3bfcc4,_0x5606af[_0x45ec('0xe')][_0x45ec('0x10')]);return _0x1a70e9(_0x5606af[_0x45ec('0xe')][_0x45ec('0x10')]);}logger['error'](_0x45ec('0xa'),_0x3bfcc4,_0x5606af[_0x45ec('0xe')][_0x45ec('0x10')]);return _0x274b39(_0x5606af[_0x45ec('0xe')][_0x45ec('0x10')]);}else{logger['info'](_0x45ec('0xa'),_0x3bfcc4,_0x45ec('0xb'));_0x274b39(_0x5606af[_0x45ec('0x11')][_0x45ec('0x10')]);}})[_0x45ec('0x12')](function(_0x923bc1){logger['error'](_0x45ec('0xa'),_0x3bfcc4,_0x923bc1);_0x1a70e9(_0x923bc1);});});}
\ No newline at end of file
diff --git a/server/api/notification/index.js b/server/api/notification/index.js
index b4e608b..dec1fcc 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 _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
+var _0xcc5a=['isAuthenticated','sendNotification','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./notification.controller','post'];(function(_0x13490b,_0x2232ab){var _0x25d1b0=function(_0x59c3ae){while(--_0x59c3ae){_0x13490b['push'](_0x13490b['shift']());}};_0x25d1b0(++_0x2232ab);}(_0xcc5a,0x107));var _0xacc5=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0xcc5a[_0x1daaa9];return _0x1dd221;};'use strict';var multer=require(_0xacc5('0x0'));var util=require(_0xacc5('0x1'));var path=require(_0xacc5('0x2'));var timeout=require(_0xacc5('0x3'));var express=require(_0xacc5('0x4'));var router=express[_0xacc5('0x5')]();var auth=require(_0xacc5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xacc5('0x7'));var controller=require(_0xacc5('0x8'));router[_0xacc5('0x9')]('/',auth[_0xacc5('0xa')](),controller[_0xacc5('0xb')]);module[_0xacc5('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/notification/notification.attributes.js b/server/api/notification/notification.attributes.js
index 62f90f0..fdd63d7 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 _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
+var _0xe822=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xe822,0x75));var _0x2e82=function(_0x1ff38f,_0x77afc8){_0x1ff38f=_0x1ff38f-0x0;var _0x5c394a=_0xe822[_0x1ff38f];return _0x5c394a;};'use strict';var Sequelize=require(_0x2e82('0x0'));module[_0x2e82('0x1')]={'body':{'type':Sequelize[_0x2e82('0x2')]},'senderName':{'type':Sequelize[_0x2e82('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x2e82('0x3')]},'beep':{'type':Sequelize[_0x2e82('0x4')]}};
\ No newline at end of file
diff --git a/server/api/notification/notification.controller.js b/server/api/notification/notification.controller.js
index ab9d5c6..fd48c7f 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 _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
+var _0x9ae9=['apply','save','then','destroy','error','stack','name','send','sendNotification','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','team','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','sequelize','transaction','Notification','create','forEach','emit','notification:send','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','User','ids','queue','replace','Queue','push','all','union','flatten','catch','getAgents','map','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','./notification.socket','register','sendStatus','end','json','count','offset','limit','status','set','Content-Range'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x9ae9,0x1d3));var _0x99ae=function(_0x5467f1,_0x4ca013){_0x5467f1=_0x5467f1-0x0;var _0x1c1041=_0x9ae9[_0x5467f1];return _0x1c1041;};'use strict';var pdf=require(_0x99ae('0x0'));var emlformat=require(_0x99ae('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x99ae('0x2'));var jsonpatch=require(_0x99ae('0x3'));var rp=require('request-promise');var moment=require(_0x99ae('0x4'));var BPromise=require(_0x99ae('0x5'));var Mustache=require(_0x99ae('0x6'));var util=require(_0x99ae('0x7'));var path=require(_0x99ae('0x8'));var sox=require(_0x99ae('0x9'));var csv=require('to-csv');var ejs=require(_0x99ae('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x99ae('0xb'));var crypto=require(_0x99ae('0xc'));var jsforce=require(_0x99ae('0xd'));var deskjs=require(_0x99ae('0xe'));var toCsv=require(_0x99ae('0xf'));var querystring=require('querystring');var Papa=require(_0x99ae('0x10'));var Redis=require(_0x99ae('0x11'));var authService=require(_0x99ae('0x12'));var qs=require(_0x99ae('0x13'));var as=require(_0x99ae('0x14'));var hardwareService=require(_0x99ae('0x15'));var logger=require(_0x99ae('0x16'))(_0x99ae('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x99ae('0x18'))['db'];config[_0x99ae('0x19')]=_[_0x99ae('0x1a')](config[_0x99ae('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x99ae('0x19')]));require(_0x99ae('0x1b'))[_0x99ae('0x1c')](socket);function respondWithStatusCode(_0x36dd50,_0x287b0d){_0x287b0d=_0x287b0d||0xcc;return function(_0x2c06ee){if(_0x2c06ee){return _0x36dd50[_0x99ae('0x1d')](_0x287b0d);}return _0x36dd50['status'](_0x287b0d)[_0x99ae('0x1e')]();};}function respondWithResult(_0x18e866,_0x444386){_0x444386=_0x444386||0xc8;return function(_0x4c1e12){if(_0x4c1e12){return _0x18e866['status'](_0x444386)[_0x99ae('0x1f')](_0x4c1e12);}};}function respondWithFilteredResult(_0x912862,_0x1ba016){return function(_0x12e5a7){if(_0x12e5a7){var _0x3020bd=_0x12e5a7[_0x99ae('0x20')],_0x4e67f1=_0x1ba016[_0x99ae('0x21')],_0x171f62=_0x1ba016['offset']+_0x1ba016[_0x99ae('0x22')],_0x2c45d6;if(_0x171f62>=_0x3020bd){_0x171f62=_0x3020bd;_0x2c45d6=0xc8;}else{_0x2c45d6=0xce;}_0x912862[_0x99ae('0x23')](_0x2c45d6);return _0x912862[_0x99ae('0x24')](_0x99ae('0x25'),_0x4e67f1+'-'+_0x171f62+'/'+_0x3020bd)[_0x99ae('0x1f')](_0x12e5a7);}return null;};}function patchUpdates(_0x255e78){return function(_0x7ec516){try{jsonpatch[_0x99ae('0x26')](_0x7ec516,_0x255e78,!![]);}catch(_0x882187){return BPromise['reject'](_0x882187);}return _0x7ec516[_0x99ae('0x27')]();};}function saveUpdates(_0x1a27e5,_0x1b43e6){return function(_0x1f57c3){if(_0x1f57c3){return _0x1f57c3['update'](_0x1a27e5)[_0x99ae('0x28')](function(_0x13087b){return _0x13087b;});}return null;};}function removeEntity(_0x230d23,_0x5101b3){return function(_0x4d6bf3){if(_0x4d6bf3){return _0x4d6bf3[_0x99ae('0x29')]()[_0x99ae('0x28')](function(){_0x230d23[_0x99ae('0x23')](0xcc)[_0x99ae('0x1e')]();});}};}function handleEntityNotFound(_0x5a6b52,_0xbd4d11){return function(_0x1dfcd3){if(!_0x1dfcd3){_0x5a6b52[_0x99ae('0x1d')](0x194);}return _0x1dfcd3;};}function handleError(_0x4c82d0,_0x3f844f){_0x3f844f=_0x3f844f||0x1f4;return function(_0x1407cf){logger[_0x99ae('0x2a')](_0x1407cf[_0x99ae('0x2b')]);if(_0x1407cf[_0x99ae('0x2c')]){delete _0x1407cf[_0x99ae('0x2c')];}_0x4c82d0[_0x99ae('0x23')](_0x3f844f)[_0x99ae('0x2d')](_0x1407cf);};}exports[_0x99ae('0x2e')]=function(_0xe5592a,_0x4c2f0f,_0xd89600){if(!_0xe5592a[_0x99ae('0x2f')][_0x99ae('0x30')](_0x99ae('0x31'))&&!_0xe5592a[_0x99ae('0x2f')][_0x99ae('0x30')]('TemplateId')){throw new db[(_0x99ae('0x32'))][(_0x99ae('0x33'))](_0x99ae('0x34'));}else{if(_0xe5592a['body'][_0x99ae('0x30')](_0x99ae('0x35'))&&!_0xe5592a[_0x99ae('0x2f')][_0x99ae('0x30')]('view')){throw new db[(_0x99ae('0x32'))][(_0x99ae('0x33'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0xe5592a[_0x99ae('0x2f')][_0x99ae('0x30')](_0x99ae('0x36'))){throw new db['Sequelize'][(_0x99ae('0x33'))](_0x99ae('0x37'));}else{try{var _0x43aeef=JSON[_0x99ae('0x38')](_0xe5592a['body'][_0x99ae('0x36')]);}catch(_0xfee509){logger[_0x99ae('0x2a')](_0xfee509);throw new db[(_0x99ae('0x32'))][(_0x99ae('0x33'))](_0x99ae('0x39'));}var _0x9a67ba=[_0x99ae('0x3a'),_0x99ae('0x3b'),_0x99ae('0x3c'),_0x99ae('0x3d'),_0x99ae('0x3e'),'voicequeue','whatsappqueue',_0x99ae('0x3f'),_0x99ae('0x40')];if(_[_0x99ae('0x41')](_0x43aeef,function(_0x581b4f){return!_[_0x99ae('0x42')](_0x9a67ba,_0x581b4f['model'][_0x99ae('0x43')]());})){throw new db['Sequelize'][(_0x99ae('0x33'))](_0x99ae('0x44'));}}}var _0x201389={};_0x201389[_0x99ae('0x45')]=_0xe5592a[_0x99ae('0x2f')][_0x99ae('0x30')](_0x99ae('0x45'))?_0xe5592a[_0x99ae('0x2f')][_0x99ae('0x45')]:_0xe5592a[_0x99ae('0x40')][_0x99ae('0x46')];_0x201389[_0x99ae('0x47')]=_['isEmpty'](_0xe5592a[_0x99ae('0x2f')][_0x99ae('0x47')])?null:_0xe5592a[_0x99ae('0x2f')][_0x99ae('0x47')];_0x201389[_0x99ae('0x48')]=_0xe5592a['body'][_0x99ae('0x48')]||![];_0x201389[_0x99ae('0x49')]=_0xe5592a[_0x99ae('0x40')]['id'];return getContent(_0xe5592a[_0x99ae('0x2f')])[_0x99ae('0x28')](function(_0xfd5779){_0x201389[_0x99ae('0x2f')]=_0xfd5779;return getRecipients(_0x43aeef);})[_0x99ae('0x28')](function(_0x2b8942){_0x201389[_0x99ae('0x4a')]=_[_0x99ae('0x4b')](_0x2b8942)['join'](',');return db[_0x99ae('0x4c')][_0x99ae('0x4d')](function(_0xc3a12d){return db[_0x99ae('0x4e')][_0x99ae('0x4f')](_0x201389,{'raw':!![],'transaction':_0xc3a12d})[_0x99ae('0x28')](function(_0x106736){var _0x476714={'sender':_0x201389[_0x99ae('0x45')],'description':_0x201389[_0x99ae('0x47')],'content':_0x201389[_0x99ae('0x2f')],'beep':_0x201389['beep']};_0x2b8942[_0x99ae('0x50')](function(_0x5f0a5b){_0x476714['recipient']=_0x5f0a5b;socket[_0x99ae('0x51')](_0x99ae('0x52'),_0x476714);});return _0x106736;});});})[_0x99ae('0x28')](respondWithResult(_0x4c2f0f,0xc9))['catch'](handleError(_0x4c2f0f,null));};function getContent(_0x502aac){return new BPromise(function(_0x6c63de,_0x5f017f){if(_0x502aac[_0x99ae('0x31')]){_0x6c63de(_0x502aac[_0x99ae('0x31')]);return;}return db[_0x99ae('0x53')][_0x99ae('0x54')]({'attributes':['html'],'where':{'id':_0x502aac[_0x99ae('0x35')]},'raw':!![]})[_0x99ae('0x28')](function(_0x123ee5){if(!_0x123ee5)throw new db['Sequelize'][(_0x99ae('0x33'))](_0x99ae('0x55'));var _0x56b7bc=Mustache[_0x99ae('0x56')](_0x123ee5[_0x99ae('0x57')],_0x502aac['view']);_0x6c63de(_0x56b7bc);})['catch'](function(_0x34eb69){_0x5f017f(_0x34eb69);});});}function getRecipients(_0x58964a){return new BPromise(function(_0x1d5639,_0x3c16ed){var _0xaa8617=[];var _0x42644e=[];_0x58964a['forEach'](function(_0x38fe49){var _0x1d0f66=_[_0x99ae('0x58')](_0x38fe49['model'][_0x99ae('0x43')]());if(_0x1d0f66===_0x99ae('0x59')){_0xaa8617=_['union'](_0xaa8617,_0x38fe49[_0x99ae('0x5a')]);}else{if(_[_0x99ae('0x42')](_0x1d0f66,_0x99ae('0x5b')))_0x1d0f66=_0x1d0f66[_0x99ae('0x5c')]('queue',_0x99ae('0x5d'));_0x38fe49[_0x99ae('0x5a')][_0x99ae('0x50')](function(_0x38e501){_0x42644e[_0x99ae('0x5e')](getAgents(_0x1d0f66,_0x38e501));});}});return BPromise[_0x99ae('0x5f')](_0x42644e)[_0x99ae('0x28')](function(_0x1420e5){_0xaa8617=_[_0x99ae('0x60')](_0xaa8617,_[_0x99ae('0x61')](_0x1420e5));_0x1d5639(_0xaa8617);})[_0x99ae('0x62')](function(_0x423a8b){_0x3c16ed(_0x423a8b);});});}function getAgents(_0x58bffa,_0x1009b){return new BPromise(function(_0x166206,_0x1f7193){return db[_0x58bffa][_0x99ae('0x54')]({'where':{'id':_0x1009b}})[_0x99ae('0x28')](function(_0xc73727){return _0xc73727[_0x99ae('0x63')]({'attributes':['id'],'raw':!![]})[_0x99ae('0x28')](function(_0x35930d){var _0x340bca=_[_0x99ae('0x64')](_0x35930d,'id');_0x166206(_0x340bca);});})[_0x99ae('0x62')](function(_0x37c3a0){_0x1f7193(_0x37c3a0);});});}
\ No newline at end of file
diff --git a/server/api/notification/notification.events.js b/server/api/notification/notification.events.js
index 205b03a..eea5067 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 _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
+var _0xb10b=['hasOwnProperty','hook','events','Notification','setMaxListeners','save','remove','emit'];(function(_0x4b3946,_0x1d529f){var _0x24ba53=function(_0x18d3d8){while(--_0x18d3d8){_0x4b3946['push'](_0x4b3946['shift']());}};_0x24ba53(++_0x1d529f);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ff332,_0x145564){_0x3ff332=_0x3ff332-0x0;var _0x5a2264=_0xb10b[_0x3ff332];return _0x5a2264;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var Notification=require('../../mysqldb')['db'][_0xbb10('0x1')];var NotificationEvents=new EventEmitter();NotificationEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){NotificationEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);NotificationEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];Notification[_0xbb10('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 22f3b28..aa997f5 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 _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
+var _0xd7d1=['path','rimraf','../../config/environment','./notification.attributes','exports','define','Notification','notifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xc43a0c,_0x4266a0){var _0x57e423=function(_0x61cf3d){while(--_0x61cf3d){_0xc43a0c['push'](_0xc43a0c['shift']());}};_0x57e423(++_0x4266a0);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x142a57,_0x1e7462){_0x142a57=_0x142a57-0x0;var _0x1b718e=_0xd7d1[_0x142a57];return _0x1b718e;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var fs=require('fs');var path=require(_0x1d7d('0x7'));var rimraf=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var attributes=require(_0x1d7d('0xa'));module[_0x1d7d('0xb')]=function(_0x14b2b9,_0x5a8cf3){return _0x14b2b9[_0x1d7d('0xc')](_0x1d7d('0xd'),attributes,{'tableName':_0x1d7d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1d7d('0xf'),'collate':_0x1d7d('0x10')});};
\ No newline at end of file
diff --git a/server/api/notification/notification.rpc.js b/server/api/notification/notification.rpc.js
index f6934b7..b89c5dc 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 _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
+var _0x55ab=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./notification.socket','register','request','then','info','Notification,\x20%s,\x20%s','request\x20sent','debug','Notification,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x55ab,0xd6));var _0xb55a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x55ab[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0xb55a('0x0'));var moment=require(_0xb55a('0x1'));var BPromise=require(_0xb55a('0x2'));var rs=require(_0xb55a('0x3'));var fs=require('fs');var Redis=require(_0xb55a('0x4'));var db=require(_0xb55a('0x5'))['db'];var utils=require(_0xb55a('0x6'));var logger=require(_0xb55a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb55a('0x8')][_0xb55a('0x9')]({'port':0x232a});config[_0xb55a('0xa')]=_[_0xb55a('0xb')](config[_0xb55a('0xa')],{'host':_0xb55a('0xc'),'port':0x18eb});var socket=require(_0xb55a('0xd'))(new Redis(config[_0xb55a('0xa')]));require(_0xb55a('0xe'))[_0xb55a('0xf')](socket);function respondWithRpcPromise(_0x53649f,_0x3caffd,_0x536bdf){return new BPromise(function(_0x3a7b4f,_0x1f1289){return client[_0xb55a('0x10')](_0x53649f,_0x536bdf)[_0xb55a('0x11')](function(_0x418466){logger[_0xb55a('0x12')](_0xb55a('0x13'),_0x3caffd,_0xb55a('0x14'));logger[_0xb55a('0x15')](_0xb55a('0x16'),_0x3caffd,'request\x20sent',JSON['stringify'](_0x418466));if(_0x418466[_0xb55a('0x17')]){if(_0x418466[_0xb55a('0x17')]['code']===0x1f4){logger[_0xb55a('0x17')](_0xb55a('0x13'),_0x3caffd,_0x418466[_0xb55a('0x17')]['message']);return _0x1f1289(_0x418466['error'][_0xb55a('0x18')]);}logger[_0xb55a('0x17')]('Notification,\x20%s,\x20%s',_0x3caffd,_0x418466[_0xb55a('0x17')]['message']);return _0x3a7b4f(_0x418466['error'][_0xb55a('0x18')]);}else{logger['info'](_0xb55a('0x13'),_0x3caffd,_0xb55a('0x14'));_0x3a7b4f(_0x418466[_0xb55a('0x19')][_0xb55a('0x18')]);}})[_0xb55a('0x1a')](function(_0x44fda6){logger[_0xb55a('0x17')](_0xb55a('0x13'),_0x3caffd,_0x44fda6);_0x1f1289(_0x44fda6);});});}
\ No newline at end of file
diff --git a/server/api/notification/notification.socket.js b/server/api/notification/notification.socket.js
index 0806bca..2a9fa8c 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 _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
+var _0xe1a2=['removeListener','register','notification:','./notification.events','save','remove','update'];(function(_0x2502dc,_0x1b2a43){var _0x5d6ae6=function(_0x2de1de){while(--_0x2de1de){_0x2502dc['push'](_0x2502dc['shift']());}};_0x5d6ae6(++_0x1b2a43);}(_0xe1a2,0x1df));var _0x2e1a=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0xe1a2[_0x1347f8];return _0x218368;};'use strict';var NotificationEvents=require(_0x2e1a('0x0'));var events=[_0x2e1a('0x1'),_0x2e1a('0x2'),_0x2e1a('0x3')];function createListener(_0x5947f7,_0x2067c2){return function(_0x13b7df){_0x2067c2['emit'](_0x5947f7,_0x13b7df);};}function removeListener(_0x3ffd6e,_0x42f936){return function(){NotificationEvents[_0x2e1a('0x4')](_0x3ffd6e,_0x42f936);};}exports[_0x2e1a('0x5')]=function(_0x1d6f62){for(var _0x1d0d98=0x0,_0x130317=events['length'];_0x1d0d98<_0x130317;_0x1d0d98++){var _0x1d63f7=events[_0x1d0d98];var _0x5aa90c=createListener(_0x2e1a('0x6')+_0x1d63f7,_0x1d6f62);NotificationEvents['on'](_0x1d63f7,_0x5aa90c);}};
\ No newline at end of file
diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js
index 1013483..37f380c 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 _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
+var _0x144a=['destroy','removeAgents','util','path','express','Router','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getInteractions','/:id/users','post','create','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','delete'];(function(_0x56a8b8,_0x344ea3){var _0x353df1=function(_0x37ef6a){while(--_0x37ef6a){_0x56a8b8['push'](_0x56a8b8['shift']());}};_0x353df1(++_0x344ea3);}(_0x144a,0xc8));var _0xa144=function(_0x2db606,_0x31542e){_0x2db606=_0x2db606-0x0;var _0x181514=_0x144a[_0x2db606];return _0x181514;};'use strict';var multer=require('multer');var util=require(_0xa144('0x0'));var path=require(_0xa144('0x1'));var timeout=require('connect-timeout');var express=require(_0xa144('0x2'));var router=express[_0xa144('0x3')]();var auth=require(_0xa144('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa144('0x5'));var controller=require(_0xa144('0x6'));router[_0xa144('0x7')]('/',auth[_0xa144('0x8')](),controller[_0xa144('0x9')]);router['get'](_0xa144('0xa'),auth[_0xa144('0x8')](),controller[_0xa144('0xb')]);router['get'](_0xa144('0xc'),auth[_0xa144('0x8')](),controller[_0xa144('0xd')]);router['get'](_0xa144('0xe'),auth[_0xa144('0x8')](),controller[_0xa144('0xf')]);router[_0xa144('0x7')](_0xa144('0x10'),auth[_0xa144('0x8')](),controller['getAnswers']);router[_0xa144('0x7')](_0xa144('0x11'),auth['isAuthenticated'](),controller['getApplications']);router[_0xa144('0x7')]('/:id/interactions',auth[_0xa144('0x8')](),controller[_0xa144('0x12')]);router[_0xa144('0x7')](_0xa144('0x13'),auth[_0xa144('0x8')](),controller['getAgents']);router[_0xa144('0x14')]('/',auth[_0xa144('0x8')](),controller[_0xa144('0x15')]);router[_0xa144('0x14')](_0xa144('0xe'),auth[_0xa144('0x8')](),controller['addDisposition']);router[_0xa144('0x14')](_0xa144('0x10'),auth[_0xa144('0x8')](),controller['addAnswer']);router[_0xa144('0x14')](_0xa144('0x16'),controller[_0xa144('0x17')]);router['post'](_0xa144('0x11'),auth[_0xa144('0x8')](),controller[_0xa144('0x18')]);router[_0xa144('0x14')](_0xa144('0x13'),auth['isAuthenticated'](),controller[_0xa144('0x19')]);router['post'](_0xa144('0x1a'),auth[_0xa144('0x8')](),controller[_0xa144('0x1b')]);router[_0xa144('0x1c')](_0xa144('0xc'),auth['isAuthenticated'](),controller[_0xa144('0x1d')]);router[_0xa144('0x1e')](_0xa144('0xc'),auth['isAuthenticated'](),controller[_0xa144('0x1f')]);router[_0xa144('0x1e')]('/:id/dispositions',auth[_0xa144('0x8')](),controller['removeDispositions']);router[_0xa144('0x1e')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0xa144('0x1e')](_0xa144('0x13'),auth['isAuthenticated'](),controller[_0xa144('0x20')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js
index c6fa889..6a78649 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 _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
+var _0x0ffc=['STRING','name','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports'];(function(_0x3b334f,_0x5d0405){var _0x5013a8=function(_0x3862c2){while(--_0x3862c2){_0x3b334f['push'](_0x3b334f['shift']());}};_0x5013a8(++_0x5d0405);}(_0x0ffc,0x1ec));var _0xc0ff=function(_0x398417,_0x1f1218){_0x398417=_0x398417-0x0;var _0x1a20b4=_0x0ffc[_0x398417];return _0x1a20b4;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc0ff('0x0'));module[_0xc0ff('0x1')]={'name':{'type':Sequelize[_0xc0ff('0x2')],'unique':_0xc0ff('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xc0ff('0x2')],'defaultValue':function(){return rs[_0xc0ff('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc0ff('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc0ff('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc0ff('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc0ff('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xc0ff('0x2')]},'queueTransfer':{'type':Sequelize[_0xc0ff('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc0ff('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc0ff('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc0ff('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc0ff('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xc0ff('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc0ff('0x9'),'set':function(_0x552094){if(!_0x552094)this[_0xc0ff('0xa')](_0xc0ff('0xb'),null);this[_0xc0ff('0xa')](_0xc0ff('0xc'),_0x552094);}}};
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js
index 4be8a34..de13c87 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 _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
+var _0x29dd=['find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','OpnechannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','order','OpenchannelAccountId','removeDispositions','addAnswer','CannedAnswer','removeAnswers','notify','openchannel','CmContact','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','from','List','Contacts','updatedAt','DESC','OpenchannelApplication','account','Applications','list','applications','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','ids','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','CmList','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','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','register','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','request\x20sent','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','result','catch','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','findAll','rows','params'];(function(_0x2f317b,_0x16f717){var _0x111d29=function(_0x41dc4b){while(--_0x41dc4b){_0x2f317b['push'](_0x2f317b['shift']());}};_0x111d29(++_0x16f717);}(_0x29dd,0x121));var _0xd29d=function(_0x187bdb,_0x113caa){_0x187bdb=_0x187bdb-0x0;var _0x189f69=_0x29dd[_0x187bdb];return _0x189f69;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd29d('0x0'));var rimraf=require(_0xd29d('0x1'));var zipdir=require(_0xd29d('0x2'));var jsonpatch=require(_0xd29d('0x3'));var rp=require(_0xd29d('0x4'));var moment=require(_0xd29d('0x5'));var BPromise=require(_0xd29d('0x6'));var Mustache=require('mustache');var util=require(_0xd29d('0x7'));var path=require(_0xd29d('0x8'));var sox=require(_0xd29d('0x9'));var csv=require('to-csv');var ejs=require(_0xd29d('0xa'));var fs=require('fs');var _=require(_0xd29d('0xb'));var squel=require(_0xd29d('0xc'));var crypto=require(_0xd29d('0xd'));var jsforce=require(_0xd29d('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd29d('0xf'));var authService=require(_0xd29d('0x10'));var qs=require(_0xd29d('0x11'));var as=require(_0xd29d('0x12'));var hardwareService=require(_0xd29d('0x13'));var logger=require(_0xd29d('0x14'))('api');var utils=require(_0xd29d('0x15'));var config=require(_0xd29d('0x16'));var db=require(_0xd29d('0x17'))['db'];config['redis']=_[_0xd29d('0x18')](config[_0xd29d('0x19')],{'host':_0xd29d('0x1a'),'port':0x18eb});var socket=require(_0xd29d('0x1b'))(new Redis(config[_0xd29d('0x19')]));require('./openchannelAccount.socket')[_0xd29d('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd29d('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xd29d('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x1cee8a,_0x32e7e7,_0xfe17f3){if(_0xfe17f3){var _0x5dfae8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5dfae8[_0xd29d('0x1e')](_0x32e7e7)){return _0x1cee8a;}else{throw new db[(_0xd29d('0x1f'))][(_0xd29d('0x20'))](_0xd29d('0x21'));}}else{return _0x1cee8a;}}function respondWithRpcPromise(_0x2f9718,_0x301d76,_0x243ab5,_0x58dc5f){return new BPromise(function(_0x515e0d,_0x4077ac){var _0x5b72ed=_0x58dc5f||client;return _0x5b72ed['request'](_0x2f9718,_0x243ab5)[_0xd29d('0x22')](function(_0x414723){logger[_0xd29d('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x301d76,_0xd29d('0x24'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x301d76,'request\x20sent',JSON[_0xd29d('0x25')](_0x414723));if(_0x414723[_0xd29d('0x26')]){if(_0x414723[_0xd29d('0x26')][_0xd29d('0x27')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x301d76,_0x414723['error'][_0xd29d('0x28')]);return _0x4077ac(_0x414723[_0xd29d('0x26')]['message']);}logger[_0xd29d('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x301d76,_0x414723[_0xd29d('0x26')][_0xd29d('0x28')]);return _0x515e0d(_0x414723['error'][_0xd29d('0x28')]);}else{logger['info'](_0xd29d('0x29'),_0x301d76,_0xd29d('0x24'));_0x515e0d(_0x414723[_0xd29d('0x2a')][_0xd29d('0x28')]);}})[_0xd29d('0x2b')](function(_0x6c905d){logger[_0xd29d('0x26')](_0xd29d('0x29'),_0x301d76,_0x6c905d);_0x4077ac(_0x6c905d);});});}function respondWithStatusCode(_0x13234a,_0x26f2f4){_0x26f2f4=_0x26f2f4||0xcc;return function(_0x1fe7c6){if(_0x1fe7c6){return _0x13234a['sendStatus'](_0x26f2f4);}return _0x13234a[_0xd29d('0x2c')](_0x26f2f4)[_0xd29d('0x2d')]();};}function respondWithResult(_0x169011,_0x585ac4){_0x585ac4=_0x585ac4||0xc8;return function(_0x1f82fd){if(_0x1f82fd){return _0x169011[_0xd29d('0x2c')](_0x585ac4)['json'](_0x1f82fd);}};}function respondWithFilteredResult(_0x3af65e,_0x41f494){return function(_0xb4fbd){if(_0xb4fbd){var _0x2a7edb=_0xb4fbd[_0xd29d('0x2e')],_0x61e4a8=_0x41f494['offset'],_0x144107=_0x41f494[_0xd29d('0x2f')]+_0x41f494[_0xd29d('0x30')],_0x1d5d91;if(_0x144107>=_0x2a7edb){_0x144107=_0x2a7edb;_0x1d5d91=0xc8;}else{_0x1d5d91=0xce;}_0x3af65e[_0xd29d('0x2c')](_0x1d5d91);return _0x3af65e[_0xd29d('0x31')](_0xd29d('0x32'),_0x61e4a8+'-'+_0x144107+'/'+_0x2a7edb)[_0xd29d('0x33')](_0xb4fbd);}return null;};}function patchUpdates(_0x3f6518){return function(_0x14a4b7){try{jsonpatch[_0xd29d('0x34')](_0x14a4b7,_0x3f6518,!![]);}catch(_0x188fb4){return BPromise[_0xd29d('0x35')](_0x188fb4);}return _0x14a4b7[_0xd29d('0x36')]();};}function saveUpdates(_0x6cac00,_0x576650){return function(_0x37dad7){if(_0x37dad7){return _0x37dad7[_0xd29d('0x37')](_0x6cac00)[_0xd29d('0x22')](function(_0x2cc115){return _0x2cc115;});}return null;};}function removeEntity(_0x45fb33,_0xcc6d2a){return function(_0x356331){if(_0x356331){return _0x356331[_0xd29d('0x38')]()['then'](function(){var _0x2c25e8=_0x356331[_0xd29d('0x39')]({'plain':!![]});var _0x235b93=_0xd29d('0x3a');return db[_0xd29d('0x3b')][_0xd29d('0x38')]({'where':{'type':_0x235b93,'resourceId':_0x2c25e8['id']}})['then'](function(){return _0x356331;});})[_0xd29d('0x22')](function(){_0x45fb33[_0xd29d('0x2c')](0xcc)[_0xd29d('0x2d')]();});}};}function handleEntityNotFound(_0x5e372d,_0x37c4f9){return function(_0x243bcb){if(!_0x243bcb){_0x5e372d[_0xd29d('0x3c')](0x194);}return _0x243bcb;};}function handleError(_0x3a6419,_0x31fb35){_0x31fb35=_0x31fb35||0x1f4;return function(_0x2cf3ad){logger[_0xd29d('0x26')](_0x2cf3ad[_0xd29d('0x3d')]);if(_0x2cf3ad[_0xd29d('0x3e')]){delete _0x2cf3ad['name'];}_0x3a6419['status'](_0x31fb35)[_0xd29d('0x3f')](_0x2cf3ad);};}exports['index']=function(_0x5bf20c,_0x14f055){var _0x592682={'include':[{'model':db[_0xd29d('0x40')],'as':_0xd29d('0x41')}]},_0x41036a={},_0x533d6d={'count':0x0,'rows':[]};var _0x40840e=_[_0xd29d('0x42')](db['OpenchannelAccount'][_0xd29d('0x43')],function(_0x34d706){return{'name':_0x34d706[_0xd29d('0x44')],'type':_0x34d706[_0xd29d('0x45')][_0xd29d('0x46')]};});_0x41036a[_0xd29d('0x47')]=_[_0xd29d('0x42')](_0x40840e,_0xd29d('0x3e'));_0x41036a[_0xd29d('0x48')]=_[_0xd29d('0x49')](_0x5bf20c[_0xd29d('0x48')]);_0x41036a['filters']=_['intersection'](_0x41036a[_0xd29d('0x47')],_0x41036a[_0xd29d('0x48')]);_0x592682['attributes']=_[_0xd29d('0x4a')](_0x41036a[_0xd29d('0x47')],qs[_0xd29d('0x4b')](_0x5bf20c['query'][_0xd29d('0x4b')]));_0x592682[_0xd29d('0x4c')]=_0x592682[_0xd29d('0x4c')][_0xd29d('0x4d')]?_0x592682[_0xd29d('0x4c')]:_0x41036a[_0xd29d('0x47')];if(!_0x5bf20c[_0xd29d('0x48')]['hasOwnProperty'](_0xd29d('0x4e'))){_0x592682[_0xd29d('0x30')]=qs[_0xd29d('0x30')](_0x5bf20c[_0xd29d('0x48')][_0xd29d('0x30')]);_0x592682['offset']=qs[_0xd29d('0x2f')](_0x5bf20c['query'][_0xd29d('0x2f')]);}_0x592682['order']=qs[_0xd29d('0x4f')](_0x5bf20c[_0xd29d('0x48')][_0xd29d('0x4f')]);_0x592682[_0xd29d('0x50')]=qs['filters'](_[_0xd29d('0x51')](_0x5bf20c[_0xd29d('0x48')],_0x41036a[_0xd29d('0x52')]),_0x40840e);if(_0x5bf20c['query'][_0xd29d('0x53')]){_0x592682[_0xd29d('0x50')]=_[_0xd29d('0x54')](_0x592682['where'],{'$or':_[_0xd29d('0x42')](_0x40840e,function(_0x16da5f){if(_0x16da5f[_0xd29d('0x45')]!==_0xd29d('0x55')){var _0x388ba8={};_0x388ba8[_0x16da5f['name']]={'$like':'%'+_0x5bf20c[_0xd29d('0x48')][_0xd29d('0x53')]+'%'};return _0x388ba8;}})});}_0x592682=_[_0xd29d('0x54')]({},_0x592682,_0x5bf20c[_0xd29d('0x56')]);var _0x410f70={'where':_0x592682['where']};return db[_0xd29d('0x57')][_0xd29d('0x2e')](_0x410f70)[_0xd29d('0x22')](function(_0x29bc91){_0x533d6d[_0xd29d('0x2e')]=_0x29bc91;if(_0x5bf20c['query'][_0xd29d('0x58')]){_0x592682[_0xd29d('0x59')]=[{'all':!![]}];}return db[_0xd29d('0x57')][_0xd29d('0x5a')](_0x592682);})[_0xd29d('0x22')](function(_0x3bbcc5){_0x533d6d[_0xd29d('0x5b')]=_0x3bbcc5;return _0x533d6d;})['then'](respondWithFilteredResult(_0x14f055,_0x592682))[_0xd29d('0x2b')](handleError(_0x14f055,null));};exports['show']=function(_0x199dd5,_0xb031ed){var _0x3cc412={'raw':![],'where':{'id':_0x199dd5[_0xd29d('0x5c')]['id']},'include':[{'model':db[_0xd29d('0x40')],'as':_0xd29d('0x41')}]},_0x521157={};_0x521157[_0xd29d('0x47')]=_[_0xd29d('0x49')](db['OpenchannelAccount'][_0xd29d('0x43')]);_0x521157[_0xd29d('0x48')]=_[_0xd29d('0x49')](_0x199dd5['query']);_0x521157[_0xd29d('0x52')]=_[_0xd29d('0x4a')](_0x521157['model'],_0x521157[_0xd29d('0x48')]);_0x3cc412['attributes']=_[_0xd29d('0x4a')](_0x521157[_0xd29d('0x47')],qs['fields'](_0x199dd5[_0xd29d('0x48')][_0xd29d('0x4b')]));_0x3cc412['attributes']=_0x3cc412[_0xd29d('0x4c')]['length']?_0x3cc412[_0xd29d('0x4c')]:_0x521157['model'];if(_0x199dd5[_0xd29d('0x48')][_0xd29d('0x58')]){_0x3cc412[_0xd29d('0x59')]=[{'all':!![]}];}_0x3cc412=_[_0xd29d('0x54')]({},_0x3cc412,_0x199dd5['options']);return db[_0xd29d('0x57')][_0xd29d('0x5d')](_0x3cc412)[_0xd29d('0x22')](handleEntityNotFound(_0xb031ed,null))['then'](respondWithResult(_0xb031ed,null))['catch'](handleError(_0xb031ed,null));};exports[_0xd29d('0x5e')]=function(_0x54023e,_0x62f113){return db[_0xd29d('0x57')][_0xd29d('0x5e')](_0x54023e[_0xd29d('0x5f')],{})[_0xd29d('0x22')](function(_0x40be58){var _0x3b2258=_0x54023e['user'][_0xd29d('0x39')]({'plain':!![]});if(!_0x3b2258)throw new Error(_0xd29d('0x60'));if(_0x3b2258[_0xd29d('0x61')]===_0xd29d('0x62')){var _0x3f1b27=_0x40be58[_0xd29d('0x39')]({'plain':!![]});var _0x3cd994=_0xd29d('0x3a');return db[_0xd29d('0x63')][_0xd29d('0x5d')]({'where':{'name':_0x3cd994,'userProfileId':_0x3b2258['userProfileId']},'raw':!![]})[_0xd29d('0x22')](function(_0x3c8587){if(_0x3c8587&&_0x3c8587[_0xd29d('0x64')]===0x0){return db[_0xd29d('0x3b')][_0xd29d('0x5e')]({'name':_0x3f1b27['name'],'resourceId':_0x3f1b27['id'],'type':_0x3c8587[_0xd29d('0x3e')],'sectionId':_0x3c8587['id']},{})[_0xd29d('0x22')](function(){return _0x40be58;});}else{return _0x40be58;}})['catch'](function(_0x488af6){logger[_0xd29d('0x26')](_0xd29d('0x65'),_0x488af6);throw _0x488af6;});}return _0x40be58;})['then'](respondWithResult(_0x62f113,0xc9))['catch'](handleError(_0x62f113,null));};exports[_0xd29d('0x37')]=function(_0x1aabd8,_0x261634){if(_0x1aabd8[_0xd29d('0x5f')]['id']){delete _0x1aabd8['body']['id'];}return db['OpenchannelAccount'][_0xd29d('0x5d')]({'where':{'id':_0x1aabd8[_0xd29d('0x5c')]['id']},'include':[{'model':db[_0xd29d('0x40')],'as':'mandatoryDispositionPause'}]})[_0xd29d('0x22')](handleEntityNotFound(_0x261634,null))[_0xd29d('0x22')](saveUpdates(_0x1aabd8['body'],null))['then'](respondWithResult(_0x261634,null))[_0xd29d('0x2b')](handleError(_0x261634,null));};exports['destroy']=function(_0x125728,_0x57b7e0){return db[_0xd29d('0x57')][_0xd29d('0x5d')]({'where':{'id':_0x125728[_0xd29d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x57b7e0,null))[_0xd29d('0x22')](removeEntity(_0x57b7e0,null))[_0xd29d('0x2b')](handleError(_0x57b7e0,null));};exports[_0xd29d('0x66')]=function(_0x52cf03,_0x9597c7){return db[_0xd29d('0x57')][_0xd29d('0x66')]()[_0xd29d('0x22')](respondWithResult(_0x9597c7,null))[_0xd29d('0x2b')](handleError(_0x9597c7,null));};exports['addDisposition']=function(_0x3b0dcc,_0x3f2254,_0x25f032){if(_0x3b0dcc[_0xd29d('0x5f')]['id']){delete _0x3b0dcc[_0xd29d('0x5f')]['id'];}return db['OpenchannelAccount'][_0xd29d('0x5d')]({'where':{'id':_0x3b0dcc[_0xd29d('0x5c')]['id']}})[_0xd29d('0x22')](handleEntityNotFound(_0x3f2254,null))[_0xd29d('0x22')](function(_0x3ea8da){if(_0x3ea8da){_0x3b0dcc[_0xd29d('0x5f')][_0xd29d('0x67')]=_0x3ea8da['id'];return db[_0xd29d('0x68')][_0xd29d('0x5e')](_0x3b0dcc[_0xd29d('0x5f')]);}})[_0xd29d('0x22')](respondWithResult(_0x3f2254,null))[_0xd29d('0x2b')](handleError(_0x3f2254,null));};exports[_0xd29d('0x69')]=function(_0x53cbc6,_0xa8d474,_0x39d5be){var _0x365201={'raw':![],'where':{}};var _0x4b7dc2={};var _0x576387={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xd29d('0x6a')]({'where':{'id':_0x53cbc6['params']['id']}})['then'](handleEntityNotFound(_0xa8d474,null))[_0xd29d('0x22')](function(_0x476f99){if(_0x476f99){_0x4b7dc2['model']=_[_0xd29d('0x49')](db[_0xd29d('0x68')]['rawAttributes']);_0x4b7dc2[_0xd29d('0x48')]=_[_0xd29d('0x49')](_0x53cbc6[_0xd29d('0x48')]);_0x4b7dc2[_0xd29d('0x52')]=_[_0xd29d('0x4a')](_0x4b7dc2[_0xd29d('0x47')],_0x4b7dc2['query']);_0x365201[_0xd29d('0x4c')]=_['intersection'](_0x4b7dc2[_0xd29d('0x47')],qs['fields'](_0x53cbc6[_0xd29d('0x48')][_0xd29d('0x4b')]));_0x365201['attributes']=_0x365201[_0xd29d('0x4c')][_0xd29d('0x4d')]?_0x365201[_0xd29d('0x4c')]:_0x4b7dc2[_0xd29d('0x47')];if(!_0x53cbc6['query'][_0xd29d('0x6b')]('nolimit')){_0x365201[_0xd29d('0x30')]=qs[_0xd29d('0x30')](_0x53cbc6['query']['limit']);_0x365201['offset']=qs['offset'](_0x53cbc6[_0xd29d('0x48')]['offset']);}_0x365201[_0xd29d('0x6c')]=qs[_0xd29d('0x4f')](_0x53cbc6[_0xd29d('0x48')][_0xd29d('0x4f')]);_0x365201[_0xd29d('0x50')]=qs[_0xd29d('0x52')](_[_0xd29d('0x51')](_0x53cbc6[_0xd29d('0x48')],_0x4b7dc2[_0xd29d('0x52')]));_0x365201['where'][_0xd29d('0x6d')]=_0x476f99['id'];if(_0x53cbc6['query'][_0xd29d('0x53')]){_0x365201[_0xd29d('0x50')]=_[_0xd29d('0x54')](_0x365201[_0xd29d('0x50')],{'$or':_[_0xd29d('0x42')](_0x365201['attributes'],function(_0x1ff87d){var _0xac4aa={};_0xac4aa[_0x1ff87d]={'$like':'%'+_0x53cbc6['query'][_0xd29d('0x53')]+'%'};return _0xac4aa;})});}_0x365201=_['merge']({},_0x365201,_0x53cbc6['options']);return db['Disposition'][_0xd29d('0x2e')]({'where':_0x365201['where']})['then'](function(_0x265494){_0x576387[_0xd29d('0x2e')]=_0x265494;if(_0x53cbc6[_0xd29d('0x48')][_0xd29d('0x58')]){_0x365201['include']=[{'all':!![]}];}return db[_0xd29d('0x68')]['findAll'](_0x365201);})[_0xd29d('0x22')](function(_0x302e54){_0x576387['rows']=_0x302e54;return _0x576387;});}})[_0xd29d('0x22')](respondWithFilteredResult(_0xa8d474,_0x365201))[_0xd29d('0x2b')](handleError(_0xa8d474,null));};exports['removeDispositions']=function(_0x761c6,_0x25315a,_0x1dd082){return db[_0xd29d('0x57')]['find']({'where':{'id':_0x761c6['params']['id']}})['then'](handleEntityNotFound(_0x25315a,null))[_0xd29d('0x22')](function(_0xfa8102){if(_0xfa8102){return _0xfa8102[_0xd29d('0x6e')](_0x761c6[_0xd29d('0x48')]['ids']);}})[_0xd29d('0x22')](respondWithStatusCode(_0x25315a,null))[_0xd29d('0x2b')](handleError(_0x25315a,null));};exports[_0xd29d('0x6f')]=function(_0x2e954d,_0x3d5ffe,_0x1052a4){if(_0x2e954d['body']['id']){delete _0x2e954d[_0xd29d('0x5f')]['id'];}return db[_0xd29d('0x57')][_0xd29d('0x5d')]({'where':{'id':_0x2e954d[_0xd29d('0x5c')]['id']}})[_0xd29d('0x22')](handleEntityNotFound(_0x3d5ffe,null))[_0xd29d('0x22')](function(_0x25c5bd){if(_0x25c5bd){_0x2e954d[_0xd29d('0x5f')][_0xd29d('0x6d')]=_0x25c5bd['id'];return db[_0xd29d('0x70')][_0xd29d('0x5e')](_0x2e954d[_0xd29d('0x5f')]);}})[_0xd29d('0x22')](respondWithResult(_0x3d5ffe,null))[_0xd29d('0x2b')](handleError(_0x3d5ffe,null));};exports['getAnswers']=function(_0x51ff6d,_0x1a16c1,_0x14cfad){var _0x30a8d4={'raw':![],'where':{}};var _0x2aab08={};var _0x26145f={'count':0x0,'rows':[]};return db[_0xd29d('0x57')][_0xd29d('0x6a')]({'where':{'id':_0x51ff6d[_0xd29d('0x5c')]['id']}})[_0xd29d('0x22')](handleEntityNotFound(_0x1a16c1,null))['then'](function(_0x33f75f){if(_0x33f75f){_0x2aab08['model']=_[_0xd29d('0x49')](db[_0xd29d('0x70')]['rawAttributes']);_0x2aab08[_0xd29d('0x48')]=_[_0xd29d('0x49')](_0x51ff6d[_0xd29d('0x48')]);_0x2aab08[_0xd29d('0x52')]=_[_0xd29d('0x4a')](_0x2aab08['model'],_0x2aab08[_0xd29d('0x48')]);_0x30a8d4['attributes']=_[_0xd29d('0x4a')](_0x2aab08[_0xd29d('0x47')],qs['fields'](_0x51ff6d[_0xd29d('0x48')][_0xd29d('0x4b')]));_0x30a8d4['attributes']=_0x30a8d4['attributes'][_0xd29d('0x4d')]?_0x30a8d4['attributes']:_0x2aab08[_0xd29d('0x47')];if(!_0x51ff6d[_0xd29d('0x48')][_0xd29d('0x6b')](_0xd29d('0x4e'))){_0x30a8d4[_0xd29d('0x30')]=qs[_0xd29d('0x30')](_0x51ff6d['query'][_0xd29d('0x30')]);_0x30a8d4[_0xd29d('0x2f')]=qs[_0xd29d('0x2f')](_0x51ff6d[_0xd29d('0x48')][_0xd29d('0x2f')]);}_0x30a8d4[_0xd29d('0x6c')]=qs[_0xd29d('0x4f')](_0x51ff6d['query'][_0xd29d('0x4f')]);_0x30a8d4[_0xd29d('0x50')]=qs[_0xd29d('0x52')](_['pick'](_0x51ff6d[_0xd29d('0x48')],_0x2aab08['filters']));_0x30a8d4[_0xd29d('0x50')][_0xd29d('0x6d')]=_0x33f75f['id'];if(_0x51ff6d['query'][_0xd29d('0x53')]){_0x30a8d4[_0xd29d('0x50')]=_[_0xd29d('0x54')](_0x30a8d4[_0xd29d('0x50')],{'$or':_[_0xd29d('0x42')](_0x30a8d4['attributes'],function(_0xc9f132){var _0x5aa66b={};_0x5aa66b[_0xc9f132]={'$like':'%'+_0x51ff6d[_0xd29d('0x48')][_0xd29d('0x53')]+'%'};return _0x5aa66b;})});}_0x30a8d4=_[_0xd29d('0x54')]({},_0x30a8d4,_0x51ff6d[_0xd29d('0x56')]);return db[_0xd29d('0x70')][_0xd29d('0x2e')]({'where':_0x30a8d4[_0xd29d('0x50')]})[_0xd29d('0x22')](function(_0x269754){_0x26145f[_0xd29d('0x2e')]=_0x269754;if(_0x51ff6d[_0xd29d('0x48')][_0xd29d('0x58')]){_0x30a8d4[_0xd29d('0x59')]=[{'all':!![]}];}return db[_0xd29d('0x70')][_0xd29d('0x5a')](_0x30a8d4);})[_0xd29d('0x22')](function(_0x28508b){_0x26145f['rows']=_0x28508b;return _0x26145f;});}})[_0xd29d('0x22')](respondWithFilteredResult(_0x1a16c1,_0x30a8d4))[_0xd29d('0x2b')](handleError(_0x1a16c1,null));};exports['removeAnswers']=function(_0x21d023,_0x5e2461,_0x28ce87){return db[_0xd29d('0x57')]['find']({'where':{'id':_0x21d023['params']['id']}})['then'](handleEntityNotFound(_0x5e2461,null))[_0xd29d('0x22')](function(_0x25eac9){if(_0x25eac9){return _0x25eac9[_0xd29d('0x71')](_0x21d023[_0xd29d('0x48')]['ids']);}})[_0xd29d('0x22')](respondWithStatusCode(_0x5e2461,null))[_0xd29d('0x2b')](handleError(_0x5e2461,null));};exports[_0xd29d('0x72')]=function(_0x307de9,_0x385272,_0x27b545){var _0x1245c3={'body':_0x307de9[_0xd29d('0x5f')],'channel':_0xd29d('0x73')};var _0x4ca546=[];var _0x288a17=[];var _0x144eb2={};var _0x1a0aa9=![];return db[_0xd29d('0x74')][_0xd29d('0x66')]()[_0xd29d('0x22')](function(_0x48040e){if(!_0x48040e){throw new db[(_0xd29d('0x1f'))][(_0xd29d('0x20'))](_0xd29d('0x75'));}_0x4ca546=_[_0xd29d('0x76')](_[_0xd29d('0x49')](_0x48040e),['createdAt','updatedAt']);_0x288a17=_[_0xd29d('0x76')](_[_0xd29d('0x49')](_0x48040e),[_0xd29d('0x77'),'updatedAt',_0xd29d('0x78'),_0xd29d('0x79')]);if(_0x307de9[_0xd29d('0x5f')]['id']){delete _0x307de9['body']['id'];}if(_[_0xd29d('0x7a')](_0x307de9[_0xd29d('0x5f')]['from'])){throw new db['Sequelize'][(_0xd29d('0x20'))](_0xd29d('0x7b'));}if(_[_0xd29d('0x7a')](_0x307de9[_0xd29d('0x5f')][_0xd29d('0x5f')])||_0x307de9[_0xd29d('0x5f')][_0xd29d('0x5f')]===''){throw new db[(_0xd29d('0x1f'))][(_0xd29d('0x20'))](_0xd29d('0x7c'));}if(_['isNil'](_0x307de9[_0xd29d('0x5f')]['mapKey'])){throw new db['Sequelize'][(_0xd29d('0x20'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x288a17);}if(!_[_0xd29d('0x7d')](_0x288a17,_0x307de9[_0xd29d('0x5f')]['mapKey'])){throw new db['Sequelize'][(_0xd29d('0x20'))](_0xd29d('0x7e')+_0x288a17);}_0x144eb2[_0x307de9[_0xd29d('0x5f')][_0xd29d('0x7f')]]=_0x307de9['body'][_0xd29d('0x80')];})[_0xd29d('0x22')](function(){return db[_0xd29d('0x57')]['find']({'where':{'id':_0x307de9[_0xd29d('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0xd29d('0x81'),'include':[{'model':db[_0xd29d('0x74')],'as':_0xd29d('0x82'),'where':_0x144eb2,'limit':0x1,'order':[[_0xd29d('0x83'),_0xd29d('0x84')]]}]},{'model':db[_0xd29d('0x85')],'as':'Applications'}]});})[_0xd29d('0x22')](handleEntityNotFound(_0x385272,null))[_0xd29d('0x22')](function(_0x3efbac){if(_0x3efbac&&_0x3efbac[_0xd29d('0x81')]){_0x1245c3[_0xd29d('0x86')]=_0x3efbac;_0x1245c3['applications']=_0x3efbac[_0xd29d('0x87')];_0x1245c3[_0xd29d('0x88')]=_0x3efbac[_0xd29d('0x81')];_0x1245c3[_0xd29d('0x89')]=_['orderBy'](_0x1245c3['applications'],[_0xd29d('0x8a')],[_0xd29d('0x8b')]);if(_0x1245c3[_0xd29d('0x86')][_0xd29d('0x87')]){delete _0x1245c3[_0xd29d('0x86')][_0xd29d('0x87')];}if(_0x1245c3[_0xd29d('0x86')][_0xd29d('0x81')]&&_0x1245c3['account'][_0xd29d('0x81')][_0xd29d('0x82')][_0xd29d('0x4d')]){return _0x1245c3[_0xd29d('0x86')][_0xd29d('0x81')]['Contacts'][0x0];}var _0x72a181=_['defaults'](_0x307de9[_0xd29d('0x5f')],{'firstName':_0x307de9['body'][_0xd29d('0x80')],'ListId':_0x3efbac['ListId']});_0x72a181[_0x307de9[_0xd29d('0x5f')][_0xd29d('0x7f')]]=_0x307de9[_0xd29d('0x5f')][_0xd29d('0x80')];return db[_0xd29d('0x74')][_0xd29d('0x5e')](_0x72a181,{'fields':_0x4ca546,'raw':!![]});}})[_0xd29d('0x22')](handleEntityNotFound(_0x385272,null))[_0xd29d('0x22')](function(_0x1a17ff){_0x1245c3[_0xd29d('0x8c')]=_0x1a17ff;if(_0x1a17ff){var _0x8f7379={'ContactId':_0x1a17ff['id'],'OpenchannelAccountId':_0x307de9[_0xd29d('0x5c')]['id'],'from':(_0x1a17ff[_0xd29d('0x8d')]||'')+'\x20'+(_0x1a17ff[_0xd29d('0x8e')]||'')};var _0x4086b9={'OpenchannelAccountId':_0x307de9[_0xd29d('0x5c')]['id'],'closed':![]};if(_0x307de9['body'][_0xd29d('0x8f')]){_0x4086b9['threadId']=_0x307de9[_0xd29d('0x5f')][_0xd29d('0x8f')];return db[_0xd29d('0x90')][_0xd29d('0x5d')]({'where':_0x4086b9})[_0xd29d('0x22')](function(_0x5beac5){if(_0x5beac5){return[_0x5beac5,![]];}_0x8f7379[_0xd29d('0x8f')]=_0x307de9[_0xd29d('0x5f')][_0xd29d('0x8f')];_0x8f7379['externalUrl']=_0x307de9[_0xd29d('0x5f')][_0xd29d('0x91')];return db['OpenchannelInteraction']['create'](_0x8f7379)[_0xd29d('0x22')](function(_0x41a326){return[_0x41a326,!![]];});});}else{_0x4086b9[_0xd29d('0x8f')]=null;}_0x4086b9[_0xd29d('0x92')]=_0x1a17ff['id'];return db[_0xd29d('0x90')][_0xd29d('0x5d')]({'where':_0x4086b9})[_0xd29d('0x22')](function(_0x1780f2){if(_0x1780f2){return[_0x1780f2,![]];}return db[_0xd29d('0x90')]['create'](_0x8f7379)[_0xd29d('0x22')](function(_0x44d13d){return[_0x44d13d,!![]];});});}})['spread'](function(_0x1c1ac5,_0x3448fe){if(_0x1c1ac5){_0x1a0aa9=_0x3448fe;if(!_0x3448fe){var _0x57aeac={'from':(_0x1245c3['contact'][_0xd29d('0x8d')]||'')+'\x20'+(_0x1245c3[_0xd29d('0x8c')][_0xd29d('0x8e')]||'')};if(_0x307de9[_0xd29d('0x5f')]['threadId']&&_0x307de9['body'][_0xd29d('0x93')]&&_0x307de9[_0xd29d('0x5f')][_0xd29d('0x8f')]!=_0x307de9['body'][_0xd29d('0x93')]){_0x57aeac[_0xd29d('0x8f')]=_0x307de9[_0xd29d('0x5f')][_0xd29d('0x93')];}return _0x1c1ac5[_0xd29d('0x37')](_0x57aeac);}else{return _0x1c1ac5;}}})['then'](function(_0x54251b){_0x1245c3[_0xd29d('0x94')]=_0x54251b[_0xd29d('0x39')]({'plain':!![]});_0x1245c3['interaction']['created']=_0x1a0aa9;if(_0x1245c3[_0xd29d('0x94')]['created']){if(_0x1245c3[_0xd29d('0x86')][_0xd29d('0x95')]){_0x1245c3[_0xd29d('0x89')][_0xd29d('0x96')]({'id':0x0,'priority':_0x1245c3[_0xd29d('0x89')][_0xd29d('0x4d')]+0x1,'app':_0xd29d('0x97'),'appdata':_0xd29d('0x98'),'interval':_0xd29d('0x99')});}}return db[_0xd29d('0x9a')]['create']({'body':_0x307de9[_0xd29d('0x5f')][_0xd29d('0x5f')],'OpenchannelAccountId':_0x307de9[_0xd29d('0x5c')]['id'],'OpenchannelInteractionId':_0x54251b['id'],'direction':'in','ContactId':_0x1245c3[_0xd29d('0x8c')]['id'],'AttachmentId':_0x307de9['body'][_0xd29d('0x9b')]});})['then'](function(_0x50d7fd){_0x1245c3[_0xd29d('0x28')]=_0x50d7fd;if(_0x1245c3['interaction'][_0xd29d('0x9c')]){return db[_0xd29d('0x9d')]['find']({'attributes':['id','name'],'where':{'id':_0x1245c3[_0xd29d('0x94')][_0xd29d('0x9c')]}})[_0xd29d('0x22')](function(_0xd6dd9f){if(_0xd6dd9f){_0x1245c3['applications'][_0xd29d('0x9e')]({'id':0x0,'priority':0x0,'app':_0xd29d('0x9f'),'appdata':_0xd6dd9f[_0xd29d('0x3e')]+','+(_0x1245c3[_0xd29d('0x86')][_0xd29d('0xa0')]||0xa),'interval':_0xd29d('0x99')});_0x1245c3[_0xd29d('0xa1')]=![];}return respondWithRpcPromise(_0xd29d('0xa2'),_0xd29d('0xa3'),_0x1245c3);});}return respondWithRpcPromise(_0xd29d('0xa2'),'startRouting',_0x1245c3);})['then'](function(_0x1a84e8){respondWithRpcPromise(_0xd29d('0xa4'),'EventManager',{'event':_0xd29d('0x72'),'message':_0x1a84e8},client9002);return _0x1a84e8;})['then'](respondWithResult(_0x385272,null))[_0xd29d('0x2b')](handleError(_0x385272,null));};exports['addApplications']=function(_0x10eedf,_0x218177,_0x35c8b0){return db[_0xd29d('0x57')][_0xd29d('0x6a')]({'where':{'id':_0x10eedf[_0xd29d('0x5c')]['id']}})[_0xd29d('0x22')](handleEntityNotFound(_0x218177,null))['then'](function(_0x47c34e){if(_0x47c34e){return db[_0xd29d('0xa5')][_0xd29d('0xa6')](function(_0x592548){return db[_0xd29d('0x85')]['destroy']({'where':{'OpenchannelAccountId':_0x10eedf[_0xd29d('0x5c')]['id']},'transaction':_0x592548})[_0xd29d('0x22')](function(_0x294f32){var _0xa59038=_[_0xd29d('0x42')](_0x10eedf[_0xd29d('0x5f')],function(_0x2fcb91){_0x2fcb91[_0xd29d('0x6d')]=_0x10eedf[_0xd29d('0x5c')]['id'];return _0x2fcb91;});return db[_0xd29d('0x85')][_0xd29d('0xa7')](_0xa59038,{'transaction':_0x592548});});})['then'](function(){return db[_0xd29d('0x85')][_0xd29d('0xa8')]({'where':{'OpenchannelAccountId':_0x10eedf[_0xd29d('0x5c')]['id']},'order':_0xd29d('0x8a')});});}})[_0xd29d('0x22')](respondWithResult(_0x218177,null))[_0xd29d('0x2b')](handleError(_0x218177,null));};exports[_0xd29d('0xa9')]=function(_0x83e4aa,_0x4c2f6b,_0x5af68b){var _0x4206e9={};var _0x3de74d={};var _0x23ecd8;var _0x3af22e;return db[_0xd29d('0x57')]['findOne']({'where':{'id':_0x83e4aa[_0xd29d('0x5c')]['id']}})[_0xd29d('0x22')](handleEntityNotFound(_0x4c2f6b,null))[_0xd29d('0x22')](function(_0x3b492d){if(_0x3b492d){_0x23ecd8=_0x3b492d;_0x3de74d[_0xd29d('0x47')]=_[_0xd29d('0x49')](db['OpenchannelApplication']['rawAttributes']);_0x3de74d[_0xd29d('0x48')]=_[_0xd29d('0x49')](_0x83e4aa[_0xd29d('0x48')]);_0x3de74d[_0xd29d('0x52')]=_[_0xd29d('0x4a')](_0x3de74d[_0xd29d('0x47')],_0x3de74d[_0xd29d('0x48')]);_0x4206e9[_0xd29d('0x4c')]=_[_0xd29d('0x4a')](_0x3de74d[_0xd29d('0x47')],qs['fields'](_0x83e4aa[_0xd29d('0x48')][_0xd29d('0x4b')]));_0x4206e9[_0xd29d('0x4c')]=_0x4206e9[_0xd29d('0x4c')]['length']?_0x4206e9[_0xd29d('0x4c')]:_0x3de74d[_0xd29d('0x47')];_0x4206e9['order']=qs[_0xd29d('0x4f')](_0x83e4aa['query'][_0xd29d('0x4f')]);_0x4206e9['where']=qs[_0xd29d('0x52')](_['pick'](_0x83e4aa[_0xd29d('0x48')],_0x3de74d['filters']));if(_0x83e4aa[_0xd29d('0x48')]['filter']){_0x4206e9['where']=_[_0xd29d('0x54')](_0x4206e9['where'],{'$or':_[_0xd29d('0x42')](_0x4206e9['attributes'],function(_0x2eaaf9){var _0x13dd70={};_0x13dd70[_0x2eaaf9]={'$like':'%'+_0x83e4aa[_0xd29d('0x48')][_0xd29d('0x53')]+'%'};return _0x13dd70;})});}_0x4206e9=_[_0xd29d('0x54')]({},_0x4206e9,_0x83e4aa[_0xd29d('0x56')]);return _0x23ecd8[_0xd29d('0xa9')](_0x4206e9);}})[_0xd29d('0x22')](function(_0x348c23){if(_0x348c23){_0x3af22e=_0x348c23[_0xd29d('0x4d')];if(!_0x83e4aa[_0xd29d('0x48')][_0xd29d('0x6b')](_0xd29d('0x4e'))){_0x4206e9[_0xd29d('0x30')]=qs[_0xd29d('0x30')](_0x83e4aa['query'][_0xd29d('0x30')]);_0x4206e9['offset']=qs[_0xd29d('0x2f')](_0x83e4aa[_0xd29d('0x48')][_0xd29d('0x2f')]);}return _0x23ecd8['getApplications'](_0x4206e9);}})['then'](function(_0x41871c){if(_0x41871c){return _0x41871c?{'count':_0x3af22e,'rows':_0x41871c}:null;}})[_0xd29d('0x22')](respondWithResult(_0x4c2f6b,null))[_0xd29d('0x2b')](handleError(_0x4c2f6b,null));};exports[_0xd29d('0xaa')]=function(_0x3dc48d,_0x1bd31b,_0x1c6a24){var _0x410dca={'raw':![],'where':{}};var _0x209c23={};var _0x1a36ba={'count':0x0,'rows':[]};return db[_0xd29d('0x57')][_0xd29d('0x6a')]({'where':{'id':_0x3dc48d[_0xd29d('0x5c')]['id']}})[_0xd29d('0x22')](handleEntityNotFound(_0x1bd31b,null))[_0xd29d('0x22')](function(_0x4eea4d){if(_0x4eea4d){_0x209c23[_0xd29d('0x47')]=_[_0xd29d('0x49')](db[_0xd29d('0x90')][_0xd29d('0x43')]);_0x209c23[_0xd29d('0x48')]=_[_0xd29d('0x49')](_0x3dc48d['query']);_0x209c23[_0xd29d('0x52')]=_[_0xd29d('0x4a')](_0x209c23['model'],_0x209c23[_0xd29d('0x48')]);_0x410dca[_0xd29d('0x4c')]=_['intersection'](_0x209c23[_0xd29d('0x47')],qs['fields'](_0x3dc48d[_0xd29d('0x48')][_0xd29d('0x4b')]));_0x410dca['attributes']=_0x410dca[_0xd29d('0x4c')][_0xd29d('0x4d')]?_0x410dca[_0xd29d('0x4c')]:_0x209c23[_0xd29d('0x47')];if(!_0x3dc48d['query']['hasOwnProperty'](_0xd29d('0x4e'))){_0x410dca[_0xd29d('0x30')]=qs[_0xd29d('0x30')](_0x3dc48d[_0xd29d('0x48')]['limit']);_0x410dca['offset']=qs[_0xd29d('0x2f')](_0x3dc48d[_0xd29d('0x48')][_0xd29d('0x2f')]);}_0x410dca['order']=qs[_0xd29d('0x4f')](_0x3dc48d[_0xd29d('0x48')]['sort']);_0x410dca[_0xd29d('0x50')]=qs['filters'](_[_0xd29d('0x51')](_0x3dc48d[_0xd29d('0x48')],_0x209c23[_0xd29d('0x52')]));_0x410dca[_0xd29d('0x50')][_0xd29d('0x6d')]=_0x4eea4d['id'];if(_0x3dc48d[_0xd29d('0x48')][_0xd29d('0x53')]){_0x410dca['where']=_[_0xd29d('0x54')](_0x410dca[_0xd29d('0x50')],{'$or':_[_0xd29d('0x42')](_0x410dca[_0xd29d('0x4c')],function(_0x5a3db8){var _0x180be5={};_0x180be5[_0x5a3db8]={'$like':'%'+_0x3dc48d[_0xd29d('0x48')][_0xd29d('0x53')]+'%'};return _0x180be5;})});}_0x410dca=_[_0xd29d('0x54')]({},_0x410dca,_0x3dc48d['options']);return db[_0xd29d('0x90')][_0xd29d('0x2e')]({'where':_0x410dca[_0xd29d('0x50')]})['then'](function(_0xb11970){_0x1a36ba[_0xd29d('0x2e')]=_0xb11970;if(_0x3dc48d['query'][_0xd29d('0x58')]){_0x410dca[_0xd29d('0x59')]=[{'model':db[_0xd29d('0x74')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xd29d('0xab'),'attributes':['name',_0xd29d('0xac'),_0xd29d('0xad')],'required':![]},{'model':db[_0xd29d('0xae')],'as':_0xd29d('0xaf'),'attributes':['id',_0xd29d('0x3e'),_0xd29d('0xb0')],'where':_0x3dc48d['query']['tag']?{'id':_0x3dc48d[_0xd29d('0x48')][_0xd29d('0xb1')]}:undefined,'required':_0x3dc48d[_0xd29d('0x48')][_0xd29d('0xb1')]?!![]:![]}];}return db[_0xd29d('0x90')][_0xd29d('0x5a')](_0x410dca);})[_0xd29d('0x22')](function(_0xedda7f){_0x1a36ba[_0xd29d('0x5b')]=_0xedda7f;return _0x1a36ba;});}})['then'](respondWithFilteredResult(_0x1bd31b,_0x410dca))[_0xd29d('0x2b')](handleError(_0x1bd31b,null));};exports['addAgents']=function(_0x300f31,_0x585a9a,_0x10205d){return db[_0xd29d('0x57')]['find']({'where':{'id':_0x300f31[_0xd29d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x585a9a,null))[_0xd29d('0x22')](function(_0x3933c1){if(_0x3933c1){return _0x3933c1[_0xd29d('0xb2')](_0x300f31[_0xd29d('0x5f')][_0xd29d('0xb3')],_[_0xd29d('0xb4')](_0x300f31[_0xd29d('0x5f')],[_0xd29d('0xb3'),'id'])||{})['spread'](function(_0x5b5f5d){for(var _0x4ff48c=0x0;_0x4ff48c<_0x300f31[_0xd29d('0x5f')][_0xd29d('0xb3')][_0xd29d('0x4d')];_0x4ff48c+=0x1){socket['emit'](_0xd29d('0xb5'),{'UserId':_0x300f31[_0xd29d('0x5f')]['ids'][_0x4ff48c],'OpenchannelAccountId':_0x300f31['params']['id']});}return _0x5b5f5d;});}})[_0xd29d('0x22')](respondWithResult(_0x585a9a,null))['catch'](handleError(_0x585a9a,null));};exports[_0xd29d('0xb6')]=function(_0x147a4c,_0x2665aa,_0x176b57){return db[_0xd29d('0x57')][_0xd29d('0x5d')]({'where':{'id':_0x147a4c[_0xd29d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2665aa,null))[_0xd29d('0x22')](function(_0x5663f7){if(_0x5663f7){return _0x5663f7[_0xd29d('0xb6')](_0x147a4c['query'][_0xd29d('0xb3')])[_0xd29d('0x22')](function(){if(_[_0xd29d('0xb7')](_0x147a4c[_0xd29d('0x48')][_0xd29d('0xb3')])){for(var _0xd93cc6=0x0;_0xd93cc6<_0x147a4c[_0xd29d('0x48')][_0xd29d('0xb3')][_0xd29d('0x4d')];_0xd93cc6+=0x1){socket[_0xd29d('0xb8')](_0xd29d('0xb9'),{'UserId':Number(_0x147a4c[_0xd29d('0x48')][_0xd29d('0xb3')][_0xd93cc6]),'OpenchannelAccountId':Number(_0x147a4c['params']['id'])});}}else{socket['emit'](_0xd29d('0xb9'),{'UserId':Number(_0x147a4c[_0xd29d('0x48')][_0xd29d('0xb3')]),'OpenchannelAccountId':Number(_0x147a4c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2665aa,null))[_0xd29d('0x2b')](handleError(_0x2665aa,null));};exports[_0xd29d('0xba')]=function(_0x215512,_0x49e6ce,_0x2ff7a6){var _0xf67494={};var _0x5154ce={};var _0x15c094;var _0x2628d1;return db['OpenchannelAccount'][_0xd29d('0x6a')]({'where':{'id':_0x215512[_0xd29d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x49e6ce,null))['then'](function(_0x1c4ea7){if(_0x1c4ea7){_0x15c094=_0x1c4ea7;_0x5154ce[_0xd29d('0x47')]=_[_0xd29d('0x49')](db[_0xd29d('0x9d')][_0xd29d('0x43')]);_0x5154ce[_0xd29d('0x48')]=_[_0xd29d('0x49')](_0x215512[_0xd29d('0x48')]);_0x5154ce['filters']=_[_0xd29d('0x4a')](_0x5154ce[_0xd29d('0x47')],_0x5154ce[_0xd29d('0x48')]);_0xf67494[_0xd29d('0x4c')]=_[_0xd29d('0x4a')](_0x5154ce[_0xd29d('0x47')],qs[_0xd29d('0x4b')](_0x215512[_0xd29d('0x48')]['fields']));_0xf67494[_0xd29d('0x4c')]=_0xf67494[_0xd29d('0x4c')]['length']?_0xf67494[_0xd29d('0x4c')]:_0x5154ce['model'];_0xf67494['order']=qs[_0xd29d('0x4f')](_0x215512['query'][_0xd29d('0x4f')]);_0xf67494[_0xd29d('0x50')]=qs[_0xd29d('0x52')](_[_0xd29d('0x51')](_0x215512[_0xd29d('0x48')],_0x5154ce[_0xd29d('0x52')]));if(_0x215512[_0xd29d('0x48')][_0xd29d('0x53')]){_0xf67494[_0xd29d('0x50')]=_['merge'](_0xf67494[_0xd29d('0x50')],{'$or':_[_0xd29d('0x42')](_0xf67494[_0xd29d('0x4c')],function(_0x159061){var _0x4e10b6={};_0x4e10b6[_0x159061]={'$like':'%'+_0x215512[_0xd29d('0x48')][_0xd29d('0x53')]+'%'};return _0x4e10b6;})});}_0xf67494=_[_0xd29d('0x54')]({},_0xf67494,_0x215512[_0xd29d('0x56')]);return _0x15c094['getAgents'](_0xf67494);}})[_0xd29d('0x22')](function(_0x4ceede){if(_0x4ceede){_0x2628d1=_0x4ceede[_0xd29d('0x4d')];if(!_0x215512[_0xd29d('0x48')][_0xd29d('0x6b')](_0xd29d('0x4e'))){_0xf67494[_0xd29d('0x30')]=qs['limit'](_0x215512[_0xd29d('0x48')][_0xd29d('0x30')]);_0xf67494[_0xd29d('0x2f')]=qs[_0xd29d('0x2f')](_0x215512[_0xd29d('0x48')][_0xd29d('0x2f')]);}return _0x15c094[_0xd29d('0xba')](_0xf67494);}})['then'](function(_0x38cd5a){if(_0x38cd5a){return _0x38cd5a?{'count':_0x2628d1,'rows':_0x38cd5a}:null;}})['then'](respondWithResult(_0x49e6ce,null))['catch'](handleError(_0x49e6ce,null));};exports[_0xd29d('0x3f')]=function(_0x3aecbf,_0x1527ab,_0x480b81){var _0x8da9c3,_0x318aa5,_0x1b9fc7;if(_[_0xd29d('0x7a')](_0x3aecbf[_0xd29d('0x5f')][_0xd29d('0x5f')])||_0x3aecbf[_0xd29d('0x5f')][_0xd29d('0x5f')]===''){throw new db[(_0xd29d('0x1f'))][(_0xd29d('0x20'))](_0xd29d('0x7c'));}if(_[_0xd29d('0x7a')](_0x3aecbf[_0xd29d('0x5f')]['to'])){}_0x8da9c3=_0x3aecbf[_0xd29d('0x5f')]['to'];return db['OpenchannelAccount'][_0xd29d('0x6a')]({'where':{'id':_0x3aecbf[_0xd29d('0x5c')]['id']}})[_0xd29d('0x22')](handleEntityNotFound(_0x1527ab,null))[_0xd29d('0x22')](function(_0x32443a){if(_0x32443a){return db['OpenchannelAccount'][_0xd29d('0x5d')]({'where':{'id':_0x32443a['id']},'include':[{'model':db[_0xd29d('0xbb')],'as':_0xd29d('0x81'),'include':[{'model':db[_0xd29d('0x74')],'as':_0xd29d('0x82'),'where':{[_0x32443a[_0xd29d('0x7f')]]:_0x8da9c3},'limit':0x1,'order':[[_0xd29d('0x83'),_0xd29d('0x84')]]}]}]})[_0xd29d('0x22')](handleEntityNotFound(_0x1527ab,null))[_0xd29d('0x22')](function(_0x4ac22){if(_0x4ac22&&_0x4ac22['List']){_0x318aa5=_0x4ac22[_0xd29d('0x39')]({'plain':!![]});if(_0x318aa5[_0xd29d('0x81')]&&_0x318aa5['List'][_0xd29d('0x82')][_0xd29d('0x4d')]){return _0x318aa5[_0xd29d('0x81')][_0xd29d('0x82')][0x0];}return db[_0xd29d('0x74')]['create'](_[_0xd29d('0x18')](_0x3aecbf[_0xd29d('0x5f')],{'firstName':_0x8da9c3,[_0x4ac22['mapKey']]:_0x8da9c3,'phone':_0x8da9c3,'ListId':_0x318aa5['ListId']}));}})[_0xd29d('0x22')](handleEntityNotFound(_0x1527ab,null))[_0xd29d('0x22')](function(_0x4a1754){if(_0x4a1754){_0x1b9fc7=_0x4a1754;return db[_0xd29d('0x90')][_0xd29d('0x5d')]({'where':{'ContactId':_0x1b9fc7['id'],'closed':![],'OpenchannelAccountId':_0x318aa5['id']}})[_0xd29d('0x22')](function(_0x2ec537){if(_0x2ec537){return[_0x2ec537,![]];}return db[_0xd29d('0x90')][_0xd29d('0x5e')]({'UserId':_0x3aecbf[_0xd29d('0x62')]['id'],'ContactId':_0x1b9fc7['id'],'OpenchannelAccountId':_0x318aa5['id'],'lastMsgDirection':_0xd29d('0xbc'),'Messages':[_[_0xd29d('0x54')](_0x3aecbf[_0xd29d('0x5f')],{'read':![],'body':_0x3aecbf[_0xd29d('0x5f')][_0xd29d('0x5f')],'OpenchannelAccountId':_0x318aa5['id'],'UserId':_0x3aecbf[_0xd29d('0x62')]['id'],'ContactId':_0x1b9fc7['id']})]},{'include':[{'model':db[_0xd29d('0x9a')],'as':'Messages'}]})['then'](function(_0x1402c5){return[_0x1402c5,!![]];});});}})['spread'](function(_0x226fd7,_0x1adea1){if(_0x1adea1){return _0x226fd7;}return db['OpenchannelMessage'][_0xd29d('0x5e')](_['merge'](_0x3aecbf[_0xd29d('0x5f')],{'read':![],'body':_0x3aecbf['body'][_0xd29d('0x5f')],'OpenchannelAccountId':_0x318aa5['id'],'OpenchannelInteractionId':_0x226fd7['id'],'UserId':_0x3aecbf[_0xd29d('0x62')]['id'],'ContactId':_0x1b9fc7['id']}))[_0xd29d('0x22')](function(_0x3f7bbb){_0x226fd7[_0xd29d('0xbd')][_0xd29d('0xbe')]=[];_0x226fd7[_0xd29d('0xbd')][_0xd29d('0xbe')][_0xd29d('0x96')](_0x3f7bbb[_0xd29d('0xbd')]);return _0x226fd7;});});}})[_0xd29d('0x22')](respondWithResult(_0x1527ab,null))[_0xd29d('0x2b')](handleError(_0x1527ab,null));};
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js
index 8f4e23a..3fe67ba 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 _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
+var _0xd38e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x8f9d63,_0x39df6f){var _0x43259e=function(_0x565df8){while(--_0x565df8){_0x8f9d63['push'](_0x8f9d63['shift']());}};_0x43259e(++_0x39df6f);}(_0xd38e,0x11e));var _0xed38=function(_0x34d00e,_0x3797b0){_0x34d00e=_0x34d00e-0x0;var _0xa822b2=_0xd38e[_0x34d00e];return _0xa822b2;};'use strict';var EventEmitter=require(_0xed38('0x0'));var OpenchannelAccount=require(_0xed38('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xed38('0x2')](0x0);var events={'afterCreate':_0xed38('0x3'),'afterUpdate':_0xed38('0x4'),'afterDestroy':_0xed38('0x5')};function emitEvent(_0x57aef9){return function(_0x530722,_0x7b90fb,_0x229ec1){OpenchannelAccountEvents['emit'](_0x57aef9+':'+_0x530722['id'],_0x530722);OpenchannelAccountEvents[_0xed38('0x6')](_0x57aef9,_0x530722);_0x229ec1(null);};}for(var e in events){if(events[_0xed38('0x7')](e)){var event=events[e];OpenchannelAccount[_0xed38('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js
index 4c10b3c..9f7fa9c 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 _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
+var _0x3baf=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','openchannel_accounts','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3baf,0x1e9));var _0xf3ba=function(_0x39d9d7,_0xb6691){_0x39d9d7=_0x39d9d7-0x0;var _0x3b1c1d=_0x3baf[_0x39d9d7];return _0x3b1c1d;};'use strict';var _=require(_0xf3ba('0x0'));var util=require('util');var logger=require(_0xf3ba('0x1'))(_0xf3ba('0x2'));var moment=require(_0xf3ba('0x3'));var BPromise=require(_0xf3ba('0x4'));var rp=require(_0xf3ba('0x5'));var fs=require('fs');var path=require(_0xf3ba('0x6'));var rimraf=require(_0xf3ba('0x7'));var config=require(_0xf3ba('0x8'));var attributes=require(_0xf3ba('0x9'));module[_0xf3ba('0xa')]=function(_0x1c1fc3,_0x9f946e){return _0x1c1fc3[_0xf3ba('0xb')](_0xf3ba('0xc'),attributes,{'tableName':_0xf3ba('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 7faba5b..c5c635e 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 _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
+var _0x627f=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util'];(function(_0x229252,_0x46b6b9){var _0x315e84=function(_0x5c1eda){while(--_0x5c1eda){_0x229252['push'](_0x229252['shift']());}};_0x315e84(++_0x46b6b9);}(_0x627f,0x15d));var _0xf627=function(_0x2fea68,_0x31caf5){_0x2fea68=_0x2fea68-0x0;var _0x4576e4=_0x627f[_0x2fea68];return _0x4576e4;};'use strict';var _=require('lodash');var util=require(_0xf627('0x0'));var moment=require('moment');var BPromise=require(_0xf627('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf627('0x2'));var db=require(_0xf627('0x3'))['db'];var utils=require(_0xf627('0x4'));var logger=require(_0xf627('0x5'))('rpc');var config=require(_0xf627('0x6'));var jayson=require(_0xf627('0x7'));var client=jayson['client'][_0xf627('0x8')]({'port':0x232a});config[_0xf627('0x9')]=_[_0xf627('0xa')](config[_0xf627('0x9')],{'host':_0xf627('0xb'),'port':0x18eb});var socket=require(_0xf627('0xc'))(new Redis(config['redis']));require('./openchannelAccount.socket')[_0xf627('0xd')](socket);function respondWithRpcPromise(_0xa5c716,_0x1de4a1,_0x30c78f){return new BPromise(function(_0xb5e54e,_0x2dcdff){return client['request'](_0xa5c716,_0x30c78f)[_0xf627('0xe')](function(_0x4e1e45){logger[_0xf627('0xf')](_0xf627('0x10'),_0x1de4a1,_0xf627('0x11'));logger[_0xf627('0x12')](_0xf627('0x13'),_0x1de4a1,_0xf627('0x11'),JSON[_0xf627('0x14')](_0x4e1e45));if(_0x4e1e45[_0xf627('0x15')]){if(_0x4e1e45[_0xf627('0x15')]['code']===0x1f4){logger[_0xf627('0x15')](_0xf627('0x10'),_0x1de4a1,_0x4e1e45[_0xf627('0x15')][_0xf627('0x16')]);return _0x2dcdff(_0x4e1e45['error'][_0xf627('0x16')]);}logger[_0xf627('0x15')](_0xf627('0x10'),_0x1de4a1,_0x4e1e45[_0xf627('0x15')][_0xf627('0x16')]);return _0xb5e54e(_0x4e1e45[_0xf627('0x15')][_0xf627('0x16')]);}else{logger[_0xf627('0xf')](_0xf627('0x10'),_0x1de4a1,_0xf627('0x11'));_0xb5e54e(_0x4e1e45[_0xf627('0x17')][_0xf627('0x16')]);}})[_0xf627('0x18')](function(_0x24b6c7){logger[_0xf627('0x15')](_0xf627('0x10'),_0x1de4a1,_0x24b6c7);_0x2dcdff(_0x24b6c7);});});}
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js
index 3703707..5061afa 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 _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
+var _0x06f8=['length','openchannelAccount:','./openchannelAccount.events','save','remove','update','register'];(function(_0x13b1e5,_0xddd116){var _0x324bce=function(_0x5a49bb){while(--_0x5a49bb){_0x13b1e5['push'](_0x13b1e5['shift']());}};_0x324bce(++_0xddd116);}(_0x06f8,0x167));var _0x806f=function(_0x478b7c,_0x53c050){_0x478b7c=_0x478b7c-0x0;var _0xd93212=_0x06f8[_0x478b7c];return _0xd93212;};'use strict';var OpenchannelAccountEvents=require(_0x806f('0x0'));var events=[_0x806f('0x1'),_0x806f('0x2'),_0x806f('0x3')];function createListener(_0x6c9638,_0x154af4){return function(_0x3bf056){_0x154af4['emit'](_0x6c9638,_0x3bf056);};}function removeListener(_0x128c00,_0x4ff7fa){return function(){OpenchannelAccountEvents['removeListener'](_0x128c00,_0x4ff7fa);};}exports[_0x806f('0x4')]=function(_0x509360){for(var _0xecbe98=0x0,_0x2ad205=events[_0x806f('0x5')];_0xecbe98<_0x2ad205;_0xecbe98++){var _0x34f262=events[_0xecbe98];var _0x194684=createListener(_0x806f('0x6')+_0x34f262,_0x509360);OpenchannelAccountEvents['on'](_0x34f262,_0x194684);}};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js
index 6385efd..a3659f4 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 _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
+var _0xba7c=['./openchannelApplication.controller','get','isAuthenticated','/:id','post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x18d1be,_0x5ec389){var _0x526abf=function(_0x122902){while(--_0x122902){_0x18d1be['push'](_0x18d1be['shift']());}};_0x526abf(++_0x5ec389);}(_0xba7c,0x1d4));var _0xcba7=function(_0x369d7e,_0x4c28ed){_0x369d7e=_0x369d7e-0x0;var _0x1a0185=_0xba7c[_0x369d7e];return _0x1a0185;};'use strict';var multer=require(_0xcba7('0x0'));var util=require(_0xcba7('0x1'));var path=require(_0xcba7('0x2'));var timeout=require(_0xcba7('0x3'));var express=require('express');var router=express[_0xcba7('0x4')]();var auth=require(_0xcba7('0x5'));var interaction=require(_0xcba7('0x6'));var config=require(_0xcba7('0x7'));var controller=require(_0xcba7('0x8'));router[_0xcba7('0x9')]('/',auth[_0xcba7('0xa')](),controller['index']);router[_0xcba7('0x9')](_0xcba7('0xb'),auth[_0xcba7('0xa')](),controller['show']);router[_0xcba7('0xc')]('/',auth[_0xcba7('0xa')](),controller['create']);router[_0xcba7('0xd')](_0xcba7('0xb'),auth[_0xcba7('0xa')](),controller[_0xcba7('0xe')]);router['delete'](_0xcba7('0xb'),auth[_0xcba7('0xa')](),controller[_0xcba7('0xf')]);module[_0xcba7('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 2540443..fccf241 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 _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
+var _0x004d=['STRING','noop','TEXT','exports'];(function(_0x18a68d,_0x16dba9){var _0x44e57b=function(_0x55a209){while(--_0x55a209){_0x18a68d['push'](_0x18a68d['shift']());}};_0x44e57b(++_0x16dba9);}(_0x004d,0x183));var _0xd004=function(_0x38506f,_0x234765){_0x38506f=_0x38506f-0x0;var _0x19251c=_0x004d[_0x38506f];return _0x19251c;};'use strict';var Sequelize=require('sequelize');module[_0xd004('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xd004('0x1')],'allowNull':![],'defaultValue':_0xd004('0x2')},'appdata':{'type':Sequelize[_0xd004('0x3')]()},'description':{'type':Sequelize[_0xd004('0x1')]},'interval':{'type':Sequelize[_0xd004('0x1')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js
index 3576499..dd1995c 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 _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
+var _0x55d6=['util','sox','to-csv','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','OpenchannelApplication','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x55d6,0x8c));var _0x655d=function(_0x1f4549,_0x57782f){_0x1f4549=_0x1f4549-0x0;var _0x46d1b9=_0x55d6[_0x1f4549];return _0x46d1b9;};'use strict';var pdf=require(_0x655d('0x0'));var emlformat=require(_0x655d('0x1'));var rimraf=require(_0x655d('0x2'));var zipdir=require(_0x655d('0x3'));var jsonpatch=require(_0x655d('0x4'));var rp=require(_0x655d('0x5'));var moment=require(_0x655d('0x6'));var BPromise=require(_0x655d('0x7'));var Mustache=require('mustache');var util=require(_0x655d('0x8'));var path=require('path');var sox=require(_0x655d('0x9'));var csv=require(_0x655d('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x655d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x655d('0xc'));var toCsv=require(_0x655d('0xa'));var querystring=require(_0x655d('0xd'));var Papa=require(_0x655d('0xe'));var Redis=require(_0x655d('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x655d('0x10'));var hardwareService=require(_0x655d('0x11'));var logger=require('../../config/logger')(_0x655d('0x12'));var utils=require(_0x655d('0x13'));var config=require(_0x655d('0x14'));var db=require(_0x655d('0x15'))['db'];function respondWithStatusCode(_0x376269,_0x1754e3){_0x1754e3=_0x1754e3||0xcc;return function(_0x536b67){if(_0x536b67){return _0x376269[_0x655d('0x16')](_0x1754e3);}return _0x376269[_0x655d('0x17')](_0x1754e3)[_0x655d('0x18')]();};}function respondWithResult(_0x3b64e8,_0x54fec3){_0x54fec3=_0x54fec3||0xc8;return function(_0x3ccc34){if(_0x3ccc34){return _0x3b64e8[_0x655d('0x17')](_0x54fec3)[_0x655d('0x19')](_0x3ccc34);}};}function respondWithFilteredResult(_0x2d5342,_0x5536d3){return function(_0x153826){if(_0x153826){var _0x4f1db6=_0x153826['count'],_0x21c948=_0x5536d3['offset'],_0x40829a=_0x5536d3[_0x655d('0x1a')]+_0x5536d3[_0x655d('0x1b')],_0x4b3947;if(_0x40829a>=_0x4f1db6){_0x40829a=_0x4f1db6;_0x4b3947=0xc8;}else{_0x4b3947=0xce;}_0x2d5342[_0x655d('0x17')](_0x4b3947);return _0x2d5342['set'](_0x655d('0x1c'),_0x21c948+'-'+_0x40829a+'/'+_0x4f1db6)[_0x655d('0x19')](_0x153826);}return null;};}function patchUpdates(_0xf84093){return function(_0xec6bc0){try{jsonpatch[_0x655d('0x1d')](_0xec6bc0,_0xf84093,!![]);}catch(_0x5d4e04){return BPromise[_0x655d('0x1e')](_0x5d4e04);}return _0xec6bc0[_0x655d('0x1f')]();};}function saveUpdates(_0x1329cb,_0x139352){return function(_0x1acb8d){if(_0x1acb8d){return _0x1acb8d[_0x655d('0x20')](_0x1329cb)[_0x655d('0x21')](function(_0x34125a){return _0x34125a;});}return null;};}function removeEntity(_0x105967,_0x558d95){return function(_0x3646a9){if(_0x3646a9){return _0x3646a9[_0x655d('0x22')]()[_0x655d('0x21')](function(){_0x105967[_0x655d('0x17')](0xcc)[_0x655d('0x18')]();});}};}function handleEntityNotFound(_0x260801,_0xb73844){return function(_0x38d0f7){if(!_0x38d0f7){_0x260801[_0x655d('0x16')](0x194);}return _0x38d0f7;};}function handleError(_0x5c1e45,_0x54cf1c){_0x54cf1c=_0x54cf1c||0x1f4;return function(_0x5bd138){logger[_0x655d('0x23')](_0x5bd138[_0x655d('0x24')]);if(_0x5bd138[_0x655d('0x25')]){delete _0x5bd138[_0x655d('0x25')];}_0x5c1e45[_0x655d('0x17')](_0x54cf1c)[_0x655d('0x26')](_0x5bd138);};}exports[_0x655d('0x27')]=function(_0x268a38,_0x133dd4){var _0xb974a5={},_0x18ac22={},_0x5ef77d={'count':0x0,'rows':[]};var _0x39e45f=_['map'](db[_0x655d('0x28')]['rawAttributes'],function(_0x33b1f1){return{'name':_0x33b1f1[_0x655d('0x29')],'type':_0x33b1f1[_0x655d('0x2a')][_0x655d('0x2b')]};});_0x18ac22['model']=_[_0x655d('0x2c')](_0x39e45f,_0x655d('0x25'));_0x18ac22[_0x655d('0x2d')]=_[_0x655d('0x2e')](_0x268a38[_0x655d('0x2d')]);_0x18ac22[_0x655d('0x2f')]=_[_0x655d('0x30')](_0x18ac22[_0x655d('0x31')],_0x18ac22[_0x655d('0x2d')]);_0xb974a5['attributes']=_['intersection'](_0x18ac22[_0x655d('0x31')],qs['fields'](_0x268a38['query'][_0x655d('0x32')]));_0xb974a5[_0x655d('0x33')]=_0xb974a5[_0x655d('0x33')]['length']?_0xb974a5[_0x655d('0x33')]:_0x18ac22[_0x655d('0x31')];if(!_0x268a38['query']['hasOwnProperty'](_0x655d('0x34'))){_0xb974a5[_0x655d('0x1b')]=qs[_0x655d('0x1b')](_0x268a38[_0x655d('0x2d')][_0x655d('0x1b')]);_0xb974a5['offset']=qs[_0x655d('0x1a')](_0x268a38[_0x655d('0x2d')][_0x655d('0x1a')]);}_0xb974a5[_0x655d('0x35')]=qs[_0x655d('0x36')](_0x268a38[_0x655d('0x2d')][_0x655d('0x36')]);_0xb974a5[_0x655d('0x37')]=qs[_0x655d('0x2f')](_[_0x655d('0x38')](_0x268a38[_0x655d('0x2d')],_0x18ac22[_0x655d('0x2f')]),_0x39e45f);if(_0x268a38[_0x655d('0x2d')][_0x655d('0x39')]){_0xb974a5[_0x655d('0x37')]=_['merge'](_0xb974a5[_0x655d('0x37')],{'$or':_['map'](_0x39e45f,function(_0x46f116){if(_0x46f116[_0x655d('0x2a')]!==_0x655d('0x3a')){var _0xb263ef={};_0xb263ef[_0x46f116[_0x655d('0x25')]]={'$like':'%'+_0x268a38['query'][_0x655d('0x39')]+'%'};return _0xb263ef;}})});}_0xb974a5=_[_0x655d('0x3b')]({},_0xb974a5,_0x268a38[_0x655d('0x3c')]);var _0x53c106={'where':_0xb974a5[_0x655d('0x37')]};return db[_0x655d('0x28')][_0x655d('0x3d')](_0x53c106)['then'](function(_0x336d79){_0x5ef77d[_0x655d('0x3d')]=_0x336d79;if(_0x268a38[_0x655d('0x2d')][_0x655d('0x3e')]){_0xb974a5[_0x655d('0x3f')]=[{'all':!![]}];}return db[_0x655d('0x28')][_0x655d('0x40')](_0xb974a5);})[_0x655d('0x21')](function(_0x2ef722){_0x5ef77d[_0x655d('0x41')]=_0x2ef722;return _0x5ef77d;})[_0x655d('0x21')](respondWithFilteredResult(_0x133dd4,_0xb974a5))[_0x655d('0x42')](handleError(_0x133dd4,null));};exports[_0x655d('0x43')]=function(_0x2cd79b,_0xd392e3){var _0xc06fb2={'raw':!![],'where':{'id':_0x2cd79b[_0x655d('0x44')]['id']}},_0x3bbf8b={};_0x3bbf8b[_0x655d('0x31')]=_[_0x655d('0x2e')](db[_0x655d('0x28')][_0x655d('0x45')]);_0x3bbf8b[_0x655d('0x2d')]=_[_0x655d('0x2e')](_0x2cd79b[_0x655d('0x2d')]);_0x3bbf8b['filters']=_[_0x655d('0x30')](_0x3bbf8b[_0x655d('0x31')],_0x3bbf8b[_0x655d('0x2d')]);_0xc06fb2[_0x655d('0x33')]=_[_0x655d('0x30')](_0x3bbf8b['model'],qs['fields'](_0x2cd79b[_0x655d('0x2d')]['fields']));_0xc06fb2['attributes']=_0xc06fb2[_0x655d('0x33')][_0x655d('0x46')]?_0xc06fb2['attributes']:_0x3bbf8b[_0x655d('0x31')];if(_0x2cd79b[_0x655d('0x2d')]['includeAll']){_0xc06fb2['include']=[{'all':!![]}];}_0xc06fb2=_[_0x655d('0x3b')]({},_0xc06fb2,_0x2cd79b[_0x655d('0x3c')]);return db[_0x655d('0x28')][_0x655d('0x47')](_0xc06fb2)[_0x655d('0x21')](handleEntityNotFound(_0xd392e3,null))[_0x655d('0x21')](respondWithResult(_0xd392e3,null))[_0x655d('0x42')](handleError(_0xd392e3,null));};exports[_0x655d('0x48')]=function(_0x379c19,_0x6e0625){return db['OpenchannelApplication']['create'](_0x379c19[_0x655d('0x49')],{})[_0x655d('0x21')](respondWithResult(_0x6e0625,0xc9))['catch'](handleError(_0x6e0625,null));};exports['update']=function(_0x3596b8,_0x1c9256){if(_0x3596b8['body']['id']){delete _0x3596b8['body']['id'];}return db['OpenchannelApplication'][_0x655d('0x47')]({'where':{'id':_0x3596b8[_0x655d('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c9256,null))[_0x655d('0x21')](saveUpdates(_0x3596b8[_0x655d('0x49')],null))[_0x655d('0x21')](respondWithResult(_0x1c9256,null))[_0x655d('0x42')](handleError(_0x1c9256,null));};exports[_0x655d('0x22')]=function(_0x162616,_0x2fdfed){return db['OpenchannelApplication'][_0x655d('0x47')]({'where':{'id':_0x162616[_0x655d('0x44')]['id']}})[_0x655d('0x21')](handleEntityNotFound(_0x2fdfed,null))[_0x655d('0x21')](removeEntity(_0x2fdfed,null))[_0x655d('0x42')](handleError(_0x2fdfed,null));};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js
index 02fb09d..c02c173 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 _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
+var _0xac26=['exports','define','openchannel_applications','utf8mb4','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelApplication.attributes'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xac26,0xee));var _0x6ac2=function(_0x20d0dc,_0x3960f3){_0x20d0dc=_0x20d0dc-0x0;var _0x127c42=_0xac26[_0x20d0dc];return _0x127c42;};'use strict';var _=require(_0x6ac2('0x0'));var util=require(_0x6ac2('0x1'));var logger=require('../../config/logger')(_0x6ac2('0x2'));var moment=require(_0x6ac2('0x3'));var BPromise=require(_0x6ac2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ac2('0x5'));var rimraf=require(_0x6ac2('0x6'));var config=require(_0x6ac2('0x7'));var attributes=require(_0x6ac2('0x8'));module[_0x6ac2('0x9')]=function(_0x2a3a89,_0x1572d4){return _0x2a3a89[_0x6ac2('0xa')]('OpenchannelApplication',attributes,{'tableName':_0x6ac2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6ac2('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js
index bded3ef..2747505 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(_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
+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(_0x5259f7,_0xdcdc61){var _0x11e597=function(_0x390f89){while(--_0x390f89){_0x5259f7['push'](_0x5259f7['shift']());}};_0x11e597(++_0xdcdc61);}(_0xb10b,0x12a));var _0xbb10=function(_0x58f8a7,_0xbd36a7){_0x58f8a7=_0x58f8a7-0x0;var _0x149b97=_0xb10b[_0x58f8a7];return _0x149b97;};'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 f8db9de..0889f89 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 _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
+var _0xd1dd=['index','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:destroy','destroy','delete','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x58f971,_0x44d986){var _0x5e02f3=function(_0x4805a5){while(--_0x4805a5){_0x58f971['push'](_0x58f971['shift']());}};_0x5e02f3(++_0x44d986);}(_0xd1dd,0x1a9));var _0xdd1d=function(_0x4fba16,_0x5db313){_0x4fba16=_0x4fba16-0x0;var _0x4bf557=_0xd1dd[_0x4fba16];return _0x4bf557;};'use strict';var multer=require('multer');var util=require(_0xdd1d('0x0'));var path=require(_0xdd1d('0x1'));var timeout=require(_0xdd1d('0x2'));var express=require(_0xdd1d('0x3'));var router=express[_0xdd1d('0x4')]();var auth=require(_0xdd1d('0x5'));var interaction=require(_0xdd1d('0x6'));var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router[_0xdd1d('0x7')]('/',auth[_0xdd1d('0x8')](),controller[_0xdd1d('0x9')]);router[_0xdd1d('0x7')](_0xdd1d('0xa'),auth[_0xdd1d('0x8')](),controller[_0xdd1d('0xb')]);router[_0xdd1d('0x7')](_0xdd1d('0xc'),auth[_0xdd1d('0x8')](),controller[_0xdd1d('0xd')]);router['get'](_0xdd1d('0xe'),auth[_0xdd1d('0x8')](),controller[_0xdd1d('0xf')]);router[_0xdd1d('0x7')]('/:id/download',auth[_0xdd1d('0x8')](),controller[_0xdd1d('0x10')]);router[_0xdd1d('0x11')]('/',auth[_0xdd1d('0x8')](),controller[_0xdd1d('0x12')]);router[_0xdd1d('0x11')](_0xdd1d('0xe'),auth[_0xdd1d('0x8')](),controller[_0xdd1d('0x13')]);router[_0xdd1d('0x11')](_0xdd1d('0x14'),auth[_0xdd1d('0x8')](),interaction[_0xdd1d('0x15')](_0xdd1d('0x16'),_0xdd1d('0x17')),controller[_0xdd1d('0x18')]);router[_0xdd1d('0x19')](_0xdd1d('0xc'),auth[_0xdd1d('0x8')](),interaction[_0xdd1d('0x15')](_0xdd1d('0x16'),'openchannelinteraction:update'),controller['update']);router['delete'](_0xdd1d('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0xdd1d('0x16'),_0xdd1d('0x1a')),controller[_0xdd1d('0x1b')]);router[_0xdd1d('0x1c')](_0xdd1d('0x14'),auth['isAuthenticated'](),controller[_0xdd1d('0x1d')]);module[_0xdd1d('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js
index ccf4816..1d186ae 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 _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
+var _0x380b=['out','sequelize','BOOLEAN','DATE','STRING','ENUM'];(function(_0x96d4e0,_0x187eb7){var _0x3bcac0=function(_0xd5c22f){while(--_0xd5c22f){_0x96d4e0['push'](_0x96d4e0['shift']());}};_0x3bcac0(++_0x187eb7);}(_0x380b,0x13f));var _0xb380=function(_0x2f406d,_0x3f995a){_0x2f406d=_0x2f406d-0x0;var _0x34d901=_0x380b[_0x2f406d];return _0x34d901;};'use strict';var Sequelize=require(_0xb380('0x0'));module['exports']={'closed':{'type':Sequelize[_0xb380('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb380('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb380('0x3')]},'read1stAt':{'type':Sequelize[_0xb380('0x2')]},'threadId':{'type':Sequelize[_0xb380('0x3')]},'externalUrl':{'type':Sequelize[_0xb380('0x3')]},'lastMsgAt':{'type':Sequelize[_0xb380('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xb380('0x4')]('in',_0xb380('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb380('0x3')]}};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js
index 5d1caf0..687a596 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 _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
+var _0x50fe=['OpenchannelInteractionId','all','rows','show','params','includeAll','include','options','create','describe','OpenchannelMessage','ids','getMessages','findOne','format','findAll','addTags','omit','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','CmContact','Contact','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','get','mkdirSync','10px','40px','Openchannel','YYYY-MM-DD','Account','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','threadId','Public','basename','createReadStream','pipe','createWriteStream','System','firstName','views','downloadInteraction.html','toFile','transcript-','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','end','status','json','offset','set','Content-Range','save','update','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','split','push','catch','index','OpenchannelInteraction','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','color','u.id','u.fullname','ui.OpenchannelInteractionId','from','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','`\x20=\x200','having','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','Tag','forEach','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','body','keys','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','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?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','isEmpty','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','count','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString'];(function(_0xcf7d1e,_0x1b00ad){var _0x42b2cb=function(_0x4c5c9b){while(--_0x4c5c9b){_0xcf7d1e['push'](_0xcf7d1e['shift']());}};_0x42b2cb(++_0x1b00ad);}(_0x50fe,0x12a));var _0xe50f=function(_0x114d66,_0x3c1188){_0x114d66=_0x114d66-0x0;var _0x5189c7=_0x50fe[_0x114d66];return _0x5189c7;};'use strict';var pdf=require(_0xe50f('0x0'));var emlformat=require(_0xe50f('0x1'));var rimraf=require(_0xe50f('0x2'));var zipdir=require(_0xe50f('0x3'));var jsonpatch=require(_0xe50f('0x4'));var rp=require(_0xe50f('0x5'));var moment=require(_0xe50f('0x6'));var BPromise=require(_0xe50f('0x7'));var Mustache=require(_0xe50f('0x8'));var util=require(_0xe50f('0x9'));var path=require(_0xe50f('0xa'));var sox=require(_0xe50f('0xb'));var csv=require(_0xe50f('0xc'));var ejs=require(_0xe50f('0xd'));var fs=require('fs');var _=require(_0xe50f('0xe'));var squel=require(_0xe50f('0xf'));var crypto=require('crypto');var jsforce=require(_0xe50f('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe50f('0xc'));var querystring=require('querystring');var Papa=require(_0xe50f('0x11'));var Redis=require(_0xe50f('0x12'));var authService=require(_0xe50f('0x13'));var qs=require(_0xe50f('0x14'));var as=require(_0xe50f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe50f('0x16'))(_0xe50f('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe50f('0x18'))['db'];config[_0xe50f('0x19')]=_[_0xe50f('0x1a')](config[_0xe50f('0x19')],{'host':_0xe50f('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe50f('0x19')]));require(_0xe50f('0x1c'))[_0xe50f('0x1d')](socket);function respondWithStatusCode(_0x31728b,_0x496631){_0x496631=_0x496631||0xcc;return function(_0x1ee6a0){if(_0x1ee6a0){return _0x31728b[_0xe50f('0x1e')](_0x496631);}return _0x31728b['status'](_0x496631)[_0xe50f('0x1f')]();};}function respondWithResult(_0x402666,_0x27e240){_0x27e240=_0x27e240||0xc8;return function(_0xee24d3){if(_0xee24d3){return _0x402666[_0xe50f('0x20')](_0x27e240)[_0xe50f('0x21')](_0xee24d3);}};}function respondWithFilteredResult(_0x36263d,_0x335f9a){return function(_0x396626){if(_0x396626){var _0x56ed7a=_0x396626['count'],_0x4cf71e=_0x335f9a[_0xe50f('0x22')],_0x175e50=_0x335f9a['offset']+_0x335f9a['limit'],_0x129d18;if(_0x175e50>=_0x56ed7a){_0x175e50=_0x56ed7a;_0x129d18=0xc8;}else{_0x129d18=0xce;}_0x36263d[_0xe50f('0x20')](_0x129d18);return _0x36263d[_0xe50f('0x23')](_0xe50f('0x24'),_0x4cf71e+'-'+_0x175e50+'/'+_0x56ed7a)[_0xe50f('0x21')](_0x396626);}return null;};}function patchUpdates(_0x8c94c9){return function(_0x1df96e){try{jsonpatch['apply'](_0x1df96e,_0x8c94c9,!![]);}catch(_0x28e180){return BPromise['reject'](_0x28e180);}return _0x1df96e[_0xe50f('0x25')]();};}function saveUpdates(_0x36e678,_0xe77962){return function(_0xd7f62c){if(_0xd7f62c){return _0xd7f62c[_0xe50f('0x26')](_0x36e678)[_0xe50f('0x27')](function(_0x331fd9){return _0x331fd9;});}return null;};}function removeEntity(_0x4d9f15,_0xa01752){return function(_0x40dad8){if(_0x40dad8){return _0x40dad8[_0xe50f('0x28')]()[_0xe50f('0x27')](function(){_0x4d9f15[_0xe50f('0x20')](0xcc)[_0xe50f('0x1f')]();});}};}function handleEntityNotFound(_0x2caae0,_0x4210bb){return function(_0x5cbd7e){if(!_0x5cbd7e){_0x2caae0['sendStatus'](0x194);}return _0x5cbd7e;};}function handleError(_0x51e8bd,_0xaf5a8a){_0xaf5a8a=_0xaf5a8a||0x1f4;return function(_0x5e9d55){logger[_0xe50f('0x29')](_0x5e9d55[_0xe50f('0x2a')]);if(_0x5e9d55[_0xe50f('0x2b')]){delete _0x5e9d55['name'];}_0x51e8bd['status'](_0xaf5a8a)[_0xe50f('0x2c')](_0x5e9d55);};}function getInteractionUsers(_0x1dab5a,_0x24d2c9){return new BPromise(function(_0x2abbb6,_0x19b405){try{if(_0x24d2c9[_0x1dab5a['id']]){_0x1dab5a['Users']=_[_0xe50f('0x2d')](_0x24d2c9[_0x1dab5a['id']],function(_0x1c174c){return{'id':_0x1c174c['id'],'fullname':_0x1c174c[_0xe50f('0x2e')]};});}}catch(_0x2a9256){_0x19b405(_0x2a9256);}_0x2abbb6(_0x1dab5a);});}function getInteractionTags(_0x4a63a6,_0x2377c4){return new BPromise(function(_0x37c7bd,_0x1ee246){try{if(_0x4a63a6[_0xe50f('0x2f')]){_0x4a63a6[_0xe50f('0x30')]=[];_0x4a63a6[_0xe50f('0x2f')][_0xe50f('0x31')](',')['forEach'](function(_0x49a3f3){_0x4a63a6[_0xe50f('0x30')][_0xe50f('0x32')](_0x2377c4[_0x49a3f3]);});}delete _0x4a63a6['TagIds'];}catch(_0x268d61){_0x1ee246(_0x268d61);}_0x37c7bd(_0x4a63a6);});}function updateOpenchannelInteraction(_0x1133c9,_0x437d0d,_0x496d4c){return new BPromise(function(_0x3cf8e1,_0x4a8c04){return getInteractionUsers(_0x1133c9,_0x496d4c)[_0xe50f('0x27')](function(_0x25b98e){return getInteractionTags(_0x25b98e,_0x437d0d);})['then'](function(_0x32cab2){_0x3cf8e1(_0x32cab2);})[_0xe50f('0x33')](function(_0x223abc){_0x4a8c04(_0x223abc);});});}exports[_0xe50f('0x34')]=function(_0x9d4d7b,_0x46eca3){var _0x24d316={},_0x41c975={},_0x5d00e3={'count':0x0,'rows':[]};var _0x4f50a3=_[_0xe50f('0x2d')](db[_0xe50f('0x35')][_0xe50f('0x36')],function(_0x55b7e9){return{'name':_0x55b7e9['fieldName'],'type':_0x55b7e9[_0xe50f('0x37')][_0xe50f('0x38')]};});_0x41c975[_0xe50f('0x39')]=_[_0xe50f('0x2d')](_0x4f50a3,'name');_0x41c975[_0xe50f('0x3a')]=_['keys'](_0x9d4d7b[_0xe50f('0x3a')]);_0x41c975[_0xe50f('0x3b')]=_[_0xe50f('0x3c')](_0x41c975['model'],_0x41c975[_0xe50f('0x3a')]);_0x24d316[_0xe50f('0x3d')]=_['intersection'](_0x41c975['model'],qs['fields'](_0x9d4d7b[_0xe50f('0x3a')][_0xe50f('0x3e')]));_0x24d316[_0xe50f('0x3d')]=_0x24d316[_0xe50f('0x3d')][_0xe50f('0x3f')]?_0x24d316[_0xe50f('0x3d')]:_0x41c975[_0xe50f('0x39')];if(!_0x9d4d7b[_0xe50f('0x3a')][_0xe50f('0x40')](_0xe50f('0x41'))){_0x24d316[_0xe50f('0x42')]=qs[_0xe50f('0x42')](_0x9d4d7b[_0xe50f('0x3a')][_0xe50f('0x42')]);_0x24d316[_0xe50f('0x22')]=qs[_0xe50f('0x22')](_0x9d4d7b[_0xe50f('0x3a')][_0xe50f('0x22')]);}_0x24d316[_0xe50f('0x43')]=qs['sort'](_0x9d4d7b[_0xe50f('0x3a')][_0xe50f('0x44')]);_0x24d316[_0xe50f('0x45')]=qs[_0xe50f('0x3b')](_[_0xe50f('0x46')](_0x9d4d7b[_0xe50f('0x3a')],_0x41c975[_0xe50f('0x3b')]),_0x4f50a3);var _0x5e4790=[];var _0x4b4013=squel[_0xe50f('0x47')]()[_0xe50f('0x48')]('id')[_0xe50f('0x48')](_0xe50f('0x2b'))[_0xe50f('0x48')](_0xe50f('0x49'))['from']('tools_tags');var _0x1c2295=squel[_0xe50f('0x47')]()[_0xe50f('0x48')](_0xe50f('0x4a'))['field'](_0xe50f('0x4b'))[_0xe50f('0x48')](_0xe50f('0x4c'))[_0xe50f('0x4d')]('user_has_openchannel_interactions','ui')[_0xe50f('0x4e')](_0xe50f('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0x15cf35=squel[_0xe50f('0x47')]()[_0xe50f('0x4d')]('openchannel_interactions','i')[_0xe50f('0x4e')](_0xe50f('0x50'),'c',_0xe50f('0x51'))[_0xe50f('0x4e')]('users','o',_0xe50f('0x52'))[_0xe50f('0x4e')]('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')[_0xe50f('0x4e')](_0xe50f('0x53'),'me',_0xe50f('0x54'))[_0xe50f('0x4e')](_0xe50f('0x55'),'it',_0xe50f('0x56'))[_0xe50f('0x4e')](_0xe50f('0x57'),'t',_0xe50f('0x58'));var _0x10d600=squel['expr']();var _0x1511f3=[];var _0x5d6622=squel[_0xe50f('0x59')]();var _0x5a10dd;if(_0x9d4d7b[_0xe50f('0x3a')][_0xe50f('0x5a')]){_0x5a10dd=as[_0xe50f('0x5b')](_0x9d4d7b['query']['search']);var _0xf998b8=_0x5a10dd['sqlOperator'];for(var _0x4f7f33=0x0;_0x4f7f33<_0x5a10dd[_0xe50f('0x5c')][_0xe50f('0x3f')];_0x4f7f33++){var _0x45aa96=_0x5a10dd[_0xe50f('0x5c')][_0x4f7f33];var _0x22c20e='i';var _0x3e4555=_[_0xe50f('0x5d')](_0x4f50a3,[_0xe50f('0x2b'),_0x45aa96[_0xe50f('0x48')]]);if(!_0x3e4555){switch(_0x45aa96[_0xe50f('0x48')]){case _0xe50f('0x5e'):if(_0x45aa96[_0xe50f('0x5f')]==0x1){_0x15cf35['having']('`'+_0x45aa96['field']+_0xe50f('0x60'));}else{_0x15cf35[_0xe50f('0x61')]('`'+_0x45aa96[_0xe50f('0x48')]+'`\x20>\x200');}break;case'Contact':if(_0x45aa96['operator']===_0xe50f('0x62')){if(_0x45aa96[_0xe50f('0x5f')]['split']('\x20')['length']>0x1){_0x10d600[_0xf998b8](_0xe50f('0x63'),qs['getFullTextValue'](_0x45aa96[_0xe50f('0x5f')]),null);}else{var _0x2320a9='%'+_0x45aa96[_0xe50f('0x5f')]+'%';_0x10d600[_0xf998b8]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2320a9,_0x2320a9,_0x2320a9);}}else{_0x3e4555=_[_0xe50f('0x5d')](_0x4f50a3,[_0xe50f('0x2b'),_0xe50f('0x64')]);_0x45aa96[_0xe50f('0x48')]=_0xe50f('0x64');_0x1fbe79=as[_0xe50f('0x65')](_0x22c20e,_0x3e4555[_0xe50f('0x37')],_0x45aa96);_0x10d600[_0xf998b8](_0x1fbe79[_0xe50f('0x66')],_0x1fbe79['value']['start'],_0x1fbe79[_0xe50f('0x5f')][_0xe50f('0x1f')]);}break;case _0xe50f('0x67'):var _0x14b59c=_0x45aa96[_0xe50f('0x5f')][_0xe50f('0x31')](',')['map'](function(_0x58e017){return Number(_0x58e017);});_0x14b59c[_0xe50f('0x68')](function(_0x4ddbc5){_0x5d6622['or'](_0xe50f('0x69'),'%,'+_0x4ddbc5+',%');});_0x1511f3=_[_0xe50f('0x6a')](_0x1511f3,_0x14b59c);break;case _0xe50f('0x6b'):if(_0x45aa96[_0xe50f('0x6c')]==='$substring'){_0x10d600[_0xf998b8](_0xe50f('0x6d'),'%'+_0x45aa96[_0xe50f('0x5f')]+'%',null);}else{_0x3e4555=_[_0xe50f('0x5d')](_0x4f50a3,[_0xe50f('0x2b'),_0xe50f('0x6e')]);_0x45aa96['field']='UserId';_0x1fbe79=as['buildExpression'](_0x22c20e,_0x3e4555[_0xe50f('0x37')],_0x45aa96);_0x10d600[_0xf998b8](_0x1fbe79[_0xe50f('0x66')],_0x1fbe79['value'][_0xe50f('0x6f')],_0x1fbe79[_0xe50f('0x5f')][_0xe50f('0x1f')]);}break;case _0xe50f('0x70'):_0x1fbe79=as[_0xe50f('0x65')]('me',null,_0x45aa96);_0x10d600[_0xf998b8](_0x1fbe79[_0xe50f('0x66')],_0x1fbe79['value'][_0xe50f('0x6f')],_0x1fbe79[_0xe50f('0x5f')][_0xe50f('0x1f')]);break;}}else{var _0x1fbe79=as[_0xe50f('0x65')](_0x22c20e,_0x3e4555[_0xe50f('0x37')],_0x45aa96);_0x10d600[_0xf998b8](_0x1fbe79['text'],_0x1fbe79['value'][_0xe50f('0x6f')],_0x1fbe79[_0xe50f('0x5f')][_0xe50f('0x1f')]);}}}else{var _0x43160f=_(_0x9d4d7b[_0xe50f('0x3a')])[_0xe50f('0x71')]()[_0xe50f('0x2d')](function(_0xbf4289){return _['some'](_0x4f50a3,[_0xe50f('0x2b'),_0xbf4289])?_0xbf4289:undefined;})[_0xe50f('0x72')]()[_0xe50f('0x5f')]();if(!_['isEmpty'](_0x43160f)){_0x43160f['forEach'](function(_0x4a7274){if(_0x4a7274===_0xe50f('0x73')){_0x15cf35[_0xe50f('0x45')](_0xe50f('0x74'),[][_0xe50f('0x75')](_0x9d4d7b[_0xe50f('0x3a')][_0x4a7274]));}else if(_0x4a7274===_0xe50f('0x76')){var _0x53a0af=JSON['parse'](_0x9d4d7b[_0xe50f('0x3a')][_0x4a7274])[_0xe50f('0x77')];var _0x11cc8b=JSON['parse'](_0x9d4d7b['query'][_0x4a7274])[_0xe50f('0x78')];_0x15cf35['where'](_0xe50f('0x79'),_0x53a0af,_0x11cc8b);}else{if(_0x9d4d7b['query'][_0x4a7274]==='null'){_0x15cf35[_0xe50f('0x45')]('i.'+_0x4a7274+_0xe50f('0x7a'));}else{_0x15cf35['where']('i.'+_0x4a7274+'\x20=\x20?',_0x9d4d7b[_0xe50f('0x3a')][_0x4a7274]);}}});}if(_0x9d4d7b[_0xe50f('0x3a')][_0xe50f('0x7b')]){if(_0x9d4d7b[_0xe50f('0x3a')]['read']==0x1){_0x15cf35['having'](_0xe50f('0x7c'));}else{_0x15cf35[_0xe50f('0x61')]('`unreadMessages`\x20>\x200');}}if(_0x9d4d7b[_0xe50f('0x3a')][_0xe50f('0x7d')]){_0x1511f3=_['isArray'](_0x9d4d7b[_0xe50f('0x3a')][_0xe50f('0x7d')])?_0x9d4d7b[_0xe50f('0x3a')][_0xe50f('0x7d')]:new Array(_0x9d4d7b['query'][_0xe50f('0x7d')]);_0x1511f3['forEach'](function(_0x54d9c5){_0x5d6622['or'](_0xe50f('0x69'),'%,'+_0x54d9c5+',%');});}if(_0x9d4d7b[_0xe50f('0x3a')][_0xe50f('0x7e')]){var _0x9030c6=_0x9d4d7b[_0xe50f('0x3a')][_0xe50f('0x7e')][_0xe50f('0x7f')]('\x5c','\x5c\x5c')[_0xe50f('0x7f')]('\x27\x27',_0xe50f('0x80'));if(qs[_0xe50f('0x81')](_0x9030c6)){_0x10d600['or'](_0xe50f('0x82'),_0x9030c6+'%');}else{_0x10d600['or'](_0xe50f('0x83'),qs[_0xe50f('0x84')](_0x9030c6))['or'](_0xe50f('0x85'),_0x9030c6+'%')['or'](_0xe50f('0x86'),_0x9030c6+'%');}}}_0x15cf35['where'](_0x10d600);_0x15cf35[_0xe50f('0x87')](_0xe50f('0x88'));var _0x9d36a1={'type':db[_0xe50f('0x89')][_0xe50f('0x8a')][_0xe50f('0x8b')],'raw':!![]};var _0x58bec1=_0x15cf35['clone']();_0x58bec1['field'](_0xe50f('0x88'));_0x58bec1[_0xe50f('0x48')](_0xe50f('0x8c'),_0xe50f('0x5e'));if(_0x24d316[_0xe50f('0x43')]){_0x24d316[_0xe50f('0x43')]['forEach'](function(_0x313e58){_0x15cf35[_0xe50f('0x43')]('i.'+_0x313e58[0x0],_0x313e58[0x1]===_0xe50f('0x8d')?![]:!![]);});}if(!_['isEmpty'](_0x1511f3)){_0x15cf35['having'](_0x5d6622);_0x58bec1['where']('t.id\x20IN\x20?',_0x1511f3);}BPromise[_0xe50f('0x8e')]()[_0xe50f('0x27')](function(){if(!_0x5a10dd){if(_0x9d4d7b[_0xe50f('0x3a')]['OpenchannelAccountId']||_0x9d4d7b[_0xe50f('0x3a')]['journey'])return;_0x58bec1[_0xe50f('0x45')](_0xe50f('0x8f'));_0x15cf35['where'](_0xe50f('0x8f'));return;}return _0x9d4d7b[_0xe50f('0x90')][_0xe50f('0x91')]({'attributes':['id'],'raw':!![]})[_0xe50f('0x27')](function(_0x44ba99){if(_[_0xe50f('0x92')](_0x44ba99)){_0x58bec1[_0xe50f('0x45')](_0xe50f('0x93'));_0x15cf35[_0xe50f('0x45')](_0xe50f('0x93'));}else{_0x58bec1[_0xe50f('0x45')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xe50f('0x2d')](_0x44ba99,'id'));_0x15cf35[_0xe50f('0x45')](_0xe50f('0x74'),_[_0xe50f('0x2d')](_0x44ba99,'id'));}});})[_0xe50f('0x27')](function(){db[_0xe50f('0x94')]['query'](_0x58bec1['toString'](),_0x9d36a1)['then'](function(_0x835489){_0x5d00e3[_0xe50f('0x95')]=_0x835489[_0xe50f('0x3f')];if(_0x5d00e3[_0xe50f('0x95')]===0x0)return[];return db['sequelize'][_0xe50f('0x3a')](_0x4b4013['toString'](),_0x9d36a1)[_0xe50f('0x27')](function(_0xf820e){_0x5e4790=_[_0xe50f('0x96')](_0xf820e,'id');_0x9d36a1=_[_0xe50f('0x97')](_0x9d36a1,{'model':db[_0xe50f('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x9d4d7b[_0xe50f('0x3a')][_0xe50f('0x3e')]){_0x24d316[_0xe50f('0x3d')]['forEach'](function(_0x38ff89){_0x15cf35[_0xe50f('0x48')]('i.'+_0x38ff89);});}else{_0x15cf35[_0xe50f('0x48')](_0xe50f('0x8c'),_0xe50f('0x5e'));_0x15cf35[_0xe50f('0x48')]('a.key',_0xe50f('0x98'));_0x15cf35[_0xe50f('0x48')](_0xe50f('0x99'),_0xe50f('0x9a'));_0x15cf35[_0xe50f('0x48')]('i.*');_0x15cf35[_0xe50f('0x48')]('c.firstName',_0xe50f('0x9b'));_0x15cf35[_0xe50f('0x48')]('c.lastName',_0xe50f('0x9c'));_0x15cf35[_0xe50f('0x48')]('c.email',_0xe50f('0x9d'));_0x15cf35[_0xe50f('0x48')](_0xe50f('0x9e'),_0xe50f('0x9f'));_0x15cf35[_0xe50f('0x48')](_0xe50f('0xa0'),_0xe50f('0xa1'));_0x15cf35[_0xe50f('0x48')](_0xe50f('0xa2'),_0xe50f('0xa3'));_0x15cf35[_0xe50f('0x48')](_0xe50f('0xa4'),'Owner.fullname');_0x15cf35[_0xe50f('0x48')]('o.internal',_0xe50f('0xa5'));_0x15cf35[_0xe50f('0x48')](_0xe50f('0xa6'),_0xe50f('0x2f'));}if(_0x24d316[_0xe50f('0x42')])_0x15cf35['limit'](_0x24d316[_0xe50f('0x42')]);if(_0x24d316[_0xe50f('0x22')])_0x15cf35['offset'](_0x24d316[_0xe50f('0x22')]);return db[_0xe50f('0x94')][_0xe50f('0x3a')](_0x15cf35[_0xe50f('0xa7')](),_0x9d36a1);})[_0xe50f('0x27')](function(_0x2cf492){_0x1c2295[_0xe50f('0x45')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0xe50f('0x2d')](_0x2cf492,'id'));return db['sequelize']['query'](_0x1c2295[_0xe50f('0xa7')](),_0x9d36a1)['then'](function(_0x951d03){var _0x9ad54=_['groupBy'](_0x951d03,_0xe50f('0xa8'));var _0x260af1=[];_0x2cf492[_0xe50f('0x68')](function(_0x1fc345){_0x260af1[_0xe50f('0x32')](updateOpenchannelInteraction(_0x1fc345,_0x5e4790,_0x9ad54));});return BPromise[_0xe50f('0xa9')](_0x260af1);});});})[_0xe50f('0x27')](function(_0x403053){_0x5d00e3[_0xe50f('0xaa')]=_0x403053;return _0x5d00e3;})[_0xe50f('0x27')](respondWithFilteredResult(_0x46eca3,_0x24d316));})[_0xe50f('0x33')](handleError(_0x46eca3,null));};exports[_0xe50f('0xab')]=function(_0x182c96,_0x228cba){var _0x5c2fb6={'raw':![],'where':{'id':_0x182c96[_0xe50f('0xac')]['id']}},_0x1977b={};_0x1977b['model']=_[_0xe50f('0x71')](db['OpenchannelInteraction']['rawAttributes']);_0x1977b[_0xe50f('0x3a')]=_[_0xe50f('0x71')](_0x182c96[_0xe50f('0x3a')]);_0x1977b[_0xe50f('0x3b')]=_['intersection'](_0x1977b[_0xe50f('0x39')],_0x1977b[_0xe50f('0x3a')]);_0x5c2fb6[_0xe50f('0x3d')]=_[_0xe50f('0x3c')](_0x1977b[_0xe50f('0x39')],qs[_0xe50f('0x3e')](_0x182c96[_0xe50f('0x3a')][_0xe50f('0x3e')]));_0x5c2fb6[_0xe50f('0x3d')]=_0x5c2fb6['attributes']['length']?_0x5c2fb6[_0xe50f('0x3d')]:_0x1977b[_0xe50f('0x39')];if(_0x182c96[_0xe50f('0x3a')][_0xe50f('0xad')]){_0x5c2fb6[_0xe50f('0xae')]=[{'all':!![]}];}_0x5c2fb6=_[_0xe50f('0x97')]({},_0x5c2fb6,_0x182c96[_0xe50f('0xaf')]);return db[_0xe50f('0x35')][_0xe50f('0x5d')](_0x5c2fb6)[_0xe50f('0x27')](handleEntityNotFound(_0x228cba,null))[_0xe50f('0x27')](respondWithResult(_0x228cba,null))[_0xe50f('0x33')](handleError(_0x228cba,null));};exports['create']=function(_0x17c8ca,_0x1f7e6b){return db[_0xe50f('0x35')][_0xe50f('0xb0')](_0x17c8ca['body'],{})[_0xe50f('0x27')](respondWithResult(_0x1f7e6b,0xc9))[_0xe50f('0x33')](handleError(_0x1f7e6b,null));};exports[_0xe50f('0x26')]=function(_0x4b9101,_0x3ee54c){if(_0x4b9101[_0xe50f('0x70')]['id']){delete _0x4b9101[_0xe50f('0x70')]['id'];}return db[_0xe50f('0x35')][_0xe50f('0x5d')]({'where':{'id':_0x4b9101[_0xe50f('0xac')]['id']}})[_0xe50f('0x27')](handleEntityNotFound(_0x3ee54c,null))[_0xe50f('0x27')](saveUpdates(_0x4b9101[_0xe50f('0x70')],null))[_0xe50f('0x27')](respondWithResult(_0x3ee54c,null))[_0xe50f('0x33')](handleError(_0x3ee54c,null));};exports['destroy']=function(_0x2a6ff8,_0x441cca){return db[_0xe50f('0x35')][_0xe50f('0x5d')]({'where':{'id':_0x2a6ff8[_0xe50f('0xac')]['id']}})[_0xe50f('0x27')](handleEntityNotFound(_0x441cca,null))['then'](removeEntity(_0x441cca,null))[_0xe50f('0x33')](handleError(_0x441cca,null));};exports[_0xe50f('0xb1')]=function(_0x3b9141,_0x389c31){return db[_0xe50f('0x35')][_0xe50f('0xb1')]()[_0xe50f('0x27')](respondWithResult(_0x389c31,null))[_0xe50f('0x33')](handleError(_0x389c31,null));};exports['addMessage']=function(_0xc1b16a,_0x2d9717,_0x2642d1){return db[_0xe50f('0xb2')][_0xe50f('0x5d')]({'where':{'id':_0xc1b16a[_0xe50f('0xac')]['id']}})['then'](handleEntityNotFound(_0x2d9717,null))[_0xe50f('0x27')](function(_0x1249da){if(_0x1249da){return _0x1249da['addMessage'](_0xc1b16a[_0xe50f('0x70')]['ids'],_['omit'](_0xc1b16a['body'],[_0xe50f('0xb3'),'id'])||{});}})[_0xe50f('0x27')](respondWithResult(_0x2d9717,null))[_0xe50f('0x33')](handleError(_0x2d9717,null));};exports[_0xe50f('0xb4')]=function(_0x21737d,_0x33baee,_0x38b837){var _0x12cd0d={'raw':![],'where':{}};var _0x56dacf={};var _0x26c397={'count':0x0,'rows':[]};return db[_0xe50f('0x35')][_0xe50f('0xb5')]({'where':{'id':_0x21737d['params']['id']}})[_0xe50f('0x27')](handleEntityNotFound(_0x33baee,null))[_0xe50f('0x27')](function(_0x48ca38){if(_0x48ca38){_0x56dacf[_0xe50f('0x39')]=_[_0xe50f('0x71')](db[_0xe50f('0xb2')][_0xe50f('0x36')]);_0x56dacf[_0xe50f('0x3a')]=_['keys'](_0x21737d[_0xe50f('0x3a')]);_0x56dacf['filters']=_['intersection'](_0x56dacf[_0xe50f('0x39')],_0x56dacf['query']);_0x12cd0d[_0xe50f('0x3d')]=_[_0xe50f('0x3c')](_0x56dacf['model'],qs['fields'](_0x21737d[_0xe50f('0x3a')][_0xe50f('0x3e')]));_0x12cd0d[_0xe50f('0x3d')]=_0x12cd0d[_0xe50f('0x3d')]['length']?_0x12cd0d[_0xe50f('0x3d')]:_0x56dacf[_0xe50f('0x39')];if(!_0x21737d[_0xe50f('0x3a')][_0xe50f('0x40')](_0xe50f('0x41'))){_0x12cd0d[_0xe50f('0x42')]=qs[_0xe50f('0x42')](_0x21737d[_0xe50f('0x3a')][_0xe50f('0x42')]);_0x12cd0d['offset']=qs[_0xe50f('0x22')](_0x21737d[_0xe50f('0x3a')][_0xe50f('0x22')]);}_0x12cd0d['order']=qs[_0xe50f('0x44')](_0x21737d[_0xe50f('0x3a')][_0xe50f('0x44')]);_0x12cd0d[_0xe50f('0x45')]=qs[_0xe50f('0x3b')](_['pick'](_0x21737d[_0xe50f('0x3a')],_0x56dacf[_0xe50f('0x3b')]));_0x12cd0d[_0xe50f('0x45')]['OpenchannelInteractionId']=_0x48ca38['id'];if(_0x21737d[_0xe50f('0x3a')][_0xe50f('0x7e')]){_0x12cd0d[_0xe50f('0x45')]=_[_0xe50f('0x97')](_0x12cd0d['where'],{'$or':_[_0xe50f('0x2d')](_0x12cd0d[_0xe50f('0x3d')],function(_0x21a419){var _0x5b483c={};_0x5b483c[_0x21a419]={'$like':'%'+_0x21737d['query'][_0xe50f('0x7e')]+'%'};return _0x5b483c;})});}if(_0x21737d[_0xe50f('0x3a')][_0xe50f('0x77')]){var _0x3d7763=_0x21737d['query']['$gte'][_0xe50f('0x31')](',');var _0x205c05={};_0x205c05[_0x3d7763[0x0]]={'$gte':moment(_0x3d7763[0x1])[_0xe50f('0xb6')]('YYYY-MM-DD\x20HH:mm:ss')};_0x12cd0d[_0xe50f('0x45')]=_[_0xe50f('0x97')](_0x12cd0d[_0xe50f('0x45')],_0x205c05);}_0x12cd0d=_[_0xe50f('0x97')]({},_0x12cd0d,_0x21737d['options']);return db[_0xe50f('0xb2')]['count']({'where':_0x12cd0d[_0xe50f('0x45')]})['then'](function(_0x1d9527){_0x26c397[_0xe50f('0x95')]=_0x1d9527;if(_0x21737d[_0xe50f('0x3a')][_0xe50f('0xad')]){_0x12cd0d[_0xe50f('0xae')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xe50f('0xb7')](_0x12cd0d);})[_0xe50f('0x27')](function(_0x1a3356){_0x26c397[_0xe50f('0xaa')]=_0x1a3356;return _0x26c397;});}})['then'](respondWithFilteredResult(_0x33baee,_0x12cd0d))[_0xe50f('0x33')](handleError(_0x33baee,null));};exports[_0xe50f('0xb8')]=function(_0x17b1e7,_0x51e33c,_0x51db5c){return db[_0xe50f('0x35')][_0xe50f('0x5d')]({'where':{'id':_0x17b1e7[_0xe50f('0xac')]['id']}})[_0xe50f('0x27')](handleEntityNotFound(_0x51e33c,null))[_0xe50f('0x27')](function(_0x14104a){if(_0x14104a){return _0x14104a['setTags'](_0x17b1e7['body'][_0xe50f('0xb3')],_[_0xe50f('0xb9')](_0x17b1e7['body'],[_0xe50f('0xb3'),'id'])||{})[_0xe50f('0xba')](function(){return db['Tag'][_0xe50f('0xb7')]({'attributes':['id',_0xe50f('0x2b'),_0xe50f('0x49')],'where':{'id':_0x17b1e7[_0xe50f('0x70')][_0xe50f('0xb3')]}});})[_0xe50f('0x27')](function(_0xfe9635){socket[_0xe50f('0xbb')](_0xe50f('0xbc'),{'id':Number(_0x17b1e7[_0xe50f('0xac')]['id']),'tags':_0xfe9635||[]});return{'id':Number(_0x17b1e7[_0xe50f('0xac')]['id']),'tags':_0xfe9635||[]};});}})[_0xe50f('0x27')](respondWithResult(_0x51e33c,null))[_0xe50f('0x33')](handleError(_0x51e33c,null));};exports[_0xe50f('0xbd')]=function(_0x268751,_0x3806ca,_0x2340b1){return db[_0xe50f('0x35')][_0xe50f('0x5d')]({'where':{'id':_0x268751['params']['id']}})[_0xe50f('0x27')](handleEntityNotFound(_0x3806ca,null))[_0xe50f('0x27')](function(_0x490776){if(_0x490776){return _0x490776[_0xe50f('0xbd')](_0x268751[_0xe50f('0x3a')][_0xe50f('0xb3')]);}})[_0xe50f('0x27')](respondWithStatusCode(_0x3806ca,null))[_0xe50f('0x33')](handleError(_0x3806ca,null));};exports[_0xe50f('0xbe')]=function(_0x606f4e,_0xaadef8){var _0x44feec=moment()[_0xe50f('0xbf')]()[_0xe50f('0xa7')]();var _0x36fd48=path[_0xe50f('0xc0')](config[_0xe50f('0xc1')],_0xe50f('0xc2'),_0xe50f('0xc3'),_0xe50f('0xc4'));var _0x1af225=path[_0xe50f('0xc0')](config[_0xe50f('0xc1')],_0xe50f('0xc2'),_0xe50f('0xc3'),_0xe50f('0xc5'));var _0x3cafa3=path[_0xe50f('0xc0')](_0x36fd48,_0x44feec);var _0xca77b4=util[_0xe50f('0xb6')]('transcript-%d-%s.zip',_0x606f4e[_0xe50f('0xac')]['id'],_0x44feec);var _0x17788c=path[_0xe50f('0xc0')](_0x36fd48,_0xca77b4);var _0x211a91=[];_0x211a91[_0xe50f('0x32')]({'model':db[_0xe50f('0x6b')],'as':_0xe50f('0x6b'),'attributes':['id','fullname'],'raw':!![]});_0x211a91['push']({'model':db[_0xe50f('0xc6')],'as':_0xe50f('0xc7'),'attributes':['id','firstName',_0xe50f('0xc8')],'raw':!![]});if(_0x606f4e['query']['attachments']){_0x211a91['push']({'model':db[_0xe50f('0xc9')],'as':_0xe50f('0xc9'),'raw':!![]});}var _0x35ae25=[{'model':db[_0xe50f('0xb2')],'as':_0xe50f('0xca'),'attributes':['id',_0xe50f('0x70'),_0xe50f('0x76'),_0xe50f('0xcb'),_0xe50f('0xcc'),_0xe50f('0x7b')],'include':_0x211a91}];_0x35ae25[_0xe50f('0x32')]({'model':db[_0xe50f('0xcd')],'as':'Account','attributes':['id','name']});_0x35ae25['push']({'model':db[_0xe50f('0x6b')],'as':'Owner','attributes':['id',_0xe50f('0x2e')]});return db['OpenchannelInteraction'][_0xe50f('0x5d')]({'where':{'id':_0x606f4e[_0xe50f('0xac')]['id']},'include':_0x35ae25})[_0xe50f('0x27')](handleEntityNotFound(_0xaadef8,null))['then'](function(_0x1ef358){if(_0x1ef358){var _0x5f4be1=_0x1ef358[_0xe50f('0xce')]({'plain':!![]});fs[_0xe50f('0xcf')](_0x3cafa3);var _0x37d4dd={'format':'A4','border':_0xe50f('0xd0'),'header':{'height':_0xe50f('0xd1'),'contents':{'first':'\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'}},'footer':{'height':'30px','contents':{'default':util[_0xe50f('0xb6')](' \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[_0xe50f('0xb6')]('%s\x20#%d',_0xe50f('0xd2'),_0x5f4be1['id']),moment()[_0xe50f('0xb6')](_0xe50f('0xd3'))[_0xe50f('0xa7')]())}}};var _0x8b6e24={'channel':_0xe50f('0xd2'),'account':_0x5f4be1[_0xe50f('0xd4')][_0xe50f('0x2b')],'agent':_0x5f4be1[_0xe50f('0xd5')]?_0x5f4be1['Owner'][_0xe50f('0x2e')]:_0xe50f('0xd6'),'createdAt':moment(_0x5f4be1['createdAt'])[_0xe50f('0xb6')](_0xe50f('0xd7'))[_0xe50f('0xa7')](),'closedAt':_0x5f4be1[_0xe50f('0xd8')]?moment(_0x5f4be1['closedAt'])[_0xe50f('0xb6')](_0xe50f('0xd7'))[_0xe50f('0xa7')]():'','disposition':_0x5f4be1[_0xe50f('0xd9')],'visibility':_0x5f4be1[_0xe50f('0xda')]?_0xe50f('0xdb'):'Private','messages':_(_0x5f4be1['Messages'])[_0xe50f('0x7e')]({'secret':![]})[_0xe50f('0x2d')](function(_0x400799){if(_0x400799['Attachment']){var _0x355be6=path[_0xe50f('0xc0')](_0x1af225,_0x400799[_0xe50f('0xc9')][_0xe50f('0xdc')]);if(fs['existsSync'](_0x355be6)){fs[_0xe50f('0xdd')](_0x355be6)[_0xe50f('0xde')](fs[_0xe50f('0xdf')](path['join'](_0x3cafa3,_0x400799[_0xe50f('0xc9')][_0xe50f('0xdc')])));}}return{'date':moment(_0x400799['createdAt'])[_0xe50f('0xb6')](_0xe50f('0xd7'))[_0xe50f('0xa7')](),'sender':_0x400799['direction']==='out'?_0x400799[_0xe50f('0x6b')]?_0x400799['User'][_0xe50f('0x2e')]:_0xe50f('0xe0'):_0x400799[_0xe50f('0xc7')][_0xe50f('0xe1')]+(_0x400799['Contact']['lastName']?'\x20'+_0x400799[_0xe50f('0xc7')]['lastName']:''),'body':_0x400799['Attachment']?_0x400799['Attachment'][_0xe50f('0xdc')]:_0x400799[_0xe50f('0x70')],'direction':_0x400799[_0xe50f('0xcb')]==='out'?'A':'C','secret':_0x400799['secret'],'read':_0x400799[_0xe50f('0x7b')],'attachment':_0x400799[_0xe50f('0xc9')]};})[_0xe50f('0x5f')]()};return ejs['renderFile'](path[_0xe50f('0xc0')](config[_0xe50f('0xc1')],'server',_0xe50f('0xe2'),_0xe50f('0xe3')),{'interaction':_0x8b6e24})['then'](function(_0x5d8759){return new BPromise(function(_0x11cae6,_0x16a347){pdf[_0xe50f('0xb0')](_0x5d8759,_0x37d4dd)[_0xe50f('0xe4')](path[_0xe50f('0xc0')](_0x3cafa3,_0xe50f('0xe5')+_0x5f4be1['id']+'-'+_0x44feec+'.pdf'),function(_0x4c3c55,_0x33ce65){if(_0x4c3c55)return _0x16a347(_0x4c3c55);_0x11cae6(_0x33ce65);});});})[_0xe50f('0x27')](function(){return new BPromise(function(_0x2d08ea,_0x52641a){zipdir(_0x3cafa3,{'saveTo':_0x17788c},function(_0x4cf1de,_0x318ee2){if(_0x4cf1de)return _0x52641a(_0x4cf1de);return _0x2d08ea(_0x318ee2);});})[_0xe50f('0x27')](function(){return new BPromise(function(_0x452808,_0x2b0d00){rimraf(_0x3cafa3,function(_0x5b2f68){if(_0x5b2f68)_0x2b0d00(_0x5b2f68);return _0x452808();});});})['then'](function(){return _0xaadef8[_0xe50f('0xbe')](_0x17788c,_0xca77b4,function(_0x3029a8){if(_0x3029a8){console[_0xe50f('0xe6')](_0xe50f('0xe7'),_0x3029a8);}else{fs[_0xe50f('0xe8')](_0x17788c);}});});});}else{return _0xaadef8['sendStatus'](0xc8);}})[_0xe50f('0x33')](handleError(_0xaadef8,null));};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js
index 25f828c..66c5450 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 _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
+var _0x01e2=['OpenchannelInteraction','OpenchannelMessage','setMaxListeners','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x5c548a,_0x4c9331){var _0x4bb4f7=function(_0x3657d9){while(--_0x3657d9){_0x5c548a['push'](_0x5c548a['shift']());}};_0x4bb4f7(++_0x4c9331);}(_0x01e2,0x120));var _0x201e=function(_0x58d9a1,_0x46312c){_0x58d9a1=_0x58d9a1-0x0;var _0x5dbcf3=_0x01e2[_0x58d9a1];return _0x5dbcf3;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db'][_0x201e('0x0')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x201e('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x201e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x201e('0x3')};function emitEvent(_0xc44a96){return function(_0x3e9162,_0x28c0d6,_0x335df5){_0x3e9162[_0x201e('0x4')]({'attributes':['id'],'raw':!![]})[_0x201e('0x5')](function(_0x196d04){_0x3e9162[_0x201e('0x6')](_0x201e('0x7'),_0x196d04[_0x201e('0x8')](function(_0x292468){return{'id':_0x292468['id']};}));return OpenchannelMessage[_0x201e('0x9')]({'where':{'OpenchannelInteractionId':_0x3e9162['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2374ed){_0x3e9162[_0x201e('0x6')]('unreadMessages',_0x2374ed[_0x201e('0xa')]);OpenchannelInteractionEvents['emit'](_0xc44a96+':'+_0x3e9162['id'],_0x3e9162);OpenchannelInteractionEvents[_0x201e('0xb')](_0xc44a96,_0x3e9162);_0x335df5(null);})[_0x201e('0xc')](_0x335df5(null));};}for(var e in events){if(events[_0x201e('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x201e('0xe')](e,emitEvent(event));}}module[_0x201e('0xf')]=OpenchannelInteractionEvents;
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js
index f38d8fe..0e4a17d 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 _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
+var _0xf7a4=['OpenchannelInteraction','openchannel_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./openchannelInteraction.attributes','exports','define'];(function(_0x3a6239,_0x45d7e8){var _0x43542d=function(_0x1f5fd2){while(--_0x1f5fd2){_0x3a6239['push'](_0x3a6239['shift']());}};_0x43542d(++_0x45d7e8);}(_0xf7a4,0x195));var _0x4f7a=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xf7a4[_0x20ef64];return _0x3707d8;};'use strict';var _=require(_0x4f7a('0x0'));var util=require(_0x4f7a('0x1'));var logger=require(_0x4f7a('0x2'))(_0x4f7a('0x3'));var moment=require(_0x4f7a('0x4'));var BPromise=require('bluebird');var rp=require(_0x4f7a('0x5'));var fs=require('fs');var path=require(_0x4f7a('0x6'));var rimraf=require(_0x4f7a('0x7'));var config=require('../../config/environment');var attributes=require(_0x4f7a('0x8'));module[_0x4f7a('0x9')]=function(_0x23699f,_0x20ad50){return _0x23699f[_0x4f7a('0xa')](_0x4f7a('0xb'),attributes,{'tableName':_0x4f7a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4bc132,_0xd4b3dd,_0x4b9fb2){if(_0x4bc132[_0x4f7a('0xd')](_0x4f7a('0xe'))){_0x4bc132['closedAt']=moment()['format'](_0x4f7a('0xf'));}_0x4b9fb2(null,_0x4bc132);}}});};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js
index 5b5c4c2..f32ddc9 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 _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
+var _0xfb37=['UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','limit','debug','AddTagsToOpenchannelInteraction','find','addTags','omit','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4a6462,_0x61b1b5){var _0x122407=function(_0x42618b){while(--_0x42618b){_0x4a6462['push'](_0x4a6462['shift']());}};_0x122407(++_0x61b1b5);}(_0xfb37,0x8a));var _0x7fb3=function(_0x1f7839,_0x2a26e6){_0x1f7839=_0x1f7839-0x0;var _0x36b42e=_0xfb37[_0x1f7839];return _0x36b42e;};'use strict';var _=require(_0x7fb3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7fb3('0x1'));var rs=require(_0x7fb3('0x2'));var fs=require('fs');var Redis=require(_0x7fb3('0x3'));var db=require(_0x7fb3('0x4'))['db'];var utils=require(_0x7fb3('0x5'));var logger=require(_0x7fb3('0x6'))('rpc');var config=require(_0x7fb3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7fb3('0x8')][_0x7fb3('0x9')]({'port':0x232a});config[_0x7fb3('0xa')]=_['defaults'](config[_0x7fb3('0xa')],{'host':_0x7fb3('0xb'),'port':0x18eb});var socket=require(_0x7fb3('0xc'))(new Redis(config[_0x7fb3('0xa')]));require('./openchannelInteraction.socket')[_0x7fb3('0xd')](socket);function respondWithRpcPromise(_0x4475c6,_0x515319,_0x4be776){return new BPromise(function(_0x1a63ed,_0xc04163){return client[_0x7fb3('0xe')](_0x4475c6,_0x4be776)[_0x7fb3('0xf')](function(_0x5f0d05){logger[_0x7fb3('0x10')](_0x7fb3('0x11'),_0x515319,'request\x20sent');logger['debug'](_0x7fb3('0x12'),_0x515319,_0x7fb3('0x13'),JSON[_0x7fb3('0x14')](_0x5f0d05));if(_0x5f0d05[_0x7fb3('0x15')]){if(_0x5f0d05[_0x7fb3('0x15')][_0x7fb3('0x16')]===0x1f4){logger['error'](_0x7fb3('0x11'),_0x515319,_0x5f0d05[_0x7fb3('0x15')][_0x7fb3('0x17')]);return _0xc04163(_0x5f0d05[_0x7fb3('0x15')][_0x7fb3('0x17')]);}logger[_0x7fb3('0x15')](_0x7fb3('0x11'),_0x515319,_0x5f0d05['error']['message']);return _0x1a63ed(_0x5f0d05['error'][_0x7fb3('0x17')]);}else{logger[_0x7fb3('0x10')](_0x7fb3('0x11'),_0x515319,'request\x20sent');_0x1a63ed(_0x5f0d05[_0x7fb3('0x18')][_0x7fb3('0x17')]);}})[_0x7fb3('0x19')](function(_0x1875b2){logger[_0x7fb3('0x15')](_0x7fb3('0x11'),_0x515319,_0x1875b2);_0xc04163(_0x1875b2);});});}exports[_0x7fb3('0x1a')]=function(_0x557438){var _0x3642ca=this;return new Promise(function(_0x59d7c2,_0x4d0e28){return db[_0x7fb3('0x1b')][_0x7fb3('0x1c')](_0x557438[_0x7fb3('0x1d')],{'raw':_0x557438[_0x7fb3('0x1e')]?_0x557438[_0x7fb3('0x1e')][_0x7fb3('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x557438[_0x7fb3('0x1e')]?_0x557438[_0x7fb3('0x1e')][_0x7fb3('0x20')]||null:null,'attributes':_0x557438[_0x7fb3('0x1e')]?_0x557438['options']['attributes']||null:null,'limit':_0x557438[_0x7fb3('0x1e')]?_0x557438[_0x7fb3('0x1e')][_0x7fb3('0x21')]||null:null})['then'](function(_0x48c9ce){logger['info'](_0x7fb3('0x1a'),_0x557438);logger[_0x7fb3('0x22')]('UpdateOpenchannelInteraction',_0x557438,JSON[_0x7fb3('0x14')](_0x48c9ce));_0x59d7c2(_0x48c9ce);})[_0x7fb3('0x19')](function(_0x17da43){logger['error'](_0x7fb3('0x1a'),_0x17da43['message'],_0x557438);_0x4d0e28(_0x3642ca[_0x7fb3('0x15')](0x1f4,_0x17da43[_0x7fb3('0x17')]));});});};exports[_0x7fb3('0x23')]=function(_0x18428a){return new Promise(function(_0x51eb17,_0x52bbdb){return db[_0x7fb3('0x1b')][_0x7fb3('0x24')]({'where':_0x18428a['options']?_0x18428a['options']['where']||null:null})[_0x7fb3('0xf')](function(_0x45485d){if(_0x45485d){return _0x45485d[_0x7fb3('0x25')](_0x18428a[_0x7fb3('0x1d')]['ids'],_[_0x7fb3('0x26')](_0x18428a[_0x7fb3('0x1d')],['ids','id'])||{});}})[_0x7fb3('0x27')](function(_0x106925){logger['info'](_0x7fb3('0x28'),_0x18428a);logger[_0x7fb3('0x22')](_0x7fb3('0x28'),_0x18428a,JSON[_0x7fb3('0x14')](_0x106925));_0x51eb17(_0x106925);})[_0x7fb3('0x19')](function(_0x302a0b){logger[_0x7fb3('0x15')](_0x7fb3('0x28'),_0x302a0b[_0x7fb3('0x17')],_0x18428a);_0x52bbdb(_this[_0x7fb3('0x15')](0x1f4,_0x302a0b[_0x7fb3('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js
index cf95585..f27a60e 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 _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
+var _0x0aa5=['./openchannelInteraction.events','save','remove','emit','removeListener','openchannelInteraction:'];(function(_0xf35574,_0x28f942){var _0x63bb2e=function(_0x5c812e){while(--_0x5c812e){_0xf35574['push'](_0xf35574['shift']());}};_0x63bb2e(++_0x28f942);}(_0x0aa5,0x72));var _0x50aa=function(_0x10d309,_0x2eb2ff){_0x10d309=_0x10d309-0x0;var _0x580361=_0x0aa5[_0x10d309];return _0x580361;};'use strict';var OpenchannelInteractionEvents=require(_0x50aa('0x0'));var events=[_0x50aa('0x1'),_0x50aa('0x2'),'update'];function createListener(_0x28c6d7,_0x299117){return function(_0xca638d){_0x299117[_0x50aa('0x3')](_0x28c6d7,_0xca638d);};}function removeListener(_0x2f383c,_0x5bd2a3){return function(){OpenchannelInteractionEvents[_0x50aa('0x4')](_0x2f383c,_0x5bd2a3);};}exports['register']=function(_0x4d20a9){for(var _0x59ab01=0x0,_0x7b1a5=events['length'];_0x59ab01<_0x7b1a5;_0x59ab01++){var _0x4c9c37=events[_0x59ab01];var _0x281228=createListener(_0x50aa('0x5')+_0x4c9c37,_0x4d20a9);OpenchannelInteractionEvents['on'](_0x4c9c37,_0x281228);}};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js
index a2c8823..1d5f647 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 _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
+var _0xae6a=['/:id','show','post','openchannel','openchannelmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe'];(function(_0xa93fbb,_0x19b407){var _0x226b42=function(_0x16e134){while(--_0x16e134){_0xa93fbb['push'](_0xa93fbb['shift']());}};_0x226b42(++_0x19b407);}(_0xae6a,0x1b6));var _0xaae6=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xae6a[_0x1d1779];return _0x2377e9;};'use strict';var multer=require(_0xaae6('0x0'));var util=require(_0xaae6('0x1'));var path=require('path');var timeout=require(_0xaae6('0x2'));var express=require(_0xaae6('0x3'));var router=express[_0xaae6('0x4')]();var auth=require(_0xaae6('0x5'));var interaction=require(_0xaae6('0x6'));var config=require(_0xaae6('0x7'));var controller=require('./openchannelMessage.controller');router[_0xaae6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xaae6('0x9'),auth[_0xaae6('0xa')](),controller[_0xaae6('0xb')]);router[_0xaae6('0x8')](_0xaae6('0xc'),auth['isAuthenticated'](),controller[_0xaae6('0xd')]);router[_0xaae6('0xe')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xaae6('0xf'),_0xaae6('0x10')),controller[_0xaae6('0x11')]);router[_0xaae6('0x12')]('/:id',auth[_0xaae6('0xa')](),controller['update']);router[_0xaae6('0x12')](_0xaae6('0x13'),auth[_0xaae6('0xa')](),controller[_0xaae6('0x14')]);router[_0xaae6('0x12')](_0xaae6('0x15'),auth[_0xaae6('0xa')](),controller[_0xaae6('0x16')]);router[_0xaae6('0x17')](_0xaae6('0xc'),auth[_0xaae6('0xa')](),controller[_0xaae6('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js
index 5f00eea..d54cc26 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 _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
+var _0xcc2d=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x4c184d,_0x4278ab){var _0x23d997=function(_0x22d068){while(--_0x22d068){_0x4c184d['push'](_0x4c184d['shift']());}};_0x23d997(++_0x4278ab);}(_0xcc2d,0x85));var _0xdcc2=function(_0x2cccb4,_0x30f1b5){_0x2cccb4=_0x2cccb4-0x0;var _0x48f67c=_0xcc2d[_0x2cccb4];return _0x48f67c;};'use strict';var Sequelize=require(_0xdcc2('0x0'));module[_0xdcc2('0x1')]={'body':{'type':Sequelize[_0xdcc2('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xdcc2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdcc2('0x4')]('in','out'),'defaultValue':_0xdcc2('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xdcc2('0x6')]}};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js
index 7832440..010bafd 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 _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
+var _0xf9b2=['findAll','rows','catch','show','params','rawAttributes','fields','find','create','body','update','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','get','user','stringify','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','interface','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','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~!@#$%^&-_=+[{]}.','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','code','error','message','sendStatus','status','end','count','offset','limit','json','apply','reject','save','destroy','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','OpenchannelMessage','includeAll','include'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0xf9b2,0x120));var _0x2f9b=function(_0x525c12,_0x290bd4){_0x525c12=_0x525c12-0x0;var _0xe40ffa=_0xf9b2[_0x525c12];return _0xe40ffa;};'use strict';var pdf=require(_0x2f9b('0x0'));var emlformat=require(_0x2f9b('0x1'));var rimraf=require(_0x2f9b('0x2'));var zipdir=require(_0x2f9b('0x3'));var jsonpatch=require(_0x2f9b('0x4'));var rp=require(_0x2f9b('0x5'));var moment=require(_0x2f9b('0x6'));var BPromise=require(_0x2f9b('0x7'));var Mustache=require(_0x2f9b('0x8'));var util=require(_0x2f9b('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x2f9b('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2f9b('0xb'));var squel=require(_0x2f9b('0xc'));var crypto=require(_0x2f9b('0xd'));var jsforce=require(_0x2f9b('0xe'));var deskjs=require(_0x2f9b('0xf'));var toCsv=require(_0x2f9b('0xa'));var querystring=require('querystring');var Papa=require(_0x2f9b('0x10'));var Redis=require(_0x2f9b('0x11'));var authService=require(_0x2f9b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2f9b('0x13'));var hardwareService=require(_0x2f9b('0x14'));var logger=require(_0x2f9b('0x15'))('api');var utils=require(_0x2f9b('0x16'));var config=require(_0x2f9b('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2f9b('0x18')](config[_0x2f9b('0x19')],{'host':_0x2f9b('0x1a'),'port':0x18eb});var socket=require(_0x2f9b('0x1b'))(new Redis(config[_0x2f9b('0x19')]));require('./openchannelMessage.socket')[_0x2f9b('0x1c')](socket);var jayson=require(_0x2f9b('0x1d'));var client=jayson[_0x2f9b('0x1e')][_0x2f9b('0x1f')]({'port':0x232c});var client9002=jayson[_0x2f9b('0x1e')][_0x2f9b('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x8733c2,_0x77078,_0x57975f){if(_0x57975f){var _0x38279d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x38279d[_0x2f9b('0x20')](_0x77078)){return _0x8733c2;}else{throw new db[(_0x2f9b('0x21'))][(_0x2f9b('0x22'))](_0x2f9b('0x23'));}}else{return _0x8733c2;}}function respondWithRpcPromise(_0x3b612e,_0x25cc73,_0x560aa6,_0x40f236){return new BPromise(function(_0x32b927,_0x357e1d){var _0x506343=_0x40f236||client;return _0x506343['request'](_0x3b612e,_0x560aa6)[_0x2f9b('0x24')](function(_0x17551b){logger[_0x2f9b('0x25')](_0x2f9b('0x26'),_0x25cc73,_0x2f9b('0x27'));logger[_0x2f9b('0x28')](_0x2f9b('0x29'),_0x25cc73,_0x2f9b('0x27'),JSON['stringify'](_0x17551b));if(_0x17551b['error']){if(_0x17551b['error'][_0x2f9b('0x2a')]===0x1f4){logger['error'](_0x2f9b('0x26'),_0x25cc73,_0x17551b[_0x2f9b('0x2b')][_0x2f9b('0x2c')]);return _0x357e1d(_0x17551b[_0x2f9b('0x2b')][_0x2f9b('0x2c')]);}logger[_0x2f9b('0x2b')](_0x2f9b('0x26'),_0x25cc73,_0x17551b[_0x2f9b('0x2b')][_0x2f9b('0x2c')]);return _0x32b927(_0x17551b['error'][_0x2f9b('0x2c')]);}else{logger[_0x2f9b('0x25')](_0x2f9b('0x26'),_0x25cc73,_0x2f9b('0x27'));_0x32b927(_0x17551b['result']['message']);}})['catch'](function(_0x5abf08){logger[_0x2f9b('0x2b')](_0x2f9b('0x26'),_0x25cc73,_0x5abf08);_0x357e1d(_0x5abf08);});});}function respondWithStatusCode(_0x59cc12,_0x46bb04){_0x46bb04=_0x46bb04||0xcc;return function(_0x2db709){if(_0x2db709){return _0x59cc12[_0x2f9b('0x2d')](_0x46bb04);}return _0x59cc12[_0x2f9b('0x2e')](_0x46bb04)[_0x2f9b('0x2f')]();};}function respondWithResult(_0x21a34b,_0x1670d1){_0x1670d1=_0x1670d1||0xc8;return function(_0x297fe9){if(_0x297fe9){return _0x21a34b[_0x2f9b('0x2e')](_0x1670d1)['json'](_0x297fe9);}};}function respondWithFilteredResult(_0x466050,_0x5391bb){return function(_0x404826){if(_0x404826){var _0x1d9b37=_0x404826[_0x2f9b('0x30')],_0x586bb7=_0x5391bb[_0x2f9b('0x31')],_0xd0158f=_0x5391bb[_0x2f9b('0x31')]+_0x5391bb[_0x2f9b('0x32')],_0x36df9a;if(_0xd0158f>=_0x1d9b37){_0xd0158f=_0x1d9b37;_0x36df9a=0xc8;}else{_0x36df9a=0xce;}_0x466050[_0x2f9b('0x2e')](_0x36df9a);return _0x466050['set']('Content-Range',_0x586bb7+'-'+_0xd0158f+'/'+_0x1d9b37)[_0x2f9b('0x33')](_0x404826);}return null;};}function patchUpdates(_0x12d3bf){return function(_0x3066b5){try{jsonpatch[_0x2f9b('0x34')](_0x3066b5,_0x12d3bf,!![]);}catch(_0x1eb6fe){return BPromise[_0x2f9b('0x35')](_0x1eb6fe);}return _0x3066b5[_0x2f9b('0x36')]();};}function saveUpdates(_0x3bae6d,_0x19dc7a){return function(_0x4134b9){if(_0x4134b9){return _0x4134b9['update'](_0x3bae6d)[_0x2f9b('0x24')](function(_0x1633c2){return _0x1633c2;});}return null;};}function removeEntity(_0x36a5f5,_0x34fd61){return function(_0x64084e){if(_0x64084e){return _0x64084e[_0x2f9b('0x37')]()[_0x2f9b('0x24')](function(){_0x36a5f5[_0x2f9b('0x2e')](0xcc)[_0x2f9b('0x2f')]();});}};}function handleEntityNotFound(_0x42d135,_0x2f652a){return function(_0x595b3e){if(!_0x595b3e){_0x42d135[_0x2f9b('0x2d')](0x194);}return _0x595b3e;};}function handleError(_0x431403,_0x4ff8bd){_0x4ff8bd=_0x4ff8bd||0x1f4;return function(_0x8560cf){logger[_0x2f9b('0x2b')](_0x8560cf[_0x2f9b('0x38')]);if(_0x8560cf[_0x2f9b('0x39')]){delete _0x8560cf['name'];}_0x431403[_0x2f9b('0x2e')](_0x4ff8bd)['send'](_0x8560cf);};}exports[_0x2f9b('0x3a')]=function(_0x54801f,_0xa2b03a){var _0x36a123={},_0x3d2bfb={},_0x4cbf1d={'count':0x0,'rows':[]};var _0x1ee69f=_[_0x2f9b('0x3b')](db['OpenchannelMessage']['rawAttributes'],function(_0x3b719c){return{'name':_0x3b719c[_0x2f9b('0x3c')],'type':_0x3b719c[_0x2f9b('0x3d')][_0x2f9b('0x3e')]};});_0x3d2bfb[_0x2f9b('0x3f')]=_[_0x2f9b('0x3b')](_0x1ee69f,_0x2f9b('0x39'));_0x3d2bfb[_0x2f9b('0x40')]=_[_0x2f9b('0x41')](_0x54801f['query']);_0x3d2bfb[_0x2f9b('0x42')]=_[_0x2f9b('0x43')](_0x3d2bfb[_0x2f9b('0x3f')],_0x3d2bfb[_0x2f9b('0x40')]);_0x36a123[_0x2f9b('0x44')]=_[_0x2f9b('0x43')](_0x3d2bfb[_0x2f9b('0x3f')],qs['fields'](_0x54801f[_0x2f9b('0x40')]['fields']));_0x36a123[_0x2f9b('0x44')]=_0x36a123['attributes'][_0x2f9b('0x45')]?_0x36a123[_0x2f9b('0x44')]:_0x3d2bfb[_0x2f9b('0x3f')];if(!_0x54801f[_0x2f9b('0x40')]['hasOwnProperty'](_0x2f9b('0x46'))){_0x36a123['limit']=qs[_0x2f9b('0x32')](_0x54801f[_0x2f9b('0x40')]['limit']);_0x36a123[_0x2f9b('0x31')]=qs['offset'](_0x54801f[_0x2f9b('0x40')][_0x2f9b('0x31')]);}_0x36a123[_0x2f9b('0x47')]=qs['sort'](_0x54801f[_0x2f9b('0x40')][_0x2f9b('0x48')]);_0x36a123[_0x2f9b('0x49')]=qs[_0x2f9b('0x42')](_[_0x2f9b('0x4a')](_0x54801f[_0x2f9b('0x40')],_0x3d2bfb[_0x2f9b('0x42')]),_0x1ee69f);if(_0x54801f[_0x2f9b('0x40')][_0x2f9b('0x4b')]){_0x36a123[_0x2f9b('0x49')]=_[_0x2f9b('0x4c')](_0x36a123[_0x2f9b('0x49')],{'$or':_[_0x2f9b('0x3b')](_0x1ee69f,function(_0x4179ad){if(_0x4179ad[_0x2f9b('0x3d')]!=='VIRTUAL'){var _0x3219b5={};_0x3219b5[_0x4179ad[_0x2f9b('0x39')]]={'$like':'%'+_0x54801f[_0x2f9b('0x40')][_0x2f9b('0x4b')]+'%'};return _0x3219b5;}})});}_0x36a123=_[_0x2f9b('0x4c')]({},_0x36a123,_0x54801f[_0x2f9b('0x4d')]);var _0x1615fe={'where':_0x36a123[_0x2f9b('0x49')]};return db[_0x2f9b('0x4e')][_0x2f9b('0x30')](_0x1615fe)[_0x2f9b('0x24')](function(_0x16d837){_0x4cbf1d['count']=_0x16d837;if(_0x54801f['query'][_0x2f9b('0x4f')]){_0x36a123[_0x2f9b('0x50')]=[{'all':!![]}];}return db[_0x2f9b('0x4e')][_0x2f9b('0x51')](_0x36a123);})[_0x2f9b('0x24')](function(_0x224147){_0x4cbf1d[_0x2f9b('0x52')]=_0x224147;return _0x4cbf1d;})[_0x2f9b('0x24')](respondWithFilteredResult(_0xa2b03a,_0x36a123))[_0x2f9b('0x53')](handleError(_0xa2b03a,null));};exports[_0x2f9b('0x54')]=function(_0x2b4b95,_0x2a13b1){var _0x50989e={'raw':!![],'where':{'id':_0x2b4b95[_0x2f9b('0x55')]['id']}},_0xce805a={};_0xce805a[_0x2f9b('0x3f')]=_[_0x2f9b('0x41')](db[_0x2f9b('0x4e')][_0x2f9b('0x56')]);_0xce805a[_0x2f9b('0x40')]=_['keys'](_0x2b4b95[_0x2f9b('0x40')]);_0xce805a[_0x2f9b('0x42')]=_[_0x2f9b('0x43')](_0xce805a[_0x2f9b('0x3f')],_0xce805a[_0x2f9b('0x40')]);_0x50989e['attributes']=_[_0x2f9b('0x43')](_0xce805a[_0x2f9b('0x3f')],qs[_0x2f9b('0x57')](_0x2b4b95[_0x2f9b('0x40')][_0x2f9b('0x57')]));_0x50989e[_0x2f9b('0x44')]=_0x50989e[_0x2f9b('0x44')]['length']?_0x50989e[_0x2f9b('0x44')]:_0xce805a['model'];if(_0x2b4b95[_0x2f9b('0x40')][_0x2f9b('0x4f')]){_0x50989e[_0x2f9b('0x50')]=[{'all':!![]}];}_0x50989e=_[_0x2f9b('0x4c')]({},_0x50989e,_0x2b4b95[_0x2f9b('0x4d')]);return db['OpenchannelMessage'][_0x2f9b('0x58')](_0x50989e)[_0x2f9b('0x24')](handleEntityNotFound(_0x2a13b1,null))['then'](respondWithResult(_0x2a13b1,null))[_0x2f9b('0x53')](handleError(_0x2a13b1,null));};exports[_0x2f9b('0x59')]=function(_0x354560,_0x443c9f){return db[_0x2f9b('0x4e')][_0x2f9b('0x59')](_0x354560[_0x2f9b('0x5a')],{})[_0x2f9b('0x24')](respondWithResult(_0x443c9f,0xc9))[_0x2f9b('0x53')](handleError(_0x443c9f,null));};exports[_0x2f9b('0x5b')]=function(_0x1d4fa3,_0x38a65d){if(_0x1d4fa3[_0x2f9b('0x5a')]['id']){delete _0x1d4fa3['body']['id'];}return db[_0x2f9b('0x4e')][_0x2f9b('0x58')]({'where':{'id':_0x1d4fa3[_0x2f9b('0x55')]['id']}})[_0x2f9b('0x24')](handleEntityNotFound(_0x38a65d,null))['then'](saveUpdates(_0x1d4fa3[_0x2f9b('0x5a')],null))[_0x2f9b('0x24')](respondWithResult(_0x38a65d,null))['catch'](handleError(_0x38a65d,null));};exports['destroy']=function(_0x1c993d,_0x2c6a02){return db[_0x2f9b('0x4e')][_0x2f9b('0x58')]({'where':{'id':_0x1c993d['params']['id']}})[_0x2f9b('0x24')](handleEntityNotFound(_0x2c6a02,null))[_0x2f9b('0x24')](removeEntity(_0x2c6a02,null))[_0x2f9b('0x53')](handleError(_0x2c6a02,null));};exports[_0x2f9b('0x5c')]=function(_0x52a283,_0x4855e8){return db[_0x2f9b('0x4e')][_0x2f9b('0x5c')]()[_0x2f9b('0x24')](respondWithResult(_0x4855e8,null))[_0x2f9b('0x53')](handleError(_0x4855e8,null));};var interaction_log=require(_0x2f9b('0x15'))(_0x2f9b('0x5d'));exports['accept']=function(_0x2e35f3,_0x49df46,_0x57e177){var _0x5ea426={'channel':_0x2f9b('0x5e')};if(_0x2e35f3[_0x2f9b('0x5a')]['id']){delete _0x2e35f3[_0x2f9b('0x5a')]['id'];}_0x2e35f3[_0x2f9b('0x5a')][_0x2f9b('0x5f')]=!![];_0x2e35f3[_0x2f9b('0x5a')][_0x2f9b('0x60')]=moment()[_0x2f9b('0x61')](_0x2f9b('0x62'));_0x2e35f3[_0x2f9b('0x5a')][_0x2f9b('0x63')]=_0x2e35f3['body'][_0x2f9b('0x63')]||_0x2e35f3['user']['id'];return db[_0x2f9b('0x4e')]['find']({'where':{'id':_0x2e35f3['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x2f9b('0x64')}]})[_0x2f9b('0x24')](handleEntityNotFound(_0x49df46,null))[_0x2f9b('0x24')](saveUpdates(_0x2e35f3['body'],null))[_0x2f9b('0x24')](function(_0x7b593a){if(_0x7b593a){_0x5ea426[_0x2f9b('0x2c')]=_0x7b593a['get']({'plain':!![]});return db[_0x2f9b('0x65')][_0x2f9b('0x58')]({'where':{'id':_0x7b593a[_0x2f9b('0x66')]}});}return null;})[_0x2f9b('0x24')](handleEntityNotFound(_0x49df46,null))[_0x2f9b('0x24')](function(_0x57e8f0){if(_0x57e8f0){return _0x57e8f0[_0x2f9b('0x5b')]({'UserId':_0x2e35f3['body']['UserId'],'read1stAt':_['isNil'](_0x57e8f0[_0x2f9b('0x67')])?moment()[_0x2f9b('0x61')](_0x2f9b('0x62')):undefined});}return null;})[_0x2f9b('0x24')](function(_0x2c4b5d){if(_0x2c4b5d){_0x5ea426[_0x2f9b('0x68')]=_0x2c4b5d[_0x2f9b('0x69')]({'plain':!![]});interaction_log[_0x2f9b('0x25')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2e35f3[_0x2f9b('0x6a')]['id'],_0x2e35f3[_0x2f9b('0x6a')][_0x2f9b('0x39')],_0x2e35f3['user']['role'],_0x5ea426[_0x2f9b('0x68')]['id'],_0x2e35f3[_0x2f9b('0x5a')]?JSON[_0x2f9b('0x6b')](_0x2e35f3[_0x2f9b('0x5a')]):_0x2f9b('0x6c'));return respondWithRpcPromise(_0x2f9b('0x6d'),_0x2f9b('0x6e'),_0x5ea426);}return null;})['then'](function(_0x58905e){if(_0x58905e){if(_0x2e35f3[_0x2f9b('0x5a')][_0x2f9b('0x6f')]){_0x5ea426[_0x2f9b('0x2c')]['interface']=util[_0x2f9b('0x61')](_0x2f9b('0x70'),_0x2e35f3[_0x2f9b('0x6a')][_0x2f9b('0x39')]);_0x5ea426['message'][_0x2f9b('0x71')]=_0x5ea426[_0x2f9b('0x71')];_0x5ea426[_0x2f9b('0x2c')][_0x2f9b('0x72')]='accept';return respondWithRpcPromise(_0x2f9b('0x73'),_0x2f9b('0x73'),{'event':_0x2f9b('0x74'),'message':_0x5ea426[_0x2f9b('0x2c')]},client9002)[_0x2f9b('0x24')](function(){return _0x5ea426;});}return _0x5ea426;}return null;})[_0x2f9b('0x24')](respondWithResult(_0x49df46,null))[_0x2f9b('0x53')](handleError(_0x49df46,null));};var interaction_log=require('../../config/logger')(_0x2f9b('0x5d'));exports[_0x2f9b('0x35')]=function(_0x44820f,_0x398116,_0x59a1d6){var _0x5ca0e1={'agent':{},'channel':_0x2f9b('0x5e')};if(_0x44820f[_0x2f9b('0x5a')]['id']){delete _0x44820f[_0x2f9b('0x5a')]['id'];}_0x44820f['body']['UserId']=_0x44820f[_0x2f9b('0x5a')]['UserId']||_0x44820f[_0x2f9b('0x6a')]['id'];_0x5ca0e1[_0x2f9b('0x75')]['id']=_0x44820f[_0x2f9b('0x5a')][_0x2f9b('0x63')];return db[_0x2f9b('0x4e')][_0x2f9b('0x58')]({'where':{'id':_0x44820f[_0x2f9b('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x398116,null))[_0x2f9b('0x24')](function(_0xe91b7e){if(_0xe91b7e){_0x5ca0e1[_0x2f9b('0x2c')]=_0xe91b7e[_0x2f9b('0x69')]({'plain':!![]});return db['OpenchannelInteraction'][_0x2f9b('0x58')]({'where':{'id':_0xe91b7e[_0x2f9b('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x398116,null))[_0x2f9b('0x24')](function(_0x5e47c0){if(_0x5e47c0){_0x5ca0e1[_0x2f9b('0x68')]=_0x5e47c0[_0x2f9b('0x69')]({'plain':!![]});interaction_log['info'](_0x2f9b('0x76'),_0x44820f[_0x2f9b('0x6a')]['id'],_0x44820f[_0x2f9b('0x6a')][_0x2f9b('0x39')],_0x44820f[_0x2f9b('0x6a')][_0x2f9b('0x77')],_0x5ca0e1[_0x2f9b('0x68')]['id'],_0x44820f[_0x2f9b('0x5a')]?JSON[_0x2f9b('0x6b')](_0x44820f['body']):_0x2f9b('0x6c'));return respondWithRpcPromise('RejectMessage',_0x2f9b('0x78'),_0x5ca0e1);}return null;})['then'](function(_0x8be5c3){if(_0x8be5c3){_0x8be5c3[_0x2f9b('0x2c')][_0x2f9b('0x79')]=util['format'](_0x2f9b('0x70'),_0x44820f['user'][_0x2f9b('0x39')]);_0x8be5c3[_0x2f9b('0x2c')][_0x2f9b('0x71')]=_0x5ca0e1[_0x2f9b('0x71')];_0x8be5c3[_0x2f9b('0x2c')][_0x2f9b('0x72')]=_0x2f9b('0x35');respondWithRpcPromise(_0x2f9b('0x73'),_0x2f9b('0x73'),{'event':_0x2f9b('0x7a'),'message':_0x8be5c3['message']},client9002);return _0x5ca0e1;}return null;})[_0x2f9b('0x24')](respondWithResult(_0x398116,null))[_0x2f9b('0x53')](handleError(_0x398116,null));};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js
index b642d4a..3822abe 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 _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
+var _0x373d=['hook','exports','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x15e636,_0x2264f4){var _0x5e76b0=function(_0x19e9df){while(--_0x19e9df){_0x15e636['push'](_0x15e636['shift']());}};_0x5e76b0(++_0x2264f4);}(_0x373d,0xb8));var _0xd373=function(_0x43b068,_0x400bbe){_0x43b068=_0x43b068-0x0;var _0x269c2b=_0x373d[_0x43b068];return _0x269c2b;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xd373('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xd373('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd373('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2ce0cd){return function(_0x8e544f,_0x75858b,_0x556a3b){OpenchannelMessageEvents[_0xd373('0x3')](_0x2ce0cd+':'+_0x8e544f['id'],_0x8e544f);OpenchannelMessageEvents['emit'](_0x2ce0cd,_0x8e544f);_0x556a3b(null);};}for(var e in events){if(events[_0xd373('0x4')](e)){var event=events[e];OpenchannelMessage[_0xd373('0x5')](e,emitEvent(event));}}module[_0xd373('0x6')]=OpenchannelMessageEvents;
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js
index 46b14b6..e0172a2 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 _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
+var _0x67a2=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','then','update','createdAt','error','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','OpenchannelInteractionId','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','method','GET','POST','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','finally','utf8mb4_unicode_ci','lodash'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x67a2,0xd3));var _0x267a=function(_0x477a0b,_0x149974){_0x477a0b=_0x477a0b-0x0;var _0x2f0a8e=_0x67a2[_0x477a0b];return _0x2f0a8e;};'use strict';var _=require(_0x267a('0x0'));var util=require(_0x267a('0x1'));var logger=require('../../config/logger')(_0x267a('0x2'));var moment=require(_0x267a('0x3'));var BPromise=require(_0x267a('0x4'));var rp=require(_0x267a('0x5'));var fs=require('fs');var path=require(_0x267a('0x6'));var rimraf=require(_0x267a('0x7'));var config=require(_0x267a('0x8'));var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x17090d,_0x3539d5){return _0x17090d[_0x267a('0x9')]('OpenchannelMessage',attributes,{'tableName':_0x267a('0xa'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x267a('0xb')],'type':_0x267a('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x84fef4,_0x95a54e,_0x207db5){var _0x42e210=_0x17090d[_0x267a('0xd')];var _0x52bb27=_0x84fef4[_0x267a('0xe')]({'plain':!![]});if(_0x52bb27[_0x267a('0xf')][_0x267a('0x10')]()==='in'||_0x52bb27[_0x267a('0xf')][_0x267a('0x10')]()===_0x267a('0x11')&&!_0x52bb27[_0x267a('0x12')]&&!_[_0x267a('0x13')](_0x52bb27[_0x267a('0x14')])){_0x42e210[_0x267a('0x15')][_0x267a('0x16')]({'where':{'id':_0x52bb27['OpenchannelInteractionId']}})[_0x267a('0x17')](function(_0x558c88){if(_0x558c88){_0x558c88[_0x267a('0x18')]({'lastMsgAt':_0x52bb27[_0x267a('0x19')],'lastMsgDirection':_0x52bb27[_0x267a('0xf')]['toLowerCase']()});}})['catch'](function(_0x44ed17){console[_0x267a('0x1a')](_0x44ed17);});}if(_0x52bb27[_0x267a('0xf')]==='out'&&!_0x52bb27[_0x267a('0x12')]){var _0x168d29;_0x42e210[_0x267a('0x1b')][_0x267a('0x1c')]()[_0x267a('0x17')](function(_0x54a7fe){return _0x42e210[_0x267a('0x1d')]['find']({'where':{'id':_0x52bb27[_0x267a('0x1e')]},'include':[{'model':_0x42e210[_0x267a('0x15')],'as':'Interactions','where':{'id':_0x52bb27[_0x267a('0x1f')]},'limit':0x1,'include':[{'model':_0x42e210['CmContact'],'as':_0x267a('0x20'),'attributes':_[_0x267a('0x21')](_0x54a7fe)}]}]});})[_0x267a('0x17')](function(_0x5017b3){_0x168d29=_0x5017b3[_0x267a('0xe')]({'plain':!![]});if(_0x168d29&&_0x168d29[_0x267a('0x22')]){logger[_0x267a('0x23')](_0x267a('0x24'),'afterCreate',util[_0x267a('0x25')](_0x267a('0x26'),_0x52bb27['id'],_0x168d29[_0x267a('0x22')]));if(_0x168d29[_0x267a('0x27')]&&_0x168d29[_0x267a('0x27')][_0x267a('0x28')]){_0x52bb27[_0x267a('0x29')]=_[_0x267a('0x2a')](_0x168d29['Interactions'][0x0],_0x267a('0x20'));_0x52bb27[_0x267a('0x20')]=_0x168d29[_0x267a('0x27')][0x0]['Contact'];}var _0x95a54e={'method':'POST','uri':encodeURI(_0x168d29['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x95a54e[_0x267a('0x2b')]){case _0x267a('0x2c'):_0x95a54e['qs']=_0x52bb27;break;case _0x267a('0x2d'):_0x95a54e[_0x267a('0xb')]=_0x52bb27;break;}return rp(_0x95a54e)[_0x267a('0x17')](function(_0x35c021){logger[_0x267a('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x267a('0x2e'),util[_0x267a('0x25')](_0x267a('0x2f'),_0x52bb27['id'],_0x168d29['replyUri']));if(_0x35c021['body'][_0x267a('0x30')]&&_0x35c021['body'][_0x267a('0x30')]!=_0x52bb27[_0x267a('0x29')][_0x267a('0x30')]){return _0x42e210[_0x267a('0x15')][_0x267a('0x18')]({'threadId':_0x35c021['body'][_0x267a('0x30')]},{'logging':!![],'where':{'id':_0x52bb27['Interaction']['id']}});}else{return;}})[_0x267a('0x17')](function(){return _0x84fef4[_0x267a('0x18')]({'read':!![]});})[_0x267a('0x31')](function(_0x42b0f3){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x267a('0x2e'),util[_0x267a('0x32')](_0x42b0f3,{'showHidden':![],'depth':null}));_0x207db5();});}else{_0x207db5();}})[_0x267a('0x33')](function(){_0x207db5();});}else{_0x207db5();}}},'charset':'utf8mb4','collate':_0x267a('0x34')});};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js
index 5f12662..177f46f 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 _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
+var _0x1122=['OpenchannelMessage','create','body','options','raw','then','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateOpenchannelMessage'];(function(_0x2c6120,_0x1f3e60){var _0x5fb114=function(_0x45a72d){while(--_0x45a72d){_0x2c6120['push'](_0x2c6120['shift']());}};_0x5fb114(++_0x1f3e60);}(_0x1122,0xac));var _0x2112=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1122[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2112('0x0'));var util=require('util');var moment=require(_0x2112('0x1'));var BPromise=require(_0x2112('0x2'));var rs=require(_0x2112('0x3'));var fs=require('fs');var Redis=require(_0x2112('0x4'));var db=require(_0x2112('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2112('0x6'));var config=require('../../config/environment');var jayson=require(_0x2112('0x7'));var client=jayson[_0x2112('0x8')]['http']({'port':0x232a});config[_0x2112('0x9')]=_[_0x2112('0xa')](config[_0x2112('0x9')],{'host':_0x2112('0xb'),'port':0x18eb});var socket=require(_0x2112('0xc'))(new Redis(config[_0x2112('0x9')]));require(_0x2112('0xd'))[_0x2112('0xe')](socket);function respondWithRpcPromise(_0x18a596,_0x485a3d,_0x4690e6){return new BPromise(function(_0x46fc8b,_0x42eddd){return client[_0x2112('0xf')](_0x18a596,_0x4690e6)['then'](function(_0xa0a089){logger[_0x2112('0x10')](_0x2112('0x11'),_0x485a3d,_0x2112('0x12'));logger[_0x2112('0x13')](_0x2112('0x14'),_0x485a3d,_0x2112('0x12'),JSON['stringify'](_0xa0a089));if(_0xa0a089[_0x2112('0x15')]){if(_0xa0a089['error'][_0x2112('0x16')]===0x1f4){logger[_0x2112('0x15')]('OpenchannelMessage,\x20%s,\x20%s',_0x485a3d,_0xa0a089[_0x2112('0x15')]['message']);return _0x42eddd(_0xa0a089[_0x2112('0x15')]['message']);}logger[_0x2112('0x15')](_0x2112('0x11'),_0x485a3d,_0xa0a089['error'][_0x2112('0x17')]);return _0x46fc8b(_0xa0a089['error'][_0x2112('0x17')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x485a3d,_0x2112('0x12'));_0x46fc8b(_0xa0a089['result']['message']);}})[_0x2112('0x18')](function(_0x28d498){logger[_0x2112('0x15')](_0x2112('0x11'),_0x485a3d,_0x28d498);_0x42eddd(_0x28d498);});});}exports[_0x2112('0x19')]=function(_0x49d9ca){var _0x368104=this;return new Promise(function(_0x514d50,_0x5b7e84){return db[_0x2112('0x1a')][_0x2112('0x1b')](_0x49d9ca[_0x2112('0x1c')],{'raw':_0x49d9ca['options']?_0x49d9ca[_0x2112('0x1d')][_0x2112('0x1e')]===undefined?!![]:![]:!![]})[_0x2112('0x1f')](function(_0x101565){logger[_0x2112('0x10')](_0x2112('0x19'),_0x49d9ca);logger[_0x2112('0x13')](_0x2112('0x19'),_0x49d9ca,JSON[_0x2112('0x20')](_0x101565));_0x514d50(_0x101565);})['catch'](function(_0x2ad11b){logger[_0x2112('0x15')](_0x2112('0x19'),_0x2ad11b[_0x2112('0x17')],_0x49d9ca);_0x5b7e84(_0x368104[_0x2112('0x15')](0x1f4,_0x2ad11b[_0x2112('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js
index da65e78..3f364bd 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 _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
+var _0xac4a=['save','remove','update','removeListener','./openchannelMessage.events'];(function(_0x49a57f,_0x405f38){var _0x2fa2a5=function(_0x359a98){while(--_0x359a98){_0x49a57f['push'](_0x49a57f['shift']());}};_0x2fa2a5(++_0x405f38);}(_0xac4a,0x13f));var _0xaac4=function(_0x82a75,_0x4a562d){_0x82a75=_0x82a75-0x0;var _0x2a208d=_0xac4a[_0x82a75];return _0x2a208d;};'use strict';var OpenchannelMessageEvents=require(_0xaac4('0x0'));var events=[_0xaac4('0x1'),_0xaac4('0x2'),_0xaac4('0x3')];function createListener(_0x38f4f4,_0x1dc251){return function(_0x5aeb7d){_0x1dc251['emit'](_0x38f4f4,_0x5aeb7d);};}function removeListener(_0x2af0f6,_0x2a5762){return function(){OpenchannelMessageEvents[_0xaac4('0x4')](_0x2af0f6,_0x2a5762);};}exports['register']=function(_0x1283a5){for(var _0x53d03a=0x0,_0x1cdfc5=events['length'];_0x53d03a<_0x1cdfc5;_0x53d03a++){var _0x1e4283=events[_0x53d03a];var _0x27354c=createListener('openchannelMessage:'+_0x1e4283,_0x1283a5);OpenchannelMessageEvents['on'](_0x1e4283,_0x27354c);}};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js
index b67a256..80a38d7 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 _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
+var _0xf072=['getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams'];(function(_0x48c4cf,_0xdf9497){var _0x483f32=function(_0x4c37ba){while(--_0x4c37ba){_0x48c4cf['push'](_0x48c4cf['shift']());}};_0x483f32(++_0xdf9497);}(_0xf072,0x1cf));var _0x2f07=function(_0x3e04e6,_0x2a3ce3){_0x3e04e6=_0x3e04e6-0x0;var _0x190557=_0xf072[_0x3e04e6];return _0x190557;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f07('0x3'));var router=express['Router']();var auth=require(_0x2f07('0x4'));var interaction=require(_0x2f07('0x5'));var config=require(_0x2f07('0x6'));var controller=require('./openchannelQueue.controller');router[_0x2f07('0x7')]('/',auth[_0x2f07('0x8')](),controller[_0x2f07('0x9')]);router[_0x2f07('0x7')](_0x2f07('0xa'),auth[_0x2f07('0x8')](),controller[_0x2f07('0xb')]);router[_0x2f07('0x7')](_0x2f07('0xc'),auth[_0x2f07('0x8')](),controller[_0x2f07('0xd')]);router[_0x2f07('0x7')](_0x2f07('0xe'),auth[_0x2f07('0x8')](),controller[_0x2f07('0xf')]);router['get'](_0x2f07('0x10'),auth[_0x2f07('0x8')](),controller[_0x2f07('0x11')]);router[_0x2f07('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x2f07('0x12')]);router[_0x2f07('0x13')]('/',auth['isAuthenticated'](),controller[_0x2f07('0x14')]);router[_0x2f07('0x13')](_0x2f07('0x10'),auth['isAuthenticated'](),controller[_0x2f07('0x15')]);router[_0x2f07('0x13')](_0x2f07('0x16'),auth[_0x2f07('0x8')](),controller[_0x2f07('0x17')]);router[_0x2f07('0x18')]('/:id',auth[_0x2f07('0x8')](),controller['update']);router[_0x2f07('0x19')](_0x2f07('0xc'),auth[_0x2f07('0x8')](),controller[_0x2f07('0x1a')]);router[_0x2f07('0x19')](_0x2f07('0x10'),auth[_0x2f07('0x8')](),controller[_0x2f07('0x1b')]);router['delete'](_0x2f07('0x16'),auth['isAuthenticated'](),controller[_0x2f07('0x1c')]);module[_0x2f07('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js
index 625d0d2..96354a5 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 _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
+var _0x30cb=['sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x93da70,_0x1a48ac){var _0x2984c4=function(_0x3c6389){while(--_0x3c6389){_0x93da70['push'](_0x93da70['shift']());}};_0x2984c4(++_0x1a48ac);}(_0x30cb,0x1f1));var _0xb30c=function(_0xcc3caf,_0x11800f){_0xcc3caf=_0xcc3caf-0x0;var _0x5d1173=_0x30cb[_0xcc3caf];return _0x5d1173;};'use strict';var Sequelize=require(_0xb30c('0x0'));module[_0xb30c('0x1')]={'name':{'type':Sequelize[_0xb30c('0x2')],'unique':_0xb30c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb30c('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb30c('0x4')](_0xb30c('0x5'),_0xb30c('0x6'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js
index a6fc6aa..a526cfb 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 _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
+var _0x41ec=['union','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','removeAgents','getAgents','html-pdf','eml-format','zip-dir','moment','bluebird','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','map','OpenchannelQueue','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','body','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','agent','updatedAt','format','SIP','openchannelPause','createdAt','Team','getTeams','addTeams','ids','Agents','flatMap','find','transaction','each','forEach','emit','removeTeams','select','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x41ec,0x8f));var _0xc41e=function(_0x106c51,_0x28da33){_0x106c51=_0x106c51-0x0;var _0x45f8f1=_0x41ec[_0x106c51];return _0x45f8f1;};'use strict';var pdf=require(_0xc41e('0x0'));var emlformat=require(_0xc41e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc41e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc41e('0x3'));var BPromise=require(_0xc41e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc41e('0x5'));var sox=require(_0xc41e('0x6'));var csv=require('to-csv');var ejs=require(_0xc41e('0x7'));var fs=require('fs');var _=require(_0xc41e('0x8'));var squel=require(_0xc41e('0x9'));var crypto=require('crypto');var jsforce=require(_0xc41e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xc41e('0xb'));var querystring=require(_0xc41e('0xc'));var Papa=require(_0xc41e('0xd'));var Redis=require(_0xc41e('0xe'));var authService=require(_0xc41e('0xf'));var qs=require(_0xc41e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc41e('0x11'));var logger=require(_0xc41e('0x12'))(_0xc41e('0x13'));var utils=require(_0xc41e('0x14'));var config=require(_0xc41e('0x15'));var db=require(_0xc41e('0x16'))['db'];config[_0xc41e('0x17')]=_[_0xc41e('0x18')](config[_0xc41e('0x17')],{'host':_0xc41e('0x19'),'port':0x18eb});var socket=require(_0xc41e('0x1a'))(new Redis(config[_0xc41e('0x17')]));require(_0xc41e('0x1b'))[_0xc41e('0x1c')](socket);function respondWithStatusCode(_0x4482d2,_0x3c4dc1){_0x3c4dc1=_0x3c4dc1||0xcc;return function(_0x493333){if(_0x493333){return _0x4482d2[_0xc41e('0x1d')](_0x3c4dc1);}return _0x4482d2[_0xc41e('0x1e')](_0x3c4dc1)[_0xc41e('0x1f')]();};}function respondWithResult(_0x4ae787,_0x404a77){_0x404a77=_0x404a77||0xc8;return function(_0x60547d){if(_0x60547d){return _0x4ae787[_0xc41e('0x1e')](_0x404a77)['json'](_0x60547d);}};}function respondWithFilteredResult(_0x419ac9,_0x43a50a){return function(_0x5b4e9c){if(_0x5b4e9c){var _0x2bb5c8=_0x5b4e9c[_0xc41e('0x20')],_0x44fb0a=_0x43a50a[_0xc41e('0x21')],_0x4400a2=_0x43a50a[_0xc41e('0x21')]+_0x43a50a['limit'],_0x410a3e;if(_0x4400a2>=_0x2bb5c8){_0x4400a2=_0x2bb5c8;_0x410a3e=0xc8;}else{_0x410a3e=0xce;}_0x419ac9['status'](_0x410a3e);return _0x419ac9[_0xc41e('0x22')](_0xc41e('0x23'),_0x44fb0a+'-'+_0x4400a2+'/'+_0x2bb5c8)[_0xc41e('0x24')](_0x5b4e9c);}return null;};}function patchUpdates(_0x3e1d80){return function(_0x5994a3){try{jsonpatch[_0xc41e('0x25')](_0x5994a3,_0x3e1d80,!![]);}catch(_0x786643){return BPromise[_0xc41e('0x26')](_0x786643);}return _0x5994a3[_0xc41e('0x27')]();};}function saveUpdates(_0x49da6f,_0x17bf7d){return function(_0x40ff99){if(_0x40ff99){return _0x40ff99[_0xc41e('0x28')](_0x49da6f)[_0xc41e('0x29')](function(_0x42f9f0){return _0x42f9f0;});}return null;};}function removeEntity(_0x1db62e,_0x867ec4){return function(_0x2b29ac){if(_0x2b29ac){return _0x2b29ac[_0xc41e('0x2a')]()[_0xc41e('0x29')](function(){var _0x4502b7=_0x2b29ac[_0xc41e('0x2b')]({'plain':!![]});var _0x369ac8=_0xc41e('0x2c');return db[_0xc41e('0x2d')][_0xc41e('0x2a')]({'where':{'type':_0x369ac8,'resourceId':_0x4502b7['id']}})[_0xc41e('0x29')](function(){return _0x2b29ac;});})[_0xc41e('0x29')](function(){_0x1db62e[_0xc41e('0x1e')](0xcc)[_0xc41e('0x1f')]();});}};}function handleEntityNotFound(_0x58521f,_0x3f044a){return function(_0x5bafd){if(!_0x5bafd){_0x58521f[_0xc41e('0x1d')](0x194);}return _0x5bafd;};}function handleError(_0x45bc39,_0x4c89b1){_0x4c89b1=_0x4c89b1||0x1f4;return function(_0x28820e){logger[_0xc41e('0x2e')](_0x28820e[_0xc41e('0x2f')]);if(_0x28820e[_0xc41e('0x30')]){delete _0x28820e['name'];}_0x45bc39[_0xc41e('0x1e')](_0x4c89b1)[_0xc41e('0x31')](_0x28820e);};}exports['index']=function(_0x801979,_0x45435c){var _0xf2a7d3={},_0x1c9395={},_0x273c23={'count':0x0,'rows':[]};var _0x207df3=_[_0xc41e('0x32')](db[_0xc41e('0x33')]['rawAttributes'],function(_0x293615){return{'name':_0x293615[_0xc41e('0x34')],'type':_0x293615[_0xc41e('0x35')]['key']};});_0x1c9395[_0xc41e('0x36')]=_[_0xc41e('0x32')](_0x207df3,_0xc41e('0x30'));_0x1c9395[_0xc41e('0x37')]=_[_0xc41e('0x38')](_0x801979['query']);_0x1c9395[_0xc41e('0x39')]=_['intersection'](_0x1c9395['model'],_0x1c9395['query']);_0xf2a7d3['attributes']=_[_0xc41e('0x3a')](_0x1c9395[_0xc41e('0x36')],qs[_0xc41e('0x3b')](_0x801979[_0xc41e('0x37')][_0xc41e('0x3b')]));_0xf2a7d3[_0xc41e('0x3c')]=_0xf2a7d3['attributes'][_0xc41e('0x3d')]?_0xf2a7d3[_0xc41e('0x3c')]:_0x1c9395[_0xc41e('0x36')];if(!_0x801979[_0xc41e('0x37')][_0xc41e('0x3e')](_0xc41e('0x3f'))){_0xf2a7d3[_0xc41e('0x40')]=qs['limit'](_0x801979[_0xc41e('0x37')][_0xc41e('0x40')]);_0xf2a7d3[_0xc41e('0x21')]=qs[_0xc41e('0x21')](_0x801979['query'][_0xc41e('0x21')]);}_0xf2a7d3[_0xc41e('0x41')]=qs[_0xc41e('0x42')](_0x801979[_0xc41e('0x37')][_0xc41e('0x42')]);_0xf2a7d3[_0xc41e('0x43')]=qs[_0xc41e('0x39')](_[_0xc41e('0x44')](_0x801979[_0xc41e('0x37')],_0x1c9395[_0xc41e('0x39')]),_0x207df3);if(_0x801979[_0xc41e('0x37')][_0xc41e('0x45')]){_0xf2a7d3[_0xc41e('0x43')]=_['merge'](_0xf2a7d3[_0xc41e('0x43')],{'$or':_['map'](_0x207df3,function(_0x496c20){if(_0x496c20[_0xc41e('0x35')]!=='VIRTUAL'){var _0x26cbb1={};_0x26cbb1[_0x496c20[_0xc41e('0x30')]]={'$like':'%'+_0x801979['query'][_0xc41e('0x45')]+'%'};return _0x26cbb1;}})});}_0xf2a7d3=_[_0xc41e('0x46')]({},_0xf2a7d3,_0x801979[_0xc41e('0x47')]);var _0x11587f={'where':_0xf2a7d3[_0xc41e('0x43')]};return db['OpenchannelQueue'][_0xc41e('0x20')](_0x11587f)[_0xc41e('0x29')](function(_0x1d2050){_0x273c23['count']=_0x1d2050;if(_0x801979[_0xc41e('0x37')][_0xc41e('0x48')]){_0xf2a7d3[_0xc41e('0x49')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xc41e('0x4a')](_0xf2a7d3);})[_0xc41e('0x29')](function(_0x27e815){_0x273c23[_0xc41e('0x4b')]=_0x27e815;return _0x273c23;})['then'](respondWithFilteredResult(_0x45435c,_0xf2a7d3))['catch'](handleError(_0x45435c,null));};exports[_0xc41e('0x4c')]=function(_0x474205,_0x33cb55){var _0x42d9cf={'raw':!![],'where':{'id':_0x474205[_0xc41e('0x4d')]['id']}},_0x20879b={};_0x20879b[_0xc41e('0x36')]=_[_0xc41e('0x38')](db[_0xc41e('0x33')][_0xc41e('0x4e')]);_0x20879b[_0xc41e('0x37')]=_['keys'](_0x474205[_0xc41e('0x37')]);_0x20879b['filters']=_['intersection'](_0x20879b[_0xc41e('0x36')],_0x20879b['query']);_0x42d9cf[_0xc41e('0x3c')]=_[_0xc41e('0x3a')](_0x20879b['model'],qs[_0xc41e('0x3b')](_0x474205[_0xc41e('0x37')][_0xc41e('0x3b')]));_0x42d9cf[_0xc41e('0x3c')]=_0x42d9cf['attributes'][_0xc41e('0x3d')]?_0x42d9cf['attributes']:_0x20879b[_0xc41e('0x36')];if(_0x474205[_0xc41e('0x37')][_0xc41e('0x48')]){_0x42d9cf[_0xc41e('0x49')]=[{'all':!![]}];}_0x42d9cf=_[_0xc41e('0x46')]({},_0x42d9cf,_0x474205['options']);return db[_0xc41e('0x33')]['find'](_0x42d9cf)['then'](handleEntityNotFound(_0x33cb55,null))['then'](respondWithResult(_0x33cb55,null))[_0xc41e('0x4f')](handleError(_0x33cb55,null));};exports[_0xc41e('0x50')]=function(_0x104d82,_0x13d683){return db[_0xc41e('0x33')]['create'](_0x104d82['body'],{})[_0xc41e('0x29')](function(_0x139a3d){var _0x54d76d=_0x104d82[_0xc41e('0x51')][_0xc41e('0x2b')]({'plain':!![]});if(!_0x54d76d)throw new Error(_0xc41e('0x52'));if(_0x54d76d['role']==='user'){var _0x3609ab=_0x139a3d['get']({'plain':!![]});var _0xd6d77d=_0xc41e('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0xd6d77d,'userProfileId':_0x54d76d['userProfileId']},'raw':!![]})[_0xc41e('0x29')](function(_0x527b18){if(_0x527b18&&_0x527b18[_0xc41e('0x53')]===0x0){return db[_0xc41e('0x2d')][_0xc41e('0x50')]({'name':_0x3609ab[_0xc41e('0x30')],'resourceId':_0x3609ab['id'],'type':_0x527b18[_0xc41e('0x30')],'sectionId':_0x527b18['id']},{})['then'](function(){return _0x139a3d;});}else{return _0x139a3d;}})[_0xc41e('0x4f')](function(_0x3f6ea5){logger[_0xc41e('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f6ea5);throw _0x3f6ea5;});}return _0x139a3d;})['then'](respondWithResult(_0x13d683,0xc9))[_0xc41e('0x4f')](handleError(_0x13d683,null));};exports[_0xc41e('0x28')]=function(_0x239783,_0xe6840f){if(_0x239783[_0xc41e('0x54')]['id']){delete _0x239783['body']['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x239783[_0xc41e('0x4d')]['id']}})['then'](handleEntityNotFound(_0xe6840f,null))['then'](saveUpdates(_0x239783[_0xc41e('0x54')],null))[_0xc41e('0x29')](respondWithResult(_0xe6840f,null))[_0xc41e('0x4f')](handleError(_0xe6840f,null));};exports[_0xc41e('0x2a')]=function(_0x2cb921,_0x5bbdf9){return db['OpenchannelQueue']['find']({'where':{'id':_0x2cb921['params']['id']}})['then'](handleEntityNotFound(_0x5bbdf9,null))[_0xc41e('0x29')](removeEntity(_0x5bbdf9,null))[_0xc41e('0x4f')](handleError(_0x5bbdf9,null));};exports['describe']=function(_0xbf6c66,_0x50b841){return db['OpenchannelQueue'][_0xc41e('0x55')]()[_0xc41e('0x29')](respondWithResult(_0x50b841,null))[_0xc41e('0x4f')](handleError(_0x50b841,null));};exports[_0xc41e('0x56')]=function(_0x3e2250,_0x2a2d99,_0x87a690){var _0x402d18={'raw':!![],'where':{}},_0x1fcc81={},_0x3273ab;return db['OpenchannelQueue'][_0xc41e('0x57')]({'where':{'id':_0x3e2250[_0xc41e('0x4d')]['id']}})[_0xc41e('0x29')](handleEntityNotFound(_0x2a2d99,null))[_0xc41e('0x29')](function(_0x416aa6){if(_0x416aa6){_0x3273ab=_0x416aa6[_0xc41e('0x2b')]({'plain':!![]});_0x1fcc81[_0xc41e('0x36')]=_[_0xc41e('0x38')](db[_0xc41e('0x58')][_0xc41e('0x4e')]);_0x1fcc81[_0xc41e('0x37')]=_[_0xc41e('0x38')](_0x3e2250['query']);_0x1fcc81['filters']=_[_0xc41e('0x3a')](_0x1fcc81[_0xc41e('0x36')],_0x1fcc81[_0xc41e('0x37')]);_0x402d18[_0xc41e('0x3c')]=_['intersection'](_0x1fcc81[_0xc41e('0x36')],qs[_0xc41e('0x3b')](_0x3e2250[_0xc41e('0x37')][_0xc41e('0x3b')]));_0x402d18[_0xc41e('0x3c')]=_0x402d18[_0xc41e('0x3c')][_0xc41e('0x3d')]?_0x402d18['attributes']:_0x1fcc81[_0xc41e('0x36')];if(!_0x3e2250[_0xc41e('0x37')]['hasOwnProperty'](_0xc41e('0x3f'))){_0x402d18[_0xc41e('0x40')]=qs[_0xc41e('0x40')](_0x3e2250[_0xc41e('0x37')]['limit']);_0x402d18[_0xc41e('0x21')]=qs['offset'](_0x3e2250[_0xc41e('0x37')][_0xc41e('0x21')]);}_0x402d18['order']=qs['sort'](_0x3e2250['query'][_0xc41e('0x42')]);_0x402d18[_0xc41e('0x43')]=qs['filters'](_['pick'](_0x3e2250[_0xc41e('0x37')],_0x1fcc81['filters']));_0x402d18[_0xc41e('0x43')][_0xc41e('0x59')]=_0x416aa6['id'];if(_0x3e2250['query'][_0xc41e('0x45')]){_0x402d18[_0xc41e('0x43')]=_[_0xc41e('0x46')](_0x402d18[_0xc41e('0x43')],{'$or':_[_0xc41e('0x32')](_0x402d18[_0xc41e('0x3c')],function(_0x3519c5){var _0x35cffa={};_0x35cffa[_0x3519c5]={'$like':'%'+_0x3e2250[_0xc41e('0x37')][_0xc41e('0x45')]+'%'};return _0x35cffa;})});}_0x402d18=_[_0xc41e('0x46')]({},_0x402d18,_0x3e2250[_0xc41e('0x47')]);return db['UserOpenchannelQueue'][_0xc41e('0x4a')](_0x402d18);}})[_0xc41e('0x29')](function(_0x48fa22){if(_0x48fa22){return db[_0xc41e('0x5a')][_0xc41e('0x5b')]({'where':{'id':_[_0xc41e('0x32')](_0x48fa22,'UserId'),'role':_0xc41e('0x5c')},'attributes':['id',_0xc41e('0x30'),'openchannelPause',_0xc41e('0x5d'),'createdAt']});}})[_0xc41e('0x29')](function(_0x19c0c6){if(_0x19c0c6){return{'count':_0x19c0c6[_0xc41e('0x20')],'rows':_[_0xc41e('0x32')](_0x19c0c6[_0xc41e('0x4b')],function(_0x58986a){return{'membername':_0x58986a['name'],'UserId':_0x58986a['id'],'queue_name':_0x3273ab[_0xc41e('0x30')],'OpenchannelQueueId':_0x3273ab['id'],'interface':util[_0xc41e('0x5e')]('%s/%s',_0xc41e('0x5f'),_0x58986a[_0xc41e('0x30')]),'penalty':0x0,'paused':_0x58986a[_0xc41e('0x60')],'createdAt':_0x58986a[_0xc41e('0x61')],'updatedAt':_0x58986a[_0xc41e('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc41e('0x29')](respondWithFilteredResult(_0x2a2d99,_0x402d18))[_0xc41e('0x4f')](handleError(_0x2a2d99,null));};exports['getTeams']=function(_0x5382e2,_0x527fae,_0x304f5f){var _0x44a852={};var _0x2cb7f4={};var _0x462584;var _0x423343;return db['OpenchannelQueue'][_0xc41e('0x57')]({'where':{'id':_0x5382e2[_0xc41e('0x4d')]['id']}})[_0xc41e('0x29')](handleEntityNotFound(_0x527fae,null))[_0xc41e('0x29')](function(_0x434f28){if(_0x434f28){_0x462584=_0x434f28;_0x2cb7f4['model']=_['keys'](db[_0xc41e('0x62')]['rawAttributes']);_0x2cb7f4[_0xc41e('0x37')]=_[_0xc41e('0x38')](_0x5382e2['query']);_0x2cb7f4[_0xc41e('0x39')]=_[_0xc41e('0x3a')](_0x2cb7f4[_0xc41e('0x36')],_0x2cb7f4['query']);_0x44a852[_0xc41e('0x3c')]=_[_0xc41e('0x3a')](_0x2cb7f4[_0xc41e('0x36')],qs[_0xc41e('0x3b')](_0x5382e2[_0xc41e('0x37')][_0xc41e('0x3b')]));_0x44a852['attributes']=_0x44a852[_0xc41e('0x3c')]['length']?_0x44a852['attributes']:_0x2cb7f4[_0xc41e('0x36')];_0x44a852['order']=qs[_0xc41e('0x42')](_0x5382e2[_0xc41e('0x37')][_0xc41e('0x42')]);_0x44a852['where']=qs[_0xc41e('0x39')](_['pick'](_0x5382e2[_0xc41e('0x37')],_0x2cb7f4[_0xc41e('0x39')]));if(_0x5382e2[_0xc41e('0x37')][_0xc41e('0x45')]){_0x44a852[_0xc41e('0x43')]=_[_0xc41e('0x46')](_0x44a852[_0xc41e('0x43')],{'$or':_[_0xc41e('0x32')](_0x44a852['attributes'],function(_0x4992e2){var _0x332f14={};_0x332f14[_0x4992e2]={'$like':'%'+_0x5382e2[_0xc41e('0x37')][_0xc41e('0x45')]+'%'};return _0x332f14;})});}_0x44a852=_[_0xc41e('0x46')]({},_0x44a852,_0x5382e2['options']);return _0x462584[_0xc41e('0x63')](_0x44a852);}})['then'](function(_0x1b4c14){if(_0x1b4c14){_0x423343=_0x1b4c14[_0xc41e('0x3d')];if(!_0x5382e2[_0xc41e('0x37')][_0xc41e('0x3e')](_0xc41e('0x3f'))){_0x44a852[_0xc41e('0x40')]=qs[_0xc41e('0x40')](_0x5382e2['query'][_0xc41e('0x40')]);_0x44a852['offset']=qs[_0xc41e('0x21')](_0x5382e2[_0xc41e('0x37')][_0xc41e('0x21')]);}return _0x462584['getTeams'](_0x44a852);}})[_0xc41e('0x29')](function(_0x26064e){if(_0x26064e){return _0x26064e?{'count':_0x423343,'rows':_0x26064e}:null;}})[_0xc41e('0x29')](respondWithResult(_0x527fae,null))[_0xc41e('0x4f')](handleError(_0x527fae,null));};exports[_0xc41e('0x64')]=function(_0x22107c,_0x4fc951,_0x390a1b){var _0x32b71b=_0x22107c[_0xc41e('0x54')][_0xc41e('0x65')];return db[_0xc41e('0x62')][_0xc41e('0x4a')]({'where':{'id':_0x32b71b},'attributes':['id'],'include':[{'model':db[_0xc41e('0x5a')],'as':_0xc41e('0x66'),'attributes':['id',_0xc41e('0x30'),'online','voicePause','interface'],'raw':!![]}]})[_0xc41e('0x29')](function(_0x4eb44b){if(_0x4eb44b){var _0x2db452=_[_0xc41e('0x67')](_0x4eb44b,function(_0x44d747){var _0x28b910=_0x44d747[_0xc41e('0x2b')]({'plain':!![]});return _0x28b910[_0xc41e('0x66')];});return db['OpenchannelQueue'][_0xc41e('0x68')]({'where':{'id':_0x22107c['params']['id']}})['then'](function(_0x5e6418){return db['sequelize'][_0xc41e('0x69')](function(_0x2c71f0){return _0x5e6418['addTeams'](_0x32b71b,{'transaction':_0x2c71f0})[_0xc41e('0x29')](function(){return BPromise[_0xc41e('0x6a')](_0x2db452,function(_0x446533){return db[_0xc41e('0x58')]['findOrCreate']({'where':{'UserId':_0x446533['id'],'OpenchannelQueueId':_0x22107c['params']['id']},'transaction':_0x2c71f0});});})[_0xc41e('0x29')](function(){_0x2db452[_0xc41e('0x6b')](function(_0x178563){socket[_0xc41e('0x6c')]('userOpenchannelQueue:save',{'UserId':_0x178563['id'],'OpenchannelQueueId':_0x5e6418['id']});});});});});}})['then'](respondWithStatusCode(_0x4fc951,null))[_0xc41e('0x4f')](handleError(_0x4fc951,null));};exports[_0xc41e('0x6d')]=function(_0x4130a3,_0xcfb591,_0x2619ca){return db['Team'][_0xc41e('0x4a')]({'where':{'id':_0x4130a3[_0xc41e('0x37')][_0xc41e('0x65')]},'attributes':['id'],'include':[{'model':db[_0xc41e('0x5a')],'as':_0xc41e('0x66'),'attributes':['id'],'raw':!![]}]})[_0xc41e('0x29')](handleEntityNotFound(_0xcfb591,null))['then'](function(_0x1282a7){var _0x1856d8=_[_0xc41e('0x32')](_0x1282a7,'id');var _0x4cae82=[];var _0x553fd7=[];var _0x3a14b6=squel[_0xc41e('0x6e')]();_0x3a14b6['field'](_0xc41e('0x6f'))[_0xc41e('0x70')](_0xc41e('0x71'),'tq')[_0xc41e('0x72')]('user_has_teams','ut',_0xc41e('0x73'))[_0xc41e('0x43')]('OpenchannelQueueId\x20=\x20?',_0x4130a3[_0xc41e('0x4d')]['id']);for(var _0x449b06=0x0;_0x449b06<_0x1282a7[_0xc41e('0x3d')];_0x449b06+=0x1){let _0x2854a4=_0x1282a7[_0x449b06];for(var _0x402588=0x0;_0x402588<_0x2854a4['Agents'][_0xc41e('0x3d')];_0x402588+=0x1){let _0x2e8971=_0x2854a4[_0xc41e('0x66')][_0x402588];var _0xb37c4e=_0x3a14b6['clone']();_0xb37c4e[_0xc41e('0x43')](_0xc41e('0x74'),_0x2e8971['id']);_0x553fd7[_0xc41e('0x75')](db[_0xc41e('0x76')][_0xc41e('0x37')](_0xb37c4e[_0xc41e('0x77')](),{'type':db['sequelize'][_0xc41e('0x78')][_0xc41e('0x79')]})[_0xc41e('0x29')](function(_0x8c4b40){if(_0x8c4b40[_0xc41e('0x3d')]===0x1){return _0x2e8971['id'];}else{var _0x241f7f=_[_0xc41e('0x7a')](_[_0xc41e('0x32')](_0x8c4b40,_0xc41e('0x7b')),function(_0xf29fcc){return _['includes'](_0x1856d8,_0xf29fcc);});if(_0x241f7f){return _0x2e8971['id'];}}}));}}return BPromise[_0xc41e('0x7c')](_0x553fd7)[_0xc41e('0x29')](function(_0x2f708f){_0x4cae82=_(_0x4cae82)[_0xc41e('0x7d')](_0x2f708f)['compact']()['value']();return db[_0xc41e('0x33')][_0xc41e('0x68')]({'where':{'id':_0x4130a3[_0xc41e('0x4d')]['id']}})[_0xc41e('0x29')](function(_0x37c342){return db[_0xc41e('0x76')][_0xc41e('0x69')](function(_0x480054){return _0x37c342[_0xc41e('0x6d')](_0x4130a3[_0xc41e('0x37')][_0xc41e('0x65')],{'transaction':_0x480054})[_0xc41e('0x29')](function(){if(!_[_0xc41e('0x7e')](_0x4cae82)){return _0x37c342['removeAgents'](_0x4cae82,{'transaction':_0x480054});}})[_0xc41e('0x29')](function(){_0x4cae82[_0xc41e('0x6b')](function(_0x1c7ea9){socket[_0xc41e('0x6c')](_0xc41e('0x7f'),{'UserId':_0x1c7ea9,'OpenchannelQueueId':_0x37c342['id']});});});});});});})['then'](respondWithStatusCode(_0xcfb591,null))[_0xc41e('0x4f')](handleError(_0xcfb591,null));};exports['addAgents']=function(_0x14a4e1,_0x1318b7,_0x3ba70f){return db[_0xc41e('0x33')]['find']({'where':{'id':_0x14a4e1[_0xc41e('0x4d')]['id']}})[_0xc41e('0x29')](handleEntityNotFound(_0x1318b7,null))[_0xc41e('0x29')](function(_0x1248c9){if(_0x1248c9){return _0x1248c9[_0xc41e('0x80')](_0x14a4e1[_0xc41e('0x54')][_0xc41e('0x65')],_[_0xc41e('0x81')](_0x14a4e1[_0xc41e('0x54')],[_0xc41e('0x65'),'id'])||{})[_0xc41e('0x82')](function(_0x30825c){for(var _0x43d3b0=0x0;_0x43d3b0<_0x14a4e1['body'][_0xc41e('0x65')][_0xc41e('0x3d')];_0x43d3b0+=0x1){socket[_0xc41e('0x6c')](_0xc41e('0x83'),{'UserId':_0x14a4e1[_0xc41e('0x54')][_0xc41e('0x65')][_0x43d3b0],'OpenchannelQueueId':_0x14a4e1[_0xc41e('0x4d')]['id']});}return _0x30825c;});}})[_0xc41e('0x29')](respondWithResult(_0x1318b7,null))[_0xc41e('0x4f')](handleError(_0x1318b7,null));};exports[_0xc41e('0x84')]=function(_0x138860,_0x59f8b4,_0x371e6d){return db[_0xc41e('0x33')][_0xc41e('0x68')]({'where':{'id':_0x138860[_0xc41e('0x4d')]['id']}})[_0xc41e('0x29')](handleEntityNotFound(_0x59f8b4,null))[_0xc41e('0x29')](function(_0x55949d){if(_0x55949d){return _0x55949d['removeAgents'](_0x138860[_0xc41e('0x37')]['ids'])[_0xc41e('0x29')](function(){if(_['isArray'](_0x138860[_0xc41e('0x37')][_0xc41e('0x65')])){for(var _0x93b696=0x0;_0x93b696<_0x138860[_0xc41e('0x37')][_0xc41e('0x65')][_0xc41e('0x3d')];_0x93b696+=0x1){socket[_0xc41e('0x6c')](_0xc41e('0x7f'),{'UserId':Number(_0x138860[_0xc41e('0x37')]['ids'][_0x93b696]),'OpenchannelQueueId':Number(_0x138860['params']['id'])});}}else{socket[_0xc41e('0x6c')](_0xc41e('0x7f'),{'UserId':Number(_0x138860[_0xc41e('0x37')][_0xc41e('0x65')]),'OpenchannelQueueId':Number(_0x138860['params']['id'])});}});}})['then'](respondWithStatusCode(_0x59f8b4,null))[_0xc41e('0x4f')](handleError(_0x59f8b4,null));};exports['getAgents']=function(_0x21672b,_0x16adb3,_0x8b36ec){var _0x2bce62={};var _0x48a38f={};var _0x1e95d2;var _0x195250;return db[_0xc41e('0x33')][_0xc41e('0x57')]({'where':{'id':_0x21672b[_0xc41e('0x4d')]['id']}})[_0xc41e('0x29')](handleEntityNotFound(_0x16adb3,null))['then'](function(_0x36f55a){if(_0x36f55a){_0x1e95d2=_0x36f55a;_0x48a38f[_0xc41e('0x36')]=_['keys'](db[_0xc41e('0x5a')][_0xc41e('0x4e')]);_0x48a38f['query']=_[_0xc41e('0x38')](_0x21672b[_0xc41e('0x37')]);_0x48a38f['filters']=_[_0xc41e('0x3a')](_0x48a38f[_0xc41e('0x36')],_0x48a38f['query']);_0x2bce62[_0xc41e('0x3c')]=_[_0xc41e('0x3a')](_0x48a38f[_0xc41e('0x36')],qs[_0xc41e('0x3b')](_0x21672b[_0xc41e('0x37')]['fields']));_0x2bce62[_0xc41e('0x3c')]=_0x2bce62[_0xc41e('0x3c')][_0xc41e('0x3d')]?_0x2bce62[_0xc41e('0x3c')]:_0x48a38f[_0xc41e('0x36')];_0x2bce62[_0xc41e('0x41')]=qs['sort'](_0x21672b[_0xc41e('0x37')][_0xc41e('0x42')]);_0x2bce62['where']=qs[_0xc41e('0x39')](_['pick'](_0x21672b[_0xc41e('0x37')],_0x48a38f['filters']));if(_0x21672b['query'][_0xc41e('0x45')]){_0x2bce62['where']=_[_0xc41e('0x46')](_0x2bce62[_0xc41e('0x43')],{'$or':_[_0xc41e('0x32')](_0x2bce62[_0xc41e('0x3c')],function(_0x293e18){var _0x448360={};_0x448360[_0x293e18]={'$like':'%'+_0x21672b[_0xc41e('0x37')][_0xc41e('0x45')]+'%'};return _0x448360;})});}_0x2bce62=_[_0xc41e('0x46')]({},_0x2bce62,_0x21672b[_0xc41e('0x47')]);return _0x1e95d2['getAgents'](_0x2bce62);}})[_0xc41e('0x29')](function(_0x278d2e){if(_0x278d2e){_0x195250=_0x278d2e[_0xc41e('0x3d')];if(!_0x21672b[_0xc41e('0x37')][_0xc41e('0x3e')](_0xc41e('0x3f'))){_0x2bce62['limit']=qs[_0xc41e('0x40')](_0x21672b[_0xc41e('0x37')][_0xc41e('0x40')]);_0x2bce62['offset']=qs[_0xc41e('0x21')](_0x21672b['query'][_0xc41e('0x21')]);}return _0x1e95d2[_0xc41e('0x85')](_0x2bce62);}})['then'](function(_0x47d126){if(_0x47d126){return _0x47d126?{'count':_0x195250,'rows':_0x47d126}:null;}})[_0xc41e('0x29')](respondWithResult(_0x16adb3,null))[_0xc41e('0x4f')](handleError(_0x16adb3,null));};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js
index 0f3167a..ee9e756 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 _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
+var _0x0bc8=['emit','hook','exports','../../mysqldb','OpenchannelQueue','setMaxListeners','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bc8,0x1a3));var _0x80bc=function(_0x5852dd,_0x3070d8){_0x5852dd=_0x5852dd-0x0;var _0x4aa03f=_0x0bc8[_0x5852dd];return _0x4aa03f;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x80bc('0x0'))['db'][_0x80bc('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x80bc('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x80bc('0x3'),'afterDestroy':_0x80bc('0x4')};function emitEvent(_0x237478){return function(_0x280966,_0x511cf4,_0x2bfe3f){OpenchannelQueueEvents['emit'](_0x237478+':'+_0x280966['id'],_0x280966);OpenchannelQueueEvents[_0x80bc('0x5')](_0x237478,_0x280966);_0x2bfe3f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x80bc('0x6')](e,emitEvent(event));}}module[_0x80bc('0x7')]=OpenchannelQueueEvents;
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js
index 542c0ca..f2d15e6 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 _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
+var _0x92f4=['OpenchannelQueue','openchannel_queues','util','api','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x19497a,_0xfca7d1){var _0x2a1f3e=function(_0x15ec33){while(--_0x15ec33){_0x19497a['push'](_0x19497a['shift']());}};_0x2a1f3e(++_0xfca7d1);}(_0x92f4,0x188));var _0x492f=function(_0x2eaedf,_0x481885){_0x2eaedf=_0x2eaedf-0x0;var _0x4b0bf8=_0x92f4[_0x2eaedf];return _0x4b0bf8;};'use strict';var _=require('lodash');var util=require(_0x492f('0x0'));var logger=require('../../config/logger')(_0x492f('0x1'));var moment=require('moment');var BPromise=require(_0x492f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x492f('0x3'));var rimraf=require(_0x492f('0x4'));var config=require(_0x492f('0x5'));var attributes=require('./openchannelQueue.attributes');module[_0x492f('0x6')]=function(_0x35b737,_0x58169b){return _0x35b737[_0x492f('0x7')](_0x492f('0x8'),attributes,{'tableName':_0x492f('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 b045bbc..9f4be19 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 _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
+var _0x1ffc=['limit','include','map','debug','ShowOpenchannelQueue','find','model','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','attributes'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0x1ffc,0xfe));var _0xc1ff=function(_0x2c1a5e,_0x550e3d){_0x2c1a5e=_0x2c1a5e-0x0;var _0x4cbf6e=_0x1ffc[_0x2c1a5e];return _0x4cbf6e;};'use strict';var _=require(_0xc1ff('0x0'));var util=require(_0xc1ff('0x1'));var moment=require(_0xc1ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xc1ff('0x3'));var fs=require('fs');var Redis=require(_0xc1ff('0x4'));var db=require(_0xc1ff('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc1ff('0x6'))(_0xc1ff('0x7'));var config=require('../../config/environment');var jayson=require(_0xc1ff('0x8'));var client=jayson[_0xc1ff('0x9')][_0xc1ff('0xa')]({'port':0x232a});config[_0xc1ff('0xb')]=_[_0xc1ff('0xc')](config[_0xc1ff('0xb')],{'host':_0xc1ff('0xd'),'port':0x18eb});var socket=require(_0xc1ff('0xe'))(new Redis(config['redis']));require(_0xc1ff('0xf'))[_0xc1ff('0x10')](socket);function respondWithRpcPromise(_0x33a562,_0x1ff84c,_0x131193){return new BPromise(function(_0x593556,_0xa676d2){return client[_0xc1ff('0x11')](_0x33a562,_0x131193)['then'](function(_0x5bc8e6){logger[_0xc1ff('0x12')](_0xc1ff('0x13'),_0x1ff84c,'request\x20sent');logger['debug'](_0xc1ff('0x14'),_0x1ff84c,_0xc1ff('0x15'),JSON[_0xc1ff('0x16')](_0x5bc8e6));if(_0x5bc8e6[_0xc1ff('0x17')]){if(_0x5bc8e6['error'][_0xc1ff('0x18')]===0x1f4){logger['error'](_0xc1ff('0x13'),_0x1ff84c,_0x5bc8e6[_0xc1ff('0x17')][_0xc1ff('0x19')]);return _0xa676d2(_0x5bc8e6['error']['message']);}logger[_0xc1ff('0x17')](_0xc1ff('0x13'),_0x1ff84c,_0x5bc8e6[_0xc1ff('0x17')]['message']);return _0x593556(_0x5bc8e6[_0xc1ff('0x17')]['message']);}else{logger[_0xc1ff('0x12')](_0xc1ff('0x13'),_0x1ff84c,_0xc1ff('0x15'));_0x593556(_0x5bc8e6[_0xc1ff('0x1a')][_0xc1ff('0x19')]);}})[_0xc1ff('0x1b')](function(_0x58f7be){logger[_0xc1ff('0x17')](_0xc1ff('0x13'),_0x1ff84c,_0x58f7be);_0xa676d2(_0x58f7be);});});}exports[_0xc1ff('0x1c')]=function(_0x55196e){var _0xcca83e=this;return new Promise(function(_0xdbe473,_0x210be1){return db[_0xc1ff('0x1d')]['findAll']({'raw':_0x55196e[_0xc1ff('0x1e')]?_0x55196e[_0xc1ff('0x1e')][_0xc1ff('0x1f')]===undefined?!![]:![]:!![],'where':_0x55196e['options']?_0x55196e['options']['where']||null:null,'attributes':_0x55196e[_0xc1ff('0x1e')]?_0x55196e[_0xc1ff('0x1e')][_0xc1ff('0x20')]||null:null,'limit':_0x55196e['options']?_0x55196e[_0xc1ff('0x1e')][_0xc1ff('0x21')]||null:null,'include':_0x55196e[_0xc1ff('0x1e')]?_0x55196e['options'][_0xc1ff('0x22')]?_[_0xc1ff('0x23')](_0x55196e[_0xc1ff('0x1e')][_0xc1ff('0x22')],function(_0x13ed1e){return{'model':db[_0x13ed1e['model']],'as':_0x13ed1e['as'],'attributes':_0x13ed1e[_0xc1ff('0x20')],'include':_0x13ed1e[_0xc1ff('0x22')]?_[_0xc1ff('0x23')](_0x13ed1e[_0xc1ff('0x22')],function(_0x42e71f){return{'model':db[_0x42e71f['model']],'as':_0x42e71f['as'],'attributes':_0x42e71f[_0xc1ff('0x20')],'include':_0x42e71f['include']?_['map'](_0x42e71f[_0xc1ff('0x22')],function(_0x53a13a){return{'model':db[_0x53a13a['model']],'as':_0x53a13a['as'],'attributes':_0x53a13a[_0xc1ff('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5efa48){logger['info'](_0xc1ff('0x1c'),_0x55196e);logger[_0xc1ff('0x24')](_0xc1ff('0x1c'),_0x55196e,JSON['stringify'](_0x5efa48));_0xdbe473(_0x5efa48);})['catch'](function(_0x3a6c9f){logger[_0xc1ff('0x17')](_0xc1ff('0x1c'),_0x3a6c9f[_0xc1ff('0x19')],_0x55196e);_0x210be1(_0xcca83e['error'](0x1f4,_0x3a6c9f[_0xc1ff('0x19')]));});});};exports[_0xc1ff('0x25')]=function(_0x4ce44e){var _0x43a09c=this;return new Promise(function(_0x286d35,_0x247535){return db['OpenchannelQueue'][_0xc1ff('0x26')]({'raw':_0x4ce44e[_0xc1ff('0x1e')]?_0x4ce44e[_0xc1ff('0x1e')][_0xc1ff('0x1f')]===undefined?!![]:![]:!![],'where':_0x4ce44e[_0xc1ff('0x1e')]?_0x4ce44e['options']['where']||null:null,'attributes':_0x4ce44e['options']?_0x4ce44e[_0xc1ff('0x1e')][_0xc1ff('0x20')]||null:null,'include':_0x4ce44e[_0xc1ff('0x1e')]?_0x4ce44e[_0xc1ff('0x1e')][_0xc1ff('0x22')]?_[_0xc1ff('0x23')](_0x4ce44e[_0xc1ff('0x1e')]['include'],function(_0x121fcc){return{'model':db[_0x121fcc[_0xc1ff('0x27')]],'as':_0x121fcc['as'],'attributes':_0x121fcc[_0xc1ff('0x20')],'include':_0x121fcc[_0xc1ff('0x22')]?_['map'](_0x121fcc[_0xc1ff('0x22')],function(_0x3c58fd){return{'model':db[_0x3c58fd[_0xc1ff('0x27')]],'as':_0x3c58fd['as'],'attributes':_0x3c58fd[_0xc1ff('0x20')],'include':_0x3c58fd[_0xc1ff('0x22')]?_[_0xc1ff('0x23')](_0x3c58fd[_0xc1ff('0x22')],function(_0x1affa7){return{'model':db[_0x1affa7['model']],'as':_0x1affa7['as'],'attributes':_0x1affa7['attributes']};}):[]};}):[]};}):[]:[]})[_0xc1ff('0x28')](function(_0x4d1ee3){logger[_0xc1ff('0x12')](_0xc1ff('0x25'),_0x4ce44e);logger[_0xc1ff('0x24')](_0xc1ff('0x25'),_0x4ce44e,JSON[_0xc1ff('0x16')](_0x4d1ee3));_0x286d35(_0x4d1ee3);})[_0xc1ff('0x1b')](function(_0x51e16f){logger['error'](_0xc1ff('0x25'),_0x51e16f[_0xc1ff('0x19')],_0x4ce44e);_0x247535(_0x43a09c[_0xc1ff('0x17')](0x1f4,_0x51e16f['message']));});});};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js
index 2b20254..2bbff47 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 _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
+var _0x5854=['register','./openchannelQueue.events','remove','update','emit','removeListener'];(function(_0x4f2654,_0x3636c4){var _0x25a297=function(_0x28872c){while(--_0x28872c){_0x4f2654['push'](_0x4f2654['shift']());}};_0x25a297(++_0x3636c4);}(_0x5854,0x15d));var _0x4585=function(_0x44364,_0x350475){_0x44364=_0x44364-0x0;var _0x40b63b=_0x5854[_0x44364];return _0x40b63b;};'use strict';var OpenchannelQueueEvents=require(_0x4585('0x0'));var events=['save',_0x4585('0x1'),_0x4585('0x2')];function createListener(_0x360d74,_0x15b041){return function(_0x5e5c59){_0x15b041[_0x4585('0x3')](_0x360d74,_0x5e5c59);};}function removeListener(_0x518dfa,_0xdbfe52){return function(){OpenchannelQueueEvents[_0x4585('0x4')](_0x518dfa,_0xdbfe52);};}exports[_0x4585('0x5')]=function(_0x34ee88){for(var _0x5bada8=0x0,_0x592dd3=events['length'];_0x5bada8<_0x592dd3;_0x5bada8++){var _0x1738bc=events[_0x5bada8];var _0x42e55a=createListener('openchannelQueue:'+_0x1738bc,_0x34ee88);OpenchannelQueueEvents['on'](_0x1738bc,_0x42e55a);}};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js
index 5206fd6..59dd7b7 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 _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
+var _0xad5d=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','put','update','delete','multer','util','path','connect-timeout','express'];(function(_0xb78b09,_0x4b792b){var _0x272536=function(_0x4af4b7){while(--_0x4af4b7){_0xb78b09['push'](_0xb78b09['shift']());}};_0x272536(++_0x4b792b);}(_0xad5d,0x187));var _0xdad5=function(_0x77b71d,_0x38e802){_0x77b71d=_0x77b71d-0x0;var _0x1b6255=_0xad5d[_0x77b71d];return _0x1b6255;};'use strict';var multer=require(_0xdad5('0x0'));var util=require(_0xdad5('0x1'));var path=require(_0xdad5('0x2'));var timeout=require(_0xdad5('0x3'));var express=require(_0xdad5('0x4'));var router=express[_0xdad5('0x5')]();var auth=require(_0xdad5('0x6'));var interaction=require(_0xdad5('0x7'));var config=require(_0xdad5('0x8'));var controller=require(_0xdad5('0x9'));router[_0xdad5('0xa')]('/',auth[_0xdad5('0xb')](),controller['index']);router[_0xdad5('0xa')](_0xdad5('0xc'),auth[_0xdad5('0xb')](),controller['describe']);router[_0xdad5('0xa')](_0xdad5('0xd'),auth[_0xdad5('0xb')](),controller['show']);router[_0xdad5('0xe')]('/',auth[_0xdad5('0xb')](),controller['create']);router[_0xdad5('0xf')](_0xdad5('0xd'),auth[_0xdad5('0xb')](),controller[_0xdad5('0x10')]);router[_0xdad5('0x11')](_0xdad5('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
index 2e37e60..0d3302f 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 _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
+var _0xfdc2=['DATE','moment','sequelize','exports','STRING'];(function(_0x635e28,_0x4eecc1){var _0x5bb9dc=function(_0x4e4486){while(--_0x4e4486){_0x635e28['push'](_0x635e28['shift']());}};_0x5bb9dc(++_0x4eecc1);}(_0xfdc2,0xd8));var _0x2fdc=function(_0x4ed278,_0x1ccc2e){_0x4ed278=_0x4ed278-0x0;var _0x1b3866=_0xfdc2[_0x4ed278];return _0x1b3866;};'use strict';var moment=require(_0x2fdc('0x0'));var Sequelize=require(_0x2fdc('0x1'));module[_0x2fdc('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x2fdc('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2fdc('0x4')]},'exitAt':{'type':Sequelize[_0x2fdc('0x4')]},'reason':{'type':Sequelize[_0x2fdc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js
index 1554567..71d4b5d 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 _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
+var _0x61c2=['params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filters','filter','where','VIRTUAL','merge','options','rows','include','find','catch','create','body'];(function(_0x6f1a87,_0x5d5bcf){var _0x2495c7=function(_0x1c6733){while(--_0x1c6733){_0x6f1a87['push'](_0x6f1a87['shift']());}};_0x2495c7(++_0x5d5bcf);}(_0x61c2,0x11f));var _0x261c=function(_0x470b74,_0x3f4052){_0x470b74=_0x470b74-0x0;var _0x59c4c3=_0x61c2[_0x470b74];return _0x59c4c3;};'use strict';var pdf=require(_0x261c('0x0'));var emlformat=require(_0x261c('0x1'));var rimraf=require(_0x261c('0x2'));var zipdir=require(_0x261c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x261c('0x4'));var BPromise=require(_0x261c('0x5'));var Mustache=require(_0x261c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x261c('0x7'));var csv=require('to-csv');var ejs=require(_0x261c('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x261c('0x9'));var jsforce=require(_0x261c('0xa'));var deskjs=require(_0x261c('0xb'));var toCsv=require(_0x261c('0xc'));var querystring=require(_0x261c('0xd'));var Papa=require(_0x261c('0xe'));var Redis=require(_0x261c('0xf'));var authService=require(_0x261c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x261c('0x11'));var hardwareService=require(_0x261c('0x12'));var logger=require(_0x261c('0x13'))('api');var utils=require(_0x261c('0x14'));var config=require(_0x261c('0x15'));var db=require(_0x261c('0x16'))['db'];function respondWithStatusCode(_0x27e5fc,_0x56e550){_0x56e550=_0x56e550||0xcc;return function(_0x3caf40){if(_0x3caf40){return _0x27e5fc[_0x261c('0x17')](_0x56e550);}return _0x27e5fc['status'](_0x56e550)[_0x261c('0x18')]();};}function respondWithResult(_0x20af1a,_0x4da031){_0x4da031=_0x4da031||0xc8;return function(_0x1c5a24){if(_0x1c5a24){return _0x20af1a[_0x261c('0x19')](_0x4da031)[_0x261c('0x1a')](_0x1c5a24);}};}function respondWithFilteredResult(_0x1d5319,_0x48fd51){return function(_0x3a6ad9){if(_0x3a6ad9){var _0x27a3c9=_0x3a6ad9[_0x261c('0x1b')],_0x234a12=_0x48fd51[_0x261c('0x1c')],_0x4d625f=_0x48fd51[_0x261c('0x1c')]+_0x48fd51[_0x261c('0x1d')],_0x21b5d4;if(_0x4d625f>=_0x27a3c9){_0x4d625f=_0x27a3c9;_0x21b5d4=0xc8;}else{_0x21b5d4=0xce;}_0x1d5319[_0x261c('0x19')](_0x21b5d4);return _0x1d5319[_0x261c('0x1e')]('Content-Range',_0x234a12+'-'+_0x4d625f+'/'+_0x27a3c9)[_0x261c('0x1a')](_0x3a6ad9);}return null;};}function patchUpdates(_0x5730da){return function(_0x257055){try{jsonpatch[_0x261c('0x1f')](_0x257055,_0x5730da,!![]);}catch(_0x59f2d6){return BPromise[_0x261c('0x20')](_0x59f2d6);}return _0x257055[_0x261c('0x21')]();};}function saveUpdates(_0x1ef550,_0x5f3288){return function(_0x4cd1e0){if(_0x4cd1e0){return _0x4cd1e0[_0x261c('0x22')](_0x1ef550)[_0x261c('0x23')](function(_0x58da00){return _0x58da00;});}return null;};}function removeEntity(_0x10c489,_0x13a947){return function(_0x8fea){if(_0x8fea){return _0x8fea['destroy']()[_0x261c('0x23')](function(){_0x10c489['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56e7cd,_0x173cbc){return function(_0x398b2c){if(!_0x398b2c){_0x56e7cd[_0x261c('0x17')](0x194);}return _0x398b2c;};}function handleError(_0x317655,_0x378d70){_0x378d70=_0x378d70||0x1f4;return function(_0x2c211c){logger[_0x261c('0x24')](_0x2c211c['stack']);if(_0x2c211c[_0x261c('0x25')]){delete _0x2c211c[_0x261c('0x25')];}_0x317655[_0x261c('0x19')](_0x378d70)[_0x261c('0x26')](_0x2c211c);};}exports[_0x261c('0x27')]=function(_0x282242,_0x3bbe9d){var _0x20666f={},_0x52c23={},_0x2df6d3={'count':0x0,'rows':[]};var _0x553742=_[_0x261c('0x28')](db[_0x261c('0x29')][_0x261c('0x2a')],function(_0xd8f8a5){return{'name':_0xd8f8a5[_0x261c('0x2b')],'type':_0xd8f8a5[_0x261c('0x2c')][_0x261c('0x2d')]};});_0x52c23[_0x261c('0x2e')]=_['map'](_0x553742,'name');_0x52c23[_0x261c('0x2f')]=_[_0x261c('0x30')](_0x282242[_0x261c('0x2f')]);_0x52c23['filters']=_['intersection'](_0x52c23[_0x261c('0x2e')],_0x52c23[_0x261c('0x2f')]);_0x20666f[_0x261c('0x31')]=_[_0x261c('0x32')](_0x52c23['model'],qs[_0x261c('0x33')](_0x282242[_0x261c('0x2f')][_0x261c('0x33')]));_0x20666f[_0x261c('0x31')]=_0x20666f['attributes']['length']?_0x20666f[_0x261c('0x31')]:_0x52c23[_0x261c('0x2e')];if(!_0x282242[_0x261c('0x2f')][_0x261c('0x34')]('nolimit')){_0x20666f[_0x261c('0x1d')]=qs[_0x261c('0x1d')](_0x282242[_0x261c('0x2f')]['limit']);_0x20666f[_0x261c('0x1c')]=qs[_0x261c('0x1c')](_0x282242['query'][_0x261c('0x1c')]);}_0x20666f[_0x261c('0x35')]=qs[_0x261c('0x36')](_0x282242[_0x261c('0x2f')]['sort']);_0x20666f['where']=qs['filters'](_[_0x261c('0x37')](_0x282242[_0x261c('0x2f')],_0x52c23[_0x261c('0x38')]),_0x553742);if(_0x282242[_0x261c('0x2f')][_0x261c('0x39')]){_0x20666f['where']=_['merge'](_0x20666f[_0x261c('0x3a')],{'$or':_[_0x261c('0x28')](_0x553742,function(_0x15ca83){if(_0x15ca83['type']!==_0x261c('0x3b')){var _0x37d45c={};_0x37d45c[_0x15ca83[_0x261c('0x25')]]={'$like':'%'+_0x282242[_0x261c('0x2f')][_0x261c('0x39')]+'%'};return _0x37d45c;}})});}_0x20666f=_[_0x261c('0x3c')]({},_0x20666f,_0x282242[_0x261c('0x3d')]);var _0x30c869={'where':_0x20666f[_0x261c('0x3a')]};return db[_0x261c('0x29')][_0x261c('0x1b')](_0x30c869)['then'](function(_0x15161c){_0x2df6d3[_0x261c('0x1b')]=_0x15161c;if(_0x282242[_0x261c('0x2f')]['includeAll']){_0x20666f['include']=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x20666f);})[_0x261c('0x23')](function(_0x13e24f){_0x2df6d3[_0x261c('0x3e')]=_0x13e24f;return _0x2df6d3;})[_0x261c('0x23')](respondWithFilteredResult(_0x3bbe9d,_0x20666f))['catch'](handleError(_0x3bbe9d,null));};exports['show']=function(_0x2723fa,_0x1684a1){var _0x5580fd={'raw':!![],'where':{'id':_0x2723fa['params']['id']}},_0xb9f54c={};_0xb9f54c['model']=_[_0x261c('0x30')](db[_0x261c('0x29')]['rawAttributes']);_0xb9f54c['query']=_[_0x261c('0x30')](_0x2723fa[_0x261c('0x2f')]);_0xb9f54c[_0x261c('0x38')]=_[_0x261c('0x32')](_0xb9f54c['model'],_0xb9f54c[_0x261c('0x2f')]);_0x5580fd[_0x261c('0x31')]=_[_0x261c('0x32')](_0xb9f54c[_0x261c('0x2e')],qs[_0x261c('0x33')](_0x2723fa['query'][_0x261c('0x33')]));_0x5580fd['attributes']=_0x5580fd[_0x261c('0x31')]['length']?_0x5580fd[_0x261c('0x31')]:_0xb9f54c[_0x261c('0x2e')];if(_0x2723fa[_0x261c('0x2f')]['includeAll']){_0x5580fd[_0x261c('0x3f')]=[{'all':!![]}];}_0x5580fd=_['merge']({},_0x5580fd,_0x2723fa[_0x261c('0x3d')]);return db['OpenchannelQueueReport'][_0x261c('0x40')](_0x5580fd)[_0x261c('0x23')](handleEntityNotFound(_0x1684a1,null))['then'](respondWithResult(_0x1684a1,null))[_0x261c('0x41')](handleError(_0x1684a1,null));};exports[_0x261c('0x42')]=function(_0x5003c0,_0xf4e056){return db[_0x261c('0x29')][_0x261c('0x42')](_0x5003c0[_0x261c('0x43')],{})[_0x261c('0x23')](respondWithResult(_0xf4e056,0xc9))['catch'](handleError(_0xf4e056,null));};exports[_0x261c('0x22')]=function(_0x3a80dc,_0x50c2c4){if(_0x3a80dc[_0x261c('0x43')]['id']){delete _0x3a80dc[_0x261c('0x43')]['id'];}return db[_0x261c('0x29')][_0x261c('0x40')]({'where':{'id':_0x3a80dc[_0x261c('0x44')]['id']}})[_0x261c('0x23')](handleEntityNotFound(_0x50c2c4,null))['then'](saveUpdates(_0x3a80dc[_0x261c('0x43')],null))[_0x261c('0x23')](respondWithResult(_0x50c2c4,null))['catch'](handleError(_0x50c2c4,null));};exports[_0x261c('0x45')]=function(_0x3cd0b9,_0x5342b1){return db[_0x261c('0x29')][_0x261c('0x40')]({'where':{'id':_0x3cd0b9[_0x261c('0x44')]['id']}})[_0x261c('0x23')](handleEntityNotFound(_0x5342b1,null))[_0x261c('0x23')](removeEntity(_0x5342b1,null))['catch'](handleError(_0x5342b1,null));};exports[_0x261c('0x46')]=function(_0x2f6763,_0x413a8b){return db[_0x261c('0x29')][_0x261c('0x46')]()['then'](respondWithResult(_0x413a8b,null))['catch'](handleError(_0x413a8b,null));};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js
index 4445462..38ab0f8 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 _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
+var _0x938a=['rimraf','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport','uniqueid','lodash','util','moment'];(function(_0x4dbec1,_0x3dbee9){var _0x56d451=function(_0x365550){while(--_0x365550){_0x4dbec1['push'](_0x4dbec1['shift']());}};_0x56d451(++_0x3dbee9);}(_0x938a,0x1d5));var _0xa938=function(_0x5cb97a,_0x5e0402){_0x5cb97a=_0x5cb97a-0x0;var _0x3bab41=_0x938a[_0x5cb97a];return _0x3bab41;};'use strict';var _=require(_0xa938('0x0'));var util=require(_0xa938('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa938('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa938('0x3'));var config=require('../../config/environment');var attributes=require(_0xa938('0x4'));module[_0xa938('0x5')]=function(_0x5db2a6,_0x214206){return _0x5db2a6['define'](_0xa938('0x6'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xa938('0x7'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
index 9a80992..a6edd9e 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 _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
+var _0xc6c0=['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','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xc6c0,0x13e));var _0x0c6c=function(_0x46a3e8,_0x2e1b35){_0x46a3e8=_0x46a3e8-0x0;var _0xf1442e=_0xc6c0[_0x46a3e8];return _0xf1442e;};'use strict';var _=require(_0x0c6c('0x0'));var util=require('util');var moment=require(_0x0c6c('0x1'));var BPromise=require(_0x0c6c('0x2'));var rs=require(_0x0c6c('0x3'));var fs=require('fs');var Redis=require(_0x0c6c('0x4'));var db=require(_0x0c6c('0x5'))['db'];var utils=require(_0x0c6c('0x6'));var logger=require(_0x0c6c('0x7'))(_0x0c6c('0x8'));var config=require(_0x0c6c('0x9'));var jayson=require(_0x0c6c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1791cb,_0x223b4f,_0x51208d){return new BPromise(function(_0x2e0cd9,_0x15c862){return client[_0x0c6c('0xb')](_0x1791cb,_0x51208d)[_0x0c6c('0xc')](function(_0x317bcf){logger[_0x0c6c('0xd')](_0x0c6c('0xe'),_0x223b4f,_0x0c6c('0xf'));logger[_0x0c6c('0x10')](_0x0c6c('0x11'),_0x223b4f,_0x0c6c('0xf'),JSON[_0x0c6c('0x12')](_0x317bcf));if(_0x317bcf['error']){if(_0x317bcf[_0x0c6c('0x13')]['code']===0x1f4){logger[_0x0c6c('0x13')](_0x0c6c('0xe'),_0x223b4f,_0x317bcf['error'][_0x0c6c('0x14')]);return _0x15c862(_0x317bcf[_0x0c6c('0x13')][_0x0c6c('0x14')]);}logger[_0x0c6c('0x13')](_0x0c6c('0xe'),_0x223b4f,_0x317bcf['error'][_0x0c6c('0x14')]);return _0x2e0cd9(_0x317bcf[_0x0c6c('0x13')][_0x0c6c('0x14')]);}else{logger[_0x0c6c('0xd')](_0x0c6c('0xe'),_0x223b4f,_0x0c6c('0xf'));_0x2e0cd9(_0x317bcf[_0x0c6c('0x15')]['message']);}})[_0x0c6c('0x16')](function(_0x527ade){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x223b4f,_0x527ade);_0x15c862(_0x527ade);});});}exports[_0x0c6c('0x17')]=function(_0x530333){var _0x9463e8=this;return new Promise(function(_0x50be43,_0x316dbe){return db[_0x0c6c('0x18')][_0x0c6c('0x19')](_0x530333[_0x0c6c('0x1a')],{'raw':_0x530333['options']?_0x530333[_0x0c6c('0x1b')][_0x0c6c('0x1c')]===undefined?!![]:![]:!![]})[_0x0c6c('0xc')](function(_0x1280fb){logger[_0x0c6c('0xd')](_0x0c6c('0x17'),_0x530333);logger[_0x0c6c('0x10')](_0x0c6c('0x17'),_0x530333,JSON[_0x0c6c('0x12')](_0x1280fb));_0x50be43(_0x1280fb);})['catch'](function(_0x323854){logger[_0x0c6c('0x13')](_0x0c6c('0x17'),_0x323854['message'],_0x530333);_0x316dbe(_0x9463e8[_0x0c6c('0x13')](0x1f4,_0x323854['message']));});});};exports[_0x0c6c('0x1d')]=function(_0x35f4ad){var _0x4140e0=this;return new Promise(function(_0x56469d,_0x3fb7a0){return db[_0x0c6c('0x18')][_0x0c6c('0x1e')](_0x35f4ad[_0x0c6c('0x1a')],{'raw':_0x35f4ad[_0x0c6c('0x1b')]?_0x35f4ad[_0x0c6c('0x1b')][_0x0c6c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35f4ad[_0x0c6c('0x1b')]?_0x35f4ad[_0x0c6c('0x1b')][_0x0c6c('0x1f')]||null:null,'attributes':_0x35f4ad['options']?_0x35f4ad[_0x0c6c('0x1b')]['attributes']||null:null,'limit':_0x35f4ad[_0x0c6c('0x1b')]?_0x35f4ad['options'][_0x0c6c('0x20')]||null:null})[_0x0c6c('0xc')](function(_0x184252){logger[_0x0c6c('0xd')](_0x0c6c('0x1d'),_0x35f4ad);logger[_0x0c6c('0x10')](_0x0c6c('0x1d'),_0x35f4ad,JSON[_0x0c6c('0x12')](_0x184252));_0x56469d(_0x184252);})['catch'](function(_0x452d93){logger[_0x0c6c('0x13')]('UpdateOpenchannelQueueReport',_0x452d93[_0x0c6c('0x14')],_0x35f4ad);_0x3fb7a0(_0x4140e0['error'](0x1f4,_0x452d93[_0x0c6c('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js
index a2920d6..8cb2816 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(_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
+var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 1041785..44738ce 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 _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
+var _0xb734=['STRING','ENUM','account','agent','queue','DATE','exports'];(function(_0xc75e69,_0x19ac94){var _0x447f25=function(_0x25125c){while(--_0x25125c){_0xc75e69['push'](_0xc75e69['shift']());}};_0x447f25(++_0x19ac94);}(_0xb734,0xc3));var _0x4b73=function(_0x2bbe8d,_0x5156c2){_0x2bbe8d=_0x2bbe8d-0x0;var _0x539e7a=_0xb734[_0x2bbe8d];return _0x539e7a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x4b73('0x0')]={'uniqueid':{'type':Sequelize[_0x4b73('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4b73('0x2')](_0x4b73('0x3'),_0x4b73('0x4'),_0x4b73('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x4b73('0x6')],'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 2c83b4e..5a15760 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 _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
+var _0x2fa8=['OpenchannelTransferReport','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','then','count','includeAll','include','rows','show','params','keys','rawAttributes','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','json','apply','reject','update','destroy','stack','name','send','map'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0x2fa8,0x1d7));var _0x82fa=function(_0x4e6017,_0x15802c){_0x4e6017=_0x4e6017-0x0;var _0x4f0ad6=_0x2fa8[_0x4e6017];return _0x4f0ad6;};'use strict';var pdf=require(_0x82fa('0x0'));var emlformat=require(_0x82fa('0x1'));var rimraf=require(_0x82fa('0x2'));var zipdir=require(_0x82fa('0x3'));var jsonpatch=require(_0x82fa('0x4'));var rp=require(_0x82fa('0x5'));var moment=require(_0x82fa('0x6'));var BPromise=require(_0x82fa('0x7'));var Mustache=require(_0x82fa('0x8'));var util=require(_0x82fa('0x9'));var path=require(_0x82fa('0xa'));var sox=require(_0x82fa('0xb'));var csv=require('to-csv');var ejs=require(_0x82fa('0xc'));var fs=require('fs');var _=require(_0x82fa('0xd'));var squel=require(_0x82fa('0xe'));var crypto=require(_0x82fa('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x82fa('0x10'));var toCsv=require(_0x82fa('0x11'));var querystring=require(_0x82fa('0x12'));var Papa=require(_0x82fa('0x13'));var Redis=require(_0x82fa('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82fa('0x15'));var logger=require(_0x82fa('0x16'))(_0x82fa('0x17'));var utils=require(_0x82fa('0x18'));var config=require('../../config/environment');var db=require(_0x82fa('0x19'))['db'];function respondWithStatusCode(_0x1e33aa,_0x1270b6){_0x1270b6=_0x1270b6||0xcc;return function(_0x2bcb04){if(_0x2bcb04){return _0x1e33aa[_0x82fa('0x1a')](_0x1270b6);}return _0x1e33aa[_0x82fa('0x1b')](_0x1270b6)[_0x82fa('0x1c')]();};}function respondWithResult(_0x55e3a8,_0x3e5b96){_0x3e5b96=_0x3e5b96||0xc8;return function(_0x3a3966){if(_0x3a3966){return _0x55e3a8[_0x82fa('0x1b')](_0x3e5b96)['json'](_0x3a3966);}};}function respondWithFilteredResult(_0x460b2f,_0x3ddfa7){return function(_0x5a1338){if(_0x5a1338){var _0x55137d=_0x5a1338['count'],_0x4cae2e=_0x3ddfa7[_0x82fa('0x1d')],_0x4404d3=_0x3ddfa7[_0x82fa('0x1d')]+_0x3ddfa7[_0x82fa('0x1e')],_0x1b4b50;if(_0x4404d3>=_0x55137d){_0x4404d3=_0x55137d;_0x1b4b50=0xc8;}else{_0x1b4b50=0xce;}_0x460b2f[_0x82fa('0x1b')](_0x1b4b50);return _0x460b2f['set']('Content-Range',_0x4cae2e+'-'+_0x4404d3+'/'+_0x55137d)[_0x82fa('0x1f')](_0x5a1338);}return null;};}function patchUpdates(_0x383511){return function(_0x315fe4){try{jsonpatch[_0x82fa('0x20')](_0x315fe4,_0x383511,!![]);}catch(_0x5aa510){return BPromise[_0x82fa('0x21')](_0x5aa510);}return _0x315fe4['save']();};}function saveUpdates(_0x1b51e6,_0x49e54e){return function(_0x30e4e3){if(_0x30e4e3){return _0x30e4e3[_0x82fa('0x22')](_0x1b51e6)['then'](function(_0x3bd0f4){return _0x3bd0f4;});}return null;};}function removeEntity(_0x345893,_0x4b5bf1){return function(_0x3f21df){if(_0x3f21df){return _0x3f21df[_0x82fa('0x23')]()['then'](function(){_0x345893['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x76e47d,_0xb91043){return function(_0x1db43e){if(!_0x1db43e){_0x76e47d['sendStatus'](0x194);}return _0x1db43e;};}function handleError(_0x3f3d8f,_0x36bcb4){_0x36bcb4=_0x36bcb4||0x1f4;return function(_0x107b17){logger['error'](_0x107b17[_0x82fa('0x24')]);if(_0x107b17[_0x82fa('0x25')]){delete _0x107b17[_0x82fa('0x25')];}_0x3f3d8f[_0x82fa('0x1b')](_0x36bcb4)[_0x82fa('0x26')](_0x107b17);};}exports['index']=function(_0x31771a,_0xba7481){var _0x349ab8={},_0x697dbc={},_0x39d865={'count':0x0,'rows':[]};var _0x20a72b=_[_0x82fa('0x27')](db[_0x82fa('0x28')]['rawAttributes'],function(_0x8bceda){return{'name':_0x8bceda[_0x82fa('0x29')],'type':_0x8bceda[_0x82fa('0x2a')]['key']};});_0x697dbc['model']=_[_0x82fa('0x27')](_0x20a72b,'name');_0x697dbc[_0x82fa('0x2b')]=_['keys'](_0x31771a[_0x82fa('0x2b')]);_0x697dbc[_0x82fa('0x2c')]=_[_0x82fa('0x2d')](_0x697dbc[_0x82fa('0x2e')],_0x697dbc[_0x82fa('0x2b')]);_0x349ab8[_0x82fa('0x2f')]=_[_0x82fa('0x2d')](_0x697dbc[_0x82fa('0x2e')],qs[_0x82fa('0x30')](_0x31771a['query'][_0x82fa('0x30')]));_0x349ab8[_0x82fa('0x2f')]=_0x349ab8['attributes'][_0x82fa('0x31')]?_0x349ab8[_0x82fa('0x2f')]:_0x697dbc[_0x82fa('0x2e')];if(!_0x31771a[_0x82fa('0x2b')][_0x82fa('0x32')](_0x82fa('0x33'))){_0x349ab8[_0x82fa('0x1e')]=qs[_0x82fa('0x1e')](_0x31771a[_0x82fa('0x2b')][_0x82fa('0x1e')]);_0x349ab8[_0x82fa('0x1d')]=qs[_0x82fa('0x1d')](_0x31771a[_0x82fa('0x2b')]['offset']);}_0x349ab8[_0x82fa('0x34')]=qs[_0x82fa('0x35')](_0x31771a[_0x82fa('0x2b')][_0x82fa('0x35')]);_0x349ab8[_0x82fa('0x36')]=qs[_0x82fa('0x2c')](_[_0x82fa('0x37')](_0x31771a[_0x82fa('0x2b')],_0x697dbc[_0x82fa('0x2c')]),_0x20a72b);if(_0x31771a['query'][_0x82fa('0x38')]){_0x349ab8[_0x82fa('0x36')]=_[_0x82fa('0x39')](_0x349ab8['where'],{'$or':_[_0x82fa('0x27')](_0x20a72b,function(_0x24a2d4){if(_0x24a2d4[_0x82fa('0x2a')]!=='VIRTUAL'){var _0x7e1d27={};_0x7e1d27[_0x24a2d4[_0x82fa('0x25')]]={'$like':'%'+_0x31771a[_0x82fa('0x2b')]['filter']+'%'};return _0x7e1d27;}})});}_0x349ab8=_['merge']({},_0x349ab8,_0x31771a[_0x82fa('0x3a')]);var _0x5b233e={'where':_0x349ab8['where']};return db[_0x82fa('0x28')]['count'](_0x5b233e)[_0x82fa('0x3b')](function(_0x35f46e){_0x39d865[_0x82fa('0x3c')]=_0x35f46e;if(_0x31771a[_0x82fa('0x2b')][_0x82fa('0x3d')]){_0x349ab8[_0x82fa('0x3e')]=[{'all':!![]}];}return db[_0x82fa('0x28')]['findAll'](_0x349ab8);})[_0x82fa('0x3b')](function(_0xf3332d){_0x39d865[_0x82fa('0x3f')]=_0xf3332d;return _0x39d865;})[_0x82fa('0x3b')](respondWithFilteredResult(_0xba7481,_0x349ab8))['catch'](handleError(_0xba7481,null));};exports[_0x82fa('0x40')]=function(_0x57810d,_0x429af1){var _0xfa54df={'raw':!![],'where':{'id':_0x57810d[_0x82fa('0x41')]['id']}},_0xf2bbdc={};_0xf2bbdc['model']=_[_0x82fa('0x42')](db['OpenchannelTransferReport'][_0x82fa('0x43')]);_0xf2bbdc[_0x82fa('0x2b')]=_['keys'](_0x57810d['query']);_0xf2bbdc['filters']=_[_0x82fa('0x2d')](_0xf2bbdc['model'],_0xf2bbdc[_0x82fa('0x2b')]);_0xfa54df[_0x82fa('0x2f')]=_['intersection'](_0xf2bbdc[_0x82fa('0x2e')],qs[_0x82fa('0x30')](_0x57810d[_0x82fa('0x2b')][_0x82fa('0x30')]));_0xfa54df[_0x82fa('0x2f')]=_0xfa54df[_0x82fa('0x2f')][_0x82fa('0x31')]?_0xfa54df[_0x82fa('0x2f')]:_0xf2bbdc[_0x82fa('0x2e')];if(_0x57810d['query'][_0x82fa('0x3d')]){_0xfa54df[_0x82fa('0x3e')]=[{'all':!![]}];}_0xfa54df=_['merge']({},_0xfa54df,_0x57810d[_0x82fa('0x3a')]);return db[_0x82fa('0x28')][_0x82fa('0x44')](_0xfa54df)[_0x82fa('0x3b')](handleEntityNotFound(_0x429af1,null))[_0x82fa('0x3b')](respondWithResult(_0x429af1,null))[_0x82fa('0x45')](handleError(_0x429af1,null));};exports['create']=function(_0x16700a,_0xfa0e1a){return db['OpenchannelTransferReport'][_0x82fa('0x46')](_0x16700a[_0x82fa('0x47')],{})[_0x82fa('0x3b')](respondWithResult(_0xfa0e1a,0xc9))[_0x82fa('0x45')](handleError(_0xfa0e1a,null));};exports[_0x82fa('0x22')]=function(_0x1740cf,_0x446b8c){if(_0x1740cf['body']['id']){delete _0x1740cf[_0x82fa('0x47')]['id'];}return db['OpenchannelTransferReport'][_0x82fa('0x44')]({'where':{'id':_0x1740cf['params']['id']}})[_0x82fa('0x3b')](handleEntityNotFound(_0x446b8c,null))[_0x82fa('0x3b')](saveUpdates(_0x1740cf['body'],null))['then'](respondWithResult(_0x446b8c,null))[_0x82fa('0x45')](handleError(_0x446b8c,null));};exports[_0x82fa('0x23')]=function(_0x51f3be,_0x402b05){return db[_0x82fa('0x28')][_0x82fa('0x44')]({'where':{'id':_0x51f3be[_0x82fa('0x41')]['id']}})[_0x82fa('0x3b')](handleEntityNotFound(_0x402b05,null))[_0x82fa('0x3b')](removeEntity(_0x402b05,null))[_0x82fa('0x45')](handleError(_0x402b05,null));};exports[_0x82fa('0x48')]=function(_0x1bcab8,_0x50cde9){return db[_0x82fa('0x28')]['describe']()[_0x82fa('0x3b')](respondWithResult(_0x50cde9,null))['catch'](handleError(_0x50cde9,null));};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js
index 362cacd..fca9a38 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 _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
+var _0xe451=['../../config/environment','exports','OpenchannelTransferReport','report_openchannel_transfer','../../config/logger','request-promise','path','rimraf'];(function(_0x1223bc,_0x4d6823){var _0x5c0891=function(_0x36a7d4){while(--_0x36a7d4){_0x1223bc['push'](_0x1223bc['shift']());}};_0x5c0891(++_0x4d6823);}(_0xe451,0xec));var _0x1e45=function(_0xb16fd,_0xb9d715){_0xb16fd=_0xb16fd-0x0;var _0x49f716=_0xe451[_0xb16fd];return _0x49f716;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1e45('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1e45('0x1'));var fs=require('fs');var path=require(_0x1e45('0x2'));var rimraf=require(_0x1e45('0x3'));var config=require(_0x1e45('0x4'));var attributes=require('./openchannelTransferReport.attributes');module[_0x1e45('0x5')]=function(_0x1a163c,_0x115f88){return _0x1a163c['define'](_0x1e45('0x6'),attributes,{'tableName':_0x1e45('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
index 6fddfdc..d5eca62 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 _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
+var _0xdcf0=['debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0xdcf0,0xb8));var _0x0dcf=function(_0x129179,_0x3dd450){_0x129179=_0x129179-0x0;var _0x2393d7=_0xdcf0[_0x129179];return _0x2393d7;};'use strict';var _=require(_0x0dcf('0x0'));var util=require(_0x0dcf('0x1'));var moment=require('moment');var BPromise=require(_0x0dcf('0x2'));var rs=require(_0x0dcf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0dcf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0dcf('0x5'));var config=require(_0x0dcf('0x6'));var jayson=require(_0x0dcf('0x7'));var client=jayson[_0x0dcf('0x8')][_0x0dcf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x598cf5,_0x9809c2,_0x4ea8e2){return new BPromise(function(_0x37871c,_0x222ffa){return client[_0x0dcf('0xa')](_0x598cf5,_0x4ea8e2)[_0x0dcf('0xb')](function(_0x17e8d6){logger[_0x0dcf('0xc')](_0x0dcf('0xd'),_0x9809c2,'request\x20sent');logger[_0x0dcf('0xe')](_0x0dcf('0xf'),_0x9809c2,_0x0dcf('0x10'),JSON[_0x0dcf('0x11')](_0x17e8d6));if(_0x17e8d6[_0x0dcf('0x12')]){if(_0x17e8d6['error']['code']===0x1f4){logger[_0x0dcf('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x9809c2,_0x17e8d6['error'][_0x0dcf('0x13')]);return _0x222ffa(_0x17e8d6[_0x0dcf('0x12')][_0x0dcf('0x13')]);}logger[_0x0dcf('0x12')](_0x0dcf('0xd'),_0x9809c2,_0x17e8d6[_0x0dcf('0x12')][_0x0dcf('0x13')]);return _0x37871c(_0x17e8d6[_0x0dcf('0x12')]['message']);}else{logger[_0x0dcf('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x9809c2,'request\x20sent');_0x37871c(_0x17e8d6[_0x0dcf('0x14')][_0x0dcf('0x13')]);}})[_0x0dcf('0x15')](function(_0x37f3b0){logger['error'](_0x0dcf('0xd'),_0x9809c2,_0x37f3b0);_0x222ffa(_0x37f3b0);});});}
\ No newline at end of file
diff --git a/server/api/pause/index.js b/server/api/pause/index.js
index cd1f5a9..a44357e 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 _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
+var _0xef36=['express','Router','./pause.controller','isAuthenticated','index','get','/:id','post','create','put','update','multer','util','connect-timeout'];(function(_0xd79011,_0x1bb245){var _0xe68fb=function(_0x1f24ad){while(--_0x1f24ad){_0xd79011['push'](_0xd79011['shift']());}};_0xe68fb(++_0x1bb245);}(_0xef36,0x193));var _0x6ef3=function(_0x1800d4,_0x29328c){_0x1800d4=_0x1800d4-0x0;var _0x3a881e=_0xef36[_0x1800d4];return _0x3a881e;};'use strict';var multer=require(_0x6ef3('0x0'));var util=require(_0x6ef3('0x1'));var path=require('path');var timeout=require(_0x6ef3('0x2'));var express=require(_0x6ef3('0x3'));var router=express[_0x6ef3('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6ef3('0x5'));router['get']('/',auth[_0x6ef3('0x6')](),controller[_0x6ef3('0x7')]);router[_0x6ef3('0x8')](_0x6ef3('0x9'),auth[_0x6ef3('0x6')](),controller['show']);router[_0x6ef3('0xa')]('/',auth[_0x6ef3('0x6')](),controller[_0x6ef3('0xb')]);router[_0x6ef3('0xc')](_0x6ef3('0x9'),auth[_0x6ef3('0x6')](),controller[_0x6ef3('0xd')]);router['delete'](_0x6ef3('0x9'),auth[_0x6ef3('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js
index cf86993..414f606 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 _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
+var _0xe663=['name','sequelize','exports','STRING'];(function(_0x31e804,_0x254a20){var _0x543a83=function(_0x177699){while(--_0x177699){_0x31e804['push'](_0x31e804['shift']());}};_0x543a83(++_0x254a20);}(_0xe663,0x1c1));var _0x3e66=function(_0x399de1,_0x1f7013){_0x399de1=_0x399de1-0x0;var _0x3bc906=_0xe663[_0x399de1];return _0x3bc906;};'use strict';var Sequelize=require(_0x3e66('0x0'));module[_0x3e66('0x1')]={'name':{'type':Sequelize[_0x3e66('0x2')],'unique':_0x3e66('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3e66('0x2')]}};
\ No newline at end of file
diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js
index 77069d9..cf24440 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 _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
+var _0x217b=['find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','crypto','jsforce','to-csv','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','set','Content-Range','apply','reject','save','destroy','then','Pauses','UserProfileResource','end','error','stack','name','send','index','map','Pause','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','where','VIRTUAL','merge','includeAll','findAll','rows','catch','params','include','options'];(function(_0x22f40a,_0x3f0dc9){var _0x410e24=function(_0x31940a){while(--_0x31940a){_0x22f40a['push'](_0x22f40a['shift']());}};_0x410e24(++_0x3f0dc9);}(_0x217b,0x194));var _0xb217=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x217b[_0x1deb03];return _0x189fe7;};'use strict';var pdf=require(_0xb217('0x0'));var emlformat=require(_0xb217('0x1'));var rimraf=require(_0xb217('0x2'));var zipdir=require(_0xb217('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb217('0x4'));var moment=require(_0xb217('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb217('0x6'));var util=require(_0xb217('0x7'));var path=require(_0xb217('0x8'));var sox=require(_0xb217('0x9'));var csv=require('to-csv');var ejs=require(_0xb217('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb217('0xb'));var jsforce=require(_0xb217('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb217('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb217('0xe'));var authService=require(_0xb217('0xf'));var qs=require(_0xb217('0x10'));var as=require(_0xb217('0x11'));var hardwareService=require(_0xb217('0x12'));var logger=require(_0xb217('0x13'))(_0xb217('0x14'));var utils=require('../../config/utils');var config=require(_0xb217('0x15'));var db=require(_0xb217('0x16'))['db'];function respondWithStatusCode(_0x23129c,_0x3bf075){_0x3bf075=_0x3bf075||0xcc;return function(_0x4f60c0){if(_0x4f60c0){return _0x23129c[_0xb217('0x17')](_0x3bf075);}return _0x23129c[_0xb217('0x18')](_0x3bf075)['end']();};}function respondWithResult(_0x2ef88e,_0x263f6b){_0x263f6b=_0x263f6b||0xc8;return function(_0x5c8c31){if(_0x5c8c31){return _0x2ef88e[_0xb217('0x18')](_0x263f6b)[_0xb217('0x19')](_0x5c8c31);}};}function respondWithFilteredResult(_0x9b0815,_0x26dd8e){return function(_0xb08052){if(_0xb08052){var _0x89bd2e=_0xb08052[_0xb217('0x1a')],_0x54fad3=_0x26dd8e[_0xb217('0x1b')],_0x53b759=_0x26dd8e[_0xb217('0x1b')]+_0x26dd8e[_0xb217('0x1c')],_0x3574e0;if(_0x53b759>=_0x89bd2e){_0x53b759=_0x89bd2e;_0x3574e0=0xc8;}else{_0x3574e0=0xce;}_0x9b0815[_0xb217('0x18')](_0x3574e0);return _0x9b0815[_0xb217('0x1d')](_0xb217('0x1e'),_0x54fad3+'-'+_0x53b759+'/'+_0x89bd2e)['json'](_0xb08052);}return null;};}function patchUpdates(_0x4e120e){return function(_0x321861){try{jsonpatch[_0xb217('0x1f')](_0x321861,_0x4e120e,!![]);}catch(_0xd683a0){return BPromise[_0xb217('0x20')](_0xd683a0);}return _0x321861[_0xb217('0x21')]();};}function saveUpdates(_0x2ccb83,_0x6a8d22){return function(_0x2f87e6){if(_0x2f87e6){return _0x2f87e6['update'](_0x2ccb83)['then'](function(_0x17b4ab){return _0x17b4ab;});}return null;};}function removeEntity(_0x350630,_0x5da3af){return function(_0x3e938c){if(_0x3e938c){return _0x3e938c[_0xb217('0x22')]()[_0xb217('0x23')](function(){var _0x24760c=_0x3e938c['get']({'plain':!![]});var _0x27a1cf=_0xb217('0x24');return db[_0xb217('0x25')]['destroy']({'where':{'type':_0x27a1cf,'resourceId':_0x24760c['id']}})['then'](function(){return _0x3e938c;});})[_0xb217('0x23')](function(){_0x350630[_0xb217('0x18')](0xcc)[_0xb217('0x26')]();});}};}function handleEntityNotFound(_0xcb1cb5,_0x12ab56){return function(_0x3e2758){if(!_0x3e2758){_0xcb1cb5['sendStatus'](0x194);}return _0x3e2758;};}function handleError(_0x4ee042,_0x4674ac){_0x4674ac=_0x4674ac||0x1f4;return function(_0x12cfeb){logger[_0xb217('0x27')](_0x12cfeb[_0xb217('0x28')]);if(_0x12cfeb[_0xb217('0x29')]){delete _0x12cfeb[_0xb217('0x29')];}_0x4ee042[_0xb217('0x18')](_0x4674ac)[_0xb217('0x2a')](_0x12cfeb);};}exports[_0xb217('0x2b')]=function(_0x3203bb,_0x196623){var _0x853fcc={},_0x30ceb5={},_0x84c573={'count':0x0,'rows':[]};var _0x3ad7c2=_[_0xb217('0x2c')](db[_0xb217('0x2d')][_0xb217('0x2e')],function(_0x162a66){return{'name':_0x162a66['fieldName'],'type':_0x162a66[_0xb217('0x2f')][_0xb217('0x30')]};});_0x30ceb5[_0xb217('0x31')]=_[_0xb217('0x2c')](_0x3ad7c2,_0xb217('0x29'));_0x30ceb5[_0xb217('0x32')]=_[_0xb217('0x33')](_0x3203bb['query']);_0x30ceb5[_0xb217('0x34')]=_[_0xb217('0x35')](_0x30ceb5['model'],_0x30ceb5[_0xb217('0x32')]);_0x853fcc[_0xb217('0x36')]=_[_0xb217('0x35')](_0x30ceb5[_0xb217('0x31')],qs[_0xb217('0x37')](_0x3203bb[_0xb217('0x32')][_0xb217('0x37')]));_0x853fcc[_0xb217('0x36')]=_0x853fcc[_0xb217('0x36')][_0xb217('0x38')]?_0x853fcc['attributes']:_0x30ceb5[_0xb217('0x31')];if(!_0x3203bb[_0xb217('0x32')]['hasOwnProperty']('nolimit')){_0x853fcc['limit']=qs[_0xb217('0x1c')](_0x3203bb[_0xb217('0x32')][_0xb217('0x1c')]);_0x853fcc[_0xb217('0x1b')]=qs[_0xb217('0x1b')](_0x3203bb[_0xb217('0x32')][_0xb217('0x1b')]);}_0x853fcc[_0xb217('0x39')]=qs[_0xb217('0x3a')](_0x3203bb[_0xb217('0x32')][_0xb217('0x3a')]);_0x853fcc['where']=qs[_0xb217('0x34')](_['pick'](_0x3203bb['query'],_0x30ceb5[_0xb217('0x34')]),_0x3ad7c2);if(_0x3203bb['query'][_0xb217('0x3b')]){_0x853fcc[_0xb217('0x3c')]=_['merge'](_0x853fcc['where'],{'$or':_['map'](_0x3ad7c2,function(_0x4b6b59){if(_0x4b6b59['type']!==_0xb217('0x3d')){var _0x5ccc28={};_0x5ccc28[_0x4b6b59[_0xb217('0x29')]]={'$like':'%'+_0x3203bb['query'][_0xb217('0x3b')]+'%'};return _0x5ccc28;}})});}_0x853fcc=_[_0xb217('0x3e')]({},_0x853fcc,_0x3203bb['options']);var _0x4d413b={'where':_0x853fcc[_0xb217('0x3c')]};return db[_0xb217('0x2d')][_0xb217('0x1a')](_0x4d413b)[_0xb217('0x23')](function(_0x1d2a66){_0x84c573[_0xb217('0x1a')]=_0x1d2a66;if(_0x3203bb[_0xb217('0x32')][_0xb217('0x3f')]){_0x853fcc['include']=[{'all':!![]}];}return db['Pause'][_0xb217('0x40')](_0x853fcc);})[_0xb217('0x23')](function(_0x8702bc){_0x84c573[_0xb217('0x41')]=_0x8702bc;return _0x84c573;})[_0xb217('0x23')](respondWithFilteredResult(_0x196623,_0x853fcc))[_0xb217('0x42')](handleError(_0x196623,null));};exports['show']=function(_0x51872f,_0x4ce050){var _0x140f40={'raw':!![],'where':{'id':_0x51872f[_0xb217('0x43')]['id']}},_0x536cbf={};_0x536cbf[_0xb217('0x31')]=_['keys'](db[_0xb217('0x2d')][_0xb217('0x2e')]);_0x536cbf[_0xb217('0x32')]=_[_0xb217('0x33')](_0x51872f[_0xb217('0x32')]);_0x536cbf[_0xb217('0x34')]=_[_0xb217('0x35')](_0x536cbf[_0xb217('0x31')],_0x536cbf[_0xb217('0x32')]);_0x140f40[_0xb217('0x36')]=_[_0xb217('0x35')](_0x536cbf[_0xb217('0x31')],qs[_0xb217('0x37')](_0x51872f[_0xb217('0x32')][_0xb217('0x37')]));_0x140f40[_0xb217('0x36')]=_0x140f40[_0xb217('0x36')]['length']?_0x140f40[_0xb217('0x36')]:_0x536cbf[_0xb217('0x31')];if(_0x51872f[_0xb217('0x32')][_0xb217('0x3f')]){_0x140f40[_0xb217('0x44')]=[{'all':!![]}];}_0x140f40=_['merge']({},_0x140f40,_0x51872f[_0xb217('0x45')]);return db[_0xb217('0x2d')][_0xb217('0x46')](_0x140f40)[_0xb217('0x23')](handleEntityNotFound(_0x4ce050,null))[_0xb217('0x23')](respondWithResult(_0x4ce050,null))[_0xb217('0x42')](handleError(_0x4ce050,null));};exports[_0xb217('0x47')]=function(_0x383a63,_0x556be7){return db['Pause'][_0xb217('0x47')](_0x383a63[_0xb217('0x48')],{})['then'](function(_0x865bd7){var _0x4fe8e2=_0x383a63[_0xb217('0x49')][_0xb217('0x4a')]({'plain':!![]});if(!_0x4fe8e2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fe8e2['role']===_0xb217('0x49')){var _0x338b20=_0x865bd7[_0xb217('0x4a')]({'plain':!![]});var _0xe0d1f3=_0xb217('0x24');return db[_0xb217('0x4b')][_0xb217('0x46')]({'where':{'name':_0xe0d1f3,'userProfileId':_0x4fe8e2[_0xb217('0x4c')]},'raw':!![]})[_0xb217('0x23')](function(_0x376da0){if(_0x376da0&&_0x376da0[_0xb217('0x4d')]===0x0){return db[_0xb217('0x25')]['create']({'name':_0x338b20[_0xb217('0x29')],'resourceId':_0x338b20['id'],'type':_0x376da0['name'],'sectionId':_0x376da0['id']},{})[_0xb217('0x23')](function(){return _0x865bd7;});}else{return _0x865bd7;}})[_0xb217('0x42')](function(_0x509331){logger[_0xb217('0x27')](_0xb217('0x4e'),_0x509331);throw _0x509331;});}return _0x865bd7;})[_0xb217('0x23')](respondWithResult(_0x556be7,0xc9))[_0xb217('0x42')](handleError(_0x556be7,null));};exports['update']=function(_0x3bdb2e,_0x3c893e){if(_0x3bdb2e[_0xb217('0x48')]['id']){delete _0x3bdb2e[_0xb217('0x48')]['id'];}return db[_0xb217('0x2d')][_0xb217('0x46')]({'where':{'id':_0x3bdb2e['params']['id']}})[_0xb217('0x23')](handleEntityNotFound(_0x3c893e,null))['then'](saveUpdates(_0x3bdb2e[_0xb217('0x48')],null))[_0xb217('0x23')](respondWithResult(_0x3c893e,null))[_0xb217('0x42')](handleError(_0x3c893e,null));};exports['destroy']=function(_0x2ccb70,_0x4c5525){return db['Pause'][_0xb217('0x46')]({'where':{'id':_0x2ccb70[_0xb217('0x43')]['id']}})[_0xb217('0x23')](handleEntityNotFound(_0x4c5525,null))['then'](removeEntity(_0x4c5525,null))['catch'](handleError(_0x4c5525,null));};
\ No newline at end of file
diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js
index b5cf28f..8a1888c 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 _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
+var _0x8acb=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','Pause','tools_pauses'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8acb,0x1b8));var _0xb8ac=function(_0x13af8a,_0xfb498c){_0x13af8a=_0x13af8a-0x0;var _0x5831a2=_0x8acb[_0x13af8a];return _0x5831a2;};'use strict';var _=require(_0xb8ac('0x0'));var util=require('util');var logger=require(_0xb8ac('0x1'))(_0xb8ac('0x2'));var moment=require(_0xb8ac('0x3'));var BPromise=require('bluebird');var rp=require(_0xb8ac('0x4'));var fs=require('fs');var path=require(_0xb8ac('0x5'));var rimraf=require(_0xb8ac('0x6'));var config=require(_0xb8ac('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x389922,_0x3a191c){return _0x389922[_0xb8ac('0x8')](_0xb8ac('0x9'),attributes,{'tableName':_0xb8ac('0xa'),'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 da49312..c6f53f1 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 _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
+var _0xc02d=['where','attributes','include','map','model','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Pause,\x20%s,\x20%s','debug','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowPause','Pause','find','options','raw'];(function(_0x2e49e8,_0x424ea3){var _0x12b2a5=function(_0xde8151){while(--_0xde8151){_0x2e49e8['push'](_0x2e49e8['shift']());}};_0x12b2a5(++_0x424ea3);}(_0xc02d,0x1aa));var _0xdc02=function(_0x3c04d7,_0x472801){_0x3c04d7=_0x3c04d7-0x0;var _0x2fb24=_0xc02d[_0x3c04d7];return _0x2fb24;};'use strict';var _=require('lodash');var util=require(_0xdc02('0x0'));var moment=require(_0xdc02('0x1'));var BPromise=require(_0xdc02('0x2'));var rs=require(_0xdc02('0x3'));var fs=require('fs');var Redis=require(_0xdc02('0x4'));var db=require(_0xdc02('0x5'))['db'];var utils=require(_0xdc02('0x6'));var logger=require(_0xdc02('0x7'))(_0xdc02('0x8'));var config=require(_0xdc02('0x9'));var jayson=require(_0xdc02('0xa'));var client=jayson['client'][_0xdc02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc472b,_0x30e0ad,_0x1560da){return new BPromise(function(_0x4a678f,_0x50a902){return client[_0xdc02('0xc')](_0xc472b,_0x1560da)[_0xdc02('0xd')](function(_0x1fed26){logger['info'](_0xdc02('0xe'),_0x30e0ad,'request\x20sent');logger[_0xdc02('0xf')](_0xdc02('0x10'),_0x30e0ad,_0xdc02('0x11'),JSON[_0xdc02('0x12')](_0x1fed26));if(_0x1fed26['error']){if(_0x1fed26[_0xdc02('0x13')][_0xdc02('0x14')]===0x1f4){logger[_0xdc02('0x13')](_0xdc02('0xe'),_0x30e0ad,_0x1fed26['error'][_0xdc02('0x15')]);return _0x50a902(_0x1fed26[_0xdc02('0x13')][_0xdc02('0x15')]);}logger['error'](_0xdc02('0xe'),_0x30e0ad,_0x1fed26['error'][_0xdc02('0x15')]);return _0x4a678f(_0x1fed26[_0xdc02('0x13')][_0xdc02('0x15')]);}else{logger['info'](_0xdc02('0xe'),_0x30e0ad,_0xdc02('0x11'));_0x4a678f(_0x1fed26[_0xdc02('0x16')]['message']);}})[_0xdc02('0x17')](function(_0x4d96ef){logger[_0xdc02('0x13')](_0xdc02('0xe'),_0x30e0ad,_0x4d96ef);_0x50a902(_0x4d96ef);});});}exports[_0xdc02('0x18')]=function(_0x26be9e){var _0x532a50=this;return new Promise(function(_0x4f731f,_0x88b0b2){return db[_0xdc02('0x19')][_0xdc02('0x1a')]({'raw':_0x26be9e[_0xdc02('0x1b')]?_0x26be9e[_0xdc02('0x1b')][_0xdc02('0x1c')]===undefined?!![]:![]:!![],'where':_0x26be9e[_0xdc02('0x1b')]?_0x26be9e[_0xdc02('0x1b')][_0xdc02('0x1d')]||null:null,'attributes':_0x26be9e[_0xdc02('0x1b')]?_0x26be9e[_0xdc02('0x1b')][_0xdc02('0x1e')]||null:null,'include':_0x26be9e['options']?_0x26be9e[_0xdc02('0x1b')][_0xdc02('0x1f')]?_[_0xdc02('0x20')](_0x26be9e['options'][_0xdc02('0x1f')],function(_0x86f55d){return{'model':db[_0x86f55d[_0xdc02('0x21')]],'as':_0x86f55d['as'],'attributes':_0x86f55d[_0xdc02('0x1e')],'include':_0x86f55d[_0xdc02('0x1f')]?_[_0xdc02('0x20')](_0x86f55d[_0xdc02('0x1f')],function(_0x513f02){return{'model':db[_0x513f02[_0xdc02('0x21')]],'as':_0x513f02['as'],'attributes':_0x513f02[_0xdc02('0x1e')],'include':_0x513f02[_0xdc02('0x1f')]?_[_0xdc02('0x20')](_0x513f02[_0xdc02('0x1f')],function(_0x523b8d){return{'model':db[_0x523b8d[_0xdc02('0x21')]],'as':_0x523b8d['as'],'attributes':_0x523b8d[_0xdc02('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ebcb2){logger[_0xdc02('0x22')](_0xdc02('0x18'),_0x26be9e);logger[_0xdc02('0xf')](_0xdc02('0x18'),_0x26be9e,JSON[_0xdc02('0x12')](_0x2ebcb2));_0x4f731f(_0x2ebcb2);})['catch'](function(_0x55dfb7){logger[_0xdc02('0x13')](_0xdc02('0x18'),_0x55dfb7['message'],_0x26be9e);_0x88b0b2(_0x532a50[_0xdc02('0x13')](0x1f4,_0x55dfb7[_0xdc02('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js
index 1fc8eac..e0bec55 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 _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
+var _0x7c32=['isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','join','root','server/files/plugins','originalname','replace','format','extname','now','post','single','file','upload','webhookPost','put','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x65d12e,_0x4b0a30){var _0x4274e0=function(_0x121624){while(--_0x121624){_0x65d12e['push'](_0x65d12e['shift']());}};_0x4274e0(++_0x4b0a30);}(_0x7c32,0xd8));var _0x27c3=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x7c32[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x27c3('0x0'));var util=require(_0x27c3('0x1'));var path=require(_0x27c3('0x2'));var timeout=require(_0x27c3('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x27c3('0x4'));var interaction=require(_0x27c3('0x5'));var config=require(_0x27c3('0x6'));var controller=require('./plugin.controller');router[_0x27c3('0x7')]('/',auth[_0x27c3('0x8')](),controller[_0x27c3('0x9')]);router[_0x27c3('0x7')](_0x27c3('0xa'),controller[_0x27c3('0xb')]);router[_0x27c3('0x7')](_0x27c3('0xc'),auth[_0x27c3('0x8')](),controller[_0x27c3('0xd')]);router[_0x27c3('0x7')](_0x27c3('0xe'),auth[_0x27c3('0x8')](),controller[_0x27c3('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1f5e40,_0x39801b,_0x938a2c){_0x938a2c(null,path[_0x27c3('0x10')](config[_0x27c3('0x11')],_0x27c3('0x12')));},'filename':function(_0xeb94ef,_0x284b60,_0x38d8ad){_0x284b60['originalname']=_0x284b60[_0x27c3('0x13')][_0x27c3('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x38d8ad(null,util[_0x27c3('0x15')]('%s-%s%s',path['basename'](_0x284b60['originalname'],path[_0x27c3('0x16')](_0x284b60['originalname'])),Date[_0x27c3('0x17')](),path[_0x27c3('0x16')](_0x284b60['originalname'])));}})});router[_0x27c3('0x18')]('/',upload[_0x27c3('0x19')](_0x27c3('0x1a')),controller[_0x27c3('0x1b')]);router[_0x27c3('0x18')](_0x27c3('0xa'),controller[_0x27c3('0x1c')]);router[_0x27c3('0x1d')](_0x27c3('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x27c3('0x1e')](_0x27c3('0xc'),auth[_0x27c3('0x8')](),controller[_0x27c3('0x1e')]);module[_0x27c3('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js
index 9bd5a3a..ef00734 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 _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
+var _0xd209=['sequelize','exports','ENUM','html','script','TEXT','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','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING'];(function(_0x497f85,_0x472835){var _0x5f107b=function(_0x185f02){while(--_0x185f02){_0x497f85['push'](_0x497f85['shift']());}};_0x5f107b(++_0x472835);}(_0xd209,0xb6));var _0x9d20=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xd209[_0xbe200f];return _0x192597;};'use strict';var Sequelize=require(_0x9d20('0x0'));module[_0x9d20('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9d20('0x2')](_0x9d20('0x3'),_0x9d20('0x4'))},'description':{'type':Sequelize[_0x9d20('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0x9d20('0x6')},'active':{'type':Sequelize[_0x9d20('0x7')],'defaultValue':0x0,'comment':_0x9d20('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0x9d20('0x9'),_0x9d20('0xa'),_0x9d20('0xb'),'never'),'defaultValue':_0x9d20('0xb'),'comment':_0x9d20('0xc')},'icon':{'type':Sequelize[_0x9d20('0xd')]},'adminUrl':{'type':Sequelize[_0x9d20('0xd')]},'agentUrl':{'type':Sequelize[_0x9d20('0xd')]},'scriptName':{'type':Sequelize[_0x9d20('0xd')]},'scriptPath':{'type':Sequelize[_0x9d20('0xd')]}};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js
index 80b7b19..7773cec 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 _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
+var _0xd783=['../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','map','Plugin','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','filter','merge','options','include','findAll','rows','catch','params','length','includeAll','find','download','root','format','createWriteStream','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','error','pipe','glob','**/*','server/files/plugins','basename','node_modules/**/*','join','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','undefined','type','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','role','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Plugins','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','encoding','method','headers','content-length','set','endsWith','statusCode','webhookPost','resolve','http://localhost:','content-type','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../config/license/hardware','api'];(function(_0x2dbb18,_0x41b2e1){var _0x312fc7=function(_0x50dacb){while(--_0x50dacb){_0x2dbb18['push'](_0x2dbb18['shift']());}};_0x312fc7(++_0x41b2e1);}(_0xd783,0x90));var _0x3d78=function(_0x1a61db,_0x3ad3af){_0x1a61db=_0x1a61db-0x0;var _0x5ac3bf=_0xd783[_0x1a61db];return _0x5ac3bf;};'use strict';var pdf=require(_0x3d78('0x0'));var emlformat=require(_0x3d78('0x1'));var rimraf=require(_0x3d78('0x2'));var zipdir=require(_0x3d78('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3d78('0x4'));var moment=require(_0x3d78('0x5'));var BPromise=require(_0x3d78('0x6'));var Mustache=require(_0x3d78('0x7'));var util=require(_0x3d78('0x8'));var path=require(_0x3d78('0x9'));var sox=require(_0x3d78('0xa'));var csv=require(_0x3d78('0xb'));var ejs=require(_0x3d78('0xc'));var fs=require('fs');var _=require(_0x3d78('0xd'));var squel=require(_0x3d78('0xe'));var crypto=require('crypto');var jsforce=require(_0x3d78('0xf'));var deskjs=require(_0x3d78('0x10'));var toCsv=require(_0x3d78('0xb'));var querystring=require(_0x3d78('0x11'));var Papa=require('papaparse');var extract=require(_0x3d78('0x12'));var rimraf=require(_0x3d78('0x2'));var archiver=require(_0x3d78('0x13'));var Redis=require(_0x3d78('0x14'));var authService=require(_0x3d78('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d78('0x16'));var logger=require('../../config/logger')(_0x3d78('0x17'));var utils=require(_0x3d78('0x18'));var config=require('../../config/environment');var db=require(_0x3d78('0x19'))['db'];config[_0x3d78('0x1a')]=_[_0x3d78('0x1b')](config[_0x3d78('0x1a')],{'host':_0x3d78('0x1c'),'port':0x18eb});var socket=require(_0x3d78('0x1d'))(new Redis(config[_0x3d78('0x1a')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x5265b9,_0xfe520a){_0xfe520a=_0xfe520a||0xcc;return function(_0x2c90d4){if(_0x2c90d4){return _0x5265b9['sendStatus'](_0xfe520a);}return _0x5265b9[_0x3d78('0x1e')](_0xfe520a)[_0x3d78('0x1f')]();};}function respondWithResult(_0x58319b,_0x43eb89){_0x43eb89=_0x43eb89||0xc8;return function(_0xb60cc7){if(_0xb60cc7){return _0x58319b['status'](_0x43eb89)[_0x3d78('0x20')](_0xb60cc7);}};}function respondWithFilteredResult(_0x5520fd,_0x608ca7){return function(_0x558d48){if(_0x558d48){var _0xd72a80=_0x558d48[_0x3d78('0x21')],_0x30db98=_0x608ca7[_0x3d78('0x22')],_0xa0d1d6=_0x608ca7['offset']+_0x608ca7[_0x3d78('0x23')],_0x2a9d07;if(_0xa0d1d6>=_0xd72a80){_0xa0d1d6=_0xd72a80;_0x2a9d07=0xc8;}else{_0x2a9d07=0xce;}_0x5520fd[_0x3d78('0x1e')](_0x2a9d07);return _0x5520fd['set'](_0x3d78('0x24'),_0x30db98+'-'+_0xa0d1d6+'/'+_0xd72a80)[_0x3d78('0x20')](_0x558d48);}return null;};}function patchUpdates(_0x21e44f){return function(_0x2572f9){try{jsonpatch[_0x3d78('0x25')](_0x2572f9,_0x21e44f,!![]);}catch(_0x115e53){return BPromise[_0x3d78('0x26')](_0x115e53);}return _0x2572f9[_0x3d78('0x27')]();};}function saveUpdates(_0x5e10ed,_0x6397d7){return function(_0x544ba7){if(_0x544ba7){return _0x544ba7[_0x3d78('0x28')](_0x5e10ed)[_0x3d78('0x29')](function(_0x1a3517){return _0x1a3517;});}return null;};}function removeEntity(_0x40fed6,_0x3103a3){return function(_0x3e4fec){if(_0x3e4fec){return _0x3e4fec[_0x3d78('0x2a')]()[_0x3d78('0x29')](function(){var _0x1b39b6=_0x3e4fec[_0x3d78('0x2b')]({'plain':!![]});var _0x1b51c1='Plugins';return db[_0x3d78('0x2c')][_0x3d78('0x2a')]({'where':{'type':_0x1b51c1,'resourceId':_0x1b39b6['id']}})[_0x3d78('0x29')](function(){return _0x3e4fec;});})[_0x3d78('0x29')](function(){_0x40fed6[_0x3d78('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x300175,_0x7d3476){return function(_0x6e8bdb){if(!_0x6e8bdb){_0x300175[_0x3d78('0x2d')](0x194);}return _0x6e8bdb;};}function handleError(_0x3464a1,_0x1f196c){_0x1f196c=_0x1f196c||0x1f4;return function(_0x3a9410){logger['error'](_0x3a9410[_0x3d78('0x2e')]);if(_0x3a9410['name']){delete _0x3a9410[_0x3d78('0x2f')];}_0x3464a1[_0x3d78('0x1e')](_0x1f196c)[_0x3d78('0x30')](_0x3a9410);};}exports['index']=function(_0x46ac49,_0x55a12a){var _0x1ec00f={},_0x347083={},_0x2e8bf0={'count':0x0,'rows':[]};var _0x5740a0=_[_0x3d78('0x31')](db[_0x3d78('0x32')][_0x3d78('0x33')],function(_0x1c9b32){return{'name':_0x1c9b32[_0x3d78('0x34')],'type':_0x1c9b32['type'][_0x3d78('0x35')]};});_0x347083[_0x3d78('0x36')]=_['map'](_0x5740a0,'name');_0x347083[_0x3d78('0x37')]=_[_0x3d78('0x38')](_0x46ac49[_0x3d78('0x37')]);_0x347083[_0x3d78('0x39')]=_[_0x3d78('0x3a')](_0x347083['model'],_0x347083['query']);_0x1ec00f['attributes']=_[_0x3d78('0x3a')](_0x347083[_0x3d78('0x36')],qs[_0x3d78('0x3b')](_0x46ac49[_0x3d78('0x37')][_0x3d78('0x3b')]));_0x1ec00f[_0x3d78('0x3c')]=_0x1ec00f[_0x3d78('0x3c')]['length']?_0x1ec00f['attributes']:_0x347083[_0x3d78('0x36')];if(!_0x46ac49['query'][_0x3d78('0x3d')]('nolimit')){_0x1ec00f[_0x3d78('0x23')]=qs[_0x3d78('0x23')](_0x46ac49['query'][_0x3d78('0x23')]);_0x1ec00f[_0x3d78('0x22')]=qs[_0x3d78('0x22')](_0x46ac49[_0x3d78('0x37')][_0x3d78('0x22')]);}_0x1ec00f['order']=qs[_0x3d78('0x3e')](_0x46ac49[_0x3d78('0x37')][_0x3d78('0x3e')]);_0x1ec00f[_0x3d78('0x3f')]=qs['filters'](_['pick'](_0x46ac49[_0x3d78('0x37')],_0x347083[_0x3d78('0x39')]),_0x5740a0);if(_0x46ac49[_0x3d78('0x37')][_0x3d78('0x40')]){_0x1ec00f[_0x3d78('0x3f')]=_['merge'](_0x1ec00f['where'],{'$or':_[_0x3d78('0x31')](_0x5740a0,function(_0x50f392){if(_0x50f392['type']!=='VIRTUAL'){var _0x5d55a0={};_0x5d55a0[_0x50f392['name']]={'$like':'%'+_0x46ac49[_0x3d78('0x37')][_0x3d78('0x40')]+'%'};return _0x5d55a0;}})});}_0x1ec00f=_[_0x3d78('0x41')]({},_0x1ec00f,_0x46ac49[_0x3d78('0x42')]);var _0x3d91b2={'where':_0x1ec00f[_0x3d78('0x3f')]};return db[_0x3d78('0x32')][_0x3d78('0x21')](_0x3d91b2)[_0x3d78('0x29')](function(_0x305d76){_0x2e8bf0[_0x3d78('0x21')]=_0x305d76;if(_0x46ac49[_0x3d78('0x37')]['includeAll']){_0x1ec00f[_0x3d78('0x43')]=[{'all':!![]}];}return db['Plugin'][_0x3d78('0x44')](_0x1ec00f);})[_0x3d78('0x29')](function(_0x3468c4){_0x2e8bf0[_0x3d78('0x45')]=_0x3468c4;return _0x2e8bf0;})[_0x3d78('0x29')](respondWithFilteredResult(_0x55a12a,_0x1ec00f))[_0x3d78('0x46')](handleError(_0x55a12a,null));};exports['show']=function(_0x4cc169,_0x1316cb){var _0x84fd95={'raw':!![],'where':{'id':_0x4cc169[_0x3d78('0x47')]['id']}},_0x53b94b={};_0x53b94b['model']=_['keys'](db[_0x3d78('0x32')]['rawAttributes']);_0x53b94b[_0x3d78('0x37')]=_[_0x3d78('0x38')](_0x4cc169[_0x3d78('0x37')]);_0x53b94b[_0x3d78('0x39')]=_[_0x3d78('0x3a')](_0x53b94b[_0x3d78('0x36')],_0x53b94b[_0x3d78('0x37')]);_0x84fd95['attributes']=_[_0x3d78('0x3a')](_0x53b94b[_0x3d78('0x36')],qs[_0x3d78('0x3b')](_0x4cc169[_0x3d78('0x37')]['fields']));_0x84fd95[_0x3d78('0x3c')]=_0x84fd95[_0x3d78('0x3c')][_0x3d78('0x48')]?_0x84fd95[_0x3d78('0x3c')]:_0x53b94b['model'];if(_0x4cc169[_0x3d78('0x37')][_0x3d78('0x49')]){_0x84fd95[_0x3d78('0x43')]=[{'all':!![]}];}_0x84fd95=_[_0x3d78('0x41')]({},_0x84fd95,_0x4cc169['options']);return db[_0x3d78('0x32')][_0x3d78('0x4a')](_0x84fd95)[_0x3d78('0x29')](handleEntityNotFound(_0x1316cb,null))['then'](respondWithResult(_0x1316cb,null))[_0x3d78('0x46')](handleError(_0x1316cb,null));};exports[_0x3d78('0x4b')]=function(_0x31d26b,_0x24b3b3,_0x23a9ff){return db[_0x3d78('0x32')]['find']({'where':{'id':_0x31d26b['params']['id']},'attributes':[_0x3d78('0x2f'),_0x3d78('0x9')],'raw':!![]})[_0x3d78('0x29')](handleEntityNotFound(_0x24b3b3,null))['then'](function(_0x373b61){if(_0x373b61){var _0x5ca720=path['join'](config[_0x3d78('0x4c')],'server/files/plugins',util[_0x3d78('0x4d')]('%s.zip',path['basename'](_0x373b61[_0x3d78('0x9')])));var _0x3b49eb=fs[_0x3d78('0x4e')](_0x5ca720);var _0x4498ca=archiver(_0x3d78('0x4f'),{'zlib':{'level':0x9}});_0x4498ca['on'](_0x3d78('0x50'),function(_0x386968){if(_0x386968[_0x3d78('0x51')]==='ENOENT'){logger['error'](_0x386968);}else{throw new db[(_0x3d78('0x52'))][(_0x3d78('0x53'))](_0x3d78('0x54'));}});_0x4498ca['on'](_0x3d78('0x55'),function(_0x694b1){throw new db[(_0x3d78('0x52'))][(_0x3d78('0x53'))](_0x3d78('0x54'));});_0x4498ca[_0x3d78('0x56')](_0x3b49eb);_0x4498ca[_0x3d78('0x57')](_0x3d78('0x58'),{'cwd':path['join'](config[_0x3d78('0x4c')],_0x3d78('0x59'),path['dirname'](_0x373b61[_0x3d78('0x9')])),'ignore':[path['join'](path[_0x3d78('0x5a')](_0x373b61[_0x3d78('0x9')]),_0x3d78('0x5b')),path[_0x3d78('0x5c')](path[_0x3d78('0x5a')](_0x373b61[_0x3d78('0x9')]),_0x3d78('0x5d'))],'nodir':!![]})[_0x3d78('0x5e')]();_0x3b49eb['on']('close',function(){if(!fs[_0x3d78('0x5f')](_0x5ca720)){throw new db[(_0x3d78('0x52'))][(_0x3d78('0x53'))](_0x3d78('0x60'));}return _0x24b3b3[_0x3d78('0x4b')](_0x5ca720,util[_0x3d78('0x4d')]('%s.zip',path[_0x3d78('0x5a')](_0x373b61[_0x3d78('0x9')])),function(_0x2449b1){if(_0x2449b1){throw new db[(_0x3d78('0x52'))][(_0x3d78('0x53'))](_0x3d78('0x61'));}fs[_0x3d78('0x62')](_0x5ca720);logger[_0x3d78('0x63')](_0x3d78('0x64'));logger[_0x3d78('0x63')](_0x3d78('0x65'));});});}return null;})[_0x3d78('0x46')](handleError(_0x24b3b3,null));};exports['upload']=function(_0x1eb382,_0x32918d,_0x35837d){var _0x48395a=path[_0x3d78('0x5a')](_0x1eb382['file']['filename'],path['extname'](_0x1eb382[_0x3d78('0x66')]['filename']));var _0x186e25=path[_0x3d78('0x5c')](config['root'],'server/files/plugins',_0x1eb382['file'][_0x3d78('0x67')]);var _0x17990e=path[_0x3d78('0x5c')](config[_0x3d78('0x4c')],'server/files/plugins',_0x48395a);logger[_0x3d78('0x63')]('Plugin\x20upload\x20filepath:\x20%s',_0x186e25);logger[_0x3d78('0x63')](_0x3d78('0x68'),_0x17990e);try{fs[_0x3d78('0x69')](_0x186e25,parseInt(_0x3d78('0x6a'),0x8));extract(_0x186e25,{'dir':_0x17990e},function(_0x50fd69){if(_0x50fd69){logger[_0x3d78('0x55')](_0x50fd69);handleError(_0x50fd69,!![]);};var _0x2fd7d8=fs[_0x3d78('0x6b')](_0x17990e);if(_0x2fd7d8[_0x3d78('0x48')]>0x1){removeReferences(_0x186e25,_0x17990e);logger[_0x3d78('0x55')](_0x3d78('0x6c'));return _0x35837d(new Error(_0x3d78('0x6c')));}var _0xad5e5c=fs[_0x3d78('0x6d')](path[_0x3d78('0x5c')](_0x17990e,_0x2fd7d8[0x0]));if(_0xad5e5c['isFile']()){removeReferences(_0x186e25,_0x17990e);logger[_0x3d78('0x55')](_0x3d78('0x6c'));return _0x35837d(new Error(_0x3d78('0x6c')));}if(_0xad5e5c[_0x3d78('0x6e')]()){var _0x263021=fs[_0x3d78('0x6b')](path[_0x3d78('0x5c')](_0x17990e,_0x2fd7d8[0x0]));if(_0x263021['length']===0x0){removeReferences(_0x186e25,_0x17990e);logger['error'](_0x3d78('0x6c'));return _0x35837d(new Error(_0x3d78('0x6c')));}var _0x30fa9e=_0x263021[_0x3d78('0x6f')](function(_0x3f13cd){return _0x3f13cd===_0x3d78('0x70');});if(!_0x30fa9e){return _0x35837d(new Error(_0x3d78('0x71')));}var _0x3c8f18=fs[_0x3d78('0x72')](path[_0x3d78('0x5c')](_0x17990e,_0x2fd7d8[0x0],_0x3d78('0x70')));var _0x290089=JSON['parse'](_0x3c8f18);if('undefined'==typeof _0x290089[_0x3d78('0x2f')]){return _0x35837d(new Error(_0x3d78('0x73')));}if(_0x3d78('0x74')==typeof _0x290089[_0x3d78('0x75')]){return _0x35837d(new Error(_0x3d78('0x76')));}if(_0x3d78('0x74')==typeof _0x290089[_0x3d78('0x77')]){return _0x35837d(new Error(_0x3d78('0x78')));}if(_0x3d78('0x74')==typeof _0x290089[_0x3d78('0x79')]){return _0x35837d(new Error(_0x3d78('0x7a')));}if(_0x290089['type']===_0x3d78('0x7b')){if(_0x3d78('0x74')==typeof _0x290089[_0x3d78('0x79')][_0x3d78('0x7c')]){return _0x35837d(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x3d78('0x74')==typeof _0x290089['parameters'][_0x3d78('0x7c')]['admin']&&_0x3d78('0x74')==typeof _0x290089[_0x3d78('0x79')][_0x3d78('0x7c')][_0x3d78('0x7d')]){return _0x35837d(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x290089[_0x3d78('0x75')]===_0x3d78('0x7e')){if('undefined'==typeof _0x290089[_0x3d78('0x79')][_0x3d78('0x7f')]){return _0x35837d(new Error(_0x3d78('0x80')));}if(_0x3d78('0x74')==typeof _0x290089['parameters'][_0x3d78('0x81')]){return _0x35837d(new Error(_0x3d78('0x82')));}}else{return _0x35837d(new Error(_0x3d78('0x83')));}var _0x516d02=_0x290089[_0x3d78('0x2f')];var _0x2ada6b=_0x290089[_0x3d78('0x84')];var _0x1dec3f=_0x290089[_0x3d78('0x75')];var _0x2bc676=_0x290089[_0x3d78('0x85')]?_0x290089[_0x3d78('0x85')]:_0x3d78('0x86');var _0x206c1e=_0x290089['icon']?_0x290089[_0x3d78('0x87')]:'icon-apps';var _0x1fe8c8='';var _0x692b5d='';var _0x4f5991='';var _0x1668ed='';var _0x4ad179=_0x290089['version'];if(_0x1dec3f==='html'){if(_0x3d78('0x74')!=typeof _0x290089['parameters'][_0x3d78('0x7c')][_0x3d78('0x88')]){var _0x413ea4=_0x290089[_0x3d78('0x79')][_0x3d78('0x7c')][_0x3d78('0x88')];if(!/^(f|ht)tps?:\/\//i[_0x3d78('0x89')](_0x413ea4)){_0x1fe8c8=path[_0x3d78('0x5c')](_0x3d78('0x8a'),_0x48395a,_0x2fd7d8[0x0],_0x413ea4);}else{_0x1fe8c8=_0x413ea4;}}else{logger[_0x3d78('0x63')](_0x3d78('0x8b'));}if(_0x3d78('0x74')!=typeof _0x290089[_0x3d78('0x79')][_0x3d78('0x7c')]['agent']){var _0x1b98e6=_0x290089['parameters'][_0x3d78('0x7c')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x3d78('0x89')](_0x1b98e6)){_0x692b5d=path[_0x3d78('0x5c')](_0x3d78('0x8a'),_0x48395a,_0x2fd7d8[0x0],_0x1b98e6);}else{_0x692b5d=_0x1b98e6;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x1dec3f==='script'){_0x4f5991=_0x290089[_0x3d78('0x79')][_0x3d78('0x7f')];_0x1668ed=_0x290089[_0x3d78('0x79')][_0x3d78('0x81')];if(_0x3d78('0x74')!=typeof _0x290089[_0x3d78('0x79')][_0x3d78('0x7c')]){if(_0x3d78('0x74')!=typeof _0x290089[_0x3d78('0x79')][_0x3d78('0x7c')][_0x3d78('0x88')]){var _0x413ea4=_0x290089[_0x3d78('0x79')][_0x3d78('0x7c')][_0x3d78('0x88')];if(!/^(f|ht)tps?:\/\//i[_0x3d78('0x89')](_0x413ea4)){_0x1fe8c8=path[_0x3d78('0x5c')]('plugins',_0x48395a,_0x2fd7d8[0x0],_0x413ea4);}else{_0x1fe8c8=_0x413ea4;}}if(_0x3d78('0x74')!=typeof _0x290089[_0x3d78('0x79')][_0x3d78('0x7c')]['agent']){var _0x1b98e6=_0x290089[_0x3d78('0x79')][_0x3d78('0x7c')][_0x3d78('0x7d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1b98e6)){_0x692b5d=path[_0x3d78('0x5c')](_0x3d78('0x8a'),_0x48395a,_0x2fd7d8[0x0],_0x1b98e6);}else{_0x692b5d=_0x1b98e6;}}}}var _0x492bcf={'name':_0x516d02,'description':_0x2ada6b,'path':path['join'](_0x48395a,_0x2fd7d8[0x0]),'type':_0x1dec3f,'sidebar':_0x2bc676,'icon':_0x206c1e,'adminUrl':_0x1fe8c8,'agentUrl':_0x692b5d,'scriptName':_0x4f5991,'scriptPath':_0x1668ed,'version':_0x4ad179};removeReferences(_0x186e25,null);return db[_0x3d78('0x32')][_0x3d78('0x8c')](_0x492bcf)[_0x3d78('0x29')](function(_0x1df3a7){var _0xbcccea={'role':_0x1eb382['body'][_0x3d78('0x8d')],'userProfileId':_0x1eb382[_0x3d78('0x8e')]['userProfileId']};if(!_0xbcccea)throw new Error(_0x3d78('0x8f'));if(_0xbcccea[_0x3d78('0x8d')]===_0x3d78('0x90')){var _0x16b3a2=_0x1df3a7['get']({'plain':!![]});return db['UserProfileSection'][_0x3d78('0x4a')]({'where':{'name':_0x3d78('0x91'),'userProfileId':_0xbcccea[_0x3d78('0x92')]},'raw':!![]})[_0x3d78('0x29')](function(_0x217594){if(_0x217594&&_0x217594[_0x3d78('0x93')]===0x0){return db[_0x3d78('0x2c')][_0x3d78('0x8c')]({'name':_0x16b3a2[_0x3d78('0x2f')],'resourceId':_0x16b3a2['id'],'type':_0x217594[_0x3d78('0x2f')],'sectionId':_0x217594['id']},{})[_0x3d78('0x29')](function(){return _0x1df3a7;});}else{return _0x1df3a7;}})[_0x3d78('0x46')](function(_0x262264){logger[_0x3d78('0x55')](_0x3d78('0x94'),_0x262264);throw _0x262264;});}return _0x1df3a7;})[_0x3d78('0x29')](respondWithResult(_0x32918d,null))[_0x3d78('0x46')](handleError(_0x32918d,null));}});}catch(_0x215e0a){_0x32918d[_0x3d78('0x1e')](0x1f4)[_0x3d78('0x30')](_0x215e0a);}};function removeReferences(_0x1f6d00,_0x43f39b){try{if(_0x1f6d00){fs[_0x3d78('0x62')](_0x1f6d00);logger[_0x3d78('0x63')](_0x3d78('0x95'));}if(_0x43f39b){rimraf(_0x43f39b,function(){});logger[_0x3d78('0x63')](_0x3d78('0x96'));}}catch(_0xe07389){logger[_0x3d78('0x55')](_0xe07389);}}exports[_0x3d78('0x28')]=function(_0x161519,_0x3aea43,_0x18a27d){return db[_0x3d78('0x32')][_0x3d78('0x4a')]({'where':{'id':_0x161519[_0x3d78('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aea43,null))[_0x3d78('0x29')](saveUpdates(_0x161519[_0x3d78('0x8e')],null))[_0x3d78('0x29')](respondWithResult(_0x3aea43,null))['catch'](handleError(_0x3aea43,null));};exports[_0x3d78('0x97')]=function(_0x535b8d,_0x542d15,_0x2f795a){return db[_0x3d78('0x32')][_0x3d78('0x4a')]({'where':{'id':_0x535b8d[_0x3d78('0x47')]['id']}})[_0x3d78('0x29')](function(_0xafe43){if(_0xafe43){return _0xafe43[_0x3d78('0x2a')]();}})[_0x3d78('0x29')](function(_0x1768dc){rimraf(path[_0x3d78('0x5c')](config[_0x3d78('0x4c')],_0x3d78('0x59'),path['dirname'](_0x1768dc[_0x3d78('0x9')])),function(){});return _0x1768dc;})['then'](handleEntityNotFound(_0x542d15,null))['then'](respondWithStatusCode(_0x542d15,null))[_0x3d78('0x46')](handleError(_0x542d15,null));};exports[_0x3d78('0x98')]=function(_0x22aece,_0x205d76,_0x4ed131){return BPromise['resolve']()['then'](function(){if(!_0x22aece[_0x3d78('0x37')]['path']){throw new Error(_0x3d78('0x99'));}if(!_0x22aece['query']['port']){throw new Error(_0x3d78('0x9a'));}var _0x541687=_0x22aece[_0x3d78('0x37')][_0x3d78('0x9b')]?_0x22aece['query']['hostname']+':'+_0x22aece['query']['port']:'http://localhost:'+_0x22aece[_0x3d78('0x37')][_0x3d78('0x9c')];var _0x16d21a=_0x22aece[_0x3d78('0x37')][_0x3d78('0x20')]?_0x22aece['query'][_0x3d78('0x20')]:!![];var _0x18b014=_0x22aece[_0x3d78('0x37')][_0x3d78('0x9d')]?_0x22aece[_0x3d78('0x37')][_0x3d78('0x9d')]:null;var _0x3d8fce={'method':_0x22aece[_0x3d78('0x9e')],'uri':util['format']('%s%s',_0x541687,_0x22aece[_0x3d78('0x37')]['path']),'json':_0x16d21a,'resolveWithFullResponse':!![],'encoding':_0x18b014,'qs':_0x22aece[_0x3d78('0x37')]};if(_0x22aece[_0x3d78('0x9f')]){_0x3d8fce[_0x3d78('0x9f')]=_0x22aece[_0x3d78('0x9f')];if(_0x3d8fce['headers'][_0x3d78('0xa0')]){delete _0x3d8fce['headers'][_0x3d78('0xa0')];}}if(_0x3d8fce[_0x3d78('0x9f')]['content-type']){delete _0x3d8fce['headers']['content-type'];}return rp(_0x3d8fce);})[_0x3d78('0x29')](function(_0x58eebd){if(_0x58eebd){_0x205d76[_0x3d78('0xa1')](_0x58eebd[_0x3d78('0x9f')]);logger[_0x3d78('0x63')](_0x58eebd[_0x3d78('0x8e')]);if(_[_0x3d78('0xa2')](_0x22aece[_0x3d78('0x37')][_0x3d78('0x9')],_0x3d78('0x4b'))&&_0x58eebd[_0x3d78('0xa3')]==0x1f4){return _0x205d76[_0x3d78('0x2d')](_0x58eebd[_0x3d78('0xa3')]);}else{return _0x205d76[_0x3d78('0x1e')](_0x58eebd[_0x3d78('0xa3')])['send'](_0x58eebd[_0x3d78('0x8e')]);}}else{return _0x205d76[_0x3d78('0x2d')](0xc8);}})['catch'](handleError(_0x205d76,null));};exports[_0x3d78('0xa4')]=function(_0x3bfb09,_0x45c813,_0x58edaf){return BPromise[_0x3d78('0xa5')]()[_0x3d78('0x29')](function(){if(!_0x3bfb09[_0x3d78('0x37')][_0x3d78('0x9')]){throw new Error(_0x3d78('0x99'));}if(!_0x3bfb09[_0x3d78('0x37')][_0x3d78('0x9c')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2bb995=_0x3bfb09[_0x3d78('0x37')][_0x3d78('0x9b')]?_0x3bfb09['query'][_0x3d78('0x9b')]+':'+_0x3bfb09[_0x3d78('0x37')][_0x3d78('0x9c')]:_0x3d78('0xa6')+_0x3bfb09[_0x3d78('0x37')][_0x3d78('0x9c')];var _0x4c0314=_0x3bfb09[_0x3d78('0x37')][_0x3d78('0x20')]?_0x3bfb09[_0x3d78('0x37')][_0x3d78('0x20')]:!![];var _0x6dca60=_0x3bfb09[_0x3d78('0x37')][_0x3d78('0x9d')]?_0x3bfb09[_0x3d78('0x37')][_0x3d78('0x9d')]:null;var _0x5bf278={'method':_0x3bfb09[_0x3d78('0x9e')],'uri':util[_0x3d78('0x4d')]('%s%s',_0x2bb995,_0x3bfb09[_0x3d78('0x37')][_0x3d78('0x9')]),'json':_0x4c0314,'resolveWithFullResponse':!![],'encoding':_0x6dca60,'body':_0x3bfb09[_0x3d78('0x8e')]};if(_0x3bfb09['headers']){_0x5bf278['headers']=_0x3bfb09[_0x3d78('0x9f')];if(_0x5bf278[_0x3d78('0x9f')][_0x3d78('0xa0')]){delete _0x5bf278[_0x3d78('0x9f')][_0x3d78('0xa0')];}}if(_0x5bf278[_0x3d78('0x9f')][_0x3d78('0xa7')]){delete _0x5bf278[_0x3d78('0x9f')][_0x3d78('0xa7')];}return rp(_0x5bf278);})[_0x3d78('0x29')](function(_0xb01c4f){if(_0xb01c4f){_0x45c813[_0x3d78('0xa1')](_0xb01c4f[_0x3d78('0x9f')]);logger[_0x3d78('0x63')](_0xb01c4f['body']);return _0x45c813['status'](_0xb01c4f[_0x3d78('0xa3')])[_0x3d78('0x30')](_0xb01c4f[_0x3d78('0x8e')]);}else{return _0x45c813['sendStatus'](0xc8);}})[_0x3d78('0x46')](handleError(_0x45c813,null));};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js
index 8cf0d2f..ec1d06f 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 _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
+var _0x28f2=['remove','emit','hook','events','../../mysqldb','Plugin','setMaxListeners','save'];(function(_0x2f3933,_0x475ba9){var _0x3f56a0=function(_0x5b20ec){while(--_0x5b20ec){_0x2f3933['push'](_0x2f3933['shift']());}};_0x3f56a0(++_0x475ba9);}(_0x28f2,0x193));var _0x228f=function(_0x76376b,_0x3edb7b){_0x76376b=_0x76376b-0x0;var _0x410343=_0x28f2[_0x76376b];return _0x410343;};'use strict';var EventEmitter=require(_0x228f('0x0'));var Plugin=require(_0x228f('0x1'))['db'][_0x228f('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x228f('0x3')](0x0);var events={'afterCreate':_0x228f('0x4'),'afterUpdate':'update','afterDestroy':_0x228f('0x5')};function emitEvent(_0x11c2cd){return function(_0x79ed5f,_0x4303c3,_0x2bb7d7){PluginEvents[_0x228f('0x6')](_0x11c2cd+':'+_0x79ed5f['id'],_0x79ed5f);PluginEvents[_0x228f('0x6')](_0x11c2cd,_0x79ed5f);_0x2bb7d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x228f('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js
index da61485..40bb036 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 _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
+var _0x0ee2=['define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./plugin.attributes','exports'];(function(_0x539bde,_0x14b7db){var _0x1718d4=function(_0x1d35e0){while(--_0x1d35e0){_0x539bde['push'](_0x539bde['shift']());}};_0x1718d4(++_0x14b7db);}(_0x0ee2,0x1df));var _0x20ee=function(_0x571ee7,_0x9a27a4){_0x571ee7=_0x571ee7-0x0;var _0x48bc4c=_0x0ee2[_0x571ee7];return _0x48bc4c;};'use strict';var _=require(_0x20ee('0x0'));var util=require(_0x20ee('0x1'));var logger=require(_0x20ee('0x2'))(_0x20ee('0x3'));var moment=require(_0x20ee('0x4'));var BPromise=require(_0x20ee('0x5'));var rp=require(_0x20ee('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20ee('0x7'));var config=require(_0x20ee('0x8'));var attributes=require(_0x20ee('0x9'));module[_0x20ee('0xa')]=function(_0x528108,_0x5d3461){return _0x528108[_0x20ee('0xb')](_0x20ee('0xc'),attributes,{'tableName':_0x20ee('0xd'),'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 6bde557..5603735 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 _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
+var _0x1b1e=['request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','options','raw','bluebird','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','Plugin,\x20%s,\x20%s'];(function(_0x512973,_0x564e8b){var _0x32f2e1=function(_0x5d5d3b){while(--_0x5d5d3b){_0x512973['push'](_0x512973['shift']());}};_0x32f2e1(++_0x564e8b);}(_0x1b1e,0xe6));var _0xe1b1=function(_0x4d8fe1,_0x3ed474){_0x4d8fe1=_0x4d8fe1-0x0;var _0x46685e=_0x1b1e[_0x4d8fe1];return _0x46685e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe1b1('0x0'));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(_0xe1b1('0x1'))('rpc');var config=require(_0xe1b1('0x2'));var jayson=require('jayson/promise');var client=jayson[_0xe1b1('0x3')][_0xe1b1('0x4')]({'port':0x232a});config[_0xe1b1('0x5')]=_[_0xe1b1('0x6')](config[_0xe1b1('0x5')],{'host':_0xe1b1('0x7'),'port':0x18eb});var socket=require(_0xe1b1('0x8'))(new Redis(config[_0xe1b1('0x5')]));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x1e722c,_0xa3c757,_0x4681eb){return new BPromise(function(_0x51f80f,_0x5075dd){return client[_0xe1b1('0x9')](_0x1e722c,_0x4681eb)[_0xe1b1('0xa')](function(_0x23b8a1){logger[_0xe1b1('0xb')](_0xe1b1('0xc'),_0xa3c757,_0xe1b1('0xd'));logger[_0xe1b1('0xe')](_0xe1b1('0xf'),_0xa3c757,_0xe1b1('0xd'),JSON[_0xe1b1('0x10')](_0x23b8a1));if(_0x23b8a1[_0xe1b1('0x11')]){if(_0x23b8a1['error'][_0xe1b1('0x12')]===0x1f4){logger[_0xe1b1('0x11')]('Plugin,\x20%s,\x20%s',_0xa3c757,_0x23b8a1[_0xe1b1('0x11')][_0xe1b1('0x13')]);return _0x5075dd(_0x23b8a1[_0xe1b1('0x11')][_0xe1b1('0x13')]);}logger['error'](_0xe1b1('0xc'),_0xa3c757,_0x23b8a1[_0xe1b1('0x11')][_0xe1b1('0x13')]);return _0x51f80f(_0x23b8a1[_0xe1b1('0x11')]['message']);}else{logger[_0xe1b1('0xb')](_0xe1b1('0xc'),_0xa3c757,_0xe1b1('0xd'));_0x51f80f(_0x23b8a1[_0xe1b1('0x14')]['message']);}})[_0xe1b1('0x15')](function(_0x211cbf){logger['error']('Plugin,\x20%s,\x20%s',_0xa3c757,_0x211cbf);_0x5075dd(_0x211cbf);});});}exports[_0xe1b1('0x16')]=function(_0x41c04f){var _0x1a2d83=this;return new Promise(function(_0x3bec59,_0x494553){return db[_0xe1b1('0x17')][_0xe1b1('0x18')](_0x41c04f['body'],{'raw':_0x41c04f['options']?_0x41c04f[_0xe1b1('0x19')][_0xe1b1('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3c2563){logger['info'](_0xe1b1('0x16'),_0x41c04f);logger[_0xe1b1('0xe')](_0xe1b1('0x16'),_0x41c04f,JSON[_0xe1b1('0x10')](_0x3c2563));_0x3bec59(_0x3c2563);})[_0xe1b1('0x15')](function(_0x1b650c){logger['error'](_0xe1b1('0x16'),_0x1b650c[_0xe1b1('0x13')],_0x41c04f);_0x494553(_0x1a2d83['error'](0x1f4,_0x1b650c[_0xe1b1('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js
index 476d19a..5ad0237 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 _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
+var _0xa596=['emit','removeListener','length','./plugin.events','save','update'];(function(_0x2ad78d,_0x470f64){var _0x309a77=function(_0x23eb0b){while(--_0x23eb0b){_0x2ad78d['push'](_0x2ad78d['shift']());}};_0x309a77(++_0x470f64);}(_0xa596,0x7b));var _0x6a59=function(_0xe5c22,_0x1250ed){_0xe5c22=_0xe5c22-0x0;var _0x1ead3d=_0xa596[_0xe5c22];return _0x1ead3d;};'use strict';var PluginEvents=require(_0x6a59('0x0'));var events=[_0x6a59('0x1'),'remove',_0x6a59('0x2')];function createListener(_0x15ba20,_0x2cf59f){return function(_0x115c98){_0x2cf59f[_0x6a59('0x3')](_0x15ba20,_0x115c98);};}function removeListener(_0xf0435f,_0x11cce1){return function(){PluginEvents[_0x6a59('0x4')](_0xf0435f,_0x11cce1);};}exports['register']=function(_0x37d9ef){for(var _0x3fab57=0x0,_0x21e97f=events[_0x6a59('0x5')];_0x3fab57<_0x21e97f;_0x3fab57++){var _0xb50532=events[_0x3fab57];var _0x3c392f=createListener('plugin:'+_0xb50532,_0x37d9ef);PluginEvents['on'](_0xb50532,_0x3c392f);}};
\ No newline at end of file
diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js
index 513adb8..b53174a 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 _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
+var _0xd57d=['isAuthenticated','index','/:id','post','create','put','update','destroy','exports','express','../../components/auth/service','./pm2.controller','get'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xd57d,0xf3));var _0xdd57=function(_0x195ae3,_0x421775){_0x195ae3=_0x195ae3-0x0;var _0x29b5d7=_0xd57d[_0x195ae3];return _0x29b5d7;};'use strict';var express=require(_0xdd57('0x0'));var router=express['Router']();var auth=require(_0xdd57('0x1'));var controller=require(_0xdd57('0x2'));router[_0xdd57('0x3')]('/',auth[_0xdd57('0x4')](),controller[_0xdd57('0x5')]);router[_0xdd57('0x3')](_0xdd57('0x6'),auth[_0xdd57('0x4')](),controller['show']);router[_0xdd57('0x7')]('/',auth['isAuthenticated'](),controller[_0xdd57('0x8')]);router[_0xdd57('0x9')]('/:id',auth[_0xdd57('0x4')](),controller[_0xdd57('0xa')]);router['delete']('/:id',auth[_0xdd57('0x4')](),controller[_0xdd57('0xb')]);module[_0xdd57('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js
index 82c7bc7..3a70b9a 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 _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
+var _0xbeb4=['motion2','length','show','describe','params','catch','create','body','script','join','../../files/plugins','cwd','dirname','chdir','start','dump','send','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','api','child_process','exec','sendStatus','json','name','status','npm\x20install','error','list','then','reject','express'];(function(_0x9f5ee9,_0x146d7a){var _0xb6130d=function(_0x566b35){while(--_0x566b35){_0x9f5ee9['push'](_0x9f5ee9['shift']());}};_0xb6130d(++_0x146d7a);}(_0xbeb4,0x181));var _0x4beb=function(_0x2f180f,_0x2110e5){_0x2f180f=_0x2f180f-0x0;var _0x447977=_0xbeb4[_0x2f180f];return _0x447977;};'use strict';var _=require(_0x4beb('0x0'));var pm2=require(_0x4beb('0x1'));var logger=require('../../config/logger')(_0x4beb('0x2'));var path=require('path');var exec=require(_0x4beb('0x3'))[_0x4beb('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x206de9,_0x468fc0){return function(_0x42ef24){if(!_0x42ef24){_0x206de9[_0x4beb('0x5')](0x194);;}return _0x42ef24;};}function respondWithResult(_0xc35f45,_0x425fe1){_0x425fe1=_0x425fe1||0xc8;return function(_0x5b99c1){if(_0x5b99c1){return _0xc35f45['status'](_0x425fe1)[_0x4beb('0x6')](_0x5b99c1);}return null;};}function handleError(_0x106031,_0xd5c337){_0xd5c337=_0xd5c337||0x1f4;return function(_0x6e0bcf){logger['error'](_0x6e0bcf['stack']);if(_0x6e0bcf[_0x4beb('0x7')]){delete _0x6e0bcf[_0x4beb('0x7')];}_0x106031[_0x4beb('0x8')](_0xd5c337)['send'](_0x6e0bcf);};}function execChildProcess(){return new BPromise(function(_0x5cee5b,_0x773165){exec(_0x4beb('0x9'),function(_0xc84cab,_0x5c223e,_0x554465){logger['info'](_0x5c223e);logger['info'](_0x554465);if(_0xc84cab){logger[_0x4beb('0xa')](_0xc84cab);return _0x773165(_0xc84cab);}return _0x5cee5b(_0x5c223e);});});}exports['index']=function(_0x21d8cc,_0x385ed7){return pm2[_0x4beb('0xb')]()[_0x4beb('0xc')](function(_0x2d5752){if(_0x2d5752){var _0x13a055=_[_0x4beb('0xd')](_0x2d5752,function(_0x2078b5){return _0x2078b5[_0x4beb('0x7')]===_0x4beb('0xe')||_0x2078b5[_0x4beb('0x7')]===_0x4beb('0xf');});return{'rows':_0x13a055,'count':_0x13a055[_0x4beb('0x10')]};}return null;})[_0x4beb('0xc')](respondWithResult(_0x385ed7,null))['catch'](handleError(_0x385ed7,null));};exports[_0x4beb('0x11')]=function(_0x56ea87,_0x3eeb6f){return pm2[_0x4beb('0x12')](_0x56ea87[_0x4beb('0x13')]['id'])[_0x4beb('0xc')](respondWithResult(_0x3eeb6f,null))['then'](handleEntityNotFound(_0x3eeb6f,null))[_0x4beb('0x14')](handleError(_0x3eeb6f,null));};exports[_0x4beb('0x15')]=function(_0x2c97e0,_0x3cb530){if(_0x2c97e0[_0x4beb('0x16')][_0x4beb('0x7')]&&_0x2c97e0[_0x4beb('0x16')][_0x4beb('0x17')]){var _0x4bfc65=path[_0x4beb('0x18')](__dirname,_0x4beb('0x19'),_0x2c97e0[_0x4beb('0x16')][_0x4beb('0x17')]);var _0x4c23b7=process[_0x4beb('0x1a')]();process['chdir'](path[_0x4beb('0x1b')](_0x4bfc65));return execChildProcess()['then'](function(_0x3c2baa){process[_0x4beb('0x1c')](_0x4c23b7);return pm2[_0x4beb('0x1d')]({'name':_0x2c97e0[_0x4beb('0x16')][_0x4beb('0x7')],'script':_0x4bfc65});})['then'](function(_0x5644f1){pm2[_0x4beb('0x1e')]();return _0x5644f1[0x0];})[_0x4beb('0xc')](respondWithResult(_0x3cb530,0xc9))[_0x4beb('0x14')](handleError(_0x3cb530,null));}else{return _0x3cb530[_0x4beb('0x8')](0x1f4)[_0x4beb('0x1f')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x4beb('0x20')]=function(_0x56855f,_0x59bdb2){if(_0x56855f['body']['id']){delete _0x56855f[_0x4beb('0x16')]['id'];}var _0x2e0efe={'online':_0x4beb('0x21'),'stopped':_0x4beb('0x22')};if(_0x2e0efe[_0x4beb('0x23')](_0x56855f[_0x4beb('0x16')]['status'])){return pm2[_0x2e0efe[_0x56855f[_0x4beb('0x16')][_0x4beb('0x8')]]](_0x56855f[_0x4beb('0x13')]['id'])[_0x4beb('0xc')](respondWithResult(_0x59bdb2,0xc8))[_0x4beb('0x14')](handleError(_0x59bdb2,null));}else{return _0x59bdb2['status'](0x1f4)[_0x4beb('0x1f')]({'message':_0x4beb('0x24')});}};exports[_0x4beb('0x25')]=function(_0xb9af42,_0xca968c){if(_0xb9af42['body']['id']){delete _0xb9af42[_0x4beb('0x16')]['id'];}if(_0xb9af42[_0x4beb('0x13')]['id']){return pm2[_0x4beb('0x26')](_0xb9af42[_0x4beb('0x13')]['id'])['then'](function(_0x2b4e7b){pm2['dump']();return _0x2b4e7b[0x0];})[_0x4beb('0xc')](respondWithResult(_0xca968c,null))['catch'](handleError(_0xca968c,null));}else{return _0xca968c[_0x4beb('0x8')](0x1f4)['send']({'message':_0x4beb('0x27')});}};
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js
index 21464ea..142734e 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 _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
+var _0xb827=['util','express','exports','multer'];(function(_0x35408d,_0x58b803){var _0x25af9a=function(_0x37959e){while(--_0x37959e){_0x35408d['push'](_0x35408d['shift']());}};_0x25af9a(++_0x58b803);}(_0xb827,0xc7));var _0x7b82=function(_0x50a0f8,_0x27c0fb){_0x50a0f8=_0x50a0f8-0x0;var _0x52e53d=_0xb827[_0x50a0f8];return _0x52e53d;};'use strict';var multer=require(_0x7b82('0x0'));var util=require(_0x7b82('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7b82('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x7b82('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js
index 6fd26cf..fb966e2 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 _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
+var _0x7980=['STRING','sequelize','exports','INTEGER','DATE'];(function(_0xe6c1c5,_0x4a8df3){var _0x2eb3bd=function(_0xbaa3c1){while(--_0xbaa3c1){_0xe6c1c5['push'](_0xe6c1c5['shift']());}};_0x2eb3bd(++_0x4a8df3);}(_0x7980,0x137));var _0x0798=function(_0x29220e,_0x449b05){_0x29220e=_0x29220e-0x0;var _0x54aed0=_0x7980[_0x29220e];return _0x54aed0;};'use strict';var Sequelize=require(_0x0798('0x0'));module[_0x0798('0x1')]={'state':{'type':Sequelize[_0x0798('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x0798('0x3')]},'uniqueid':{'type':Sequelize[_0x0798('0x4')]},'starttime':{'type':Sequelize[_0x0798('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x0798('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x0798('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0798('0x4')]}};
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js
index f1267db..ca2d58b 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 _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
+var _0x1854=['request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api'];(function(_0x31ef02,_0x50674d){var _0x44ab88=function(_0x40c222){while(--_0x40c222){_0x31ef02['push'](_0x31ef02['shift']());}};_0x44ab88(++_0x50674d);}(_0x1854,0x188));var _0x4185=function(_0x37e342,_0x160c8f){_0x37e342=_0x37e342-0x0;var _0x1768f9=_0x1854[_0x37e342];return _0x1768f9;};'use strict';var _=require(_0x4185('0x0'));var util=require(_0x4185('0x1'));var logger=require(_0x4185('0x2'))(_0x4185('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4185('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4185('0x5'));var config=require(_0x4185('0x6'));var attributes=require(_0x4185('0x7'));module['exports']=function(_0x4cf5aa,_0x5e285c){return _0x4cf5aa[_0x4185('0x8')](_0x4185('0x9'),attributes,{'tableName':_0x4185('0xa'),'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 ab68457..2ed47d6 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 _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
+var _0x49d0=['options','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body'];(function(_0x36ab21,_0x44b7c0){var _0x1da5a6=function(_0x168519){while(--_0x168519){_0x36ab21['push'](_0x36ab21['shift']());}};_0x1da5a6(++_0x44b7c0);}(_0x49d0,0x136));var _0x049d=function(_0x557280,_0x5d138e){_0x557280=_0x557280-0x0;var _0x1dcac3=_0x49d0[_0x557280];return _0x1dcac3;};'use strict';var _=require('lodash');var util=require(_0x049d('0x0'));var moment=require(_0x049d('0x1'));var BPromise=require(_0x049d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x049d('0x3'));var db=require(_0x049d('0x4'))['db'];var utils=require(_0x049d('0x5'));var logger=require(_0x049d('0x6'))(_0x049d('0x7'));var config=require('../../config/environment');var jayson=require(_0x049d('0x8'));var client=jayson[_0x049d('0x9')][_0x049d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f34e0,_0x15b767,_0x151a81){return new BPromise(function(_0x26cd24,_0x3efc82){return client[_0x049d('0xb')](_0x2f34e0,_0x151a81)['then'](function(_0xff4a91){logger['info'](_0x049d('0xc'),_0x15b767,'request\x20sent');logger[_0x049d('0xd')](_0x049d('0xe'),_0x15b767,_0x049d('0xf'),JSON['stringify'](_0xff4a91));if(_0xff4a91[_0x049d('0x10')]){if(_0xff4a91[_0x049d('0x10')][_0x049d('0x11')]===0x1f4){logger[_0x049d('0x10')](_0x049d('0xc'),_0x15b767,_0xff4a91[_0x049d('0x10')][_0x049d('0x12')]);return _0x3efc82(_0xff4a91[_0x049d('0x10')][_0x049d('0x12')]);}logger[_0x049d('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x15b767,_0xff4a91[_0x049d('0x10')][_0x049d('0x12')]);return _0x26cd24(_0xff4a91['error'][_0x049d('0x12')]);}else{logger[_0x049d('0x13')](_0x049d('0xc'),_0x15b767,_0x049d('0xf'));_0x26cd24(_0xff4a91[_0x049d('0x14')][_0x049d('0x12')]);}})[_0x049d('0x15')](function(_0x30c6a0){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x15b767,_0x30c6a0);_0x3efc82(_0x30c6a0);});});}exports[_0x049d('0x16')]=function(_0x3f365a){var _0x1c0b20=this;return new Promise(function(_0x19293c,_0x1fd213){return db[_0x049d('0x17')][_0x049d('0x18')](_0x3f365a[_0x049d('0x19')],{'raw':_0x3f365a[_0x049d('0x1a')]?_0x3f365a['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4a515b){logger[_0x049d('0x13')]('CreateReportAgentPreview',_0x3f365a);logger[_0x049d('0xd')](_0x049d('0x16'),_0x3f365a,JSON[_0x049d('0x1b')](_0x4a515b));_0x19293c(_0x4a515b);})[_0x049d('0x15')](function(_0x6c167a){logger['error'](_0x049d('0x16'),_0x6c167a[_0x049d('0x12')],_0x3f365a);_0x1fd213(_0x1c0b20['error'](0x1f4,_0x6c167a[_0x049d('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js
index 27a6dfc..03a44bb 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 _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
+var _0xe72f=['/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound/channels','outboundChannels','/agents','put','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','chat','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','whatsapp','/sms/queues/:id','showWhatsappQueues','/agents/:id/notify','util','path','express','../../components/auth/service','./rpc.controller','get','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','voiceQueuesPreview'];(function(_0x46e1a3,_0x3f2d9a){var _0x47b61d=function(_0x5e014f){while(--_0x5e014f){_0x46e1a3['push'](_0x46e1a3['shift']());}};_0x47b61d(++_0x3f2d9a);}(_0xe72f,0x74));var _0xfe72=function(_0x4da350,_0x1f6f09){_0x4da350=_0x4da350-0x0;var _0x430e1e=_0xe72f[_0x4da350];return _0x430e1e;};'use strict';var multer=require('multer');var util=require(_0xfe72('0x0'));var path=require(_0xfe72('0x1'));var express=require(_0xfe72('0x2'));var router=express['Router']();var auth=require(_0xfe72('0x3'));var controller=require(_0xfe72('0x4'));router[_0xfe72('0x5')]('/voice/channels',auth[_0xfe72('0x6')](),controller['voiceChannels']);router['get'](_0xfe72('0x7'),auth[_0xfe72('0x6')](),controller['voiceChannelMixMonitor']);router[_0xfe72('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xfe72('0x6')](),controller[_0xfe72('0x8')]);router[_0xfe72('0x5')]('/voice/queues',auth[_0xfe72('0x6')](),controller[_0xfe72('0x9')]);router[_0xfe72('0x5')](_0xfe72('0xa'),auth[_0xfe72('0x6')](),controller[_0xfe72('0xb')]);router[_0xfe72('0x5')](_0xfe72('0xc'),auth[_0xfe72('0x6')](),controller[_0xfe72('0xd')]);router[_0xfe72('0x5')]('/mail/accounts',auth[_0xfe72('0x6')](),controller['mailAccounts']);router['get'](_0xfe72('0xe'),auth[_0xfe72('0x6')](),controller[_0xfe72('0xf')]);router['get']('/sms/queues',auth[_0xfe72('0x6')](),controller[_0xfe72('0x10')]);router[_0xfe72('0x5')](_0xfe72('0x11'),auth[_0xfe72('0x6')](),controller[_0xfe72('0x12')]);router['get']('/fax/queues',auth['isAuthenticated'](),controller['faxQueues']);router['get']('/voice/queues/preview/:id',auth[_0xfe72('0x6')](),controller[_0xfe72('0x13')]);router[_0xfe72('0x5')](_0xfe72('0x14'),auth[_0xfe72('0x6')](),controller[_0xfe72('0x15')]);router['get'](_0xfe72('0x16'),auth[_0xfe72('0x6')](),controller[_0xfe72('0x17')]);router[_0xfe72('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth[_0xfe72('0x6')](),controller[_0xfe72('0x18')]);router[_0xfe72('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xfe72('0x6')](),controller[_0xfe72('0x19')]);router[_0xfe72('0x5')](_0xfe72('0x1a'),auth[_0xfe72('0x6')](),controller[_0xfe72('0x1b')]);router[_0xfe72('0x5')]('/outbound',auth[_0xfe72('0x6')](),controller['outbound']);router[_0xfe72('0x5')](_0xfe72('0x1c'),auth[_0xfe72('0x6')](),controller[_0xfe72('0x1d')]);router[_0xfe72('0x5')](_0xfe72('0x1e'),auth[_0xfe72('0x6')](),controller['agents']);router[_0xfe72('0x1f')](_0xfe72('0x20'),auth[_0xfe72('0x6')](),controller[_0xfe72('0x21')]);router['get']('/telephones',auth[_0xfe72('0x6')](),controller[_0xfe72('0x22')]);router[_0xfe72('0x5')](_0xfe72('0x23'),auth['isAuthenticated'](),controller[_0xfe72('0x24')]);router[_0xfe72('0x5')](_0xfe72('0x25'),auth[_0xfe72('0x6')](),controller[_0xfe72('0x26')]);router['get'](_0xfe72('0x27'),auth[_0xfe72('0x6')](),controller[_0xfe72('0x28')]);router[_0xfe72('0x5')](_0xfe72('0x29'),auth[_0xfe72('0x6')](),controller['chatQueuesWaitingInteractions']);router[_0xfe72('0x5')](_0xfe72('0x2a'),auth[_0xfe72('0x6')](),controller[_0xfe72('0x2b')]);router[_0xfe72('0x5')]('/openchannel/queues/waitinginteractions',auth[_0xfe72('0x6')](),controller[_0xfe72('0x2c')]);router['get']('/sms/queues/waitinginteractions',auth[_0xfe72('0x6')](),controller[_0xfe72('0x2d')]);router['get'](_0xfe72('0x2e'),auth[_0xfe72('0x6')](),controller[_0xfe72('0x2f')]);router[_0xfe72('0x5')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xfe72('0x30')]);router['post'](_0xfe72('0x31'),auth[_0xfe72('0x6')](),controller[_0xfe72('0x32')](_0xfe72('0x33')));router[_0xfe72('0x5')](_0xfe72('0x34'),auth['isAuthenticated'](),controller[_0xfe72('0x35')]);router[_0xfe72('0x36')]('/chat/queues/:id/notify',auth[_0xfe72('0x6')](),controller[_0xfe72('0x32')](_0xfe72('0x37')));router[_0xfe72('0x5')]('/chat/queues/:id',auth[_0xfe72('0x6')](),controller['showChatQueues']);router['post'](_0xfe72('0x38'),auth['isAuthenticated'](),controller[_0xfe72('0x32')](_0xfe72('0x39')));router[_0xfe72('0x5')]('/fax/queues/:id',auth[_0xfe72('0x6')](),controller[_0xfe72('0x3a')]);router[_0xfe72('0x36')](_0xfe72('0x3b'),auth['isAuthenticated'](),controller[_0xfe72('0x32')](_0xfe72('0x3c')));router[_0xfe72('0x5')](_0xfe72('0x3d'),auth[_0xfe72('0x6')](),controller[_0xfe72('0x3e')]);router[_0xfe72('0x36')](_0xfe72('0x3f'),auth['isAuthenticated'](),controller[_0xfe72('0x32')]('sms'));router[_0xfe72('0x36')]('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0xfe72('0x40')));router[_0xfe72('0x5')](_0xfe72('0x41'),auth[_0xfe72('0x6')](),controller['showSmsQueues']);router[_0xfe72('0x5')]('/whatsapp/queues/:id',auth[_0xfe72('0x6')](),controller[_0xfe72('0x42')]);router[_0xfe72('0x36')](_0xfe72('0x43'),auth[_0xfe72('0x6')](),controller['agentNotify']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js
index d2cd15e..13c328f 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 _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
+var _0x1451=['hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','internal','AgentCapacity','capacity','telephones','Telephones','Trunks','campaigns','Campaigns','showChatQueues','ChatQueues','mailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','\x20Queue\x20not\x20found','findOne','messageId','Interaction','update','queue','MessageId','QueueId','create','Start','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Agent\x20not\x20found','\x20Message\x20not\x20found','InteractionId','TransferReport','agent','agentTransferTimeout','bluebird','moment','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','name','isNil','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','body','interaction','user'];(function(_0x3efed6,_0xccd8a8){var _0x1ad423=function(_0x22283b){while(--_0x22283b){_0x3efed6['push'](_0x3efed6['shift']());}};_0x1ad423(++_0xccd8a8);}(_0x1451,0x193));var _0x1145=function(_0x3a175b,_0x505d13){_0x3a175b=_0x3a175b-0x0;var _0x9b84fa=_0x1451[_0x3a175b];return _0x9b84fa;};'use strict';var BPromise=require(_0x1145('0x0'));var moment=require(_0x1145('0x1'));var _=require('lodash');var util=require(_0x1145('0x2'));var db=require(_0x1145('0x3'))['db'];var logger=require(_0x1145('0x4'))(_0x1145('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x1145('0x6')][_0x1145('0x7')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson['client'][_0x1145('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x506a5e,_0x130155,_0x4a14b7){return new BPromise(function(_0x140006,_0x1793d3){var _0x4ea0f0=_0x4a14b7?_0x4a14b7:amiClient;return _0x4ea0f0[_0x1145('0x8')](_0x506a5e,_0x130155)[_0x1145('0x9')](function(_0x4eb678){if(_0x4eb678[_0x1145('0xa')]){if(_0x4eb678[_0x1145('0xa')][_0x1145('0xb')]===0x1f4){return _0x1793d3(_0x4eb678[_0x1145('0xa')][_0x1145('0xc')]);}return _0x140006(_0x4eb678[_0x1145('0xa')][_0x1145('0xc')]);}else{_0x140006(_0x4eb678[_0x1145('0xd')]);}})[_0x1145('0xe')](function(_0x184702){_0x1793d3(_0x184702);});});}function respondWithResult(_0x2adc31,_0x48a972){_0x48a972=_0x48a972||0xc8;return function(_0x3fca1c){if(_0x3fca1c){return _0x2adc31[_0x1145('0xf')](_0x48a972)[_0x1145('0x10')](_0x3fca1c);}return _0x2adc31[_0x1145('0x11')](0x194);};}function handleError(_0x202e98,_0x2bd417){_0x2bd417=_0x2bd417||0x1f4;return function(_0x26ed9f){logger[_0x1145('0xa')](_0x26ed9f['stack']);if(_0x26ed9f['name']){delete _0x26ed9f[_0x1145('0x12')];}_0x202e98['status'](_0x2bd417)['send'](_0x26ed9f);};}function findById(_0x50984d){return function(_0x52c79c){if(!_[_0x1145('0x13')](_0x50984d)&&!_['isNil'](_0x52c79c)&&!_['isNil'](_0x52c79c['rows'])){return _[_0x1145('0x14')](_0x52c79c['rows'],function(_0x31c9ed){return _0x31c9ed['id']==_0x50984d;});}return null;};}exports[_0x1145('0x15')]=function(_0x5e4e93,_0x403e6b){return respondWithRpcPromise(_0x1145('0x16'),_0x5e4e93[_0x1145('0x17')])[_0x1145('0x9')](respondWithResult(_0x403e6b,null))['catch'](handleError(_0x403e6b,null));};exports[_0x1145('0x18')]=function(_0x1ce483,_0x33a757){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x1145('0x19')](_0x1ce483[_0x1145('0x17')],_0x1ce483['params']))[_0x1145('0x9')](respondWithResult(_0x33a757,null))[_0x1145('0xe')](handleError(_0x33a757,null));};exports[_0x1145('0x1a')]=function(_0x38ef17,_0x363855){return respondWithRpcPromise(_0x1145('0x1b'),_['merge'](_0x38ef17[_0x1145('0x17')],_0x38ef17[_0x1145('0x1c')]))[_0x1145('0x9')](respondWithResult(_0x363855,null))['catch'](handleError(_0x363855,null));};exports[_0x1145('0x1d')]=function(_0x3923e9,_0x3848e0){return respondWithRpcPromise(_0x1145('0x1e'),_0x3923e9[_0x1145('0x17')])[_0x1145('0x9')](respondWithResult(_0x3848e0,null))[_0x1145('0xe')](handleError(_0x3848e0,null));};exports['showVoiceQueues']=function(_0x4fa22,_0x4ae08d){return respondWithRpcPromise('VoiceQueues',_0x4fa22['query'])[_0x1145('0x9')](findById(_0x4fa22[_0x1145('0x1c')]['id']))['then'](respondWithResult(_0x4ae08d,null))['catch'](handleError(_0x4ae08d,null));};exports[_0x1145('0x1f')]=function(_0x372b88,_0x1e8659){return respondWithRpcPromise(_0x1145('0x20'),_[_0x1145('0x19')](_0x372b88[_0x1145('0x17')],_0x372b88[_0x1145('0x1c')]))[_0x1145('0x9')](respondWithResult(_0x1e8659,null))[_0x1145('0xe')](handleError(_0x1e8659,null));};exports['voiceQueuesChannels']=function(_0x5a8e96,_0x422632){return respondWithRpcPromise(_0x1145('0x21'),_0x5a8e96[_0x1145('0x17')])['then'](respondWithResult(_0x422632,null))[_0x1145('0xe')](handleError(_0x422632,null));};exports[_0x1145('0x22')]=function(_0x39e20f,_0x178e34){return respondWithRpcPromise(_0x1145('0x23'),_[_0x1145('0x19')](_0x39e20f['query'],_0x39e20f[_0x1145('0x1c')]))['then'](respondWithResult(_0x178e34,null))[_0x1145('0xe')](handleError(_0x178e34,null));};exports['voiceQueuesChannelHangup']=function(_0x176de0,_0xe6f35){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x1145('0x19')](_0x176de0[_0x1145('0x17')],_0x176de0[_0x1145('0x1c')]))[_0x1145('0x9')](respondWithResult(_0xe6f35,null))[_0x1145('0xe')](handleError(_0xe6f35,null));};exports['voiceQueuesChannelRedirect']=function(_0xfb3cb7,_0x540bb8){return respondWithRpcPromise(_0x1145('0x24'),_['merge'](_0xfb3cb7['query'],_0xfb3cb7['params']))['then'](respondWithResult(_0x540bb8,null))['catch'](handleError(_0x540bb8,null));};exports[_0x1145('0x25')]=function(_0x4c078a,_0x5e9e45){return respondWithRpcPromise('Outbound',_0x4c078a['query'])[_0x1145('0x9')](respondWithResult(_0x5e9e45,null))[_0x1145('0xe')](handleError(_0x5e9e45,null));};exports[_0x1145('0x26')]=function(_0x176831,_0x477467){return respondWithRpcPromise(_0x1145('0x27'),_0x176831['query'])['then'](respondWithResult(_0x477467,null))[_0x1145('0xe')](handleError(_0x477467,null));};exports['agents']=function(_0x4a5d9e,_0x266a69){var _0x121fc5;return respondWithRpcPromise('Agents',_0x4a5d9e['query'])[_0x1145('0x9')](function(_0xf2d1d2){_0x121fc5=_0xf2d1d2;return respondWithRpcPromise(_0x1145('0x28'),_0x4a5d9e[_0x1145('0x17')],routingClient);})['then'](function(_0x1e0813){return _[_0x1145('0x19')]({},_0x1e0813,_0x121fc5);})[_0x1145('0x9')](respondWithResult(_0x266a69,null))[_0x1145('0xe')](handleError(_0x266a69,null));};exports[_0x1145('0x29')]=function(_0x2ad3f9,_0x2fc17a){if(_0x2ad3f9[_0x1145('0x2a')]&&_0x2ad3f9['body'][_0x1145('0x2b')]&&_0x2ad3f9['user']&&_0x2ad3f9[_0x1145('0x2c')][_0x1145('0x12')]){for(var _0x55a988 in _0x2ad3f9[_0x1145('0x2a')]['interaction']){if(_0x2ad3f9[_0x1145('0x2a')]['interaction'][_0x1145('0x2d')](_0x55a988)){db[_0x1145('0x2e')][_0x1145('0x2f')]({'where':{'channel':_0x55a988,'membername':_0x2ad3f9[_0x1145('0x2c')][_0x1145('0x12')],'type':_0x1145('0x30'),'exitAt':null,'uniqueid':_0x2ad3f9[_0x1145('0x2a')][_0x1145('0x2b')][_0x55a988]&&_0x2ad3f9[_0x1145('0x2a')][_0x1145('0x2b')][_0x55a988][_0x1145('0x31')]?{'$notIn':_0x2ad3f9[_0x1145('0x2a')][_0x1145('0x2b')][_0x55a988]}:{'$ne':null}}})[_0x1145('0x9')](function(_0x569d65){var _0x3f2238=moment()[_0x1145('0x32')](_0x1145('0x33'));for(var _0x3a524e=0x0,_0xb95ae2=_0x569d65['length'];_0x3a524e<_0xb95ae2;_0x3a524e+=0x1){_0x569d65[_0x3a524e][_0x1145('0x34')]({'exitAt':_0x3f2238});}});for(var _0x29cc91=0x0;_0x29cc91<_0x2ad3f9['body'][_0x1145('0x2b')][_0x55a988][_0x1145('0x31')];_0x29cc91+=0x1){db[_0x1145('0x2e')][_0x1145('0x35')]({'where':{'channel':_0x55a988,'membername':_0x2ad3f9[_0x1145('0x2c')][_0x1145('0x12')],'type':_0x1145('0x30'),'uniqueid':_0x2ad3f9['body'][_0x1145('0x2b')][_0x55a988][_0x29cc91],'exitAt':null},'defaults':{'channel':_0x55a988,'membername':_0x2ad3f9['user']['name'],'interface':_[_0x1145('0x13')](_0x2ad3f9['user'][_0x1145('0x36')])?util[_0x1145('0x32')](_0x1145('0x37'),_0x2ad3f9[_0x1145('0x2c')][_0x1145('0x12')]):_0x2ad3f9['user'][_0x1145('0x36')],'type':_0x1145('0x30'),'enterAt':moment()[_0x1145('0x32')](_0x1145('0x33')),'role':'agent','internal':_0x2ad3f9[_0x1145('0x2c')][_0x1145('0x38')],'uniqueid':_0x2ad3f9['body']['interaction'][_0x55a988][_0x29cc91]}});}}}}return respondWithRpcPromise(_0x1145('0x39'),{'id':_0x2ad3f9[_0x1145('0x1c')]['id'],'capacity':_0x2ad3f9[_0x1145('0x2a')][_0x1145('0x3a')]},routingClient)[_0x1145('0x9')](respondWithResult(_0x2fc17a,null))[_0x1145('0xe')](handleError(_0x2fc17a,null));};exports[_0x1145('0x3b')]=function(_0x37b5d8,_0x227d79){return respondWithRpcPromise(_0x1145('0x3c'),_0x37b5d8['query'])[_0x1145('0x9')](respondWithResult(_0x227d79,null))[_0x1145('0xe')](handleError(_0x227d79,null));};exports['trunks']=function(_0x18c050,_0x1f5ae6){return respondWithRpcPromise(_0x1145('0x3d'),_0x18c050[_0x1145('0x17')])[_0x1145('0x9')](respondWithResult(_0x1f5ae6,null))[_0x1145('0xe')](handleError(_0x1f5ae6,null));};exports[_0x1145('0x3e')]=function(_0x5a466c,_0x14c9f1){return respondWithRpcPromise(_0x1145('0x3f'),_0x5a466c[_0x1145('0x17')])[_0x1145('0x9')](respondWithResult(_0x14c9f1,null))[_0x1145('0xe')](handleError(_0x14c9f1,null));};exports['chatQueues']=function(_0x2973b2,_0x5be9da){return respondWithRpcPromise('ChatQueues',_0x2973b2[_0x1145('0x17')],routingClient)['then'](respondWithResult(_0x5be9da,null))['catch'](handleError(_0x5be9da,null));};exports[_0x1145('0x40')]=function(_0x500061,_0x3874f9){return respondWithRpcPromise(_0x1145('0x41'),_0x500061[_0x1145('0x17')],routingClient)[_0x1145('0x9')](findById(_0x500061[_0x1145('0x1c')]['id']))[_0x1145('0x9')](respondWithResult(_0x3874f9,null))['catch'](handleError(_0x3874f9,null));};exports[_0x1145('0x42')]=function(_0x5aa26e,_0x409409){return respondWithRpcPromise('MailQueues',_0x5aa26e[_0x1145('0x17')],routingClient)[_0x1145('0x9')](respondWithResult(_0x409409,null))['catch'](handleError(_0x409409,null));};exports[_0x1145('0x43')]=function(_0x44d702,_0xafc416){return respondWithRpcPromise('MailQueues',_0x44d702[_0x1145('0x17')],routingClient)['then'](findById(_0x44d702[_0x1145('0x1c')]['id']))[_0x1145('0x9')](respondWithResult(_0xafc416,null))[_0x1145('0xe')](handleError(_0xafc416,null));};exports[_0x1145('0x44')]=function(_0x4cfcbe,_0x226d0a){return respondWithRpcPromise(_0x1145('0x45'),_0x4cfcbe[_0x1145('0x17')],mailClient)[_0x1145('0x9')](respondWithResult(_0x226d0a,null))[_0x1145('0xe')](handleError(_0x226d0a,null));};exports['openchannelQueues']=function(_0x9eb176,_0x778aa0){return respondWithRpcPromise(_0x1145('0x46'),_0x9eb176[_0x1145('0x17')],routingClient)[_0x1145('0x9')](respondWithResult(_0x778aa0,null))[_0x1145('0xe')](handleError(_0x778aa0,null));};exports[_0x1145('0x47')]=function(_0x397f27,_0x2e35ab){return respondWithRpcPromise(_0x1145('0x46'),_0x397f27[_0x1145('0x17')],routingClient)[_0x1145('0x9')](findById(_0x397f27[_0x1145('0x1c')]['id']))[_0x1145('0x9')](respondWithResult(_0x2e35ab,null))[_0x1145('0xe')](handleError(_0x2e35ab,null));};exports[_0x1145('0x48')]=function(_0x51640d,_0x3ee0cf){return respondWithRpcPromise(_0x1145('0x49'),_0x51640d[_0x1145('0x17')],routingClient)[_0x1145('0x9')](respondWithResult(_0x3ee0cf,null))[_0x1145('0xe')](handleError(_0x3ee0cf,null));};exports[_0x1145('0x4a')]=function(_0x289557,_0x48c430){return respondWithRpcPromise(_0x1145('0x49'),_0x289557['query'],routingClient)['then'](findById(_0x289557[_0x1145('0x1c')]['id']))['then'](respondWithResult(_0x48c430,null))['catch'](handleError(_0x48c430,null));};exports[_0x1145('0x4b')]=function(_0x5005d5,_0x567936){return respondWithRpcPromise(_0x1145('0x4c'),_0x5005d5['query'],routingClient)['then'](respondWithResult(_0x567936,null))[_0x1145('0xe')](handleError(_0x567936,null));};exports[_0x1145('0x4d')]=function(_0x509a6f,_0x515f7f){return respondWithRpcPromise(_0x1145('0x4c'),_0x509a6f['query'],routingClient)[_0x1145('0x9')](findById(_0x509a6f[_0x1145('0x1c')]['id']))['then'](respondWithResult(_0x515f7f,null))[_0x1145('0xe')](handleError(_0x515f7f,null));};exports[_0x1145('0x4e')]=function(_0x3b55d6,_0xdab3bc){return respondWithRpcPromise(_0x1145('0x4f'),_0x3b55d6[_0x1145('0x17')],routingClient)[_0x1145('0x9')](respondWithResult(_0xdab3bc,null))[_0x1145('0xe')](handleError(_0xdab3bc,null));};exports['showFaxQueues']=function(_0x21a85e,_0x8bc6ff){return respondWithRpcPromise(_0x1145('0x4f'),_0x21a85e[_0x1145('0x17')],routingClient)[_0x1145('0x9')](findById(_0x21a85e[_0x1145('0x1c')]['id']))[_0x1145('0x9')](respondWithResult(_0x8bc6ff,null))['catch'](handleError(_0x8bc6ff,null));};exports[_0x1145('0x50')]=function(_0xfd6ba1,_0x53b235){return respondWithRpcPromise(_0x1145('0x51'),_0xfd6ba1['query'])[_0x1145('0x9')](respondWithResult(_0x53b235,null))[_0x1145('0xe')](handleError(_0x53b235,null));};exports[_0x1145('0x52')]=function(_0x2c3017,_0x350f97){return respondWithRpcPromise(_0x1145('0x53'),_0x2c3017[_0x1145('0x17')],routingClient)['then'](respondWithResult(_0x350f97,null))['catch'](handleError(_0x350f97,null));};exports['mailQueuesWaitingInteractions']=function(_0x4288c2,_0x27d611){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x4288c2[_0x1145('0x17')],routingClient)['then'](respondWithResult(_0x27d611,null))[_0x1145('0xe')](handleError(_0x27d611,null));};exports[_0x1145('0x54')]=function(_0x4de99f,_0x1996ae){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4de99f['query'],routingClient)[_0x1145('0x9')](respondWithResult(_0x1996ae,null))[_0x1145('0xe')](handleError(_0x1996ae,null));};exports['smsQueuesWaitingInteractions']=function(_0x18d307,_0x200797){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x18d307[_0x1145('0x17')],routingClient)[_0x1145('0x9')](respondWithResult(_0x200797,null))['catch'](handleError(_0x200797,null));};exports[_0x1145('0x55')]=function(_0x5160e1,_0x4f35d9){return respondWithRpcPromise(_0x1145('0x56'),_0x5160e1[_0x1145('0x17')],routingClient)[_0x1145('0x9')](respondWithResult(_0x4f35d9,null))[_0x1145('0xe')](handleError(_0x4f35d9,null));};exports['faxQueuesWaitingInteractions']=function(_0x4c48fe,_0x230399){return respondWithRpcPromise(_0x1145('0x57'),_0x4c48fe['query'],routingClient)[_0x1145('0x9')](respondWithResult(_0x230399,null))['catch'](handleError(_0x230399,null));};exports['queueNotify']=function(_0x136b8e){return function(_0x4817a4,_0x42e3da){var _0x4eb54d,_0x3cb2dc;var _0x2f4fbe=_[_0x1145('0x58')](_0x136b8e);var _0x10c90a=_0x136b8e===_0x1145('0x59')?_0x1145('0x5a'):_0x1145('0x5b');return db[_0x2f4fbe+'Queue']['findOne']({'raw':!![],'where':{'id':_0x4817a4[_0x1145('0x1c')]['id']}})[_0x1145('0x9')](function(_0xf8d502){if(_[_0x1145('0x13')](_0xf8d502)){throw new Error(_0x2f4fbe+_0x1145('0x5c'));}_0x4eb54d=_0xf8d502;return db[_0x2f4fbe+'Message'][_0x1145('0x5d')]({'where':{'id':_0x4817a4['body'][_0x1145('0x5e')]},'include':[{'model':db[_0x2f4fbe+_0x1145('0x5f')],'as':_0x1145('0x5f')},{'model':db[_0x2f4fbe+_0x10c90a],'as':_0x1145('0x5b')}]});})['then'](function(_0x8f0a53){if(_[_0x1145('0x13')](_0x8f0a53)){throw new Error(_0x2f4fbe+'\x20Message\x20not\x20found');}_0x3cb2dc=_0x8f0a53;return _0x8f0a53[_0x1145('0x60')]({'read':0x0,'readAt':null,'UserId':null});})[_0x1145('0x9')](function(){var _0x1b58c3={'uniqueid':_0x136b8e+'.'+_0x3cb2dc['id']+'.'+_0x3cb2dc['Interaction']['id'],'FromUserId':_0x4817a4[_0x1145('0x2c')]['id'],'type':_0x1145('0x61')};_0x1b58c3[_0x2f4fbe+_0x1145('0x62')]=_0x3cb2dc['id'];_0x1b58c3[_0x2f4fbe+'InteractionId']=_0x3cb2dc[_0x1145('0x5f')]['id'];_0x1b58c3['From'+_0x2f4fbe+_0x10c90a+'Id']=_0x3cb2dc[_0x1145('0x5b')]['id'];_0x1b58c3['To'+_0x2f4fbe+_0x1145('0x63')]=_0x4eb54d['id'];return db[_0x2f4fbe+'TransferReport'][_0x1145('0x64')](_0x1b58c3);})[_0x1145('0x9')](function(){return respondWithRpcPromise(_0x1145('0x65'),{'channel':_0x136b8e,'interaction':_0x3cb2dc[_0x1145('0x5f')],'message':_0x3cb2dc,'account':_0x3cb2dc['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x1145('0x61'),'appdata':_0x4eb54d['name']+','+(_0x3cb2dc['Account']['queueTransferTimeout']||0x12c),'interval':_0x1145('0x66')}]},routingClient);})[_0x1145('0x9')](respondWithResult(_0x42e3da,null))[_0x1145('0xe')](handleError(_0x42e3da,null));};};exports[_0x1145('0x67')]=function(_0x127a6b,_0x154b78){var _0x5630d6,_0x5cfa04;if(_[_0x1145('0x13')](_0x127a6b[_0x1145('0x2a')][_0x1145('0x68')])){throw new Error(_0x1145('0x69'));}var _0x4a819f=_0x127a6b[_0x1145('0x2a')][_0x1145('0x68')];var _0x1ed932=_['capitalize'](_0x4a819f);var _0x480c3e=_0x4a819f===_0x1145('0x59')?_0x1145('0x5a'):_0x1145('0x5b');return db['User'][_0x1145('0x5d')]({'raw':!![],'where':{'id':_0x127a6b[_0x1145('0x1c')]['id'],'role':'agent'}})['then'](function(_0x2a4b3a){if(_[_0x1145('0x13')](_0x2a4b3a)){throw new Error(_0x1145('0x6a'));}_0x5630d6=_0x2a4b3a;return db[_0x1ed932+'Message'][_0x1145('0x5d')]({'where':{'id':_0x127a6b[_0x1145('0x2a')][_0x1145('0x5e')]},'include':[{'model':db[_0x1ed932+_0x1145('0x5f')],'as':'Interaction'},{'model':db[_0x1ed932+_0x480c3e],'as':_0x1145('0x5b')}]});})[_0x1145('0x9')](function(_0x19f89c){if(_[_0x1145('0x13')](_0x19f89c)){throw new Error(_0x1ed932+_0x1145('0x6b'));}_0x5cfa04=_0x19f89c;return _0x19f89c['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x1145('0x9')](function(){var _0x20bbfc={'uniqueid':_0x4a819f+'.'+_0x5cfa04['id']+'.'+_0x5cfa04[_0x1145('0x5f')]['id'],'FromUserId':_0x127a6b[_0x1145('0x2c')]['id'],'type':_0x1145('0x61'),'ToUserId':_0x5630d6['id']};_0x20bbfc[_0x1ed932+_0x1145('0x62')]=_0x5cfa04['id'];_0x20bbfc[_0x1ed932+_0x1145('0x6c')]=_0x5cfa04['Interaction']['id'];_0x20bbfc['From'+_0x1ed932+_0x480c3e+'Id']=_0x5cfa04['Account']['id'];return db[_0x1ed932+_0x1145('0x6d')][_0x1145('0x64')](_0x20bbfc);})[_0x1145('0x9')](function(){return respondWithRpcPromise(_0x1145('0x65'),{'channel':_0x4a819f,'interaction':_0x5cfa04[_0x1145('0x5f')],'message':_0x5cfa04,'account':_0x5cfa04[_0x1145('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x1145('0x6e'),'appdata':_0x5630d6[_0x1145('0x12')]+','+(_0x5cfa04[_0x1145('0x5b')][_0x1145('0x6f')]||0x12c),'interval':_0x1145('0x66')}]},routingClient);})[_0x1145('0x9')](respondWithResult(_0x154b78,null))[_0x1145('0xe')](handleError(_0x154b78,null));};
\ No newline at end of file
diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js
index 4b3961d..199a840 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 _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
+var _0x9cb3=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','show','/:id/run','run','post','create','/:id','destroy','exports'];(function(_0x4ded65,_0xc8d7c1){var _0x5864fb=function(_0x40df9d){while(--_0x40df9d){_0x4ded65['push'](_0x4ded65['shift']());}};_0x5864fb(++_0xc8d7c1);}(_0x9cb3,0xa0));var _0x39cb=function(_0x44774d,_0x27fe98){_0x44774d=_0x44774d-0x0;var _0x282b23=_0x9cb3[_0x44774d];return _0x282b23;};'use strict';var multer=require(_0x39cb('0x0'));var util=require(_0x39cb('0x1'));var path=require(_0x39cb('0x2'));var timeout=require(_0x39cb('0x3'));var express=require(_0x39cb('0x4'));var router=express['Router']();var auth=require(_0x39cb('0x5'));var interaction=require(_0x39cb('0x6'));var config=require(_0x39cb('0x7'));var controller=require(_0x39cb('0x8'));router['get']('/',auth[_0x39cb('0x9')](),controller[_0x39cb('0xa')]);router[_0x39cb('0xb')]('/:id',auth[_0x39cb('0x9')](),controller[_0x39cb('0xc')]);router[_0x39cb('0xb')](_0x39cb('0xd'),auth[_0x39cb('0x9')](),controller[_0x39cb('0xe')]);router[_0x39cb('0xf')]('/',auth['isAuthenticated'](),controller[_0x39cb('0x10')]);router['put'](_0x39cb('0x11'),auth[_0x39cb('0x9')](),controller['update']);router['delete']('/:id',auth[_0x39cb('0x9')](),controller[_0x39cb('0x12')]);module[_0x39cb('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js
index 3645529..9c43661 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 _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
+var _0xc6ac=['minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','days','hours'];(function(_0x576607,_0x4b1d47){var _0xb0e831=function(_0x21ce17){while(--_0x21ce17){_0x576607['push'](_0x576607['shift']());}};_0xb0e831(++_0x4b1d47);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x4768c9,_0x3cb482){_0x4768c9=_0x4768c9-0x0;var _0x1d7a35=_0xc6ac[_0x4768c9];return _0x1d7a35;};'use strict';var Sequelize=require(_0xcc6a('0x0'));module[_0xcc6a('0x1')]={'name':{'type':Sequelize[_0xcc6a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xcc6a('0x2')]},'active':{'type':Sequelize[_0xcc6a('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xcc6a('0x2')],'allowNull':![],'defaultValue':_0xcc6a('0x4')},'startAt':{'type':Sequelize[_0xcc6a('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xcc6a('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xcc6a('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xcc6a('0x7')](_0xcc6a('0x8'),_0xcc6a('0x9'),_0xcc6a('0xa'),'weeks',_0xcc6a('0xb'),_0xcc6a('0xc'),_0xcc6a('0xd')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xcc6a('0x7')](_0xcc6a('0xe'),_0xcc6a('0xf'),_0xcc6a('0x10')),'allowNull':![],'defaultValue':_0xcc6a('0xe')},'type':{'type':Sequelize['ENUM'](_0xcc6a('0x11'),_0xcc6a('0x12')),'allowNull':![],'defaultValue':_0xcc6a('0x11')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xcc6a('0x2')]},'cc':{'type':Sequelize[_0xcc6a('0x13')]},'bcc':{'type':Sequelize[_0xcc6a('0x13')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js
index 7a02cc9..a9a3a57 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 _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
+var _0x35e4=['UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','then','destroy','get','Scheduler'];(function(_0x56d58c,_0x1df6f7){var _0x2daa31=function(_0x36f316){while(--_0x36f316){_0x56d58c['push'](_0x56d58c['shift']());}};_0x2daa31(++_0x1df6f7);}(_0x35e4,0x80));var _0x435e=function(_0x3037c7,_0x420144){_0x3037c7=_0x3037c7-0x0;var _0x1e6cf3=_0x35e4[_0x3037c7];return _0x1e6cf3;};'use strict';var pdf=require(_0x435e('0x0'));var emlformat=require(_0x435e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x435e('0x2'));var jsonpatch=require(_0x435e('0x3'));var rp=require(_0x435e('0x4'));var moment=require(_0x435e('0x5'));var BPromise=require(_0x435e('0x6'));var Mustache=require(_0x435e('0x7'));var util=require('util');var path=require(_0x435e('0x8'));var sox=require(_0x435e('0x9'));var csv=require(_0x435e('0xa'));var ejs=require(_0x435e('0xb'));var fs=require('fs');var _=require(_0x435e('0xc'));var squel=require(_0x435e('0xd'));var crypto=require(_0x435e('0xe'));var jsforce=require(_0x435e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x435e('0xa'));var querystring=require(_0x435e('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x435e('0x11'));var qs=require(_0x435e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x435e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x435e('0x14'));var config=require('../../config/environment');var db=require(_0x435e('0x15'))['db'];function respondWithStatusCode(_0x5ee452,_0x56e817){_0x56e817=_0x56e817||0xcc;return function(_0x430c45){if(_0x430c45){return _0x5ee452[_0x435e('0x16')](_0x56e817);}return _0x5ee452[_0x435e('0x17')](_0x56e817)[_0x435e('0x18')]();};}function respondWithResult(_0x2a8834,_0x1ac690){_0x1ac690=_0x1ac690||0xc8;return function(_0x1f123a){if(_0x1f123a){return _0x2a8834[_0x435e('0x17')](_0x1ac690)[_0x435e('0x19')](_0x1f123a);}};}function respondWithFilteredResult(_0x48b62a,_0x3eb052){return function(_0x468e34){if(_0x468e34){var _0x6ed6f5=_0x468e34[_0x435e('0x1a')],_0x36b263=_0x3eb052[_0x435e('0x1b')],_0x417ca1=_0x3eb052[_0x435e('0x1b')]+_0x3eb052['limit'],_0x1891a2;if(_0x417ca1>=_0x6ed6f5){_0x417ca1=_0x6ed6f5;_0x1891a2=0xc8;}else{_0x1891a2=0xce;}_0x48b62a[_0x435e('0x17')](_0x1891a2);return _0x48b62a[_0x435e('0x1c')](_0x435e('0x1d'),_0x36b263+'-'+_0x417ca1+'/'+_0x6ed6f5)['json'](_0x468e34);}return null;};}function patchUpdates(_0x3d57f5){return function(_0x51afec){try{jsonpatch[_0x435e('0x1e')](_0x51afec,_0x3d57f5,!![]);}catch(_0x47f955){return BPromise['reject'](_0x47f955);}return _0x51afec[_0x435e('0x1f')]();};}function saveUpdates(_0x374278,_0x1261cd){return function(_0x4e407c){if(_0x4e407c){return _0x4e407c['update'](_0x374278)[_0x435e('0x20')](function(_0x3bee9a){return _0x3bee9a;});}return null;};}function removeEntity(_0x150633,_0x1f9d66){return function(_0x3e1e3c){if(_0x3e1e3c){return _0x3e1e3c[_0x435e('0x21')]()[_0x435e('0x20')](function(){var _0x52e7b6=_0x3e1e3c[_0x435e('0x22')]({'plain':!![]});var _0x19bf96=_0x435e('0x23');return db[_0x435e('0x24')]['destroy']({'where':{'type':_0x19bf96,'resourceId':_0x52e7b6['id']}})['then'](function(){return _0x3e1e3c;});})[_0x435e('0x20')](function(){_0x150633['status'](0xcc)[_0x435e('0x18')]();});}};}function handleEntityNotFound(_0xbd60f,_0x17005){return function(_0x2c818a){if(!_0x2c818a){_0xbd60f['sendStatus'](0x194);}return _0x2c818a;};}function handleError(_0x318514,_0x1b0061){_0x1b0061=_0x1b0061||0x1f4;return function(_0x36c4cb){logger[_0x435e('0x25')](_0x36c4cb[_0x435e('0x26')]);if(_0x36c4cb[_0x435e('0x27')]){delete _0x36c4cb['name'];}_0x318514[_0x435e('0x17')](_0x1b0061)[_0x435e('0x28')](_0x36c4cb);};}exports[_0x435e('0x29')]=function(_0x548c17,_0x45c5b8){var _0x5d5ffc={},_0x86d133={},_0x28e6eb={'count':0x0,'rows':[]};var _0x5ee617=_[_0x435e('0x2a')](db[_0x435e('0x2b')][_0x435e('0x2c')],function(_0x4c0f09){return{'name':_0x4c0f09[_0x435e('0x2d')],'type':_0x4c0f09[_0x435e('0x2e')]['key']};});_0x86d133[_0x435e('0x2f')]=_[_0x435e('0x2a')](_0x5ee617,_0x435e('0x27'));_0x86d133['query']=_['keys'](_0x548c17[_0x435e('0x30')]);_0x86d133['filters']=_[_0x435e('0x31')](_0x86d133[_0x435e('0x2f')],_0x86d133[_0x435e('0x30')]);_0x5d5ffc['attributes']=_[_0x435e('0x31')](_0x86d133[_0x435e('0x2f')],qs[_0x435e('0x32')](_0x548c17[_0x435e('0x30')][_0x435e('0x32')]));_0x5d5ffc['attributes']=_0x5d5ffc[_0x435e('0x33')][_0x435e('0x34')]?_0x5d5ffc[_0x435e('0x33')]:_0x86d133['model'];if(!_0x548c17[_0x435e('0x30')][_0x435e('0x35')](_0x435e('0x36'))){_0x5d5ffc[_0x435e('0x37')]=qs[_0x435e('0x37')](_0x548c17['query']['limit']);_0x5d5ffc[_0x435e('0x1b')]=qs[_0x435e('0x1b')](_0x548c17[_0x435e('0x30')][_0x435e('0x1b')]);}_0x5d5ffc[_0x435e('0x38')]=qs[_0x435e('0x39')](_0x548c17[_0x435e('0x30')][_0x435e('0x39')]);_0x5d5ffc[_0x435e('0x3a')]=qs['filters'](_['pick'](_0x548c17[_0x435e('0x30')],_0x86d133['filters']),_0x5ee617);if(_0x548c17[_0x435e('0x30')]['filter']){_0x5d5ffc[_0x435e('0x3a')]=_[_0x435e('0x3b')](_0x5d5ffc[_0x435e('0x3a')],{'$or':_[_0x435e('0x2a')](_0x5ee617,function(_0x30aec1){if(_0x30aec1[_0x435e('0x2e')]!==_0x435e('0x3c')){var _0xe68a98={};_0xe68a98[_0x30aec1[_0x435e('0x27')]]={'$like':'%'+_0x548c17['query']['filter']+'%'};return _0xe68a98;}})});}_0x5d5ffc=_['merge']({},_0x5d5ffc,_0x548c17['options']);var _0x1fe850={'where':_0x5d5ffc[_0x435e('0x3a')]};return db['Schedule']['count'](_0x1fe850)[_0x435e('0x20')](function(_0x1107fa){_0x28e6eb['count']=_0x1107fa;if(_0x548c17[_0x435e('0x30')][_0x435e('0x3d')]){_0x5d5ffc[_0x435e('0x3e')]=[{'all':!![]}];}return db[_0x435e('0x2b')][_0x435e('0x3f')](_0x5d5ffc);})[_0x435e('0x20')](function(_0x3826cd){_0x28e6eb[_0x435e('0x40')]=_0x3826cd;return _0x28e6eb;})['then'](respondWithFilteredResult(_0x45c5b8,_0x5d5ffc))[_0x435e('0x41')](handleError(_0x45c5b8,null));};exports['show']=function(_0x4704be,_0x4155b0){var _0x23ff4d={'raw':![],'where':{'id':_0x4704be[_0x435e('0x42')]['id']}},_0xffb959={};_0xffb959[_0x435e('0x2f')]=_[_0x435e('0x43')](db[_0x435e('0x2b')][_0x435e('0x2c')]);_0xffb959[_0x435e('0x30')]=_[_0x435e('0x43')](_0x4704be[_0x435e('0x30')]);_0xffb959['filters']=_[_0x435e('0x31')](_0xffb959[_0x435e('0x2f')],_0xffb959[_0x435e('0x30')]);_0x23ff4d[_0x435e('0x33')]=_[_0x435e('0x31')](_0xffb959[_0x435e('0x2f')],qs[_0x435e('0x32')](_0x4704be[_0x435e('0x30')][_0x435e('0x32')]));_0x23ff4d[_0x435e('0x33')]=_0x23ff4d[_0x435e('0x33')][_0x435e('0x34')]?_0x23ff4d[_0x435e('0x33')]:_0xffb959['model'];if(_0x4704be[_0x435e('0x30')][_0x435e('0x3d')]){_0x23ff4d[_0x435e('0x3e')]=[{'all':!![]}];}_0x23ff4d=_[_0x435e('0x3b')]({},_0x23ff4d,_0x4704be[_0x435e('0x44')]);return db[_0x435e('0x2b')]['find'](_0x23ff4d)['then'](handleEntityNotFound(_0x4155b0,null))[_0x435e('0x20')](respondWithResult(_0x4155b0,null))['catch'](handleError(_0x4155b0,null));};exports['create']=function(_0xf4e0d6,_0x28db31){return db[_0x435e('0x2b')][_0x435e('0x45')](_0xf4e0d6[_0x435e('0x46')],{})[_0x435e('0x20')](function(_0x7b8533){var _0x55b2e6=_0xf4e0d6[_0x435e('0x47')]['get']({'plain':!![]});if(!_0x55b2e6)throw new Error(_0x435e('0x48'));if(_0x55b2e6[_0x435e('0x49')]===_0x435e('0x47')){var _0x298adf=_0x7b8533[_0x435e('0x22')]({'plain':!![]});var _0x21f407=_0x435e('0x23');return db[_0x435e('0x4a')][_0x435e('0x4b')]({'where':{'name':_0x21f407,'userProfileId':_0x55b2e6[_0x435e('0x4c')]},'raw':!![]})[_0x435e('0x20')](function(_0x8c24b){if(_0x8c24b&&_0x8c24b[_0x435e('0x4d')]===0x0){return db[_0x435e('0x24')][_0x435e('0x45')]({'name':_0x298adf[_0x435e('0x27')],'resourceId':_0x298adf['id'],'type':_0x8c24b['name'],'sectionId':_0x8c24b['id']},{})[_0x435e('0x20')](function(){return _0x7b8533;});}else{return _0x7b8533;}})['catch'](function(_0x3cfe19){logger['error'](_0x435e('0x4e'),_0x3cfe19);throw _0x3cfe19;});}return _0x7b8533;})[_0x435e('0x20')](respondWithResult(_0x28db31,0xc9))['catch'](handleError(_0x28db31,null));};exports[_0x435e('0x4f')]=function(_0x1f0fb0,_0x43c9d2){if(_0x1f0fb0[_0x435e('0x46')]['id']){delete _0x1f0fb0[_0x435e('0x46')]['id'];}return db['Schedule'][_0x435e('0x4b')]({'where':{'id':_0x1f0fb0[_0x435e('0x42')]['id']}})['then'](handleEntityNotFound(_0x43c9d2,null))['then'](saveUpdates(_0x1f0fb0[_0x435e('0x46')],null))[_0x435e('0x20')](respondWithResult(_0x43c9d2,null))[_0x435e('0x41')](handleError(_0x43c9d2,null));};exports['destroy']=function(_0x4d64ec,_0x212cd1){return db[_0x435e('0x2b')][_0x435e('0x4b')]({'where':{'id':_0x4d64ec[_0x435e('0x42')]['id']}})['then'](handleEntityNotFound(_0x212cd1,null))[_0x435e('0x20')](removeEntity(_0x212cd1,null))[_0x435e('0x41')](handleError(_0x212cd1,null));};exports[_0x435e('0x50')]=function(_0x382e89,_0x90e5a9,_0x469156){var _0xd01b0=require(_0x435e('0x51'));return db[_0x435e('0x2b')]['find']({'where':{'id':_0x382e89[_0x435e('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x90e5a9,null))[_0x435e('0x20')](function(){_0xd01b0['run'](_0x382e89[_0x435e('0x42')]['id']);})['then'](respondWithStatusCode(_0x90e5a9,null))[_0x435e('0x41')](handleError(_0x90e5a9,null));};
\ No newline at end of file
diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js
index a6419c4..ca66388 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 _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
+var _0x3bbc=['./schedule.attributes','exports','Schedule','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x169f86,_0xadf81f){var _0x30cced=function(_0x84611b){while(--_0x84611b){_0x169f86['push'](_0x169f86['shift']());}};_0x30cced(++_0xadf81f);}(_0x3bbc,0xfd));var _0xc3bb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3bbc[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc3bb('0x0'))(_0xc3bb('0x1'));var moment=require('moment');var BPromise=require(_0xc3bb('0x2'));var rp=require(_0xc3bb('0x3'));var fs=require('fs');var path=require(_0xc3bb('0x4'));var rimraf=require(_0xc3bb('0x5'));var config=require(_0xc3bb('0x6'));var attributes=require(_0xc3bb('0x7'));module[_0xc3bb('0x8')]=function(_0x2feda1,_0x7d0f98){return _0x2feda1['define'](_0xc3bb('0x9'),attributes,{'tableName':'tools_schedules','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 c49efd5..b661587 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 _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
+var _0xdf8d=['lodash','moment','rpc','client','then','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x266e2c,_0x57b6ab){var _0xb19c8b=function(_0x4b9f49){while(--_0x4b9f49){_0x266e2c['push'](_0x266e2c['shift']());}};_0xb19c8b(++_0x57b6ab);}(_0xdf8d,0xb6));var _0xddf8=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0xdf8d[_0x243217];return _0x478029;};'use strict';var _=require(_0xddf8('0x0'));var util=require('util');var moment=require(_0xddf8('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('../../config/utils');var logger=require('../../config/logger')(_0xddf8('0x2'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xddf8('0x3')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15c4e7,_0xe61c3,_0x183718){return new BPromise(function(_0x324daf,_0x41941f){return client['request'](_0x15c4e7,_0x183718)[_0xddf8('0x4')](function(_0x5e10e7){logger[_0xddf8('0x5')](_0xddf8('0x6'),_0xe61c3,'request\x20sent');logger[_0xddf8('0x7')](_0xddf8('0x8'),_0xe61c3,_0xddf8('0x9'),JSON['stringify'](_0x5e10e7));if(_0x5e10e7['error']){if(_0x5e10e7[_0xddf8('0xa')][_0xddf8('0xb')]===0x1f4){logger['error'](_0xddf8('0x6'),_0xe61c3,_0x5e10e7[_0xddf8('0xa')][_0xddf8('0xc')]);return _0x41941f(_0x5e10e7[_0xddf8('0xa')][_0xddf8('0xc')]);}logger[_0xddf8('0xa')]('Schedule,\x20%s,\x20%s',_0xe61c3,_0x5e10e7[_0xddf8('0xa')][_0xddf8('0xc')]);return _0x324daf(_0x5e10e7[_0xddf8('0xa')][_0xddf8('0xc')]);}else{logger['info'](_0xddf8('0x6'),_0xe61c3,_0xddf8('0x9'));_0x324daf(_0x5e10e7[_0xddf8('0xd')]['message']);}})['catch'](function(_0x36d689){logger[_0xddf8('0xa')](_0xddf8('0x6'),_0xe61c3,_0x36d689);_0x41941f(_0x36d689);});});}
\ No newline at end of file
diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js
index 0c79345..58c0b34 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 _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
+var _0x567a=['describe','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x567a,0xdb));var _0xa567=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x567a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa567('0x0'));var timeout=require(_0xa567('0x1'));var express=require('express');var router=express[_0xa567('0x2')]();var auth=require(_0xa567('0x3'));var interaction=require(_0xa567('0x4'));var config=require(_0xa567('0x5'));var controller=require(_0xa567('0x6'));router[_0xa567('0x7')]('/',auth[_0xa567('0x8')](),controller[_0xa567('0x9')]);router[_0xa567('0x7')](_0xa567('0xa'),auth[_0xa567('0x8')](),controller[_0xa567('0xb')]);router['get'](_0xa567('0xc'),auth[_0xa567('0x8')](),controller[_0xa567('0xd')]);router[_0xa567('0x7')](_0xa567('0xe'),auth[_0xa567('0x8')](),controller[_0xa567('0xf')]);router[_0xa567('0x10')]('/',auth[_0xa567('0x8')](),controller[_0xa567('0x11')]);router[_0xa567('0x12')](_0xa567('0xc'),auth[_0xa567('0x8')](),controller[_0xa567('0x13')]);router[_0xa567('0x14')](_0xa567('0xc'),auth['isAuthenticated'](),controller[_0xa567('0x15')]);module[_0xa567('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js
index 3121c84..a5660a6 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 _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
+var _0xac9d=['format','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','replace','INTEGER','setDataValue','startedAt','subtract','closedAt','duration','MM-DD-YYYY\x20HH:mm','toString','DATE'];(function(_0x5a6961,_0x34740b){var _0x185646=function(_0x257e5e){while(--_0x257e5e){_0x5a6961['push'](_0x5a6961['shift']());}};_0x185646(++_0x34740b);}(_0xac9d,0x14d));var _0xdac9=function(_0x35468d,_0x2a7240){_0x35468d=_0x35468d-0x0;var _0x30da52=_0xac9d[_0x35468d];return _0x30da52;};'use strict';var Sequelize=require(_0xdac9('0x0'));var moment=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var config=require(_0xdac9('0x3'));module[_0xdac9('0x4')]={'format':{'type':Sequelize[_0xdac9('0x5')],'get':function(){return this[_0xdac9('0x6')](_0xdac9('0x7'))?path['extname'](this[_0xdac9('0x6')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xdac9('0x8')]},'channel':{'type':Sequelize[_0xdac9('0x8')]},'value':{'type':Sequelize[_0xdac9('0x8')],'set':function(_0x776b6c){var _0x1c78c5=_0x776b6c[_0xdac9('0x9')](/\\/g,'/');this['setDataValue'](_0xdac9('0x7'),_0x1c78c5);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdac9('0xa')],'set':function(_0x3a013b){this[_0xdac9('0xb')](_0xdac9('0xc'),moment()[_0xdac9('0xd')](_0x3a013b,'ms'));this[_0xdac9('0xb')](_0xdac9('0xe'),moment());this[_0xdac9('0xb')](_0xdac9('0xf'),_0x3a013b);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xdac9('0x6')](_0xdac9('0xc')))['format'](_0xdac9('0x10'))[_0xdac9('0x11')]();}},'closedAt':{'type':Sequelize[_0xdac9('0x12')],'get':function(){return moment(this['getDataValue'](_0xdac9('0xe')))[_0xdac9('0x13')](_0xdac9('0x10'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xdac9('0x6')](_0xdac9('0x14')))['format'](_0xdac9('0x10'))[_0xdac9('0x11')]();}},'updatedAt':{'type':Sequelize[_0xdac9('0x12')],'get':function(){return moment(this[_0xdac9('0x6')](_0xdac9('0x15')))[_0xdac9('0x13')](_0xdac9('0x10'))[_0xdac9('0x11')]();}}};
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js
index f22f6d8..ea32b49 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 _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
+var _0x5d17=['format','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','ScreenRecording','then','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','merge','find','create','body','createdAt','value','describe','download','../../components/encryptor','uniqueid','root','%s.cypher','existsSync','decryptFile','secrets','recording','join','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','map','fieldName','key','differenceBy'];(function(_0x34325b,_0x5e5afe){var _0x3da348=function(_0x3bf709){while(--_0x3bf709){_0x34325b['push'](_0x34325b['shift']());}};_0x3da348(++_0x5e5afe);}(_0x5d17,0x114));var _0x75d1=function(_0x3df517,_0x373364){_0x3df517=_0x3df517-0x0;var _0x25ddd5=_0x5d17[_0x3df517];return _0x25ddd5;};'use strict';var pdf=require(_0x75d1('0x0'));var emlformat=require(_0x75d1('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x75d1('0x2'));var rp=require(_0x75d1('0x3'));var moment=require(_0x75d1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x75d1('0x5'));var util=require(_0x75d1('0x6'));var path=require(_0x75d1('0x7'));var sox=require(_0x75d1('0x8'));var csv=require('to-csv');var ejs=require(_0x75d1('0x9'));var fs=require('fs');var _=require(_0x75d1('0xa'));var squel=require(_0x75d1('0xb'));var crypto=require(_0x75d1('0xc'));var jsforce=require(_0x75d1('0xd'));var deskjs=require(_0x75d1('0xe'));var toCsv=require(_0x75d1('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x75d1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75d1('0x11'));var hardwareService=require(_0x75d1('0x12'));var logger=require('../../config/logger')(_0x75d1('0x13'));var utils=require(_0x75d1('0x14'));var config=require(_0x75d1('0x15'));var db=require(_0x75d1('0x16'))['db'];function respondWithStatusCode(_0x6c1265,_0xd089cf){_0xd089cf=_0xd089cf||0xcc;return function(_0x49667a){if(_0x49667a){return _0x6c1265[_0x75d1('0x17')](_0xd089cf);}return _0x6c1265[_0x75d1('0x18')](_0xd089cf)[_0x75d1('0x19')]();};}function respondWithResult(_0x314a71,_0x49d723){_0x49d723=_0x49d723||0xc8;return function(_0x553697){if(_0x553697){return _0x314a71['status'](_0x49d723)[_0x75d1('0x1a')](_0x553697);}};}function respondWithFilteredResult(_0x12fa32,_0x2fd022){return function(_0x52e649){if(_0x52e649){var _0x1f9620=_0x52e649[_0x75d1('0x1b')],_0x3fff9b=_0x2fd022[_0x75d1('0x1c')],_0x1d30f3=_0x2fd022[_0x75d1('0x1c')]+_0x2fd022[_0x75d1('0x1d')],_0x269e82;if(_0x1d30f3>=_0x1f9620){_0x1d30f3=_0x1f9620;_0x269e82=0xc8;}else{_0x269e82=0xce;}_0x12fa32[_0x75d1('0x18')](_0x269e82);return _0x12fa32[_0x75d1('0x1e')](_0x75d1('0x1f'),_0x3fff9b+'-'+_0x1d30f3+'/'+_0x1f9620)['json'](_0x52e649);}return null;};}function patchUpdates(_0x493fff){return function(_0xc6b282){try{jsonpatch[_0x75d1('0x20')](_0xc6b282,_0x493fff,!![]);}catch(_0x56730d){return BPromise[_0x75d1('0x21')](_0x56730d);}return _0xc6b282[_0x75d1('0x22')]();};}function saveUpdates(_0x579731,_0xf6cc70){return function(_0xa42dbe){if(_0xa42dbe){return _0xa42dbe[_0x75d1('0x23')](_0x579731)['then'](function(_0x1d9d25){return _0x1d9d25;});}return null;};}function removeEntity(_0x522924,_0x501cc7){return function(_0x1cb58c){if(_0x1cb58c){return _0x1cb58c[_0x75d1('0x24')]()['then'](function(){_0x522924[_0x75d1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a85c0,_0xc256af){return function(_0x345cf5){if(!_0x345cf5){_0x3a85c0['sendStatus'](0x194);}return _0x345cf5;};}function handleError(_0x525588,_0x4590ac){_0x4590ac=_0x4590ac||0x1f4;return function(_0x45b18f){logger[_0x75d1('0x25')](_0x45b18f[_0x75d1('0x26')]);if(_0x45b18f['name']){delete _0x45b18f[_0x75d1('0x27')];}_0x525588[_0x75d1('0x18')](_0x4590ac)[_0x75d1('0x28')](_0x45b18f);};}exports['index']=function(_0x54095d,_0x57efd6){var _0x364dc9={},_0x30d9f3={},_0x45c182={'count':0x0,'rows':[]};var _0x468bf0=_[_0x75d1('0x29')](db['ScreenRecording']['rawAttributes'],function(_0x410e16){return{'name':_0x410e16[_0x75d1('0x2a')],'type':_0x410e16['type'][_0x75d1('0x2b')]};});_0x30d9f3['model']=_[_0x75d1('0x2c')](_[_0x75d1('0x29')](_0x468bf0,_0x75d1('0x27')),[_0x75d1('0x2d')]);_0x30d9f3[_0x75d1('0x2e')]=_['keys'](_0x54095d[_0x75d1('0x2e')]);_0x30d9f3[_0x75d1('0x2f')]=_[_0x75d1('0x30')](_0x30d9f3[_0x75d1('0x31')],_0x30d9f3['query']);_0x364dc9[_0x75d1('0x32')]=_['intersection'](_0x30d9f3[_0x75d1('0x31')],qs[_0x75d1('0x33')](_0x54095d['query'][_0x75d1('0x33')]));_0x364dc9[_0x75d1('0x32')]=_0x364dc9[_0x75d1('0x32')][_0x75d1('0x34')]?_0x364dc9[_0x75d1('0x32')]:_0x30d9f3['model'];if(!_0x54095d[_0x75d1('0x2e')][_0x75d1('0x35')](_0x75d1('0x36'))){_0x364dc9[_0x75d1('0x1d')]=qs['limit'](_0x54095d['query']['limit']);_0x364dc9[_0x75d1('0x1c')]=qs[_0x75d1('0x1c')](_0x54095d[_0x75d1('0x2e')][_0x75d1('0x1c')]);}_0x364dc9[_0x75d1('0x37')]=qs[_0x75d1('0x38')](_0x54095d[_0x75d1('0x2e')][_0x75d1('0x38')]);_0x364dc9[_0x75d1('0x39')]=qs['filters'](_[_0x75d1('0x3a')](_0x54095d[_0x75d1('0x2e')],_0x30d9f3[_0x75d1('0x2f')]),_0x468bf0);if(_0x54095d[_0x75d1('0x2e')][_0x75d1('0x3b')]){_0x364dc9['where']=_['merge'](_0x364dc9['where'],{'$or':_[_0x75d1('0x29')](_0x468bf0,function(_0x17c0f6){if(_0x17c0f6[_0x75d1('0x3c')]!==_0x75d1('0x3d')){var _0x460b92={};_0x460b92[_0x17c0f6[_0x75d1('0x27')]]={'$like':'%'+_0x54095d['query']['filter']+'%'};return _0x460b92;}})});}_0x364dc9=_['merge']({},_0x364dc9,_0x54095d[_0x75d1('0x3e')]);var _0x4cb084={'where':_0x364dc9['where']};return db[_0x75d1('0x3f')][_0x75d1('0x1b')](_0x4cb084)[_0x75d1('0x40')](function(_0x46854c){_0x45c182['count']=_0x46854c;if(_0x54095d[_0x75d1('0x2e')][_0x75d1('0x41')]){_0x364dc9[_0x75d1('0x42')]=[{'all':!![]}];}return db[_0x75d1('0x3f')][_0x75d1('0x43')](_0x364dc9);})[_0x75d1('0x40')](function(_0x33df05){_0x45c182[_0x75d1('0x44')]=_0x33df05;return _0x45c182;})[_0x75d1('0x40')](respondWithFilteredResult(_0x57efd6,_0x364dc9))[_0x75d1('0x45')](handleError(_0x57efd6,null));};exports[_0x75d1('0x46')]=function(_0x93922f,_0xe14be9){var _0x577e6e={'raw':![],'where':{'id':_0x93922f[_0x75d1('0x47')]['id']}},_0x16550e={};_0x16550e[_0x75d1('0x31')]=_[_0x75d1('0x48')](db[_0x75d1('0x3f')][_0x75d1('0x49')]);_0x16550e[_0x75d1('0x2e')]=_[_0x75d1('0x48')](_0x93922f['query']);_0x16550e['filters']=_[_0x75d1('0x30')](_0x16550e[_0x75d1('0x31')],_0x16550e[_0x75d1('0x2e')]);_0x577e6e[_0x75d1('0x32')]=_['intersection'](_0x16550e[_0x75d1('0x31')],qs[_0x75d1('0x33')](_0x93922f[_0x75d1('0x2e')][_0x75d1('0x33')]));_0x577e6e['attributes']=_0x577e6e[_0x75d1('0x32')][_0x75d1('0x34')]?_0x577e6e[_0x75d1('0x32')]:_0x16550e[_0x75d1('0x31')];if(_0x93922f['query'][_0x75d1('0x41')]){_0x577e6e['include']=[{'all':!![]}];}_0x577e6e=_[_0x75d1('0x4a')]({},_0x577e6e,_0x93922f[_0x75d1('0x3e')]);return db[_0x75d1('0x3f')][_0x75d1('0x4b')](_0x577e6e)[_0x75d1('0x40')](handleEntityNotFound(_0xe14be9,null))[_0x75d1('0x40')](respondWithResult(_0xe14be9,null))['catch'](handleError(_0xe14be9,null));};exports[_0x75d1('0x4c')]=function(_0x589ad8,_0x5b7663){return db[_0x75d1('0x3f')][_0x75d1('0x4c')](_0x589ad8[_0x75d1('0x4d')],{})[_0x75d1('0x40')](respondWithResult(_0x5b7663,0xc9))[_0x75d1('0x45')](handleError(_0x5b7663,null));};exports[_0x75d1('0x23')]=function(_0x18f96a,_0x5b7b7c){if(_0x18f96a['body']['id']){delete _0x18f96a[_0x75d1('0x4d')]['id'];}delete _0x18f96a[_0x75d1('0x4d')]['duration'];delete _0x18f96a[_0x75d1('0x4d')][_0x75d1('0x4e')];delete _0x18f96a[_0x75d1('0x4d')]['closedAt'];delete _0x18f96a[_0x75d1('0x4d')][_0x75d1('0x4f')];return db[_0x75d1('0x3f')][_0x75d1('0x4b')]({'where':{'id':_0x18f96a[_0x75d1('0x47')]['id']}})[_0x75d1('0x40')](handleEntityNotFound(_0x5b7b7c,null))[_0x75d1('0x40')](saveUpdates(_0x18f96a['body'],null))[_0x75d1('0x40')](respondWithResult(_0x5b7b7c,null))[_0x75d1('0x45')](handleError(_0x5b7b7c,null));};exports[_0x75d1('0x50')]=function(_0x395e0b,_0x43bd9d){return db[_0x75d1('0x3f')][_0x75d1('0x50')]()['then'](respondWithResult(_0x43bd9d,null))[_0x75d1('0x45')](handleError(_0x43bd9d,null));};exports[_0x75d1('0x51')]=function(_0x42d587,_0x575319,_0x350cf4){var _0x30d6bd=require(_0x75d1('0x52'));var _0x382760=![];var _0x281123={};if(_0x42d587[_0x75d1('0x2e')]['type']&&_0x42d587[_0x75d1('0x2e')][_0x75d1('0x3c')]===_0x75d1('0x53')){_0x281123[_0x75d1('0x53')]=_0x42d587[_0x75d1('0x47')]['id'];}else{_0x281123['id']=_0x42d587[_0x75d1('0x47')]['id'];}return db[_0x75d1('0x3f')][_0x75d1('0x4b')]({'where':_0x281123,'attributes':['id',_0x75d1('0x4f')],'raw':!![]})[_0x75d1('0x40')](handleEntityNotFound(_0x575319,null))[_0x75d1('0x40')](function(_0x13050e){if(_0x13050e){var _0x5ceb42=path['join'](config[_0x75d1('0x54')],'server/files/screen_recordings',_0x13050e[_0x75d1('0x4f')]);var _0x1e149b=util['format'](_0x75d1('0x55'),_0x5ceb42);if(fs[_0x75d1('0x56')](_0x1e149b)){_0x382760=!![];return _0x30d6bd[_0x75d1('0x57')](_0x1e149b,_0x5ceb42,config[_0x75d1('0x58')][_0x75d1('0x59')])[_0x75d1('0x40')](function(){return _0x13050e;});}return _0x13050e;}})[_0x75d1('0x40')](function(_0x5048ef){if(_0x5048ef){var _0x3c5da6=path[_0x75d1('0x5a')](config[_0x75d1('0x54')],_0x75d1('0x5b'),_0x5048ef[_0x75d1('0x4f')]);if(!fs[_0x75d1('0x56')](_0x3c5da6)){throw new db[(_0x75d1('0x5c'))][(_0x75d1('0x5d'))](_0x75d1('0x5e'));}if(_0x5048ef[_0x75d1('0x5f')]){return _0x575319['download'](_0x3c5da6,_0x5048ef['filename']+path[_0x75d1('0x60')](_0x3c5da6),function(){if(_0x382760){fs[_0x75d1('0x61')](_0x3c5da6);}});}else{return _0x575319[_0x75d1('0x51')](_0x3c5da6,function(_0x49d9ca){if(_0x382760){fs[_0x75d1('0x61')](_0x3c5da6);}});}}})['catch'](function(_0x2005d1){if(_0x2005d1[_0x75d1('0x62')]===_0x75d1('0x5e')){_0x575319[_0x75d1('0x18')](0x194)['send'](_0x75d1('0x63'));}else{return handleError(_0x575319,null);}});};exports['destroy']=function(_0x4b1943,_0x18d8f3){return db[_0x75d1('0x3f')][_0x75d1('0x4b')]({'where':{'id':_0x4b1943[_0x75d1('0x47')]['id']}})['then'](function(_0x4c45ff){if(!_0x4c45ff)throw new ReferenceError(_0x75d1('0x64'));return _0x4c45ff;})[_0x75d1('0x40')](function(_0x4ec3c5){var _0x1a52fa=path[_0x75d1('0x5a')](config['root'],_0x75d1('0x5b'),_0x4ec3c5[_0x75d1('0x4f')]);logger[_0x75d1('0x65')](_0x75d1('0x66'),_0x1a52fa);if(!_[_0x75d1('0x67')](_0x4ec3c5[_0x75d1('0x4f')])&&fs[_0x75d1('0x56')](_0x1a52fa)){logger[_0x75d1('0x65')](_0x75d1('0x68')+_0x1a52fa+_0x75d1('0x69'));fs[_0x75d1('0x6a')](_0x1a52fa);}_0x1a52fa=_0x1a52fa+'.cypher';if(!_[_0x75d1('0x67')](_0x4ec3c5[_0x75d1('0x4f')])&&fs[_0x75d1('0x56')](_0x1a52fa)){logger[_0x75d1('0x65')](_0x75d1('0x68')+_0x1a52fa+_0x75d1('0x69'));fs[_0x75d1('0x6a')](_0x1a52fa);}return _0x4ec3c5;})['then'](function(_0x5f4395){if(!_0x5f4395)throw new InternalError();return _0x5f4395[_0x75d1('0x24')]();})[_0x75d1('0x40')](function(){_0x18d8f3[_0x75d1('0x18')](0xcc)[_0x75d1('0x19')]();})[_0x75d1('0x45')](handleError(_0x18d8f3,null));};
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js
index ce79c2f..80093d8 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 _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
+var _0x4d5a=['screen_recordings','interactionid','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./screenRecording.attributes','define','ScreenRecording'];(function(_0x2da8c4,_0x27adda){var _0x3ee006=function(_0x4b9d7c){while(--_0x4b9d7c){_0x2da8c4['push'](_0x2da8c4['shift']());}};_0x3ee006(++_0x27adda);}(_0x4d5a,0x15e));var _0xa4d5=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x4d5a[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require(_0xa4d5('0x0'));var logger=require(_0xa4d5('0x1'))(_0xa4d5('0x2'));var moment=require('moment');var BPromise=require(_0xa4d5('0x3'));var rp=require(_0xa4d5('0x4'));var fs=require('fs');var path=require(_0xa4d5('0x5'));var rimraf=require(_0xa4d5('0x6'));var config=require('../../config/environment');var attributes=require(_0xa4d5('0x7'));module['exports']=function(_0x5e25a5,_0x32d194){return _0x5e25a5[_0xa4d5('0x8')](_0xa4d5('0x9'),attributes,{'tableName':_0xa4d5('0xa'),'paranoid':![],'indexes':[{'name':_0xa4d5('0xb'),'fields':[_0xa4d5('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js
index 31473d2..6ebb904 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(_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
+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(_0x1a5003,_0x2fdf49){var _0xc6aacb=function(_0x3f2c10){while(--_0x3f2c10){_0x1a5003['push'](_0x1a5003['shift']());}};_0xc6aacb(++_0x2fdf49);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 221e74d..4b8165d 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 _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
+var _0xfdb1=['/:id','show','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','extname','originalname','post','single','file','addLogo','logologin','/:id/logo_login','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x56a871,_0x18b7fe){var _0x124954=function(_0x39b7a1){while(--_0x39b7a1){_0x56a871['push'](_0x56a871['shift']());}};_0x124954(++_0x18b7fe);}(_0xfdb1,0x74));var _0x1fdb=function(_0x3e3a55,_0x1c1eba){_0x3e3a55=_0x3e3a55-0x0;var _0x2f25d3=_0xfdb1[_0x3e3a55];return _0x2f25d3;};'use strict';var multer=require(_0x1fdb('0x0'));var util=require(_0x1fdb('0x1'));var path=require('path');var timeout=require(_0x1fdb('0x2'));var express=require(_0x1fdb('0x3'));var router=express[_0x1fdb('0x4')]();var auth=require(_0x1fdb('0x5'));var interaction=require(_0x1fdb('0x6'));var config=require('../../config/environment');var controller=require('./setting.controller');router[_0x1fdb('0x7')]('/',auth[_0x1fdb('0x8')](),controller[_0x1fdb('0x9')]);router[_0x1fdb('0x7')](_0x1fdb('0xa'),controller[_0x1fdb('0xb')]);router[_0x1fdb('0x7')](_0x1fdb('0xc'),controller[_0x1fdb('0xd')]);router[_0x1fdb('0x7')]('/:id/logo_login',controller[_0x1fdb('0xe')]);router[_0x1fdb('0x7')](_0x1fdb('0xf'),controller['gdpr']);router['get'](_0x1fdb('0x10'),controller[_0x1fdb('0x11')]);router[_0x1fdb('0x7')](_0x1fdb('0x12'),controller[_0x1fdb('0x13')]);var upload=multer({'storage':multer[_0x1fdb('0x14')]({'destination':function(_0x2b0795,_0xf432b7,_0x359fb6){_0x359fb6(null,path[_0x1fdb('0x15')](config[_0x1fdb('0x16')],_0x1fdb('0x17')));},'filename':function(_0x425913,_0x157162,_0x42f491){_0x42f491(null,util[_0x1fdb('0x18')](_0x1fdb('0x19'),'logo',path[_0x1fdb('0x1a')](_0x157162[_0x1fdb('0x1b')])));}})});router[_0x1fdb('0x1c')](_0x1fdb('0xc'),upload[_0x1fdb('0x1d')](_0x1fdb('0x1e')),controller[_0x1fdb('0x1f')]);var upload=multer({'storage':multer[_0x1fdb('0x14')]({'destination':function(_0x155355,_0x4b709b,_0x2917e1){_0x2917e1(null,path[_0x1fdb('0x15')](config[_0x1fdb('0x16')],_0x1fdb('0x17')));},'filename':function(_0x10c996,_0x1d6e5a,_0x792de8){_0x792de8(null,util[_0x1fdb('0x18')]('%s%s',_0x1fdb('0x20'),path[_0x1fdb('0x1a')](_0x1d6e5a['originalname'])));}})});router[_0x1fdb('0x1c')](_0x1fdb('0x21'),upload['single'](_0x1fdb('0x1e')),controller[_0x1fdb('0x22')]);var upload=multer({'storage':multer[_0x1fdb('0x14')]({'destination':function(_0x2d18b2,_0x227407,_0x4d1000){_0x4d1000(null,path[_0x1fdb('0x15')](config[_0x1fdb('0x16')],'server/files/images/logos/'));},'filename':function(_0x531309,_0x4a0dfd,_0x37553){_0x37553(null,util[_0x1fdb('0x18')](_0x1fdb('0x19'),_0x1fdb('0x23'),path[_0x1fdb('0x1a')](_0x4a0dfd[_0x1fdb('0x1b')])));}})});router['post'](_0x1fdb('0x10'),upload[_0x1fdb('0x1d')]('file'),controller[_0x1fdb('0x24')]);var upload=multer({'storage':multer[_0x1fdb('0x14')]({'destination':function(_0x4682ec,_0x47822d,_0x225471){_0x225471(null,path['join'](config[_0x1fdb('0x16')],'server/files/images/logos/'));},'filename':function(_0x6dce0c,_0x12f055,_0x5d6f3c){_0x5d6f3c(null,util['format'](_0x1fdb('0x19'),_0x1fdb('0x25'),path[_0x1fdb('0x1a')](_0x12f055[_0x1fdb('0x1b')])));}})});router['post']('/:id/favicon',upload[_0x1fdb('0x1d')](_0x1fdb('0x1e')),controller[_0x1fdb('0x26')]);router[_0x1fdb('0x27')](_0x1fdb('0xa'),auth[_0x1fdb('0x8')](),controller[_0x1fdb('0x28')]);module[_0x1fdb('0x29')]=router;
\ No newline at end of file
diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js
index 2ec5ac0..979684b 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 _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
+var _0x5c94=['/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','sequelize','INTEGER','min_internal','min_mailbox','STRING'];(function(_0x4d003f,_0x593984){var _0x26f727=function(_0x39d901){while(--_0x39d901){_0x4d003f['push'](_0x4d003f['shift']());}};_0x26f727(++_0x593984);}(_0x5c94,0x9b));var _0x45c9=function(_0x14e6b9,_0x4fabec){_0x14e6b9=_0x14e6b9-0x0;var _0x390eb6=_0x5c94[_0x14e6b9];return _0x390eb6;};'use strict';var Sequelize=require(_0x45c9('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0x45c9('0x1')](0xb),'unique':_0x45c9('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x45c9('0x1')](0xb),'unique':_0x45c9('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x45c9('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x45c9('0x4')],'defaultValue':_0x45c9('0x5')},'logo':{'type':Sequelize[_0x45c9('0x4')]},'defaultLogo':{'type':Sequelize[_0x45c9('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x45c9('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x45c9('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x45c9('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x45c9('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x45c9('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x45c9('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x45c9('0x4')]},'turnaddr':{'type':Sequelize[_0x45c9('0x4')]},'turnusername':{'type':Sequelize[_0x45c9('0x4')]},'turnpassword':{'type':Sequelize[_0x45c9('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x45c9('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x45c9('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x45c9('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x45c9('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x45c9('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x45c9('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x45c9('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x45c9('0x4')],'defaultValue':_0x45c9('0x7')},'chatTimeout':{'type':Sequelize[_0x45c9('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x45c9('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x45c9('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x45c9('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x45c9('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x45c9('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x45c9('0x4')]},'defaultFavicon':{'type':Sequelize[_0x45c9('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x45c9('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x45c9('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x45c9('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x45c9('0x1')]},'transcribeRegion':{'type':Sequelize[_0x45c9('0x4')]},'sentiment':{'type':Sequelize[_0x45c9('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x45c9('0x1')]},'sentimentRegion':{'type':Sequelize[_0x45c9('0x4')]},'language':{'type':Sequelize[_0x45c9('0x4')]},'bucket':{'type':Sequelize[_0x45c9('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x45c9('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 8e08086..c80b465 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 _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
+var _0xd0de=['squel','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','jayson/promise','client','test','Sequelize','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','stack','name','index','map','Setting','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','find','body','addLogo','file','logo','filename','getLogo','getLicense','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','upperFirst','default_logo.svg','existsSync','ValidationError','\x20not\x20found','../../config/license/util','server/files/images/logos','default_loginLogo.svg','default','custom','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x2cc6c2,_0x5407d6){var _0x4c0adf=function(_0x4dc9b1){while(--_0x4dc9b1){_0x2cc6c2['push'](_0x2cc6c2['shift']());}};_0x4c0adf(++_0x5407d6);}(_0xd0de,0xe8));var _0xed0d=function(_0x3b231a,_0x53a00d){_0x3b231a=_0x3b231a-0x0;var _0x18d67a=_0xd0de[_0x3b231a];return _0x18d67a;};'use strict';var pdf=require(_0xed0d('0x0'));var emlformat=require(_0xed0d('0x1'));var rimraf=require(_0xed0d('0x2'));var zipdir=require(_0xed0d('0x3'));var jsonpatch=require(_0xed0d('0x4'));var rp=require('request-promise');var moment=require(_0xed0d('0x5'));var BPromise=require(_0xed0d('0x6'));var Mustache=require(_0xed0d('0x7'));var util=require(_0xed0d('0x8'));var path=require(_0xed0d('0x9'));var sox=require('sox');var csv=require(_0xed0d('0xa'));var ejs=require(_0xed0d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xed0d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed0d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xed0d('0xe'));var Papa=require(_0xed0d('0xf'));var Redis=require(_0xed0d('0x10'));var authService=require(_0xed0d('0x11'));var qs=require(_0xed0d('0x12'));var as=require(_0xed0d('0x13'));var hardwareService=require(_0xed0d('0x14'));var logger=require(_0xed0d('0x15'))(_0xed0d('0x16'));var utils=require(_0xed0d('0x17'));var config=require(_0xed0d('0x18'));var db=require(_0xed0d('0x19'))['db'];var jayson=require(_0xed0d('0x1a'));var client=jayson[_0xed0d('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x535aa1,_0x22ca1d,_0x9195fb){if(_0x9195fb){var _0x2915f4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2915f4[_0xed0d('0x1c')](_0x22ca1d)){return _0x535aa1;}else{throw new db[(_0xed0d('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 _0x535aa1;}}function respondWithRpcPromise(_0x685611,_0x2b1358,_0x5d53f0,_0x4bf283){return new BPromise(function(_0x4504f4,_0x1f2d13){var _0x5c9556=_0x4bf283||client;return _0x5c9556['request'](_0x685611,_0x5d53f0)[_0xed0d('0x1e')](function(_0x366228){logger[_0xed0d('0x1f')](_0xed0d('0x20'),_0x2b1358,_0xed0d('0x21'));logger[_0xed0d('0x22')](_0xed0d('0x23'),_0x2b1358,'request\x20sent',JSON[_0xed0d('0x24')](_0x366228));if(_0x366228[_0xed0d('0x25')]){if(_0x366228[_0xed0d('0x25')][_0xed0d('0x26')]===0x1f4){logger[_0xed0d('0x25')](_0xed0d('0x20'),_0x2b1358,_0x366228[_0xed0d('0x25')][_0xed0d('0x27')]);return _0x1f2d13(_0x366228[_0xed0d('0x25')]['message']);}logger[_0xed0d('0x25')](_0xed0d('0x20'),_0x2b1358,_0x366228[_0xed0d('0x25')]['message']);return _0x4504f4(_0x366228[_0xed0d('0x25')][_0xed0d('0x27')]);}else{logger[_0xed0d('0x1f')]('Setting,\x20%s,\x20%s',_0x2b1358,_0xed0d('0x21'));_0x4504f4(_0x366228[_0xed0d('0x28')][_0xed0d('0x27')]);}})[_0xed0d('0x29')](function(_0x95f1c4){logger['error'](_0xed0d('0x20'),_0x2b1358,_0x95f1c4);_0x1f2d13(_0x95f1c4);});});}function respondWithStatusCode(_0x3122a6,_0x683fd){_0x683fd=_0x683fd||0xcc;return function(_0x148b22){if(_0x148b22){return _0x3122a6['sendStatus'](_0x683fd);}return _0x3122a6[_0xed0d('0x2a')](_0x683fd)[_0xed0d('0x2b')]();};}function respondWithResult(_0x2683fa,_0x28551d){_0x28551d=_0x28551d||0xc8;return function(_0x1a6575){if(_0x1a6575){return _0x2683fa[_0xed0d('0x2a')](_0x28551d)['json'](_0x1a6575);}};}function respondWithFilteredResult(_0x490662,_0x560cf0){return function(_0xa63d27){if(_0xa63d27){var _0x20cdd4=_0xa63d27[_0xed0d('0x2c')],_0x1fabeb=_0x560cf0[_0xed0d('0x2d')],_0x498ea6=_0x560cf0[_0xed0d('0x2d')]+_0x560cf0['limit'],_0x2c1aae;if(_0x498ea6>=_0x20cdd4){_0x498ea6=_0x20cdd4;_0x2c1aae=0xc8;}else{_0x2c1aae=0xce;}_0x490662[_0xed0d('0x2a')](_0x2c1aae);return _0x490662[_0xed0d('0x2e')](_0xed0d('0x2f'),_0x1fabeb+'-'+_0x498ea6+'/'+_0x20cdd4)[_0xed0d('0x30')](_0xa63d27);}return null;};}function patchUpdates(_0x2f477b){return function(_0x425303){try{jsonpatch[_0xed0d('0x31')](_0x425303,_0x2f477b,!![]);}catch(_0x18b975){return BPromise[_0xed0d('0x32')](_0x18b975);}return _0x425303[_0xed0d('0x33')]();};}function saveUpdates(_0x48784b,_0x3512e0){return function(_0x16f55d){if(_0x16f55d){return _0x16f55d[_0xed0d('0x34')](_0x48784b)['then'](function(_0x399650){return _0x399650;});}return null;};}function removeEntity(_0x41b01d,_0xdb49d1){return function(_0x4f081d){if(_0x4f081d){return _0x4f081d[_0xed0d('0x35')]()[_0xed0d('0x1e')](function(){_0x41b01d['status'](0xcc)[_0xed0d('0x2b')]();});}};}function handleEntityNotFound(_0x361a9b,_0x5ba105){return function(_0x3becdf){if(!_0x3becdf){_0x361a9b[_0xed0d('0x36')](0x194);}return _0x3becdf;};}function handleError(_0x3b766b,_0x4455bc){_0x4455bc=_0x4455bc||0x1f4;return function(_0x5f53fe){logger['error'](_0x5f53fe[_0xed0d('0x37')]);if(_0x5f53fe[_0xed0d('0x38')]){delete _0x5f53fe[_0xed0d('0x38')];}_0x3b766b['status'](_0x4455bc)['send'](_0x5f53fe);};}exports[_0xed0d('0x39')]=function(_0x2a0932,_0x226ec7){var _0x195a46={},_0x381980={},_0x6fe4ca={'count':0x0,'rows':[]};var _0x24c221=_[_0xed0d('0x3a')](db[_0xed0d('0x3b')][_0xed0d('0x3c')],function(_0x4b5a92){return{'name':_0x4b5a92['fieldName'],'type':_0x4b5a92[_0xed0d('0x3d')][_0xed0d('0x3e')]};});_0x381980[_0xed0d('0x3f')]=_['map'](_0x24c221,_0xed0d('0x38'));_0x381980[_0xed0d('0x40')]=_[_0xed0d('0x41')](_0x2a0932[_0xed0d('0x40')]);_0x381980['filters']=_[_0xed0d('0x42')](_0x381980['model'],_0x381980[_0xed0d('0x40')]);_0x195a46[_0xed0d('0x43')]=_[_0xed0d('0x42')](_0x381980[_0xed0d('0x3f')],qs['fields'](_0x2a0932[_0xed0d('0x40')][_0xed0d('0x44')]));_0x195a46[_0xed0d('0x43')]=_0x195a46[_0xed0d('0x43')][_0xed0d('0x45')]?_0x195a46['attributes']:_0x381980[_0xed0d('0x3f')];if(!_0x2a0932[_0xed0d('0x40')][_0xed0d('0x46')](_0xed0d('0x47'))){_0x195a46[_0xed0d('0x48')]=qs[_0xed0d('0x48')](_0x2a0932['query'][_0xed0d('0x48')]);_0x195a46[_0xed0d('0x2d')]=qs[_0xed0d('0x2d')](_0x2a0932[_0xed0d('0x40')][_0xed0d('0x2d')]);}_0x195a46[_0xed0d('0x49')]=qs[_0xed0d('0x4a')](_0x2a0932[_0xed0d('0x40')][_0xed0d('0x4a')]);_0x195a46[_0xed0d('0x4b')]=qs[_0xed0d('0x4c')](_[_0xed0d('0x4d')](_0x2a0932[_0xed0d('0x40')],_0x381980['filters']),_0x24c221);if(_0x2a0932[_0xed0d('0x40')][_0xed0d('0x4e')]){_0x195a46[_0xed0d('0x4b')]=_['merge'](_0x195a46[_0xed0d('0x4b')],{'$or':_[_0xed0d('0x3a')](_0x24c221,function(_0x57efc2){if(_0x57efc2['type']!==_0xed0d('0x4f')){var _0xc2609e={};_0xc2609e[_0x57efc2[_0xed0d('0x38')]]={'$like':'%'+_0x2a0932[_0xed0d('0x40')]['filter']+'%'};return _0xc2609e;}})});}_0x195a46=_[_0xed0d('0x50')]({},_0x195a46,_0x2a0932[_0xed0d('0x51')]);var _0xe0342c={'where':_0x195a46[_0xed0d('0x4b')]};return db[_0xed0d('0x3b')][_0xed0d('0x2c')](_0xe0342c)[_0xed0d('0x1e')](function(_0x48230c){_0x6fe4ca[_0xed0d('0x2c')]=_0x48230c;if(_0x2a0932[_0xed0d('0x40')][_0xed0d('0x52')]){_0x195a46[_0xed0d('0x53')]=[{'all':!![]}];}return db[_0xed0d('0x3b')]['findAll'](_0x195a46);})[_0xed0d('0x1e')](function(_0x3c8630){_0x6fe4ca[_0xed0d('0x54')]=_0x3c8630;return _0x6fe4ca;})[_0xed0d('0x1e')](respondWithFilteredResult(_0x226ec7,_0x195a46))['catch'](handleError(_0x226ec7,null));};exports['show']=function(_0x46ea84,_0x28387d){var _0x474f5b={'raw':![],'where':{'id':_0x46ea84[_0xed0d('0x55')]['id']}},_0x3da45e={};_0x3da45e[_0xed0d('0x3f')]=_[_0xed0d('0x41')](db[_0xed0d('0x3b')][_0xed0d('0x3c')]);_0x3da45e['query']=_[_0xed0d('0x41')](_0x46ea84[_0xed0d('0x40')]);_0x3da45e[_0xed0d('0x4c')]=_['intersection'](_0x3da45e[_0xed0d('0x3f')],_0x3da45e[_0xed0d('0x40')]);_0x474f5b[_0xed0d('0x43')]=_[_0xed0d('0x42')](_0x3da45e[_0xed0d('0x3f')],qs[_0xed0d('0x44')](_0x46ea84[_0xed0d('0x40')][_0xed0d('0x44')]));_0x474f5b[_0xed0d('0x43')]=_0x474f5b['attributes'][_0xed0d('0x45')]?_0x474f5b['attributes']:_0x3da45e[_0xed0d('0x3f')];if(_0x46ea84[_0xed0d('0x40')][_0xed0d('0x52')]){_0x474f5b[_0xed0d('0x53')]=[{'all':!![]}];}_0x474f5b=_[_0xed0d('0x50')]({},_0x474f5b,_0x46ea84[_0xed0d('0x51')]);return db['Setting'][_0xed0d('0x56')](_0x474f5b)[_0xed0d('0x1e')](handleEntityNotFound(_0x28387d,null))[_0xed0d('0x1e')](respondWithResult(_0x28387d,null))['catch'](handleError(_0x28387d,null));};exports['update']=function(_0x425afa,_0x516c10){if(_0x425afa[_0xed0d('0x57')]['id']){delete _0x425afa[_0xed0d('0x57')]['id'];}return db[_0xed0d('0x3b')][_0xed0d('0x56')]({'where':{'id':_0x425afa['params']['id']}})['then'](handleEntityNotFound(_0x516c10,null))[_0xed0d('0x1e')](saveUpdates(_0x425afa['body'],null))[_0xed0d('0x1e')](respondWithResult(_0x516c10,null))['catch'](handleError(_0x516c10,null));};exports[_0xed0d('0x58')]=function(_0x2a9793,_0xa4a2b7,_0x7ccd66){if(_0x2a9793[_0xed0d('0x59')]&&_0x2a9793['file']['filename']){_0x2a9793[_0xed0d('0x57')][_0xed0d('0x5a')]=_0x2a9793[_0xed0d('0x59')][_0xed0d('0x5b')];}return db[_0xed0d('0x3b')][_0xed0d('0x56')]({'where':{'id':_0x2a9793[_0xed0d('0x55')]['id']}})[_0xed0d('0x1e')](handleEntityNotFound(_0xa4a2b7,null))['then'](saveUpdates(_0x2a9793[_0xed0d('0x57')],null))[_0xed0d('0x1e')](respondWithResult(_0xa4a2b7,null))[_0xed0d('0x29')](handleError(_0xa4a2b7,null));};exports['addLogoLogin']=function(_0x153b36,_0xd62f47,_0x824e5d){if(_0x153b36[_0xed0d('0x59')]&&_0x153b36['file'][_0xed0d('0x5b')]){_0x153b36[_0xed0d('0x57')]['loginLogo']=_0x153b36['file']['filename'];}return db[_0xed0d('0x3b')][_0xed0d('0x56')]({'where':{'id':_0x153b36[_0xed0d('0x55')]['id']}})['then'](handleEntityNotFound(_0xd62f47,null))[_0xed0d('0x1e')](saveUpdates(_0x153b36[_0xed0d('0x57')],null))[_0xed0d('0x1e')](respondWithResult(_0xd62f47,null))[_0xed0d('0x29')](handleError(_0xd62f47,null));};var utilLicense=require('../../config/license/util');exports[_0xed0d('0x5c')]=function(_0x1666e3,_0x31ce56,_0x500045){var _0x5cb96a='server/files/images/logos';var _0x58b9bd={'custom':![]};return utilLicense[_0xed0d('0x5d')]()[_0xed0d('0x1e')](function(_0x2653cd){if(_0x2653cd){_0x58b9bd=_0x2653cd;}return db[_0xed0d('0x3b')][_0xed0d('0x56')]({'where':{'id':_0x1666e3[_0xed0d('0x55')]['id']},'attributes':['logo',_0xed0d('0x5e'),_0xed0d('0x5f'),_0xed0d('0x60'),_0xed0d('0x61'),_0xed0d('0x62'),_0xed0d('0x63'),_0xed0d('0x64')],'raw':!![]});})[_0xed0d('0x1e')](handleEntityNotFound(_0x31ce56,null))[_0xed0d('0x1e')](function(_0x1e5163){if(_0x1e5163){var _0x16ce6d=_0x1e5163['logo']&&fs['existsSync'](path[_0xed0d('0x65')](config[_0xed0d('0x66')],_0x5cb96a,_['toLower'](_0x1e5163[_0xed0d('0x5a')])))?path[_0xed0d('0x65')](config[_0xed0d('0x66')],_0x5cb96a,_['toLower'](_0x1e5163[_0xed0d('0x5a')])):path['join'](config[_0xed0d('0x66')],_0x5cb96a,_[_0xed0d('0x67')]('default_logo.svg'));var _0x3b249f='default'+_[_0xed0d('0x68')]('logo');if(_0x1e5163[_0x3b249f]||!_0x58b9bd['custom']){_0x16ce6d=path[_0xed0d('0x65')](config[_0xed0d('0x66')],_0x5cb96a,_[_0xed0d('0x67')](_0xed0d('0x69')));}if(!fs[_0xed0d('0x6a')](_0x16ce6d)){throw new db[(_0xed0d('0x1d'))][(_0xed0d('0x6b'))](_[_0xed0d('0x68')](_0xed0d('0x5a'))+_0xed0d('0x6c'));}return _0x31ce56['download'](_0x16ce6d);}})[_0xed0d('0x29')](handleError(_0x31ce56,null));};var utilLicense=require(_0xed0d('0x6d'));exports['getLogoLogin']=function(_0x37f858,_0x4dbda2,_0x29847c){var _0x5c887b=_0xed0d('0x6e');var _0xb9d1be={'custom':![]};return utilLicense[_0xed0d('0x5d')]()[_0xed0d('0x1e')](function(_0x48c26a){if(_0x48c26a){_0xb9d1be=_0x48c26a;}return db[_0xed0d('0x3b')][_0xed0d('0x56')]({'where':{'id':_0x37f858['params']['id']},'attributes':[_0xed0d('0x5a'),_0xed0d('0x5e'),'preferred',_0xed0d('0x60'),'defaultLogo',_0xed0d('0x62'),_0xed0d('0x63'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x4dbda2,null))[_0xed0d('0x1e')](function(_0x79ac64){if(_0x79ac64){var _0x5b3cc0=_0x79ac64['loginLogo']&&fs['existsSync'](path[_0xed0d('0x65')](config['root'],_0x5c887b,_[_0xed0d('0x67')](_0x79ac64[_0xed0d('0x5e')])))?path[_0xed0d('0x65')](config[_0xed0d('0x66')],_0x5c887b,_['toLower'](_0x79ac64[_0xed0d('0x5e')])):path[_0xed0d('0x65')](config['root'],_0x5c887b,_[_0xed0d('0x67')](_0xed0d('0x6f')));var _0x540b3e=_0xed0d('0x70')+_[_0xed0d('0x68')]('loginLogo');if(_0x79ac64[_0x540b3e]||!_0xb9d1be[_0xed0d('0x71')]){_0x5b3cc0=path['join'](config[_0xed0d('0x66')],_0x5c887b,_[_0xed0d('0x67')](_0xed0d('0x6f')));}if(!fs[_0xed0d('0x6a')](_0x5b3cc0)){throw new db[(_0xed0d('0x1d'))]['ValidationError'](_['upperFirst'](_0xed0d('0x5e'))+_0xed0d('0x6c'));}return _0x4dbda2['download'](_0x5b3cc0);}})[_0xed0d('0x29')](handleError(_0x4dbda2,null));};exports['gdpr']=function(_0x56d542,_0x84ec33){return db[_0xed0d('0x3b')][_0xed0d('0x56')]({'where':{'id':_0x56d542[_0xed0d('0x55')]['id']},'attributes':[_0xed0d('0x72')]})[_0xed0d('0x1e')](respondWithResult(_0x84ec33,null))[_0xed0d('0x29')](handleError(_0x84ec33,null));};exports[_0xed0d('0x73')]=function(_0xa8ce05,_0x53bcd3,_0x3c3c85){if(_0xa8ce05['file']&&_0xa8ce05['file'][_0xed0d('0x5b')]){_0xa8ce05[_0xed0d('0x57')][_0xed0d('0x5f')]=_0xa8ce05[_0xed0d('0x59')][_0xed0d('0x5b')];}return db[_0xed0d('0x3b')][_0xed0d('0x56')]({'where':{'id':_0xa8ce05[_0xed0d('0x55')]['id']}})[_0xed0d('0x1e')](handleEntityNotFound(_0x53bcd3,null))[_0xed0d('0x1e')](saveUpdates(_0xa8ce05[_0xed0d('0x57')],null))[_0xed0d('0x1e')](respondWithResult(_0x53bcd3,null))[_0xed0d('0x29')](handleError(_0x53bcd3,null));};var utilLicense=require(_0xed0d('0x6d'));exports[_0xed0d('0x74')]=function(_0x4c0da3,_0x4a7ec0,_0x269df4){var _0x48f829=_0xed0d('0x6e');var _0x3bf86b={'custom':![]};return utilLicense[_0xed0d('0x5d')]()[_0xed0d('0x1e')](function(_0x39d76b){if(_0x39d76b){_0x3bf86b=_0x39d76b;}return db[_0xed0d('0x3b')][_0xed0d('0x56')]({'where':{'id':_0x4c0da3['params']['id']},'attributes':[_0xed0d('0x5a'),_0xed0d('0x5e'),_0xed0d('0x5f'),'favicon','defaultLogo',_0xed0d('0x62'),_0xed0d('0x63'),_0xed0d('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x4a7ec0,null))[_0xed0d('0x1e')](function(_0x182d93){if(_0x182d93){var _0xb9029c=_0x182d93[_0xed0d('0x5f')]&&fs['existsSync'](path[_0xed0d('0x65')](config[_0xed0d('0x66')],_0x48f829,_['toLower'](_0x182d93['preferred'])))?path[_0xed0d('0x65')](config['root'],_0x48f829,_[_0xed0d('0x67')](_0x182d93['preferred'])):path[_0xed0d('0x65')](config[_0xed0d('0x66')],_0x48f829,_[_0xed0d('0x67')](_0xed0d('0x75')));var _0x2ee879='default'+_[_0xed0d('0x68')](_0xed0d('0x5f'));if(_0x182d93[_0x2ee879]||!_0x3bf86b['custom']||!_0x3bf86b[_0xed0d('0x5f')]){_0xb9029c=path[_0xed0d('0x65')](config['root'],_0x48f829,_['toLower'](_0xed0d('0x75')));}if(!fs['existsSync'](_0xb9029c)){throw new db['Sequelize'][(_0xed0d('0x6b'))](_[_0xed0d('0x68')]('preferred')+_0xed0d('0x6c'));}return _0x4a7ec0['download'](_0xb9029c);}})['catch'](handleError(_0x4a7ec0,null));};exports[_0xed0d('0x76')]=function(_0x4cdf4d,_0x462b3a,_0x27bdf3){if(_0x4cdf4d[_0xed0d('0x59')]&&_0x4cdf4d[_0xed0d('0x59')][_0xed0d('0x5b')]){_0x4cdf4d[_0xed0d('0x57')][_0xed0d('0x60')]=_0x4cdf4d[_0xed0d('0x59')][_0xed0d('0x5b')];}return db[_0xed0d('0x3b')]['find']({'where':{'id':_0x4cdf4d['params']['id']}})['then'](handleEntityNotFound(_0x462b3a,null))['then'](saveUpdates(_0x4cdf4d[_0xed0d('0x57')],null))['then'](respondWithResult(_0x462b3a,null))['catch'](handleError(_0x462b3a,null));};var utilLicense=require(_0xed0d('0x6d'));exports[_0xed0d('0x77')]=function(_0x1a1e49,_0x5b0db3,_0x59f1c1){var _0x48f17c=_0xed0d('0x6e');var _0x278d6c={'custom':![]};return utilLicense[_0xed0d('0x5d')]()[_0xed0d('0x1e')](function(_0x4c254c){if(_0x4c254c){_0x278d6c=_0x4c254c;}return db[_0xed0d('0x3b')][_0xed0d('0x56')]({'where':{'id':_0x1a1e49[_0xed0d('0x55')]['id']},'attributes':[_0xed0d('0x5a'),_0xed0d('0x5e'),_0xed0d('0x5f'),'favicon',_0xed0d('0x61'),_0xed0d('0x62'),_0xed0d('0x63'),_0xed0d('0x64')],'raw':!![]});})[_0xed0d('0x1e')](handleEntityNotFound(_0x5b0db3,null))[_0xed0d('0x1e')](function(_0x5e22cc){if(_0x5e22cc){var _0x3dda53=_0x5e22cc[_0xed0d('0x60')]&&fs['existsSync'](path[_0xed0d('0x65')](config['root'],_0x48f17c,_['toLower'](_0x5e22cc['favicon'])))?path['join'](config[_0xed0d('0x66')],_0x48f17c,_[_0xed0d('0x67')](_0x5e22cc[_0xed0d('0x60')])):path[_0xed0d('0x65')](config[_0xed0d('0x66')],_0x48f17c,_['toLower'](_0xed0d('0x78')));var _0x1a247=_0xed0d('0x70')+_[_0xed0d('0x68')]('favicon');if(_0x5e22cc[_0x1a247]||!_0x278d6c['custom']){_0x3dda53=path['join'](config[_0xed0d('0x66')],_0x48f17c,_[_0xed0d('0x67')]('default_favicon.ico'));}if(!fs['existsSync'](_0x3dda53)){throw new db['Sequelize']['ValidationError'](_[_0xed0d('0x68')](_0xed0d('0x60'))+_0xed0d('0x6c'));}return _0x5b0db3[_0xed0d('0x79')](_0x3dda53);}})['catch'](handleError(_0x5b0db3,null));};
\ No newline at end of file
diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js
index b84dc7f..18141be 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 _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
+var _0x1f46=['request-promise','path','rimraf','../../config/environment','./setting.attributes','define','Setting','settings','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3e507d,_0x3abb4b){var _0x6ccda7=function(_0x378b89){while(--_0x378b89){_0x3e507d['push'](_0x3e507d['shift']());}};_0x6ccda7(++_0x3abb4b);}(_0x1f46,0x78));var _0x61f4=function(_0x412a4a,_0x461b25){_0x412a4a=_0x412a4a-0x0;var _0x55fad5=_0x1f46[_0x412a4a];return _0x55fad5;};'use strict';var _=require(_0x61f4('0x0'));var util=require(_0x61f4('0x1'));var logger=require(_0x61f4('0x2'))(_0x61f4('0x3'));var moment=require(_0x61f4('0x4'));var BPromise=require(_0x61f4('0x5'));var rp=require(_0x61f4('0x6'));var fs=require('fs');var path=require(_0x61f4('0x7'));var rimraf=require(_0x61f4('0x8'));var config=require(_0x61f4('0x9'));var attributes=require(_0x61f4('0xa'));module['exports']=function(_0x5858bb,_0x49ee34){return _0x5858bb[_0x61f4('0xb')](_0x61f4('0xc'),attributes,{'tableName':_0x61f4('0xd'),'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 c1a714f..808efff 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 _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
+var _0xf717=['../../config/environment','jayson/promise','http','request','then','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x444424,_0x1bdcfb){var _0x1c891c=function(_0x1ada40){while(--_0x1ada40){_0x444424['push'](_0x444424['shift']());}};_0x1c891c(++_0x1bdcfb);}(_0xf717,0xf5));var _0x7f71=function(_0x3aad54,_0x2dfd85){_0x3aad54=_0x3aad54-0x0;var _0xa378a2=_0xf717[_0x3aad54];return _0xa378a2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7f71('0x0'));var BPromise=require(_0x7f71('0x1'));var rs=require(_0x7f71('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f71('0x3'))['db'];var utils=require(_0x7f71('0x4'));var logger=require(_0x7f71('0x5'))(_0x7f71('0x6'));var config=require(_0x7f71('0x7'));var jayson=require(_0x7f71('0x8'));var client=jayson['client'][_0x7f71('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ec360,_0x42a95c,_0x1c1c07){return new BPromise(function(_0x3959b1,_0x295a39){return client[_0x7f71('0xa')](_0x3ec360,_0x1c1c07)[_0x7f71('0xb')](function(_0x20fb99){logger['info'](_0x7f71('0xc'),_0x42a95c,'request\x20sent');logger[_0x7f71('0xd')](_0x7f71('0xe'),_0x42a95c,_0x7f71('0xf'),JSON['stringify'](_0x20fb99));if(_0x20fb99[_0x7f71('0x10')]){if(_0x20fb99[_0x7f71('0x10')]['code']===0x1f4){logger[_0x7f71('0x10')](_0x7f71('0xc'),_0x42a95c,_0x20fb99['error'][_0x7f71('0x11')]);return _0x295a39(_0x20fb99['error'][_0x7f71('0x11')]);}logger[_0x7f71('0x10')]('Setting,\x20%s,\x20%s',_0x42a95c,_0x20fb99[_0x7f71('0x10')][_0x7f71('0x11')]);return _0x3959b1(_0x20fb99['error'][_0x7f71('0x11')]);}else{logger[_0x7f71('0x12')](_0x7f71('0xc'),_0x42a95c,'request\x20sent');_0x3959b1(_0x20fb99[_0x7f71('0x13')][_0x7f71('0x11')]);}})[_0x7f71('0x14')](function(_0x3b3099){logger[_0x7f71('0x10')](_0x7f71('0xc'),_0x42a95c,_0x3b3099);_0x295a39(_0x3b3099);});});}
\ No newline at end of file
diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js
index 3a1a1eb..579f9c6 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 _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
+var _0x6348=['/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions','/:id/canned_answers','/:id/interactions','getInteractions','statusGet','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','notify','addApplications','send','/:id/status','status','addAgents','put'];(function(_0x34751a,_0xbc2322){var _0x394a95=function(_0x3bdcc6){while(--_0x3bdcc6){_0x34751a['push'](_0x34751a['shift']());}};_0x394a95(++_0xbc2322);}(_0x6348,0xa3));var _0x8634=function(_0x116f1c,_0x5be34b){_0x116f1c=_0x116f1c-0x0;var _0x5be838=_0x6348[_0x116f1c];return _0x5be838;};'use strict';var multer=require(_0x8634('0x0'));var util=require(_0x8634('0x1'));var path=require(_0x8634('0x2'));var timeout=require(_0x8634('0x3'));var express=require(_0x8634('0x4'));var router=express[_0x8634('0x5')]();var auth=require(_0x8634('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8634('0x7'));router[_0x8634('0x8')]('/',auth[_0x8634('0x9')](),controller[_0x8634('0xa')]);router['get'](_0x8634('0xb'),auth[_0x8634('0x9')](),controller[_0x8634('0xc')]);router[_0x8634('0x8')]('/:id',auth[_0x8634('0x9')](),controller[_0x8634('0xd')]);router[_0x8634('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8634('0xe')]);router['get'](_0x8634('0xf'),auth[_0x8634('0x9')](),controller['getAnswers']);router[_0x8634('0x8')]('/:id/applications',auth[_0x8634('0x9')](),controller['getApplications']);router[_0x8634('0x8')](_0x8634('0x10'),auth['isAuthenticated'](),controller[_0x8634('0x11')]);router['get']('/:id/status',controller[_0x8634('0x12')]);router['get'](_0x8634('0x13'),auth[_0x8634('0x9')](),controller[_0x8634('0x14')]);router['post']('/',auth[_0x8634('0x9')](),controller['create']);router[_0x8634('0x15')](_0x8634('0x16'),auth[_0x8634('0x9')](),controller[_0x8634('0x17')]);router[_0x8634('0x15')](_0x8634('0xf'),auth['isAuthenticated'](),controller[_0x8634('0x18')]);router[_0x8634('0x15')]('/:id/notify',controller[_0x8634('0x19')]);router[_0x8634('0x15')]('/:id/applications',auth[_0x8634('0x9')](),controller[_0x8634('0x1a')]);router['post']('/:id/send',auth[_0x8634('0x9')](),controller[_0x8634('0x1b')]);router[_0x8634('0x15')](_0x8634('0x1c'),controller[_0x8634('0x1d')]);router[_0x8634('0x15')](_0x8634('0x13'),auth['isAuthenticated'](),controller[_0x8634('0x1e')]);router[_0x8634('0x1f')](_0x8634('0x20'),auth[_0x8634('0x9')](),controller['update']);router[_0x8634('0x21')](_0x8634('0x20'),auth['isAuthenticated'](),controller[_0x8634('0x22')]);router['delete'](_0x8634('0x16'),auth[_0x8634('0x9')](),controller[_0x8634('0x23')]);router[_0x8634('0x21')](_0x8634('0xf'),auth['isAuthenticated'](),controller[_0x8634('0x24')]);router[_0x8634('0x21')](_0x8634('0x13'),auth[_0x8634('0x9')](),controller[_0x8634('0x25')]);module[_0x8634('0x26')]=router;
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js
index 0fd4934..bd53593 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 _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
+var _0x7250=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','name','STRING','generate','ENUM','connectel','clicksend','plivo','clickatell','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x453285,_0x1426f6){var _0x4e05e0=function(_0x4fb0e5){while(--_0x4fb0e5){_0x453285['push'](_0x453285['shift']());}};_0x4e05e0(++_0x1426f6);}(_0x7250,0x147));var _0x0725=function(_0x2c3e46,_0x3eeacd){_0x2c3e46=_0x2c3e46-0x0;var _0x571def=_0x7250[_0x2c3e46];return _0x571def;};'use strict';var Sequelize=require(_0x0725('0x0'));var rs=require(_0x0725('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x0725('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x0725('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x0725('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x0725('0x3')],'defaultValue':function(){return rs[_0x0725('0x4')]();}},'phone':{'type':Sequelize[_0x0725('0x3')]},'type':{'type':Sequelize[_0x0725('0x5')]('twilio','skebby',_0x0725('0x6'),_0x0725('0x7'),_0x0725('0x8'),_0x0725('0x9'),'csc',_0x0725('0xa'),_0x0725('0xb'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x0725('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x0725('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x0725('0x3')]},'apiKey':{'type':Sequelize[_0x0725('0x3')]},'senderString':{'type':Sequelize[_0x0725('0x3')]},'deliveryReport':{'type':Sequelize[_0x0725('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x0725('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0725('0xd');}},'notificationSound':{'type':Sequelize[_0x0725('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0725('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0725('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0725('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0725('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0725('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0725('0xe')],'comment':_0x0725('0xf')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0725('0x10'),'set':function(_0x548b48){if(!_0x548b48)this['setDataValue'](_0x0725('0x11'),null);this['setDataValue'](_0x0725('0x12'),_0x548b48);}}};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js
index ae1abd0..1304fa5 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(_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
+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(_0x5092f2,_0x3fe719){var _0x308ce8=function(_0x3b0c7c){while(--_0x3b0c7c){_0x5092f2['push'](_0x5092f2['shift']());}};_0x308ce8(++_0x3fe719);}(_0x7a54,0x106));var _0x47a5=function(_0x537571,_0xca8273){_0x537571=_0x537571-0x0;var _0x59913=_0x7a54[_0x537571];return _0x59913;};'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 e73250d..64c5aac 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 _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
+var _0xa82a=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0x3c45ba,_0x4f2166){var _0x3dfe00=function(_0x55ac99){while(--_0x55ac99){_0x3c45ba['push'](_0x3c45ba['shift']());}};_0x3dfe00(++_0x4f2166);}(_0xa82a,0xc9));var _0xaa82=function(_0x22dbb5,_0x26ed79){_0x22dbb5=_0x22dbb5-0x0;var _0x14a77e=_0xa82a[_0x22dbb5];return _0x14a77e;};'use strict';var EventEmitter=require(_0xaa82('0x0'));var SmsAccount=require(_0xaa82('0x1'))['db'][_0xaa82('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xaa82('0x3')](0x0);var events={'afterCreate':_0xaa82('0x4'),'afterUpdate':_0xaa82('0x5'),'afterDestroy':_0xaa82('0x6')};function emitEvent(_0x5082aa){return function(_0x74ae89,_0x59fe69,_0x2e082f){SmsAccountEvents[_0xaa82('0x7')](_0x5082aa+':'+_0x74ae89['id'],_0x74ae89);SmsAccountEvents['emit'](_0x5082aa,_0x74ae89);_0x2e082f(null);};}for(var e in events){if(events[_0xaa82('0x8')](e)){var event=events[e];SmsAccount[_0xaa82('0x9')](e,emitEvent(event));}}module[_0xaa82('0xa')]=SmsAccountEvents;
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js
index f31d8e2..a0fd597 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(_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
+var _0xa9e0=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x410703,_0x4ae955){var _0x5007d7=function(_0x1a3195){while(--_0x1a3195){_0x410703['push'](_0x410703['shift']());}};_0x5007d7(++_0x4ae955);}(_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 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 b366722..04b9d2b 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 _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
+var _0xbeff=['request\x20sent','error','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','SmsAccount','find','raw','options','where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbeff,0xe9));var _0xfbef=function(_0x3df822,_0x22e9ed){_0x3df822=_0x3df822-0x0;var _0x19d1b9=_0xbeff[_0x3df822];return _0x19d1b9;};'use strict';var _=require(_0xfbef('0x0'));var util=require(_0xfbef('0x1'));var moment=require(_0xfbef('0x2'));var BPromise=require(_0xfbef('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfbef('0x4'))['db'];var utils=require(_0xfbef('0x5'));var logger=require(_0xfbef('0x6'))(_0xfbef('0x7'));var config=require(_0xfbef('0x8'));var jayson=require(_0xfbef('0x9'));var client=jayson[_0xfbef('0xa')][_0xfbef('0xb')]({'port':0x232a});config['redis']=_[_0xfbef('0xc')](config['redis'],{'host':_0xfbef('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfbef('0xe'))['register'](socket);function respondWithRpcPromise(_0x342d86,_0x2adeab,_0x391451){return new BPromise(function(_0x5bffe0,_0x5668f1){return client[_0xfbef('0xf')](_0x342d86,_0x391451)[_0xfbef('0x10')](function(_0x1f53d2){logger[_0xfbef('0x11')]('SmsAccount,\x20%s,\x20%s',_0x2adeab,'request\x20sent');logger['debug'](_0xfbef('0x12'),_0x2adeab,_0xfbef('0x13'),JSON['stringify'](_0x1f53d2));if(_0x1f53d2[_0xfbef('0x14')]){if(_0x1f53d2['error']['code']===0x1f4){logger[_0xfbef('0x14')](_0xfbef('0x15'),_0x2adeab,_0x1f53d2[_0xfbef('0x14')][_0xfbef('0x16')]);return _0x5668f1(_0x1f53d2[_0xfbef('0x14')]['message']);}logger[_0xfbef('0x14')](_0xfbef('0x15'),_0x2adeab,_0x1f53d2['error']['message']);return _0x5bffe0(_0x1f53d2['error'][_0xfbef('0x16')]);}else{logger['info'](_0xfbef('0x15'),_0x2adeab,_0xfbef('0x13'));_0x5bffe0(_0x1f53d2[_0xfbef('0x17')]['message']);}})[_0xfbef('0x18')](function(_0xb82343){logger[_0xfbef('0x14')](_0xfbef('0x15'),_0x2adeab,_0xb82343);_0x5668f1(_0xb82343);});});}exports[_0xfbef('0x19')]=function(_0x44dd51){var _0x809323=this;return new Promise(function(_0x3a7f09,_0x52eeca){return db[_0xfbef('0x1a')][_0xfbef('0x1b')]({'raw':_0x44dd51['options']?_0x44dd51['options'][_0xfbef('0x1c')]===undefined?!![]:![]:!![],'where':_0x44dd51[_0xfbef('0x1d')]?_0x44dd51[_0xfbef('0x1d')][_0xfbef('0x1e')]||null:null,'attributes':_0x44dd51[_0xfbef('0x1d')]?_0x44dd51['options'][_0xfbef('0x1f')]||null:null,'include':_0x44dd51[_0xfbef('0x1d')]?_0x44dd51[_0xfbef('0x1d')][_0xfbef('0x20')]?_[_0xfbef('0x21')](_0x44dd51[_0xfbef('0x1d')][_0xfbef('0x20')],function(_0x33aeab){return{'model':db[_0x33aeab[_0xfbef('0x22')]],'as':_0x33aeab['as'],'attributes':_0x33aeab[_0xfbef('0x1f')],'include':_0x33aeab[_0xfbef('0x20')]?_[_0xfbef('0x21')](_0x33aeab[_0xfbef('0x20')],function(_0x20d6cb){return{'model':db[_0x20d6cb['model']],'as':_0x20d6cb['as'],'attributes':_0x20d6cb[_0xfbef('0x1f')],'include':_0x20d6cb['include']?_['map'](_0x20d6cb['include'],function(_0x563322){return{'model':db[_0x563322[_0xfbef('0x22')]],'as':_0x563322['as'],'attributes':_0x563322[_0xfbef('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b66e8){logger['info'](_0xfbef('0x19'),_0x44dd51);logger['debug'](_0xfbef('0x19'),_0x44dd51,JSON[_0xfbef('0x23')](_0x3b66e8));_0x3a7f09(_0x3b66e8);})[_0xfbef('0x18')](function(_0x27e17c){logger[_0xfbef('0x14')](_0xfbef('0x19'),_0x27e17c['message'],_0x44dd51);_0x52eeca(_0x809323[_0xfbef('0x14')](0x1f4,_0x27e17c['message']));});});};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js
index 56efce8..d49e9a2 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 _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
+var _0xf1b0=['smsAccount:','./smsAccount.events','save','remove','update','removeListener'];(function(_0x47903d,_0x1d1dca){var _0x176303=function(_0x2c276a){while(--_0x2c276a){_0x47903d['push'](_0x47903d['shift']());}};_0x176303(++_0x1d1dca);}(_0xf1b0,0x151));var _0x0f1b=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0xf1b0[_0x7b173];return _0x1c598c;};'use strict';var SmsAccountEvents=require(_0x0f1b('0x0'));var events=[_0x0f1b('0x1'),_0x0f1b('0x2'),_0x0f1b('0x3')];function createListener(_0x4280c3,_0x4193f3){return function(_0x4ac856){_0x4193f3['emit'](_0x4280c3,_0x4ac856);};}function removeListener(_0x37c2a5,_0x209c8d){return function(){SmsAccountEvents[_0x0f1b('0x4')](_0x37c2a5,_0x209c8d);};}exports['register']=function(_0x28dda7){for(var _0x12f389=0x0,_0xe15b0b=events['length'];_0x12f389<_0xe15b0b;_0x12f389++){var _0x1a2b2a=events[_0x12f389];var _0x2afc75=createListener(_0x0f1b('0x5')+_0x1a2b2a,_0x28dda7);SmsAccountEvents['on'](_0x1a2b2a,_0x2afc75);}};
\ No newline at end of file
diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js
index 74d6502..30f8d5e 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 _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
+var _0xb4c2=['index','show','post','create','/:id','update','delete','multer','util','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated'];(function(_0x5e6b52,_0x3bbdda){var _0xafd2bc=function(_0x1324c9){while(--_0x1324c9){_0x5e6b52['push'](_0x5e6b52['shift']());}};_0xafd2bc(++_0x3bbdda);}(_0xb4c2,0x11f));var _0x2b4c=function(_0x208fe2,_0x40a58a){_0x208fe2=_0x208fe2-0x0;var _0x4b283f=_0xb4c2[_0x208fe2];return _0x4b283f;};'use strict';var multer=require(_0x2b4c('0x0'));var util=require(_0x2b4c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x2b4c('0x2'));var config=require(_0x2b4c('0x3'));var controller=require(_0x2b4c('0x4'));router[_0x2b4c('0x5')]('/',auth[_0x2b4c('0x6')](),controller[_0x2b4c('0x7')]);router[_0x2b4c('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x2b4c('0x8')]);router[_0x2b4c('0x9')]('/',auth[_0x2b4c('0x6')](),controller[_0x2b4c('0xa')]);router['put'](_0x2b4c('0xb'),auth[_0x2b4c('0x6')](),controller[_0x2b4c('0xc')]);router[_0x2b4c('0xd')](_0x2b4c('0xb'),auth[_0x2b4c('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js
index 59a5a0f..9ba098e 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 _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
+var _0x5211=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x1762e7,_0x395f19){var _0x3daa52=function(_0x3f2f5b){while(--_0x3f2f5b){_0x1762e7['push'](_0x1762e7['shift']());}};_0x3daa52(++_0x395f19);}(_0x5211,0x17d));var _0x1521=function(_0xc72052,_0x4a3363){_0xc72052=_0xc72052-0x0;var _0x1f9949=_0x5211[_0xc72052];return _0x1f9949;};'use strict';var Sequelize=require(_0x1521('0x0'));module[_0x1521('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1521('0x2')],'allowNull':![],'defaultValue':_0x1521('0x3')},'appdata':{'type':Sequelize[_0x1521('0x4')]()},'description':{'type':Sequelize[_0x1521('0x2')]},'interval':{'type':Sequelize[_0x1521('0x2')],'defaultValue':_0x1521('0x5')}};
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js
index a68a5f1..e1d5475 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 _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
+var _0xbaf0=['to-csv','ejs','lodash','squel','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','SmsApplication','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','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'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['SmsApplication'][_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));};
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js
index 210381d..d1a4144 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 _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
+var _0x34cf=['sms_applications','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','./smsApplication.attributes','exports','define','SmsApplication'];(function(_0x427249,_0x360587){var _0x5ad328=function(_0x3af302){while(--_0x3af302){_0x427249['push'](_0x427249['shift']());}};_0x5ad328(++_0x360587);}(_0x34cf,0x113));var _0xf34c=function(_0x567d54,_0x516180){_0x567d54=_0x567d54-0x0;var _0x5dcb34=_0x34cf[_0x567d54];return _0x5dcb34;};'use strict';var _=require(_0xf34c('0x0'));var util=require(_0xf34c('0x1'));var logger=require(_0xf34c('0x2'))(_0xf34c('0x3'));var moment=require(_0xf34c('0x4'));var BPromise=require('bluebird');var rp=require(_0xf34c('0x5'));var fs=require('fs');var path=require(_0xf34c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf34c('0x7'));module[_0xf34c('0x8')]=function(_0xef66cc,_0x193e54){return _0xef66cc[_0xf34c('0x9')](_0xf34c('0xa'),attributes,{'tableName':_0xf34c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf34c('0xc'),'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 38a06f9..5f2dde7 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 _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
+var _0x7c22=['SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','SmsApplication,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','request','then','request\x20sent','debug'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0x7c22,0x6c));var _0x27c2=function(_0x93d17a,_0x1bcb82){_0x93d17a=_0x93d17a-0x0;var _0x2b4eee=_0x7c22[_0x93d17a];return _0x2b4eee;};'use strict';var _=require(_0x27c2('0x0'));var util=require(_0x27c2('0x1'));var moment=require('moment');var BPromise=require(_0x27c2('0x2'));var rs=require(_0x27c2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27c2('0x4'))['db'];var utils=require(_0x27c2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x27c2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x27c2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32ec44,_0x123055,_0x56736f){return new BPromise(function(_0xb57ae1,_0xd38478){return client[_0x27c2('0x8')](_0x32ec44,_0x56736f)[_0x27c2('0x9')](function(_0x298bb7){logger['info']('SmsApplication,\x20%s,\x20%s',_0x123055,_0x27c2('0xa'));logger[_0x27c2('0xb')](_0x27c2('0xc'),_0x123055,_0x27c2('0xa'),JSON['stringify'](_0x298bb7));if(_0x298bb7[_0x27c2('0xd')]){if(_0x298bb7[_0x27c2('0xd')][_0x27c2('0xe')]===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x123055,_0x298bb7[_0x27c2('0xd')][_0x27c2('0xf')]);return _0xd38478(_0x298bb7[_0x27c2('0xd')][_0x27c2('0xf')]);}logger[_0x27c2('0xd')]('SmsApplication,\x20%s,\x20%s',_0x123055,_0x298bb7[_0x27c2('0xd')]['message']);return _0xb57ae1(_0x298bb7[_0x27c2('0xd')][_0x27c2('0xf')]);}else{logger[_0x27c2('0x10')](_0x27c2('0x11'),_0x123055,'request\x20sent');_0xb57ae1(_0x298bb7[_0x27c2('0x12')][_0x27c2('0xf')]);}})[_0x27c2('0x13')](function(_0xdbe562){logger[_0x27c2('0xd')](_0x27c2('0x11'),_0x123055,_0xdbe562);_0xd38478(_0xdbe562);});});}
\ No newline at end of file
diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js
index 2812ecd..d62e22b 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 _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
+var _0xfdad=['isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','tracked','sms','smsinteraction:addtags','put','smsinteraction:update','destroy','delete','/:id/tags','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x17823f,_0xffd807){var _0x51fc21=function(_0x5e4921){while(--_0x5e4921){_0x17823f['push'](_0x17823f['shift']());}};_0x51fc21(++_0xffd807);}(_0xfdad,0x164));var _0xdfda=function(_0x576ed1,_0x3b6ec4){_0x576ed1=_0x576ed1-0x0;var _0x2f825e=_0xfdad[_0x576ed1];return _0x2f825e;};'use strict';var multer=require(_0xdfda('0x0'));var util=require(_0xdfda('0x1'));var path=require('path');var timeout=require(_0xdfda('0x2'));var express=require(_0xdfda('0x3'));var router=express['Router']();var auth=require(_0xdfda('0x4'));var interaction=require(_0xdfda('0x5'));var config=require(_0xdfda('0x6'));var controller=require('./smsInteraction.controller');router[_0xdfda('0x7')]('/',auth[_0xdfda('0x8')](),controller['index']);router[_0xdfda('0x7')](_0xdfda('0x9'),auth[_0xdfda('0x8')](),controller[_0xdfda('0xa')]);router[_0xdfda('0x7')](_0xdfda('0xb'),auth[_0xdfda('0x8')](),controller[_0xdfda('0xc')]);router[_0xdfda('0x7')](_0xdfda('0xd'),auth[_0xdfda('0x8')](),controller[_0xdfda('0xe')]);router[_0xdfda('0x7')](_0xdfda('0xf'),auth[_0xdfda('0x8')](),controller[_0xdfda('0x10')]);router['post']('/',auth[_0xdfda('0x8')](),controller[_0xdfda('0x11')]);router[_0xdfda('0x12')](_0xdfda('0xd'),auth[_0xdfda('0x8')](),controller['addMessage']);router[_0xdfda('0x12')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xdfda('0x13')](_0xdfda('0x14'),_0xdfda('0x15')),controller['addTags']);router[_0xdfda('0x16')]('/:id',auth[_0xdfda('0x8')](),interaction[_0xdfda('0x13')](_0xdfda('0x14'),_0xdfda('0x17')),controller['update']);router['delete'](_0xdfda('0xb'),auth[_0xdfda('0x8')](),interaction[_0xdfda('0x13')](_0xdfda('0x14'),'smsinteraction:destroy'),controller[_0xdfda('0x18')]);router[_0xdfda('0x19')](_0xdfda('0x1a'),auth[_0xdfda('0x8')](),controller['removeTags']);module[_0xdfda('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js
index 971d010..6865c96 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 _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
+var _0xb10b=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3e5de0,_0x2aa52b){var _0x247d28=function(_0x558b6f){while(--_0x558b6f){_0x3e5de0['push'](_0x3e5de0['shift']());}};_0x247d28(++_0x2aa52b);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a94d0,_0x374e5d){_0x4a94d0=_0x4a94d0-0x0;var _0x50128a=_0xb10b[_0x4a94d0];return _0x50128a;};'use strict';var Sequelize=require(_0xbb10('0x0'));var moment=require('moment');module[_0xbb10('0x1')]={'closed':{'type':Sequelize[_0xbb10('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbb10('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbb10('0x4')]},'phone':{'type':Sequelize[_0xbb10('0x4')]},'read1stAt':{'type':Sequelize[_0xbb10('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xbb10('0x5')]('in',_0xbb10('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbb10('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbb10('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 7a1727f..cc5f4a2 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 _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
+var _0xde2c=['having','`\x20=\x200','operator','getFullTextValue','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','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','toString','sequelize','merge','SmsInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.email','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','show','includeAll','include','create','update','params','destroy','SmsMessage','addMessage','ids','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','omit','findAll','emit','removeTags','download','unix','join','root','server','transcript-%d-%s.zip','Contact','createdAt','secret','SmsAccount','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',' \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
','Sms','YYYY-MM-DD','Owner','N.A.','closed','closedAt','disposition','direction','out','System','lastName','renderFile','views','downloadInteraction.html','toFile','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','then','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','catch','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','field','color','from','tools_tags','u.id','user_has_sms_interactions','users','select','left_join','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','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value'];(function(_0x190194,_0xe6b356){var _0x3acc59=function(_0x54a5b9){while(--_0x54a5b9){_0x190194['push'](_0x190194['shift']());}};_0x3acc59(++_0xe6b356);}(_0xde2c,0x7f));var _0xcde2=function(_0x12ca5f,_0x223d98){_0x12ca5f=_0x12ca5f-0x0;var _0xfc3ae9=_0xde2c[_0x12ca5f];return _0xfc3ae9;};'use strict';var pdf=require(_0xcde2('0x0'));var emlformat=require(_0xcde2('0x1'));var rimraf=require(_0xcde2('0x2'));var zipdir=require(_0xcde2('0x3'));var jsonpatch=require(_0xcde2('0x4'));var rp=require(_0xcde2('0x5'));var moment=require(_0xcde2('0x6'));var BPromise=require(_0xcde2('0x7'));var Mustache=require('mustache');var util=require(_0xcde2('0x8'));var path=require(_0xcde2('0x9'));var sox=require(_0xcde2('0xa'));var csv=require(_0xcde2('0xb'));var ejs=require(_0xcde2('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcde2('0xd'));var crypto=require(_0xcde2('0xe'));var jsforce=require(_0xcde2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcde2('0x10'));var Papa=require(_0xcde2('0x11'));var Redis=require('ioredis');var authService=require(_0xcde2('0x12'));var qs=require(_0xcde2('0x13'));var as=require(_0xcde2('0x14'));var hardwareService=require(_0xcde2('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xcde2('0x16'));var config=require(_0xcde2('0x17'));var db=require(_0xcde2('0x18'))['db'];config[_0xcde2('0x19')]=_[_0xcde2('0x1a')](config[_0xcde2('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xcde2('0x1b'))(new Redis(config['redis']));require(_0xcde2('0x1c'))['register'](socket);function respondWithStatusCode(_0x4b0e0e,_0x34e079){_0x34e079=_0x34e079||0xcc;return function(_0x1c7103){if(_0x1c7103){return _0x4b0e0e[_0xcde2('0x1d')](_0x34e079);}return _0x4b0e0e[_0xcde2('0x1e')](_0x34e079)[_0xcde2('0x1f')]();};}function respondWithResult(_0x5312c7,_0x39b023){_0x39b023=_0x39b023||0xc8;return function(_0x4c558b){if(_0x4c558b){return _0x5312c7[_0xcde2('0x1e')](_0x39b023)[_0xcde2('0x20')](_0x4c558b);}};}function respondWithFilteredResult(_0xbade43,_0x1f1858){return function(_0x5223f1){if(_0x5223f1){var _0x4fd5aa=_0x5223f1[_0xcde2('0x21')],_0x4fe586=_0x1f1858[_0xcde2('0x22')],_0x2b4468=_0x1f1858[_0xcde2('0x22')]+_0x1f1858['limit'],_0x582e84;if(_0x2b4468>=_0x4fd5aa){_0x2b4468=_0x4fd5aa;_0x582e84=0xc8;}else{_0x582e84=0xce;}_0xbade43[_0xcde2('0x1e')](_0x582e84);return _0xbade43[_0xcde2('0x23')](_0xcde2('0x24'),_0x4fe586+'-'+_0x2b4468+'/'+_0x4fd5aa)[_0xcde2('0x20')](_0x5223f1);}return null;};}function patchUpdates(_0x43df7a){return function(_0x57210d){try{jsonpatch['apply'](_0x57210d,_0x43df7a,!![]);}catch(_0x5a92b9){return BPromise[_0xcde2('0x25')](_0x5a92b9);}return _0x57210d[_0xcde2('0x26')]();};}function saveUpdates(_0x2c9562,_0x4063d4){return function(_0xc86374){if(_0xc86374){return _0xc86374['update'](_0x2c9562)[_0xcde2('0x27')](function(_0x52368b){return _0x52368b;});}return null;};}function removeEntity(_0x280d8c,_0xb2123c){return function(_0x26d18e){if(_0x26d18e){return _0x26d18e['destroy']()['then'](function(){_0x280d8c[_0xcde2('0x1e')](0xcc)[_0xcde2('0x1f')]();});}};}function handleEntityNotFound(_0x3e8aaf,_0x217ec9){return function(_0xcadb2){if(!_0xcadb2){_0x3e8aaf['sendStatus'](0x194);}return _0xcadb2;};}function handleError(_0x2d1d17,_0x45275a){_0x45275a=_0x45275a||0x1f4;return function(_0x1dce65){logger['error'](_0x1dce65[_0xcde2('0x28')]);if(_0x1dce65[_0xcde2('0x29')]){delete _0x1dce65[_0xcde2('0x29')];}_0x2d1d17[_0xcde2('0x1e')](_0x45275a)[_0xcde2('0x2a')](_0x1dce65);};}function getInteractionUsers(_0x5b2b7,_0x40b12c){return new BPromise(function(_0x3e492f,_0x5bf1e6){try{if(_0x40b12c[_0x5b2b7['id']]){_0x5b2b7[_0xcde2('0x2b')]=_['map'](_0x40b12c[_0x5b2b7['id']],function(_0x141072){return{'id':_0x141072['id'],'fullname':_0x141072[_0xcde2('0x2c')]};});}}catch(_0x43706c){_0x5bf1e6(_0x43706c);}_0x3e492f(_0x5b2b7);});}function getInteractionTags(_0x49cb58,_0xae46dc){return new BPromise(function(_0x28fedd,_0x58afb1){try{if(_0x49cb58[_0xcde2('0x2d')]){_0x49cb58[_0xcde2('0x2e')]=[];_0x49cb58[_0xcde2('0x2d')][_0xcde2('0x2f')](',')[_0xcde2('0x30')](function(_0xb689cd){_0x49cb58[_0xcde2('0x2e')][_0xcde2('0x31')](_0xae46dc[_0xb689cd]);});}delete _0x49cb58['TagIds'];}catch(_0x3a1f13){_0x58afb1(_0x3a1f13);}_0x28fedd(_0x49cb58);});}function updateSmsInteraction(_0x6fda22,_0x21b7bd,_0x15bd3e){return new BPromise(function(_0x4e2c3a,_0x2ae8e0){return getInteractionUsers(_0x6fda22,_0x15bd3e)[_0xcde2('0x27')](function(_0x2e14f8){return getInteractionTags(_0x2e14f8,_0x21b7bd);})[_0xcde2('0x27')](function(_0x498339){_0x4e2c3a(_0x498339);})[_0xcde2('0x32')](function(_0x452816){_0x2ae8e0(_0x452816);});});}exports[_0xcde2('0x33')]=function(_0x303d45,_0x54ae78){var _0xb9c8d2={},_0x5ab40f={},_0xbde4f4={'count':0x0,'rows':[]};var _0x3090b6=_[_0xcde2('0x34')](db['SmsInteraction'][_0xcde2('0x35')],function(_0x31feeb){return{'name':_0x31feeb[_0xcde2('0x36')],'type':_0x31feeb[_0xcde2('0x37')]['key']};});_0x5ab40f['model']=_[_0xcde2('0x34')](_0x3090b6,_0xcde2('0x29'));_0x5ab40f[_0xcde2('0x38')]=_[_0xcde2('0x39')](_0x303d45[_0xcde2('0x38')]);_0x5ab40f[_0xcde2('0x3a')]=_[_0xcde2('0x3b')](_0x5ab40f[_0xcde2('0x3c')],_0x5ab40f[_0xcde2('0x38')]);_0xb9c8d2['attributes']=_[_0xcde2('0x3b')](_0x5ab40f[_0xcde2('0x3c')],qs[_0xcde2('0x3d')](_0x303d45[_0xcde2('0x38')][_0xcde2('0x3d')]));_0xb9c8d2['attributes']=_0xb9c8d2['attributes'][_0xcde2('0x3e')]?_0xb9c8d2[_0xcde2('0x3f')]:_0x5ab40f[_0xcde2('0x3c')];if(!_0x303d45[_0xcde2('0x38')][_0xcde2('0x40')](_0xcde2('0x41'))){_0xb9c8d2['limit']=qs['limit'](_0x303d45['query'][_0xcde2('0x42')]);_0xb9c8d2[_0xcde2('0x22')]=qs[_0xcde2('0x22')](_0x303d45[_0xcde2('0x38')][_0xcde2('0x22')]);}_0xb9c8d2[_0xcde2('0x43')]=qs[_0xcde2('0x44')](_0x303d45['query']['sort']);_0xb9c8d2[_0xcde2('0x45')]=qs['filters'](_[_0xcde2('0x46')](_0x303d45['query'],_0x5ab40f[_0xcde2('0x3a')]),_0x3090b6);var _0x3239a0=[];var _0x2cf372=squel['select']()[_0xcde2('0x47')]('id')['field'](_0xcde2('0x29'))[_0xcde2('0x47')](_0xcde2('0x48'))[_0xcde2('0x49')](_0xcde2('0x4a'));var _0x27b64f=squel['select']()['field'](_0xcde2('0x4b'))['field']('u.fullname')[_0xcde2('0x47')]('ui.SmsInteractionId')[_0xcde2('0x49')](_0xcde2('0x4c'),'ui')['left_join'](_0xcde2('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x5acde1=squel[_0xcde2('0x4e')]()[_0xcde2('0x49')]('sms_interactions','i')[_0xcde2('0x4f')]('cm_contacts','c',_0xcde2('0x50'))[_0xcde2('0x4f')](_0xcde2('0x4d'),'o',_0xcde2('0x51'))[_0xcde2('0x4f')]('sms_accounts','a',_0xcde2('0x52'))[_0xcde2('0x4f')](_0xcde2('0x53'),'me',_0xcde2('0x54'))['left_join']('sms_interaction_has_tags','it',_0xcde2('0x55'))['left_join'](_0xcde2('0x4a'),'t',_0xcde2('0x56'));var _0x381bd4=squel[_0xcde2('0x57')]();var _0x1ce210=[];var _0x3b7862=squel['expr']();var _0x1ce5fe;if(_0x303d45['query'][_0xcde2('0x58')]){_0x1ce5fe=as['parseSearch'](_0x303d45[_0xcde2('0x38')][_0xcde2('0x58')]);var _0x3d10c8=_0x1ce5fe[_0xcde2('0x59')];for(var _0x446cf0=0x0;_0x446cf0<_0x1ce5fe[_0xcde2('0x5a')]['length'];_0x446cf0++){var _0x3adc5b=_0x1ce5fe['conditions'][_0x446cf0];var _0x138c58='i';var _0x184005=_[_0xcde2('0x5b')](_0x3090b6,[_0xcde2('0x29'),_0x3adc5b[_0xcde2('0x47')]]);if(!_0x184005){switch(_0x3adc5b[_0xcde2('0x47')]){case _0xcde2('0x5c'):if(_0x3adc5b[_0xcde2('0x5d')]==0x1){_0x5acde1[_0xcde2('0x5e')]('`'+_0x3adc5b[_0xcde2('0x47')]+_0xcde2('0x5f'));}else{_0x5acde1[_0xcde2('0x5e')]('`'+_0x3adc5b['field']+'`\x20>\x200');}break;case'Contact':if(_0x3adc5b[_0xcde2('0x60')]==='$substring'){if(_0x3adc5b[_0xcde2('0x5d')][_0xcde2('0x2f')]('\x20')[_0xcde2('0x3e')]>0x1){_0x381bd4[_0x3d10c8]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xcde2('0x61')](_0x3adc5b['value']),null);}else{var _0x2ccfe9='%'+_0x3adc5b['value']+'%';_0x381bd4[_0x3d10c8](_0xcde2('0x62'),_0x2ccfe9,_0x2ccfe9,_0x2ccfe9);}}else{_0x184005=_[_0xcde2('0x5b')](_0x3090b6,['name',_0xcde2('0x63')]);_0x3adc5b['field']='ContactId';_0x223cb0=as[_0xcde2('0x64')](_0x138c58,_0x184005[_0xcde2('0x37')],_0x3adc5b);_0x381bd4[_0x3d10c8](_0x223cb0[_0xcde2('0x65')],_0x223cb0[_0xcde2('0x5d')][_0xcde2('0x66')],_0x223cb0[_0xcde2('0x5d')]['end']);}break;case _0xcde2('0x67'):var _0x44b3fb=_0x3adc5b[_0xcde2('0x5d')][_0xcde2('0x2f')](',')[_0xcde2('0x34')](function(_0x541a70){return Number(_0x541a70);});_0x44b3fb['forEach'](function(_0x5775bb){_0x3b7862['or'](_0xcde2('0x68'),'%,'+_0x5775bb+',%');});_0x1ce210=_[_0xcde2('0x69')](_0x1ce210,_0x44b3fb);break;case _0xcde2('0x6a'):if(_0x3adc5b[_0xcde2('0x60')]==='$substring'){_0x381bd4[_0x3d10c8](_0xcde2('0x6b'),'%'+_0x3adc5b[_0xcde2('0x5d')]+'%',null);}else{_0x184005=_[_0xcde2('0x5b')](_0x3090b6,[_0xcde2('0x29'),_0xcde2('0x6c')]);_0x3adc5b[_0xcde2('0x47')]='UserId';_0x223cb0=as[_0xcde2('0x64')](_0x138c58,_0x184005[_0xcde2('0x37')],_0x3adc5b);_0x381bd4[_0x3d10c8](_0x223cb0['text'],_0x223cb0[_0xcde2('0x5d')][_0xcde2('0x66')],_0x223cb0[_0xcde2('0x5d')][_0xcde2('0x1f')]);}break;case _0xcde2('0x6d'):_0x223cb0=as[_0xcde2('0x64')]('me',null,_0x3adc5b);_0x381bd4[_0x3d10c8](_0x223cb0[_0xcde2('0x65')],_0x223cb0[_0xcde2('0x5d')][_0xcde2('0x66')],_0x223cb0[_0xcde2('0x5d')]['end']);break;}}else{var _0x223cb0=as[_0xcde2('0x64')](_0x138c58,_0x184005['type'],_0x3adc5b);_0x381bd4[_0x3d10c8](_0x223cb0[_0xcde2('0x65')],_0x223cb0[_0xcde2('0x5d')][_0xcde2('0x66')],_0x223cb0['value'][_0xcde2('0x1f')]);}}}else{var _0x1253c6=_(_0x303d45[_0xcde2('0x38')])[_0xcde2('0x39')]()[_0xcde2('0x34')](function(_0x3aa334){return _[_0xcde2('0x6e')](_0x3090b6,[_0xcde2('0x29'),_0x3aa334])?_0x3aa334:undefined;})[_0xcde2('0x6f')]()[_0xcde2('0x5d')]();if(!_[_0xcde2('0x70')](_0x1253c6)){_0x1253c6['forEach'](function(_0x5bd1bd){if(_0x5bd1bd===_0xcde2('0x71')){_0x5acde1[_0xcde2('0x45')](_0xcde2('0x72'),[]['concat'](_0x303d45['query'][_0x5bd1bd]));}else if(_0x5bd1bd==='createdAt'){var _0x1341d0=JSON[_0xcde2('0x73')](_0x303d45[_0xcde2('0x38')][_0x5bd1bd])[_0xcde2('0x74')];var _0x325b51=JSON[_0xcde2('0x73')](_0x303d45['query'][_0x5bd1bd])['$lte'];_0x5acde1[_0xcde2('0x45')](_0xcde2('0x75'),_0x1341d0,_0x325b51);}else{if(_0x303d45[_0xcde2('0x38')][_0x5bd1bd]===_0xcde2('0x76')){_0x5acde1[_0xcde2('0x45')]('i.'+_0x5bd1bd+_0xcde2('0x77'));}else{_0x5acde1[_0xcde2('0x45')]('i.'+_0x5bd1bd+_0xcde2('0x78'),_0x303d45[_0xcde2('0x38')][_0x5bd1bd]);}}});}if(_0x303d45[_0xcde2('0x38')][_0xcde2('0x79')]){if(_0x303d45[_0xcde2('0x38')][_0xcde2('0x79')]==0x1){_0x5acde1[_0xcde2('0x5e')](_0xcde2('0x7a'));}else{_0x5acde1[_0xcde2('0x5e')](_0xcde2('0x7b'));}}if(_0x303d45[_0xcde2('0x38')][_0xcde2('0x7c')]){_0x1ce210=_[_0xcde2('0x7d')](_0x303d45['query'][_0xcde2('0x7c')])?_0x303d45[_0xcde2('0x38')][_0xcde2('0x7c')]:new Array(_0x303d45[_0xcde2('0x38')][_0xcde2('0x7c')]);_0x1ce210['forEach'](function(_0x2e9714){_0x3b7862['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2e9714+',%');});}if(_0x303d45[_0xcde2('0x38')][_0xcde2('0x7e')]){var _0x171cee=_0x303d45[_0xcde2('0x38')][_0xcde2('0x7e')][_0xcde2('0x7f')]('\x5c','\x5c\x5c')[_0xcde2('0x7f')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x171cee)){_0x381bd4['or'](_0xcde2('0x80'),_0x171cee+'%')['or']('i.phone\x20LIKE\x20?',_0x171cee+'%');}else{_0x381bd4['or'](_0xcde2('0x81'),qs[_0xcde2('0x61')](_0x171cee))['or'](_0xcde2('0x82'),_0x171cee+'%');}}}_0x5acde1[_0xcde2('0x45')](_0x381bd4);_0x5acde1[_0xcde2('0x83')](_0xcde2('0x84'));var _0x257950={'type':db['Sequelize'][_0xcde2('0x85')][_0xcde2('0x86')],'raw':!![]};var _0x25ee3e=_0x5acde1[_0xcde2('0x87')]();_0x25ee3e['field'](_0xcde2('0x84'));_0x25ee3e[_0xcde2('0x47')](_0xcde2('0x88'),_0xcde2('0x5c'));if(_0xb9c8d2[_0xcde2('0x43')]){_0xb9c8d2[_0xcde2('0x43')][_0xcde2('0x30')](function(_0x214cbb){_0x5acde1[_0xcde2('0x43')]('i.'+_0x214cbb[0x0],_0x214cbb[0x1]===_0xcde2('0x89')?![]:!![]);});}if(!_[_0xcde2('0x70')](_0x1ce210)){_0x5acde1[_0xcde2('0x5e')](_0x3b7862);_0x25ee3e[_0xcde2('0x45')]('t.id\x20IN\x20?',_0x1ce210);}BPromise[_0xcde2('0x8a')]()[_0xcde2('0x27')](function(){if(!_0x1ce5fe){if(_0x303d45[_0xcde2('0x38')][_0xcde2('0x71')]||_0x303d45[_0xcde2('0x38')][_0xcde2('0x8b')])return;_0x25ee3e[_0xcde2('0x45')](_0xcde2('0x8c'));_0x5acde1[_0xcde2('0x45')](_0xcde2('0x8c'));return;}return _0x303d45[_0xcde2('0x8d')][_0xcde2('0x8e')]({'attributes':['id'],'raw':!![]})[_0xcde2('0x27')](function(_0x2ff2f2){if(_[_0xcde2('0x70')](_0x2ff2f2)){_0x25ee3e[_0xcde2('0x45')]('i.SmsAccountId\x20IS\x20NULL');_0x5acde1['where'](_0xcde2('0x8f'));}else{_0x25ee3e[_0xcde2('0x45')](_0xcde2('0x72'),_[_0xcde2('0x34')](_0x2ff2f2,'id'));_0x5acde1['where'](_0xcde2('0x72'),_['map'](_0x2ff2f2,'id'));}});})[_0xcde2('0x27')](function(){db['sequelize'][_0xcde2('0x38')](_0x25ee3e[_0xcde2('0x90')](),_0x257950)['then'](function(_0x1c72c2){_0xbde4f4[_0xcde2('0x21')]=_0x1c72c2[_0xcde2('0x3e')];if(_0xbde4f4['count']===0x0)return[];return db[_0xcde2('0x91')][_0xcde2('0x38')](_0x2cf372[_0xcde2('0x90')](),_0x257950)[_0xcde2('0x27')](function(_0x4b7e5f){_0x3239a0=_['keyBy'](_0x4b7e5f,'id');_0x257950=_[_0xcde2('0x92')](_0x257950,{'model':db[_0xcde2('0x93')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x303d45[_0xcde2('0x38')][_0xcde2('0x3d')]){_0xb9c8d2[_0xcde2('0x3f')][_0xcde2('0x30')](function(_0x4be3c3){_0x5acde1[_0xcde2('0x47')]('i.'+_0x4be3c3);});}else{_0x5acde1[_0xcde2('0x47')](_0xcde2('0x88'),_0xcde2('0x5c'));_0x5acde1[_0xcde2('0x47')](_0xcde2('0x94'),_0xcde2('0x95'));_0x5acde1['field'](_0xcde2('0x96'),_0xcde2('0x97'));_0x5acde1['field'](_0xcde2('0x98'));_0x5acde1[_0xcde2('0x47')](_0xcde2('0x99'),'Contact.firstName');_0x5acde1[_0xcde2('0x47')](_0xcde2('0x9a'),'Contact.lastName');_0x5acde1['field']('c.email',_0xcde2('0x9b'));_0x5acde1[_0xcde2('0x47')]('c.phone',_0xcde2('0x9c'));_0x5acde1['field']('c.mobile',_0xcde2('0x9d'));_0x5acde1[_0xcde2('0x47')](_0xcde2('0x9e'),'Contact.fax');_0x5acde1[_0xcde2('0x47')](_0xcde2('0x9f'),_0xcde2('0xa0'));_0x5acde1[_0xcde2('0x47')](_0xcde2('0xa1'),_0xcde2('0xa2'));_0x5acde1[_0xcde2('0x47')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0xb9c8d2[_0xcde2('0x42')])_0x5acde1[_0xcde2('0x42')](_0xb9c8d2[_0xcde2('0x42')]);if(_0xb9c8d2[_0xcde2('0x22')])_0x5acde1[_0xcde2('0x22')](_0xb9c8d2['offset']);return db[_0xcde2('0x91')]['query'](_0x5acde1['toString'](),_0x257950);})[_0xcde2('0x27')](function(_0x5aa5c9){_0x27b64f['where'](_0xcde2('0xa3'),_[_0xcde2('0x34')](_0x5aa5c9,'id'));return db[_0xcde2('0x91')][_0xcde2('0x38')](_0x27b64f[_0xcde2('0x90')](),_0x257950)['then'](function(_0x44d0ad){var _0x562486=_[_0xcde2('0xa4')](_0x44d0ad,_0xcde2('0xa5'));var _0x3d96b1=[];_0x5aa5c9[_0xcde2('0x30')](function(_0x5130a5){_0x3d96b1['push'](updateSmsInteraction(_0x5130a5,_0x3239a0,_0x562486));});return BPromise['all'](_0x3d96b1);});});})[_0xcde2('0x27')](function(_0x4bd901){_0xbde4f4['rows']=_0x4bd901;return _0xbde4f4;})[_0xcde2('0x27')](respondWithFilteredResult(_0x54ae78,_0xb9c8d2));})[_0xcde2('0x32')](handleError(_0x54ae78,null));};exports[_0xcde2('0xa6')]=function(_0x15f943,_0xe8b781){var _0x7a6b89={'raw':![],'where':{'id':_0x15f943['params']['id']}},_0x236d70={};_0x236d70[_0xcde2('0x3c')]=_[_0xcde2('0x39')](db[_0xcde2('0x93')][_0xcde2('0x35')]);_0x236d70[_0xcde2('0x38')]=_[_0xcde2('0x39')](_0x15f943[_0xcde2('0x38')]);_0x236d70['filters']=_[_0xcde2('0x3b')](_0x236d70['model'],_0x236d70['query']);_0x7a6b89[_0xcde2('0x3f')]=_[_0xcde2('0x3b')](_0x236d70[_0xcde2('0x3c')],qs[_0xcde2('0x3d')](_0x15f943[_0xcde2('0x38')][_0xcde2('0x3d')]));_0x7a6b89[_0xcde2('0x3f')]=_0x7a6b89['attributes'][_0xcde2('0x3e')]?_0x7a6b89[_0xcde2('0x3f')]:_0x236d70[_0xcde2('0x3c')];if(_0x15f943['query'][_0xcde2('0xa7')]){_0x7a6b89[_0xcde2('0xa8')]=[{'all':!![]}];}_0x7a6b89=_['merge']({},_0x7a6b89,_0x15f943['options']);return db[_0xcde2('0x93')][_0xcde2('0x5b')](_0x7a6b89)[_0xcde2('0x27')](handleEntityNotFound(_0xe8b781,null))[_0xcde2('0x27')](respondWithResult(_0xe8b781,null))[_0xcde2('0x32')](handleError(_0xe8b781,null));};exports['create']=function(_0x5a78ad,_0x2c7414){return db['SmsInteraction'][_0xcde2('0xa9')](_0x5a78ad[_0xcde2('0x6d')],{})[_0xcde2('0x27')](respondWithResult(_0x2c7414,0xc9))[_0xcde2('0x32')](handleError(_0x2c7414,null));};exports[_0xcde2('0xaa')]=function(_0x5350d3,_0x1149c8){if(_0x5350d3[_0xcde2('0x6d')]['id']){delete _0x5350d3[_0xcde2('0x6d')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x5350d3[_0xcde2('0xab')]['id']}})['then'](handleEntityNotFound(_0x1149c8,null))[_0xcde2('0x27')](saveUpdates(_0x5350d3[_0xcde2('0x6d')],null))[_0xcde2('0x27')](respondWithResult(_0x1149c8,null))[_0xcde2('0x32')](handleError(_0x1149c8,null));};exports[_0xcde2('0xac')]=function(_0x404284,_0x427d7a){return db['SmsInteraction']['find']({'where':{'id':_0x404284[_0xcde2('0xab')]['id']}})[_0xcde2('0x27')](handleEntityNotFound(_0x427d7a,null))[_0xcde2('0x27')](removeEntity(_0x427d7a,null))['catch'](handleError(_0x427d7a,null));};exports['describe']=function(_0x12293b,_0x39143c){return db[_0xcde2('0x93')]['describe']()[_0xcde2('0x27')](respondWithResult(_0x39143c,null))[_0xcde2('0x32')](handleError(_0x39143c,null));};exports['addMessage']=function(_0x3eae0b,_0x138eaa,_0x9ffcc8){return db[_0xcde2('0xad')][_0xcde2('0x5b')]({'where':{'id':_0x3eae0b[_0xcde2('0xab')]['id']}})[_0xcde2('0x27')](handleEntityNotFound(_0x138eaa,null))[_0xcde2('0x27')](function(_0x48c169){if(_0x48c169){return _0x48c169[_0xcde2('0xae')](_0x3eae0b[_0xcde2('0x6d')][_0xcde2('0xaf')],_['omit'](_0x3eae0b[_0xcde2('0x6d')],[_0xcde2('0xaf'),'id'])||{});}})[_0xcde2('0x27')](respondWithResult(_0x138eaa,null))[_0xcde2('0x32')](handleError(_0x138eaa,null));};exports['getMessages']=function(_0x1faf97,_0x4268bd,_0x1b520e){var _0x14c475={'raw':![],'where':{}};var _0x223a08={};var _0x4ffbb2={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x1faf97[_0xcde2('0xab')]['id']}})[_0xcde2('0x27')](handleEntityNotFound(_0x4268bd,null))['then'](function(_0x25a17b){if(_0x25a17b){_0x223a08[_0xcde2('0x3c')]=_[_0xcde2('0x39')](db['SmsMessage'][_0xcde2('0x35')]);_0x223a08[_0xcde2('0x38')]=_[_0xcde2('0x39')](_0x1faf97['query']);_0x223a08[_0xcde2('0x3a')]=_[_0xcde2('0x3b')](_0x223a08[_0xcde2('0x3c')],_0x223a08[_0xcde2('0x38')]);_0x14c475[_0xcde2('0x3f')]=_[_0xcde2('0x3b')](_0x223a08[_0xcde2('0x3c')],qs[_0xcde2('0x3d')](_0x1faf97[_0xcde2('0x38')][_0xcde2('0x3d')]));_0x14c475[_0xcde2('0x3f')]=_0x14c475[_0xcde2('0x3f')]['length']?_0x14c475[_0xcde2('0x3f')]:_0x223a08['model'];if(!_0x1faf97[_0xcde2('0x38')]['hasOwnProperty'](_0xcde2('0x41'))){_0x14c475['limit']=qs['limit'](_0x1faf97[_0xcde2('0x38')][_0xcde2('0x42')]);_0x14c475[_0xcde2('0x22')]=qs[_0xcde2('0x22')](_0x1faf97[_0xcde2('0x38')][_0xcde2('0x22')]);}_0x14c475['order']=qs[_0xcde2('0x44')](_0x1faf97[_0xcde2('0x38')][_0xcde2('0x44')]);_0x14c475[_0xcde2('0x45')]=qs[_0xcde2('0x3a')](_[_0xcde2('0x46')](_0x1faf97[_0xcde2('0x38')],_0x223a08[_0xcde2('0x3a')]));_0x14c475[_0xcde2('0x45')][_0xcde2('0xa5')]=_0x25a17b['id'];if(_0x1faf97['query'][_0xcde2('0x7e')]){_0x14c475[_0xcde2('0x45')]=_[_0xcde2('0x92')](_0x14c475[_0xcde2('0x45')],{'$or':_[_0xcde2('0x34')](_0x14c475[_0xcde2('0x3f')],function(_0x504f94){var _0x353e44={};_0x353e44[_0x504f94]={'$like':'%'+_0x1faf97[_0xcde2('0x38')][_0xcde2('0x7e')]+'%'};return _0x353e44;})});}if(_0x1faf97[_0xcde2('0x38')][_0xcde2('0x74')]){var _0x27ab58=_0x1faf97[_0xcde2('0x38')][_0xcde2('0x74')]['split'](',');var _0x5785bf={};_0x5785bf[_0x27ab58[0x0]]={'$gte':moment(_0x27ab58[0x1])[_0xcde2('0xb0')](_0xcde2('0xb1'))};_0x14c475[_0xcde2('0x45')]=_[_0xcde2('0x92')](_0x14c475[_0xcde2('0x45')],_0x5785bf);}_0x14c475=_[_0xcde2('0x92')]({},_0x14c475,_0x1faf97[_0xcde2('0xb2')]);return db[_0xcde2('0xad')][_0xcde2('0x21')]({'where':_0x14c475[_0xcde2('0x45')]})['then'](function(_0x3f9b5b){_0x4ffbb2[_0xcde2('0x21')]=_0x3f9b5b;if(_0x1faf97[_0xcde2('0x38')][_0xcde2('0xa7')]){_0x14c475[_0xcde2('0xa8')]=[{'all':!![]}];}return db[_0xcde2('0xad')]['findAll'](_0x14c475);})[_0xcde2('0x27')](function(_0x49db7b){_0x4ffbb2[_0xcde2('0xb3')]=_0x49db7b;return _0x4ffbb2;});}})[_0xcde2('0x27')](respondWithFilteredResult(_0x4268bd,_0x14c475))[_0xcde2('0x32')](handleError(_0x4268bd,null));};exports[_0xcde2('0xb4')]=function(_0x4ebd59,_0x3f3654,_0x2c736c){return db[_0xcde2('0x93')][_0xcde2('0x5b')]({'where':{'id':_0x4ebd59[_0xcde2('0xab')]['id']}})['then'](handleEntityNotFound(_0x3f3654,null))[_0xcde2('0x27')](function(_0x6b48e){if(_0x6b48e){return _0x6b48e[_0xcde2('0xb5')](_0x4ebd59['body'][_0xcde2('0xaf')],_[_0xcde2('0xb6')](_0x4ebd59[_0xcde2('0x6d')],['ids','id'])||{})['spread'](function(){return db[_0xcde2('0x67')][_0xcde2('0xb7')]({'attributes':['id',_0xcde2('0x29'),_0xcde2('0x48')],'where':{'id':_0x4ebd59['body'][_0xcde2('0xaf')]}});})['then'](function(_0x1a7570){socket[_0xcde2('0xb8')]('smsInteractionTags:save',{'id':Number(_0x4ebd59[_0xcde2('0xab')]['id']),'tags':_0x1a7570||[]});return{'id':Number(_0x4ebd59[_0xcde2('0xab')]['id']),'tags':_0x1a7570||[]};});}})['then'](respondWithResult(_0x3f3654,null))[_0xcde2('0x32')](handleError(_0x3f3654,null));};exports[_0xcde2('0xb9')]=function(_0x5a5422,_0x5de57e,_0x488ec5){return db['SmsInteraction'][_0xcde2('0x5b')]({'where':{'id':_0x5a5422[_0xcde2('0xab')]['id']}})[_0xcde2('0x27')](handleEntityNotFound(_0x5de57e,null))['then'](function(_0x3dae1c){if(_0x3dae1c){return _0x3dae1c[_0xcde2('0xb9')](_0x5a5422[_0xcde2('0x38')][_0xcde2('0xaf')]);}})[_0xcde2('0x27')](respondWithStatusCode(_0x5de57e,null))[_0xcde2('0x32')](handleError(_0x5de57e,null));};exports[_0xcde2('0xba')]=function(_0x51a939,_0x259090){var _0x1dc03f=moment()[_0xcde2('0xbb')]()[_0xcde2('0x90')]();var _0x3d82c8=path[_0xcde2('0xbc')](config[_0xcde2('0xbd')],_0xcde2('0xbe'),'files','tmp');var _0x17a17b=path[_0xcde2('0xbc')](config[_0xcde2('0xbd')],'server','files','attachments');var _0x1d5873=path[_0xcde2('0xbc')](_0x3d82c8,_0x1dc03f);var _0x1868db=util[_0xcde2('0xb0')](_0xcde2('0xbf'),_0x51a939['params']['id'],_0x1dc03f);var _0x43f23e=path[_0xcde2('0xbc')](_0x3d82c8,_0x1868db);var _0x340df3=[];_0x340df3[_0xcde2('0x31')]({'model':db[_0xcde2('0x6a')],'as':_0xcde2('0x6a'),'attributes':['id','fullname'],'raw':!![]});_0x340df3[_0xcde2('0x31')]({'model':db['CmContact'],'as':_0xcde2('0xc0'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x53aff2=[{'model':db[_0xcde2('0xad')],'as':'Messages','attributes':['id','body',_0xcde2('0xc1'),'direction',_0xcde2('0xc2'),_0xcde2('0x79')],'include':_0x340df3}];_0x53aff2[_0xcde2('0x31')]({'model':db[_0xcde2('0xc3')],'as':_0xcde2('0xc4'),'attributes':['id',_0xcde2('0x29')]});_0x53aff2[_0xcde2('0x31')]({'model':db[_0xcde2('0x6a')],'as':'Owner','attributes':['id','fullname']});return db[_0xcde2('0x93')]['find']({'where':{'id':_0x51a939['params']['id']},'include':_0x53aff2})[_0xcde2('0x27')](handleEntityNotFound(_0x259090,null))[_0xcde2('0x27')](function(_0x12d060){if(_0x12d060){var _0x4be643=_0x12d060[_0xcde2('0xc5')]({'plain':!![]});fs[_0xcde2('0xc6')](_0x1d5873);var _0x453824={'format':'A4','border':'10px','header':{'height':_0xcde2('0xc7'),'contents':{'first':_0xcde2('0xc8')}},'footer':{'height':'30px','contents':{'default':util[_0xcde2('0xb0')](_0xcde2('0xc9'),util['format']('%s\x20#%d',_0xcde2('0xca'),_0x4be643['id']),moment()['format'](_0xcde2('0xcb'))[_0xcde2('0x90')]())}}};var _0x36a33a={'channel':'Sms','account':_0x4be643[_0xcde2('0xc4')]['name'],'agent':_0x4be643['Owner']?_0x4be643[_0xcde2('0xcc')][_0xcde2('0x2c')]:_0xcde2('0xcd'),'createdAt':moment(_0x4be643[_0xcde2('0xc1')])[_0xcde2('0xb0')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x4be643[_0xcde2('0xce')]?moment(_0x4be643[_0xcde2('0xcf')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xcde2('0x90')]():'','disposition':_0x4be643[_0xcde2('0xd0')],'messages':_(_0x4be643['Messages'])[_0xcde2('0x7e')]({'secret':![]})[_0xcde2('0x34')](function(_0x3d673e){return{'date':moment(_0x3d673e[_0xcde2('0xc1')])[_0xcde2('0xb0')](_0xcde2('0xb1'))[_0xcde2('0x90')](),'sender':_0x3d673e[_0xcde2('0xd1')]===_0xcde2('0xd2')?_0x3d673e[_0xcde2('0x6a')]?_0x3d673e['User'][_0xcde2('0x2c')]:_0xcde2('0xd3'):_0x3d673e[_0xcde2('0xc0')]['firstName']+(_0x3d673e['Contact'][_0xcde2('0xd4')]?'\x20'+_0x3d673e[_0xcde2('0xc0')]['lastName']:''),'body':_0x3d673e[_0xcde2('0x6d')],'direction':_0x3d673e['direction']===_0xcde2('0xd2')?'A':'C','secret':_0x3d673e['secret'],'read':_0x3d673e[_0xcde2('0x79')]};})[_0xcde2('0x5d')]()};return ejs[_0xcde2('0xd5')](path['join'](config[_0xcde2('0xbd')],_0xcde2('0xbe'),_0xcde2('0xd6'),_0xcde2('0xd7')),{'interaction':_0x36a33a})[_0xcde2('0x27')](function(_0x3591e6){return new BPromise(function(_0xc6ee3a,_0x2dc70e){pdf[_0xcde2('0xa9')](_0x3591e6,_0x453824)[_0xcde2('0xd8')](path['join'](_0x1d5873,'transcript-'+_0x4be643['id']+'-'+_0x1dc03f+_0xcde2('0xd9')),function(_0x22b5c1,_0x3a0dd8){if(_0x22b5c1)return _0x2dc70e(_0x22b5c1);_0xc6ee3a(_0x3a0dd8);});});})[_0xcde2('0x27')](function(){return new BPromise(function(_0x508e7b,_0x5196f9){zipdir(_0x1d5873,{'saveTo':_0x43f23e},function(_0x21da72,_0x4c68d2){if(_0x21da72)return _0x5196f9(_0x21da72);return _0x508e7b(_0x4c68d2);});})[_0xcde2('0x27')](function(){return new BPromise(function(_0x589af6,_0x1978d9){rimraf(_0x1d5873,function(_0x3b32d5){if(_0x3b32d5)_0x1978d9(_0x3b32d5);return _0x589af6();});});})['then'](function(){return _0x259090[_0xcde2('0xba')](_0x43f23e,_0x1868db,function(_0x258f98){if(_0x258f98){console[_0xcde2('0xda')](_0xcde2('0xdb'),_0x258f98);}else{fs[_0xcde2('0xdc')](_0x43f23e);}});});});}else{return _0x259090[_0xcde2('0x1d')](0xc8);}})[_0xcde2('0x32')](handleError(_0x259090,null));};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js
index 98618cd..daf268c 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 _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
+var _0x24ca=['remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','SmsInteraction','../../mysqldb','SmsMessage','save','update'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x24ca,0x1bc));var _0xa24c=function(_0xf34b0a,_0x11e116){_0xf34b0a=_0xf34b0a-0x0;var _0x5021e1=_0x24ca[_0xf34b0a];return _0x5021e1;};'use strict';var EventEmitter=require(_0xa24c('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xa24c('0x1')];var SmsMessage=require(_0xa24c('0x2'))['db'][_0xa24c('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa24c('0x4'),'afterUpdate':_0xa24c('0x5'),'afterDestroy':_0xa24c('0x6')};function emitEvent(_0x28aa2f){return function(_0xe76a30,_0x15a5cd,_0xf0511){_0xe76a30[_0xa24c('0x7')]({'attributes':['id'],'raw':!![]})[_0xa24c('0x8')](function(_0x257264){_0xe76a30[_0xa24c('0x9')]('Users',_0x257264[_0xa24c('0xa')](function(_0x3a5727){return{'id':_0x3a5727['id']};}));return SmsMessage[_0xa24c('0xb')]({'where':{'SmsInteractionId':_0xe76a30['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x399f32){_0xe76a30[_0xa24c('0x9')](_0xa24c('0xc'),_0x399f32[_0xa24c('0xd')]);SmsInteractionEvents[_0xa24c('0xe')](_0x28aa2f+':'+_0xe76a30['id'],_0xe76a30);SmsInteractionEvents[_0xa24c('0xe')](_0x28aa2f,_0xe76a30);_0xf0511(null);})[_0xa24c('0xf')](_0xf0511(null));};}for(var e in events){if(events[_0xa24c('0x10')](e)){var event=events[e];SmsInteraction[_0xa24c('0x11')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents;
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js
index 8f9015a..2037d80 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 _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
+var _0xa677=['SmsInteraction','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','exports','define'];(function(_0x375d74,_0x192737){var _0xee960b=function(_0x493c47){while(--_0x493c47){_0x375d74['push'](_0x375d74['shift']());}};_0xee960b(++_0x192737);}(_0xa677,0x1f1));var _0x7a67=function(_0x3598bb,_0x24befa){_0x3598bb=_0x3598bb-0x0;var _0x13c837=_0xa677[_0x3598bb];return _0x13c837;};'use strict';var _=require(_0x7a67('0x0'));var util=require(_0x7a67('0x1'));var logger=require(_0x7a67('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7a67('0x3'));var rp=require(_0x7a67('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a67('0x5'));var config=require(_0x7a67('0x6'));var attributes=require(_0x7a67('0x7'));module[_0x7a67('0x8')]=function(_0x1e98f2,_0x581061){return _0x1e98f2[_0x7a67('0x9')](_0x7a67('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5831a1,_0x2fafd6,_0x2d92fc){if(_0x5831a1['changed']('closed')){_0x5831a1[_0x7a67('0xb')]=moment()['format'](_0x7a67('0xc'));}_0x2d92fc(null,_0x5831a1);}}});};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js
index bedd866..92f2849 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 _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
+var _0x8b25=['register','info','SmsInteraction,\x20%s,\x20%s','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','limit','then','debug','find','where','addTags','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost','./smsInteraction.socket'];(function(_0xf8d324,_0x5d969b){var _0x1fb044=function(_0x772f2d){while(--_0x772f2d){_0xf8d324['push'](_0xf8d324['shift']());}};_0x1fb044(++_0x5d969b);}(_0x8b25,0x85));var _0x58b2=function(_0x5cd236,_0x152c6d){_0x5cd236=_0x5cd236-0x0;var _0x1274c8=_0x8b25[_0x5cd236];return _0x1274c8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x58b2('0x0'));var BPromise=require(_0x58b2('0x1'));var rs=require(_0x58b2('0x2'));var fs=require('fs');var Redis=require(_0x58b2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x58b2('0x4'));var logger=require(_0x58b2('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x58b2('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x58b2('0x7')]=_[_0x58b2('0x8')](config[_0x58b2('0x7')],{'host':_0x58b2('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x58b2('0x7')]));require(_0x58b2('0xa'))[_0x58b2('0xb')](socket);function respondWithRpcPromise(_0x30752a,_0x2c2e20,_0x146ec6){return new BPromise(function(_0x3248d8,_0x380124){return client['request'](_0x30752a,_0x146ec6)['then'](function(_0x164ac8){logger[_0x58b2('0xc')](_0x58b2('0xd'),_0x2c2e20,'request\x20sent');logger['debug'](_0x58b2('0xe'),_0x2c2e20,_0x58b2('0xf'),JSON[_0x58b2('0x10')](_0x164ac8));if(_0x164ac8[_0x58b2('0x11')]){if(_0x164ac8[_0x58b2('0x11')]['code']===0x1f4){logger[_0x58b2('0x11')](_0x58b2('0xd'),_0x2c2e20,_0x164ac8[_0x58b2('0x11')]['message']);return _0x380124(_0x164ac8['error'][_0x58b2('0x12')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x2c2e20,_0x164ac8['error'][_0x58b2('0x12')]);return _0x3248d8(_0x164ac8[_0x58b2('0x11')][_0x58b2('0x12')]);}else{logger[_0x58b2('0xc')]('SmsInteraction,\x20%s,\x20%s',_0x2c2e20,_0x58b2('0xf'));_0x3248d8(_0x164ac8[_0x58b2('0x13')][_0x58b2('0x12')]);}})[_0x58b2('0x14')](function(_0x117104){logger[_0x58b2('0x11')](_0x58b2('0xd'),_0x2c2e20,_0x117104);_0x380124(_0x117104);});});}exports[_0x58b2('0x15')]=function(_0x168696){var _0x57ed29=this;return new Promise(function(_0x46ab82,_0x23393d){return db[_0x58b2('0x16')]['update'](_0x168696[_0x58b2('0x17')],{'raw':_0x168696[_0x58b2('0x18')]?_0x168696[_0x58b2('0x18')][_0x58b2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x168696['options']?_0x168696[_0x58b2('0x18')]['where']||null:null,'attributes':_0x168696[_0x58b2('0x18')]?_0x168696[_0x58b2('0x18')]['attributes']||null:null,'limit':_0x168696['options']?_0x168696[_0x58b2('0x18')][_0x58b2('0x1a')]||null:null})[_0x58b2('0x1b')](function(_0x33e51d){logger['info'](_0x58b2('0x15'),_0x168696);logger[_0x58b2('0x1c')](_0x58b2('0x15'),_0x168696,JSON[_0x58b2('0x10')](_0x33e51d));_0x46ab82(_0x33e51d);})[_0x58b2('0x14')](function(_0x13af43){logger[_0x58b2('0x11')]('UpdateSmsInteraction',_0x13af43[_0x58b2('0x12')],_0x168696);_0x23393d(_0x57ed29[_0x58b2('0x11')](0x1f4,_0x13af43[_0x58b2('0x12')]));});});};exports['AddTagsToSmsInteraction']=function(_0x4b592b){return new Promise(function(_0x39cbcf,_0xee2d17){return db[_0x58b2('0x16')][_0x58b2('0x1d')]({'where':_0x4b592b[_0x58b2('0x18')]?_0x4b592b[_0x58b2('0x18')][_0x58b2('0x1e')]||null:null})[_0x58b2('0x1b')](function(_0x463ba3){if(_0x463ba3){return _0x463ba3[_0x58b2('0x1f')](_0x4b592b[_0x58b2('0x17')][_0x58b2('0x20')],_[_0x58b2('0x21')](_0x4b592b[_0x58b2('0x17')],['ids','id'])||{});}})[_0x58b2('0x22')](function(_0x260da8){logger[_0x58b2('0xc')]('AddTags',_0x4b592b);logger['debug']('AddTags',_0x4b592b,JSON[_0x58b2('0x10')](_0x260da8));_0x39cbcf(_0x260da8);})[_0x58b2('0x14')](function(_0x3b00be){logger[_0x58b2('0x11')](_0x58b2('0x23'),_0x3b00be['message'],_0x4b592b);_0xee2d17(_this[_0x58b2('0x11')](0x1f4,_0x3b00be['message']));});});};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js
index a2e2d2d..3628d5b 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 _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
+var _0x0b0e=['smsInteraction:','./smsInteraction.events','remove','emit','removeListener','register'];(function(_0x54e4c6,_0x2568d8){var _0x16e08d=function(_0x18642b){while(--_0x18642b){_0x54e4c6['push'](_0x54e4c6['shift']());}};_0x16e08d(++_0x2568d8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4843f9,_0x4af459){_0x4843f9=_0x4843f9-0x0;var _0x193c6a=_0x0b0e[_0x4843f9];return _0x193c6a;};'use strict';var SmsInteractionEvents=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(){SmsInteractionEvents[_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);SmsInteractionEvents['on'](_0x50be7f,_0x11effc);}};
\ No newline at end of file
diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js
index 56ac83e..665450b 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 _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
+var _0xb859=['accept','delete','destroy','exports','path','express','Router','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','sms','smsmessage:create','create','post','/:id/status','put','update'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xb859,0x17b));var _0x9b85=function(_0x1f8f66,_0x5dc25a){_0x1f8f66=_0x1f8f66-0x0;var _0x3b992d=_0xb859[_0x1f8f66];return _0x3b992d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9b85('0x0'));var timeout=require('connect-timeout');var express=require(_0x9b85('0x1'));var router=express[_0x9b85('0x2')]();var auth=require(_0x9b85('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9b85('0x4'));var controller=require(_0x9b85('0x5'));router[_0x9b85('0x6')]('/',auth[_0x9b85('0x7')](),controller[_0x9b85('0x8')]);router[_0x9b85('0x6')](_0x9b85('0x9'),auth[_0x9b85('0x7')](),controller[_0x9b85('0xa')]);router[_0x9b85('0x6')](_0x9b85('0xb'),auth['isAuthenticated'](),controller[_0x9b85('0xc')]);router['post']('/',auth[_0x9b85('0x7')](),interaction[_0x9b85('0xd')](_0x9b85('0xe'),_0x9b85('0xf')),controller[_0x9b85('0x10')]);router[_0x9b85('0x11')](_0x9b85('0x12'),controller['status']);router[_0x9b85('0x13')]('/:id',auth[_0x9b85('0x7')](),controller[_0x9b85('0x14')]);router[_0x9b85('0x13')]('/:id/accept',auth[_0x9b85('0x7')](),controller[_0x9b85('0x15')]);router[_0x9b85('0x13')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0x9b85('0x16')](_0x9b85('0xb'),auth[_0x9b85('0x7')](),controller[_0x9b85('0x17')]);module[_0x9b85('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js
index 72de9bb..6621dd9 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 _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
+var _0x1961=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','BOOLEAN'];(function(_0xf62e6c,_0x160938){var _0x14234f=function(_0x16fe1d){while(--_0x16fe1d){_0xf62e6c['push'](_0xf62e6c['shift']());}};_0x14234f(++_0x160938);}(_0x1961,0x10c));var _0x1196=function(_0x28069a,_0x1113d8){_0x28069a=_0x28069a-0x0;var _0x41adc6=_0x1961[_0x28069a];return _0x41adc6;};'use strict';var Sequelize=require(_0x1196('0x0'));module[_0x1196('0x1')]={'body':{'type':Sequelize[_0x1196('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1196('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1196('0x4')]('in',_0x1196('0x5')),'defaultValue':_0x1196('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x1196('0x6')]},'readAt':{'type':Sequelize[_0x1196('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js
index e3ee07e..bd83398 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 _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
+var _0x135b=['format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','message','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','SmsAccountId','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','Status','infobip','results','DELIVERED','SmsAccount,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','lodash','squel','crypto','jsforce','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','redis','defaults','localhost','socket.io-emitter','register','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','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','destroy','name','send','index','map','SmsMessage','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','sms-interactions','accept','sms'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x135b,0xaf));var _0xb135=function(_0x5285d0,_0x3d424c){_0x5285d0=_0x5285d0-0x0;var _0x4dd0a2=_0x135b[_0x5285d0];return _0x4dd0a2;};'use strict';var pdf=require(_0xb135('0x0'));var emlformat=require(_0xb135('0x1'));var rimraf=require(_0xb135('0x2'));var zipdir=require(_0xb135('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb135('0x4'));var moment=require(_0xb135('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb135('0x6'));var util=require(_0xb135('0x7'));var path=require(_0xb135('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb135('0x9'));var squel=require(_0xb135('0xa'));var crypto=require(_0xb135('0xb'));var jsforce=require(_0xb135('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb135('0xd'));var querystring=require(_0xb135('0xe'));var Papa=require(_0xb135('0xf'));var Redis=require(_0xb135('0x10'));var authService=require(_0xb135('0x11'));var qs=require(_0xb135('0x12'));var as=require(_0xb135('0x13'));var hardwareService=require(_0xb135('0x14'));var logger=require(_0xb135('0x15'))(_0xb135('0x16'));var utils=require(_0xb135('0x17'));var config=require(_0xb135('0x18'));var db=require(_0xb135('0x19'))['db'];config[_0xb135('0x1a')]=_[_0xb135('0x1b')](config[_0xb135('0x1a')],{'host':_0xb135('0x1c'),'port':0x18eb});var socket=require(_0xb135('0x1d'))(new Redis(config[_0xb135('0x1a')]));require('./smsMessage.socket')[_0xb135('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb135('0x1f')][_0xb135('0x20')]({'port':0x232c});var client9002=jayson[_0xb135('0x1f')][_0xb135('0x20')]({'port':0x232a});function checkPasswordPattern(_0x37f3f2,_0x28b9d3,_0x385704){if(_0x385704){var _0x35950d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x35950d[_0xb135('0x21')](_0x28b9d3)){return _0x37f3f2;}else{throw new db['Sequelize'][(_0xb135('0x22'))](_0xb135('0x23'));}}else{return _0x37f3f2;}}function respondWithRpcPromise(_0x45c4ae,_0x51b18f,_0x5d9010,_0x2975bf){return new BPromise(function(_0x47d9ef,_0x9530ac){var _0x282dee=_0x2975bf||client;return _0x282dee[_0xb135('0x24')](_0x45c4ae,_0x5d9010)[_0xb135('0x25')](function(_0xc8a99){logger[_0xb135('0x26')](_0xb135('0x27'),_0x51b18f,_0xb135('0x28'));logger[_0xb135('0x29')](_0xb135('0x2a'),_0x51b18f,'request\x20sent',JSON[_0xb135('0x2b')](_0xc8a99));if(_0xc8a99['error']){if(_0xc8a99[_0xb135('0x2c')]['code']===0x1f4){logger[_0xb135('0x2c')]('SmsMessage,\x20%s,\x20%s',_0x51b18f,_0xc8a99['error']['message']);return _0x9530ac(_0xc8a99['error']['message']);}logger['error'](_0xb135('0x27'),_0x51b18f,_0xc8a99[_0xb135('0x2c')]['message']);return _0x47d9ef(_0xc8a99[_0xb135('0x2c')]['message']);}else{logger['info'](_0xb135('0x27'),_0x51b18f,'request\x20sent');_0x47d9ef(_0xc8a99['result']['message']);}})['catch'](function(_0x35cd29){logger[_0xb135('0x2c')](_0xb135('0x27'),_0x51b18f,_0x35cd29);_0x9530ac(_0x35cd29);});});}function respondWithStatusCode(_0x2d1389,_0x11d086){_0x11d086=_0x11d086||0xcc;return function(_0x1da1f3){if(_0x1da1f3){return _0x2d1389[_0xb135('0x2d')](_0x11d086);}return _0x2d1389[_0xb135('0x2e')](_0x11d086)[_0xb135('0x2f')]();};}function respondWithResult(_0x565e84,_0x5c8de4){_0x5c8de4=_0x5c8de4||0xc8;return function(_0x16f4f6){if(_0x16f4f6){return _0x565e84[_0xb135('0x2e')](_0x5c8de4)[_0xb135('0x30')](_0x16f4f6);}};}function respondWithFilteredResult(_0x1d33cb,_0x4d3ebd){return function(_0x322ed1){if(_0x322ed1){var _0x2d521c=_0x322ed1[_0xb135('0x31')],_0x30fc67=_0x4d3ebd[_0xb135('0x32')],_0x4f88c1=_0x4d3ebd['offset']+_0x4d3ebd['limit'],_0x28eed8;if(_0x4f88c1>=_0x2d521c){_0x4f88c1=_0x2d521c;_0x28eed8=0xc8;}else{_0x28eed8=0xce;}_0x1d33cb[_0xb135('0x2e')](_0x28eed8);return _0x1d33cb[_0xb135('0x33')](_0xb135('0x34'),_0x30fc67+'-'+_0x4f88c1+'/'+_0x2d521c)[_0xb135('0x30')](_0x322ed1);}return null;};}function patchUpdates(_0x576657){return function(_0xdaebcb){try{jsonpatch[_0xb135('0x35')](_0xdaebcb,_0x576657,!![]);}catch(_0x4470ee){return BPromise[_0xb135('0x36')](_0x4470ee);}return _0xdaebcb['save']();};}function saveUpdates(_0x2a0692,_0x28bfe9){return function(_0x292376){if(_0x292376){return _0x292376[_0xb135('0x37')](_0x2a0692)['then'](function(_0x4ff221){return _0x4ff221;});}return null;};}function removeEntity(_0xd467f9,_0x211aac){return function(_0x2559b8){if(_0x2559b8){return _0x2559b8[_0xb135('0x38')]()[_0xb135('0x25')](function(){_0xd467f9[_0xb135('0x2e')](0xcc)[_0xb135('0x2f')]();});}};}function handleEntityNotFound(_0x177d13,_0x4c8b24){return function(_0x5d8256){if(!_0x5d8256){_0x177d13[_0xb135('0x2d')](0x194);}return _0x5d8256;};}function handleError(_0x1e878c,_0x49feff){_0x49feff=_0x49feff||0x1f4;return function(_0x20d2de){logger[_0xb135('0x2c')](_0x20d2de['stack']);if(_0x20d2de[_0xb135('0x39')]){delete _0x20d2de[_0xb135('0x39')];}_0x1e878c[_0xb135('0x2e')](_0x49feff)[_0xb135('0x3a')](_0x20d2de);};}exports[_0xb135('0x3b')]=function(_0x21462a,_0x4cf68f){var _0x59bfc5={},_0x477a5a={},_0xce7d76={'count':0x0,'rows':[]};var _0x1c6e05=_[_0xb135('0x3c')](db[_0xb135('0x3d')][_0xb135('0x3e')],function(_0x305f8d){return{'name':_0x305f8d[_0xb135('0x3f')],'type':_0x305f8d['type'][_0xb135('0x40')]};});_0x477a5a['model']=_[_0xb135('0x3c')](_0x1c6e05,_0xb135('0x39'));_0x477a5a[_0xb135('0x41')]=_[_0xb135('0x42')](_0x21462a[_0xb135('0x41')]);_0x477a5a[_0xb135('0x43')]=_['intersection'](_0x477a5a[_0xb135('0x44')],_0x477a5a[_0xb135('0x41')]);_0x59bfc5[_0xb135('0x45')]=_[_0xb135('0x46')](_0x477a5a[_0xb135('0x44')],qs[_0xb135('0x47')](_0x21462a[_0xb135('0x41')][_0xb135('0x47')]));_0x59bfc5[_0xb135('0x45')]=_0x59bfc5['attributes'][_0xb135('0x48')]?_0x59bfc5['attributes']:_0x477a5a[_0xb135('0x44')];if(!_0x21462a[_0xb135('0x41')][_0xb135('0x49')]('nolimit')){_0x59bfc5[_0xb135('0x4a')]=qs[_0xb135('0x4a')](_0x21462a['query'][_0xb135('0x4a')]);_0x59bfc5[_0xb135('0x32')]=qs[_0xb135('0x32')](_0x21462a['query']['offset']);}_0x59bfc5['order']=qs[_0xb135('0x4b')](_0x21462a[_0xb135('0x41')][_0xb135('0x4b')]);_0x59bfc5[_0xb135('0x4c')]=qs[_0xb135('0x43')](_[_0xb135('0x4d')](_0x21462a[_0xb135('0x41')],_0x477a5a[_0xb135('0x43')]),_0x1c6e05);if(_0x21462a['query'][_0xb135('0x4e')]){_0x59bfc5[_0xb135('0x4c')]=_[_0xb135('0x4f')](_0x59bfc5[_0xb135('0x4c')],{'$or':_['map'](_0x1c6e05,function(_0x2d3928){if(_0x2d3928[_0xb135('0x50')]!=='VIRTUAL'){var _0x57c31c={};_0x57c31c[_0x2d3928[_0xb135('0x39')]]={'$like':'%'+_0x21462a[_0xb135('0x41')][_0xb135('0x4e')]+'%'};return _0x57c31c;}})});}_0x59bfc5=_[_0xb135('0x4f')]({},_0x59bfc5,_0x21462a[_0xb135('0x51')]);var _0xcf1691={'where':_0x59bfc5[_0xb135('0x4c')]};return db[_0xb135('0x3d')][_0xb135('0x31')](_0xcf1691)[_0xb135('0x25')](function(_0x3b6a1d){_0xce7d76[_0xb135('0x31')]=_0x3b6a1d;if(_0x21462a[_0xb135('0x41')][_0xb135('0x52')]){_0x59bfc5[_0xb135('0x53')]=[{'all':!![]}];}return db[_0xb135('0x3d')][_0xb135('0x54')](_0x59bfc5);})[_0xb135('0x25')](function(_0x271bfc){_0xce7d76[_0xb135('0x55')]=_0x271bfc;return _0xce7d76;})[_0xb135('0x25')](respondWithFilteredResult(_0x4cf68f,_0x59bfc5))[_0xb135('0x56')](handleError(_0x4cf68f,null));};exports['show']=function(_0x3b2105,_0x1ebacc){var _0x13e657={'raw':!![],'where':{'id':_0x3b2105['params']['id']}},_0x4dce80={};_0x4dce80[_0xb135('0x44')]=_[_0xb135('0x42')](db['SmsMessage'][_0xb135('0x3e')]);_0x4dce80[_0xb135('0x41')]=_[_0xb135('0x42')](_0x3b2105[_0xb135('0x41')]);_0x4dce80[_0xb135('0x43')]=_[_0xb135('0x46')](_0x4dce80[_0xb135('0x44')],_0x4dce80['query']);_0x13e657[_0xb135('0x45')]=_[_0xb135('0x46')](_0x4dce80[_0xb135('0x44')],qs[_0xb135('0x47')](_0x3b2105['query'][_0xb135('0x47')]));_0x13e657[_0xb135('0x45')]=_0x13e657[_0xb135('0x45')][_0xb135('0x48')]?_0x13e657[_0xb135('0x45')]:_0x4dce80[_0xb135('0x44')];if(_0x3b2105[_0xb135('0x41')]['includeAll']){_0x13e657[_0xb135('0x53')]=[{'all':!![]}];}_0x13e657=_[_0xb135('0x4f')]({},_0x13e657,_0x3b2105[_0xb135('0x51')]);return db[_0xb135('0x3d')][_0xb135('0x57')](_0x13e657)[_0xb135('0x25')](handleEntityNotFound(_0x1ebacc,null))[_0xb135('0x25')](respondWithResult(_0x1ebacc,null))[_0xb135('0x56')](handleError(_0x1ebacc,null));};exports[_0xb135('0x58')]=function(_0x1fe5c7,_0x2f7647){return db[_0xb135('0x3d')][_0xb135('0x58')](_0x1fe5c7[_0xb135('0x59')],{})[_0xb135('0x25')](respondWithResult(_0x2f7647,0xc9))[_0xb135('0x56')](handleError(_0x2f7647,null));};exports[_0xb135('0x37')]=function(_0x595107,_0x49c5b6){if(_0x595107[_0xb135('0x59')]['id']){delete _0x595107[_0xb135('0x59')]['id'];}return db[_0xb135('0x3d')][_0xb135('0x57')]({'where':{'id':_0x595107['params']['id']}})[_0xb135('0x25')](handleEntityNotFound(_0x49c5b6,null))[_0xb135('0x25')](saveUpdates(_0x595107[_0xb135('0x59')],null))[_0xb135('0x25')](respondWithResult(_0x49c5b6,null))[_0xb135('0x56')](handleError(_0x49c5b6,null));};exports['destroy']=function(_0x4526d5,_0xb66fe5){return db[_0xb135('0x3d')][_0xb135('0x57')]({'where':{'id':_0x4526d5[_0xb135('0x5a')]['id']}})['then'](handleEntityNotFound(_0xb66fe5,null))[_0xb135('0x25')](removeEntity(_0xb66fe5,null))[_0xb135('0x56')](handleError(_0xb66fe5,null));};exports[_0xb135('0x5b')]=function(_0x15f7e7,_0x3d584a){return db[_0xb135('0x3d')][_0xb135('0x5b')]()[_0xb135('0x25')](respondWithResult(_0x3d584a,null))['catch'](handleError(_0x3d584a,null));};var interaction_log=require(_0xb135('0x15'))(_0xb135('0x5c'));exports[_0xb135('0x5d')]=function(_0x194330,_0x3e5ff2,_0x48a360){var _0x3b09cd={'channel':_0xb135('0x5e')};if(_0x194330[_0xb135('0x59')]['id']){delete _0x194330[_0xb135('0x59')]['id'];}_0x194330[_0xb135('0x59')]['read']=!![];_0x194330[_0xb135('0x59')]['readAt']=moment()[_0xb135('0x5f')](_0xb135('0x60'));_0x194330[_0xb135('0x59')][_0xb135('0x61')]=_0x194330[_0xb135('0x59')]['UserId']||_0x194330[_0xb135('0x62')]['id'];return db[_0xb135('0x3d')][_0xb135('0x57')]({'where':{'id':_0x194330[_0xb135('0x5a')]['id'],'UserId':null},'include':[{'model':db[_0xb135('0x63')],'as':'Contact'}]})[_0xb135('0x25')](handleEntityNotFound(_0x3e5ff2,null))[_0xb135('0x25')](saveUpdates(_0x194330['body'],null))[_0xb135('0x25')](function(_0x1d86bf){if(_0x1d86bf){_0x3b09cd[_0xb135('0x64')]=_0x1d86bf[_0xb135('0x65')]({'plain':!![]});return db[_0xb135('0x66')][_0xb135('0x57')]({'where':{'id':_0x1d86bf[_0xb135('0x67')]}});}return null;})[_0xb135('0x25')](handleEntityNotFound(_0x3e5ff2,null))['then'](function(_0x4404f3){if(_0x4404f3){return _0x4404f3[_0xb135('0x37')]({'UserId':_0x194330[_0xb135('0x59')]['UserId'],'read1stAt':_[_0xb135('0x68')](_0x4404f3[_0xb135('0x69')])?moment()[_0xb135('0x5f')](_0xb135('0x60')):undefined});}return null;})[_0xb135('0x25')](function(_0x55045c){if(_0x55045c){_0x3b09cd[_0xb135('0x6a')]=_0x55045c[_0xb135('0x65')]({'plain':!![]});interaction_log[_0xb135('0x26')](_0xb135('0x6b'),_0x194330[_0xb135('0x62')]['id'],_0x194330[_0xb135('0x62')][_0xb135('0x39')],_0x194330[_0xb135('0x62')][_0xb135('0x6c')],_0x3b09cd[_0xb135('0x6a')]['id'],_0x194330[_0xb135('0x59')]?JSON[_0xb135('0x2b')](_0x194330[_0xb135('0x59')]):_0xb135('0x6d'));return respondWithRpcPromise('AcceptMessage',_0xb135('0x6e'),_0x3b09cd);}return null;})[_0xb135('0x25')](function(_0x1360ff){if(_0x1360ff){if(_0x194330['body'][_0xb135('0x6f')]){_0x3b09cd[_0xb135('0x64')][_0xb135('0x70')]=util['format'](_0xb135('0x71'),_0x194330['user'][_0xb135('0x39')]);_0x3b09cd[_0xb135('0x64')]['channel']=_0x3b09cd[_0xb135('0x72')];_0x3b09cd[_0xb135('0x64')][_0xb135('0x73')]=_0xb135('0x5d');return respondWithRpcPromise('EventManager',_0xb135('0x74'),{'event':_0xb135('0x75'),'message':_0x3b09cd[_0xb135('0x64')]},client9002)['then'](function(){return _0x3b09cd;});}return _0x3b09cd;}return null;})['then'](respondWithResult(_0x3e5ff2,null))[_0xb135('0x56')](handleError(_0x3e5ff2,null));};var interaction_log=require(_0xb135('0x15'))(_0xb135('0x5c'));exports[_0xb135('0x36')]=function(_0x2ff001,_0x344574,_0x22d256){var _0x3faa95={'agent':{},'channel':_0xb135('0x5e')};if(_0x2ff001[_0xb135('0x59')]['id']){delete _0x2ff001[_0xb135('0x59')]['id'];}_0x2ff001[_0xb135('0x59')][_0xb135('0x61')]=_0x2ff001[_0xb135('0x59')][_0xb135('0x61')]||_0x2ff001[_0xb135('0x62')]['id'];_0x3faa95['agent']['id']=_0x2ff001[_0xb135('0x59')][_0xb135('0x61')];return db[_0xb135('0x3d')][_0xb135('0x57')]({'where':{'id':_0x2ff001[_0xb135('0x5a')]['id'],'UserId':null}})[_0xb135('0x25')](handleEntityNotFound(_0x344574,null))[_0xb135('0x25')](function(_0x17bb99){if(_0x17bb99){_0x3faa95['message']=_0x17bb99[_0xb135('0x65')]({'plain':!![]});return db[_0xb135('0x66')][_0xb135('0x57')]({'where':{'id':_0x17bb99['SmsInteractionId']}});}return null;})[_0xb135('0x25')](handleEntityNotFound(_0x344574,null))[_0xb135('0x25')](function(_0x53f6cf){if(_0x53f6cf){_0x3faa95[_0xb135('0x6a')]=_0x53f6cf['get']({'plain':!![]});interaction_log[_0xb135('0x26')](_0xb135('0x76'),_0x2ff001['user']['id'],_0x2ff001[_0xb135('0x62')][_0xb135('0x39')],_0x2ff001[_0xb135('0x62')]['role'],_0x3faa95['interaction']['id'],_0x2ff001[_0xb135('0x59')]?JSON[_0xb135('0x2b')](_0x2ff001[_0xb135('0x59')]):_0xb135('0x6d'));return respondWithRpcPromise(_0xb135('0x77'),_0xb135('0x78'),_0x3faa95);}return null;})['then'](function(_0x1e603f){if(_0x1e603f){_0x1e603f[_0xb135('0x64')][_0xb135('0x70')]=util[_0xb135('0x5f')](_0xb135('0x71'),_0x2ff001[_0xb135('0x62')][_0xb135('0x39')]);_0x1e603f['message'][_0xb135('0x72')]=_0x3faa95[_0xb135('0x72')];_0x1e603f[_0xb135('0x64')][_0xb135('0x73')]=_0xb135('0x36');respondWithRpcPromise(_0xb135('0x74'),_0xb135('0x74'),{'event':_0xb135('0x79'),'message':_0x1e603f[_0xb135('0x64')]},client9002);return _0x3faa95;}return null;})[_0xb135('0x25')](respondWithResult(_0x344574,null))[_0xb135('0x56')](handleError(_0x344574,null));};exports['status']=function(_0x35a55d,_0x2e10d2,_0x2348fb){if(_0x35a55d['body']['id']){delete _0x35a55d['body']['id'];}var _0x51806a;return db[_0xb135('0x3d')]['find']({'where':{'id':_0x35a55d[_0xb135('0x5a')]['id']}})[_0xb135('0x25')](handleEntityNotFound(_0x2e10d2,null))[_0xb135('0x25')](function(_0x50d57c){if(_0x50d57c){_0x51806a=_0x50d57c;return db['SmsAccount'][_0xb135('0x57')]({'where':{'id':_0x50d57c[_0xb135('0x7a')]}});}})['then'](handleEntityNotFound(_0x2e10d2,null))[_0xb135('0x25')](function(_0x2824bc){if(_0x2824bc){logger[_0xb135('0x29')](_0xb135('0x2a'),_0xb135('0x2e'),'received\x20delivery\x20report\x20from',_0x2824bc[_0xb135('0x50')],util[_0xb135('0x7b')](_0x35a55d['body'],{'showHidden':![],'depth':null}));switch(_0x2824bc['type']){case _0xb135('0x7c'):if(_0x35a55d['body'][_0xb135('0x7d')]&&_0x35a55d[_0xb135('0x59')][_0xb135('0x7d')]===_0x51806a[_0xb135('0x7e')]){return _0x51806a[_0xb135('0x37')]({'read':!![]});}else{logger[_0xb135('0x2c')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb135('0x2e'),'twilio',util[_0xb135('0x7b')](_0x35a55d[_0xb135('0x59')],{'showHidden':![],'depth':null}));}break;case _0xb135('0x7f'):if(_0x35a55d[_0xb135('0x59')]['MessageUUID']&&_0x35a55d[_0xb135('0x59')][_0xb135('0x80')]===_0x51806a[_0xb135('0x7e')]&&_[_0xb135('0x81')](['sent','delivered'],_0x35a55d[_0xb135('0x59')][_0xb135('0x82')])>=0x0){return _0x51806a[_0xb135('0x37')]({'read':!![]});}else{logger[_0xb135('0x2c')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','plivio',util[_0xb135('0x7b')](_0x35a55d[_0xb135('0x59')],{'showHidden':![],'depth':null}));}break;case _0xb135('0x83'):var _0x1de3f8=_0x35a55d[_0xb135('0x59')][_0xb135('0x84')][0x0];if(_0x1de3f8['status']['groupName']===_0xb135('0x85')){return _0x51806a[_0xb135('0x37')]({'read':!![]});}else{logger[_0xb135('0x2c')](_0xb135('0x86'),_0xb135('0x2e'),'infobip',util[_0xb135('0x7b')](_0x35a55d['body'],{'showHidden':![],'depth':null}));}break;}return _0x51806a;}})[_0xb135('0x25')](respondWithResult(_0x2e10d2,null))[_0xb135('0x56')](handleError(_0x2e10d2,null));};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js
index 4c54ea1..cabe717 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 _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
+var _0xc95b=['SmsMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0xf2f332,_0x299fbf){var _0x56cce3=function(_0x5f37e0){while(--_0x5f37e0){_0xf2f332['push'](_0xf2f332['shift']());}};_0x56cce3(++_0x299fbf);}(_0xc95b,0x178));var _0xbc95=function(_0x67db95,_0x2c298d){_0x67db95=_0x67db95-0x0;var _0x3a9a2b=_0xc95b[_0x67db95];return _0x3a9a2b;};'use strict';var EventEmitter=require(_0xbc95('0x0'));var SmsMessage=require(_0xbc95('0x1'))['db'][_0xbc95('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xbc95('0x3')](0x0);var events={'afterCreate':_0xbc95('0x4'),'afterUpdate':'update','afterDestroy':_0xbc95('0x5')};function emitEvent(_0x581dc0){return function(_0x2759bd,_0x1d9fde,_0x392d6c){SmsMessageEvents[_0xbc95('0x6')](_0x581dc0+':'+_0x2759bd['id'],_0x2759bd);SmsMessageEvents[_0xbc95('0x6')](_0x581dc0,_0x2759bd);_0x392d6c(null);};}for(var e in events){if(events[_0xbc95('0x7')](e)){var event=events[e];SmsMessage[_0xbc95('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents;
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js
index a974569..4d505f7 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 _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
+var _0x9ee9=['/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','Basic\x20%s','http_code','data','queued_count','clickSend','plivo','remote','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','text','keys','length','createHash','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','Token\x20not\x20received','finally','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','findOne','SmsInteractionId','then','update','catch','SmsAccount','find','SmsAccountId','type','twilio','phone','accountSid','authToken','messages','create','/api/sms/messages/'];(function(_0x28cb42,_0x25400b){var _0xeaf3ee=function(_0x50282d){while(--_0x50282d){_0x28cb42['push'](_0x28cb42['shift']());}};_0xeaf3ee(++_0x25400b);}(_0x9ee9,0xcc));var _0x99ee=function(_0x25b9bf,_0x1aa452){_0x25b9bf=_0x25b9bf-0x0;var _0x381b87=_0x9ee9[_0x25b9bf];return _0x381b87;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x99ee('0x0'))(_0x99ee('0x1'));var moment=require(_0x99ee('0x2'));var BPromise=require(_0x99ee('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99ee('0x4'));var rimraf=require(_0x99ee('0x5'));var config=require('../../config/environment');var attributes=require(_0x99ee('0x6'));module[_0x99ee('0x7')]=function(_0x1ff1f8,_0x4ae714){return _0x1ff1f8[_0x99ee('0x8')](_0x99ee('0x9'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x99ee('0xa')]},{'name':_0x99ee('0xb'),'fields':[_0x99ee('0xc')],'type':_0x99ee('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x41cb9e,_0x453156,_0x39182a){var _0xb6fc2f=_0x1ff1f8['models'];var _0x2cfed9=_0x41cb9e['get']({'plain':!![]});if(_0x2cfed9[_0x99ee('0xe')][_0x99ee('0xf')]()==='in'||_0x2cfed9[_0x99ee('0xe')][_0x99ee('0xf')]()===_0x99ee('0x10')&&!_0x2cfed9[_0x99ee('0x11')]&&!_[_0x99ee('0x12')](_0x2cfed9[_0x99ee('0x13')])){_0xb6fc2f['SmsInteraction'][_0x99ee('0x14')]({'where':{'id':_0x2cfed9[_0x99ee('0x15')]}})[_0x99ee('0x16')](function(_0x2226a2){if(_0x2226a2){_0x2226a2[_0x99ee('0x17')]({'lastMsgAt':_0x2cfed9['createdAt'],'lastMsgDirection':_0x2cfed9[_0x99ee('0xe')][_0x99ee('0xf')]()});}})[_0x99ee('0x18')](function(_0x2335d3){console['error'](_0x2335d3);});}if(_0x2cfed9[_0x99ee('0xe')]===_0x99ee('0x10')&&!_0x2cfed9[_0x99ee('0x11')]){var _0x5d295b;_0xb6fc2f[_0x99ee('0x19')][_0x99ee('0x1a')]({'where':{'id':_0x2cfed9[_0x99ee('0x1b')]},'raw':!![]})[_0x99ee('0x16')](function(_0xc22909){_0x5d295b=_0xc22909;if(_0x5d295b&&_0x5d295b[_0x99ee('0x1c')]){switch(_0x5d295b[_0x99ee('0x1c')]){case'twilio':var _0x535301=require(_0x99ee('0x1d'));if(_0x5d295b['accountSid']&&_0x5d295b['authToken']&&_0x5d295b[_0x99ee('0x1e')]){var _0x283aff=new _0x535301(_0x5d295b[_0x99ee('0x1f')],_0x5d295b[_0x99ee('0x20')]);_0x283aff[_0x99ee('0x21')][_0x99ee('0x22')]({'body':_0x2cfed9[_0x99ee('0xc')],'to':_0x2cfed9[_0x99ee('0x1e')],'from':_0x5d295b['phone'],'statusCallback':_0x5d295b['remote']+_0x99ee('0x23')+_0x2cfed9['id']+_0x99ee('0x24')+_0x5d295b[_0x99ee('0x25')]})[_0x99ee('0x16')](function(_0x567623){if(_0x567623[_0x99ee('0x26')]){return _0x41cb9e[_0x99ee('0x17')]({'messageId':_0x567623[_0x99ee('0x26')]});}})[_0x99ee('0x18')](function(_0x4c2b15){logger[_0x99ee('0x27')](_0x99ee('0x28'),_0x99ee('0x29'),_0x99ee('0x1d'),util['inspect'](_0x4c2b15,{'showHidden':![],'depth':null}));});}else{logger[_0x99ee('0x27')](_0x99ee('0x28'),_0x99ee('0x29'),_0x99ee('0x1d'),_0x99ee('0x2a'));}break;case _0x99ee('0x2b'):var _0x435ed5=_0x99ee('0x2c');if(_0x5d295b[_0x99ee('0x2d')]&&_0x5d295b[_0x99ee('0x2e')]){var _0x3af0d7={'recipient':[_0x2cfed9[_0x99ee('0x1e')]],'message':_0x2cfed9[_0x99ee('0xc')],'message_type':_0x5d295b['smsMethod']};if(_0x5d295b[_0x99ee('0x2f')]&&_0x5d295b[_0x99ee('0x2f')]!=='SI'){_0x3af0d7['sender']=_0x5d295b[_0x99ee('0x1e')];}var _0x29349a={'url':_0x435ed5+_0x99ee('0x30')+_0x5d295b[_0x99ee('0x2d')]+_0x99ee('0x31')+_0x5d295b[_0x99ee('0x2e')],'method':_0x99ee('0x32')};rp(_0x29349a)[_0x99ee('0x16')](function(_0x26b9a5){var _0x58f0bf=_0x26b9a5[_0x99ee('0x33')](';');var _0xbd391c={'user_key':_0x58f0bf[0x0],'session_key':_0x58f0bf[0x1]};_0x29349a={'url':_0x435ed5+_0x99ee('0x34'),'method':_0x99ee('0x35'),'headers':{'user_key':_0xbd391c[_0x99ee('0x36')],'Session_key':_0xbd391c[_0x99ee('0x37')]},'json':!![],'body':_0x3af0d7};return rp(_0x29349a);})['then'](function(_0x2d2894){if(_0x2d2894[_0x99ee('0x38')]>=0x1){var _0x428ca2={'messageId':_0x2d2894[_0x99ee('0x39')]};if(_0x5d295b['smsMethod']!=='GP'||!_0x5d295b[_0x99ee('0x3a')]){_0x428ca2[_0x99ee('0x3b')]=!![];}return _0x41cb9e[_0x99ee('0x17')](_0x428ca2);}else{return logger['error'](_0x99ee('0x28'),_0x99ee('0x29'),_0x99ee('0x2b'),util[_0x99ee('0x3c')](_0x2d2894,{'showHidden':![],'depth':null}));}})['catch'](function(_0x936723){return logger[_0x99ee('0x27')](_0x99ee('0x28'),'afterCreate','skebby',util[_0x99ee('0x3c')](_0x936723,{'showHidden':![],'depth':null}));});}else{logger[_0x99ee('0x27')](_0x99ee('0x28'),'afterCreate','skebby',_0x99ee('0x3d'));}break;case _0x99ee('0x3e'):if(_0x5d295b[_0x99ee('0x20')]){var _0x185027={'recipient':_0x2cfed9[_0x99ee('0x1e')],'message':_0x2cfed9[_0x99ee('0xc')],'sender':_0x5d295b['senderString']||_0x5d295b[_0x99ee('0x1e')],'authorization':_0x5d295b[_0x99ee('0x20')]};var _0x453156={'method':_0x99ee('0x35'),'uri':_0x99ee('0x3f'),'body':_0x185027,'json':!![]};rp(_0x453156)['then'](function(_0xb2834e){var _0x1f03f2={'messageId':_0xb2834e[_0x99ee('0x40')]};if(!_0x5d295b[_0x99ee('0x3a')]){_0x1f03f2[_0x99ee('0x3b')]=!![];}return _0x41cb9e[_0x99ee('0x17')](_0x1f03f2);})[_0x99ee('0x18')](function(_0x2ad495){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x99ee('0x29'),_0x99ee('0x3e'),util['inspect'](_0x2ad495,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x99ee('0x28'),_0x99ee('0x29'),_0x99ee('0x3e'),_0x99ee('0x41'));}break;case _0x99ee('0x42'):if(_0x5d295b[_0x99ee('0x2d')]&&_0x5d295b['password']){var _0x185027={'messages':[{'source':_0x99ee('0x43'),'to':_0x2cfed9['phone'],'body':_0x2cfed9['body'],'from':_0x5d295b[_0x99ee('0x44')]||_0x5d295b[_0x99ee('0x1e')]}]};var _0xae1b9e=util[_0x99ee('0x45')](_0x99ee('0x46'),_0x5d295b['username'],_0x5d295b[_0x99ee('0x2e')]);var _0x453156={'method':_0x99ee('0x35'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x185027,'headers':{'Authorization':util['format'](_0x99ee('0x47'),new Buffer(_0xae1b9e)['toString']('base64'))},'json':!![]};rp(_0x453156)[_0x99ee('0x16')](function(_0x4ad738){if(_0x4ad738[_0x99ee('0x48')]>=0xc8&&_0x4ad738[_0x99ee('0x48')]<=0xce){if(_0x4ad738['data']&&_0x4ad738[_0x99ee('0x49')][_0x99ee('0x4a')]>0x0){var _0x22e07e=_['head'](_0x4ad738[_0x99ee('0x49')][_0x99ee('0x21')]);var _0x2a6a45={'messageId':_0x22e07e['message_id']};if(!_0x5d295b['deliveryReport']){_0x2a6a45[_0x99ee('0x3b')]=!![];}return _0x41cb9e[_0x99ee('0x17')](_0x2a6a45);}else{logger[_0x99ee('0x27')](_0x99ee('0x28'),_0x99ee('0x29'),_0x99ee('0x4b'),util[_0x99ee('0x3c')](_0x4ad738,{'showHidden':![],'depth':null}));}}else{logger[_0x99ee('0x27')](_0x99ee('0x28'),_0x99ee('0x29'),_0x99ee('0x4b'),util[_0x99ee('0x3c')](_0x4ad738,{'showHidden':![],'depth':null}));}})[_0x99ee('0x18')](function(_0x12adcd){logger['error'](_0x99ee('0x28'),_0x99ee('0x29'),'clickSend',util[_0x99ee('0x3c')](_0x12adcd,{'showHidden':![],'depth':null}));});}else{logger[_0x99ee('0x27')](_0x99ee('0x28'),_0x99ee('0x29'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0x99ee('0x4c'):if(_0x5d295b['authId']&&_0x5d295b['authToken']){var _0x185027={'dst':_0x2cfed9[_0x99ee('0x1e')],'text':_0x2cfed9[_0x99ee('0xc')],'src':_0x5d295b[_0x99ee('0x44')]||_0x5d295b[_0x99ee('0x1e')],'url':_0x5d295b[_0x99ee('0x4d')]+_0x99ee('0x23')+_0x2cfed9['id']+_0x99ee('0x24')+_0x5d295b[_0x99ee('0x25')]};var _0xae1b9e=util[_0x99ee('0x45')]('%s:%s',_0x5d295b[_0x99ee('0x4e')],_0x5d295b[_0x99ee('0x20')]);var _0x453156={'method':'POST','uri':util[_0x99ee('0x45')](_0x99ee('0x4f'),_0x5d295b['authId']),'body':_0x185027,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0xae1b9e)[_0x99ee('0x50')](_0x99ee('0x51')))},'json':!![]};rp(_0x453156)[_0x99ee('0x16')](function(_0x456563){var _0x38f0cb={'messageId':_0x456563[_0x99ee('0x52')][0x0]};return _0x41cb9e[_0x99ee('0x17')](_0x38f0cb);})[_0x99ee('0x18')](function(_0x71adf4){logger['error'](_0x99ee('0x28'),_0x99ee('0x29'),'plivo',util[_0x99ee('0x3c')](_0x71adf4,{'showHidden':![],'depth':null}));});}else{logger[_0x99ee('0x27')](_0x99ee('0x28'),_0x99ee('0x29'),_0x99ee('0x4c'),_0x99ee('0x53'));}break;case _0x99ee('0x54'):if(_0x5d295b['username']&&_0x5d295b[_0x99ee('0x2e')]){if(_0x5d295b[_0x99ee('0x55')]){var _0x33fe6e={'method':'POST','uri':_0x5d295b[_0x99ee('0x55')]+_0x99ee('0x56'),'body':{'username':_0x5d295b[_0x99ee('0x2d')],'password':_0x5d295b[_0x99ee('0x2e')]},'json':!![]};return rp(_0x33fe6e)[_0x99ee('0x16')](function(_0x6b0328){var _0x2fcbcc={'method':_0x99ee('0x35'),'uri':_0x5d295b[_0x99ee('0x55')]+_0x99ee('0x57'),'body':{'messages':[{'from':_0x5d295b[_0x99ee('0x1e')],'destinations':[{'to':_0x2cfed9[_0x99ee('0x1e')]}],'text':_0x2cfed9[_0x99ee('0xc')],'notifyUrl':_0x5d295b[_0x99ee('0x4d')]+'/api/sms/messages/'+_0x2cfed9['id']+'/status?token='+_0x5d295b[_0x99ee('0x25')],'notifyContentType':'application/json','callbackData':_0x5d295b['phone']+';'+_0x2cfed9[_0x99ee('0xc')]}]},'headers':{'Authorization':_0x99ee('0x58')+_0x6b0328[_0x99ee('0x25')]},'json':!![]};return rp(_0x2fcbcc)[_0x99ee('0x16')](function(_0x580b95){if(_0x580b95[_0x99ee('0x21')]){var _0x4dbf47={'messageId':_0x580b95[_0x99ee('0x21')][0x0][_0x99ee('0xa')]};if(!_0x5d295b[_0x99ee('0x3a')]){_0x4dbf47[_0x99ee('0x3b')]=!![];}return _0x41cb9e[_0x99ee('0x17')](_0x4dbf47);}else{return logger[_0x99ee('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x99ee('0x54'),util['inspect'](_0x580b95,{'showHidden':![],'depth':null}));}});})[_0x99ee('0x18')](function(_0x32df16){return logger[_0x99ee('0x27')](_0x99ee('0x28'),_0x99ee('0x29'),_0x99ee('0x54'),util['inspect'](_0x32df16,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x99ee('0x28'),_0x99ee('0x29'),'infobip',_0x99ee('0x59'));}}else{logger['error'](_0x99ee('0x28'),_0x99ee('0x29'),_0x99ee('0x54'),_0x99ee('0x3d'));}break;case _0x99ee('0x5a'):var _0x380ec0=require(_0x99ee('0x5b'));if(_0x5d295b[_0x99ee('0x5c')]){var _0x1fb1f9={};_0x1fb1f9[_0x99ee('0x5d')]=_0x5d295b[_0x99ee('0x2d')];_0x1fb1f9['phone']=_0x2cfed9[_0x99ee('0x1e')];_0x1fb1f9[_0x99ee('0x5e')]=_0x5d295b[_0x99ee('0x1e')];_0x1fb1f9[_0x99ee('0x5f')]=_0x2cfed9[_0x99ee('0xc')];_0x1fb1f9['timestamp']=+new Date();var _0x1cba12='';var _0x21f82d='';var _0x475d8e=Object[_0x99ee('0x60')](_0x1fb1f9);_0x475d8e['sort']();for(var _0x1ab940=0x0;_0x1ab940<_0x475d8e[_0x99ee('0x61')];_0x1ab940++){if(_0x1cba12!=''){_0x1cba12+='&';}_0x1cba12+=_0x475d8e[_0x1ab940]+'='+encodeURIComponent(_0x1fb1f9[_0x475d8e[_0x1ab940]]);_0x21f82d+=_0x1fb1f9[_0x475d8e[_0x1ab940]];}_0x21f82d+=_0x5d295b[_0x99ee('0x5c')];_0x21f82d=_0x380ec0[_0x99ee('0x62')]('md5')[_0x99ee('0x17')](_0x21f82d)['digest'](_0x99ee('0x63'));if(_0x1cba12!==''){_0x1cba12+='&';}_0x1cba12+=_0x99ee('0x64')+_0x21f82d;var _0x29349a={'method':_0x99ee('0x32'),'uri':_0x5d295b[_0x99ee('0x55')]+_0x99ee('0x65')+_0x1cba12,'json':!![]};return rp(_0x29349a)[_0x99ee('0x16')](function(_0x5f23d1){var _0x4e5db6=Object['keys'](_0x5f23d1);if(_0x5f23d1[_0x4e5db6[0x0]]['error']&&parseInt(_0x5f23d1[_0x4e5db6[0x0]]['error'])===0x0){var _0xeb10b7={'messageId':_0x5f23d1[_0x4e5db6[0x0]][_0x99ee('0x66')]};if(!_0x5d295b['deliveryReport']){_0xeb10b7['read']=!![];}return _0x41cb9e[_0x99ee('0x17')](_0xeb10b7);}else{return logger['error'](_0x99ee('0x28'),_0x99ee('0x29'),_0x99ee('0x5a'),util[_0x99ee('0x3c')](_0x5f23d1[_0x99ee('0x27')],{'showHidden':![],'depth':null}));}})[_0x99ee('0x18')](function(_0x1751f1){return logger[_0x99ee('0x27')](_0x99ee('0x28'),_0x99ee('0x29'),'csc',util[_0x99ee('0x3c')](_0x1751f1,{'showHidden':![],'depth':null}));});}else{logger[_0x99ee('0x27')](_0x99ee('0x28'),_0x99ee('0x29'),_0x99ee('0x5a'),_0x99ee('0x67'));}break;case _0x99ee('0x68'):if(_0x5d295b['apiKey']){var _0x33e91f={'method':'POST','uri':_0x99ee('0x69'),'headers':{'Authorization':_0x5d295b[_0x99ee('0x5c')]},'body':{'content':_0x2cfed9[_0x99ee('0xc')],'to':[_0x2cfed9[_0x99ee('0x1e')]],'from':_0x5d295b[_0x99ee('0x1e')],'binary':![],'clientMessageId':_0x99ee('0x6a'),'charset':_0x99ee('0x6b')},'json':!![]};rp(_0x33e91f)['then'](function(_0x3a0d05){if(!_0x3a0d05['error']){var _0x38ee33={'messageId':_0x3a0d05['messages'][0x0][_0x99ee('0x6c')]};if(!_0x5d295b[_0x99ee('0x3a')]){_0x38ee33[_0x99ee('0x3b')]=!![];}return _0x41cb9e[_0x99ee('0x17')](_0x38ee33);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x99ee('0x68'),util['inspect'](_0x3a0d05['error'],{'showHidden':![],'depth':null}));}})[_0x99ee('0x18')](function(_0x316d79){return logger['error'](_0x99ee('0x28'),_0x99ee('0x29'),_0x99ee('0x68'),util[_0x99ee('0x3c')](_0x316d79,{'showHidden':![],'depth':null}));});}else{logger[_0x99ee('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x99ee('0x29'),_0x99ee('0x68'),_0x99ee('0x67'));}break;case _0x99ee('0x6d'):if(_0x5d295b[_0x99ee('0x5c')]){var _0x3df3c8={};var _0x29349a={'method':'POST','uri':_0x99ee('0x6e'),'headers':{'Authorization':_0x99ee('0x6f')+_0x5d295b[_0x99ee('0x5c')],'Content-Type':_0x99ee('0x70')},'body':{'from':_0x5d295b[_0x99ee('0x1e')],'to':_0x2cfed9[_0x99ee('0x1e')],'text':_0x2cfed9[_0x99ee('0xc')]},'json':!![]};return rp(_0x29349a)[_0x99ee('0x16')](function(_0x484c93){if(_0x484c93[_0x99ee('0x71')]==0xca){_0x3df3c8['message']=_0x484c93;var _0x1f4402={'method':'POST','uri':_0x99ee('0x72'),'headers':{'Authorization':_0x99ee('0x6f')+_0x5d295b[_0x99ee('0x5c')],'Content-Type':_0x99ee('0x70')},'body':{'refid':_0x3df3c8[_0x99ee('0x73')]['refid']},'json':!![]};return rp(_0x1f4402)['then'](function(_0x17d998){_0x3df3c8['status']=_0x17d998;var _0x4b3ed6={'messageId':_0x3df3c8[_0x99ee('0x73')][_0x99ee('0x74')],'read':!![]};return _0x41cb9e[_0x99ee('0x17')](_0x4b3ed6);});}else{return logger[_0x99ee('0x27')](_0x99ee('0x28'),'afterCreate',_0x99ee('0x6d'),util[_0x99ee('0x3c')](_0x484c93,{'showHidden':![],'depth':null}));}})[_0x99ee('0x18')](function(_0x174de9){return logger[_0x99ee('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x99ee('0x29'),_0x99ee('0x6d'),util[_0x99ee('0x3c')](_0x174de9,{'showHidden':![],'depth':null}));});}else{return logger[_0x99ee('0x27')](_0x99ee('0x28'),_0x99ee('0x29'),_0x99ee('0x6d'),_0x99ee('0x75'));}break;}}})[_0x99ee('0x76')](function(){_0x39182a();});}else{_0x39182a();}}},'charset':'utf8mb4','collate':_0x99ee('0x77')});};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js
index 825f756..f9e9de8 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 _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
+var _0xb10b=['options','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','body'];(function(_0x4981ed,_0x5ee4af){var _0x4134fa=function(_0x510ed9){while(--_0x510ed9){_0x4981ed['push'](_0x4981ed['shift']());}};_0x4134fa(++_0x5ee4af);}(_0xb10b,0x12a));var _0xbb10=function(_0x473d1e,_0x4df799){_0x473d1e=_0x473d1e-0x0;var _0x503be9=_0xb10b[_0x473d1e];return _0x503be9;};'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});config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('SmsMessage,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('SmsMessage,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['create'](_0x19f48d[_0xbb10('0x1f')],{'raw':_0x19f48d[_0xbb10('0x20')]?_0x19f48d['options']['raw']===undefined?!![]:![]:!![]})[_0xbb10('0x11')](function(_0x311abe){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger[_0xbb10('0x14')](_0xbb10('0x1d'),_0x19f48d,JSON[_0xbb10('0x16')](_0x311abe));_0x109908(_0x311abe);})[_0xbb10('0x1c')](function(_0x7f2377){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x7f2377[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x7f2377['message']));});});};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js
index d823f55..1887e5b 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 _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
+var _0x08ec=['emit','removeListener','register','smsMessage:','./smsMessage.events','save','remove','update'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x08ec,0x164));var _0xc08e=function(_0x2cc294,_0x468722){_0x2cc294=_0x2cc294-0x0;var _0x1b068e=_0x08ec[_0x2cc294];return _0x1b068e;};'use strict';var SmsMessageEvents=require(_0xc08e('0x0'));var events=[_0xc08e('0x1'),_0xc08e('0x2'),_0xc08e('0x3')];function createListener(_0x543d18,_0x13c74d){return function(_0x40c0e2){_0x13c74d[_0xc08e('0x4')](_0x543d18,_0x40c0e2);};}function removeListener(_0xf2cf7a,_0x20e5ec){return function(){SmsMessageEvents[_0xc08e('0x5')](_0xf2cf7a,_0x20e5ec);};}exports[_0xc08e('0x6')]=function(_0x251554){for(var _0x495fa2=0x0,_0x4ba0b9=events['length'];_0x495fa2<_0x4ba0b9;_0x495fa2++){var _0x19d77f=events[_0x495fa2];var _0x2a4e60=createListener(_0xc08e('0x7')+_0x19d77f,_0x251554);SmsMessageEvents['on'](_0x19d77f,_0x2a4e60);}};
\ No newline at end of file
diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js
index b3fce20..1880828 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 _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
+var _0x8411=['post','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create'];(function(_0x1c9fab,_0x2787fe){var _0x57db79=function(_0x421789){while(--_0x421789){_0x1c9fab['push'](_0x1c9fab['shift']());}};_0x57db79(++_0x2787fe);}(_0x8411,0x118));var _0x1841=function(_0x2407c1,_0x442e31){_0x2407c1=_0x2407c1-0x0;var _0x1d85d9=_0x8411[_0x2407c1];return _0x1d85d9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1841('0x0'));var timeout=require(_0x1841('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x1841('0x2'));var interaction=require(_0x1841('0x3'));var config=require(_0x1841('0x4'));var controller=require(_0x1841('0x5'));router[_0x1841('0x6')]('/',auth['isAuthenticated'](),controller[_0x1841('0x7')]);router['get'](_0x1841('0x8'),auth[_0x1841('0x9')](),controller[_0x1841('0xa')]);router[_0x1841('0x6')](_0x1841('0xb'),auth[_0x1841('0x9')](),controller[_0x1841('0xc')]);router[_0x1841('0x6')](_0x1841('0xd'),auth[_0x1841('0x9')](),controller[_0x1841('0xe')]);router[_0x1841('0x6')](_0x1841('0xf'),auth[_0x1841('0x9')](),controller[_0x1841('0x10')]);router[_0x1841('0x6')](_0x1841('0x11'),auth[_0x1841('0x9')](),controller[_0x1841('0x12')]);router['post']('/',auth[_0x1841('0x9')](),controller[_0x1841('0x13')]);router[_0x1841('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x1841('0x15')]);router[_0x1841('0x14')]('/:id/users',auth[_0x1841('0x9')](),controller[_0x1841('0x16')]);router[_0x1841('0x17')](_0x1841('0xb'),auth[_0x1841('0x9')](),controller[_0x1841('0x18')]);router['delete'](_0x1841('0xb'),auth[_0x1841('0x9')](),controller[_0x1841('0x19')]);router[_0x1841('0x1a')](_0x1841('0xf'),auth[_0x1841('0x9')](),controller[_0x1841('0x1b')]);router[_0x1841('0x1a')](_0x1841('0x11'),auth[_0x1841('0x9')](),controller[_0x1841('0x1c')]);module[_0x1841('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js
index b177325..147a86e 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 _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
+var _0x9fc5=['INTEGER','ENUM','rrmemory','beepall','sequelize','STRING','name'];(function(_0x4bc51b,_0x2fccc0){var _0x267ddf=function(_0x67df8f){while(--_0x67df8f){_0x4bc51b['push'](_0x4bc51b['shift']());}};_0x267ddf(++_0x2fccc0);}(_0x9fc5,0x123));var _0x59fc=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x9fc5[_0x47e7cb];return _0x2a8874;};'use strict';var Sequelize=require(_0x59fc('0x0'));module['exports']={'name':{'type':Sequelize[_0x59fc('0x1')],'unique':_0x59fc('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x59fc('0x1')]},'timeout':{'type':Sequelize[_0x59fc('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x59fc('0x4')](_0x59fc('0x5'),_0x59fc('0x6'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js
index 10b8b0c..4d607a4 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 _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
+var _0xf6f5=['agent','smsPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','forEach','emit','userSmsQueue:save','removeTeams','tq.TeamId','from','team_has_sms_queues','user_has_teams','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','union','compact','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','user','role','get','SmsQueues','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','order','User','UserId'];(function(_0x4cbb43,_0x599116){var _0x2394c4=function(_0x53be97){while(--_0x53be97){_0x4cbb43['push'](_0x4cbb43['shift']());}};_0x2394c4(++_0x599116);}(_0xf6f5,0xb6));var _0x5f6f=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xf6f5[_0xbca1b1];return _0x4e1686;};'use strict';var pdf=require(_0x5f6f('0x0'));var emlformat=require(_0x5f6f('0x1'));var rimraf=require(_0x5f6f('0x2'));var zipdir=require(_0x5f6f('0x3'));var jsonpatch=require(_0x5f6f('0x4'));var rp=require(_0x5f6f('0x5'));var moment=require(_0x5f6f('0x6'));var BPromise=require(_0x5f6f('0x7'));var Mustache=require('mustache');var util=require(_0x5f6f('0x8'));var path=require(_0x5f6f('0x9'));var sox=require(_0x5f6f('0xa'));var csv=require(_0x5f6f('0xb'));var ejs=require(_0x5f6f('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5f6f('0xd'));var crypto=require(_0x5f6f('0xe'));var jsforce=require(_0x5f6f('0xf'));var deskjs=require(_0x5f6f('0x10'));var toCsv=require(_0x5f6f('0xb'));var querystring=require(_0x5f6f('0x11'));var Papa=require(_0x5f6f('0x12'));var Redis=require(_0x5f6f('0x13'));var authService=require(_0x5f6f('0x14'));var qs=require(_0x5f6f('0x15'));var as=require(_0x5f6f('0x16'));var hardwareService=require(_0x5f6f('0x17'));var logger=require('../../config/logger')(_0x5f6f('0x18'));var utils=require('../../config/utils');var config=require(_0x5f6f('0x19'));var db=require(_0x5f6f('0x1a'))['db'];config[_0x5f6f('0x1b')]=_[_0x5f6f('0x1c')](config[_0x5f6f('0x1b')],{'host':_0x5f6f('0x1d'),'port':0x18eb});var socket=require(_0x5f6f('0x1e'))(new Redis(config[_0x5f6f('0x1b')]));require(_0x5f6f('0x1f'))[_0x5f6f('0x20')](socket);function respondWithStatusCode(_0x350e56,_0x401071){_0x401071=_0x401071||0xcc;return function(_0x555db4){if(_0x555db4){return _0x350e56[_0x5f6f('0x21')](_0x401071);}return _0x350e56[_0x5f6f('0x22')](_0x401071)[_0x5f6f('0x23')]();};}function respondWithResult(_0x2e51bc,_0x44ca9a){_0x44ca9a=_0x44ca9a||0xc8;return function(_0x39a0fe){if(_0x39a0fe){return _0x2e51bc[_0x5f6f('0x22')](_0x44ca9a)[_0x5f6f('0x24')](_0x39a0fe);}};}function respondWithFilteredResult(_0x555baf,_0x646d27){return function(_0x4027b8){if(_0x4027b8){var _0x35c838=_0x4027b8[_0x5f6f('0x25')],_0x5932da=_0x646d27[_0x5f6f('0x26')],_0x28b046=_0x646d27['offset']+_0x646d27[_0x5f6f('0x27')],_0x56766a;if(_0x28b046>=_0x35c838){_0x28b046=_0x35c838;_0x56766a=0xc8;}else{_0x56766a=0xce;}_0x555baf[_0x5f6f('0x22')](_0x56766a);return _0x555baf['set'](_0x5f6f('0x28'),_0x5932da+'-'+_0x28b046+'/'+_0x35c838)[_0x5f6f('0x24')](_0x4027b8);}return null;};}function patchUpdates(_0x359a66){return function(_0x1f0272){try{jsonpatch[_0x5f6f('0x29')](_0x1f0272,_0x359a66,!![]);}catch(_0x66320a){return BPromise[_0x5f6f('0x2a')](_0x66320a);}return _0x1f0272[_0x5f6f('0x2b')]();};}function saveUpdates(_0x1e1294,_0x3b0b22){return function(_0x469604){if(_0x469604){return _0x469604[_0x5f6f('0x2c')](_0x1e1294)[_0x5f6f('0x2d')](function(_0x1d82fc){return _0x1d82fc;});}return null;};}function removeEntity(_0x1926e0,_0x130950){return function(_0x348cfb){if(_0x348cfb){return _0x348cfb[_0x5f6f('0x2e')]()[_0x5f6f('0x2d')](function(){var _0x17608b=_0x348cfb['get']({'plain':!![]});var _0x32536a='SmsQueues';return db['UserProfileResource'][_0x5f6f('0x2e')]({'where':{'type':_0x32536a,'resourceId':_0x17608b['id']}})[_0x5f6f('0x2d')](function(){return _0x348cfb;});})['then'](function(){_0x1926e0[_0x5f6f('0x22')](0xcc)[_0x5f6f('0x23')]();});}};}function handleEntityNotFound(_0x1a36a9,_0x3a5ead){return function(_0x53f5d5){if(!_0x53f5d5){_0x1a36a9[_0x5f6f('0x21')](0x194);}return _0x53f5d5;};}function handleError(_0x2c52be,_0x12e9f1){_0x12e9f1=_0x12e9f1||0x1f4;return function(_0x12629f){logger[_0x5f6f('0x2f')](_0x12629f[_0x5f6f('0x30')]);if(_0x12629f[_0x5f6f('0x31')]){delete _0x12629f[_0x5f6f('0x31')];}_0x2c52be[_0x5f6f('0x22')](_0x12e9f1)[_0x5f6f('0x32')](_0x12629f);};}exports[_0x5f6f('0x33')]=function(_0x409621,_0x921e3){var _0x5ed9c1={},_0x205ac3={},_0x3859bc={'count':0x0,'rows':[]};var _0x428225=_[_0x5f6f('0x34')](db[_0x5f6f('0x35')][_0x5f6f('0x36')],function(_0x2e61dd){return{'name':_0x2e61dd[_0x5f6f('0x37')],'type':_0x2e61dd['type'][_0x5f6f('0x38')]};});_0x205ac3[_0x5f6f('0x39')]=_[_0x5f6f('0x34')](_0x428225,_0x5f6f('0x31'));_0x205ac3[_0x5f6f('0x3a')]=_['keys'](_0x409621[_0x5f6f('0x3a')]);_0x205ac3[_0x5f6f('0x3b')]=_[_0x5f6f('0x3c')](_0x205ac3[_0x5f6f('0x39')],_0x205ac3[_0x5f6f('0x3a')]);_0x5ed9c1[_0x5f6f('0x3d')]=_['intersection'](_0x205ac3[_0x5f6f('0x39')],qs[_0x5f6f('0x3e')](_0x409621['query']['fields']));_0x5ed9c1[_0x5f6f('0x3d')]=_0x5ed9c1[_0x5f6f('0x3d')]['length']?_0x5ed9c1[_0x5f6f('0x3d')]:_0x205ac3[_0x5f6f('0x39')];if(!_0x409621[_0x5f6f('0x3a')][_0x5f6f('0x3f')](_0x5f6f('0x40'))){_0x5ed9c1[_0x5f6f('0x27')]=qs['limit'](_0x409621['query'][_0x5f6f('0x27')]);_0x5ed9c1['offset']=qs[_0x5f6f('0x26')](_0x409621['query']['offset']);}_0x5ed9c1['order']=qs['sort'](_0x409621[_0x5f6f('0x3a')][_0x5f6f('0x41')]);_0x5ed9c1['where']=qs['filters'](_[_0x5f6f('0x42')](_0x409621['query'],_0x205ac3['filters']),_0x428225);if(_0x409621[_0x5f6f('0x3a')][_0x5f6f('0x43')]){_0x5ed9c1['where']=_[_0x5f6f('0x44')](_0x5ed9c1[_0x5f6f('0x45')],{'$or':_['map'](_0x428225,function(_0x278f2c){if(_0x278f2c[_0x5f6f('0x46')]!==_0x5f6f('0x47')){var _0x26842e={};_0x26842e[_0x278f2c[_0x5f6f('0x31')]]={'$like':'%'+_0x409621['query'][_0x5f6f('0x43')]+'%'};return _0x26842e;}})});}_0x5ed9c1=_[_0x5f6f('0x44')]({},_0x5ed9c1,_0x409621[_0x5f6f('0x48')]);var _0x243e36={'where':_0x5ed9c1['where']};return db[_0x5f6f('0x35')][_0x5f6f('0x25')](_0x243e36)[_0x5f6f('0x2d')](function(_0x5e31e1){_0x3859bc[_0x5f6f('0x25')]=_0x5e31e1;if(_0x409621[_0x5f6f('0x3a')][_0x5f6f('0x49')]){_0x5ed9c1[_0x5f6f('0x4a')]=[{'all':!![]}];}return db[_0x5f6f('0x35')][_0x5f6f('0x4b')](_0x5ed9c1);})[_0x5f6f('0x2d')](function(_0x2bd893){_0x3859bc[_0x5f6f('0x4c')]=_0x2bd893;return _0x3859bc;})[_0x5f6f('0x2d')](respondWithFilteredResult(_0x921e3,_0x5ed9c1))[_0x5f6f('0x4d')](handleError(_0x921e3,null));};exports[_0x5f6f('0x4e')]=function(_0x1fd7df,_0x700ee2){var _0x1542b0={'raw':!![],'where':{'id':_0x1fd7df[_0x5f6f('0x4f')]['id']}},_0x2b4ccb={};_0x2b4ccb[_0x5f6f('0x39')]=_['keys'](db[_0x5f6f('0x35')][_0x5f6f('0x36')]);_0x2b4ccb[_0x5f6f('0x3a')]=_[_0x5f6f('0x50')](_0x1fd7df['query']);_0x2b4ccb[_0x5f6f('0x3b')]=_[_0x5f6f('0x3c')](_0x2b4ccb[_0x5f6f('0x39')],_0x2b4ccb[_0x5f6f('0x3a')]);_0x1542b0[_0x5f6f('0x3d')]=_[_0x5f6f('0x3c')](_0x2b4ccb[_0x5f6f('0x39')],qs[_0x5f6f('0x3e')](_0x1fd7df[_0x5f6f('0x3a')][_0x5f6f('0x3e')]));_0x1542b0[_0x5f6f('0x3d')]=_0x1542b0[_0x5f6f('0x3d')][_0x5f6f('0x51')]?_0x1542b0[_0x5f6f('0x3d')]:_0x2b4ccb[_0x5f6f('0x39')];if(_0x1fd7df['query']['includeAll']){_0x1542b0[_0x5f6f('0x4a')]=[{'all':!![]}];}_0x1542b0=_[_0x5f6f('0x44')]({},_0x1542b0,_0x1fd7df[_0x5f6f('0x48')]);return db[_0x5f6f('0x35')][_0x5f6f('0x52')](_0x1542b0)[_0x5f6f('0x2d')](handleEntityNotFound(_0x700ee2,null))[_0x5f6f('0x2d')](respondWithResult(_0x700ee2,null))[_0x5f6f('0x4d')](handleError(_0x700ee2,null));};exports[_0x5f6f('0x53')]=function(_0x5e4b15,_0x2706dc){return db['SmsQueue'][_0x5f6f('0x53')](_0x5e4b15['body'],{})[_0x5f6f('0x2d')](function(_0x1eb8b3){var _0x3004d1=_0x5e4b15[_0x5f6f('0x54')]['get']({'plain':!![]});if(!_0x3004d1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3004d1[_0x5f6f('0x55')]===_0x5f6f('0x54')){var _0x25344e=_0x1eb8b3[_0x5f6f('0x56')]({'plain':!![]});var _0xb94028=_0x5f6f('0x57');return db[_0x5f6f('0x58')][_0x5f6f('0x52')]({'where':{'name':_0xb94028,'userProfileId':_0x3004d1[_0x5f6f('0x59')]},'raw':!![]})['then'](function(_0x1fc2b2){if(_0x1fc2b2&&_0x1fc2b2['autoAssociation']===0x0){return db[_0x5f6f('0x5a')][_0x5f6f('0x53')]({'name':_0x25344e['name'],'resourceId':_0x25344e['id'],'type':_0x1fc2b2[_0x5f6f('0x31')],'sectionId':_0x1fc2b2['id']},{})[_0x5f6f('0x2d')](function(){return _0x1eb8b3;});}else{return _0x1eb8b3;}})[_0x5f6f('0x4d')](function(_0x3110c7){logger['error'](_0x5f6f('0x5b'),_0x3110c7);throw _0x3110c7;});}return _0x1eb8b3;})[_0x5f6f('0x2d')](respondWithResult(_0x2706dc,0xc9))['catch'](handleError(_0x2706dc,null));};exports[_0x5f6f('0x2c')]=function(_0x2ccb3d,_0xb2fb04){if(_0x2ccb3d['body']['id']){delete _0x2ccb3d[_0x5f6f('0x5c')]['id'];}return db[_0x5f6f('0x35')][_0x5f6f('0x52')]({'where':{'id':_0x2ccb3d['params']['id']}})[_0x5f6f('0x2d')](handleEntityNotFound(_0xb2fb04,null))[_0x5f6f('0x2d')](saveUpdates(_0x2ccb3d[_0x5f6f('0x5c')],null))[_0x5f6f('0x2d')](respondWithResult(_0xb2fb04,null))[_0x5f6f('0x4d')](handleError(_0xb2fb04,null));};exports[_0x5f6f('0x2e')]=function(_0x4a7114,_0x17a828){return db[_0x5f6f('0x35')][_0x5f6f('0x52')]({'where':{'id':_0x4a7114['params']['id']}})['then'](handleEntityNotFound(_0x17a828,null))[_0x5f6f('0x2d')](removeEntity(_0x17a828,null))[_0x5f6f('0x4d')](handleError(_0x17a828,null));};exports[_0x5f6f('0x5d')]=function(_0x227e0e,_0x1c83fd){return db[_0x5f6f('0x35')]['describe']()[_0x5f6f('0x2d')](respondWithResult(_0x1c83fd,null))[_0x5f6f('0x4d')](handleError(_0x1c83fd,null));};exports[_0x5f6f('0x5e')]=function(_0x562728,_0x244500,_0x16d28d){var _0x4c3a3f={'raw':!![],'where':{}},_0xe9121d={},_0xf1e4dc;return db[_0x5f6f('0x35')][_0x5f6f('0x5f')]({'where':{'id':_0x562728[_0x5f6f('0x4f')]['id']}})[_0x5f6f('0x2d')](handleEntityNotFound(_0x244500,null))[_0x5f6f('0x2d')](function(_0x978926){if(_0x978926){_0xf1e4dc=_0x978926['get']({'plain':!![]});_0xe9121d[_0x5f6f('0x39')]=_[_0x5f6f('0x50')](db[_0x5f6f('0x60')][_0x5f6f('0x36')]);_0xe9121d[_0x5f6f('0x3a')]=_[_0x5f6f('0x50')](_0x562728[_0x5f6f('0x3a')]);_0xe9121d['filters']=_[_0x5f6f('0x3c')](_0xe9121d[_0x5f6f('0x39')],_0xe9121d[_0x5f6f('0x3a')]);_0x4c3a3f[_0x5f6f('0x3d')]=_[_0x5f6f('0x3c')](_0xe9121d[_0x5f6f('0x39')],qs[_0x5f6f('0x3e')](_0x562728[_0x5f6f('0x3a')][_0x5f6f('0x3e')]));_0x4c3a3f['attributes']=_0x4c3a3f[_0x5f6f('0x3d')][_0x5f6f('0x51')]?_0x4c3a3f[_0x5f6f('0x3d')]:_0xe9121d[_0x5f6f('0x39')];if(!_0x562728['query'][_0x5f6f('0x3f')](_0x5f6f('0x40'))){_0x4c3a3f['limit']=qs[_0x5f6f('0x27')](_0x562728[_0x5f6f('0x3a')][_0x5f6f('0x27')]);_0x4c3a3f['offset']=qs[_0x5f6f('0x26')](_0x562728['query'][_0x5f6f('0x26')]);}_0x4c3a3f[_0x5f6f('0x61')]=qs[_0x5f6f('0x41')](_0x562728[_0x5f6f('0x3a')]['sort']);_0x4c3a3f[_0x5f6f('0x45')]=qs[_0x5f6f('0x3b')](_[_0x5f6f('0x42')](_0x562728[_0x5f6f('0x3a')],_0xe9121d[_0x5f6f('0x3b')]));_0x4c3a3f['where']['SmsQueueId']=_0x978926['id'];if(_0x562728[_0x5f6f('0x3a')][_0x5f6f('0x43')]){_0x4c3a3f[_0x5f6f('0x45')]=_[_0x5f6f('0x44')](_0x4c3a3f[_0x5f6f('0x45')],{'$or':_['map'](_0x4c3a3f['attributes'],function(_0x3e3f35){var _0x122ba4={};_0x122ba4[_0x3e3f35]={'$like':'%'+_0x562728[_0x5f6f('0x3a')][_0x5f6f('0x43')]+'%'};return _0x122ba4;})});}_0x4c3a3f=_[_0x5f6f('0x44')]({},_0x4c3a3f,_0x562728[_0x5f6f('0x48')]);return db[_0x5f6f('0x60')][_0x5f6f('0x4b')](_0x4c3a3f);}})[_0x5f6f('0x2d')](function(_0x3c1c3d){if(_0x3c1c3d){return db[_0x5f6f('0x62')]['findAndCountAll']({'where':{'id':_[_0x5f6f('0x34')](_0x3c1c3d,_0x5f6f('0x63')),'role':_0x5f6f('0x64')},'attributes':['id',_0x5f6f('0x31'),_0x5f6f('0x65'),'updatedAt',_0x5f6f('0x66')]});}})[_0x5f6f('0x2d')](function(_0x4ac720){if(_0x4ac720){return{'count':_0x4ac720[_0x5f6f('0x25')],'rows':_[_0x5f6f('0x34')](_0x4ac720['rows'],function(_0x28ba4c){return{'membername':_0x28ba4c['name'],'UserId':_0x28ba4c['id'],'queue_name':_0xf1e4dc[_0x5f6f('0x31')],'SmsQueueId':_0xf1e4dc['id'],'interface':util[_0x5f6f('0x67')](_0x5f6f('0x68'),_0x5f6f('0x69'),_0x28ba4c[_0x5f6f('0x31')]),'penalty':0x0,'paused':_0x28ba4c[_0x5f6f('0x65')],'createdAt':_0x28ba4c[_0x5f6f('0x66')],'updatedAt':_0x28ba4c[_0x5f6f('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5f6f('0x2d')](respondWithFilteredResult(_0x244500,_0x4c3a3f))[_0x5f6f('0x4d')](handleError(_0x244500,null));};exports[_0x5f6f('0x6b')]=function(_0x239e6a,_0x13e554,_0x12c6b8){var _0x30deac={};var _0x4a94ee={};var _0xa0f342;var _0x36a3af;return db[_0x5f6f('0x35')][_0x5f6f('0x5f')]({'where':{'id':_0x239e6a[_0x5f6f('0x4f')]['id']}})[_0x5f6f('0x2d')](handleEntityNotFound(_0x13e554,null))[_0x5f6f('0x2d')](function(_0x270615){if(_0x270615){_0xa0f342=_0x270615;_0x4a94ee[_0x5f6f('0x39')]=_[_0x5f6f('0x50')](db[_0x5f6f('0x6c')]['rawAttributes']);_0x4a94ee[_0x5f6f('0x3a')]=_[_0x5f6f('0x50')](_0x239e6a[_0x5f6f('0x3a')]);_0x4a94ee[_0x5f6f('0x3b')]=_['intersection'](_0x4a94ee[_0x5f6f('0x39')],_0x4a94ee[_0x5f6f('0x3a')]);_0x30deac[_0x5f6f('0x3d')]=_['intersection'](_0x4a94ee['model'],qs[_0x5f6f('0x3e')](_0x239e6a[_0x5f6f('0x3a')][_0x5f6f('0x3e')]));_0x30deac[_0x5f6f('0x3d')]=_0x30deac[_0x5f6f('0x3d')][_0x5f6f('0x51')]?_0x30deac['attributes']:_0x4a94ee[_0x5f6f('0x39')];_0x30deac[_0x5f6f('0x61')]=qs[_0x5f6f('0x41')](_0x239e6a[_0x5f6f('0x3a')][_0x5f6f('0x41')]);_0x30deac[_0x5f6f('0x45')]=qs[_0x5f6f('0x3b')](_[_0x5f6f('0x42')](_0x239e6a[_0x5f6f('0x3a')],_0x4a94ee[_0x5f6f('0x3b')]));if(_0x239e6a[_0x5f6f('0x3a')]['filter']){_0x30deac['where']=_[_0x5f6f('0x44')](_0x30deac['where'],{'$or':_[_0x5f6f('0x34')](_0x30deac[_0x5f6f('0x3d')],function(_0x3883a7){var _0x1856d8={};_0x1856d8[_0x3883a7]={'$like':'%'+_0x239e6a['query']['filter']+'%'};return _0x1856d8;})});}_0x30deac=_[_0x5f6f('0x44')]({},_0x30deac,_0x239e6a['options']);return _0xa0f342['getTeams'](_0x30deac);}})[_0x5f6f('0x2d')](function(_0x5b4e4b){if(_0x5b4e4b){_0x36a3af=_0x5b4e4b[_0x5f6f('0x51')];if(!_0x239e6a['query']['hasOwnProperty']('nolimit')){_0x30deac[_0x5f6f('0x27')]=qs[_0x5f6f('0x27')](_0x239e6a[_0x5f6f('0x3a')][_0x5f6f('0x27')]);_0x30deac[_0x5f6f('0x26')]=qs[_0x5f6f('0x26')](_0x239e6a['query'][_0x5f6f('0x26')]);}return _0xa0f342['getTeams'](_0x30deac);}})[_0x5f6f('0x2d')](function(_0x99a5a0){if(_0x99a5a0){return _0x99a5a0?{'count':_0x36a3af,'rows':_0x99a5a0}:null;}})[_0x5f6f('0x2d')](respondWithResult(_0x13e554,null))['catch'](handleError(_0x13e554,null));};exports[_0x5f6f('0x6d')]=function(_0x16bcb6,_0x2f4cb1,_0x3a1559){var _0x4413b8=_0x16bcb6['body'][_0x5f6f('0x6e')];return db[_0x5f6f('0x6c')][_0x5f6f('0x4b')]({'where':{'id':_0x4413b8},'attributes':['id'],'include':[{'model':db[_0x5f6f('0x62')],'as':_0x5f6f('0x6f'),'attributes':['id','name',_0x5f6f('0x70'),_0x5f6f('0x71'),_0x5f6f('0x72')],'raw':!![]}]})[_0x5f6f('0x2d')](function(_0x4e0032){if(_0x4e0032){var _0x1c6900=_[_0x5f6f('0x73')](_0x4e0032,function(_0x5f372c){var _0x1271d7=_0x5f372c[_0x5f6f('0x56')]({'plain':!![]});return _0x1271d7['Agents'];});return db[_0x5f6f('0x35')][_0x5f6f('0x52')]({'where':{'id':_0x16bcb6[_0x5f6f('0x4f')]['id']}})[_0x5f6f('0x2d')](function(_0x2c7c60){return db[_0x5f6f('0x74')]['transaction'](function(_0x3b68d4){return _0x2c7c60[_0x5f6f('0x6d')](_0x4413b8,{'transaction':_0x3b68d4})[_0x5f6f('0x2d')](function(){return BPromise['each'](_0x1c6900,function(_0x584342){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x584342['id'],'SmsQueueId':_0x16bcb6['params']['id']},'transaction':_0x3b68d4});});})[_0x5f6f('0x2d')](function(){_0x1c6900[_0x5f6f('0x75')](function(_0x405fce){socket[_0x5f6f('0x76')](_0x5f6f('0x77'),{'UserId':_0x405fce['id'],'SmsQueueId':_0x2c7c60['id']});});});});});}})[_0x5f6f('0x2d')](respondWithStatusCode(_0x2f4cb1,null))[_0x5f6f('0x4d')](handleError(_0x2f4cb1,null));};exports[_0x5f6f('0x78')]=function(_0x26fb5e,_0x1a1dcb,_0x4f03aa){return db[_0x5f6f('0x6c')]['findAll']({'where':{'id':_0x26fb5e[_0x5f6f('0x3a')][_0x5f6f('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5f6f('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x5f6f('0x2d')](handleEntityNotFound(_0x1a1dcb,null))['then'](function(_0xbda0fd){var _0x5747dc=_[_0x5f6f('0x34')](_0xbda0fd,'id');var _0x5cf052=[];var _0x5c2bc5=[];var _0xc91e1b=squel['select']();_0xc91e1b['field'](_0x5f6f('0x79'))[_0x5f6f('0x7a')](_0x5f6f('0x7b'),'tq')['join'](_0x5f6f('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x5f6f('0x45')](_0x5f6f('0x7d'),_0x26fb5e['params']['id']);for(var _0x2e263c=0x0;_0x2e263c<_0xbda0fd[_0x5f6f('0x51')];_0x2e263c+=0x1){let _0x13e95e=_0xbda0fd[_0x2e263c];for(var _0x49b029=0x0;_0x49b029<_0x13e95e[_0x5f6f('0x6f')][_0x5f6f('0x51')];_0x49b029+=0x1){let _0xda1efa=_0x13e95e[_0x5f6f('0x6f')][_0x49b029];var _0x339511=_0xc91e1b['clone']();_0x339511['where'](_0x5f6f('0x7e'),_0xda1efa['id']);_0x5c2bc5['push'](db[_0x5f6f('0x74')][_0x5f6f('0x3a')](_0x339511[_0x5f6f('0x7f')](),{'type':db[_0x5f6f('0x74')][_0x5f6f('0x80')]['SELECT']})[_0x5f6f('0x2d')](function(_0x23232d){if(_0x23232d[_0x5f6f('0x51')]===0x1){return _0xda1efa['id'];}else{var _0x2b648f=_[_0x5f6f('0x81')](_['map'](_0x23232d,_0x5f6f('0x82')),function(_0x7b31f6){return _[_0x5f6f('0x83')](_0x5747dc,_0x7b31f6);});if(_0x2b648f){return _0xda1efa['id'];}}}));}}return BPromise['all'](_0x5c2bc5)['then'](function(_0x37c3c7){_0x5cf052=_(_0x5cf052)[_0x5f6f('0x84')](_0x37c3c7)[_0x5f6f('0x85')]()['value']();return db['SmsQueue']['find']({'where':{'id':_0x26fb5e[_0x5f6f('0x4f')]['id']}})[_0x5f6f('0x2d')](function(_0x4d2b8d){return db['sequelize']['transaction'](function(_0x279772){return _0x4d2b8d[_0x5f6f('0x78')](_0x26fb5e['query'][_0x5f6f('0x6e')],{'transaction':_0x279772})[_0x5f6f('0x2d')](function(){if(!_['isEmpty'](_0x5cf052)){return _0x4d2b8d[_0x5f6f('0x86')](_0x5cf052,{'transaction':_0x279772});}})[_0x5f6f('0x2d')](function(){_0x5cf052[_0x5f6f('0x75')](function(_0x4c7d0b){socket[_0x5f6f('0x76')](_0x5f6f('0x87'),{'UserId':_0x4c7d0b,'SmsQueueId':_0x4d2b8d['id']});});});});});});})[_0x5f6f('0x2d')](respondWithStatusCode(_0x1a1dcb,null))[_0x5f6f('0x4d')](handleError(_0x1a1dcb,null));};exports['addAgents']=function(_0x15933b,_0x3b1a21,_0x4d7de3){return db[_0x5f6f('0x35')]['find']({'where':{'id':_0x15933b['params']['id']}})[_0x5f6f('0x2d')](handleEntityNotFound(_0x3b1a21,null))[_0x5f6f('0x2d')](function(_0x189a37){if(_0x189a37){return _0x189a37[_0x5f6f('0x88')](_0x15933b['body'][_0x5f6f('0x6e')],_[_0x5f6f('0x89')](_0x15933b[_0x5f6f('0x5c')],[_0x5f6f('0x6e'),'id'])||{})[_0x5f6f('0x8a')](function(_0x18e3d6){for(var _0x1b3f20=0x0;_0x1b3f20<_0x15933b[_0x5f6f('0x5c')][_0x5f6f('0x6e')][_0x5f6f('0x51')];_0x1b3f20+=0x1){socket[_0x5f6f('0x76')]('userSmsQueue:save',{'UserId':_0x15933b[_0x5f6f('0x5c')][_0x5f6f('0x6e')][_0x1b3f20],'SmsQueueId':_0x15933b[_0x5f6f('0x4f')]['id']});}return _0x18e3d6;});}})['then'](respondWithResult(_0x3b1a21,null))['catch'](handleError(_0x3b1a21,null));};exports[_0x5f6f('0x86')]=function(_0xcdfaee,_0x2fca5f,_0x36847c){return db[_0x5f6f('0x35')]['find']({'where':{'id':_0xcdfaee['params']['id']}})[_0x5f6f('0x2d')](handleEntityNotFound(_0x2fca5f,null))[_0x5f6f('0x2d')](function(_0x37b128){if(_0x37b128){return _0x37b128[_0x5f6f('0x86')](_0xcdfaee[_0x5f6f('0x3a')][_0x5f6f('0x6e')])[_0x5f6f('0x2d')](function(){if(_[_0x5f6f('0x8b')](_0xcdfaee[_0x5f6f('0x3a')][_0x5f6f('0x6e')])){for(var _0x9cbe0=0x0;_0x9cbe0<_0xcdfaee[_0x5f6f('0x3a')]['ids'][_0x5f6f('0x51')];_0x9cbe0+=0x1){socket[_0x5f6f('0x76')]('userSmsQueue:remove',{'UserId':Number(_0xcdfaee[_0x5f6f('0x3a')][_0x5f6f('0x6e')][_0x9cbe0]),'SmsQueueId':Number(_0xcdfaee['params']['id'])});}}else{socket[_0x5f6f('0x76')](_0x5f6f('0x87'),{'UserId':Number(_0xcdfaee[_0x5f6f('0x3a')][_0x5f6f('0x6e')]),'SmsQueueId':Number(_0xcdfaee[_0x5f6f('0x4f')]['id'])});}});}})[_0x5f6f('0x2d')](respondWithStatusCode(_0x2fca5f,null))[_0x5f6f('0x4d')](handleError(_0x2fca5f,null));};exports[_0x5f6f('0x8c')]=function(_0x1aaab9,_0x17e44b,_0x18130f){var _0x5414eb={};var _0x28011f={};var _0x4e25bb;var _0x404dc1;return db[_0x5f6f('0x35')][_0x5f6f('0x5f')]({'where':{'id':_0x1aaab9['params']['id']}})[_0x5f6f('0x2d')](handleEntityNotFound(_0x17e44b,null))[_0x5f6f('0x2d')](function(_0x33ada9){if(_0x33ada9){_0x4e25bb=_0x33ada9;_0x28011f['model']=_[_0x5f6f('0x50')](db[_0x5f6f('0x62')][_0x5f6f('0x36')]);_0x28011f['query']=_['keys'](_0x1aaab9[_0x5f6f('0x3a')]);_0x28011f[_0x5f6f('0x3b')]=_['intersection'](_0x28011f[_0x5f6f('0x39')],_0x28011f[_0x5f6f('0x3a')]);_0x5414eb[_0x5f6f('0x3d')]=_['intersection'](_0x28011f['model'],qs['fields'](_0x1aaab9[_0x5f6f('0x3a')]['fields']));_0x5414eb[_0x5f6f('0x3d')]=_0x5414eb[_0x5f6f('0x3d')]['length']?_0x5414eb[_0x5f6f('0x3d')]:_0x28011f[_0x5f6f('0x39')];_0x5414eb[_0x5f6f('0x61')]=qs[_0x5f6f('0x41')](_0x1aaab9['query'][_0x5f6f('0x41')]);_0x5414eb[_0x5f6f('0x45')]=qs[_0x5f6f('0x3b')](_[_0x5f6f('0x42')](_0x1aaab9['query'],_0x28011f['filters']));if(_0x1aaab9['query'][_0x5f6f('0x43')]){_0x5414eb['where']=_[_0x5f6f('0x44')](_0x5414eb[_0x5f6f('0x45')],{'$or':_['map'](_0x5414eb['attributes'],function(_0x9d61be){var _0x5c740b={};_0x5c740b[_0x9d61be]={'$like':'%'+_0x1aaab9[_0x5f6f('0x3a')]['filter']+'%'};return _0x5c740b;})});}_0x5414eb=_[_0x5f6f('0x44')]({},_0x5414eb,_0x1aaab9['options']);return _0x4e25bb[_0x5f6f('0x8c')](_0x5414eb);}})[_0x5f6f('0x2d')](function(_0x5b05f4){if(_0x5b05f4){_0x404dc1=_0x5b05f4[_0x5f6f('0x51')];if(!_0x1aaab9[_0x5f6f('0x3a')][_0x5f6f('0x3f')](_0x5f6f('0x40'))){_0x5414eb['limit']=qs[_0x5f6f('0x27')](_0x1aaab9[_0x5f6f('0x3a')][_0x5f6f('0x27')]);_0x5414eb[_0x5f6f('0x26')]=qs['offset'](_0x1aaab9[_0x5f6f('0x3a')][_0x5f6f('0x26')]);}return _0x4e25bb[_0x5f6f('0x8c')](_0x5414eb);}})['then'](function(_0x438423){if(_0x438423){return _0x438423?{'count':_0x404dc1,'rows':_0x438423}:null;}})[_0x5f6f('0x2d')](respondWithResult(_0x17e44b,null))[_0x5f6f('0x4d')](handleError(_0x17e44b,null));};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js
index 74c1be5..fb114cb 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 _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
+var _0x7d4d=['exports','../../mysqldb','SmsQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x53274b,_0x176dda){var _0x40382c=function(_0x929aa7){while(--_0x929aa7){_0x53274b['push'](_0x53274b['shift']());}};_0x40382c(++_0x176dda);}(_0x7d4d,0xd9));var _0xd7d4=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x7d4d[_0x2e2681];return _0x368a64;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xd7d4('0x0'))['db'][_0xd7d4('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd7d4('0x2')](0x0);var events={'afterCreate':_0xd7d4('0x3'),'afterUpdate':_0xd7d4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x246f54){return function(_0x265647,_0x221827,_0x49b826){SmsQueueEvents[_0xd7d4('0x5')](_0x246f54+':'+_0x265647['id'],_0x265647);SmsQueueEvents[_0xd7d4('0x5')](_0x246f54,_0x265647);_0x49b826(null);};}for(var e in events){if(events[_0xd7d4('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xd7d4('0x7')]=SmsQueueEvents;
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js
index 7d5f79f..f488125 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 _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
+var _0xe186=['bluebird','request-promise','path','../../config/environment','exports','sms_queues','lodash','util','api','moment'];(function(_0x110f4b,_0x1f5cf6){var _0x28b50c=function(_0x4df190){while(--_0x4df190){_0x110f4b['push'](_0x110f4b['shift']());}};_0x28b50c(++_0x1f5cf6);}(_0xe186,0x146));var _0x6e18=function(_0x427d1b,_0x2f2ec2){_0x427d1b=_0x427d1b-0x0;var _0x646c3f=_0xe186[_0x427d1b];return _0x646c3f;};'use strict';var _=require(_0x6e18('0x0'));var util=require(_0x6e18('0x1'));var logger=require('../../config/logger')(_0x6e18('0x2'));var moment=require(_0x6e18('0x3'));var BPromise=require(_0x6e18('0x4'));var rp=require(_0x6e18('0x5'));var fs=require('fs');var path=require(_0x6e18('0x6'));var rimraf=require('rimraf');var config=require(_0x6e18('0x7'));var attributes=require('./smsQueue.attributes');module[_0x6e18('0x8')]=function(_0x1bafb5,_0x1b9e15){return _0x1bafb5['define']('SmsQueue',attributes,{'tableName':_0x6e18('0x9'),'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 ce530a4..86f1707 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 _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
+var _0xe622=['request','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','GetSmsQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowSmsQueue','SmsQueue','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket'];(function(_0xb400ce,_0x51e8dc){var _0x50b4bc=function(_0x3bf6d4){while(--_0x3bf6d4){_0xb400ce['push'](_0xb400ce['shift']());}};_0x50b4bc(++_0x51e8dc);}(_0xe622,0x16a));var _0x2e62=function(_0x57c182,_0x5d69ea){_0x57c182=_0x57c182-0x0;var _0xa9d5a0=_0xe622[_0x57c182];return _0xa9d5a0;};'use strict';var _=require(_0x2e62('0x0'));var util=require('util');var moment=require(_0x2e62('0x1'));var BPromise=require(_0x2e62('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e62('0x3'));var db=require(_0x2e62('0x4'))['db'];var utils=require(_0x2e62('0x5'));var logger=require('../../config/logger')(_0x2e62('0x6'));var config=require(_0x2e62('0x7'));var jayson=require(_0x2e62('0x8'));var client=jayson[_0x2e62('0x9')][_0x2e62('0xa')]({'port':0x232a});config[_0x2e62('0xb')]=_[_0x2e62('0xc')](config[_0x2e62('0xb')],{'host':_0x2e62('0xd'),'port':0x18eb});var socket=require(_0x2e62('0xe'))(new Redis(config['redis']));require(_0x2e62('0xf'))['register'](socket);function respondWithRpcPromise(_0x504cd2,_0x350ae5,_0x402199){return new BPromise(function(_0x219d5a,_0x1dac26){return client[_0x2e62('0x10')](_0x504cd2,_0x402199)[_0x2e62('0x11')](function(_0x403d33){logger[_0x2e62('0x12')](_0x2e62('0x13'),_0x350ae5,'request\x20sent');logger[_0x2e62('0x14')](_0x2e62('0x15'),_0x350ae5,_0x2e62('0x16'),JSON[_0x2e62('0x17')](_0x403d33));if(_0x403d33['error']){if(_0x403d33['error'][_0x2e62('0x18')]===0x1f4){logger['error'](_0x2e62('0x13'),_0x350ae5,_0x403d33[_0x2e62('0x19')][_0x2e62('0x1a')]);return _0x1dac26(_0x403d33[_0x2e62('0x19')][_0x2e62('0x1a')]);}logger[_0x2e62('0x19')](_0x2e62('0x13'),_0x350ae5,_0x403d33[_0x2e62('0x19')][_0x2e62('0x1a')]);return _0x219d5a(_0x403d33['error'][_0x2e62('0x1a')]);}else{logger[_0x2e62('0x12')]('SmsQueue,\x20%s,\x20%s',_0x350ae5,'request\x20sent');_0x219d5a(_0x403d33[_0x2e62('0x1b')][_0x2e62('0x1a')]);}})[_0x2e62('0x1c')](function(_0x40d6c4){logger[_0x2e62('0x19')]('SmsQueue,\x20%s,\x20%s',_0x350ae5,_0x40d6c4);_0x1dac26(_0x40d6c4);});});}exports[_0x2e62('0x1d')]=function(_0x4f36e4){var _0xf4ea8a=this;return new Promise(function(_0x161839,_0x33943e){return db['SmsQueue'][_0x2e62('0x1e')]({'raw':_0x4f36e4[_0x2e62('0x1f')]?_0x4f36e4[_0x2e62('0x1f')][_0x2e62('0x20')]===undefined?!![]:![]:!![],'where':_0x4f36e4[_0x2e62('0x1f')]?_0x4f36e4[_0x2e62('0x1f')][_0x2e62('0x21')]||null:null,'attributes':_0x4f36e4[_0x2e62('0x1f')]?_0x4f36e4['options']['attributes']||null:null,'limit':_0x4f36e4['options']?_0x4f36e4[_0x2e62('0x1f')][_0x2e62('0x22')]||null:null,'include':_0x4f36e4[_0x2e62('0x1f')]?_0x4f36e4[_0x2e62('0x1f')][_0x2e62('0x23')]?_[_0x2e62('0x24')](_0x4f36e4[_0x2e62('0x1f')][_0x2e62('0x23')],function(_0x45ce84){return{'model':db[_0x45ce84[_0x2e62('0x25')]],'as':_0x45ce84['as'],'attributes':_0x45ce84[_0x2e62('0x26')],'include':_0x45ce84[_0x2e62('0x23')]?_[_0x2e62('0x24')](_0x45ce84['include'],function(_0x1b48f8){return{'model':db[_0x1b48f8[_0x2e62('0x25')]],'as':_0x1b48f8['as'],'attributes':_0x1b48f8[_0x2e62('0x26')],'include':_0x1b48f8[_0x2e62('0x23')]?_[_0x2e62('0x24')](_0x1b48f8[_0x2e62('0x23')],function(_0x2b74e9){return{'model':db[_0x2b74e9[_0x2e62('0x25')]],'as':_0x2b74e9['as'],'attributes':_0x2b74e9[_0x2e62('0x26')]};}):[]};}):[]};}):[]:[]})[_0x2e62('0x11')](function(_0x55fca3){logger[_0x2e62('0x12')](_0x2e62('0x1d'),_0x4f36e4);logger[_0x2e62('0x14')](_0x2e62('0x1d'),_0x4f36e4,JSON[_0x2e62('0x17')](_0x55fca3));_0x161839(_0x55fca3);})[_0x2e62('0x1c')](function(_0x20cf88){logger[_0x2e62('0x19')](_0x2e62('0x1d'),_0x20cf88[_0x2e62('0x1a')],_0x4f36e4);_0x33943e(_0xf4ea8a[_0x2e62('0x19')](0x1f4,_0x20cf88[_0x2e62('0x1a')]));});});};exports[_0x2e62('0x27')]=function(_0x1f71d1){var _0x407e60=this;return new Promise(function(_0x3ee46a,_0x1368a9){return db[_0x2e62('0x28')][_0x2e62('0x29')]({'raw':_0x1f71d1[_0x2e62('0x1f')]?_0x1f71d1['options']['raw']===undefined?!![]:![]:!![],'where':_0x1f71d1['options']?_0x1f71d1['options']['where']||null:null,'attributes':_0x1f71d1['options']?_0x1f71d1[_0x2e62('0x1f')][_0x2e62('0x26')]||null:null,'include':_0x1f71d1[_0x2e62('0x1f')]?_0x1f71d1['options'][_0x2e62('0x23')]?_[_0x2e62('0x24')](_0x1f71d1[_0x2e62('0x1f')]['include'],function(_0x33ce57){return{'model':db[_0x33ce57['model']],'as':_0x33ce57['as'],'attributes':_0x33ce57[_0x2e62('0x26')],'include':_0x33ce57['include']?_[_0x2e62('0x24')](_0x33ce57['include'],function(_0x318857){return{'model':db[_0x318857[_0x2e62('0x25')]],'as':_0x318857['as'],'attributes':_0x318857['attributes'],'include':_0x318857[_0x2e62('0x23')]?_['map'](_0x318857[_0x2e62('0x23')],function(_0x1ea877){return{'model':db[_0x1ea877[_0x2e62('0x25')]],'as':_0x1ea877['as'],'attributes':_0x1ea877['attributes']};}):[]};}):[]};}):[]:[]})[_0x2e62('0x11')](function(_0x23361a){logger[_0x2e62('0x12')](_0x2e62('0x27'),_0x1f71d1);logger['debug']('ShowSmsQueue',_0x1f71d1,JSON[_0x2e62('0x17')](_0x23361a));_0x3ee46a(_0x23361a);})['catch'](function(_0x51c04e){logger[_0x2e62('0x19')](_0x2e62('0x27'),_0x51c04e['message'],_0x1f71d1);_0x1368a9(_0x407e60[_0x2e62('0x19')](0x1f4,_0x51c04e[_0x2e62('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js
index aecf426..de85ba3 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 _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
+var _0x7363=['removeListener','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x5df5e1,_0x3e0305){var _0x2fffd3=function(_0x532a7c){while(--_0x532a7c){_0x5df5e1['push'](_0x5df5e1['shift']());}};_0x2fffd3(++_0x3e0305);}(_0x7363,0x153));var _0x3736=function(_0x27a27c,_0x37b846){_0x27a27c=_0x27a27c-0x0;var _0x526849=_0x7363[_0x27a27c];return _0x526849;};'use strict';var SmsQueueEvents=require(_0x3736('0x0'));var events=[_0x3736('0x1'),_0x3736('0x2'),_0x3736('0x3')];function createListener(_0x5b7ba,_0x2480f9){return function(_0x32e434){_0x2480f9['emit'](_0x5b7ba,_0x32e434);};}function removeListener(_0x1fa4f4,_0x2a4874){return function(){SmsQueueEvents[_0x3736('0x4')](_0x1fa4f4,_0x2a4874);};}exports['register']=function(_0xc7b3f4){for(var _0x17d198=0x0,_0x496fe1=events[_0x3736('0x5')];_0x17d198<_0x496fe1;_0x17d198++){var _0x343688=events[_0x17d198];var _0x20c7ed=createListener(_0x3736('0x6')+_0x343688,_0xc7b3f4);SmsQueueEvents['on'](_0x343688,_0x20c7ed);}};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js
index cd1978c..c9f031a 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 _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
+var _0x5882=['show','post','create','put','update','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3a4429,_0x4c34bb){var _0x358408=function(_0x371ff8){while(--_0x371ff8){_0x3a4429['push'](_0x3a4429['shift']());}};_0x358408(++_0x4c34bb);}(_0x5882,0xc3));var _0x2588=function(_0x28efcb,_0x8db8e7){_0x28efcb=_0x28efcb-0x0;var _0x450cc3=_0x5882[_0x28efcb];return _0x450cc3;};'use strict';var multer=require(_0x2588('0x0'));var util=require(_0x2588('0x1'));var path=require(_0x2588('0x2'));var timeout=require('connect-timeout');var express=require(_0x2588('0x3'));var router=express[_0x2588('0x4')]();var auth=require(_0x2588('0x5'));var interaction=require(_0x2588('0x6'));var config=require(_0x2588('0x7'));var controller=require(_0x2588('0x8'));router[_0x2588('0x9')]('/',auth[_0x2588('0xa')](),controller[_0x2588('0xb')]);router[_0x2588('0x9')](_0x2588('0xc'),auth[_0x2588('0xa')](),controller[_0x2588('0xd')]);router['get'](_0x2588('0xe'),auth['isAuthenticated'](),controller[_0x2588('0xf')]);router[_0x2588('0x10')]('/',auth[_0x2588('0xa')](),controller[_0x2588('0x11')]);router[_0x2588('0x12')](_0x2588('0xe'),auth['isAuthenticated'](),controller[_0x2588('0x13')]);router['delete']('/:id',auth[_0x2588('0xa')](),controller[_0x2588('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js
index 8554e7d..aee6071 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 _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
+var _0x7331=['moment','sequelize','exports','STRING','DATE'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x7331,0xb4));var _0x1733=function(_0x29d324,_0xe4ca4e){_0x29d324=_0x29d324-0x0;var _0x258c80=_0x7331[_0x29d324];return _0x258c80;};'use strict';var moment=require(_0x1733('0x0'));var Sequelize=require(_0x1733('0x1'));module[_0x1733('0x2')]={'uniqueid':{'type':Sequelize[_0x1733('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1733('0x3')]},'joinAt':{'type':Sequelize[_0x1733('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1733('0x4')]},'exitAt':{'type':Sequelize[_0x1733('0x4')]},'reason':{'type':Sequelize[_0x1733('0x3')]}};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js
index d95df96..aaf0bc8 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(_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
+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(_0x47df54,_0x1aeb61){var _0x261b87=function(_0x54bc77){while(--_0x54bc77){_0x47df54['push'](_0x47df54['shift']());}};_0x261b87(++_0x1aeb61);}(_0x814b,0x1a2));var _0xb814=function(_0x21ccfc,_0x48834e){_0x21ccfc=_0x21ccfc-0x0;var _0x279454=_0x814b[_0x21ccfc];return _0x279454;};'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 5856720..ac5100e 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 _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
+var _0xe0d1=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash'];(function(_0x177e72,_0x28bf32){var _0x392698=function(_0x45a052){while(--_0x45a052){_0x177e72['push'](_0x177e72['shift']());}};_0x392698(++_0x28bf32);}(_0xe0d1,0xfb));var _0x1e0d=function(_0x1dc24d,_0x541fa4){_0x1dc24d=_0x1dc24d-0x0;var _0x5d7fb2=_0xe0d1[_0x1dc24d];return _0x5d7fb2;};'use strict';var _=require(_0x1e0d('0x0'));var util=require(_0x1e0d('0x1'));var logger=require(_0x1e0d('0x2'))(_0x1e0d('0x3'));var moment=require(_0x1e0d('0x4'));var BPromise=require(_0x1e0d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e0d('0x6'));var rimraf=require(_0x1e0d('0x7'));var config=require(_0x1e0d('0x8'));var attributes=require('./smsQueueReport.attributes');module[_0x1e0d('0x9')]=function(_0x2e461b,_0x315701){return _0x2e461b[_0x1e0d('0xa')](_0x1e0d('0xb'),attributes,{'tableName':_0x1e0d('0xc'),'paranoid':![],'indexes':[{'name':_0x1e0d('0xd'),'fields':[_0x1e0d('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 9477499..4b74d81 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 _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
+var _0xdbb3=['update','body','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSmsQueueReport','SmsQueueReport','create','options','raw','then','catch','UpdateSmsQueueReport'];(function(_0x4b6e56,_0x5a6187){var _0x59453b=function(_0x208fe6){while(--_0x208fe6){_0x4b6e56['push'](_0x4b6e56['shift']());}};_0x59453b(++_0x5a6187);}(_0xdbb3,0xdc));var _0x3dbb=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xdbb3[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x3dbb('0x0'));var util=require(_0x3dbb('0x1'));var moment=require(_0x3dbb('0x2'));var BPromise=require(_0x3dbb('0x3'));var rs=require(_0x3dbb('0x4'));var fs=require('fs');var Redis=require(_0x3dbb('0x5'));var db=require(_0x3dbb('0x6'))['db'];var utils=require(_0x3dbb('0x7'));var logger=require(_0x3dbb('0x8'))(_0x3dbb('0x9'));var config=require(_0x3dbb('0xa'));var jayson=require(_0x3dbb('0xb'));var client=jayson[_0x3dbb('0xc')][_0x3dbb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xba4281,_0x46307d,_0x316e3a){return new BPromise(function(_0x423a15,_0x4af7d3){return client['request'](_0xba4281,_0x316e3a)['then'](function(_0x3a1383){logger[_0x3dbb('0xe')](_0x3dbb('0xf'),_0x46307d,'request\x20sent');logger[_0x3dbb('0x10')](_0x3dbb('0x11'),_0x46307d,_0x3dbb('0x12'),JSON[_0x3dbb('0x13')](_0x3a1383));if(_0x3a1383[_0x3dbb('0x14')]){if(_0x3a1383[_0x3dbb('0x14')][_0x3dbb('0x15')]===0x1f4){logger[_0x3dbb('0x14')](_0x3dbb('0xf'),_0x46307d,_0x3a1383[_0x3dbb('0x14')][_0x3dbb('0x16')]);return _0x4af7d3(_0x3a1383['error']['message']);}logger[_0x3dbb('0x14')](_0x3dbb('0xf'),_0x46307d,_0x3a1383['error'][_0x3dbb('0x16')]);return _0x423a15(_0x3a1383[_0x3dbb('0x14')][_0x3dbb('0x16')]);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x46307d,'request\x20sent');_0x423a15(_0x3a1383[_0x3dbb('0x17')][_0x3dbb('0x16')]);}})['catch'](function(_0x245e45){logger[_0x3dbb('0x14')](_0x3dbb('0xf'),_0x46307d,_0x245e45);_0x4af7d3(_0x245e45);});});}exports[_0x3dbb('0x18')]=function(_0x67f256){var _0x2ecc46=this;return new Promise(function(_0x16b195,_0x40c7ec){return db[_0x3dbb('0x19')][_0x3dbb('0x1a')](_0x67f256['body'],{'raw':_0x67f256[_0x3dbb('0x1b')]?_0x67f256[_0x3dbb('0x1b')][_0x3dbb('0x1c')]===undefined?!![]:![]:!![]})[_0x3dbb('0x1d')](function(_0x5b3f7f){logger['info'](_0x3dbb('0x18'),_0x67f256);logger[_0x3dbb('0x10')]('CreateSmsQueueReport',_0x67f256,JSON[_0x3dbb('0x13')](_0x5b3f7f));_0x16b195(_0x5b3f7f);})[_0x3dbb('0x1e')](function(_0x20b1fc){logger[_0x3dbb('0x14')](_0x3dbb('0x18'),_0x20b1fc['message'],_0x67f256);_0x40c7ec(_0x2ecc46['error'](0x1f4,_0x20b1fc[_0x3dbb('0x16')]));});});};exports[_0x3dbb('0x1f')]=function(_0x3bea5a){var _0x5dd05f=this;return new Promise(function(_0x14031c,_0x3870b9){return db[_0x3dbb('0x19')][_0x3dbb('0x20')](_0x3bea5a[_0x3dbb('0x21')],{'raw':_0x3bea5a[_0x3dbb('0x1b')]?_0x3bea5a[_0x3dbb('0x1b')][_0x3dbb('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bea5a[_0x3dbb('0x1b')]?_0x3bea5a['options']['where']||null:null,'attributes':_0x3bea5a[_0x3dbb('0x1b')]?_0x3bea5a[_0x3dbb('0x1b')][_0x3dbb('0x22')]||null:null,'limit':_0x3bea5a[_0x3dbb('0x1b')]?_0x3bea5a[_0x3dbb('0x1b')][_0x3dbb('0x23')]||null:null})['then'](function(_0x26cb99){logger[_0x3dbb('0xe')]('UpdateSmsQueueReport',_0x3bea5a);logger[_0x3dbb('0x10')]('UpdateSmsQueueReport',_0x3bea5a,JSON[_0x3dbb('0x13')](_0x26cb99));_0x14031c(_0x26cb99);})[_0x3dbb('0x1e')](function(_0x523bbc){logger[_0x3dbb('0x14')](_0x3dbb('0x1f'),_0x523bbc[_0x3dbb('0x16')],_0x3bea5a);_0x3870b9(_0x5dd05f[_0x3dbb('0x14')](0x1f4,_0x523bbc[_0x3dbb('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js
index cf06a7c..a0aa847 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 _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
+var _0xbaf0=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','util','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js
index 6d6de08..dd6a810 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 _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
+var _0xe263=['account','agent','queue','DATE','moment','exports','STRING'];(function(_0x532dcb,_0xb4fa89){var _0x507b54=function(_0x1eaaf9){while(--_0x1eaaf9){_0x532dcb['push'](_0x532dcb['shift']());}};_0x507b54(++_0xb4fa89);}(_0xe263,0x131));var _0x3e26=function(_0x5593d5,_0x43ed6f){_0x5593d5=_0x5593d5-0x0;var _0x48bbe5=_0xe263[_0x5593d5];return _0x48bbe5;};'use strict';var moment=require(_0x3e26('0x0'));var Sequelize=require('sequelize');module[_0x3e26('0x1')]={'uniqueid':{'type':Sequelize[_0x3e26('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3e26('0x3'),_0x3e26('0x4'),_0x3e26('0x5')),'allowNull':![],'defaultValue':_0x3e26('0x5')},'transferredAt':{'type':Sequelize[_0x3e26('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js
index 710ed90..0650c51 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(_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
+var _0xe706=['catch','create','body','destroy','describe','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','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','SmsTransferReport','include','findAll','rows','params','includeAll','options','find'];(function(_0x578299,_0x5ad73f){var _0x4f5d36=function(_0x208c5e){while(--_0x208c5e){_0x578299['push'](_0x578299['shift']());}};_0x4f5d36(++_0x5ad73f);}(_0xe706,0xa3));var _0x6e70=function(_0x3451ba,_0x4dd59b){_0x3451ba=_0x3451ba-0x0;var _0x558479=_0xe706[_0x3451ba];return _0x558479;};'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['SmsTransferReport'][_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));};exports['show']=function(_0x5ae898,_0x154e0c){var _0x2b63cc={'raw':!![],'where':{'id':_0x5ae898[_0x6e70('0x46')]['id']}},_0x83847b={};_0x83847b[_0x6e70('0x31')]=_['keys'](db[_0x6e70('0x42')][_0x6e70('0x2d')]);_0x83847b[_0x6e70('0x32')]=_['keys'](_0x5ae898['query']);_0x83847b['filters']=_[_0x6e70('0x36')](_0x83847b['model'],_0x83847b[_0x6e70('0x32')]);_0x2b63cc[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x83847b[_0x6e70('0x31')],qs['fields'](_0x5ae898[_0x6e70('0x32')]['fields']));_0x2b63cc[_0x6e70('0x35')]=_0x2b63cc[_0x6e70('0x35')][_0x6e70('0x38')]?_0x2b63cc[_0x6e70('0x35')]:_0x83847b['model'];if(_0x5ae898[_0x6e70('0x32')][_0x6e70('0x47')]){_0x2b63cc[_0x6e70('0x43')]=[{'all':!![]}];}_0x2b63cc=_[_0x6e70('0x40')]({},_0x2b63cc,_0x5ae898[_0x6e70('0x48')]);return db[_0x6e70('0x42')][_0x6e70('0x49')](_0x2b63cc)['then'](handleEntityNotFound(_0x154e0c,null))[_0x6e70('0x27')](respondWithResult(_0x154e0c,null))[_0x6e70('0x4a')](handleError(_0x154e0c,null));};exports[_0x6e70('0x4b')]=function(_0x2f99cb,_0x3f86cf){return db[_0x6e70('0x42')][_0x6e70('0x4b')](_0x2f99cb['body'],{})[_0x6e70('0x27')](respondWithResult(_0x3f86cf,0xc9))['catch'](handleError(_0x3f86cf,null));};exports[_0x6e70('0x26')]=function(_0x3836e4,_0x4b351e){if(_0x3836e4['body']['id']){delete _0x3836e4[_0x6e70('0x4c')]['id'];}return db[_0x6e70('0x42')][_0x6e70('0x49')]({'where':{'id':_0x3836e4['params']['id']}})['then'](handleEntityNotFound(_0x4b351e,null))[_0x6e70('0x27')](saveUpdates(_0x3836e4[_0x6e70('0x4c')],null))[_0x6e70('0x27')](respondWithResult(_0x4b351e,null))[_0x6e70('0x4a')](handleError(_0x4b351e,null));};exports[_0x6e70('0x4d')]=function(_0x340674,_0x4ad5a9){return db[_0x6e70('0x42')][_0x6e70('0x49')]({'where':{'id':_0x340674[_0x6e70('0x46')]['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x4ad5a9,null))[_0x6e70('0x27')](removeEntity(_0x4ad5a9,null))['catch'](handleError(_0x4ad5a9,null));};exports['describe']=function(_0x2c5538,_0x2e3ea6){return db[_0x6e70('0x42')][_0x6e70('0x4e')]()[_0x6e70('0x27')](respondWithResult(_0x2e3ea6,null))['catch'](handleError(_0x2e3ea6,null));};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js
index 7e0d7ac..5808899 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 _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
+var _0x8362=['lodash','util','api','bluebird','./smsTransferReport.attributes','exports','define','report_sms_transfer'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x8362,0x70));var _0x2836=function(_0x2363e4,_0x4bb9b3){_0x2363e4=_0x2363e4-0x0;var _0x1f135a=_0x8362[_0x2363e4];return _0x1f135a;};'use strict';var _=require(_0x2836('0x0'));var util=require(_0x2836('0x1'));var logger=require('../../config/logger')(_0x2836('0x2'));var moment=require('moment');var BPromise=require(_0x2836('0x3'));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(_0x2836('0x4'));module[_0x2836('0x5')]=function(_0x5ec3c8,_0x396ba2){return _0x5ec3c8[_0x2836('0x6')]('SmsTransferReport',attributes,{'tableName':_0x2836('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js
index 0bcaa27..d5c018f 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 _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
+var _0x54fc=['../../config/environment','jayson/promise','http','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x36bb2b,_0x46916e){var _0x14c773=function(_0x40cf47){while(--_0x40cf47){_0x36bb2b['push'](_0x36bb2b['shift']());}};_0x14c773(++_0x46916e);}(_0x54fc,0xff));var _0xc54f=function(_0x51434c,_0x201593){_0x51434c=_0x51434c-0x0;var _0x1337ff=_0x54fc[_0x51434c];return _0x1337ff;};'use strict';var _=require(_0xc54f('0x0'));var util=require(_0xc54f('0x1'));var moment=require(_0xc54f('0x2'));var BPromise=require(_0xc54f('0x3'));var rs=require(_0xc54f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc54f('0x5'))['db'];var utils=require(_0xc54f('0x6'));var logger=require(_0xc54f('0x7'))(_0xc54f('0x8'));var config=require(_0xc54f('0x9'));var jayson=require(_0xc54f('0xa'));var client=jayson['client'][_0xc54f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16636c,_0xc31f40,_0x26601c){return new BPromise(function(_0x2a55ee,_0x244528){return client['request'](_0x16636c,_0x26601c)[_0xc54f('0xc')](function(_0x441523){logger[_0xc54f('0xd')](_0xc54f('0xe'),_0xc31f40,_0xc54f('0xf'));logger[_0xc54f('0x10')](_0xc54f('0x11'),_0xc31f40,_0xc54f('0xf'),JSON['stringify'](_0x441523));if(_0x441523[_0xc54f('0x12')]){if(_0x441523[_0xc54f('0x12')]['code']===0x1f4){logger['error'](_0xc54f('0xe'),_0xc31f40,_0x441523[_0xc54f('0x12')][_0xc54f('0x13')]);return _0x244528(_0x441523[_0xc54f('0x12')]['message']);}logger[_0xc54f('0x12')](_0xc54f('0xe'),_0xc31f40,_0x441523[_0xc54f('0x12')][_0xc54f('0x13')]);return _0x2a55ee(_0x441523[_0xc54f('0x12')][_0xc54f('0x13')]);}else{logger[_0xc54f('0xd')](_0xc54f('0xe'),_0xc31f40,_0xc54f('0xf'));_0x2a55ee(_0x441523[_0xc54f('0x14')][_0xc54f('0x13')]);}})[_0xc54f('0x15')](function(_0xc44878){logger['error'](_0xc54f('0xe'),_0xc31f40,_0xc44878);_0x244528(_0xc44878);});});}
\ No newline at end of file
diff --git a/server/api/sound/index.js b/server/api/sound/index.js
index 07a15db..68310b1 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 _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
+var _0xdd0d=['path','connect-timeout','express','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','originalname','replace','format','%s-%s%s','basename','now','post','file','create','put','update','delete','exports','util'];(function(_0x35fb83,_0x4be931){var _0x43ada0=function(_0x4bef4b){while(--_0x4bef4b){_0x35fb83['push'](_0x35fb83['shift']());}};_0x43ada0(++_0x4be931);}(_0xdd0d,0x103));var _0xddd0=function(_0x807901,_0x3416c0){_0x807901=_0x807901-0x0;var _0x908c66=_0xdd0d[_0x807901];return _0x908c66;};'use strict';var multer=require('multer');var util=require(_0xddd0('0x0'));var path=require(_0xddd0('0x1'));var timeout=require(_0xddd0('0x2'));var express=require(_0xddd0('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xddd0('0x4'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0xddd0('0x5')]('/',auth[_0xddd0('0x6')](),controller[_0xddd0('0x7')]);router['get'](_0xddd0('0x8'),auth[_0xddd0('0x6')](),controller[_0xddd0('0x9')]);router[_0xddd0('0x5')](_0xddd0('0xa'),auth[_0xddd0('0x6')](),controller[_0xddd0('0xb')]);var upload=multer({'storage':multer[_0xddd0('0xc')]({'destination':function(_0xc0ade6,_0x2f4df5,_0x299afc){_0x299afc(null,path['join'](config['root'],'server/files/sounds/original/'));},'filename':function(_0xc889d7,_0xf4a14d,_0x11e041){_0xf4a14d[_0xddd0('0xd')]=_0xf4a14d['originalname'][_0xddd0('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x11e041(null,util[_0xddd0('0xf')](_0xddd0('0x10'),path[_0xddd0('0x11')](_0xf4a14d[_0xddd0('0xd')],path['extname'](_0xf4a14d[_0xddd0('0xd')])),Date[_0xddd0('0x12')](),path['extname'](_0xf4a14d[_0xddd0('0xd')])));}})});router[_0xddd0('0x13')]('/',upload['single'](_0xddd0('0x14')),controller[_0xddd0('0x15')]);router[_0xddd0('0x16')](_0xddd0('0x8'),auth[_0xddd0('0x6')](),controller[_0xddd0('0x17')]);router[_0xddd0('0x18')](_0xddd0('0x8'),auth[_0xddd0('0x6')](),controller[_0xddd0('0x18')]);module[_0xddd0('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js
index 5337775..221e2c9 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 _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
+var _0x2138=['INTEGER','sequelize','exports','STRING','name','FLOAT','BIGINT'];(function(_0x3c2e1c,_0x6f1fe3){var _0x4c56e8=function(_0x1233ca){while(--_0x1233ca){_0x3c2e1c['push'](_0x3c2e1c['shift']());}};_0x4c56e8(++_0x6f1fe3);}(_0x2138,0x190));var _0x8213=function(_0x3a44a8,_0x5f0170){_0x3a44a8=_0x3a44a8-0x0;var _0x386bb7=_0x2138[_0x3a44a8];return _0x386bb7;};'use strict';var Sequelize=require(_0x8213('0x0'));module[_0x8213('0x1')]={'name':{'type':Sequelize[_0x8213('0x2')],'unique':_0x8213('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x8213('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x8213('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x8213('0x4')]},'original_sampleCount':{'type':Sequelize[_0x8213('0x5')]},'original_channelCount':{'type':Sequelize[_0x8213('0x6')]},'original_bitRate':{'type':Sequelize[_0x8213('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x8213('0x2')]},'converted_duration':{'type':Sequelize[_0x8213('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x8213('0x5')]},'converted_channelCount':{'type':Sequelize[_0x8213('0x6')]},'converted_bitRate':{'type':Sequelize[_0x8213('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x8213('0x6')]}};
\ No newline at end of file
diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js
index e9dd511..74fc50e 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 _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
+var _0xcb52=['end','json','count','limit','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','Sound','findAll','rows','params','include','find','catch','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','download','server/files/sounds/converted','format','%s.%s','basename','file','originalname','extname','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_channelCount','converted_sampleRate','body','userProfileId','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','server/files/sounds/original','original_format','html-pdf','eml-format','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/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status'];(function(_0x51cc55,_0x46925d){var _0x28ecbb=function(_0x5a58f8){while(--_0x5a58f8){_0x51cc55['push'](_0x51cc55['shift']());}};_0x28ecbb(++_0x46925d);}(_0xcb52,0x15c));var _0x2cb5=function(_0x5a451c,_0x33b7f1){_0x5a451c=_0x5a451c-0x0;var _0x5eade4=_0xcb52[_0x5a451c];return _0x5eade4;};'use strict';var pdf=require(_0x2cb5('0x0'));var emlformat=require(_0x2cb5('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2cb5('0x2'));var moment=require(_0x2cb5('0x3'));var BPromise=require(_0x2cb5('0x4'));var Mustache=require(_0x2cb5('0x5'));var util=require(_0x2cb5('0x6'));var path=require(_0x2cb5('0x7'));var sox=require(_0x2cb5('0x8'));var csv=require(_0x2cb5('0x9'));var ejs=require(_0x2cb5('0xa'));var fs=require('fs');var _=require(_0x2cb5('0xb'));var squel=require(_0x2cb5('0xc'));var crypto=require('crypto');var jsforce=require(_0x2cb5('0xd'));var deskjs=require(_0x2cb5('0xe'));var toCsv=require(_0x2cb5('0x9'));var querystring=require('querystring');var Papa=require(_0x2cb5('0xf'));var Redis=require(_0x2cb5('0x10'));var authService=require(_0x2cb5('0x11'));var qs=require(_0x2cb5('0x12'));var as=require(_0x2cb5('0x13'));var hardwareService=require(_0x2cb5('0x14'));var logger=require(_0x2cb5('0x15'))(_0x2cb5('0x16'));var utils=require(_0x2cb5('0x17'));var config=require('../../config/environment');var db=require(_0x2cb5('0x18'))['db'];function respondWithStatusCode(_0x2afd16,_0x1467bf){_0x1467bf=_0x1467bf||0xcc;return function(_0xde8b1a){if(_0xde8b1a){return _0x2afd16[_0x2cb5('0x19')](_0x1467bf);}return _0x2afd16[_0x2cb5('0x1a')](_0x1467bf)[_0x2cb5('0x1b')]();};}function respondWithResult(_0x2c374f,_0x1200c6){_0x1200c6=_0x1200c6||0xc8;return function(_0x27884c){if(_0x27884c){return _0x2c374f[_0x2cb5('0x1a')](_0x1200c6)[_0x2cb5('0x1c')](_0x27884c);}};}function respondWithFilteredResult(_0x930975,_0x328388){return function(_0x123f97){if(_0x123f97){var _0x5d404a=_0x123f97[_0x2cb5('0x1d')],_0x489990=_0x328388['offset'],_0x55447d=_0x328388['offset']+_0x328388[_0x2cb5('0x1e')],_0x55d413;if(_0x55447d>=_0x5d404a){_0x55447d=_0x5d404a;_0x55d413=0xc8;}else{_0x55d413=0xce;}_0x930975[_0x2cb5('0x1a')](_0x55d413);return _0x930975[_0x2cb5('0x1f')](_0x2cb5('0x20'),_0x489990+'-'+_0x55447d+'/'+_0x5d404a)['json'](_0x123f97);}return null;};}function patchUpdates(_0x30c128){return function(_0x536f18){try{jsonpatch['apply'](_0x536f18,_0x30c128,!![]);}catch(_0x5b31fd){return BPromise[_0x2cb5('0x21')](_0x5b31fd);}return _0x536f18[_0x2cb5('0x22')]();};}function saveUpdates(_0x58f357,_0x31eefc){return function(_0x4e4d4f){if(_0x4e4d4f){return _0x4e4d4f[_0x2cb5('0x23')](_0x58f357)['then'](function(_0x56e149){return _0x56e149;});}return null;};}function removeEntity(_0x4f2e03,_0x1d6c5d){return function(_0x43607e){if(_0x43607e){return _0x43607e['destroy']()[_0x2cb5('0x24')](function(){var _0x2a4bd5=_0x43607e[_0x2cb5('0x25')]({'plain':!![]});var _0x525e92='Sounds';return db[_0x2cb5('0x26')][_0x2cb5('0x27')]({'where':{'type':_0x525e92,'resourceId':_0x2a4bd5['id']}})[_0x2cb5('0x24')](function(){return _0x43607e;});})[_0x2cb5('0x24')](function(){_0x4f2e03[_0x2cb5('0x1a')](0xcc)[_0x2cb5('0x1b')]();});}};}function handleEntityNotFound(_0x4a172a,_0x4d08b7){return function(_0x353075){if(!_0x353075){_0x4a172a[_0x2cb5('0x19')](0x194);}return _0x353075;};}function handleError(_0xfb0eb1,_0x4bf07d){_0x4bf07d=_0x4bf07d||0x1f4;return function(_0x5a057d){logger[_0x2cb5('0x28')](_0x5a057d[_0x2cb5('0x29')]);if(_0x5a057d[_0x2cb5('0x2a')]){delete _0x5a057d[_0x2cb5('0x2a')];}_0xfb0eb1['status'](_0x4bf07d)[_0x2cb5('0x2b')](_0x5a057d);};}exports[_0x2cb5('0x2c')]=function(_0x62f7c,_0x561d2a){var _0x2171ee={},_0x1856f4={},_0x303693={'count':0x0,'rows':[]};var _0x5715c5=_[_0x2cb5('0x2d')](db['Sound'][_0x2cb5('0x2e')],function(_0x2ca118){return{'name':_0x2ca118[_0x2cb5('0x2f')],'type':_0x2ca118[_0x2cb5('0x30')]['key']};});_0x1856f4[_0x2cb5('0x31')]=_[_0x2cb5('0x2d')](_0x5715c5,_0x2cb5('0x2a'));_0x1856f4[_0x2cb5('0x32')]=_[_0x2cb5('0x33')](_0x62f7c[_0x2cb5('0x32')]);_0x1856f4['filters']=_[_0x2cb5('0x34')](_0x1856f4[_0x2cb5('0x31')],_0x1856f4[_0x2cb5('0x32')]);_0x2171ee[_0x2cb5('0x35')]=_[_0x2cb5('0x34')](_0x1856f4[_0x2cb5('0x31')],qs[_0x2cb5('0x36')](_0x62f7c[_0x2cb5('0x32')][_0x2cb5('0x36')]));_0x2171ee['attributes']=_0x2171ee['attributes'][_0x2cb5('0x37')]?_0x2171ee[_0x2cb5('0x35')]:_0x1856f4['model'];if(!_0x62f7c[_0x2cb5('0x32')][_0x2cb5('0x38')](_0x2cb5('0x39'))){_0x2171ee[_0x2cb5('0x1e')]=qs[_0x2cb5('0x1e')](_0x62f7c[_0x2cb5('0x32')][_0x2cb5('0x1e')]);_0x2171ee[_0x2cb5('0x3a')]=qs[_0x2cb5('0x3a')](_0x62f7c[_0x2cb5('0x32')][_0x2cb5('0x3a')]);}_0x2171ee[_0x2cb5('0x3b')]=qs[_0x2cb5('0x3c')](_0x62f7c[_0x2cb5('0x32')]['sort']);_0x2171ee[_0x2cb5('0x3d')]=qs[_0x2cb5('0x3e')](_[_0x2cb5('0x3f')](_0x62f7c[_0x2cb5('0x32')],_0x1856f4['filters']),_0x5715c5);if(_0x62f7c[_0x2cb5('0x32')]['filter']){_0x2171ee[_0x2cb5('0x3d')]=_['merge'](_0x2171ee[_0x2cb5('0x3d')],{'$or':_[_0x2cb5('0x2d')](_0x5715c5,function(_0x1f1df5){if(_0x1f1df5[_0x2cb5('0x30')]!==_0x2cb5('0x40')){var _0xd5c1a0={};_0xd5c1a0[_0x1f1df5[_0x2cb5('0x2a')]]={'$like':'%'+_0x62f7c[_0x2cb5('0x32')][_0x2cb5('0x41')]+'%'};return _0xd5c1a0;}})});}_0x2171ee=_[_0x2cb5('0x42')]({},_0x2171ee,_0x62f7c[_0x2cb5('0x43')]);var _0x18c1f3={'where':_0x2171ee[_0x2cb5('0x3d')]};return db['Sound']['count'](_0x18c1f3)[_0x2cb5('0x24')](function(_0xbe0221){_0x303693[_0x2cb5('0x1d')]=_0xbe0221;if(_0x62f7c['query'][_0x2cb5('0x44')]){_0x2171ee['include']=[{'all':!![]}];}return db[_0x2cb5('0x45')][_0x2cb5('0x46')](_0x2171ee);})[_0x2cb5('0x24')](function(_0x56b527){_0x303693[_0x2cb5('0x47')]=_0x56b527;return _0x303693;})[_0x2cb5('0x24')](respondWithFilteredResult(_0x561d2a,_0x2171ee))['catch'](handleError(_0x561d2a,null));};exports['show']=function(_0x555f75,_0x48891d){var _0x568d43={'raw':!![],'where':{'id':_0x555f75[_0x2cb5('0x48')]['id']}},_0x8f1d5={};_0x8f1d5['model']=_['keys'](db[_0x2cb5('0x45')][_0x2cb5('0x2e')]);_0x8f1d5['query']=_[_0x2cb5('0x33')](_0x555f75[_0x2cb5('0x32')]);_0x8f1d5[_0x2cb5('0x3e')]=_[_0x2cb5('0x34')](_0x8f1d5['model'],_0x8f1d5[_0x2cb5('0x32')]);_0x568d43['attributes']=_[_0x2cb5('0x34')](_0x8f1d5[_0x2cb5('0x31')],qs[_0x2cb5('0x36')](_0x555f75[_0x2cb5('0x32')][_0x2cb5('0x36')]));_0x568d43[_0x2cb5('0x35')]=_0x568d43[_0x2cb5('0x35')][_0x2cb5('0x37')]?_0x568d43[_0x2cb5('0x35')]:_0x8f1d5[_0x2cb5('0x31')];if(_0x555f75[_0x2cb5('0x32')][_0x2cb5('0x44')]){_0x568d43[_0x2cb5('0x49')]=[{'all':!![]}];}_0x568d43=_['merge']({},_0x568d43,_0x555f75['options']);return db['Sound'][_0x2cb5('0x4a')](_0x568d43)[_0x2cb5('0x24')](handleEntityNotFound(_0x48891d,null))[_0x2cb5('0x24')](respondWithResult(_0x48891d,null))[_0x2cb5('0x4b')](handleError(_0x48891d,null));};exports['download']=function(_0x4c2399,_0x3477eb,_0x4f16f9){return db[_0x2cb5('0x45')][_0x2cb5('0x4a')]({'where':{'id':_0x4c2399['params']['id']},'attributes':[_0x2cb5('0x2a'),_0x2cb5('0x4c'),_0x2cb5('0x4d')],'raw':!![]})[_0x2cb5('0x24')](handleEntityNotFound(_0x3477eb,null))['then'](function(_0x58dcec){if(_0x58dcec){if(!fs[_0x2cb5('0x4e')](path[_0x2cb5('0x4f')](config[_0x2cb5('0x50')],'server/files/sounds/converted',_0x58dcec[_0x2cb5('0x4c')]+'.'+_0x58dcec[_0x2cb5('0x4d')]))){throw new db[(_0x2cb5('0x51'))][(_0x2cb5('0x52'))](_0x2cb5('0x53'));}return _0x3477eb[_0x2cb5('0x54')](path[_0x2cb5('0x4f')](config[_0x2cb5('0x50')],_0x2cb5('0x55'),util[_0x2cb5('0x56')](_0x2cb5('0x57'),_0x58dcec[_0x2cb5('0x4c')],_0x58dcec[_0x2cb5('0x4d')])),util[_0x2cb5('0x56')](_0x2cb5('0x57'),_0x58dcec[_0x2cb5('0x2a')],_0x58dcec['converted_format']));}return null;})['catch'](handleError(_0x3477eb,null));};exports['create']=function(_0x354808,_0x549731,_0x5dc03a){var _0x2b4c20={'name':path[_0x2cb5('0x58')](_0x354808[_0x2cb5('0x59')][_0x2cb5('0x5a')],path[_0x2cb5('0x5b')](_0x354808[_0x2cb5('0x59')]['originalname'])),'save_name':path[_0x2cb5('0x58')](_0x354808[_0x2cb5('0x59')][_0x2cb5('0x5c')],path['extname'](_0x354808['file'][_0x2cb5('0x5c')])),'original_format':path[_0x2cb5('0x5b')](_0x354808[_0x2cb5('0x59')]['originalname'])[_0x2cb5('0x5d')](0x1),'converted_format':_0x2cb5('0x5e')};var _0x569b27=path[_0x2cb5('0x4f')](config['root'],'server/files/sounds/original',_0x354808[_0x2cb5('0x59')][_0x2cb5('0x5c')]);var _0xa03cfa=path[_0x2cb5('0x4f')](config['root'],_0x2cb5('0x55'),util[_0x2cb5('0x56')](_0x2cb5('0x57'),path['basename'](_0x354808[_0x2cb5('0x59')][_0x2cb5('0x5c')],path[_0x2cb5('0x5b')](_0x354808[_0x2cb5('0x59')][_0x2cb5('0x5c')])),_0x2b4c20['converted_format']));logger[_0x2cb5('0x5f')](_0x2cb5('0x60'),_0x569b27);logger[_0x2cb5('0x5f')]('Sound\x20upload\x20destination:\x20%s',_0xa03cfa);try{fs[_0x2cb5('0x61')](_0x569b27,parseInt(_0x2cb5('0x62'),0x8));var _0x5467eb=sox[_0x2cb5('0x63')](_0x569b27,_0xa03cfa,{'sampleRate':0x1f40,'format':_0x2cb5('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5467eb['on']('error',function(_0x37303f){fs[_0x2cb5('0x64')](_0x569b27);_0x549731[_0x2cb5('0x1a')](0x1f4)['send'](_0x37303f);});_0x5467eb['on'](_0x2cb5('0x65'),function(_0x205556){_0x2b4c20[_0x2cb5('0x66')]=isNaN(_0x205556[_0x2cb5('0x67')])?null:_0x205556[_0x2cb5('0x67')]*0x3e8;_0x2b4c20[_0x2cb5('0x68')]=isNaN(_0x205556['sampleCount'])?null:_0x205556[_0x2cb5('0x69')];_0x2b4c20[_0x2cb5('0x6a')]=isNaN(_0x205556[_0x2cb5('0x6b')])?null:_0x205556[_0x2cb5('0x6b')];_0x2b4c20[_0x2cb5('0x6c')]=isNaN(_0x205556[_0x2cb5('0x6d')])?null:_0x205556[_0x2cb5('0x6d')];_0x2b4c20[_0x2cb5('0x6e')]=isNaN(_0x205556[_0x2cb5('0x6f')])?null:_0x205556[_0x2cb5('0x6f')];});_0x5467eb['on']('dest',function(_0x243932){_0x2b4c20[_0x2cb5('0x70')]=isNaN(_0x243932[_0x2cb5('0x67')])?null:_0x243932[_0x2cb5('0x67')]*0x3e8;_0x2b4c20['converted_sampleCount']=isNaN(_0x243932[_0x2cb5('0x69')])?null:_0x243932[_0x2cb5('0x69')];_0x2b4c20[_0x2cb5('0x71')]=isNaN(_0x243932[_0x2cb5('0x6b')])?null:_0x243932[_0x2cb5('0x6b')];_0x2b4c20['converted_bitRate']=isNaN(_0x243932[_0x2cb5('0x6d')])?null:_0x243932[_0x2cb5('0x6d')];_0x2b4c20[_0x2cb5('0x72')]=isNaN(_0x243932[_0x2cb5('0x6f')])?null:_0x243932['sampleRate'];});_0x5467eb['on'](_0x2cb5('0x1b'),function(){fs['chmodSync'](_0xa03cfa,parseInt('0777',0x8));return db[_0x2cb5('0x45')]['create'](_0x2b4c20)['then'](function(_0xd411c5){var _0x5ad226={'role':_0x354808[_0x2cb5('0x73')]['role'],'userProfileId':_0x354808[_0x2cb5('0x73')][_0x2cb5('0x74')]};if(!_0x5ad226)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ad226[_0x2cb5('0x75')]===_0x2cb5('0x76')){var _0x333c0b=_0xd411c5[_0x2cb5('0x25')]({'plain':!![]});return db['UserProfileSection'][_0x2cb5('0x4a')]({'where':{'name':'Sounds','userProfileId':_0x5ad226[_0x2cb5('0x74')]},'raw':!![]})[_0x2cb5('0x24')](function(_0x28f5c1){if(_0x28f5c1&&_0x28f5c1[_0x2cb5('0x77')]===0x0){return db['UserProfileResource']['create']({'name':_0x333c0b[_0x2cb5('0x2a')],'resourceId':_0x333c0b['id'],'type':_0x28f5c1[_0x2cb5('0x2a')],'sectionId':_0x28f5c1['id']},{})['then'](function(){return _0xd411c5;});}else{return _0xd411c5;}})[_0x2cb5('0x4b')](function(_0xe3c1e8){logger[_0x2cb5('0x28')](_0x2cb5('0x78'),_0xe3c1e8);throw _0xe3c1e8;});}return _0xd411c5;})[_0x2cb5('0x24')](respondWithResult(_0x549731,null))[_0x2cb5('0x4b')](handleError(_0x549731,null));});_0x5467eb[_0x2cb5('0x79')]();}catch(_0x3e1bdc){_0x549731[_0x2cb5('0x1a')](0x1f4)[_0x2cb5('0x2b')](_0x3e1bdc);}};exports['update']=function(_0x12a5fb,_0x44d965,_0x3d7735){return db[_0x2cb5('0x45')][_0x2cb5('0x4a')]({'where':{'id':_0x12a5fb[_0x2cb5('0x48')]['id']}})[_0x2cb5('0x24')](handleEntityNotFound(_0x44d965,null))[_0x2cb5('0x24')](saveUpdates(_[_0x2cb5('0x3f')](_0x12a5fb[_0x2cb5('0x73')],[_0x2cb5('0x2a'),'description']),null))['then'](respondWithResult(_0x44d965,null))[_0x2cb5('0x4b')](handleError(_0x44d965,null));};exports[_0x2cb5('0x7a')]=function(_0x36844a,_0x513568,_0x2b36a2){return db[_0x2cb5('0x45')]['find']({'where':{'id':_0x36844a[_0x2cb5('0x48')]['id']}})[_0x2cb5('0x24')](function(_0x1c5402){if(_0x1c5402){return _0x1c5402[_0x2cb5('0x27')]();}})[_0x2cb5('0x24')](function(_0x43fe1b){var _0x45c6c3=path[_0x2cb5('0x4f')](config['root'],_0x2cb5('0x7b'),util[_0x2cb5('0x56')]('%s.%s',_0x43fe1b[_0x2cb5('0x4c')],_0x43fe1b[_0x2cb5('0x7c')]));var _0x46ccf3=path[_0x2cb5('0x4f')](config[_0x2cb5('0x50')],'server/files/sounds/converted',util[_0x2cb5('0x56')](_0x2cb5('0x57'),_0x43fe1b[_0x2cb5('0x4c')],_0x43fe1b['converted_format']));fs['unlinkSync'](_0x45c6c3);fs[_0x2cb5('0x64')](_0x46ccf3);return _0x43fe1b;})[_0x2cb5('0x24')](function(_0x2982e1){if(_0x2982e1){return _0x513568[_0x2cb5('0x1a')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x513568,null))[_0x2cb5('0x4b')](handleError(_0x513568,null));};
\ No newline at end of file
diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js
index 561540b..b15390b 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 _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
+var _0xc368=['Sound','tools_sounds','util','api','moment','bluebird','request-promise','path','../../config/environment','./sound.attributes','exports'];(function(_0x42e632,_0x179f86){var _0x5af8bb=function(_0x355cac){while(--_0x355cac){_0x42e632['push'](_0x42e632['shift']());}};_0x5af8bb(++_0x179f86);}(_0xc368,0x7b));var _0x8c36=function(_0x5e7359,_0x45e861){_0x5e7359=_0x5e7359-0x0;var _0x3962b6=_0xc368[_0x5e7359];return _0x3962b6;};'use strict';var _=require('lodash');var util=require(_0x8c36('0x0'));var logger=require('../../config/logger')(_0x8c36('0x1'));var moment=require(_0x8c36('0x2'));var BPromise=require(_0x8c36('0x3'));var rp=require(_0x8c36('0x4'));var fs=require('fs');var path=require(_0x8c36('0x5'));var rimraf=require('rimraf');var config=require(_0x8c36('0x6'));var attributes=require(_0x8c36('0x7'));module[_0x8c36('0x8')]=function(_0x1d3660,_0x5ebfc1){return _0x1d3660['define'](_0x8c36('0x9'),attributes,{'tableName':_0x8c36('0xa'),'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 7e76089..5b3372f 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 _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
+var _0x40d7=['model','attributes','ShowSound','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','Sound,\x20%s,\x20%s','message','catch','Sound','find','options','raw','where','map','include'];(function(_0x137c51,_0x1b0ab4){var _0x77b4d3=function(_0x246695){while(--_0x246695){_0x137c51['push'](_0x137c51['shift']());}};_0x77b4d3(++_0x1b0ab4);}(_0x40d7,0xbd));var _0x740d=function(_0x5af59e,_0x3771c1){_0x5af59e=_0x5af59e-0x0;var _0x4240df=_0x40d7[_0x5af59e];return _0x4240df;};'use strict';var _=require(_0x740d('0x0'));var util=require(_0x740d('0x1'));var moment=require(_0x740d('0x2'));var BPromise=require(_0x740d('0x3'));var rs=require(_0x740d('0x4'));var fs=require('fs');var Redis=require(_0x740d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x740d('0x6'))(_0x740d('0x7'));var config=require(_0x740d('0x8'));var jayson=require(_0x740d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xaefd6f,_0xc862d7,_0x3d3f43){return new BPromise(function(_0x35ff4c,_0x3372c9){return client[_0x740d('0xa')](_0xaefd6f,_0x3d3f43)[_0x740d('0xb')](function(_0x13e6b3){logger[_0x740d('0xc')]('Sound,\x20%s,\x20%s',_0xc862d7,_0x740d('0xd'));logger[_0x740d('0xe')](_0x740d('0xf'),_0xc862d7,_0x740d('0xd'),JSON['stringify'](_0x13e6b3));if(_0x13e6b3['error']){if(_0x13e6b3[_0x740d('0x10')][_0x740d('0x11')]===0x1f4){logger[_0x740d('0x10')](_0x740d('0x12'),_0xc862d7,_0x13e6b3[_0x740d('0x10')][_0x740d('0x13')]);return _0x3372c9(_0x13e6b3[_0x740d('0x10')]['message']);}logger[_0x740d('0x10')](_0x740d('0x12'),_0xc862d7,_0x13e6b3[_0x740d('0x10')][_0x740d('0x13')]);return _0x35ff4c(_0x13e6b3['error'][_0x740d('0x13')]);}else{logger[_0x740d('0xc')]('Sound,\x20%s,\x20%s',_0xc862d7,_0x740d('0xd'));_0x35ff4c(_0x13e6b3['result'][_0x740d('0x13')]);}})[_0x740d('0x14')](function(_0x181825){logger['error']('Sound,\x20%s,\x20%s',_0xc862d7,_0x181825);_0x3372c9(_0x181825);});});}exports['ShowSound']=function(_0x1c611e){var _0x2be2c4=this;return new Promise(function(_0x5ad03f,_0x49febf){return db[_0x740d('0x15')][_0x740d('0x16')]({'raw':_0x1c611e[_0x740d('0x17')]?_0x1c611e[_0x740d('0x17')][_0x740d('0x18')]===undefined?!![]:![]:!![],'where':_0x1c611e[_0x740d('0x17')]?_0x1c611e[_0x740d('0x17')][_0x740d('0x19')]||null:null,'attributes':_0x1c611e['options']?_0x1c611e[_0x740d('0x17')]['attributes']||null:null,'include':_0x1c611e['options']?_0x1c611e['options']['include']?_[_0x740d('0x1a')](_0x1c611e[_0x740d('0x17')][_0x740d('0x1b')],function(_0xac13e4){return{'model':db[_0xac13e4[_0x740d('0x1c')]],'as':_0xac13e4['as'],'attributes':_0xac13e4[_0x740d('0x1d')],'include':_0xac13e4['include']?_['map'](_0xac13e4[_0x740d('0x1b')],function(_0x2fa8d0){return{'model':db[_0x2fa8d0[_0x740d('0x1c')]],'as':_0x2fa8d0['as'],'attributes':_0x2fa8d0[_0x740d('0x1d')],'include':_0x2fa8d0[_0x740d('0x1b')]?_[_0x740d('0x1a')](_0x2fa8d0[_0x740d('0x1b')],function(_0x40b6b8){return{'model':db[_0x40b6b8[_0x740d('0x1c')]],'as':_0x40b6b8['as'],'attributes':_0x40b6b8[_0x740d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d9d0d){logger['info'](_0x740d('0x1e'),_0x1c611e);logger[_0x740d('0xe')](_0x740d('0x1e'),_0x1c611e,JSON['stringify'](_0x2d9d0d));_0x5ad03f(_0x2d9d0d);})[_0x740d('0x14')](function(_0x1ee127){logger[_0x740d('0x10')](_0x740d('0x1e'),_0x1ee127[_0x740d('0x13')],_0x1c611e);_0x49febf(_0x2be2c4[_0x740d('0x10')](0x1f4,_0x1ee127[_0x740d('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js
index 2efecb6..cbb4c2a 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 _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
+var _0xf9d8=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareMessage.controller','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x3828b2,_0x3f20a9){var _0x459805=function(_0x2d52ca){while(--_0x2d52ca){_0x3828b2['push'](_0x3828b2['shift']());}};_0x459805(++_0x3f20a9);}(_0xf9d8,0x1d0));var _0x8f9d=function(_0x4bb36a,_0x424329){_0x4bb36a=_0x4bb36a-0x0;var _0x5b1f2d=_0xf9d8[_0x4bb36a];return _0x5b1f2d;};'use strict';var multer=require(_0x8f9d('0x0'));var util=require(_0x8f9d('0x1'));var path=require(_0x8f9d('0x2'));var timeout=require(_0x8f9d('0x3'));var express=require(_0x8f9d('0x4'));var router=express[_0x8f9d('0x5')]();var auth=require(_0x8f9d('0x6'));var interaction=require(_0x8f9d('0x7'));var config=require('../../config/environment');var controller=require(_0x8f9d('0x8'));router[_0x8f9d('0x9')]('/',auth[_0x8f9d('0xa')](),controller['index']);router['get'](_0x8f9d('0xb'),auth['isAuthenticated'](),controller[_0x8f9d('0xc')]);router[_0x8f9d('0xd')]('/',auth['isAuthenticated'](),controller[_0x8f9d('0xe')]);router[_0x8f9d('0xf')](_0x8f9d('0xb'),auth[_0x8f9d('0xa')](),controller[_0x8f9d('0x10')]);router[_0x8f9d('0x11')](_0x8f9d('0xb'),auth[_0x8f9d('0xa')](),controller[_0x8f9d('0x12')]);module[_0x8f9d('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js
index b9cf1a8..880cb47 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 _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
+var _0x8ea8=['ENUM','out','sequelize','TEXT','medium'];(function(_0x19c1ca,_0x881113){var _0x5960af=function(_0x3e568f){while(--_0x3e568f){_0x19c1ca['push'](_0x19c1ca['shift']());}};_0x5960af(++_0x881113);}(_0x8ea8,0xf2));var _0x88ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x88ea('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x88ea('0x1')](_0x88ea('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x88ea('0x3')]('in',_0x88ea('0x4')),'defaultValue':_0x88ea('0x4'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js
index 45e929a..77dfa9c 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 _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
+var _0xb65e=['status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','SquareMessage','includeAll','include','findAll','rows','catch','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb65e,0x130));var _0xeb65=function(_0x26e1b0,_0x2c098d){_0x26e1b0=_0x26e1b0-0x0;var _0x3d1eb1=_0xb65e[_0x26e1b0];return _0x3d1eb1;};'use strict';var pdf=require(_0xeb65('0x0'));var emlformat=require(_0xeb65('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xeb65('0x2'));var jsonpatch=require(_0xeb65('0x3'));var rp=require('request-promise');var moment=require(_0xeb65('0x4'));var BPromise=require(_0xeb65('0x5'));var Mustache=require(_0xeb65('0x6'));var util=require('util');var path=require(_0xeb65('0x7'));var sox=require(_0xeb65('0x8'));var csv=require('to-csv');var ejs=require(_0xeb65('0x9'));var fs=require('fs');var _=require(_0xeb65('0xa'));var squel=require('squel');var crypto=require(_0xeb65('0xb'));var jsforce=require(_0xeb65('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xeb65('0xd'));var qs=require(_0xeb65('0xe'));var as=require(_0xeb65('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb65('0x10'));var utils=require(_0xeb65('0x11'));var config=require(_0xeb65('0x12'));var db=require(_0xeb65('0x13'))['db'];function respondWithStatusCode(_0x459642,_0x26fccd){_0x26fccd=_0x26fccd||0xcc;return function(_0x33a429){if(_0x33a429){return _0x459642[_0xeb65('0x14')](_0x26fccd);}return _0x459642[_0xeb65('0x15')](_0x26fccd)[_0xeb65('0x16')]();};}function respondWithResult(_0x150ce1,_0x1563d7){_0x1563d7=_0x1563d7||0xc8;return function(_0x1db587){if(_0x1db587){return _0x150ce1[_0xeb65('0x15')](_0x1563d7)[_0xeb65('0x17')](_0x1db587);}};}function respondWithFilteredResult(_0x4e2803,_0x20b98d){return function(_0x5dc4b2){if(_0x5dc4b2){var _0x4c3357=_0x5dc4b2[_0xeb65('0x18')],_0x337943=_0x20b98d[_0xeb65('0x19')],_0x2782ef=_0x20b98d[_0xeb65('0x19')]+_0x20b98d[_0xeb65('0x1a')],_0x5ac3a1;if(_0x2782ef>=_0x4c3357){_0x2782ef=_0x4c3357;_0x5ac3a1=0xc8;}else{_0x5ac3a1=0xce;}_0x4e2803['status'](_0x5ac3a1);return _0x4e2803[_0xeb65('0x1b')](_0xeb65('0x1c'),_0x337943+'-'+_0x2782ef+'/'+_0x4c3357)['json'](_0x5dc4b2);}return null;};}function patchUpdates(_0x588864){return function(_0xbc9586){try{jsonpatch[_0xeb65('0x1d')](_0xbc9586,_0x588864,!![]);}catch(_0x5a16f6){return BPromise[_0xeb65('0x1e')](_0x5a16f6);}return _0xbc9586['save']();};}function saveUpdates(_0x2cdcfe,_0x2f9597){return function(_0x3c5743){if(_0x3c5743){return _0x3c5743[_0xeb65('0x1f')](_0x2cdcfe)[_0xeb65('0x20')](function(_0x34fc29){return _0x34fc29;});}return null;};}function removeEntity(_0x1d7505,_0x5ba6f7){return function(_0x152834){if(_0x152834){return _0x152834[_0xeb65('0x21')]()[_0xeb65('0x20')](function(){_0x1d7505[_0xeb65('0x15')](0xcc)[_0xeb65('0x16')]();});}};}function handleEntityNotFound(_0x5bcd9a,_0x3bca25){return function(_0x3d1ee3){if(!_0x3d1ee3){_0x5bcd9a[_0xeb65('0x14')](0x194);}return _0x3d1ee3;};}function handleError(_0x49e807,_0x22f7a1){_0x22f7a1=_0x22f7a1||0x1f4;return function(_0x11b818){logger[_0xeb65('0x22')](_0x11b818['stack']);if(_0x11b818[_0xeb65('0x23')]){delete _0x11b818[_0xeb65('0x23')];}_0x49e807[_0xeb65('0x15')](_0x22f7a1)['send'](_0x11b818);};}exports['index']=function(_0x56a3a9,_0x54e398){var _0x3e7aef={},_0x4b0108={},_0x14f07a={'count':0x0,'rows':[]};var _0xaf5224=_[_0xeb65('0x24')](db['SquareMessage'][_0xeb65('0x25')],function(_0x59739b){return{'name':_0x59739b[_0xeb65('0x26')],'type':_0x59739b['type']['key']};});_0x4b0108[_0xeb65('0x27')]=_['map'](_0xaf5224,'name');_0x4b0108[_0xeb65('0x28')]=_[_0xeb65('0x29')](_0x56a3a9[_0xeb65('0x28')]);_0x4b0108[_0xeb65('0x2a')]=_[_0xeb65('0x2b')](_0x4b0108['model'],_0x4b0108['query']);_0x3e7aef[_0xeb65('0x2c')]=_[_0xeb65('0x2b')](_0x4b0108[_0xeb65('0x27')],qs[_0xeb65('0x2d')](_0x56a3a9[_0xeb65('0x28')][_0xeb65('0x2d')]));_0x3e7aef['attributes']=_0x3e7aef['attributes'][_0xeb65('0x2e')]?_0x3e7aef[_0xeb65('0x2c')]:_0x4b0108[_0xeb65('0x27')];if(!_0x56a3a9[_0xeb65('0x28')][_0xeb65('0x2f')](_0xeb65('0x30'))){_0x3e7aef['limit']=qs[_0xeb65('0x1a')](_0x56a3a9[_0xeb65('0x28')]['limit']);_0x3e7aef[_0xeb65('0x19')]=qs[_0xeb65('0x19')](_0x56a3a9[_0xeb65('0x28')]['offset']);}_0x3e7aef[_0xeb65('0x31')]=qs[_0xeb65('0x32')](_0x56a3a9['query']['sort']);_0x3e7aef[_0xeb65('0x33')]=qs[_0xeb65('0x2a')](_['pick'](_0x56a3a9['query'],_0x4b0108[_0xeb65('0x2a')]),_0xaf5224);if(_0x56a3a9[_0xeb65('0x28')][_0xeb65('0x34')]){_0x3e7aef['where']=_['merge'](_0x3e7aef['where'],{'$or':_['map'](_0xaf5224,function(_0x26e1ef){if(_0x26e1ef['type']!=='VIRTUAL'){var _0x5592ba={};_0x5592ba[_0x26e1ef[_0xeb65('0x23')]]={'$like':'%'+_0x56a3a9['query']['filter']+'%'};return _0x5592ba;}})});}_0x3e7aef=_[_0xeb65('0x35')]({},_0x3e7aef,_0x56a3a9[_0xeb65('0x36')]);var _0x150690={'where':_0x3e7aef[_0xeb65('0x33')]};return db[_0xeb65('0x37')]['count'](_0x150690)[_0xeb65('0x20')](function(_0x4be961){_0x14f07a[_0xeb65('0x18')]=_0x4be961;if(_0x56a3a9[_0xeb65('0x28')][_0xeb65('0x38')]){_0x3e7aef[_0xeb65('0x39')]=[{'all':!![]}];}return db['SquareMessage'][_0xeb65('0x3a')](_0x3e7aef);})[_0xeb65('0x20')](function(_0x1f68b6){_0x14f07a[_0xeb65('0x3b')]=_0x1f68b6;return _0x14f07a;})['then'](respondWithFilteredResult(_0x54e398,_0x3e7aef))[_0xeb65('0x3c')](handleError(_0x54e398,null));};exports['show']=function(_0x42a13b,_0x558dc8){var _0x1f723a={'raw':!![],'where':{'id':_0x42a13b['params']['id']}},_0x158419={};_0x158419['model']=_[_0xeb65('0x29')](db[_0xeb65('0x37')][_0xeb65('0x25')]);_0x158419['query']=_[_0xeb65('0x29')](_0x42a13b[_0xeb65('0x28')]);_0x158419[_0xeb65('0x2a')]=_[_0xeb65('0x2b')](_0x158419[_0xeb65('0x27')],_0x158419[_0xeb65('0x28')]);_0x1f723a[_0xeb65('0x2c')]=_[_0xeb65('0x2b')](_0x158419[_0xeb65('0x27')],qs[_0xeb65('0x2d')](_0x42a13b[_0xeb65('0x28')]['fields']));_0x1f723a[_0xeb65('0x2c')]=_0x1f723a[_0xeb65('0x2c')][_0xeb65('0x2e')]?_0x1f723a[_0xeb65('0x2c')]:_0x158419[_0xeb65('0x27')];if(_0x42a13b['query']['includeAll']){_0x1f723a[_0xeb65('0x39')]=[{'all':!![]}];}_0x1f723a=_[_0xeb65('0x35')]({},_0x1f723a,_0x42a13b[_0xeb65('0x36')]);return db[_0xeb65('0x37')][_0xeb65('0x3d')](_0x1f723a)[_0xeb65('0x20')](handleEntityNotFound(_0x558dc8,null))['then'](respondWithResult(_0x558dc8,null))['catch'](handleError(_0x558dc8,null));};exports[_0xeb65('0x3e')]=function(_0x4827a2,_0x3ac699){return db[_0xeb65('0x37')][_0xeb65('0x3e')](_0x4827a2[_0xeb65('0x3f')],{})['then'](respondWithResult(_0x3ac699,0xc9))[_0xeb65('0x3c')](handleError(_0x3ac699,null));};exports[_0xeb65('0x1f')]=function(_0x5a9f4e,_0x3c0acc){if(_0x5a9f4e[_0xeb65('0x3f')]['id']){delete _0x5a9f4e[_0xeb65('0x3f')]['id'];}return db[_0xeb65('0x37')]['find']({'where':{'id':_0x5a9f4e[_0xeb65('0x40')]['id']}})[_0xeb65('0x20')](handleEntityNotFound(_0x3c0acc,null))[_0xeb65('0x20')](saveUpdates(_0x5a9f4e['body'],null))['then'](respondWithResult(_0x3c0acc,null))[_0xeb65('0x3c')](handleError(_0x3c0acc,null));};exports[_0xeb65('0x21')]=function(_0x5e6116,_0x5a4096){return db['SquareMessage'][_0xeb65('0x3d')]({'where':{'id':_0x5e6116[_0xeb65('0x40')]['id']}})['then'](handleEntityNotFound(_0x5a4096,null))[_0xeb65('0x20')](removeEntity(_0x5a4096,null))[_0xeb65('0x3c')](handleError(_0x5a4096,null));};
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js
index 6611295..4655f91 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 _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
+var _0xdc97=['path','../../config/environment','./squareMessage.attributes','exports','define','lodash','util','../../config/logger','moment','request-promise'];(function(_0x571bbc,_0x242132){var _0x3e8edb=function(_0x5cc0a2){while(--_0x5cc0a2){_0x571bbc['push'](_0x571bbc['shift']());}};_0x3e8edb(++_0x242132);}(_0xdc97,0x13b));var _0x7dc9=function(_0x3a8fb1,_0x1c084d){_0x3a8fb1=_0x3a8fb1-0x0;var _0x42ecde=_0xdc97[_0x3a8fb1];return _0x42ecde;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var logger=require(_0x7dc9('0x2'))('api');var moment=require(_0x7dc9('0x3'));var BPromise=require('bluebird');var rp=require(_0x7dc9('0x4'));var fs=require('fs');var path=require(_0x7dc9('0x5'));var rimraf=require('rimraf');var config=require(_0x7dc9('0x6'));var attributes=require(_0x7dc9('0x7'));module[_0x7dc9('0x8')]=function(_0x3ba3ca,_0x589f02){return _0x3ba3ca[_0x7dc9('0x9')]('SquareMessage',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 6d92c63..480e40a 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 _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
+var _0x31c2=['request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','then','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x2fa0c6,_0x45fbeb){var _0x36ffb0=function(_0x3e82f1){while(--_0x3e82f1){_0x2fa0c6['push'](_0x2fa0c6['shift']());}};_0x36ffb0(++_0x45fbeb);}(_0x31c2,0x1e1));var _0x231c=function(_0x2d06cd,_0x1b435c){_0x2d06cd=_0x2d06cd-0x0;var _0xf450f8=_0x31c2[_0x2d06cd];return _0xf450f8;};'use strict';var _=require(_0x231c('0x0'));var util=require(_0x231c('0x1'));var moment=require(_0x231c('0x2'));var BPromise=require(_0x231c('0x3'));var rs=require(_0x231c('0x4'));var fs=require('fs');var Redis=require(_0x231c('0x5'));var db=require(_0x231c('0x6'))['db'];var utils=require(_0x231c('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x231c('0x8'));var jayson=require(_0x231c('0x9'));var client=jayson[_0x231c('0xa')][_0x231c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48bfb2,_0x111bf9,_0x49ff9e){return new BPromise(function(_0x439df8,_0x38b3b9){return client[_0x231c('0xc')](_0x48bfb2,_0x49ff9e)['then'](function(_0x2524bf){logger[_0x231c('0xd')](_0x231c('0xe'),_0x111bf9,_0x231c('0xf'));logger[_0x231c('0x10')](_0x231c('0x11'),_0x111bf9,_0x231c('0xf'),JSON['stringify'](_0x2524bf));if(_0x2524bf[_0x231c('0x12')]){if(_0x2524bf[_0x231c('0x12')]['code']===0x1f4){logger[_0x231c('0x12')](_0x231c('0xe'),_0x111bf9,_0x2524bf[_0x231c('0x12')][_0x231c('0x13')]);return _0x38b3b9(_0x2524bf[_0x231c('0x12')][_0x231c('0x13')]);}logger[_0x231c('0x12')](_0x231c('0xe'),_0x111bf9,_0x2524bf[_0x231c('0x12')][_0x231c('0x13')]);return _0x439df8(_0x2524bf[_0x231c('0x12')][_0x231c('0x13')]);}else{logger[_0x231c('0xd')](_0x231c('0xe'),_0x111bf9,_0x231c('0xf'));_0x439df8(_0x2524bf[_0x231c('0x14')][_0x231c('0x13')]);}})[_0x231c('0x15')](function(_0x1852e5){logger[_0x231c('0x12')]('SquareMessage,\x20%s,\x20%s',_0x111bf9,_0x1852e5);_0x38b3b9(_0x1852e5);});});}exports[_0x231c('0x16')]=function(_0x341645){var _0x17f9ce=this;return new Promise(function(_0xadea80,_0x36aebc){return db[_0x231c('0x17')][_0x231c('0x18')](_0x341645[_0x231c('0x19')],{'raw':_0x341645[_0x231c('0x1a')]?_0x341645[_0x231c('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x231c('0x1b')](function(_0x5e8a53){logger[_0x231c('0xd')]('CreateSquareMessage',_0x341645);logger[_0x231c('0x10')](_0x231c('0x16'),_0x341645,JSON[_0x231c('0x1c')](_0x5e8a53));_0xadea80(_0x5e8a53);})[_0x231c('0x15')](function(_0x255671){logger[_0x231c('0x12')](_0x231c('0x16'),_0x255671[_0x231c('0x13')],_0x341645);_0x36aebc(_0x17f9ce['error'](0x1f4,_0x255671[_0x231c('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js
index f5189fe..9b386ba 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 _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
+var _0xbfd9=['update','delete','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','get','/:id','show','test','post','create','put'];(function(_0x2d37b7,_0x3bf618){var _0x4dfbdb=function(_0x18fc40){while(--_0x18fc40){_0x2d37b7['push'](_0x2d37b7['shift']());}};_0x4dfbdb(++_0x3bf618);}(_0xbfd9,0x1d0));var _0x9bfd=function(_0x1ff2c6,_0x21c9b8){_0x1ff2c6=_0x1ff2c6-0x0;var _0x308eb9=_0xbfd9[_0x1ff2c6];return _0x308eb9;};'use strict';var multer=require('multer');var util=require(_0x9bfd('0x0'));var path=require('path');var timeout=require(_0x9bfd('0x1'));var express=require(_0x9bfd('0x2'));var router=express['Router']();var auth=require(_0x9bfd('0x3'));var interaction=require(_0x9bfd('0x4'));var config=require(_0x9bfd('0x5'));var controller=require(_0x9bfd('0x6'));router['get']('/',auth[_0x9bfd('0x7')](),controller[_0x9bfd('0x8')]);router[_0x9bfd('0x9')](_0x9bfd('0xa'),auth[_0x9bfd('0x7')](),controller[_0x9bfd('0xb')]);router[_0x9bfd('0x9')]('/:id/test',auth[_0x9bfd('0x7')](),timeout('15s'),controller[_0x9bfd('0xc')]);router[_0x9bfd('0xd')]('/',auth['isAuthenticated'](),controller[_0x9bfd('0xe')]);router[_0x9bfd('0xf')](_0x9bfd('0xa'),auth[_0x9bfd('0x7')](),controller[_0x9bfd('0x10')]);router[_0x9bfd('0x11')](_0x9bfd('0xa'),auth[_0x9bfd('0x7')](),controller[_0x9bfd('0x12')]);module[_0x9bfd('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js
index 057b296..acf9fa0 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 _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
+var _0x8421=['STRING','name','sequelize'];(function(_0x47e522,_0x3d2cb1){var _0x4f1f78=function(_0x27b351){while(--_0x27b351){_0x47e522['push'](_0x47e522['shift']());}};_0x4f1f78(++_0x3d2cb1);}(_0x8421,0x1b5));var _0x1842=function(_0x1cd93a,_0x4399b7){_0x1cd93a=_0x1cd93a-0x0;var _0x11e592=_0x8421[_0x1cd93a];return _0x11e592;};'use strict';var Sequelize=require(_0x1842('0x0'));module['exports']={'name':{'type':Sequelize[_0x1842('0x1')],'unique':_0x1842('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x1842('0x1')]},'description':{'type':Sequelize[_0x1842('0x1')]}};
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js
index 576a6bf..f1d5772 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 _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
+var _0xffe5=['set','Content-Range','apply','reject','destroy','then','get','ODBC','error','stack','name','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','params','options','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','update','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status'];(function(_0xffb12e,_0x72099d){var _0xc4bce8=function(_0x13178f){while(--_0x13178f){_0xffb12e['push'](_0xffb12e['shift']());}};_0xc4bce8(++_0x72099d);}(_0xffe5,0x1e5));var _0x5ffe=function(_0x29a72f,_0xd8b4b5){_0x29a72f=_0x29a72f-0x0;var _0x31527d=_0xffe5[_0x29a72f];return _0x31527d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5ffe('0x0'));var rimraf=require(_0x5ffe('0x1'));var zipdir=require(_0x5ffe('0x2'));var jsonpatch=require(_0x5ffe('0x3'));var rp=require('request-promise');var moment=require(_0x5ffe('0x4'));var BPromise=require(_0x5ffe('0x5'));var Mustache=require('mustache');var util=require(_0x5ffe('0x6'));var path=require(_0x5ffe('0x7'));var sox=require(_0x5ffe('0x8'));var csv=require(_0x5ffe('0x9'));var ejs=require(_0x5ffe('0xa'));var fs=require('fs');var _=require(_0x5ffe('0xb'));var squel=require('squel');var crypto=require(_0x5ffe('0xc'));var jsforce=require(_0x5ffe('0xd'));var deskjs=require(_0x5ffe('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5ffe('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5ffe('0x10'));var as=require(_0x5ffe('0x11'));var hardwareService=require(_0x5ffe('0x12'));var logger=require(_0x5ffe('0x13'))(_0x5ffe('0x14'));var utils=require(_0x5ffe('0x15'));var config=require(_0x5ffe('0x16'));var db=require(_0x5ffe('0x17'))['db'];function respondWithStatusCode(_0x111333,_0x47b040){_0x47b040=_0x47b040||0xcc;return function(_0x3c4f14){if(_0x3c4f14){return _0x111333[_0x5ffe('0x18')](_0x47b040);}return _0x111333['status'](_0x47b040)[_0x5ffe('0x19')]();};}function respondWithResult(_0x33b31b,_0xc49378){_0xc49378=_0xc49378||0xc8;return function(_0x3b9f01){if(_0x3b9f01){return _0x33b31b['status'](_0xc49378)[_0x5ffe('0x1a')](_0x3b9f01);}};}function respondWithFilteredResult(_0x53ae6a,_0x3eda95){return function(_0x1cf3d2){if(_0x1cf3d2){var _0x497315=_0x1cf3d2[_0x5ffe('0x1b')],_0x4c03e1=_0x3eda95[_0x5ffe('0x1c')],_0x535342=_0x3eda95[_0x5ffe('0x1c')]+_0x3eda95[_0x5ffe('0x1d')],_0x1c45c1;if(_0x535342>=_0x497315){_0x535342=_0x497315;_0x1c45c1=0xc8;}else{_0x1c45c1=0xce;}_0x53ae6a[_0x5ffe('0x1e')](_0x1c45c1);return _0x53ae6a[_0x5ffe('0x1f')](_0x5ffe('0x20'),_0x4c03e1+'-'+_0x535342+'/'+_0x497315)[_0x5ffe('0x1a')](_0x1cf3d2);}return null;};}function patchUpdates(_0x45ae8b){return function(_0x4acaf3){try{jsonpatch[_0x5ffe('0x21')](_0x4acaf3,_0x45ae8b,!![]);}catch(_0x54b91d){return BPromise[_0x5ffe('0x22')](_0x54b91d);}return _0x4acaf3['save']();};}function saveUpdates(_0x472377,_0x16138c){return function(_0x11b34d){if(_0x11b34d){return _0x11b34d['update'](_0x472377)['then'](function(_0x58cb60){return _0x58cb60;});}return null;};}function removeEntity(_0x51c063,_0x1ab861){return function(_0x3ee8fb){if(_0x3ee8fb){return _0x3ee8fb[_0x5ffe('0x23')]()[_0x5ffe('0x24')](function(){var _0xb7c8ba=_0x3ee8fb[_0x5ffe('0x25')]({'plain':!![]});var _0x698781=_0x5ffe('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x698781,'resourceId':_0xb7c8ba['id']}})[_0x5ffe('0x24')](function(){return _0x3ee8fb;});})['then'](function(){_0x51c063[_0x5ffe('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2314a4,_0x1a0de6){return function(_0x16054d){if(!_0x16054d){_0x2314a4['sendStatus'](0x194);}return _0x16054d;};}function handleError(_0x523447,_0x29ba95){_0x29ba95=_0x29ba95||0x1f4;return function(_0x508f3b){logger[_0x5ffe('0x27')](_0x508f3b[_0x5ffe('0x28')]);if(_0x508f3b[_0x5ffe('0x29')]){delete _0x508f3b[_0x5ffe('0x29')];}_0x523447[_0x5ffe('0x1e')](_0x29ba95)['send'](_0x508f3b);};}exports[_0x5ffe('0x2a')]=function(_0x31423a,_0x12b89e){var _0x5096fc={},_0x1975ca={},_0x57a6a5={'count':0x0,'rows':[]};var _0x1bfdb4=_[_0x5ffe('0x2b')](db[_0x5ffe('0x2c')][_0x5ffe('0x2d')],function(_0x462fd7){return{'name':_0x462fd7[_0x5ffe('0x2e')],'type':_0x462fd7[_0x5ffe('0x2f')][_0x5ffe('0x30')]};});_0x1975ca[_0x5ffe('0x31')]=_[_0x5ffe('0x2b')](_0x1bfdb4,_0x5ffe('0x29'));_0x1975ca[_0x5ffe('0x32')]=_[_0x5ffe('0x33')](_0x31423a[_0x5ffe('0x32')]);_0x1975ca[_0x5ffe('0x34')]=_[_0x5ffe('0x35')](_0x1975ca['model'],_0x1975ca[_0x5ffe('0x32')]);_0x5096fc[_0x5ffe('0x36')]=_[_0x5ffe('0x35')](_0x1975ca['model'],qs[_0x5ffe('0x37')](_0x31423a['query'][_0x5ffe('0x37')]));_0x5096fc[_0x5ffe('0x36')]=_0x5096fc[_0x5ffe('0x36')][_0x5ffe('0x38')]?_0x5096fc[_0x5ffe('0x36')]:_0x1975ca[_0x5ffe('0x31')];if(!_0x31423a[_0x5ffe('0x32')][_0x5ffe('0x39')](_0x5ffe('0x3a'))){_0x5096fc['limit']=qs[_0x5ffe('0x1d')](_0x31423a[_0x5ffe('0x32')][_0x5ffe('0x1d')]);_0x5096fc['offset']=qs[_0x5ffe('0x1c')](_0x31423a['query'][_0x5ffe('0x1c')]);}_0x5096fc['order']=qs['sort'](_0x31423a[_0x5ffe('0x32')][_0x5ffe('0x3b')]);_0x5096fc['where']=qs[_0x5ffe('0x34')](_[_0x5ffe('0x3c')](_0x31423a[_0x5ffe('0x32')],_0x1975ca[_0x5ffe('0x34')]),_0x1bfdb4);if(_0x31423a[_0x5ffe('0x32')][_0x5ffe('0x3d')]){_0x5096fc[_0x5ffe('0x3e')]=_[_0x5ffe('0x3f')](_0x5096fc[_0x5ffe('0x3e')],{'$or':_[_0x5ffe('0x2b')](_0x1bfdb4,function(_0xa83bdc){if(_0xa83bdc[_0x5ffe('0x2f')]!==_0x5ffe('0x40')){var _0xa3a7d0={};_0xa3a7d0[_0xa83bdc[_0x5ffe('0x29')]]={'$like':'%'+_0x31423a[_0x5ffe('0x32')][_0x5ffe('0x3d')]+'%'};return _0xa3a7d0;}})});}_0x5096fc=_['merge']({},_0x5096fc,_0x31423a['options']);var _0x476b02={'where':_0x5096fc['where']};return db[_0x5ffe('0x2c')][_0x5ffe('0x1b')](_0x476b02)[_0x5ffe('0x24')](function(_0x59a412){_0x57a6a5['count']=_0x59a412;if(_0x31423a[_0x5ffe('0x32')][_0x5ffe('0x41')]){_0x5096fc['include']=[{'all':!![]}];}return db[_0x5ffe('0x2c')][_0x5ffe('0x42')](_0x5096fc);})[_0x5ffe('0x24')](function(_0x554360){_0x57a6a5['rows']=_0x554360;return _0x57a6a5;})[_0x5ffe('0x24')](respondWithFilteredResult(_0x12b89e,_0x5096fc))[_0x5ffe('0x43')](handleError(_0x12b89e,null));};exports['show']=function(_0x4b26d1,_0x30b535){var _0xbe27b1={'raw':!![],'where':{'id':_0x4b26d1[_0x5ffe('0x44')]['id']}},_0x10c233={};_0x10c233[_0x5ffe('0x31')]=_['keys'](db['SquareOdbc'][_0x5ffe('0x2d')]);_0x10c233[_0x5ffe('0x32')]=_[_0x5ffe('0x33')](_0x4b26d1[_0x5ffe('0x32')]);_0x10c233['filters']=_[_0x5ffe('0x35')](_0x10c233[_0x5ffe('0x31')],_0x10c233[_0x5ffe('0x32')]);_0xbe27b1[_0x5ffe('0x36')]=_[_0x5ffe('0x35')](_0x10c233[_0x5ffe('0x31')],qs[_0x5ffe('0x37')](_0x4b26d1[_0x5ffe('0x32')]['fields']));_0xbe27b1[_0x5ffe('0x36')]=_0xbe27b1[_0x5ffe('0x36')][_0x5ffe('0x38')]?_0xbe27b1['attributes']:_0x10c233[_0x5ffe('0x31')];if(_0x4b26d1[_0x5ffe('0x32')][_0x5ffe('0x41')]){_0xbe27b1['include']=[{'all':!![]}];}_0xbe27b1=_[_0x5ffe('0x3f')]({},_0xbe27b1,_0x4b26d1[_0x5ffe('0x45')]);return db['SquareOdbc']['find'](_0xbe27b1)[_0x5ffe('0x24')](handleEntityNotFound(_0x30b535,null))[_0x5ffe('0x24')](respondWithResult(_0x30b535,null))[_0x5ffe('0x43')](handleError(_0x30b535,null));};exports[_0x5ffe('0x46')]=function(_0x2eceb6,_0x151844){return db[_0x5ffe('0x2c')][_0x5ffe('0x46')](_0x2eceb6[_0x5ffe('0x47')],{})[_0x5ffe('0x24')](function(_0x368b3c){var _0x14a1c8=_0x2eceb6[_0x5ffe('0x48')][_0x5ffe('0x25')]({'plain':!![]});if(!_0x14a1c8)throw new Error(_0x5ffe('0x49'));if(_0x14a1c8[_0x5ffe('0x4a')]===_0x5ffe('0x48')){var _0x25b1ed=_0x368b3c[_0x5ffe('0x25')]({'plain':!![]});var _0x3d2b41=_0x5ffe('0x26');return db[_0x5ffe('0x4b')][_0x5ffe('0x4c')]({'where':{'name':_0x3d2b41,'userProfileId':_0x14a1c8[_0x5ffe('0x4d')]},'raw':!![]})['then'](function(_0x3941c5){if(_0x3941c5&&_0x3941c5[_0x5ffe('0x4e')]===0x0){return db[_0x5ffe('0x4f')][_0x5ffe('0x46')]({'name':_0x25b1ed['name'],'resourceId':_0x25b1ed['id'],'type':_0x3941c5[_0x5ffe('0x29')],'sectionId':_0x3941c5['id']},{})['then'](function(){return _0x368b3c;});}else{return _0x368b3c;}})[_0x5ffe('0x43')](function(_0x22d240){logger['error'](_0x5ffe('0x50'),_0x22d240);throw _0x22d240;});}return _0x368b3c;})[_0x5ffe('0x24')](respondWithResult(_0x151844,0xc9))[_0x5ffe('0x43')](handleError(_0x151844,null));};exports[_0x5ffe('0x51')]=function(_0x525964,_0xa8b539){if(_0x525964[_0x5ffe('0x47')]['id']){delete _0x525964['body']['id'];}return db['SquareOdbc'][_0x5ffe('0x4c')]({'where':{'id':_0x525964[_0x5ffe('0x44')]['id']}})[_0x5ffe('0x24')](handleEntityNotFound(_0xa8b539,null))['then'](saveUpdates(_0x525964[_0x5ffe('0x47')],null))[_0x5ffe('0x24')](respondWithResult(_0xa8b539,null))[_0x5ffe('0x43')](handleError(_0xa8b539,null));};exports[_0x5ffe('0x23')]=function(_0x3508e8,_0x36bcea){return db[_0x5ffe('0x2c')]['find']({'where':{'id':_0x3508e8[_0x5ffe('0x44')]['id']}})[_0x5ffe('0x24')](handleEntityNotFound(_0x36bcea,null))[_0x5ffe('0x24')](removeEntity(_0x36bcea,null))['catch'](handleError(_0x36bcea,null));};exports['test']=function(_0x4a1148,_0x2aabb6,_0x11df8e){var _0x5413db;return db[_0x5ffe('0x2c')][_0x5ffe('0x4c')]({'where':{'id':_0x4a1148[_0x5ffe('0x44')]['id']},'attributes':['id',_0x5ffe('0x52')]})[_0x5ffe('0x24')](handleEntityNotFound(_0x2aabb6,null))[_0x5ffe('0x24')](function(_0x385e6f){if(_0x385e6f){var _0xb42d24=require(_0x5ffe('0x53'))();_0xb42d24[_0x5ffe('0x54')](_0x385e6f[_0x5ffe('0x52')]);_0xb42d24[_0x5ffe('0x55')]();return _0x385e6f;}})[_0x5ffe('0x24')](respondWithResult(_0x2aabb6,null))[_0x5ffe('0x43')](handleError(_0x2aabb6,null));};
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js
index e5cc354..f9b3388 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 _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
+var _0xabe7=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SquareOdbc','square_odbc'];(function(_0x1c4bf8,_0x1ad9cd){var _0x55f3a2=function(_0x252b16){while(--_0x252b16){_0x1c4bf8['push'](_0x1c4bf8['shift']());}};_0x55f3a2(++_0x1ad9cd);}(_0xabe7,0x1b0));var _0x7abe=function(_0x451a8f,_0x36614e){_0x451a8f=_0x451a8f-0x0;var _0x5ce95b=_0xabe7[_0x451a8f];return _0x5ce95b;};'use strict';var _=require(_0x7abe('0x0'));var util=require(_0x7abe('0x1'));var logger=require(_0x7abe('0x2'))('api');var moment=require(_0x7abe('0x3'));var BPromise=require(_0x7abe('0x4'));var rp=require(_0x7abe('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7abe('0x6'));var config=require(_0x7abe('0x7'));var attributes=require('./squareOdbc.attributes');module[_0x7abe('0x8')]=function(_0x2ed698,_0x56d6ae){return _0x2ed698[_0x7abe('0x9')](_0x7abe('0xa'),attributes,{'tableName':_0x7abe('0xb'),'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 7fa9ffd..88b9e2f 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 _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
+var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x35b7ba,_0x155c7f){var _0x25ea5e=function(_0x4d16f6){while(--_0x4d16f6){_0x35b7ba['push'](_0x35b7ba['shift']());}};_0x25ea5e(++_0x155c7f);}(_0xe14b,0x93));var _0xbe14=function(_0x1a7938,_0x1a937c){_0x1a7938=_0x1a7938-0x0;var _0x4e8845=_0xe14b[_0x1a7938];return _0x4e8845;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js
index 4840aaf..cc2cc8e 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 _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
+var _0x2547=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','post','/:id/users','addUsers','put','delete','destroy','removeUsers','exports','util'];(function(_0x165eb7,_0x4a5b9d){var _0x1b06bd=function(_0x55be7e){while(--_0x55be7e){_0x165eb7['push'](_0x165eb7['shift']());}};_0x1b06bd(++_0x4a5b9d);}(_0x2547,0x1cd));var _0x7254=function(_0x5d7349,_0x2591cd){_0x5d7349=_0x5d7349-0x0;var _0x48fee9=_0x2547[_0x5d7349];return _0x48fee9;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var auth=require(_0x7254('0x5'));var interaction=require(_0x7254('0x6'));var config=require(_0x7254('0x7'));var controller=require('./squareProject.controller');router[_0x7254('0x8')]('/',auth[_0x7254('0x9')](),controller[_0x7254('0xa')]);router[_0x7254('0x8')]('/:id',auth[_0x7254('0x9')](),controller[_0x7254('0xb')]);router[_0x7254('0x8')]('/:id/users',auth[_0x7254('0x9')](),controller['getUsers']);router['post']('/',auth['isAuthenticated'](),controller[_0x7254('0xc')]);router[_0x7254('0xd')](_0x7254('0xe'),auth[_0x7254('0x9')](),controller[_0x7254('0xf')]);router[_0x7254('0x10')]('/:id',auth[_0x7254('0x9')](),controller['update']);router[_0x7254('0x11')]('/:id',auth[_0x7254('0x9')](),controller[_0x7254('0x12')]);router[_0x7254('0x11')](_0x7254('0xe'),auth[_0x7254('0x9')](),controller[_0x7254('0x13')]);module[_0x7254('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 dca37d1..db5abc9 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 _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
+var _0x5f86=['TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','exports','STRING'];(function(_0x2e152f,_0x2ead5e){var _0x242767=function(_0x237604){while(--_0x237604){_0x2e152f['push'](_0x2e152f['shift']());}};_0x242767(++_0x2ead5e);}(_0x5f86,0x152));var _0x65f8=function(_0x5ef658,_0x492562){_0x5ef658=_0x5ef658-0x0;var _0x5d51df=_0x5f86[_0x5ef658];return _0x5d51df;};'use strict';var Sequelize=require('sequelize');module[_0x65f8('0x0')]={'name':{'type':Sequelize[_0x65f8('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x65f8('0x1')]},'notes':{'type':Sequelize[_0x65f8('0x2')]},'preproduction':{'type':Sequelize[_0x65f8('0x3')](_0x65f8('0x4')),'get':function(){if(this[_0x65f8('0x5')](_0x65f8('0x6'))){return this['getDataValue'](_0x65f8('0x6'))[_0x65f8('0x7')](_0x65f8('0x8'));}}},'production':{'type':Sequelize[_0x65f8('0x3')](_0x65f8('0x4')),'get':function(){if(this[_0x65f8('0x5')](_0x65f8('0x9'))){return this['getDataValue'](_0x65f8('0x9'))[_0x65f8('0x7')](_0x65f8('0x8'));}}}};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js
index 792cc1e..5f187ab 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 _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
+var _0x8a03=['params','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','html-pdf','eml-format','rimraf','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/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','count','offset','limit','Content-Range','json','apply','update','destroy','get','SquareProjects','UserProfileResource','then','end','error','stack','name','index','map','SquareProject','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','include','options','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x50b634,_0x1a9974){var _0xcbb832=function(_0x13441b){while(--_0x13441b){_0x50b634['push'](_0x50b634['shift']());}};_0xcbb832(++_0x1a9974);}(_0x8a03,0xcb));var _0x38a0=function(_0x5d87f3,_0x989352){_0x5d87f3=_0x5d87f3-0x0;var _0x540dd7=_0x8a03[_0x5d87f3];return _0x540dd7;};'use strict';var pdf=require(_0x38a0('0x0'));var emlformat=require(_0x38a0('0x1'));var rimraf=require(_0x38a0('0x2'));var zipdir=require(_0x38a0('0x3'));var jsonpatch=require(_0x38a0('0x4'));var rp=require(_0x38a0('0x5'));var moment=require('moment');var BPromise=require(_0x38a0('0x6'));var Mustache=require(_0x38a0('0x7'));var util=require(_0x38a0('0x8'));var path=require(_0x38a0('0x9'));var sox=require(_0x38a0('0xa'));var csv=require(_0x38a0('0xb'));var ejs=require(_0x38a0('0xc'));var fs=require('fs');var _=require(_0x38a0('0xd'));var squel=require(_0x38a0('0xe'));var crypto=require(_0x38a0('0xf'));var jsforce=require(_0x38a0('0x10'));var deskjs=require(_0x38a0('0x11'));var toCsv=require(_0x38a0('0xb'));var querystring=require(_0x38a0('0x12'));var Papa=require(_0x38a0('0x13'));var Redis=require(_0x38a0('0x14'));var authService=require(_0x38a0('0x15'));var qs=require(_0x38a0('0x16'));var as=require(_0x38a0('0x17'));var hardwareService=require(_0x38a0('0x18'));var logger=require(_0x38a0('0x19'))(_0x38a0('0x1a'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x38a0('0x1b'))['db'];config['redis']=_[_0x38a0('0x1c')](config[_0x38a0('0x1d')],{'host':_0x38a0('0x1e'),'port':0x18eb});var socket=require(_0x38a0('0x1f'))(new Redis(config[_0x38a0('0x1d')]));require(_0x38a0('0x20'))[_0x38a0('0x21')](socket);function respondWithStatusCode(_0x333c14,_0x448bf8){_0x448bf8=_0x448bf8||0xcc;return function(_0x1f407b){if(_0x1f407b){return _0x333c14['sendStatus'](_0x448bf8);}return _0x333c14[_0x38a0('0x22')](_0x448bf8)['end']();};}function respondWithResult(_0x39e593,_0x56bcc9){_0x56bcc9=_0x56bcc9||0xc8;return function(_0x2adef9){if(_0x2adef9){return _0x39e593[_0x38a0('0x22')](_0x56bcc9)['json'](_0x2adef9);}};}function respondWithFilteredResult(_0x5b376a,_0x4ad5c2){return function(_0x2e5a9c){if(_0x2e5a9c){var _0x46249a=_0x2e5a9c[_0x38a0('0x23')],_0x3d2ed0=_0x4ad5c2[_0x38a0('0x24')],_0x34aa6e=_0x4ad5c2[_0x38a0('0x24')]+_0x4ad5c2[_0x38a0('0x25')],_0x15c9b6;if(_0x34aa6e>=_0x46249a){_0x34aa6e=_0x46249a;_0x15c9b6=0xc8;}else{_0x15c9b6=0xce;}_0x5b376a['status'](_0x15c9b6);return _0x5b376a['set'](_0x38a0('0x26'),_0x3d2ed0+'-'+_0x34aa6e+'/'+_0x46249a)[_0x38a0('0x27')](_0x2e5a9c);}return null;};}function patchUpdates(_0x8db257){return function(_0x3f9aff){try{jsonpatch[_0x38a0('0x28')](_0x3f9aff,_0x8db257,!![]);}catch(_0x3ba1e9){return BPromise['reject'](_0x3ba1e9);}return _0x3f9aff['save']();};}function saveUpdates(_0x1fbdb9,_0x1b0ee5){return function(_0x418198){if(_0x418198){return _0x418198[_0x38a0('0x29')](_0x1fbdb9)['then'](function(_0xfaa7aa){return _0xfaa7aa;});}return null;};}function removeEntity(_0x3d9757,_0x22c995){return function(_0x22bc3a){if(_0x22bc3a){return _0x22bc3a[_0x38a0('0x2a')]()['then'](function(){var _0x460634=_0x22bc3a[_0x38a0('0x2b')]({'plain':!![]});var _0x4593e9=_0x38a0('0x2c');return db[_0x38a0('0x2d')][_0x38a0('0x2a')]({'where':{'type':_0x4593e9,'resourceId':_0x460634['id']}})[_0x38a0('0x2e')](function(){return _0x22bc3a;});})[_0x38a0('0x2e')](function(){_0x3d9757['status'](0xcc)[_0x38a0('0x2f')]();});}};}function handleEntityNotFound(_0x21eb46,_0x34be76){return function(_0x3bff94){if(!_0x3bff94){_0x21eb46['sendStatus'](0x194);}return _0x3bff94;};}function handleError(_0x840a5c,_0x3e0f2e){_0x3e0f2e=_0x3e0f2e||0x1f4;return function(_0x29be0a){logger[_0x38a0('0x30')](_0x29be0a[_0x38a0('0x31')]);if(_0x29be0a[_0x38a0('0x32')]){delete _0x29be0a[_0x38a0('0x32')];}_0x840a5c[_0x38a0('0x22')](_0x3e0f2e)['send'](_0x29be0a);};}exports[_0x38a0('0x33')]=function(_0x5a4754,_0x25dd55){var _0x15a118={},_0x4cbac4={},_0x5f3c58={'count':0x0,'rows':[]};var _0x3c3606=_[_0x38a0('0x34')](db[_0x38a0('0x35')][_0x38a0('0x36')],function(_0x351652){return{'name':_0x351652['fieldName'],'type':_0x351652[_0x38a0('0x37')][_0x38a0('0x38')]};});_0x4cbac4['model']=_[_0x38a0('0x34')](_0x3c3606,_0x38a0('0x32'));_0x4cbac4[_0x38a0('0x39')]=_[_0x38a0('0x3a')](_0x5a4754[_0x38a0('0x39')]);_0x4cbac4[_0x38a0('0x3b')]=_[_0x38a0('0x3c')](_0x4cbac4[_0x38a0('0x3d')],_0x4cbac4[_0x38a0('0x39')]);_0x15a118[_0x38a0('0x3e')]=_[_0x38a0('0x3c')](_0x4cbac4['model'],qs[_0x38a0('0x3f')](_0x5a4754[_0x38a0('0x39')][_0x38a0('0x3f')]));_0x15a118[_0x38a0('0x3e')]=_0x15a118[_0x38a0('0x3e')][_0x38a0('0x40')]?_0x15a118['attributes']:_0x4cbac4['model'];if(!_0x5a4754[_0x38a0('0x39')][_0x38a0('0x41')](_0x38a0('0x42'))){_0x15a118[_0x38a0('0x25')]=qs[_0x38a0('0x25')](_0x5a4754[_0x38a0('0x39')]['limit']);_0x15a118[_0x38a0('0x24')]=qs['offset'](_0x5a4754[_0x38a0('0x39')][_0x38a0('0x24')]);}_0x15a118[_0x38a0('0x43')]=qs['sort'](_0x5a4754['query'][_0x38a0('0x44')]);_0x15a118['where']=qs[_0x38a0('0x3b')](_[_0x38a0('0x45')](_0x5a4754[_0x38a0('0x39')],_0x4cbac4['filters']),_0x3c3606);if(_0x5a4754['query'][_0x38a0('0x46')]){_0x15a118[_0x38a0('0x47')]=_[_0x38a0('0x48')](_0x15a118['where'],{'$or':_[_0x38a0('0x34')](_0x3c3606,function(_0x2f3bfc){if(_0x2f3bfc[_0x38a0('0x37')]!==_0x38a0('0x49')){var _0xc60bb0={};_0xc60bb0[_0x2f3bfc[_0x38a0('0x32')]]={'$like':'%'+_0x5a4754['query'][_0x38a0('0x46')]+'%'};return _0xc60bb0;}})});}_0x15a118=_[_0x38a0('0x48')]({},_0x15a118,_0x5a4754['options']);var _0x216202={'where':_0x15a118[_0x38a0('0x47')]};return db[_0x38a0('0x35')][_0x38a0('0x23')](_0x216202)['then'](function(_0xda3e45){_0x5f3c58[_0x38a0('0x23')]=_0xda3e45;if(_0x5a4754[_0x38a0('0x39')][_0x38a0('0x4a')]){_0x15a118['include']=[{'all':!![]}];}return db[_0x38a0('0x35')]['findAll'](_0x15a118);})[_0x38a0('0x2e')](function(_0x95321a){_0x5f3c58[_0x38a0('0x4b')]=_0x95321a;return _0x5f3c58;})[_0x38a0('0x2e')](respondWithFilteredResult(_0x25dd55,_0x15a118))[_0x38a0('0x4c')](handleError(_0x25dd55,null));};exports['show']=function(_0x503ff2,_0x2d8bfd){var _0x428540={'raw':![],'where':{'id':_0x503ff2['params']['id']}},_0x2fa75f={};_0x2fa75f[_0x38a0('0x3d')]=_[_0x38a0('0x3a')](db[_0x38a0('0x35')][_0x38a0('0x36')]);_0x2fa75f[_0x38a0('0x39')]=_[_0x38a0('0x3a')](_0x503ff2[_0x38a0('0x39')]);_0x2fa75f[_0x38a0('0x3b')]=_[_0x38a0('0x3c')](_0x2fa75f[_0x38a0('0x3d')],_0x2fa75f[_0x38a0('0x39')]);_0x428540[_0x38a0('0x3e')]=_[_0x38a0('0x3c')](_0x2fa75f['model'],qs[_0x38a0('0x3f')](_0x503ff2['query'][_0x38a0('0x3f')]));_0x428540[_0x38a0('0x3e')]=_0x428540[_0x38a0('0x3e')]['length']?_0x428540['attributes']:_0x2fa75f[_0x38a0('0x3d')];if(_0x503ff2[_0x38a0('0x39')][_0x38a0('0x4a')]){_0x428540[_0x38a0('0x4d')]=[{'all':!![]}];}_0x428540=_['merge']({},_0x428540,_0x503ff2[_0x38a0('0x4e')]);return db[_0x38a0('0x35')]['find'](_0x428540)['then'](handleEntityNotFound(_0x2d8bfd,null))['then'](respondWithResult(_0x2d8bfd,null))[_0x38a0('0x4c')](handleError(_0x2d8bfd,null));};exports[_0x38a0('0x4f')]=function(_0x276366,_0x24db19){return db[_0x38a0('0x35')][_0x38a0('0x4f')](_0x276366[_0x38a0('0x50')],{})[_0x38a0('0x2e')](function(_0x36acc7){var _0x364ae9=_0x276366['user'][_0x38a0('0x2b')]({'plain':!![]});if(!_0x364ae9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x364ae9[_0x38a0('0x51')]===_0x38a0('0x52')){var _0x11efc3=_0x36acc7['get']({'plain':!![]});var _0x45ec5e=_0x38a0('0x2c');return db[_0x38a0('0x53')][_0x38a0('0x54')]({'where':{'name':_0x45ec5e,'userProfileId':_0x364ae9[_0x38a0('0x55')]},'raw':!![]})[_0x38a0('0x2e')](function(_0x2ae362){if(_0x2ae362&&_0x2ae362[_0x38a0('0x56')]===0x0){return db['UserProfileResource'][_0x38a0('0x4f')]({'name':_0x11efc3['name'],'resourceId':_0x11efc3['id'],'type':_0x2ae362[_0x38a0('0x32')],'sectionId':_0x2ae362['id']},{})[_0x38a0('0x2e')](function(){return _0x36acc7;});}else{return _0x36acc7;}})[_0x38a0('0x4c')](function(_0x3ef65a){logger['error'](_0x38a0('0x57'),_0x3ef65a);throw _0x3ef65a;});}return _0x36acc7;})[_0x38a0('0x2e')](respondWithResult(_0x24db19,0xc9))[_0x38a0('0x4c')](handleError(_0x24db19,null));};exports[_0x38a0('0x29')]=function(_0x572b1e,_0x21958f){if(_0x572b1e[_0x38a0('0x50')]['id']){delete _0x572b1e[_0x38a0('0x50')]['id'];}return db['SquareProject'][_0x38a0('0x54')]({'where':{'id':_0x572b1e[_0x38a0('0x58')]['id']}})[_0x38a0('0x2e')](handleEntityNotFound(_0x21958f,null))['then'](saveUpdates(_0x572b1e[_0x38a0('0x50')],null))[_0x38a0('0x2e')](respondWithResult(_0x21958f,null))[_0x38a0('0x4c')](handleError(_0x21958f,null));};exports[_0x38a0('0x2a')]=function(_0x10d7d9,_0x28e80e){return db[_0x38a0('0x35')][_0x38a0('0x54')]({'where':{'id':_0x10d7d9[_0x38a0('0x58')]['id']}})[_0x38a0('0x2e')](handleEntityNotFound(_0x28e80e,null))[_0x38a0('0x2e')](removeEntity(_0x28e80e,null))[_0x38a0('0x4c')](handleError(_0x28e80e,null));};exports[_0x38a0('0x59')]=function(_0x3c5868,_0x1a46f2,_0x593fcb){return db[_0x38a0('0x35')]['find']({'where':{'id':_0x3c5868[_0x38a0('0x58')]['id']}})[_0x38a0('0x2e')](handleEntityNotFound(_0x1a46f2,null))['then'](function(_0x4056a3){if(_0x4056a3){return _0x4056a3['addUsers'](_0x3c5868[_0x38a0('0x50')][_0x38a0('0x5a')],_['omit'](_0x3c5868[_0x38a0('0x50')],[_0x38a0('0x5a'),'id'])||{});}})[_0x38a0('0x2e')](respondWithResult(_0x1a46f2,null))['catch'](handleError(_0x1a46f2,null));};exports['removeUsers']=function(_0x451199,_0x142bca,_0x2b8a6e){return db[_0x38a0('0x35')]['find']({'where':{'id':_0x451199['params']['id']}})[_0x38a0('0x2e')](handleEntityNotFound(_0x142bca,null))['then'](function(_0x3e7328){if(_0x3e7328){return _0x3e7328[_0x38a0('0x5b')](_0x451199['query'][_0x38a0('0x5a')])['then'](function(){if(_[_0x38a0('0x5c')](_0x451199[_0x38a0('0x39')][_0x38a0('0x5a')])){for(var _0x4c0fc8=0x0;_0x4c0fc8<_0x451199[_0x38a0('0x39')][_0x38a0('0x5a')][_0x38a0('0x40')];_0x4c0fc8+=0x1){socket[_0x38a0('0x5d')](_0x38a0('0x5e'),{'UserId':Number(_0x451199[_0x38a0('0x39')][_0x38a0('0x5a')][_0x4c0fc8]),'SquareProjectId':Number(_0x451199[_0x38a0('0x58')]['id'])});}}else{socket[_0x38a0('0x5d')]('userSquareProject:remove',{'UserId':Number(_0x451199[_0x38a0('0x39')][_0x38a0('0x5a')]),'SquareProjectId':Number(_0x451199[_0x38a0('0x58')]['id'])});}});}})[_0x38a0('0x2e')](respondWithStatusCode(_0x142bca,null))['catch'](handleError(_0x142bca,null));};exports[_0x38a0('0x5f')]=function(_0x6e80e4,_0xd8226c,_0x5bd805){var _0x23dd97={};var _0x407638={};var _0x2df272;var _0x3c708c;return db[_0x38a0('0x35')][_0x38a0('0x60')]({'where':{'id':_0x6e80e4[_0x38a0('0x58')]['id']}})[_0x38a0('0x2e')](handleEntityNotFound(_0xd8226c,null))['then'](function(_0x3c1dfd){if(_0x3c1dfd){_0x2df272=_0x3c1dfd;_0x407638[_0x38a0('0x3d')]=_[_0x38a0('0x3a')](db['User']['rawAttributes']);_0x407638[_0x38a0('0x39')]=_[_0x38a0('0x3a')](_0x6e80e4[_0x38a0('0x39')]);_0x407638[_0x38a0('0x3b')]=_[_0x38a0('0x3c')](_0x407638[_0x38a0('0x3d')],_0x407638[_0x38a0('0x39')]);_0x23dd97[_0x38a0('0x3e')]=_[_0x38a0('0x3c')](_0x407638[_0x38a0('0x3d')],qs['fields'](_0x6e80e4[_0x38a0('0x39')][_0x38a0('0x3f')]));_0x23dd97[_0x38a0('0x3e')]=_0x23dd97[_0x38a0('0x3e')]['length']?_0x23dd97[_0x38a0('0x3e')]:_0x407638[_0x38a0('0x3d')];_0x23dd97['order']=qs['sort'](_0x6e80e4[_0x38a0('0x39')]['sort']);_0x23dd97['where']=qs[_0x38a0('0x3b')](_[_0x38a0('0x45')](_0x6e80e4[_0x38a0('0x39')],_0x407638['filters']));if(_0x6e80e4[_0x38a0('0x39')][_0x38a0('0x46')]){_0x23dd97[_0x38a0('0x47')]=_[_0x38a0('0x48')](_0x23dd97[_0x38a0('0x47')],{'$or':_[_0x38a0('0x34')](_0x23dd97[_0x38a0('0x3e')],function(_0x29d305){var _0x23bcbc={};_0x23bcbc[_0x29d305]={'$like':'%'+_0x6e80e4['query'][_0x38a0('0x46')]+'%'};return _0x23bcbc;})});}_0x23dd97=_['merge']({},_0x23dd97,_0x6e80e4[_0x38a0('0x4e')]);return _0x2df272[_0x38a0('0x5f')](_0x23dd97);}})['then'](function(_0xa0c3fd){if(_0xa0c3fd){_0x3c708c=_0xa0c3fd['length'];if(!_0x6e80e4[_0x38a0('0x39')][_0x38a0('0x41')]('nolimit')){_0x23dd97[_0x38a0('0x25')]=qs[_0x38a0('0x25')](_0x6e80e4['query'][_0x38a0('0x25')]);_0x23dd97['offset']=qs[_0x38a0('0x24')](_0x6e80e4[_0x38a0('0x39')][_0x38a0('0x24')]);}return _0x2df272[_0x38a0('0x5f')](_0x23dd97);}})[_0x38a0('0x2e')](function(_0x446c16){if(_0x446c16){return _0x446c16?{'count':_0x3c708c,'rows':_0x446c16}:null;}})['then'](respondWithResult(_0xd8226c,null))[_0x38a0('0x4c')](handleError(_0xd8226c,null));};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js
index ab099de..f3370eb 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 _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
+var _0x49fe=['events','../../mysqldb','SquareProject','update','emit','hasOwnProperty','hook','exports'];(function(_0x3cba1d,_0x2825ae){var _0x5f192b=function(_0x32ff5d){while(--_0x32ff5d){_0x3cba1d['push'](_0x3cba1d['shift']());}};_0x5f192b(++_0x2825ae);}(_0x49fe,0x100));var _0xe49f=function(_0x2b5aaa,_0x215e83){_0x2b5aaa=_0x2b5aaa-0x0;var _0x344a85=_0x49fe[_0x2b5aaa];return _0x344a85;};'use strict';var EventEmitter=require(_0xe49f('0x0'));var SquareProject=require(_0xe49f('0x1'))['db'][_0xe49f('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe49f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x195bcf){return function(_0x199a0b,_0xb0e197,_0x43c119){SquareProjectEvents['emit'](_0x195bcf+':'+_0x199a0b['id'],_0x199a0b);SquareProjectEvents[_0xe49f('0x4')](_0x195bcf,_0x199a0b);_0x43c119(null);};}for(var e in events){if(events[_0xe49f('0x5')](e)){var event=events[e];SquareProject[_0xe49f('0x6')](e,emitEvent(event));}}module[_0xe49f('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 0a351fe..d03ffa8 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 _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
+var _0x1967=['path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x64fa5d,_0x4ba48d){var _0x39618c=function(_0x4e0672){while(--_0x4e0672){_0x64fa5d['push'](_0x64fa5d['shift']());}};_0x39618c(++_0x4ba48d);}(_0x1967,0x173));var _0x7196=function(_0x1ecb44,_0x72bc9e){_0x1ecb44=_0x1ecb44-0x0;var _0x56d879=_0x1967[_0x1ecb44];return _0x56d879;};'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':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js
index 5b643dc..69bc220 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 _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
+var _0xc2ef=['../../config/environment','jayson/promise','client','http','redis','localhost','./squareProject.socket','request','then','info','request\x20sent','debug','error','code','message','SquareProject,\x20%s,\x20%s','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x342db7,_0x2f2fac){var _0x2742e1=function(_0x43c1b5){while(--_0x43c1b5){_0x342db7['push'](_0x342db7['shift']());}};_0x2742e1(++_0x2f2fac);}(_0xc2ef,0x1e5));var _0xfc2e=function(_0x4d193b,_0x3020a5){_0x4d193b=_0x4d193b-0x0;var _0x5357b1=_0xc2ef[_0x4d193b];return _0x5357b1;};'use strict';var _=require(_0xfc2e('0x0'));var util=require(_0xfc2e('0x1'));var moment=require(_0xfc2e('0x2'));var BPromise=require(_0xfc2e('0x3'));var rs=require(_0xfc2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc2e('0x5'))['db'];var utils=require(_0xfc2e('0x6'));var logger=require(_0xfc2e('0x7'))(_0xfc2e('0x8'));var config=require(_0xfc2e('0x9'));var jayson=require(_0xfc2e('0xa'));var client=jayson[_0xfc2e('0xb')][_0xfc2e('0xc')]({'port':0x232a});config[_0xfc2e('0xd')]=_['defaults'](config[_0xfc2e('0xd')],{'host':_0xfc2e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfc2e('0xf'))['register'](socket);function respondWithRpcPromise(_0x35cd4b,_0x43e92b,_0x29d054){return new BPromise(function(_0x1c29ce,_0x28ab1e){return client[_0xfc2e('0x10')](_0x35cd4b,_0x29d054)[_0xfc2e('0x11')](function(_0xd6afb0){logger[_0xfc2e('0x12')]('SquareProject,\x20%s,\x20%s',_0x43e92b,_0xfc2e('0x13'));logger[_0xfc2e('0x14')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x43e92b,_0xfc2e('0x13'),JSON['stringify'](_0xd6afb0));if(_0xd6afb0['error']){if(_0xd6afb0[_0xfc2e('0x15')][_0xfc2e('0x16')]===0x1f4){logger[_0xfc2e('0x15')]('SquareProject,\x20%s,\x20%s',_0x43e92b,_0xd6afb0[_0xfc2e('0x15')][_0xfc2e('0x17')]);return _0x28ab1e(_0xd6afb0[_0xfc2e('0x15')]['message']);}logger['error'](_0xfc2e('0x18'),_0x43e92b,_0xd6afb0[_0xfc2e('0x15')][_0xfc2e('0x17')]);return _0x1c29ce(_0xd6afb0[_0xfc2e('0x15')]['message']);}else{logger[_0xfc2e('0x12')]('SquareProject,\x20%s,\x20%s',_0x43e92b,_0xfc2e('0x13'));_0x1c29ce(_0xd6afb0[_0xfc2e('0x19')][_0xfc2e('0x17')]);}})[_0xfc2e('0x1a')](function(_0x393fe6){logger[_0xfc2e('0x15')](_0xfc2e('0x18'),_0x43e92b,_0x393fe6);_0x28ab1e(_0x393fe6);});});}exports[_0xfc2e('0x1b')]=function(_0x5a680a){var _0x522c8f=this;return new Promise(function(_0x6e554e,_0x1024b5){return db[_0xfc2e('0x1c')][_0xfc2e('0x1d')]({'raw':_0x5a680a['options']?_0x5a680a[_0xfc2e('0x1e')][_0xfc2e('0x1f')]===undefined?!![]:![]:!![],'where':_0x5a680a['options']?_0x5a680a[_0xfc2e('0x1e')][_0xfc2e('0x20')]||null:null,'attributes':_0x5a680a[_0xfc2e('0x1e')]?_0x5a680a[_0xfc2e('0x1e')][_0xfc2e('0x21')]||null:null,'include':_0x5a680a['options']?_0x5a680a[_0xfc2e('0x1e')][_0xfc2e('0x22')]?_[_0xfc2e('0x23')](_0x5a680a[_0xfc2e('0x1e')]['include'],function(_0x4e8573){return{'model':db[_0x4e8573['model']],'as':_0x4e8573['as'],'attributes':_0x4e8573[_0xfc2e('0x21')],'include':_0x4e8573['include']?_[_0xfc2e('0x23')](_0x4e8573[_0xfc2e('0x22')],function(_0x4b7b9b){return{'model':db[_0x4b7b9b['model']],'as':_0x4b7b9b['as'],'attributes':_0x4b7b9b[_0xfc2e('0x21')],'include':_0x4b7b9b[_0xfc2e('0x22')]?_[_0xfc2e('0x23')](_0x4b7b9b['include'],function(_0x5d7735){return{'model':db[_0x5d7735[_0xfc2e('0x24')]],'as':_0x5d7735['as'],'attributes':_0x5d7735[_0xfc2e('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c949c){logger[_0xfc2e('0x12')](_0xfc2e('0x1b'),_0x5a680a);logger['debug'](_0xfc2e('0x1b'),_0x5a680a,JSON[_0xfc2e('0x25')](_0x2c949c));_0x6e554e(_0x2c949c);})[_0xfc2e('0x1a')](function(_0x370d24){logger[_0xfc2e('0x15')]('ShowSquareProject',_0x370d24[_0xfc2e('0x17')],_0x5a680a);_0x1024b5(_0x522c8f[_0xfc2e('0x15')](0x1f4,_0x370d24[_0xfc2e('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js
index bcdaa8d..50cdbc6 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 _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
+var _0x6d38=['removeListener','length','squareProject:','save','remove','update'];(function(_0x53377b,_0x166f23){var _0x39cba9=function(_0x4be07d){while(--_0x4be07d){_0x53377b['push'](_0x53377b['shift']());}};_0x39cba9(++_0x166f23);}(_0x6d38,0x1ef));var _0x86d3=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6d38[_0x2b4411];return _0x8e41ef;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x86d3('0x0'),_0x86d3('0x1'),_0x86d3('0x2')];function createListener(_0x52d138,_0x5c0b77){return function(_0xd1c7c){_0x5c0b77['emit'](_0x52d138,_0xd1c7c);};}function removeListener(_0xe9198a,_0x455b9d){return function(){SquareProjectEvents[_0x86d3('0x3')](_0xe9198a,_0x455b9d);};}exports['register']=function(_0x2d8272){for(var _0xfbbc15=0x0,_0x33d4aa=events[_0x86d3('0x4')];_0xfbbc15<_0x33d4aa;_0xfbbc15++){var _0x47e654=events[_0xfbbc15];var _0x552b07=createListener(_0x86d3('0x5')+_0x47e654,_0x2d8272);SquareProjectEvents['on'](_0x47e654,_0x552b07);}};
\ No newline at end of file
diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js
index 793a1da..2362043 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 _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
+var _0xf891=['delete','/:id/delete','destroy','multer','util','express','Router','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','put','update'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xf891,0x93));var _0x1f89=function(_0x385bf3,_0x259ed3){_0x385bf3=_0x385bf3-0x0;var _0x5af14f=_0xf891[_0x385bf3];return _0x5af14f;};'use strict';var multer=require(_0x1f89('0x0'));var util=require(_0x1f89('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1f89('0x2'));var router=express[_0x1f89('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1f89('0x4'));var config=require('../../config/environment');var controller=require(_0x1f89('0x5'));router[_0x1f89('0x6')]('/',auth[_0x1f89('0x7')](),controller['index']);router[_0x1f89('0x6')](_0x1f89('0x8'),auth['isAuthenticated'](),controller[_0x1f89('0x9')]);router[_0x1f89('0x6')](_0x1f89('0xa'),auth[_0x1f89('0x7')](),controller[_0x1f89('0xb')]);router[_0x1f89('0xc')]('/',auth[_0x1f89('0x7')](),controller['create']);router[_0x1f89('0xd')](_0x1f89('0x8'),auth[_0x1f89('0x7')](),controller[_0x1f89('0xe')]);router[_0x1f89('0xf')](_0x1f89('0x10'),auth[_0x1f89('0x7')](),controller[_0x1f89('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js
index 1aa7e8f..9aadac4 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 _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
+var _0xb520=['VIRTUAL','getDataValue','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x2290ae,_0xbbbf35){var _0x38bdd0=function(_0x4eb053){while(--_0x4eb053){_0x2290ae['push'](_0x2290ae['shift']());}};_0x38bdd0(++_0xbbbf35);}(_0xb520,0x162));var _0x0b52=function(_0x492432,_0x2cb758){_0x492432=_0x492432-0x0;var _0x5d1be8=_0xb520[_0x492432];return _0x5d1be8;};'use strict';var Sequelize=require(_0x0b52('0x0'));module[_0x0b52('0x1')]={'uniqueid':{'type':Sequelize[_0x0b52('0x2')]},'callerid':{'type':Sequelize[_0x0b52('0x2')]},'calleridname':{'type':Sequelize[_0x0b52('0x2')]},'context':{'type':Sequelize[_0x0b52('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x0b52('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x0b52('0x2')]},'filename':{'type':Sequelize[_0x0b52('0x2')]},'savePath':{'type':Sequelize[_0x0b52('0x2')]},'format':{'type':Sequelize[_0x0b52('0x3')],'get':function(){var _0x33a6b6='';var _0x517665=this[_0x0b52('0x4')]('savePath');if(_0x517665){_0x33a6b6=_0x517665[_0x0b52('0x5')](_0x517665[_0x0b52('0x6')]('.'));}return _0x33a6b6;}}};
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js
index 21a9695..6f85aad 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 _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
+var _0xe501=['../../mysqldb','sendStatus','status','json','count','offset','set','save','update','then','error','stack','name','send','index','SquareRecording','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','options','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','ValidationError','SquareRecording\x20not\x20found','extname','unlink','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','end','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xe501,0x157));var _0x1e50=function(_0x10b213,_0x1f710f){_0x10b213=_0x10b213-0x0;var _0x263d5a=_0xe501[_0x10b213];return _0x263d5a;};'use strict';var pdf=require(_0x1e50('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1e50('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e50('0x2'));var rp=require('request-promise');var moment=require(_0x1e50('0x3'));var BPromise=require(_0x1e50('0x4'));var Mustache=require(_0x1e50('0x5'));var util=require(_0x1e50('0x6'));var path=require(_0x1e50('0x7'));var sox=require('sox');var csv=require(_0x1e50('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1e50('0x9'));var squel=require(_0x1e50('0xa'));var crypto=require(_0x1e50('0xb'));var jsforce=require(_0x1e50('0xc'));var deskjs=require(_0x1e50('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e50('0xe'));var Redis=require(_0x1e50('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1e50('0x10'));var as=require(_0x1e50('0x11'));var hardwareService=require(_0x1e50('0x12'));var logger=require(_0x1e50('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1e50('0x14'));var db=require(_0x1e50('0x15'))['db'];function respondWithStatusCode(_0x16d5a5,_0xe8efb7){_0xe8efb7=_0xe8efb7||0xcc;return function(_0x242af2){if(_0x242af2){return _0x16d5a5[_0x1e50('0x16')](_0xe8efb7);}return _0x16d5a5[_0x1e50('0x17')](_0xe8efb7)['end']();};}function respondWithResult(_0x59298b,_0x49961c){_0x49961c=_0x49961c||0xc8;return function(_0x28d41d){if(_0x28d41d){return _0x59298b[_0x1e50('0x17')](_0x49961c)[_0x1e50('0x18')](_0x28d41d);}};}function respondWithFilteredResult(_0x59c0ef,_0x47299e){return function(_0x336e7a){if(_0x336e7a){var _0x57685c=_0x336e7a[_0x1e50('0x19')],_0x2aafcb=_0x47299e[_0x1e50('0x1a')],_0x229200=_0x47299e[_0x1e50('0x1a')]+_0x47299e['limit'],_0xc62162;if(_0x229200>=_0x57685c){_0x229200=_0x57685c;_0xc62162=0xc8;}else{_0xc62162=0xce;}_0x59c0ef['status'](_0xc62162);return _0x59c0ef[_0x1e50('0x1b')]('Content-Range',_0x2aafcb+'-'+_0x229200+'/'+_0x57685c)[_0x1e50('0x18')](_0x336e7a);}return null;};}function patchUpdates(_0x3a819e){return function(_0x4f276b){try{jsonpatch['apply'](_0x4f276b,_0x3a819e,!![]);}catch(_0x462ab7){return BPromise['reject'](_0x462ab7);}return _0x4f276b[_0x1e50('0x1c')]();};}function saveUpdates(_0x2a1788,_0x1b54c6){return function(_0x31437f){if(_0x31437f){return _0x31437f[_0x1e50('0x1d')](_0x2a1788)['then'](function(_0x571340){return _0x571340;});}return null;};}function removeEntity(_0xada6c3,_0x393508){return function(_0x3cf9c5){if(_0x3cf9c5){return _0x3cf9c5['destroy']()[_0x1e50('0x1e')](function(){_0xada6c3[_0x1e50('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37fb49,_0x5d7263){return function(_0x4c3ec3){if(!_0x4c3ec3){_0x37fb49[_0x1e50('0x16')](0x194);}return _0x4c3ec3;};}function handleError(_0x1315b9,_0x5cc990){_0x5cc990=_0x5cc990||0x1f4;return function(_0x5cc884){logger[_0x1e50('0x1f')](_0x5cc884[_0x1e50('0x20')]);if(_0x5cc884[_0x1e50('0x21')]){delete _0x5cc884['name'];}_0x1315b9[_0x1e50('0x17')](_0x5cc990)[_0x1e50('0x22')](_0x5cc884);};}exports[_0x1e50('0x23')]=function(_0x51beab,_0x9f8d9c){var _0x34eaa0={},_0x2b854d={},_0xf11cbb={'count':0x0,'rows':[]};var _0x10c484=_['map'](db[_0x1e50('0x24')][_0x1e50('0x25')],function(_0x56191b){return{'name':_0x56191b[_0x1e50('0x26')],'type':_0x56191b['type'][_0x1e50('0x27')]};});_0x2b854d[_0x1e50('0x28')]=_['map'](_0x10c484,_0x1e50('0x21'));_0x2b854d[_0x1e50('0x29')]=_[_0x1e50('0x2a')](_0x51beab[_0x1e50('0x29')]);_0x2b854d[_0x1e50('0x2b')]=_[_0x1e50('0x2c')](_0x2b854d['model'],_0x2b854d[_0x1e50('0x29')]);_0x34eaa0[_0x1e50('0x2d')]=_['intersection'](_0x2b854d[_0x1e50('0x28')],qs['fields'](_0x51beab[_0x1e50('0x29')][_0x1e50('0x2e')]));_0x34eaa0['attributes']=_0x34eaa0[_0x1e50('0x2d')][_0x1e50('0x2f')]?_0x34eaa0[_0x1e50('0x2d')]:_0x2b854d['model'];if(!_0x51beab[_0x1e50('0x29')][_0x1e50('0x30')](_0x1e50('0x31'))){_0x34eaa0[_0x1e50('0x32')]=qs[_0x1e50('0x32')](_0x51beab[_0x1e50('0x29')][_0x1e50('0x32')]);_0x34eaa0[_0x1e50('0x1a')]=qs[_0x1e50('0x1a')](_0x51beab['query']['offset']);}_0x34eaa0[_0x1e50('0x33')]=qs[_0x1e50('0x34')](_0x51beab[_0x1e50('0x29')][_0x1e50('0x34')]);_0x34eaa0[_0x1e50('0x35')]=qs['filters'](_['pick'](_0x51beab['query'],_0x2b854d[_0x1e50('0x2b')]),_0x10c484);if(_0x51beab[_0x1e50('0x29')]['filter']){_0x34eaa0['where']=_[_0x1e50('0x36')](_0x34eaa0[_0x1e50('0x35')],{'$or':_['map'](_0x10c484,function(_0x4c07e5){if(_0x4c07e5[_0x1e50('0x37')]!==_0x1e50('0x38')){var _0x4c3674={};_0x4c3674[_0x4c07e5['name']]={'$like':'%'+_0x51beab[_0x1e50('0x29')][_0x1e50('0x39')]+'%'};return _0x4c3674;}})});}_0x34eaa0=_[_0x1e50('0x36')]({},_0x34eaa0,_0x51beab['options']);var _0x178bab={'where':_0x34eaa0[_0x1e50('0x35')]};return db[_0x1e50('0x24')][_0x1e50('0x19')](_0x178bab)['then'](function(_0x4141c9){_0xf11cbb[_0x1e50('0x19')]=_0x4141c9;if(_0x51beab['query'][_0x1e50('0x3a')]){_0x34eaa0[_0x1e50('0x3b')]=[{'all':!![]}];}return db[_0x1e50('0x24')][_0x1e50('0x3c')](_0x34eaa0);})[_0x1e50('0x1e')](function(_0x2409df){_0xf11cbb[_0x1e50('0x3d')]=_0x2409df;return _0xf11cbb;})['then'](respondWithFilteredResult(_0x9f8d9c,_0x34eaa0))[_0x1e50('0x3e')](handleError(_0x9f8d9c,null));};exports['show']=function(_0x3c9d51,_0x122f5f){var _0x3dee74={'raw':!![],'where':{'id':_0x3c9d51[_0x1e50('0x3f')]['id']}},_0x36c118={};_0x36c118[_0x1e50('0x28')]=_[_0x1e50('0x2a')](db[_0x1e50('0x24')][_0x1e50('0x25')]);_0x36c118[_0x1e50('0x29')]=_[_0x1e50('0x2a')](_0x3c9d51[_0x1e50('0x29')]);_0x36c118[_0x1e50('0x2b')]=_[_0x1e50('0x2c')](_0x36c118[_0x1e50('0x28')],_0x36c118[_0x1e50('0x29')]);_0x3dee74[_0x1e50('0x2d')]=_[_0x1e50('0x2c')](_0x36c118[_0x1e50('0x28')],qs[_0x1e50('0x2e')](_0x3c9d51[_0x1e50('0x29')]['fields']));_0x3dee74['attributes']=_0x3dee74['attributes']['length']?_0x3dee74[_0x1e50('0x2d')]:_0x36c118['model'];if(_0x3c9d51[_0x1e50('0x29')][_0x1e50('0x3a')]){_0x3dee74['include']=[{'all':!![]}];}_0x3dee74=_['merge']({},_0x3dee74,_0x3c9d51[_0x1e50('0x40')]);return db[_0x1e50('0x24')][_0x1e50('0x41')](_0x3dee74)['then'](handleEntityNotFound(_0x122f5f,null))[_0x1e50('0x1e')](respondWithResult(_0x122f5f,null))[_0x1e50('0x3e')](handleError(_0x122f5f,null));};exports['create']=function(_0x61c33a,_0x35f6be){return db['SquareRecording'][_0x1e50('0x42')](_0x61c33a[_0x1e50('0x43')],{})[_0x1e50('0x1e')](respondWithResult(_0x35f6be,0xc9))['catch'](handleError(_0x35f6be,null));};exports[_0x1e50('0x1d')]=function(_0x224db2,_0x54249f){if(_0x224db2[_0x1e50('0x43')]['id']){delete _0x224db2[_0x1e50('0x43')]['id'];}return db[_0x1e50('0x24')]['find']({'where':{'id':_0x224db2[_0x1e50('0x3f')]['id']}})[_0x1e50('0x1e')](handleEntityNotFound(_0x54249f,null))['then'](saveUpdates(_0x224db2['body'],null))[_0x1e50('0x1e')](respondWithResult(_0x54249f,null))[_0x1e50('0x3e')](handleError(_0x54249f,null));};exports[_0x1e50('0x44')]=function(_0x1bac8f,_0x2de373,_0x14c135){var _0x4f6711=require(_0x1e50('0x45'));var _0x21fb69=![];var _0x159671={};if(_0x1bac8f[_0x1e50('0x29')][_0x1e50('0x37')]&&_0x1bac8f[_0x1e50('0x29')][_0x1e50('0x37')]===_0x1e50('0x46')){_0x159671[_0x1e50('0x46')]=_0x1bac8f[_0x1e50('0x3f')]['id'];}else{_0x159671['id']=_0x1bac8f[_0x1e50('0x3f')]['id'];}return db['SquareRecording'][_0x1e50('0x41')]({'where':_0x159671,'attributes':['id',_0x1e50('0x47'),_0x1e50('0x48')],'raw':!![]})[_0x1e50('0x1e')](handleEntityNotFound(_0x2de373,null))[_0x1e50('0x1e')](function(_0x430609){if(_0x430609){var _0x72dc04=_0x430609[_0x1e50('0x47')];var _0xda17b5=util[_0x1e50('0x49')](_0x1e50('0x4a'),_0x72dc04);if(fs[_0x1e50('0x4b')](_0xda17b5)){_0x21fb69=!![];return _0x4f6711[_0x1e50('0x4c')](_0xda17b5,_0x72dc04,config['secrets']['recording'])[_0x1e50('0x1e')](function(){return _0x430609;});}return _0x430609;}})['then'](function(_0xcc228d){if(_0xcc228d){var _0x12c111=_0xcc228d[_0x1e50('0x47')];if(!fs[_0x1e50('0x4b')](_0x12c111)){throw new db['Sequelize'][(_0x1e50('0x4d'))](_0x1e50('0x4e'));}if(_0xcc228d[_0x1e50('0x48')]){return _0x2de373['download'](_0x12c111,_0xcc228d['filename']+path[_0x1e50('0x4f')](_0x12c111),function(){if(_0x21fb69){fs[_0x1e50('0x50')](_0x12c111);}});}else{return _0x2de373[_0x1e50('0x44')](_0x12c111,function(_0x30702e){if(_0x21fb69){fs[_0x1e50('0x50')](_0x12c111);}});}}})[_0x1e50('0x3e')](function(_0xd1fbcb){if(_0xd1fbcb['message']===_0x1e50('0x4e')){_0x2de373[_0x1e50('0x17')](0x194)['send']('Not\x20found');}else{return handleError(_0x2de373,null);}});};exports[_0x1e50('0x51')]=function(_0x52be47,_0x39f933){return db[_0x1e50('0x24')][_0x1e50('0x41')]({'where':{'id':_0x52be47['params']['id']}})[_0x1e50('0x1e')](function(_0x2ad589){if(!_0x2ad589)throw new ReferenceError(_0x1e50('0x52'));return _0x2ad589;})[_0x1e50('0x1e')](function(_0x13c718){var _0x1bc20e=_0x13c718[_0x1e50('0x47')];logger[_0x1e50('0x53')](_0x1e50('0x54'),_0x1bc20e);if(!_[_0x1e50('0x55')](_0x13c718['savePath'])&&fs['existsSync'](_0x1bc20e)){logger['info'](_0x1e50('0x56')+_0x1bc20e+_0x1e50('0x57'));fs[_0x1e50('0x58')](_0x1bc20e);}_0x1bc20e=_0x1bc20e+_0x1e50('0x59');if(!_[_0x1e50('0x55')](_0x13c718['savePath'])&&fs[_0x1e50('0x4b')](_0x1bc20e)){logger[_0x1e50('0x53')](_0x1e50('0x56')+_0x1bc20e+_0x1e50('0x57'));fs[_0x1e50('0x58')](_0x1bc20e);}return _0x13c718;})[_0x1e50('0x1e')](function(_0x35ef0e){if(!_0x35ef0e)throw new InternalError();return _0x35ef0e[_0x1e50('0x51')]();})[_0x1e50('0x1e')](function(){_0x39f933[_0x1e50('0x17')](0xcc)[_0x1e50('0x5a')]();})['catch'](handleError(_0x39f933,null));};
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js
index 3ba69ac..67509f7 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 _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
+var _0x331c=['request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x331c,0x1e9));var _0xc331=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x331c[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xc331('0x0'));var util=require(_0xc331('0x1'));var logger=require(_0xc331('0x2'))(_0xc331('0x3'));var moment=require(_0xc331('0x4'));var BPromise=require('bluebird');var rp=require(_0xc331('0x5'));var fs=require('fs');var path=require(_0xc331('0x6'));var rimraf=require(_0xc331('0x7'));var config=require(_0xc331('0x8'));var attributes=require(_0xc331('0x9'));module['exports']=function(_0x1a3db4,_0x140eb9){return _0x1a3db4[_0xc331('0xa')](_0xc331('0xb'),attributes,{'tableName':_0xc331('0xc'),'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 1329305..d7093c9 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 _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
+var _0x83d4=['options','raw','stringify','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','CreateSquareRecording','SquareRecording','body'];(function(_0x53777c,_0x320988){var _0x5a3f15=function(_0x5df142){while(--_0x5df142){_0x53777c['push'](_0x53777c['shift']());}};_0x5a3f15(++_0x320988);}(_0x83d4,0xb2));var _0x483d=function(_0x4b83eb,_0x220b02){_0x4b83eb=_0x4b83eb-0x0;var _0x3b69a5=_0x83d4[_0x4b83eb];return _0x3b69a5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x483d('0x0'));var BPromise=require('bluebird');var rs=require(_0x483d('0x1'));var fs=require('fs');var Redis=require(_0x483d('0x2'));var db=require(_0x483d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x483d('0x4'))(_0x483d('0x5'));var config=require(_0x483d('0x6'));var jayson=require(_0x483d('0x7'));var client=jayson[_0x483d('0x8')][_0x483d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47a056,_0x5c4c69,_0x59bab9){return new BPromise(function(_0x17b395,_0x5bddb5){return client['request'](_0x47a056,_0x59bab9)[_0x483d('0xa')](function(_0x2dd014){logger[_0x483d('0xb')](_0x483d('0xc'),_0x5c4c69,_0x483d('0xd'));logger[_0x483d('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x5c4c69,_0x483d('0xd'),JSON['stringify'](_0x2dd014));if(_0x2dd014['error']){if(_0x2dd014['error']['code']===0x1f4){logger['error'](_0x483d('0xc'),_0x5c4c69,_0x2dd014[_0x483d('0xf')][_0x483d('0x10')]);return _0x5bddb5(_0x2dd014[_0x483d('0xf')][_0x483d('0x10')]);}logger[_0x483d('0xf')](_0x483d('0xc'),_0x5c4c69,_0x2dd014[_0x483d('0xf')]['message']);return _0x17b395(_0x2dd014['error']['message']);}else{logger[_0x483d('0xb')]('SquareRecording,\x20%s,\x20%s',_0x5c4c69,_0x483d('0xd'));_0x17b395(_0x2dd014[_0x483d('0x11')][_0x483d('0x10')]);}})[_0x483d('0x12')](function(_0x1800c1){logger[_0x483d('0xf')](_0x483d('0xc'),_0x5c4c69,_0x1800c1);_0x5bddb5(_0x1800c1);});});}exports[_0x483d('0x13')]=function(_0x522faa){var _0x41baec=this;return new Promise(function(_0x42b340,_0x3998b5){return db[_0x483d('0x14')]['create'](_0x522faa[_0x483d('0x15')],{'raw':_0x522faa['options']?_0x522faa[_0x483d('0x16')][_0x483d('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x51856e){logger[_0x483d('0xb')]('CreateSquareRecording',_0x522faa);logger['debug']('CreateSquareRecording',_0x522faa,JSON[_0x483d('0x18')](_0x51856e));_0x42b340(_0x51856e);})[_0x483d('0x12')](function(_0x2b2b71){logger[_0x483d('0xf')]('CreateSquareRecording',_0x2b2b71[_0x483d('0x10')],_0x522faa);_0x3998b5(_0x41baec[_0x483d('0xf')](0x1f4,_0x2b2b71[_0x483d('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js
index 99635f6..00957b1 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 _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
+var _0x6a3e=['put','update','destroy','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','describe','/:id','post','create'];(function(_0x201038,_0x46c979){var _0x1b61ca=function(_0xf55d2a){while(--_0xf55d2a){_0x201038['push'](_0x201038['shift']());}};_0x1b61ca(++_0x46c979);}(_0x6a3e,0x94));var _0xe6a3=function(_0x4026db,_0x24121c){_0x4026db=_0x4026db-0x0;var _0x5d4b2e=_0x6a3e[_0x4026db];return _0x5d4b2e;};'use strict';var multer=require(_0xe6a3('0x0'));var util=require(_0xe6a3('0x1'));var path=require(_0xe6a3('0x2'));var timeout=require('connect-timeout');var express=require(_0xe6a3('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe6a3('0x4'));var config=require(_0xe6a3('0x5'));var controller=require(_0xe6a3('0x6'));router[_0xe6a3('0x7')]('/',auth[_0xe6a3('0x8')](),controller[_0xe6a3('0x9')]);router[_0xe6a3('0x7')]('/describe',auth[_0xe6a3('0x8')](),controller[_0xe6a3('0xa')]);router[_0xe6a3('0x7')](_0xe6a3('0xb'),auth[_0xe6a3('0x8')](),controller['show']);router[_0xe6a3('0xc')]('/',auth[_0xe6a3('0x8')](),controller[_0xe6a3('0xd')]);router[_0xe6a3('0xe')](_0xe6a3('0xb'),auth[_0xe6a3('0x8')](),controller[_0xe6a3('0xf')]);router['delete']('/:id',auth[_0xe6a3('0x8')](),controller[_0xe6a3('0x10')]);module[_0xe6a3('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js
index 7ace0f8..29162ef 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 _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
+var _0x77a1=['sequelize','STRING','DATE','BOOLEAN'];(function(_0x5c2663,_0x7782f7){var _0x52baef=function(_0x49b1e8){while(--_0x49b1e8){_0x5c2663['push'](_0x5c2663['shift']());}};_0x52baef(++_0x7782f7);}(_0x77a1,0x10c));var _0x177a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x77a1[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x177a('0x0'));module['exports']={'network':{'type':Sequelize[_0x177a('0x1')]},'network_script':{'type':Sequelize[_0x177a('0x1')]},'request':{'type':Sequelize[_0x177a('0x1')]},'channel':{'type':Sequelize[_0x177a('0x1')]},'language':{'type':Sequelize[_0x177a('0x1')]},'type':{'type':Sequelize[_0x177a('0x1')]},'uniqueid':{'type':Sequelize[_0x177a('0x1')]},'version':{'type':Sequelize[_0x177a('0x1')]},'callerid':{'type':Sequelize[_0x177a('0x1')]},'calleridname':{'type':Sequelize[_0x177a('0x1')]},'callingpres':{'type':Sequelize[_0x177a('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x177a('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x177a('0x1')]},'rdnis':{'type':Sequelize[_0x177a('0x1')]},'context':{'type':Sequelize[_0x177a('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x177a('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x177a('0x1')]},'threadid':{'type':Sequelize[_0x177a('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x177a('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x177a('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 0341880..32f544a 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 _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
+var _0x7cc5=['nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','SquareReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','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','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x47756d,_0x417eda){var _0x245985=function(_0x3123b0){while(--_0x3123b0){_0x47756d['push'](_0x47756d['shift']());}};_0x245985(++_0x417eda);}(_0x7cc5,0x18d));var _0x57cc=function(_0x21e31e,_0x451faf){_0x21e31e=_0x21e31e-0x0;var _0x3e5b20=_0x7cc5[_0x21e31e];return _0x3e5b20;};'use strict';var pdf=require(_0x57cc('0x0'));var emlformat=require(_0x57cc('0x1'));var rimraf=require(_0x57cc('0x2'));var zipdir=require(_0x57cc('0x3'));var jsonpatch=require(_0x57cc('0x4'));var rp=require('request-promise');var moment=require(_0x57cc('0x5'));var BPromise=require(_0x57cc('0x6'));var Mustache=require(_0x57cc('0x7'));var util=require('util');var path=require(_0x57cc('0x8'));var sox=require(_0x57cc('0x9'));var csv=require(_0x57cc('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x57cc('0xb'));var squel=require(_0x57cc('0xc'));var crypto=require(_0x57cc('0xd'));var jsforce=require(_0x57cc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x57cc('0xa'));var querystring=require('querystring');var Papa=require(_0x57cc('0xf'));var Redis=require(_0x57cc('0x10'));var authService=require(_0x57cc('0x11'));var qs=require(_0x57cc('0x12'));var as=require(_0x57cc('0x13'));var hardwareService=require(_0x57cc('0x14'));var logger=require(_0x57cc('0x15'))(_0x57cc('0x16'));var utils=require('../../config/utils');var config=require(_0x57cc('0x17'));var db=require(_0x57cc('0x18'))['db'];function respondWithStatusCode(_0x8ba422,_0x444d7e){_0x444d7e=_0x444d7e||0xcc;return function(_0x499960){if(_0x499960){return _0x8ba422[_0x57cc('0x19')](_0x444d7e);}return _0x8ba422[_0x57cc('0x1a')](_0x444d7e)[_0x57cc('0x1b')]();};}function respondWithResult(_0x5d95c1,_0x3530f7){_0x3530f7=_0x3530f7||0xc8;return function(_0x19e828){if(_0x19e828){return _0x5d95c1[_0x57cc('0x1a')](_0x3530f7)[_0x57cc('0x1c')](_0x19e828);}};}function respondWithFilteredResult(_0x2bfdaf,_0x1b0938){return function(_0x35c27f){if(_0x35c27f){var _0x2dbfbb=_0x35c27f[_0x57cc('0x1d')],_0x3a540f=_0x1b0938[_0x57cc('0x1e')],_0x1f2814=_0x1b0938[_0x57cc('0x1e')]+_0x1b0938[_0x57cc('0x1f')],_0xe718b;if(_0x1f2814>=_0x2dbfbb){_0x1f2814=_0x2dbfbb;_0xe718b=0xc8;}else{_0xe718b=0xce;}_0x2bfdaf['status'](_0xe718b);return _0x2bfdaf['set'](_0x57cc('0x20'),_0x3a540f+'-'+_0x1f2814+'/'+_0x2dbfbb)[_0x57cc('0x1c')](_0x35c27f);}return null;};}function patchUpdates(_0x1e8e4a){return function(_0x131c47){try{jsonpatch[_0x57cc('0x21')](_0x131c47,_0x1e8e4a,!![]);}catch(_0x4cb614){return BPromise[_0x57cc('0x22')](_0x4cb614);}return _0x131c47[_0x57cc('0x23')]();};}function saveUpdates(_0x2b3611,_0x46cdae){return function(_0x556bc1){if(_0x556bc1){return _0x556bc1[_0x57cc('0x24')](_0x2b3611)[_0x57cc('0x25')](function(_0x1b07b1){return _0x1b07b1;});}return null;};}function removeEntity(_0x42d3e7,_0x991848){return function(_0x115637){if(_0x115637){return _0x115637['destroy']()[_0x57cc('0x25')](function(){_0x42d3e7[_0x57cc('0x1a')](0xcc)[_0x57cc('0x1b')]();});}};}function handleEntityNotFound(_0x2baebc,_0x195e5e){return function(_0x4dd410){if(!_0x4dd410){_0x2baebc[_0x57cc('0x19')](0x194);}return _0x4dd410;};}function handleError(_0xea9215,_0x1b5544){_0x1b5544=_0x1b5544||0x1f4;return function(_0x364451){logger[_0x57cc('0x26')](_0x364451[_0x57cc('0x27')]);if(_0x364451['name']){delete _0x364451[_0x57cc('0x28')];}_0xea9215['status'](_0x1b5544)[_0x57cc('0x29')](_0x364451);};}exports[_0x57cc('0x2a')]=function(_0x36b1da,_0xa14c1b){var _0x995d24={},_0x52aa39={},_0x189c4d={'count':0x0,'rows':[]};var _0x33460c=_[_0x57cc('0x2b')](db['SquareReport'][_0x57cc('0x2c')],function(_0x3c0203){return{'name':_0x3c0203['fieldName'],'type':_0x3c0203['type']['key']};});_0x52aa39[_0x57cc('0x2d')]=_[_0x57cc('0x2b')](_0x33460c,_0x57cc('0x28'));_0x52aa39[_0x57cc('0x2e')]=_[_0x57cc('0x2f')](_0x36b1da[_0x57cc('0x2e')]);_0x52aa39[_0x57cc('0x30')]=_[_0x57cc('0x31')](_0x52aa39['model'],_0x52aa39[_0x57cc('0x2e')]);_0x995d24[_0x57cc('0x32')]=_[_0x57cc('0x31')](_0x52aa39[_0x57cc('0x2d')],qs[_0x57cc('0x33')](_0x36b1da[_0x57cc('0x2e')][_0x57cc('0x33')]));_0x995d24['attributes']=_0x995d24[_0x57cc('0x32')][_0x57cc('0x34')]?_0x995d24[_0x57cc('0x32')]:_0x52aa39[_0x57cc('0x2d')];if(!_0x36b1da[_0x57cc('0x2e')]['hasOwnProperty'](_0x57cc('0x35'))){_0x995d24[_0x57cc('0x1f')]=qs[_0x57cc('0x1f')](_0x36b1da[_0x57cc('0x2e')][_0x57cc('0x1f')]);_0x995d24[_0x57cc('0x1e')]=qs[_0x57cc('0x1e')](_0x36b1da[_0x57cc('0x2e')][_0x57cc('0x1e')]);}_0x995d24[_0x57cc('0x36')]=qs['sort'](_0x36b1da['query'][_0x57cc('0x37')]);_0x995d24['where']=qs[_0x57cc('0x30')](_[_0x57cc('0x38')](_0x36b1da['query'],_0x52aa39[_0x57cc('0x30')]),_0x33460c);if(_0x36b1da['query'][_0x57cc('0x39')]){_0x995d24[_0x57cc('0x3a')]=_[_0x57cc('0x3b')](_0x995d24[_0x57cc('0x3a')],{'$or':_['map'](_0x33460c,function(_0x201d7c){if(_0x201d7c['type']!==_0x57cc('0x3c')){var _0x58b0a6={};_0x58b0a6[_0x201d7c['name']]={'$like':'%'+_0x36b1da[_0x57cc('0x2e')]['filter']+'%'};return _0x58b0a6;}})});}_0x995d24=_['merge']({},_0x995d24,_0x36b1da[_0x57cc('0x3d')]);var _0x599dff={'where':_0x995d24[_0x57cc('0x3a')]};return db[_0x57cc('0x3e')][_0x57cc('0x1d')](_0x599dff)[_0x57cc('0x25')](function(_0x18ee67){_0x189c4d[_0x57cc('0x1d')]=_0x18ee67;if(_0x36b1da[_0x57cc('0x2e')][_0x57cc('0x3f')]){_0x995d24['include']=[{'all':!![]}];}return db['SquareReport'][_0x57cc('0x40')](_0x995d24);})[_0x57cc('0x25')](function(_0x3f1cc1){_0x189c4d[_0x57cc('0x41')]=_0x3f1cc1;return _0x189c4d;})[_0x57cc('0x25')](respondWithFilteredResult(_0xa14c1b,_0x995d24))[_0x57cc('0x42')](handleError(_0xa14c1b,null));};exports[_0x57cc('0x43')]=function(_0x509068,_0x14fc30){var _0x1e6477={'raw':!![],'where':{'id':_0x509068[_0x57cc('0x44')]['id']}},_0xf93995={};_0xf93995['model']=_['keys'](db[_0x57cc('0x3e')][_0x57cc('0x2c')]);_0xf93995[_0x57cc('0x2e')]=_[_0x57cc('0x2f')](_0x509068[_0x57cc('0x2e')]);_0xf93995[_0x57cc('0x30')]=_[_0x57cc('0x31')](_0xf93995['model'],_0xf93995['query']);_0x1e6477[_0x57cc('0x32')]=_[_0x57cc('0x31')](_0xf93995[_0x57cc('0x2d')],qs[_0x57cc('0x33')](_0x509068[_0x57cc('0x2e')]['fields']));_0x1e6477[_0x57cc('0x32')]=_0x1e6477[_0x57cc('0x32')][_0x57cc('0x34')]?_0x1e6477[_0x57cc('0x32')]:_0xf93995[_0x57cc('0x2d')];if(_0x509068[_0x57cc('0x2e')][_0x57cc('0x3f')]){_0x1e6477[_0x57cc('0x45')]=[{'all':!![]}];}_0x1e6477=_['merge']({},_0x1e6477,_0x509068[_0x57cc('0x3d')]);return db[_0x57cc('0x3e')][_0x57cc('0x46')](_0x1e6477)[_0x57cc('0x25')](handleEntityNotFound(_0x14fc30,null))['then'](respondWithResult(_0x14fc30,null))[_0x57cc('0x42')](handleError(_0x14fc30,null));};exports[_0x57cc('0x47')]=function(_0x5c7531,_0x13c47c){return db['SquareReport'][_0x57cc('0x47')](_0x5c7531['body'],{})[_0x57cc('0x25')](respondWithResult(_0x13c47c,0xc9))[_0x57cc('0x42')](handleError(_0x13c47c,null));};exports[_0x57cc('0x24')]=function(_0x57bbbc,_0x48d5bd){if(_0x57bbbc[_0x57cc('0x48')]['id']){delete _0x57bbbc['body']['id'];}return db[_0x57cc('0x3e')][_0x57cc('0x46')]({'where':{'id':_0x57bbbc['params']['id']}})['then'](handleEntityNotFound(_0x48d5bd,null))[_0x57cc('0x25')](saveUpdates(_0x57bbbc[_0x57cc('0x48')],null))[_0x57cc('0x25')](respondWithResult(_0x48d5bd,null))[_0x57cc('0x42')](handleError(_0x48d5bd,null));};exports[_0x57cc('0x49')]=function(_0x4a7ad1,_0x316e63){return db[_0x57cc('0x3e')][_0x57cc('0x46')]({'where':{'id':_0x4a7ad1[_0x57cc('0x44')]['id']}})[_0x57cc('0x25')](handleEntityNotFound(_0x316e63,null))[_0x57cc('0x25')](removeEntity(_0x316e63,null))[_0x57cc('0x42')](handleError(_0x316e63,null));};exports['describe']=function(_0x45b9d5,_0x97bd4b){return db[_0x57cc('0x3e')][_0x57cc('0x4a')]()[_0x57cc('0x25')](respondWithResult(_0x97bd4b,null))[_0x57cc('0x42')](handleError(_0x97bd4b,null));};
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js
index fa12c3d..2ddd164 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 _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
+var _0x9804=['./squareReport.attributes','define','SquareReport','report_square','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger','moment','rimraf'];(function(_0x3a091f,_0x320915){var _0xd7413a=function(_0x19a6af){while(--_0x19a6af){_0x3a091f['push'](_0x3a091f['shift']());}};_0xd7413a(++_0x320915);}(_0x9804,0x1ab));var _0x4980=function(_0x9a62de,_0x127f28){_0x9a62de=_0x9a62de-0x0;var _0x14d7b3=_0x9804[_0x9a62de];return _0x14d7b3;};'use strict';var _=require(_0x4980('0x0'));var util=require(_0x4980('0x1'));var logger=require(_0x4980('0x2'))('api');var moment=require(_0x4980('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4980('0x4'));var config=require('../../config/environment');var attributes=require(_0x4980('0x5'));module['exports']=function(_0x137676,_0x370b63){return _0x137676[_0x4980('0x6')](_0x4980('0x7'),attributes,{'tableName':_0x4980('0x8'),'paranoid':![],'indexes':[{'name':_0x4980('0x9'),'fields':[_0x4980('0xa'),'project_name']},{'name':_0x4980('0xb'),'fields':[_0x4980('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js
index f377e0e..f486505 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 _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
+var _0x98bb=['then','info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareReport','SquareReport','create','body','options','raw','catch','UpdateSquareReport','update','where','limit','debug','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x48c886,_0x42607a){var _0x24a99c=function(_0x154743){while(--_0x154743){_0x48c886['push'](_0x48c886['shift']());}};_0x24a99c(++_0x42607a);}(_0x98bb,0x1d5));var _0xb98b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x98bb[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb98b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb98b('0x1'));var rs=require(_0xb98b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb98b('0x3'));var logger=require(_0xb98b('0x4'))(_0xb98b('0x5'));var config=require(_0xb98b('0x6'));var jayson=require(_0xb98b('0x7'));var client=jayson[_0xb98b('0x8')][_0xb98b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4730cf,_0x1322ae,_0x4ad331){return new BPromise(function(_0x1ed2a2,_0x4b29d5){return client[_0xb98b('0xa')](_0x4730cf,_0x4ad331)[_0xb98b('0xb')](function(_0x4db0ff){logger[_0xb98b('0xc')](_0xb98b('0xd'),_0x1322ae,'request\x20sent');logger['debug'](_0xb98b('0xe'),_0x1322ae,'request\x20sent',JSON[_0xb98b('0xf')](_0x4db0ff));if(_0x4db0ff[_0xb98b('0x10')]){if(_0x4db0ff['error'][_0xb98b('0x11')]===0x1f4){logger[_0xb98b('0x10')](_0xb98b('0xd'),_0x1322ae,_0x4db0ff['error']['message']);return _0x4b29d5(_0x4db0ff[_0xb98b('0x10')]['message']);}logger[_0xb98b('0x10')](_0xb98b('0xd'),_0x1322ae,_0x4db0ff['error'][_0xb98b('0x12')]);return _0x1ed2a2(_0x4db0ff[_0xb98b('0x10')][_0xb98b('0x12')]);}else{logger[_0xb98b('0xc')](_0xb98b('0xd'),_0x1322ae,'request\x20sent');_0x1ed2a2(_0x4db0ff[_0xb98b('0x13')][_0xb98b('0x12')]);}})['catch'](function(_0x119895){logger[_0xb98b('0x10')](_0xb98b('0xd'),_0x1322ae,_0x119895);_0x4b29d5(_0x119895);});});}exports[_0xb98b('0x14')]=function(_0x19762f){var _0xb75ba6=this;return new Promise(function(_0x327758,_0x4771f4){return db[_0xb98b('0x15')][_0xb98b('0x16')](_0x19762f[_0xb98b('0x17')],{'raw':_0x19762f[_0xb98b('0x18')]?_0x19762f[_0xb98b('0x18')][_0xb98b('0x19')]===undefined?!![]:![]:!![]})[_0xb98b('0xb')](function(_0x35b08d){logger[_0xb98b('0xc')]('CreateSquareReport',_0x19762f);logger['debug'](_0xb98b('0x14'),_0x19762f,JSON[_0xb98b('0xf')](_0x35b08d));_0x327758(_0x35b08d);})[_0xb98b('0x1a')](function(_0xe7a511){logger[_0xb98b('0x10')](_0xb98b('0x14'),_0xe7a511['message'],_0x19762f);_0x4771f4(_0xb75ba6[_0xb98b('0x10')](0x1f4,_0xe7a511[_0xb98b('0x12')]));});});};exports[_0xb98b('0x1b')]=function(_0x426b67){var _0x151e0f=this;return new Promise(function(_0x18bb38,_0xcffacc){return db[_0xb98b('0x15')][_0xb98b('0x1c')](_0x426b67[_0xb98b('0x17')],{'raw':_0x426b67[_0xb98b('0x18')]?_0x426b67[_0xb98b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x426b67['options']?_0x426b67[_0xb98b('0x18')][_0xb98b('0x1d')]||null:null,'attributes':_0x426b67[_0xb98b('0x18')]?_0x426b67[_0xb98b('0x18')]['attributes']||null:null,'limit':_0x426b67[_0xb98b('0x18')]?_0x426b67[_0xb98b('0x18')][_0xb98b('0x1e')]||null:null})[_0xb98b('0xb')](function(_0x101853){logger[_0xb98b('0xc')](_0xb98b('0x1b'),_0x426b67);logger[_0xb98b('0x1f')]('UpdateSquareReport',_0x426b67,JSON[_0xb98b('0xf')](_0x101853));_0x18bb38(_0x101853);})[_0xb98b('0x1a')](function(_0x2032b7){logger['error'](_0xb98b('0x1b'),_0x2032b7['message'],_0x426b67);_0xcffacc(_0x151e0f['error'](0x1f4,_0x2032b7['message']));});});};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js
index 182fb15..70d2568 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 _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
+var _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x521258,_0x25ff14){var _0x4abddf=function(_0x5a81d9){while(--_0x5a81d9){_0x521258['push'](_0x521258['shift']());}};_0x4abddf(++_0x25ff14);}(_0x7a54,0x106));var _0x47a5=function(_0x2b533b,_0x59e41f){_0x2b533b=_0x2b533b-0x0;var _0x204c55=_0x7a54[_0x2b533b];return _0x204c55;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js
index 96c867a..b609459 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 _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
+var _0x6765=['STRING','TEXT','sequelize','exports'];(function(_0x192e7e,_0x4b446e){var _0x15205c=function(_0x4c30d1){while(--_0x4c30d1){_0x192e7e['push'](_0x192e7e['shift']());}};_0x15205c(++_0x4b446e);}(_0x6765,0x13a));var _0x5676=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x6765[_0x36dfbd];return _0x4ecad9;};'use strict';var Sequelize=require(_0x5676('0x0'));module[_0x5676('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x5676('0x2')]},'application':{'type':Sequelize[_0x5676('0x2')]},'data':{'type':Sequelize[_0x5676('0x3')]},'project_name':{'type':Sequelize[_0x5676('0x2')]},'callerid':{'type':Sequelize[_0x5676('0x2')]}};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js
index 21d8333..86d0120 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 _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
+var _0x1e4d=['rimraf','fast-json-patch','request-promise','util','to-csv','ejs','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','send','SquareDetailsReport','rawAttributes','type','key','map','keys','filters','intersection','model','query','attributes','fields','length','order','where','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','show','options','create','body','find','params','describe','html-pdf'];(function(_0xbb3935,_0x4fedd4){var _0x1d0806=function(_0x2c6611){while(--_0x2c6611){_0xbb3935['push'](_0xbb3935['shift']());}};_0x1d0806(++_0x4fedd4);}(_0x1e4d,0xfb));var _0xd1e4=function(_0xf72b47,_0x4596ee){_0xf72b47=_0xf72b47-0x0;var _0xd69d2d=_0x1e4d[_0xf72b47];return _0xd69d2d;};'use strict';var pdf=require(_0xd1e4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd1e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd1e4('0x2'));var rp=require(_0xd1e4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd1e4('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xd1e4('0x5'));var ejs=require(_0xd1e4('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd1e4('0x7'));var deskjs=require(_0xd1e4('0x8'));var toCsv=require(_0xd1e4('0x5'));var querystring=require(_0xd1e4('0x9'));var Papa=require('papaparse');var Redis=require(_0xd1e4('0xa'));var authService=require('../../components/auth/service');var qs=require(_0xd1e4('0xb'));var as=require(_0xd1e4('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd1e4('0xd'));var utils=require(_0xd1e4('0xe'));var config=require(_0xd1e4('0xf'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b1106,_0x3e7235){_0x3e7235=_0x3e7235||0xcc;return function(_0x2f3a94){if(_0x2f3a94){return _0x1b1106['sendStatus'](_0x3e7235);}return _0x1b1106[_0xd1e4('0x10')](_0x3e7235)[_0xd1e4('0x11')]();};}function respondWithResult(_0x347b6f,_0xa514b3){_0xa514b3=_0xa514b3||0xc8;return function(_0x1bdf42){if(_0x1bdf42){return _0x347b6f[_0xd1e4('0x10')](_0xa514b3)[_0xd1e4('0x12')](_0x1bdf42);}};}function respondWithFilteredResult(_0x148f86,_0x40ded7){return function(_0x108b24){if(_0x108b24){var _0x2251a9=_0x108b24['count'],_0x31df7b=_0x40ded7[_0xd1e4('0x13')],_0x279504=_0x40ded7[_0xd1e4('0x13')]+_0x40ded7[_0xd1e4('0x14')],_0x25aa89;if(_0x279504>=_0x2251a9){_0x279504=_0x2251a9;_0x25aa89=0xc8;}else{_0x25aa89=0xce;}_0x148f86['status'](_0x25aa89);return _0x148f86[_0xd1e4('0x15')](_0xd1e4('0x16'),_0x31df7b+'-'+_0x279504+'/'+_0x2251a9)['json'](_0x108b24);}return null;};}function patchUpdates(_0x1a8b90){return function(_0xcce5c4){try{jsonpatch[_0xd1e4('0x17')](_0xcce5c4,_0x1a8b90,!![]);}catch(_0x1d265f){return BPromise['reject'](_0x1d265f);}return _0xcce5c4[_0xd1e4('0x18')]();};}function saveUpdates(_0xf6127f,_0x13318f){return function(_0xd81c56){if(_0xd81c56){return _0xd81c56[_0xd1e4('0x19')](_0xf6127f)[_0xd1e4('0x1a')](function(_0xb1ae59){return _0xb1ae59;});}return null;};}function removeEntity(_0x3a953a,_0x5479a9){return function(_0x73416a){if(_0x73416a){return _0x73416a[_0xd1e4('0x1b')]()['then'](function(){_0x3a953a[_0xd1e4('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2decad,_0x333bc8){return function(_0x4c5532){if(!_0x4c5532){_0x2decad[_0xd1e4('0x1c')](0x194);}return _0x4c5532;};}function handleError(_0xc40963,_0x314478){_0x314478=_0x314478||0x1f4;return function(_0x33d494){logger[_0xd1e4('0x1d')](_0x33d494['stack']);if(_0x33d494[_0xd1e4('0x1e')]){delete _0x33d494[_0xd1e4('0x1e')];}_0xc40963[_0xd1e4('0x10')](_0x314478)[_0xd1e4('0x1f')](_0x33d494);};}exports['index']=function(_0xc11dc3,_0x3c2894){var _0x1fc63e={},_0x3eedd1={},_0x5f5dcb={'count':0x0,'rows':[]};var _0x40438a=_['map'](db[_0xd1e4('0x20')][_0xd1e4('0x21')],function(_0x35765e){return{'name':_0x35765e['fieldName'],'type':_0x35765e[_0xd1e4('0x22')][_0xd1e4('0x23')]};});_0x3eedd1['model']=_[_0xd1e4('0x24')](_0x40438a,_0xd1e4('0x1e'));_0x3eedd1['query']=_[_0xd1e4('0x25')](_0xc11dc3['query']);_0x3eedd1[_0xd1e4('0x26')]=_[_0xd1e4('0x27')](_0x3eedd1[_0xd1e4('0x28')],_0x3eedd1[_0xd1e4('0x29')]);_0x1fc63e[_0xd1e4('0x2a')]=_[_0xd1e4('0x27')](_0x3eedd1[_0xd1e4('0x28')],qs[_0xd1e4('0x2b')](_0xc11dc3['query'][_0xd1e4('0x2b')]));_0x1fc63e[_0xd1e4('0x2a')]=_0x1fc63e[_0xd1e4('0x2a')][_0xd1e4('0x2c')]?_0x1fc63e['attributes']:_0x3eedd1[_0xd1e4('0x28')];if(!_0xc11dc3[_0xd1e4('0x29')]['hasOwnProperty']('nolimit')){_0x1fc63e[_0xd1e4('0x14')]=qs['limit'](_0xc11dc3[_0xd1e4('0x29')][_0xd1e4('0x14')]);_0x1fc63e[_0xd1e4('0x13')]=qs[_0xd1e4('0x13')](_0xc11dc3['query']['offset']);}_0x1fc63e[_0xd1e4('0x2d')]=qs['sort'](_0xc11dc3[_0xd1e4('0x29')]['sort']);_0x1fc63e[_0xd1e4('0x2e')]=qs[_0xd1e4('0x26')](_['pick'](_0xc11dc3[_0xd1e4('0x29')],_0x3eedd1[_0xd1e4('0x26')]),_0x40438a);if(_0xc11dc3[_0xd1e4('0x29')]['filter']){_0x1fc63e['where']=_[_0xd1e4('0x2f')](_0x1fc63e[_0xd1e4('0x2e')],{'$or':_[_0xd1e4('0x24')](_0x40438a,function(_0xfbf5ce){if(_0xfbf5ce[_0xd1e4('0x22')]!==_0xd1e4('0x30')){var _0xf415ef={};_0xf415ef[_0xfbf5ce[_0xd1e4('0x1e')]]={'$like':'%'+_0xc11dc3[_0xd1e4('0x29')][_0xd1e4('0x31')]+'%'};return _0xf415ef;}})});}_0x1fc63e=_[_0xd1e4('0x2f')]({},_0x1fc63e,_0xc11dc3['options']);var _0x3852df={'where':_0x1fc63e[_0xd1e4('0x2e')]};return db[_0xd1e4('0x20')][_0xd1e4('0x32')](_0x3852df)[_0xd1e4('0x1a')](function(_0x35c84b){_0x5f5dcb[_0xd1e4('0x32')]=_0x35c84b;if(_0xc11dc3[_0xd1e4('0x29')][_0xd1e4('0x33')]){_0x1fc63e[_0xd1e4('0x34')]=[{'all':!![]}];}return db[_0xd1e4('0x20')][_0xd1e4('0x35')](_0x1fc63e);})[_0xd1e4('0x1a')](function(_0x5f47f2){_0x5f5dcb[_0xd1e4('0x36')]=_0x5f47f2;return _0x5f5dcb;})[_0xd1e4('0x1a')](respondWithFilteredResult(_0x3c2894,_0x1fc63e))[_0xd1e4('0x37')](handleError(_0x3c2894,null));};exports[_0xd1e4('0x38')]=function(_0x6dbeee,_0x90d21f){var _0x173258={'raw':!![],'where':{'id':_0x6dbeee['params']['id']}},_0x3fa877={};_0x3fa877[_0xd1e4('0x28')]=_[_0xd1e4('0x25')](db['SquareDetailsReport'][_0xd1e4('0x21')]);_0x3fa877[_0xd1e4('0x29')]=_[_0xd1e4('0x25')](_0x6dbeee[_0xd1e4('0x29')]);_0x3fa877['filters']=_[_0xd1e4('0x27')](_0x3fa877[_0xd1e4('0x28')],_0x3fa877[_0xd1e4('0x29')]);_0x173258[_0xd1e4('0x2a')]=_[_0xd1e4('0x27')](_0x3fa877[_0xd1e4('0x28')],qs[_0xd1e4('0x2b')](_0x6dbeee[_0xd1e4('0x29')][_0xd1e4('0x2b')]));_0x173258['attributes']=_0x173258[_0xd1e4('0x2a')][_0xd1e4('0x2c')]?_0x173258[_0xd1e4('0x2a')]:_0x3fa877['model'];if(_0x6dbeee[_0xd1e4('0x29')][_0xd1e4('0x33')]){_0x173258[_0xd1e4('0x34')]=[{'all':!![]}];}_0x173258=_['merge']({},_0x173258,_0x6dbeee[_0xd1e4('0x39')]);return db[_0xd1e4('0x20')]['find'](_0x173258)[_0xd1e4('0x1a')](handleEntityNotFound(_0x90d21f,null))['then'](respondWithResult(_0x90d21f,null))[_0xd1e4('0x37')](handleError(_0x90d21f,null));};exports[_0xd1e4('0x3a')]=function(_0x56a739,_0x5bfcf4){return db['SquareDetailsReport'][_0xd1e4('0x3a')](_0x56a739[_0xd1e4('0x3b')],{})['then'](respondWithResult(_0x5bfcf4,0xc9))[_0xd1e4('0x37')](handleError(_0x5bfcf4,null));};exports['update']=function(_0xe4f30d,_0x307eef){if(_0xe4f30d[_0xd1e4('0x3b')]['id']){delete _0xe4f30d[_0xd1e4('0x3b')]['id'];}return db[_0xd1e4('0x20')][_0xd1e4('0x3c')]({'where':{'id':_0xe4f30d[_0xd1e4('0x3d')]['id']}})[_0xd1e4('0x1a')](handleEntityNotFound(_0x307eef,null))[_0xd1e4('0x1a')](saveUpdates(_0xe4f30d['body'],null))[_0xd1e4('0x1a')](respondWithResult(_0x307eef,null))[_0xd1e4('0x37')](handleError(_0x307eef,null));};exports[_0xd1e4('0x1b')]=function(_0xc82bca,_0x5b6ebc){return db['SquareDetailsReport'][_0xd1e4('0x3c')]({'where':{'id':_0xc82bca[_0xd1e4('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5b6ebc,null))[_0xd1e4('0x1a')](removeEntity(_0x5b6ebc,null))[_0xd1e4('0x37')](handleError(_0x5b6ebc,null));};exports[_0xd1e4('0x3e')]=function(_0x5ec6fc,_0x4fe39f){return db[_0xd1e4('0x20')][_0xd1e4('0x3e')]()[_0xd1e4('0x1a')](respondWithResult(_0x4fe39f,null))[_0xd1e4('0x37')](handleError(_0x4fe39f,null));};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js
index c765765..080acf0 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 _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
+var _0x81cc=['path','rimraf','./squareReportDetail.attributes','exports','report_square_details','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4cdcfb,_0x489c3b){var _0x5c240f=function(_0x1e6a75){while(--_0x1e6a75){_0x4cdcfb['push'](_0x4cdcfb['shift']());}};_0x5c240f(++_0x489c3b);}(_0x81cc,0x73));var _0xc81c=function(_0xf6f87b,_0x417bbc){_0xf6f87b=_0xf6f87b-0x0;var _0x19845b=_0x81cc[_0xf6f87b];return _0x19845b;};'use strict';var _=require(_0xc81c('0x0'));var util=require(_0xc81c('0x1'));var logger=require(_0xc81c('0x2'))(_0xc81c('0x3'));var moment=require('moment');var BPromise=require(_0xc81c('0x4'));var rp=require(_0xc81c('0x5'));var fs=require('fs');var path=require(_0xc81c('0x6'));var rimraf=require(_0xc81c('0x7'));var config=require('../../config/environment');var attributes=require(_0xc81c('0x8'));module[_0xc81c('0x9')]=function(_0x5ace93,_0x3cd394){return _0x5ace93['define']('SquareDetailsReport',attributes,{'tableName':_0xc81c('0xa'),'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 53b5553..8b3f929 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 _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
+var _0xc9a7=['catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result'];(function(_0x14e287,_0x41aedc){var _0x3f4c24=function(_0xaab3a3){while(--_0xaab3a3){_0x14e287['push'](_0x14e287['shift']());}};_0x3f4c24(++_0x41aedc);}(_0xc9a7,0xf9));var _0x7c9a=function(_0xdc004,_0x4e61ca){_0xdc004=_0xdc004-0x0;var _0x22e6a3=_0xc9a7[_0xdc004];return _0x22e6a3;};'use strict';var _=require(_0x7c9a('0x0'));var util=require(_0x7c9a('0x1'));var moment=require(_0x7c9a('0x2'));var BPromise=require(_0x7c9a('0x3'));var rs=require(_0x7c9a('0x4'));var fs=require('fs');var Redis=require(_0x7c9a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7c9a('0x6'));var config=require(_0x7c9a('0x7'));var jayson=require(_0x7c9a('0x8'));var client=jayson['client'][_0x7c9a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b9f07,_0x12e3d9,_0x37ef41){return new BPromise(function(_0x1308a6,_0x1cafb8){return client[_0x7c9a('0xa')](_0x2b9f07,_0x37ef41)[_0x7c9a('0xb')](function(_0x480668){logger['info'](_0x7c9a('0xc'),_0x12e3d9,_0x7c9a('0xd'));logger[_0x7c9a('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x12e3d9,'request\x20sent',JSON[_0x7c9a('0xf')](_0x480668));if(_0x480668['error']){if(_0x480668[_0x7c9a('0x10')][_0x7c9a('0x11')]===0x1f4){logger[_0x7c9a('0x10')](_0x7c9a('0xc'),_0x12e3d9,_0x480668[_0x7c9a('0x10')][_0x7c9a('0x12')]);return _0x1cafb8(_0x480668['error'][_0x7c9a('0x12')]);}logger['error'](_0x7c9a('0xc'),_0x12e3d9,_0x480668[_0x7c9a('0x10')][_0x7c9a('0x12')]);return _0x1308a6(_0x480668[_0x7c9a('0x10')][_0x7c9a('0x12')]);}else{logger[_0x7c9a('0x13')](_0x7c9a('0xc'),_0x12e3d9,_0x7c9a('0xd'));_0x1308a6(_0x480668[_0x7c9a('0x14')]['message']);}})[_0x7c9a('0x15')](function(_0x4d0fe7){logger[_0x7c9a('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x12e3d9,_0x4d0fe7);_0x1cafb8(_0x4d0fe7);});});}exports[_0x7c9a('0x16')]=function(_0x32890e){var _0x255462=this;return new Promise(function(_0x481b1e,_0x509dfc){return db[_0x7c9a('0x17')]['create'](_0x32890e[_0x7c9a('0x18')],{'raw':_0x32890e['options']?_0x32890e[_0x7c9a('0x19')][_0x7c9a('0x1a')]===undefined?!![]:![]:!![]})[_0x7c9a('0xb')](function(_0x64cbd3){logger[_0x7c9a('0x13')](_0x7c9a('0x16'),_0x32890e);logger['debug'](_0x7c9a('0x16'),_0x32890e,JSON[_0x7c9a('0xf')](_0x64cbd3));_0x481b1e(_0x64cbd3);})[_0x7c9a('0x15')](function(_0x39ae6e){logger[_0x7c9a('0x10')](_0x7c9a('0x16'),_0x39ae6e['message'],_0x32890e);_0x509dfc(_0x255462['error'](0x1f4,_0x39ae6e['message']));});});};
\ No newline at end of file
diff --git a/server/api/system/index.js b/server/api/system/index.js
index a3b42de..da3a7f9 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 _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
+var _0x06f7=['Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','killProcess','express'];(function(_0x273422,_0x11abe1){var _0x144440=function(_0x257f41){while(--_0x257f41){_0x273422['push'](_0x273422['shift']());}};_0x144440(++_0x11abe1);}(_0x06f7,0xd7));var _0x706f=function(_0x4f32de,_0x5bd4a){_0x4f32de=_0x4f32de-0x0;var _0x149821=_0x06f7[_0x4f32de];return _0x149821;};'use strict';var express=require(_0x706f('0x0'));var router=express[_0x706f('0x1')]();var auth=require(_0x706f('0x2'));var controller=require(_0x706f('0x3'));router[_0x706f('0x4')]('/',auth[_0x706f('0x5')](),controller[_0x706f('0x6')]);router[_0x706f('0x4')]('/process/:pid/kill',auth[_0x706f('0x5')](),controller[_0x706f('0x7')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js
index f64c492..785aa65 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 _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
+var _0x8549=['SIGINT','killProcess','../../config/logger','util','lodash','inspect','name','send','getAllData','then','status','catch','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x8549,0x113));var _0x9854=function(_0x367bd3,_0x1f9027){_0x367bd3=_0x367bd3-0x0;var _0x4f0b13=_0x8549[_0x367bd3];return _0x4f0b13;};'use strict';var info=require('systeminformation');var exec=require('child_process')['exec'];var logger=require(_0x9854('0x0'))('api');var util=require(_0x9854('0x1'));var BPromise=require('bluebird');var _=require(_0x9854('0x2'));function handleError(_0x1ea948,_0x191f8c,_0x23fe5d){_0x191f8c=_0x191f8c||0x1f4;return function(_0xde3882){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x23fe5d,_0x191f8c,util[_0x9854('0x3')](_0xde3882,{'showHidden':![],'depth':null}));delete _0xde3882[_0x9854('0x4')];_0x1ea948['status'](_0x191f8c)[_0x9854('0x5')](_0xde3882);};}exports['index']=function(_0x10b11e,_0x46a3cc){return info[_0x9854('0x6')]()[_0x9854('0x7')](function(_0x28e8f2){return _0x46a3cc[_0x9854('0x8')](0xc8)['json'](_0x28e8f2);})[_0x9854('0x9')](function(_0x504875){return _0x46a3cc[_0x9854('0x8')](0x1f4)[_0x9854('0xa')](_0x504875);});};exports['killProcess']=function(_0x2cd512,_0x3047dd){var _0x1b9746=[_0x9854('0xb')];return new BPromise(function(_0x186b37,_0x9ff256){return exec(util[_0x9854('0xc')](_0x9854('0xd'),_0x2cd512['params'][_0x9854('0xe')]),function(_0x2116c2,_0x3e3d51,_0x3e4ca4){if(_0x2116c2){return _0x9ff256(_0x2116c2);}return _0x186b37(_0x3e3d51);});})[_0x9854('0x7')](function(_0x198e3a){var _0x14754f=![];var _0x23b553=_0x198e3a['split'](/\n/);for(var _0xe21422=0x0,_0x22890d=_0x1b9746['length'];_0xe21422<_0x22890d,_0x14754f===![];_0xe21422+=0x1){if(_0x198e3a[_0x9854('0xf')](_0x1b9746[_0xe21422])>=0x0){_0x14754f=!![];}}if(!_0x14754f){throw new Error(util['format'](_0x9854('0x10'),_0x2cd512[_0x9854('0x11')][_0x9854('0xe')]));}process[_0x9854('0x12')](_0x2cd512[_0x9854('0x11')]['pid'],_0x9854('0x13'));return _0x3047dd[_0x9854('0x8')](0xc8)[_0x9854('0xa')]({'message':util[_0x9854('0xc')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x2cd512[_0x9854('0x11')][_0x9854('0xe')])});})[_0x9854('0x9')](handleError(_0x3047dd,null,_0x9854('0x14')));};
\ No newline at end of file
diff --git a/server/api/tag/index.js b/server/api/tag/index.js
index d6698fc..592b150 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 _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
+var _0xdace=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','get','show','post','create','put','/:id','delete','exports','multer'];(function(_0x1d1031,_0x4c8354){var _0x371d1b=function(_0x2a63bc){while(--_0x2a63bc){_0x1d1031['push'](_0x1d1031['shift']());}};_0x371d1b(++_0x4c8354);}(_0xdace,0xc5));var _0xedac=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0xdace[_0x50f392];return _0x5926f2;};'use strict';var multer=require(_0xedac('0x0'));var util=require('util');var path=require(_0xedac('0x1'));var timeout=require(_0xedac('0x2'));var express=require(_0xedac('0x3'));var router=express['Router']();var auth=require(_0xedac('0x4'));var interaction=require(_0xedac('0x5'));var config=require(_0xedac('0x6'));var controller=require(_0xedac('0x7'));router['get']('/',auth[_0xedac('0x8')](),controller[_0xedac('0x9')]);router[_0xedac('0xa')]('/:id',auth[_0xedac('0x8')](),controller[_0xedac('0xb')]);router[_0xedac('0xc')]('/',auth['isAuthenticated'](),controller[_0xedac('0xd')]);router[_0xedac('0xe')](_0xedac('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xedac('0x10')](_0xedac('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xedac('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js
index 3888f4c..9af69a8 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 _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
+var _0xac4a=['exports','STRING','name','#0091EA','sequelize'];(function(_0x259789,_0x6eb44f){var _0x74ad9f=function(_0x557349){while(--_0x557349){_0x259789['push'](_0x259789['shift']());}};_0x74ad9f(++_0x6eb44f);}(_0xac4a,0x13f));var _0xaac4=function(_0x5baa14,_0x2efc6a){_0x5baa14=_0x5baa14-0x0;var _0x52107c=_0xac4a[_0x5baa14];return _0x52107c;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'name':{'type':Sequelize[_0xaac4('0x2')],'unique':_0xaac4('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xaac4('0x2')],'defaultValue':_0xaac4('0x4')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js
index b0e1baa..ebb83ea 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 _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
+var _0xdfdc=['key','model','query','keys','attributes','intersection','fields','nolimit','order','sort','where','pick','filters','filter','merge','type','options','Tag','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','then','get','Tags','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes'];(function(_0xe09b32,_0x9a33b9){var _0x611dfc=function(_0x1413cb){while(--_0x1413cb){_0xe09b32['push'](_0xe09b32['shift']());}};_0x611dfc(++_0x9a33b9);}(_0xdfdc,0x1e8));var _0xcdfd=function(_0x5388cb,_0x34c4e7){_0x5388cb=_0x5388cb-0x0;var _0x4c7d99=_0xdfdc[_0x5388cb];return _0x4c7d99;};'use strict';var pdf=require(_0xcdfd('0x0'));var emlformat=require(_0xcdfd('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xcdfd('0x2'));var jsonpatch=require(_0xcdfd('0x3'));var rp=require(_0xcdfd('0x4'));var moment=require(_0xcdfd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcdfd('0x6'));var util=require(_0xcdfd('0x7'));var path=require('path');var sox=require(_0xcdfd('0x8'));var csv=require('to-csv');var ejs=require(_0xcdfd('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcdfd('0xa'));var crypto=require(_0xcdfd('0xb'));var jsforce=require(_0xcdfd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcdfd('0xd'));var querystring=require(_0xcdfd('0xe'));var Papa=require(_0xcdfd('0xf'));var Redis=require(_0xcdfd('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcdfd('0x11'));var hardwareService=require(_0xcdfd('0x12'));var logger=require(_0xcdfd('0x13'))('api');var utils=require(_0xcdfd('0x14'));var config=require(_0xcdfd('0x15'));var db=require(_0xcdfd('0x16'))['db'];function respondWithStatusCode(_0x3d7761,_0x25321b){_0x25321b=_0x25321b||0xcc;return function(_0x423172){if(_0x423172){return _0x3d7761[_0xcdfd('0x17')](_0x25321b);}return _0x3d7761[_0xcdfd('0x18')](_0x25321b)[_0xcdfd('0x19')]();};}function respondWithResult(_0x3dae92,_0x54bb81){_0x54bb81=_0x54bb81||0xc8;return function(_0x3ad6bf){if(_0x3ad6bf){return _0x3dae92[_0xcdfd('0x18')](_0x54bb81)[_0xcdfd('0x1a')](_0x3ad6bf);}};}function respondWithFilteredResult(_0x30d65e,_0x4d50d0){return function(_0x316e19){if(_0x316e19){var _0xf22fa=_0x316e19[_0xcdfd('0x1b')],_0xf6df37=_0x4d50d0[_0xcdfd('0x1c')],_0x1d8d2f=_0x4d50d0['offset']+_0x4d50d0[_0xcdfd('0x1d')],_0x52be60;if(_0x1d8d2f>=_0xf22fa){_0x1d8d2f=_0xf22fa;_0x52be60=0xc8;}else{_0x52be60=0xce;}_0x30d65e[_0xcdfd('0x18')](_0x52be60);return _0x30d65e[_0xcdfd('0x1e')](_0xcdfd('0x1f'),_0xf6df37+'-'+_0x1d8d2f+'/'+_0xf22fa)[_0xcdfd('0x1a')](_0x316e19);}return null;};}function patchUpdates(_0xd8124d){return function(_0x5c746e){try{jsonpatch['apply'](_0x5c746e,_0xd8124d,!![]);}catch(_0x14cd77){return BPromise[_0xcdfd('0x20')](_0x14cd77);}return _0x5c746e['save']();};}function saveUpdates(_0x5bf7c1,_0x524b30){return function(_0x1c530f){if(_0x1c530f){return _0x1c530f['update'](_0x5bf7c1)[_0xcdfd('0x21')](function(_0x1247a4){return _0x1247a4;});}return null;};}function removeEntity(_0x10e3bd,_0x5e3ee3){return function(_0x28a833){if(_0x28a833){return _0x28a833['destroy']()['then'](function(){var _0x5094bf=_0x28a833[_0xcdfd('0x22')]({'plain':!![]});var _0x5402b8=_0xcdfd('0x23');return db[_0xcdfd('0x24')][_0xcdfd('0x25')]({'where':{'type':_0x5402b8,'resourceId':_0x5094bf['id']}})[_0xcdfd('0x21')](function(){return _0x28a833;});})[_0xcdfd('0x21')](function(){_0x10e3bd['status'](0xcc)[_0xcdfd('0x19')]();});}};}function handleEntityNotFound(_0x3a13ff,_0x5d6ee6){return function(_0x22d2f8){if(!_0x22d2f8){_0x3a13ff[_0xcdfd('0x17')](0x194);}return _0x22d2f8;};}function handleError(_0x106da5,_0x2ebaf1){_0x2ebaf1=_0x2ebaf1||0x1f4;return function(_0x531cb5){logger[_0xcdfd('0x26')](_0x531cb5[_0xcdfd('0x27')]);if(_0x531cb5[_0xcdfd('0x28')]){delete _0x531cb5[_0xcdfd('0x28')];}_0x106da5[_0xcdfd('0x18')](_0x2ebaf1)[_0xcdfd('0x29')](_0x531cb5);};}exports['index']=function(_0x5b9ff6,_0x8ae832){var _0x16ac9c={},_0x28f0b4={},_0x2191d1={'count':0x0,'rows':[]};var _0x2128fa=_[_0xcdfd('0x2a')](db['Tag'][_0xcdfd('0x2b')],function(_0x31be03){return{'name':_0x31be03['fieldName'],'type':_0x31be03['type'][_0xcdfd('0x2c')]};});_0x28f0b4[_0xcdfd('0x2d')]=_[_0xcdfd('0x2a')](_0x2128fa,'name');_0x28f0b4[_0xcdfd('0x2e')]=_[_0xcdfd('0x2f')](_0x5b9ff6['query']);_0x28f0b4['filters']=_['intersection'](_0x28f0b4[_0xcdfd('0x2d')],_0x28f0b4[_0xcdfd('0x2e')]);_0x16ac9c[_0xcdfd('0x30')]=_[_0xcdfd('0x31')](_0x28f0b4[_0xcdfd('0x2d')],qs[_0xcdfd('0x32')](_0x5b9ff6[_0xcdfd('0x2e')][_0xcdfd('0x32')]));_0x16ac9c[_0xcdfd('0x30')]=_0x16ac9c[_0xcdfd('0x30')]['length']?_0x16ac9c[_0xcdfd('0x30')]:_0x28f0b4[_0xcdfd('0x2d')];if(!_0x5b9ff6[_0xcdfd('0x2e')]['hasOwnProperty'](_0xcdfd('0x33'))){_0x16ac9c[_0xcdfd('0x1d')]=qs[_0xcdfd('0x1d')](_0x5b9ff6[_0xcdfd('0x2e')]['limit']);_0x16ac9c[_0xcdfd('0x1c')]=qs[_0xcdfd('0x1c')](_0x5b9ff6[_0xcdfd('0x2e')][_0xcdfd('0x1c')]);}_0x16ac9c[_0xcdfd('0x34')]=qs[_0xcdfd('0x35')](_0x5b9ff6['query']['sort']);_0x16ac9c[_0xcdfd('0x36')]=qs['filters'](_[_0xcdfd('0x37')](_0x5b9ff6[_0xcdfd('0x2e')],_0x28f0b4[_0xcdfd('0x38')]),_0x2128fa);if(_0x5b9ff6[_0xcdfd('0x2e')][_0xcdfd('0x39')]){_0x16ac9c[_0xcdfd('0x36')]=_[_0xcdfd('0x3a')](_0x16ac9c[_0xcdfd('0x36')],{'$or':_[_0xcdfd('0x2a')](_0x2128fa,function(_0x5c929a){if(_0x5c929a[_0xcdfd('0x3b')]!=='VIRTUAL'){var _0x9a4bee={};_0x9a4bee[_0x5c929a[_0xcdfd('0x28')]]={'$like':'%'+_0x5b9ff6[_0xcdfd('0x2e')][_0xcdfd('0x39')]+'%'};return _0x9a4bee;}})});}_0x16ac9c=_[_0xcdfd('0x3a')]({},_0x16ac9c,_0x5b9ff6[_0xcdfd('0x3c')]);var _0xbae3a1={'where':_0x16ac9c[_0xcdfd('0x36')]};return db[_0xcdfd('0x3d')]['count'](_0xbae3a1)[_0xcdfd('0x21')](function(_0x18abe){_0x2191d1[_0xcdfd('0x1b')]=_0x18abe;if(_0x5b9ff6[_0xcdfd('0x2e')][_0xcdfd('0x3e')]){_0x16ac9c[_0xcdfd('0x3f')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x16ac9c);})[_0xcdfd('0x21')](function(_0x5b4c4c){_0x2191d1[_0xcdfd('0x40')]=_0x5b4c4c;return _0x2191d1;})[_0xcdfd('0x21')](respondWithFilteredResult(_0x8ae832,_0x16ac9c))[_0xcdfd('0x41')](handleError(_0x8ae832,null));};exports[_0xcdfd('0x42')]=function(_0x3d3183,_0x5633d3){var _0x539d03={'raw':!![],'where':{'id':_0x3d3183[_0xcdfd('0x43')]['id']}},_0x43c372={};_0x43c372[_0xcdfd('0x2d')]=_['keys'](db[_0xcdfd('0x3d')][_0xcdfd('0x2b')]);_0x43c372[_0xcdfd('0x2e')]=_[_0xcdfd('0x2f')](_0x3d3183['query']);_0x43c372[_0xcdfd('0x38')]=_[_0xcdfd('0x31')](_0x43c372[_0xcdfd('0x2d')],_0x43c372[_0xcdfd('0x2e')]);_0x539d03[_0xcdfd('0x30')]=_[_0xcdfd('0x31')](_0x43c372['model'],qs[_0xcdfd('0x32')](_0x3d3183[_0xcdfd('0x2e')][_0xcdfd('0x32')]));_0x539d03[_0xcdfd('0x30')]=_0x539d03[_0xcdfd('0x30')]['length']?_0x539d03['attributes']:_0x43c372['model'];if(_0x3d3183[_0xcdfd('0x2e')][_0xcdfd('0x3e')]){_0x539d03['include']=[{'all':!![]}];}_0x539d03=_[_0xcdfd('0x3a')]({},_0x539d03,_0x3d3183[_0xcdfd('0x3c')]);return db[_0xcdfd('0x3d')][_0xcdfd('0x44')](_0x539d03)[_0xcdfd('0x21')](handleEntityNotFound(_0x5633d3,null))[_0xcdfd('0x21')](respondWithResult(_0x5633d3,null))['catch'](handleError(_0x5633d3,null));};exports[_0xcdfd('0x45')]=function(_0x1834da,_0x481698){return db[_0xcdfd('0x3d')][_0xcdfd('0x45')](_0x1834da[_0xcdfd('0x46')],{})[_0xcdfd('0x21')](function(_0x2ac025){var _0x3ecf07=_0x1834da[_0xcdfd('0x47')][_0xcdfd('0x22')]({'plain':!![]});if(!_0x3ecf07)throw new Error(_0xcdfd('0x48'));if(_0x3ecf07['role']===_0xcdfd('0x47')){var _0x1f3226=_0x2ac025[_0xcdfd('0x22')]({'plain':!![]});var _0x38f60e='Tags';return db[_0xcdfd('0x49')]['find']({'where':{'name':_0x38f60e,'userProfileId':_0x3ecf07[_0xcdfd('0x4a')]},'raw':!![]})[_0xcdfd('0x21')](function(_0x3e98c9){if(_0x3e98c9&&_0x3e98c9['autoAssociation']===0x0){return db[_0xcdfd('0x24')]['create']({'name':_0x1f3226[_0xcdfd('0x28')],'resourceId':_0x1f3226['id'],'type':_0x3e98c9[_0xcdfd('0x28')],'sectionId':_0x3e98c9['id']},{})['then'](function(){return _0x2ac025;});}else{return _0x2ac025;}})[_0xcdfd('0x41')](function(_0x3b8acb){logger[_0xcdfd('0x26')](_0xcdfd('0x4b'),_0x3b8acb);throw _0x3b8acb;});}return _0x2ac025;})['then'](respondWithResult(_0x481698,0xc9))[_0xcdfd('0x41')](handleError(_0x481698,null));};exports['update']=function(_0x4d4d47,_0x5c12db){if(_0x4d4d47[_0xcdfd('0x46')]['id']){delete _0x4d4d47[_0xcdfd('0x46')]['id'];}return db[_0xcdfd('0x3d')][_0xcdfd('0x44')]({'where':{'id':_0x4d4d47[_0xcdfd('0x43')]['id']}})[_0xcdfd('0x21')](handleEntityNotFound(_0x5c12db,null))[_0xcdfd('0x21')](saveUpdates(_0x4d4d47[_0xcdfd('0x46')],null))[_0xcdfd('0x21')](respondWithResult(_0x5c12db,null))[_0xcdfd('0x41')](handleError(_0x5c12db,null));};exports[_0xcdfd('0x25')]=function(_0x2bcad4,_0x3213a7){return db[_0xcdfd('0x3d')][_0xcdfd('0x44')]({'where':{'id':_0x2bcad4['params']['id']}})[_0xcdfd('0x21')](handleEntityNotFound(_0x3213a7,null))[_0xcdfd('0x21')](removeEntity(_0x3213a7,null))[_0xcdfd('0x41')](handleError(_0x3213a7,null));};
\ No newline at end of file
diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js
index 9f7ec25..784edf5 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 _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
+var _0xe9d5=['request-promise','../../config/environment','./tag.attributes','define','Tag','tools_tags','lodash','util','../../config/logger','api','bluebird'];(function(_0x59734a,_0x1e96e3){var _0x4481a2=function(_0x4c6260){while(--_0x4c6260){_0x59734a['push'](_0x59734a['shift']());}};_0x4481a2(++_0x1e96e3);}(_0xe9d5,0x187));var _0x5e9d=function(_0x5acbef,_0x36b414){_0x5acbef=_0x5acbef-0x0;var _0x5e9742=_0xe9d5[_0x5acbef];return _0x5e9742;};'use strict';var _=require(_0x5e9d('0x0'));var util=require(_0x5e9d('0x1'));var logger=require(_0x5e9d('0x2'))(_0x5e9d('0x3'));var moment=require('moment');var BPromise=require(_0x5e9d('0x4'));var rp=require(_0x5e9d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e9d('0x6'));var attributes=require(_0x5e9d('0x7'));module['exports']=function(_0x4ac3a9,_0x2455a1){return _0x4ac3a9[_0x5e9d('0x8')](_0x5e9d('0x9'),attributes,{'tableName':_0x5e9d('0xa'),'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 7af43df..77255ec 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 _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
+var _0x6f0d=['Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','Tag,\x20%s,\x20%s','request\x20sent'];(function(_0x44a573,_0x1481e8){var _0x37a4cc=function(_0x4d4384){while(--_0x4d4384){_0x44a573['push'](_0x44a573['shift']());}};_0x37a4cc(++_0x1481e8);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x144b4f,_0x34069c){_0x144b4f=_0x144b4f-0x0;var _0x5f5978=_0x6f0d[_0x144b4f];return _0x5f5978;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe21ac4,_0x1af29c,_0x8b89a9){return new BPromise(function(_0x1a48a0,_0x4c4916){return client['request'](_0xe21ac4,_0x8b89a9)[_0xd6f0('0xa')](function(_0x272c4e){logger[_0xd6f0('0xb')](_0xd6f0('0xc'),_0x1af29c,_0xd6f0('0xd'));logger['debug'](_0xd6f0('0xe'),_0x1af29c,_0xd6f0('0xd'),JSON[_0xd6f0('0xf')](_0x272c4e));if(_0x272c4e[_0xd6f0('0x10')]){if(_0x272c4e['error'][_0xd6f0('0x11')]===0x1f4){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);return _0x4c4916(_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);}logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e['error'][_0xd6f0('0x12')]);return _0x1a48a0(_0x272c4e[_0xd6f0('0x10')]['message']);}else{logger[_0xd6f0('0xb')]('Tag,\x20%s,\x20%s',_0x1af29c,_0xd6f0('0xd'));_0x1a48a0(_0x272c4e[_0xd6f0('0x13')][_0xd6f0('0x12')]);}})[_0xd6f0('0x14')](function(_0x64ff5f){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x64ff5f);_0x4c4916(_0x64ff5f);});});}
\ No newline at end of file
diff --git a/server/api/team/index.js b/server/api/team/index.js
index 1febe3e..56205f9 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 _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
+var _0x53d8=['update','delete','destroy','removeQueues','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./team.controller','get','isAuthenticated','/:id','show','/:id/queues','getQueues','/:id/users','getAgents','post','addQueues','put'];(function(_0x781d60,_0x368c4d){var _0x1baea8=function(_0x2675a8){while(--_0x2675a8){_0x781d60['push'](_0x781d60['shift']());}};_0x1baea8(++_0x368c4d);}(_0x53d8,0x119));var _0x853d=function(_0x2c1995,_0x11f775){_0x2c1995=_0x2c1995-0x0;var _0xa7e7e8=_0x53d8[_0x2c1995];return _0xa7e7e8;};'use strict';var multer=require(_0x853d('0x0'));var util=require(_0x853d('0x1'));var path=require(_0x853d('0x2'));var timeout=require(_0x853d('0x3'));var express=require(_0x853d('0x4'));var router=express[_0x853d('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x853d('0x6'));var controller=require(_0x853d('0x7'));router[_0x853d('0x8')]('/',auth[_0x853d('0x9')](),controller['index']);router[_0x853d('0x8')](_0x853d('0xa'),auth[_0x853d('0x9')](),controller[_0x853d('0xb')]);router[_0x853d('0x8')](_0x853d('0xc'),auth[_0x853d('0x9')](),controller[_0x853d('0xd')]);router[_0x853d('0x8')](_0x853d('0xe'),auth[_0x853d('0x9')](),controller[_0x853d('0xf')]);router[_0x853d('0x10')]('/',auth[_0x853d('0x9')](),controller['create']);router['post'](_0x853d('0xc'),auth[_0x853d('0x9')](),controller[_0x853d('0x11')]);router[_0x853d('0x10')](_0x853d('0xe'),auth[_0x853d('0x9')](),controller['addAgents']);router[_0x853d('0x12')](_0x853d('0xa'),auth[_0x853d('0x9')](),controller[_0x853d('0x13')]);router[_0x853d('0x14')](_0x853d('0xa'),auth[_0x853d('0x9')](),controller[_0x853d('0x15')]);router['delete'](_0x853d('0xc'),auth[_0x853d('0x9')](),controller[_0x853d('0x16')]);router[_0x853d('0x14')](_0x853d('0xe'),auth['isAuthenticated'](),controller[_0x853d('0x17')]);module[_0x853d('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js
index 590ad15..ed742f2 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 _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
+var _0xed9c=['STRING','name','sequelize','exports'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0xed9c,0x122));var _0xced9=function(_0x3299e8,_0x3ef8eb){_0x3299e8=_0x3299e8-0x0;var _0x4b3dc0=_0xed9c[_0x3299e8];return _0x4b3dc0;};'use strict';var Sequelize=require(_0xced9('0x0'));module[_0xced9('0x1')]={'name':{'type':Sequelize[_0xced9('0x2')],'allowNull':![],'unique':_0xced9('0x3')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js
index 0444653..474b4f9 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 _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
+var _0xdab2=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','Teams','UserProfileResource','stack','name','send','index','map','Team','rawAttributes','fieldName','type','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getQueues','findOne','channel','Sequelize','Unknown\x20channel','toLowerCase','Queue','sort','get','capitalize','Queues','addQueues','isValidChannel','ValidationError','add','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Fax','Openchannel','each','online','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','omit','emit','userTeam:save','removeAgents','voice','chat','mail','sms','openchannel','whatsapp','isArray','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','querystring'];(function(_0x21f342,_0x38d943){var _0x8eb05b=function(_0x2be841){while(--_0x2be841){_0x21f342['push'](_0x21f342['shift']());}};_0x8eb05b(++_0x38d943);}(_0xdab2,0x17d));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x2dab('0x0'));var emlformat=require(_0x2dab('0x1'));var rimraf=require(_0x2dab('0x2'));var zipdir=require(_0x2dab('0x3'));var jsonpatch=require(_0x2dab('0x4'));var rp=require(_0x2dab('0x5'));var moment=require(_0x2dab('0x6'));var BPromise=require(_0x2dab('0x7'));var Mustache=require(_0x2dab('0x8'));var util=require('util');var path=require(_0x2dab('0x9'));var sox=require(_0x2dab('0xa'));var csv=require(_0x2dab('0xb'));var ejs=require(_0x2dab('0xc'));var fs=require('fs');var _=require(_0x2dab('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2dab('0xb'));var querystring=require(_0x2dab('0xe'));var Papa=require(_0x2dab('0xf'));var Redis=require(_0x2dab('0x10'));var authService=require(_0x2dab('0x11'));var qs=require(_0x2dab('0x12'));var as=require(_0x2dab('0x13'));var hardwareService=require(_0x2dab('0x14'));var logger=require(_0x2dab('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2dab('0x16'));var db=require(_0x2dab('0x17'))['db'];config[_0x2dab('0x18')]=_['defaults'](config[_0x2dab('0x18')],{'host':_0x2dab('0x19'),'port':0x18eb});var socket=require(_0x2dab('0x1a'))(new Redis(config[_0x2dab('0x18')]));require(_0x2dab('0x1b'))['register'](socket);function respondWithStatusCode(_0x12dfd5,_0x468ec0){_0x468ec0=_0x468ec0||0xcc;return function(_0x5bd1d6){if(_0x5bd1d6){return _0x12dfd5[_0x2dab('0x1c')](_0x468ec0);}return _0x12dfd5[_0x2dab('0x1d')](_0x468ec0)[_0x2dab('0x1e')]();};}function respondWithResult(_0x3e0820,_0x2b9421){_0x2b9421=_0x2b9421||0xc8;return function(_0x5eb0f0){if(_0x5eb0f0){return _0x3e0820[_0x2dab('0x1d')](_0x2b9421)[_0x2dab('0x1f')](_0x5eb0f0);}};}function respondWithFilteredResult(_0x3c667e,_0x4a07ce){return function(_0x586d38){if(_0x586d38){var _0x5e6718=_0x586d38[_0x2dab('0x20')],_0x2f0c28=_0x4a07ce[_0x2dab('0x21')],_0x37d2ba=_0x4a07ce['offset']+_0x4a07ce[_0x2dab('0x22')],_0x1fbbd5;if(_0x37d2ba>=_0x5e6718){_0x37d2ba=_0x5e6718;_0x1fbbd5=0xc8;}else{_0x1fbbd5=0xce;}_0x3c667e['status'](_0x1fbbd5);return _0x3c667e[_0x2dab('0x23')](_0x2dab('0x24'),_0x2f0c28+'-'+_0x37d2ba+'/'+_0x5e6718)[_0x2dab('0x1f')](_0x586d38);}return null;};}function patchUpdates(_0x27e867){return function(_0x21e9e0){try{jsonpatch['apply'](_0x21e9e0,_0x27e867,!![]);}catch(_0x1b5a70){return BPromise[_0x2dab('0x25')](_0x1b5a70);}return _0x21e9e0[_0x2dab('0x26')]();};}function saveUpdates(_0x2f9eab,_0x1a929f){return function(_0x45b65a){if(_0x45b65a){return _0x45b65a['update'](_0x2f9eab)[_0x2dab('0x27')](function(_0x241987){return _0x241987;});}return null;};}function removeEntity(_0x57a597,_0x5015e4){return function(_0x3dcb3a){if(_0x3dcb3a){return _0x3dcb3a[_0x2dab('0x28')]()['then'](function(){var _0x410a82=_0x3dcb3a['get']({'plain':!![]});var _0x337dcd=_0x2dab('0x29');return db[_0x2dab('0x2a')]['destroy']({'where':{'type':_0x337dcd,'resourceId':_0x410a82['id']}})[_0x2dab('0x27')](function(){return _0x3dcb3a;});})[_0x2dab('0x27')](function(){_0x57a597[_0x2dab('0x1d')](0xcc)[_0x2dab('0x1e')]();});}};}function handleEntityNotFound(_0xac2b41,_0x238b3e){return function(_0x19cca2){if(!_0x19cca2){_0xac2b41[_0x2dab('0x1c')](0x194);}return _0x19cca2;};}function handleError(_0x234eba,_0x4300c8){_0x4300c8=_0x4300c8||0x1f4;return function(_0x4f93da){logger['error'](_0x4f93da[_0x2dab('0x2b')]);if(_0x4f93da[_0x2dab('0x2c')]){delete _0x4f93da[_0x2dab('0x2c')];}_0x234eba['status'](_0x4300c8)[_0x2dab('0x2d')](_0x4f93da);};}exports[_0x2dab('0x2e')]=function(_0x28dd23,_0x580cc7){var _0xe3d10b={},_0x4955f0={},_0x552c49={'count':0x0,'rows':[]};var _0x1e7d95=_[_0x2dab('0x2f')](db[_0x2dab('0x30')][_0x2dab('0x31')],function(_0x1acd71){return{'name':_0x1acd71[_0x2dab('0x32')],'type':_0x1acd71[_0x2dab('0x33')]['key']};});_0x4955f0['model']=_[_0x2dab('0x2f')](_0x1e7d95,_0x2dab('0x2c'));_0x4955f0[_0x2dab('0x34')]=_[_0x2dab('0x35')](_0x28dd23[_0x2dab('0x34')]);_0x4955f0[_0x2dab('0x36')]=_['intersection'](_0x4955f0[_0x2dab('0x37')],_0x4955f0['query']);_0xe3d10b['attributes']=_[_0x2dab('0x38')](_0x4955f0[_0x2dab('0x37')],qs[_0x2dab('0x39')](_0x28dd23[_0x2dab('0x34')][_0x2dab('0x39')]));_0xe3d10b[_0x2dab('0x3a')]=_0xe3d10b['attributes'][_0x2dab('0x3b')]?_0xe3d10b[_0x2dab('0x3a')]:_0x4955f0['model'];if(!_0x28dd23[_0x2dab('0x34')][_0x2dab('0x3c')](_0x2dab('0x3d'))){_0xe3d10b[_0x2dab('0x22')]=qs['limit'](_0x28dd23[_0x2dab('0x34')][_0x2dab('0x22')]);_0xe3d10b[_0x2dab('0x21')]=qs[_0x2dab('0x21')](_0x28dd23['query'][_0x2dab('0x21')]);}_0xe3d10b[_0x2dab('0x3e')]=qs['sort'](_0x28dd23[_0x2dab('0x34')]['sort']);_0xe3d10b['where']=qs[_0x2dab('0x36')](_[_0x2dab('0x3f')](_0x28dd23['query'],_0x4955f0['filters']),_0x1e7d95);if(_0x28dd23[_0x2dab('0x34')][_0x2dab('0x40')]){_0xe3d10b[_0x2dab('0x41')]=_[_0x2dab('0x42')](_0xe3d10b['where'],{'$or':_[_0x2dab('0x2f')](_0x1e7d95,function(_0x171f9f){if(_0x171f9f['type']!==_0x2dab('0x43')){var _0x5721b4={};_0x5721b4[_0x171f9f[_0x2dab('0x2c')]]={'$like':'%'+_0x28dd23[_0x2dab('0x34')][_0x2dab('0x40')]+'%'};return _0x5721b4;}})});}_0xe3d10b=_[_0x2dab('0x42')]({},_0xe3d10b,_0x28dd23[_0x2dab('0x44')]);var _0x181ed4={'where':_0xe3d10b[_0x2dab('0x41')]};return db['Team'][_0x2dab('0x20')](_0x181ed4)[_0x2dab('0x27')](function(_0x32fb3b){_0x552c49[_0x2dab('0x20')]=_0x32fb3b;if(_0x28dd23[_0x2dab('0x34')][_0x2dab('0x45')]){_0xe3d10b[_0x2dab('0x46')]=[{'all':!![]}];}return db[_0x2dab('0x30')][_0x2dab('0x47')](_0xe3d10b);})[_0x2dab('0x27')](function(_0x47915a){_0x552c49[_0x2dab('0x48')]=_0x47915a;return _0x552c49;})['then'](respondWithFilteredResult(_0x580cc7,_0xe3d10b))[_0x2dab('0x49')](handleError(_0x580cc7,null));};exports['show']=function(_0x30c646,_0x7949d4){var _0x318960={'raw':![],'where':{'id':_0x30c646['params']['id']}},_0xc6b8c5={};_0xc6b8c5[_0x2dab('0x37')]=_[_0x2dab('0x35')](db[_0x2dab('0x30')]['rawAttributes']);_0xc6b8c5[_0x2dab('0x34')]=_['keys'](_0x30c646['query']);_0xc6b8c5[_0x2dab('0x36')]=_[_0x2dab('0x38')](_0xc6b8c5[_0x2dab('0x37')],_0xc6b8c5['query']);_0x318960[_0x2dab('0x3a')]=_[_0x2dab('0x38')](_0xc6b8c5[_0x2dab('0x37')],qs[_0x2dab('0x39')](_0x30c646[_0x2dab('0x34')][_0x2dab('0x39')]));_0x318960[_0x2dab('0x3a')]=_0x318960[_0x2dab('0x3a')][_0x2dab('0x3b')]?_0x318960[_0x2dab('0x3a')]:_0xc6b8c5[_0x2dab('0x37')];if(_0x30c646['query'][_0x2dab('0x45')]){_0x318960[_0x2dab('0x46')]=[{'all':!![]}];}_0x318960=_[_0x2dab('0x42')]({},_0x318960,_0x30c646[_0x2dab('0x44')]);return db[_0x2dab('0x30')]['find'](_0x318960)[_0x2dab('0x27')](handleEntityNotFound(_0x7949d4,null))[_0x2dab('0x27')](respondWithResult(_0x7949d4,null))[_0x2dab('0x49')](handleError(_0x7949d4,null));};exports['create']=function(_0x220ae6,_0xa57e96){return db[_0x2dab('0x30')]['create'](_0x220ae6[_0x2dab('0x4a')],{})[_0x2dab('0x27')](function(_0x26d184){var _0x43f620=_0x220ae6[_0x2dab('0x4b')]['get']({'plain':!![]});if(!_0x43f620)throw new Error(_0x2dab('0x4c'));if(_0x43f620[_0x2dab('0x4d')]===_0x2dab('0x4b')){var _0x395805=_0x26d184['get']({'plain':!![]});var _0xa1fb1f=_0x2dab('0x29');return db[_0x2dab('0x4e')][_0x2dab('0x4f')]({'where':{'name':_0xa1fb1f,'userProfileId':_0x43f620[_0x2dab('0x50')]},'raw':!![]})[_0x2dab('0x27')](function(_0x7d8404){if(_0x7d8404&&_0x7d8404['autoAssociation']===0x0){return db[_0x2dab('0x2a')][_0x2dab('0x51')]({'name':_0x395805['name'],'resourceId':_0x395805['id'],'type':_0x7d8404[_0x2dab('0x2c')],'sectionId':_0x7d8404['id']},{})[_0x2dab('0x27')](function(){return _0x26d184;});}else{return _0x26d184;}})[_0x2dab('0x49')](function(_0x317418){logger[_0x2dab('0x52')](_0x2dab('0x53'),_0x317418);throw _0x317418;});}return _0x26d184;})[_0x2dab('0x27')](respondWithResult(_0xa57e96,0xc9))[_0x2dab('0x49')](handleError(_0xa57e96,null));};exports[_0x2dab('0x54')]=function(_0x42149c,_0x90c863){if(_0x42149c[_0x2dab('0x4a')]['id']){delete _0x42149c[_0x2dab('0x4a')]['id'];}return db['Team'][_0x2dab('0x4f')]({'where':{'id':_0x42149c['params']['id']}})[_0x2dab('0x27')](handleEntityNotFound(_0x90c863,null))['then'](saveUpdates(_0x42149c[_0x2dab('0x4a')],null))[_0x2dab('0x27')](respondWithResult(_0x90c863,null))[_0x2dab('0x49')](handleError(_0x90c863,null));};exports[_0x2dab('0x28')]=function(_0x429c4c,_0x135a5d){return db['Team'][_0x2dab('0x4f')]({'where':{'id':_0x429c4c[_0x2dab('0x55')]['id']}})[_0x2dab('0x27')](handleEntityNotFound(_0x135a5d,null))[_0x2dab('0x27')](removeEntity(_0x135a5d,null))[_0x2dab('0x49')](handleError(_0x135a5d,null));};exports[_0x2dab('0x56')]=function(_0x18ae1d,_0x42aa62,_0x247454){return db[_0x2dab('0x30')][_0x2dab('0x57')]({'where':{'id':_0x18ae1d['params']['id']}})[_0x2dab('0x27')](handleEntityNotFound(_0x42aa62,null))[_0x2dab('0x27')](function(_0x2cffb7){if(!_0x18ae1d[_0x2dab('0x34')][_0x2dab('0x58')]||!utils['isValidChannel'](_0x18ae1d['query'][_0x2dab('0x58')])){throw new db[(_0x2dab('0x59'))]['ValidationError'](_0x2dab('0x5a'));}var _0x2820fa={};var _0x5b4641={};_0x5b4641[_0x2dab('0x37')]=_[_0x2dab('0x35')](db[_['capitalize'](_0x18ae1d[_0x2dab('0x34')][_0x2dab('0x58')][_0x2dab('0x5b')]())+_0x2dab('0x5c')]['rawAttributes']);_0x5b4641[_0x2dab('0x34')]=_[_0x2dab('0x35')](_0x18ae1d['query']);_0x5b4641[_0x2dab('0x36')]=_['intersection'](_0x5b4641[_0x2dab('0x37')],_0x5b4641[_0x2dab('0x34')]);_0x2820fa[_0x2dab('0x3a')]=_[_0x2dab('0x38')](_0x5b4641[_0x2dab('0x37')],qs[_0x2dab('0x39')](_0x18ae1d[_0x2dab('0x34')][_0x2dab('0x39')]));_0x2820fa[_0x2dab('0x3a')]=_0x2820fa['attributes'][_0x2dab('0x3b')]?_0x2820fa['attributes']:_0x5b4641[_0x2dab('0x37')];_0x2820fa[_0x2dab('0x22')]=qs[_0x2dab('0x22')](_0x18ae1d[_0x2dab('0x34')][_0x2dab('0x22')]);_0x2820fa['offset']=qs['offset'](_0x18ae1d[_0x2dab('0x34')]['offset']);_0x2820fa[_0x2dab('0x3e')]=qs[_0x2dab('0x5d')](_0x18ae1d[_0x2dab('0x34')][_0x2dab('0x5d')]);_0x2820fa[_0x2dab('0x41')]=qs[_0x2dab('0x36')](_[_0x2dab('0x3f')](_0x18ae1d['query'],_0x5b4641['filters']));_0x2820fa=_[_0x2dab('0x42')]({},_0x2820fa,_0x18ae1d[_0x2dab('0x44')]);return _0x2cffb7[_0x2dab('0x5e')+_[_0x2dab('0x5f')](_0x18ae1d[_0x2dab('0x34')][_0x2dab('0x58')]['toLowerCase']())+_0x2dab('0x60')](_0x2820fa);})[_0x2dab('0x27')](respondWithResult(_0x42aa62,null))[_0x2dab('0x49')](handleError(_0x42aa62,null));};exports[_0x2dab('0x61')]=function(_0x561ab0,_0x3814bc,_0x282008){return db[_0x2dab('0x30')][_0x2dab('0x57')]({'where':{'id':_0x561ab0[_0x2dab('0x55')]['id']}})[_0x2dab('0x27')](function(_0x1c513d){if(_0x1c513d){if(!_0x561ab0[_0x2dab('0x4a')]['channel']||!utils[_0x2dab('0x62')](_0x561ab0[_0x2dab('0x4a')][_0x2dab('0x58')])){throw new db['Sequelize'][(_0x2dab('0x63'))](_0x2dab('0x5a'));}return _0x1c513d[_0x2dab('0x64')+_[_0x2dab('0x5f')](_0x561ab0['body']['channel'][_0x2dab('0x5b')]())+_0x2dab('0x60')](_0x561ab0[_0x2dab('0x4a')][_0x2dab('0x65')]);}return null;})['then'](handleEntityNotFound(_0x3814bc,null))[_0x2dab('0x27')](respondWithStatusCode(_0x3814bc,null))[_0x2dab('0x49')](handleError(_0x3814bc,null));};exports[_0x2dab('0x66')]=function(_0xed1b9c,_0x2886f1,_0x595a69){return db[_0x2dab('0x30')][_0x2dab('0x57')]({'where':{'id':_0xed1b9c[_0x2dab('0x55')]['id']}})[_0x2dab('0x27')](function(_0x232148){if(_0x232148){if(!_0xed1b9c['query'][_0x2dab('0x58')]||!utils[_0x2dab('0x62')](_0xed1b9c[_0x2dab('0x34')][_0x2dab('0x58')])){throw new db['Sequelize'][(_0x2dab('0x63'))](_0x2dab('0x5a'));}return _0x232148[_0x2dab('0x67')+_[_0x2dab('0x5f')](_0xed1b9c[_0x2dab('0x34')][_0x2dab('0x58')]['toLowerCase']())+_0x2dab('0x60')](_0xed1b9c['query']['ids']);}return null;})[_0x2dab('0x27')](handleEntityNotFound(_0x2886f1,null))[_0x2dab('0x27')](respondWithStatusCode(_0x2886f1,null))[_0x2dab('0x49')](handleError(_0x2886f1,null));};exports[_0x2dab('0x68')]=function(_0x2a2490,_0x20c01d,_0x3b31a2){return db['Team']['find']({'where':{'id':_0x2a2490[_0x2dab('0x55')]['id']}})[_0x2dab('0x27')](handleEntityNotFound(_0x20c01d,null))[_0x2dab('0x27')](function(_0x1462c1){if(_0x1462c1){var _0xffa6ec=[_0x2dab('0x69'),_0x2dab('0x6a'),_0x2dab('0x6b'),'Sms',_0x2dab('0x6c'),_0x2dab('0x6d'),'Whatsapp'];return BPromise[_0x2dab('0x6e')](_0xffa6ec,function(_0x589076){return _0x1462c1[_0x2dab('0x5e')+_0x589076+_0x2dab('0x60')]({'attributes':['id',_0x2dab('0x2c')]})[_0x2dab('0x27')](function(_0x7a2d28){return BPromise[_0x2dab('0x6e')](_0x7a2d28,function(_0x3a7963){return _0x3a7963['addAgents'](_0x2a2490[_0x2dab('0x4a')][_0x2dab('0x65')])[_0x2dab('0x27')](function(){if(_0x589076==='Voice'){return db['User'][_0x2dab('0x47')]({'where':{'id':_0x2a2490['body'][_0x2dab('0x65')]},'attributes':['id','name',_0x2dab('0x6f'),'voicePause',_0x2dab('0x70')],'raw':!![]})['then'](function(_0x34482a){return BPromise[_0x2dab('0x6e')](_[_0x2dab('0x40')](_0x34482a,{'online':0x1}),function(_0x2c04c2){return db[_0x2dab('0x71')][_0x2dab('0x72')]({'membername':_0x2c04c2[_0x2dab('0x2c')],'UserId':_0x2c04c2['id'],'queue_name':_0x3a7963[_0x2dab('0x2c')],'VoiceQueueId':_0x3a7963['id'],'interface':_[_0x2dab('0x73')](_0x2c04c2[_0x2dab('0x70')])?util[_0x2dab('0x74')](_0x2dab('0x75'),_0x2c04c2[_0x2dab('0x2c')]):_0x2c04c2[_0x2dab('0x70')],'paused':_0x2c04c2[_0x2dab('0x76')]||![],'penalty':0x0});});});}});});})[_0x2dab('0x27')](function(){return _0x1462c1;});})[_0x2dab('0x27')](function(){return _0x1462c1;});}})[_0x2dab('0x27')](function(_0x357e65){if(_0x357e65){return _0x357e65['addAgents'](_0x2a2490['body']['ids'],_[_0x2dab('0x77')](_0x2a2490['body'],[_0x2dab('0x65'),'id'])||{})['spread'](function(_0x5c0825){for(var _0x42819a=0x0;_0x42819a<_0x2a2490[_0x2dab('0x4a')][_0x2dab('0x65')][_0x2dab('0x3b')];_0x42819a+=0x1){socket[_0x2dab('0x78')](_0x2dab('0x79'),{'UserId':_0x2a2490[_0x2dab('0x4a')][_0x2dab('0x65')][_0x42819a],'TeamId':_0x2a2490['params']['id']});}return _0x5c0825;});}})['then'](respondWithResult(_0x20c01d,null))[_0x2dab('0x49')](handleError(_0x20c01d,null));};exports[_0x2dab('0x7a')]=function(_0x5401da,_0x4c35ad,_0x4a4166){return db['Team']['find']({'where':{'id':_0x5401da['params']['id']}})[_0x2dab('0x27')](handleEntityNotFound(_0x4c35ad,null))[_0x2dab('0x27')](function(_0x3ac831){if(_0x3ac831){return BPromise['each']([_0x2dab('0x7b'),_0x2dab('0x7c'),_0x2dab('0x7d'),_0x2dab('0x7e'),'fax',_0x2dab('0x7f'),_0x2dab('0x80')],function(_0x4fc28b){return _0x3ac831[_0x2dab('0x5e')+_['capitalize'](_0x4fc28b)+_0x2dab('0x60')]({'attributes':['id','name']})['then'](function(_0x267827){return BPromise[_0x2dab('0x6e')](_0x267827,function(_0x3728df){return _0x3728df[_0x2dab('0x7a')](_0x5401da[_0x2dab('0x34')][_0x2dab('0x65')])['then'](function(){if(_0x4fc28b===_0x2dab('0x7b')){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x3728df['id'],'UserId':_0x5401da[_0x2dab('0x34')][_0x2dab('0x65')]}});}});});})[_0x2dab('0x27')](function(){return _0x3ac831;});})[_0x2dab('0x27')](function(){return _0x3ac831;});}})['then'](function(_0x1ada30){if(_0x1ada30){return _0x1ada30['removeAgents'](_0x5401da['query']['ids'])['then'](function(){if(_[_0x2dab('0x81')](_0x5401da[_0x2dab('0x34')]['ids'])){for(var _0x1082ca=0x0;_0x1082ca<_0x5401da[_0x2dab('0x34')]['ids'][_0x2dab('0x3b')];_0x1082ca+=0x1){socket['emit'](_0x2dab('0x82'),{'UserId':Number(_0x5401da['query'][_0x2dab('0x65')][_0x1082ca]),'TeamId':Number(_0x5401da[_0x2dab('0x55')]['id'])});}}else{socket[_0x2dab('0x78')](_0x2dab('0x82'),{'UserId':Number(_0x5401da['query'][_0x2dab('0x65')]),'TeamId':Number(_0x5401da[_0x2dab('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x4c35ad,null))[_0x2dab('0x49')](handleError(_0x4c35ad,null));};exports[_0x2dab('0x83')]=function(_0x6ba844,_0x5f4205,_0x24a823){var _0x55d39e={};var _0x4e6b72={};var _0x4c4df0;var _0x3fe69b;return db[_0x2dab('0x30')][_0x2dab('0x57')]({'where':{'id':_0x6ba844[_0x2dab('0x55')]['id']}})[_0x2dab('0x27')](handleEntityNotFound(_0x5f4205,null))[_0x2dab('0x27')](function(_0x31e792){if(_0x31e792){_0x4c4df0=_0x31e792;_0x4e6b72[_0x2dab('0x37')]=_[_0x2dab('0x35')](db['User'][_0x2dab('0x31')]);_0x4e6b72[_0x2dab('0x34')]=_['keys'](_0x6ba844[_0x2dab('0x34')]);_0x4e6b72[_0x2dab('0x36')]=_['intersection'](_0x4e6b72[_0x2dab('0x37')],_0x4e6b72[_0x2dab('0x34')]);_0x55d39e[_0x2dab('0x3a')]=_[_0x2dab('0x38')](_0x4e6b72[_0x2dab('0x37')],qs[_0x2dab('0x39')](_0x6ba844[_0x2dab('0x34')][_0x2dab('0x39')]));_0x55d39e[_0x2dab('0x3a')]=_0x55d39e[_0x2dab('0x3a')]['length']?_0x55d39e[_0x2dab('0x3a')]:_0x4e6b72[_0x2dab('0x37')];_0x55d39e[_0x2dab('0x3e')]=qs[_0x2dab('0x5d')](_0x6ba844[_0x2dab('0x34')][_0x2dab('0x5d')]);_0x55d39e[_0x2dab('0x41')]=qs[_0x2dab('0x36')](_[_0x2dab('0x3f')](_0x6ba844['query'],_0x4e6b72[_0x2dab('0x36')]));if(_0x6ba844['query'][_0x2dab('0x40')]){_0x55d39e['where']=_[_0x2dab('0x42')](_0x55d39e[_0x2dab('0x41')],{'$or':_[_0x2dab('0x2f')](_0x55d39e[_0x2dab('0x3a')],function(_0x4ad0b7){var _0x26510e={};_0x26510e[_0x4ad0b7]={'$like':'%'+_0x6ba844['query'][_0x2dab('0x40')]+'%'};return _0x26510e;})});}_0x55d39e=_['merge']({},_0x55d39e,_0x6ba844[_0x2dab('0x44')]);return _0x4c4df0['getAgents'](_0x55d39e);}})['then'](function(_0xef6d7b){if(_0xef6d7b){_0x3fe69b=_0xef6d7b['length'];if(!_0x6ba844[_0x2dab('0x34')][_0x2dab('0x3c')](_0x2dab('0x3d'))){_0x55d39e[_0x2dab('0x22')]=qs[_0x2dab('0x22')](_0x6ba844['query'][_0x2dab('0x22')]);_0x55d39e['offset']=qs[_0x2dab('0x21')](_0x6ba844[_0x2dab('0x34')][_0x2dab('0x21')]);}return _0x4c4df0['getAgents'](_0x55d39e);}})[_0x2dab('0x27')](function(_0x127115){if(_0x127115){return _0x127115?{'count':_0x3fe69b,'rows':_0x127115}:null;}})[_0x2dab('0x27')](respondWithResult(_0x5f4205,null))['catch'](handleError(_0x5f4205,null));};
\ No newline at end of file
diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js
index 1e7275f..fa6b43e 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 _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
+var _0x6405=['update','remove','emit','events','../../mysqldb','Team','setMaxListeners','save'];(function(_0x584510,_0x21c8b9){var _0x15d135=function(_0x2a8e80){while(--_0x2a8e80){_0x584510['push'](_0x584510['shift']());}};_0x15d135(++_0x21c8b9);}(_0x6405,0x13b));var _0x5640=function(_0x48807c,_0x298de8){_0x48807c=_0x48807c-0x0;var _0xdf5f2f=_0x6405[_0x48807c];return _0xdf5f2f;};'use strict';var EventEmitter=require(_0x5640('0x0'));var Team=require(_0x5640('0x1'))['db'][_0x5640('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x5640('0x3')](0x0);var events={'afterCreate':_0x5640('0x4'),'afterUpdate':_0x5640('0x5'),'afterDestroy':_0x5640('0x6')};function emitEvent(_0x3001d4){return function(_0xb82cab,_0x308a96,_0xcc710e){TeamEvents[_0x5640('0x7')](_0x3001d4+':'+_0xb82cab['id'],_0xb82cab);TeamEvents[_0x5640('0x7')](_0x3001d4,_0xb82cab);_0xcc710e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents;
\ No newline at end of file
diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js
index 3ec3bfb..85cbea5 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 _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
+var _0xbb4c=['../../config/logger','api','moment','request-promise','path','rimraf','./team.attributes','define','Team','teams','lodash'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xbb4c,0x1ac));var _0xcbb4=function(_0x25b314,_0x2af525){_0x25b314=_0x25b314-0x0;var _0x2f267f=_0xbb4c[_0x25b314];return _0x2f267f;};'use strict';var _=require(_0xcbb4('0x0'));var util=require('util');var logger=require(_0xcbb4('0x1'))(_0xcbb4('0x2'));var moment=require(_0xcbb4('0x3'));var BPromise=require('bluebird');var rp=require(_0xcbb4('0x4'));var fs=require('fs');var path=require(_0xcbb4('0x5'));var rimraf=require(_0xcbb4('0x6'));var config=require('../../config/environment');var attributes=require(_0xcbb4('0x7'));module['exports']=function(_0x23895b,_0x4c9545){return _0x23895b[_0xcbb4('0x8')](_0xcbb4('0x9'),attributes,{'tableName':_0xcbb4('0xa'),'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 eb5fe4e..b19130a 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 _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
+var _0x2ff6=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x386bbf,_0x29f394){var _0x2df2d3=function(_0x15db7b){while(--_0x15db7b){_0x386bbf['push'](_0x386bbf['shift']());}};_0x2df2d3(++_0x29f394);}(_0x2ff6,0x77));var _0x62ff=function(_0x5e65b8,_0x85529c){_0x5e65b8=_0x5e65b8-0x0;var _0x4a29df=_0x2ff6[_0x5e65b8];return _0x4a29df;};'use strict';var _=require(_0x62ff('0x0'));var util=require(_0x62ff('0x1'));var moment=require(_0x62ff('0x2'));var BPromise=require(_0x62ff('0x3'));var rs=require(_0x62ff('0x4'));var fs=require('fs');var Redis=require(_0x62ff('0x5'));var db=require(_0x62ff('0x6'))['db'];var utils=require(_0x62ff('0x7'));var logger=require(_0x62ff('0x8'))(_0x62ff('0x9'));var config=require(_0x62ff('0xa'));var jayson=require(_0x62ff('0xb'));var client=jayson[_0x62ff('0xc')][_0x62ff('0xd')]({'port':0x232a});config[_0x62ff('0xe')]=_[_0x62ff('0xf')](config[_0x62ff('0xe')],{'host':_0x62ff('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x62ff('0xe')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x206efd,_0x72e652,_0x18ccc3){return new BPromise(function(_0x1ed2f8,_0x1e8ae9){return client[_0x62ff('0x11')](_0x206efd,_0x18ccc3)[_0x62ff('0x12')](function(_0x52d7d4){logger[_0x62ff('0x13')](_0x62ff('0x14'),_0x72e652,_0x62ff('0x15'));logger[_0x62ff('0x16')]('Team,\x20%s,\x20%s,\x20%s',_0x72e652,'request\x20sent',JSON[_0x62ff('0x17')](_0x52d7d4));if(_0x52d7d4[_0x62ff('0x18')]){if(_0x52d7d4[_0x62ff('0x18')][_0x62ff('0x19')]===0x1f4){logger['error'](_0x62ff('0x14'),_0x72e652,_0x52d7d4[_0x62ff('0x18')][_0x62ff('0x1a')]);return _0x1e8ae9(_0x52d7d4['error']['message']);}logger[_0x62ff('0x18')](_0x62ff('0x14'),_0x72e652,_0x52d7d4['error'][_0x62ff('0x1a')]);return _0x1ed2f8(_0x52d7d4[_0x62ff('0x18')][_0x62ff('0x1a')]);}else{logger[_0x62ff('0x13')](_0x62ff('0x14'),_0x72e652,'request\x20sent');_0x1ed2f8(_0x52d7d4[_0x62ff('0x1b')][_0x62ff('0x1a')]);}})[_0x62ff('0x1c')](function(_0x3ccd61){logger[_0x62ff('0x18')](_0x62ff('0x14'),_0x72e652,_0x3ccd61);_0x1e8ae9(_0x3ccd61);});});}
\ No newline at end of file
diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js
index 28f34fa..c63bb74 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 _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
+var _0x6fc2=['save','remove','removeListener','length','./team.events'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0x6fc2,0x117));var _0x26fc=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x6fc2[_0x4c12ec];return _0x3ae42c;};'use strict';var TeamEvents=require(_0x26fc('0x0'));var events=[_0x26fc('0x1'),_0x26fc('0x2'),'update'];function createListener(_0x294784,_0x574483){return function(_0x5d460c){_0x574483['emit'](_0x294784,_0x5d460c);};}function removeListener(_0x5bab33,_0x2cbf9b){return function(){TeamEvents[_0x26fc('0x3')](_0x5bab33,_0x2cbf9b);};}exports['register']=function(_0x12a41d){for(var _0x3018aa=0x0,_0x2f5258=events[_0x26fc('0x4')];_0x3018aa<_0x2f5258;_0x3018aa++){var _0x5c87f2=events[_0x3018aa];var _0x23c15a=createListener('team:'+_0x5c87f2,_0x12a41d);TeamEvents['on'](_0x5c87f2,_0x23c15a);}};
\ No newline at end of file
diff --git a/server/api/template/index.js b/server/api/template/index.js
index 0b4cb0e..0fe99c3 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 _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
+var _0x1575=['put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','post','create'];(function(_0x331b90,_0x340456){var _0x3a149b=function(_0x6be932){while(--_0x6be932){_0x331b90['push'](_0x331b90['shift']());}};_0x3a149b(++_0x340456);}(_0x1575,0xc3));var _0x5157=function(_0x29055f,_0x1694ca){_0x29055f=_0x29055f-0x0;var _0x218a7e=_0x1575[_0x29055f];return _0x218a7e;};'use strict';var multer=require(_0x5157('0x0'));var util=require(_0x5157('0x1'));var path=require(_0x5157('0x2'));var timeout=require(_0x5157('0x3'));var express=require(_0x5157('0x4'));var router=express[_0x5157('0x5')]();var auth=require(_0x5157('0x6'));var interaction=require(_0x5157('0x7'));var config=require('../../config/environment');var controller=require('./template.controller');router[_0x5157('0x8')]('/',auth[_0x5157('0x9')](),controller['index']);router[_0x5157('0x8')](_0x5157('0xa'),auth[_0x5157('0x9')](),controller['show']);router[_0x5157('0xb')]('/',auth[_0x5157('0x9')](),controller[_0x5157('0xc')]);router[_0x5157('0xd')]('/:id',auth[_0x5157('0x9')](),controller[_0x5157('0xe')]);router[_0x5157('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js
index a31bbae..19f8844 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 _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
+var _0x95e2=['STRING','TEXT','sequelize'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x95e2,0x1af));var _0x295e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x95e2[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x295e('0x0'));module['exports']={'name':{'type':Sequelize[_0x295e('0x1')]},'description':{'type':Sequelize[_0x295e('0x1')]},'html':{'type':Sequelize[_0x295e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js
index 94fa818..b674eec 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 _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
+var _0x56ee=['squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','sendStatus','end','json','count','offset','limit','status','set','reject','save','then','destroy','get','Templates','error','stack','name','index','map','Template','rawAttributes','fieldName','type','keys','intersection','query','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','ejs','lodash'];(function(_0x2aa921,_0x3f0b6e){var _0x1e3f79=function(_0x2a152b){while(--_0x2a152b){_0x2aa921['push'](_0x2aa921['shift']());}};_0x1e3f79(++_0x3f0b6e);}(_0x56ee,0x1c9));var _0xe56e=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0x56ee[_0x39bc44];return _0x2916d8;};'use strict';var pdf=require(_0xe56e('0x0'));var emlformat=require(_0xe56e('0x1'));var rimraf=require(_0xe56e('0x2'));var zipdir=require(_0xe56e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe56e('0x4'));var moment=require(_0xe56e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe56e('0x6'));var util=require('util');var path=require(_0xe56e('0x7'));var sox=require(_0xe56e('0x8'));var csv=require('to-csv');var ejs=require(_0xe56e('0x9'));var fs=require('fs');var _=require(_0xe56e('0xa'));var squel=require(_0xe56e('0xb'));var crypto=require(_0xe56e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe56e('0xd'));var toCsv=require(_0xe56e('0xe'));var querystring=require(_0xe56e('0xf'));var Papa=require(_0xe56e('0x10'));var Redis=require(_0xe56e('0x11'));var authService=require(_0xe56e('0x12'));var qs=require(_0xe56e('0x13'));var as=require(_0xe56e('0x14'));var hardwareService=require(_0xe56e('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe56e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cc0f8,_0x28d1fc){_0x28d1fc=_0x28d1fc||0xcc;return function(_0x19632f){if(_0x19632f){return _0x1cc0f8[_0xe56e('0x17')](_0x28d1fc);}return _0x1cc0f8['status'](_0x28d1fc)[_0xe56e('0x18')]();};}function respondWithResult(_0x47f2e9,_0x3cd3ac){_0x3cd3ac=_0x3cd3ac||0xc8;return function(_0x372d32){if(_0x372d32){return _0x47f2e9['status'](_0x3cd3ac)[_0xe56e('0x19')](_0x372d32);}};}function respondWithFilteredResult(_0xcb922c,_0x480d35){return function(_0x325e6a){if(_0x325e6a){var _0x49a80e=_0x325e6a[_0xe56e('0x1a')],_0x421962=_0x480d35[_0xe56e('0x1b')],_0x2fe24d=_0x480d35[_0xe56e('0x1b')]+_0x480d35[_0xe56e('0x1c')],_0x3c77b4;if(_0x2fe24d>=_0x49a80e){_0x2fe24d=_0x49a80e;_0x3c77b4=0xc8;}else{_0x3c77b4=0xce;}_0xcb922c[_0xe56e('0x1d')](_0x3c77b4);return _0xcb922c[_0xe56e('0x1e')]('Content-Range',_0x421962+'-'+_0x2fe24d+'/'+_0x49a80e)[_0xe56e('0x19')](_0x325e6a);}return null;};}function patchUpdates(_0x3ab669){return function(_0x223043){try{jsonpatch['apply'](_0x223043,_0x3ab669,!![]);}catch(_0x297636){return BPromise[_0xe56e('0x1f')](_0x297636);}return _0x223043[_0xe56e('0x20')]();};}function saveUpdates(_0x3d0061,_0x271e65){return function(_0x61980c){if(_0x61980c){return _0x61980c['update'](_0x3d0061)[_0xe56e('0x21')](function(_0xa1a4fa){return _0xa1a4fa;});}return null;};}function removeEntity(_0xfaa4c3,_0x419c90){return function(_0xcf492d){if(_0xcf492d){return _0xcf492d[_0xe56e('0x22')]()[_0xe56e('0x21')](function(){var _0x23e7f1=_0xcf492d[_0xe56e('0x23')]({'plain':!![]});var _0x5ee5fa=_0xe56e('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x5ee5fa,'resourceId':_0x23e7f1['id']}})[_0xe56e('0x21')](function(){return _0xcf492d;});})[_0xe56e('0x21')](function(){_0xfaa4c3[_0xe56e('0x1d')](0xcc)[_0xe56e('0x18')]();});}};}function handleEntityNotFound(_0x2f2c94,_0x40a411){return function(_0x21d753){if(!_0x21d753){_0x2f2c94[_0xe56e('0x17')](0x194);}return _0x21d753;};}function handleError(_0x33e118,_0x3b6354){_0x3b6354=_0x3b6354||0x1f4;return function(_0x483e4f){logger[_0xe56e('0x25')](_0x483e4f[_0xe56e('0x26')]);if(_0x483e4f[_0xe56e('0x27')]){delete _0x483e4f[_0xe56e('0x27')];}_0x33e118[_0xe56e('0x1d')](_0x3b6354)['send'](_0x483e4f);};}exports[_0xe56e('0x28')]=function(_0x5e7c70,_0x38ccd5){var _0x4e53a0={},_0x5354ab={},_0x355bc6={'count':0x0,'rows':[]};var _0xa14edb=_[_0xe56e('0x29')](db[_0xe56e('0x2a')][_0xe56e('0x2b')],function(_0x4a761c){return{'name':_0x4a761c[_0xe56e('0x2c')],'type':_0x4a761c[_0xe56e('0x2d')]['key']};});_0x5354ab['model']=_[_0xe56e('0x29')](_0xa14edb,_0xe56e('0x27'));_0x5354ab['query']=_[_0xe56e('0x2e')](_0x5e7c70['query']);_0x5354ab['filters']=_[_0xe56e('0x2f')](_0x5354ab['model'],_0x5354ab[_0xe56e('0x30')]);_0x4e53a0[_0xe56e('0x31')]=_[_0xe56e('0x2f')](_0x5354ab['model'],qs[_0xe56e('0x32')](_0x5e7c70[_0xe56e('0x30')][_0xe56e('0x32')]));_0x4e53a0[_0xe56e('0x31')]=_0x4e53a0[_0xe56e('0x31')][_0xe56e('0x33')]?_0x4e53a0[_0xe56e('0x31')]:_0x5354ab[_0xe56e('0x34')];if(!_0x5e7c70[_0xe56e('0x30')][_0xe56e('0x35')](_0xe56e('0x36'))){_0x4e53a0['limit']=qs[_0xe56e('0x1c')](_0x5e7c70['query'][_0xe56e('0x1c')]);_0x4e53a0[_0xe56e('0x1b')]=qs['offset'](_0x5e7c70[_0xe56e('0x30')]['offset']);}_0x4e53a0['order']=qs[_0xe56e('0x37')](_0x5e7c70[_0xe56e('0x30')][_0xe56e('0x37')]);_0x4e53a0[_0xe56e('0x38')]=qs[_0xe56e('0x39')](_[_0xe56e('0x3a')](_0x5e7c70['query'],_0x5354ab['filters']),_0xa14edb);if(_0x5e7c70[_0xe56e('0x30')]['filter']){_0x4e53a0[_0xe56e('0x38')]=_['merge'](_0x4e53a0[_0xe56e('0x38')],{'$or':_[_0xe56e('0x29')](_0xa14edb,function(_0x48cb58){if(_0x48cb58[_0xe56e('0x2d')]!==_0xe56e('0x3b')){var _0x399456={};_0x399456[_0x48cb58['name']]={'$like':'%'+_0x5e7c70[_0xe56e('0x30')]['filter']+'%'};return _0x399456;}})});}_0x4e53a0=_[_0xe56e('0x3c')]({},_0x4e53a0,_0x5e7c70[_0xe56e('0x3d')]);var _0x430685={'where':_0x4e53a0['where']};return db[_0xe56e('0x2a')]['count'](_0x430685)[_0xe56e('0x21')](function(_0x5aa1d3){_0x355bc6[_0xe56e('0x1a')]=_0x5aa1d3;if(_0x5e7c70[_0xe56e('0x30')][_0xe56e('0x3e')]){_0x4e53a0['include']=[{'all':!![]}];}return db['Template'][_0xe56e('0x3f')](_0x4e53a0);})[_0xe56e('0x21')](function(_0x1d39ea){_0x355bc6[_0xe56e('0x40')]=_0x1d39ea;return _0x355bc6;})[_0xe56e('0x21')](respondWithFilteredResult(_0x38ccd5,_0x4e53a0))[_0xe56e('0x41')](handleError(_0x38ccd5,null));};exports[_0xe56e('0x42')]=function(_0x5ae93f,_0x21ca5a){var _0x52e8e5={'raw':!![],'where':{'id':_0x5ae93f['params']['id']}},_0x90f6cd={};_0x90f6cd['model']=_[_0xe56e('0x2e')](db['Template'][_0xe56e('0x2b')]);_0x90f6cd['query']=_[_0xe56e('0x2e')](_0x5ae93f[_0xe56e('0x30')]);_0x90f6cd[_0xe56e('0x39')]=_[_0xe56e('0x2f')](_0x90f6cd[_0xe56e('0x34')],_0x90f6cd['query']);_0x52e8e5[_0xe56e('0x31')]=_[_0xe56e('0x2f')](_0x90f6cd[_0xe56e('0x34')],qs[_0xe56e('0x32')](_0x5ae93f[_0xe56e('0x30')][_0xe56e('0x32')]));_0x52e8e5[_0xe56e('0x31')]=_0x52e8e5[_0xe56e('0x31')][_0xe56e('0x33')]?_0x52e8e5[_0xe56e('0x31')]:_0x90f6cd[_0xe56e('0x34')];if(_0x5ae93f[_0xe56e('0x30')][_0xe56e('0x3e')]){_0x52e8e5['include']=[{'all':!![]}];}_0x52e8e5=_[_0xe56e('0x3c')]({},_0x52e8e5,_0x5ae93f['options']);return db['Template'][_0xe56e('0x43')](_0x52e8e5)['then'](handleEntityNotFound(_0x21ca5a,null))[_0xe56e('0x21')](respondWithResult(_0x21ca5a,null))[_0xe56e('0x41')](handleError(_0x21ca5a,null));};exports[_0xe56e('0x44')]=function(_0x578b13,_0x1338e8){return db[_0xe56e('0x2a')][_0xe56e('0x44')](_0x578b13['body'],{})[_0xe56e('0x21')](function(_0xf91861){var _0x1f37ad=_0x578b13[_0xe56e('0x45')][_0xe56e('0x23')]({'plain':!![]});if(!_0x1f37ad)throw new Error(_0xe56e('0x46'));if(_0x1f37ad[_0xe56e('0x47')]===_0xe56e('0x45')){var _0x46fa8d=_0xf91861[_0xe56e('0x23')]({'plain':!![]});var _0x2cbaeb=_0xe56e('0x24');return db[_0xe56e('0x48')][_0xe56e('0x43')]({'where':{'name':_0x2cbaeb,'userProfileId':_0x1f37ad[_0xe56e('0x49')]},'raw':!![]})['then'](function(_0x1fe73d){if(_0x1fe73d&&_0x1fe73d[_0xe56e('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x46fa8d['name'],'resourceId':_0x46fa8d['id'],'type':_0x1fe73d[_0xe56e('0x27')],'sectionId':_0x1fe73d['id']},{})[_0xe56e('0x21')](function(){return _0xf91861;});}else{return _0xf91861;}})[_0xe56e('0x41')](function(_0x4ef0f2){logger['error'](_0xe56e('0x4b'),_0x4ef0f2);throw _0x4ef0f2;});}return _0xf91861;})[_0xe56e('0x21')](respondWithResult(_0x1338e8,0xc9))[_0xe56e('0x41')](handleError(_0x1338e8,null));};exports[_0xe56e('0x4c')]=function(_0x22b9d4,_0x1473a6){if(_0x22b9d4[_0xe56e('0x4d')]['id']){delete _0x22b9d4[_0xe56e('0x4d')]['id'];}return db['Template'][_0xe56e('0x43')]({'where':{'id':_0x22b9d4['params']['id']}})[_0xe56e('0x21')](handleEntityNotFound(_0x1473a6,null))['then'](saveUpdates(_0x22b9d4[_0xe56e('0x4d')],null))['then'](respondWithResult(_0x1473a6,null))['catch'](handleError(_0x1473a6,null));};exports['destroy']=function(_0x3b4acb,_0x395fb7){return db[_0xe56e('0x2a')][_0xe56e('0x43')]({'where':{'id':_0x3b4acb['params']['id']}})[_0xe56e('0x21')](handleEntityNotFound(_0x395fb7,null))['then'](removeEntity(_0x395fb7,null))['catch'](handleError(_0x395fb7,null));};
\ No newline at end of file
diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js
index 1befea9..86c3668 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 _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
+var _0x430b=['path','../../config/environment','Template','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x118311,_0x900858){var _0x389ed9=function(_0x67b851){while(--_0x67b851){_0x118311['push'](_0x118311['shift']());}};_0x389ed9(++_0x900858);}(_0x430b,0x186));var _0xb430=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0x430b[_0x35d4e9];return _0x5c2770;};'use strict';var _=require(_0xb430('0x0'));var util=require(_0xb430('0x1'));var logger=require(_0xb430('0x2'))(_0xb430('0x3'));var moment=require('moment');var BPromise=require(_0xb430('0x4'));var rp=require(_0xb430('0x5'));var fs=require('fs');var path=require(_0xb430('0x6'));var rimraf=require('rimraf');var config=require(_0xb430('0x7'));var attributes=require('./template.attributes');module['exports']=function(_0x328932,_0x4800c6){return _0x328932['define'](_0xb430('0x8'),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 9ecf622..0bd4ca3 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 _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
+var _0x6ab3=['Template,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','map','model','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x6ab3,0x16f));var _0x36ab=function(_0x53ad58,_0x3fb489){_0x53ad58=_0x53ad58-0x0;var _0x554b03=_0x6ab3[_0x53ad58];return _0x554b03;};'use strict';var _=require(_0x36ab('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x36ab('0x1'));var rs=require(_0x36ab('0x2'));var fs=require('fs');var Redis=require(_0x36ab('0x3'));var db=require(_0x36ab('0x4'))['db'];var utils=require(_0x36ab('0x5'));var logger=require(_0x36ab('0x6'))(_0x36ab('0x7'));var config=require(_0x36ab('0x8'));var jayson=require(_0x36ab('0x9'));var client=jayson[_0x36ab('0xa')][_0x36ab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32437e,_0x568f0c,_0x325939){return new BPromise(function(_0x111e70,_0x689b89){return client[_0x36ab('0xc')](_0x32437e,_0x325939)[_0x36ab('0xd')](function(_0x1cedf5){logger[_0x36ab('0xe')](_0x36ab('0xf'),_0x568f0c,_0x36ab('0x10'));logger[_0x36ab('0x11')](_0x36ab('0x12'),_0x568f0c,'request\x20sent',JSON['stringify'](_0x1cedf5));if(_0x1cedf5['error']){if(_0x1cedf5[_0x36ab('0x13')][_0x36ab('0x14')]===0x1f4){logger[_0x36ab('0x13')]('Template,\x20%s,\x20%s',_0x568f0c,_0x1cedf5[_0x36ab('0x13')][_0x36ab('0x15')]);return _0x689b89(_0x1cedf5[_0x36ab('0x13')][_0x36ab('0x15')]);}logger[_0x36ab('0x13')](_0x36ab('0xf'),_0x568f0c,_0x1cedf5[_0x36ab('0x13')][_0x36ab('0x15')]);return _0x111e70(_0x1cedf5[_0x36ab('0x13')][_0x36ab('0x15')]);}else{logger['info'](_0x36ab('0xf'),_0x568f0c,_0x36ab('0x10'));_0x111e70(_0x1cedf5[_0x36ab('0x16')][_0x36ab('0x15')]);}})[_0x36ab('0x17')](function(_0x79251b){logger[_0x36ab('0x13')](_0x36ab('0xf'),_0x568f0c,_0x79251b);_0x689b89(_0x79251b);});});}exports[_0x36ab('0x18')]=function(_0x44035c){var _0x172b5e=this;return new Promise(function(_0x40f5b2,_0x35349a){return db[_0x36ab('0x19')]['findAll']({'raw':_0x44035c[_0x36ab('0x1a')]?_0x44035c['options'][_0x36ab('0x1b')]===undefined?!![]:![]:!![],'where':_0x44035c[_0x36ab('0x1a')]?_0x44035c[_0x36ab('0x1a')][_0x36ab('0x1c')]||null:null,'attributes':_0x44035c['options']?_0x44035c[_0x36ab('0x1a')][_0x36ab('0x1d')]||null:null,'limit':_0x44035c['options']?_0x44035c[_0x36ab('0x1a')][_0x36ab('0x1e')]||null:null,'include':_0x44035c['options']?_0x44035c[_0x36ab('0x1a')][_0x36ab('0x1f')]?_[_0x36ab('0x20')](_0x44035c[_0x36ab('0x1a')]['include'],function(_0x59841b){return{'model':db[_0x59841b[_0x36ab('0x21')]],'as':_0x59841b['as'],'attributes':_0x59841b['attributes'],'include':_0x59841b[_0x36ab('0x1f')]?_[_0x36ab('0x20')](_0x59841b[_0x36ab('0x1f')],function(_0xa72a98){return{'model':db[_0xa72a98[_0x36ab('0x21')]],'as':_0xa72a98['as'],'attributes':_0xa72a98[_0x36ab('0x1d')],'include':_0xa72a98[_0x36ab('0x1f')]?_[_0x36ab('0x20')](_0xa72a98['include'],function(_0xfc27ae){return{'model':db[_0xfc27ae[_0x36ab('0x21')]],'as':_0xfc27ae['as'],'attributes':_0xfc27ae['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bf16d){logger['info'](_0x36ab('0x18'),_0x44035c);logger[_0x36ab('0x11')](_0x36ab('0x18'),_0x44035c,JSON[_0x36ab('0x22')](_0x5bf16d));_0x40f5b2(_0x5bf16d);})[_0x36ab('0x17')](function(_0x5809dc){logger['error'](_0x36ab('0x18'),_0x5809dc[_0x36ab('0x15')],_0x44035c);_0x35349a(_0x172b5e[_0x36ab('0x13')](0x1f4,_0x5809dc[_0x36ab('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js
index 24ddfef..2757657 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 _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
+var _0x69d5=['update','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions','/:id/any_conditions','/:id/actions','post','create','/:id/all_conditions','addAllCondition','addAnyCondition','put'];(function(_0x3053a0,_0x2dff34){var _0x21b751=function(_0x2a266f){while(--_0x2a266f){_0x3053a0['push'](_0x3053a0['shift']());}};_0x21b751(++_0x2dff34);}(_0x69d5,0x1cd));var _0x569d=function(_0xcdfe89,_0x29e34b){_0xcdfe89=_0xcdfe89-0x0;var _0xdaef56=_0x69d5[_0xcdfe89];return _0xdaef56;};'use strict';var multer=require(_0x569d('0x0'));var util=require(_0x569d('0x1'));var path=require(_0x569d('0x2'));var timeout=require(_0x569d('0x3'));var express=require('express');var router=express[_0x569d('0x4')]();var auth=require(_0x569d('0x5'));var interaction=require(_0x569d('0x6'));var config=require('../../config/environment');var controller=require(_0x569d('0x7'));router[_0x569d('0x8')]('/',auth[_0x569d('0x9')](),controller[_0x569d('0xa')]);router[_0x569d('0x8')](_0x569d('0xb'),auth[_0x569d('0x9')](),controller[_0x569d('0xc')]);router[_0x569d('0x8')]('/:id/all_conditions',auth[_0x569d('0x9')](),controller[_0x569d('0xd')]);router[_0x569d('0x8')](_0x569d('0xe'),auth[_0x569d('0x9')](),controller['getAnyConditions']);router['get'](_0x569d('0xf'),auth['isAuthenticated'](),controller['getActions']);router[_0x569d('0x10')]('/',auth[_0x569d('0x9')](),controller[_0x569d('0x11')]);router[_0x569d('0x10')](_0x569d('0x12'),auth['isAuthenticated'](),controller[_0x569d('0x13')]);router['post']('/:id/any_conditions',auth[_0x569d('0x9')](),controller[_0x569d('0x14')]);router['post'](_0x569d('0xf'),auth[_0x569d('0x9')](),controller['addAction']);router[_0x569d('0x15')]('/:id',auth[_0x569d('0x9')](),controller[_0x569d('0x16')]);router['delete'](_0x569d('0xb'),auth[_0x569d('0x9')](),controller['destroy']);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 613762f..6d60fa5 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 _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
+var _0x6ff3=['BOOLEAN','sequelize','exports','STRING'];(function(_0x5116f0,_0x253c87){var _0x4a64e2=function(_0x49fd86){while(--_0x49fd86){_0x5116f0['push'](_0x5116f0['shift']());}};_0x4a64e2(++_0x253c87);}(_0x6ff3,0x7d));var _0x36ff=function(_0x3d6bb4,_0x2eeac8){_0x3d6bb4=_0x3d6bb4-0x0;var _0x3f19e2=_0x6ff3[_0x3d6bb4];return _0x3f19e2;};'use strict';var Sequelize=require(_0x36ff('0x0'));module[_0x36ff('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x36ff('0x2')]},'status':{'type':Sequelize[_0x36ff('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js
index 33c4497..5be0cad 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 _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
+var _0x7b1b=['stack','name','send','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','Trigger','include','findAll','rows','catch','show','keys','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','hasOwnProperty','nolimit','getAnyConditions','findOne','TriggerId','Action','getActions','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','limit','status','set','Content-Range','reject','save','update','then','destroy','Triggers','UserProfileResource'];(function(_0x2eee25,_0x53460d){var _0x1cb8c4=function(_0x4dad56){while(--_0x4dad56){_0x2eee25['push'](_0x2eee25['shift']());}};_0x1cb8c4(++_0x53460d);}(_0x7b1b,0x149));var _0xb7b1=function(_0x24b12d,_0x24c4a2){_0x24b12d=_0x24b12d-0x0;var _0x442e40=_0x7b1b[_0x24b12d];return _0x442e40;};'use strict';var pdf=require(_0xb7b1('0x0'));var emlformat=require(_0xb7b1('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb7b1('0x2'));var rp=require(_0xb7b1('0x3'));var moment=require(_0xb7b1('0x4'));var BPromise=require(_0xb7b1('0x5'));var Mustache=require(_0xb7b1('0x6'));var util=require(_0xb7b1('0x7'));var path=require('path');var sox=require(_0xb7b1('0x8'));var csv=require(_0xb7b1('0x9'));var ejs=require(_0xb7b1('0xa'));var fs=require('fs');var _=require(_0xb7b1('0xb'));var squel=require(_0xb7b1('0xc'));var crypto=require('crypto');var jsforce=require(_0xb7b1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb7b1('0x9'));var querystring=require(_0xb7b1('0xe'));var Papa=require(_0xb7b1('0xf'));var Redis=require(_0xb7b1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb7b1('0x11'));var as=require(_0xb7b1('0x12'));var hardwareService=require(_0xb7b1('0x13'));var logger=require('../../config/logger')(_0xb7b1('0x14'));var utils=require(_0xb7b1('0x15'));var config=require(_0xb7b1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x145ea1,_0x15684a){_0x15684a=_0x15684a||0xcc;return function(_0x35adaa){if(_0x35adaa){return _0x145ea1[_0xb7b1('0x17')](_0x15684a);}return _0x145ea1['status'](_0x15684a)[_0xb7b1('0x18')]();};}function respondWithResult(_0xbecd1d,_0x4bde0d){_0x4bde0d=_0x4bde0d||0xc8;return function(_0x5bfd13){if(_0x5bfd13){return _0xbecd1d['status'](_0x4bde0d)[_0xb7b1('0x19')](_0x5bfd13);}};}function respondWithFilteredResult(_0x6072b7,_0xba95f0){return function(_0x470447){if(_0x470447){var _0x1f694a=_0x470447[_0xb7b1('0x1a')],_0x59214d=_0xba95f0[_0xb7b1('0x1b')],_0x231a6f=_0xba95f0['offset']+_0xba95f0[_0xb7b1('0x1c')],_0x41acb6;if(_0x231a6f>=_0x1f694a){_0x231a6f=_0x1f694a;_0x41acb6=0xc8;}else{_0x41acb6=0xce;}_0x6072b7[_0xb7b1('0x1d')](_0x41acb6);return _0x6072b7[_0xb7b1('0x1e')](_0xb7b1('0x1f'),_0x59214d+'-'+_0x231a6f+'/'+_0x1f694a)['json'](_0x470447);}return null;};}function patchUpdates(_0x553235){return function(_0x2ce9c9){try{jsonpatch['apply'](_0x2ce9c9,_0x553235,!![]);}catch(_0x38ee5){return BPromise[_0xb7b1('0x20')](_0x38ee5);}return _0x2ce9c9[_0xb7b1('0x21')]();};}function saveUpdates(_0x54190d,_0x6a3046){return function(_0x131cb7){if(_0x131cb7){return _0x131cb7[_0xb7b1('0x22')](_0x54190d)[_0xb7b1('0x23')](function(_0x56ea9e){return _0x56ea9e;});}return null;};}function removeEntity(_0x26a09d,_0x23f1ae){return function(_0x383151){if(_0x383151){return _0x383151[_0xb7b1('0x24')]()['then'](function(){var _0x152970=_0x383151['get']({'plain':!![]});var _0x2c464e=_0xb7b1('0x25');return db[_0xb7b1('0x26')][_0xb7b1('0x24')]({'where':{'type':_0x2c464e,'resourceId':_0x152970['id']}})[_0xb7b1('0x23')](function(){return _0x383151;});})[_0xb7b1('0x23')](function(){_0x26a09d[_0xb7b1('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20b794,_0x3eeef3){return function(_0x2f5ea5){if(!_0x2f5ea5){_0x20b794['sendStatus'](0x194);}return _0x2f5ea5;};}function handleError(_0x5ce314,_0x27bc6c){_0x27bc6c=_0x27bc6c||0x1f4;return function(_0x121b15){logger['error'](_0x121b15[_0xb7b1('0x27')]);if(_0x121b15[_0xb7b1('0x28')]){delete _0x121b15[_0xb7b1('0x28')];}_0x5ce314[_0xb7b1('0x1d')](_0x27bc6c)[_0xb7b1('0x29')](_0x121b15);};}exports['index']=function(_0x31c1c0,_0x541b1a){var _0x3e7e47={},_0x564ebe={},_0x3837b9={'count':0x0,'rows':[]};var _0x387c70=_[_0xb7b1('0x2a')](db['Trigger'][_0xb7b1('0x2b')],function(_0xa0a888){return{'name':_0xa0a888[_0xb7b1('0x2c')],'type':_0xa0a888[_0xb7b1('0x2d')]['key']};});_0x564ebe[_0xb7b1('0x2e')]=_['map'](_0x387c70,_0xb7b1('0x28'));_0x564ebe[_0xb7b1('0x2f')]=_['keys'](_0x31c1c0['query']);_0x564ebe[_0xb7b1('0x30')]=_[_0xb7b1('0x31')](_0x564ebe[_0xb7b1('0x2e')],_0x564ebe['query']);_0x3e7e47[_0xb7b1('0x32')]=_['intersection'](_0x564ebe['model'],qs[_0xb7b1('0x33')](_0x31c1c0[_0xb7b1('0x2f')][_0xb7b1('0x33')]));_0x3e7e47['attributes']=_0x3e7e47['attributes'][_0xb7b1('0x34')]?_0x3e7e47[_0xb7b1('0x32')]:_0x564ebe['model'];if(!_0x31c1c0[_0xb7b1('0x2f')]['hasOwnProperty']('nolimit')){_0x3e7e47['limit']=qs[_0xb7b1('0x1c')](_0x31c1c0[_0xb7b1('0x2f')][_0xb7b1('0x1c')]);_0x3e7e47[_0xb7b1('0x1b')]=qs[_0xb7b1('0x1b')](_0x31c1c0[_0xb7b1('0x2f')]['offset']);}_0x3e7e47[_0xb7b1('0x35')]=qs[_0xb7b1('0x36')](_0x31c1c0['query']['sort']);_0x3e7e47['where']=qs[_0xb7b1('0x30')](_[_0xb7b1('0x37')](_0x31c1c0['query'],_0x564ebe[_0xb7b1('0x30')]),_0x387c70);if(_0x31c1c0[_0xb7b1('0x2f')][_0xb7b1('0x38')]){_0x3e7e47[_0xb7b1('0x39')]=_[_0xb7b1('0x3a')](_0x3e7e47['where'],{'$or':_[_0xb7b1('0x2a')](_0x387c70,function(_0x3af78f){if(_0x3af78f[_0xb7b1('0x2d')]!==_0xb7b1('0x3b')){var _0x4f7673={};_0x4f7673[_0x3af78f[_0xb7b1('0x28')]]={'$like':'%'+_0x31c1c0[_0xb7b1('0x2f')][_0xb7b1('0x38')]+'%'};return _0x4f7673;}})});}_0x3e7e47=_['merge']({},_0x3e7e47,_0x31c1c0['options']);var _0x30052e={'where':_0x3e7e47[_0xb7b1('0x39')]};return db[_0xb7b1('0x3c')][_0xb7b1('0x1a')](_0x30052e)[_0xb7b1('0x23')](function(_0x1b75a2){_0x3837b9['count']=_0x1b75a2;if(_0x31c1c0[_0xb7b1('0x2f')]['includeAll']){_0x3e7e47[_0xb7b1('0x3d')]=[{'all':!![]}];}return db[_0xb7b1('0x3c')][_0xb7b1('0x3e')](_0x3e7e47);})[_0xb7b1('0x23')](function(_0x13c12f){_0x3837b9[_0xb7b1('0x3f')]=_0x13c12f;return _0x3837b9;})[_0xb7b1('0x23')](respondWithFilteredResult(_0x541b1a,_0x3e7e47))[_0xb7b1('0x40')](handleError(_0x541b1a,null));};exports[_0xb7b1('0x41')]=function(_0xaa921f,_0xf6be39){var _0x2f56c0={'raw':![],'where':{'id':_0xaa921f['params']['id']}},_0x6b7407={};_0x6b7407[_0xb7b1('0x2e')]=_['keys'](db[_0xb7b1('0x3c')][_0xb7b1('0x2b')]);_0x6b7407['query']=_[_0xb7b1('0x42')](_0xaa921f['query']);_0x6b7407[_0xb7b1('0x30')]=_[_0xb7b1('0x31')](_0x6b7407[_0xb7b1('0x2e')],_0x6b7407[_0xb7b1('0x2f')]);_0x2f56c0[_0xb7b1('0x32')]=_[_0xb7b1('0x31')](_0x6b7407[_0xb7b1('0x2e')],qs['fields'](_0xaa921f['query'][_0xb7b1('0x33')]));_0x2f56c0[_0xb7b1('0x32')]=_0x2f56c0[_0xb7b1('0x32')]['length']?_0x2f56c0['attributes']:_0x6b7407[_0xb7b1('0x2e')];if(_0xaa921f[_0xb7b1('0x2f')][_0xb7b1('0x43')]){_0x2f56c0[_0xb7b1('0x3d')]=[{'all':!![]}];}_0x2f56c0=_[_0xb7b1('0x3a')]({},_0x2f56c0,_0xaa921f[_0xb7b1('0x44')]);return db[_0xb7b1('0x3c')][_0xb7b1('0x45')](_0x2f56c0)['then'](handleEntityNotFound(_0xf6be39,null))['then'](respondWithResult(_0xf6be39,null))[_0xb7b1('0x40')](handleError(_0xf6be39,null));};exports[_0xb7b1('0x46')]=function(_0x1c3604,_0x5a5377){return db[_0xb7b1('0x3c')][_0xb7b1('0x46')](_0x1c3604[_0xb7b1('0x47')],{})[_0xb7b1('0x23')](function(_0x3475be){var _0x3aacc1=_0x1c3604[_0xb7b1('0x48')]['get']({'plain':!![]});if(!_0x3aacc1)throw new Error(_0xb7b1('0x49'));if(_0x3aacc1[_0xb7b1('0x4a')]===_0xb7b1('0x48')){var _0x4acaeb=_0x3475be[_0xb7b1('0x4b')]({'plain':!![]});var _0x511d97=_0xb7b1('0x25');return db[_0xb7b1('0x4c')]['find']({'where':{'name':_0x511d97,'userProfileId':_0x3aacc1[_0xb7b1('0x4d')]},'raw':!![]})[_0xb7b1('0x23')](function(_0x1518eb){if(_0x1518eb&&_0x1518eb['autoAssociation']===0x0){return db[_0xb7b1('0x26')][_0xb7b1('0x46')]({'name':_0x4acaeb[_0xb7b1('0x28')],'resourceId':_0x4acaeb['id'],'type':_0x1518eb['name'],'sectionId':_0x1518eb['id']},{})['then'](function(){return _0x3475be;});}else{return _0x3475be;}})['catch'](function(_0x47c877){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47c877);throw _0x47c877;});}return _0x3475be;})[_0xb7b1('0x23')](respondWithResult(_0x5a5377,0xc9))[_0xb7b1('0x40')](handleError(_0x5a5377,null));};exports[_0xb7b1('0x22')]=function(_0xfead3c,_0x2914e9){if(_0xfead3c[_0xb7b1('0x47')]['id']){delete _0xfead3c['body']['id'];}return db[_0xb7b1('0x3c')]['find']({'where':{'id':_0xfead3c[_0xb7b1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2914e9,null))[_0xb7b1('0x23')](saveUpdates(_0xfead3c['body'],null))[_0xb7b1('0x23')](respondWithResult(_0x2914e9,null))[_0xb7b1('0x40')](handleError(_0x2914e9,null));};exports[_0xb7b1('0x24')]=function(_0x16a5d1,_0x3312f5){return db['Trigger'][_0xb7b1('0x45')]({'where':{'id':_0x16a5d1[_0xb7b1('0x4e')]['id']}})[_0xb7b1('0x23')](handleEntityNotFound(_0x3312f5,null))['then'](removeEntity(_0x3312f5,null))[_0xb7b1('0x40')](handleError(_0x3312f5,null));};exports[_0xb7b1('0x4f')]=function(_0x1fc9a0,_0xdeff4e,_0x538b03){if(_0x1fc9a0['body']['id']){delete _0x1fc9a0[_0xb7b1('0x47')]['id'];}return db['Trigger'][_0xb7b1('0x45')]({'where':{'id':_0x1fc9a0[_0xb7b1('0x4e')]['id']}})['then'](handleEntityNotFound(_0xdeff4e,null))[_0xb7b1('0x23')](function(_0x445187){if(_0x445187){_0x1fc9a0['body'][_0xb7b1('0x50')]=_0x445187['id'];return db[_0xb7b1('0x51')][_0xb7b1('0x46')](_0x1fc9a0[_0xb7b1('0x47')]);}})[_0xb7b1('0x23')](respondWithResult(_0xdeff4e,null))['catch'](handleError(_0xdeff4e,null));};exports[_0xb7b1('0x52')]=function(_0x49f21a,_0x73b6bf,_0x4653ed){if(_0x49f21a[_0xb7b1('0x47')]['id']){delete _0x49f21a['body']['id'];}return db['Trigger'][_0xb7b1('0x45')]({'where':{'id':_0x49f21a[_0xb7b1('0x4e')]['id']}})[_0xb7b1('0x23')](handleEntityNotFound(_0x73b6bf,null))[_0xb7b1('0x23')](function(_0x6bd72e){if(_0x6bd72e){_0x49f21a[_0xb7b1('0x47')][_0xb7b1('0x53')]=_0x6bd72e['id'];return db['Condition']['create'](_0x49f21a[_0xb7b1('0x47')]);}})['then'](respondWithResult(_0x73b6bf,null))[_0xb7b1('0x40')](handleError(_0x73b6bf,null));};exports[_0xb7b1('0x54')]=function(_0xd4e9ef,_0x45ba6d,_0x3d32e9){var _0x480008={};var _0x469c54={};var _0x398e48;var _0x5eeb5a;return db[_0xb7b1('0x3c')]['findOne']({'where':{'id':_0xd4e9ef['params']['id']}})[_0xb7b1('0x23')](handleEntityNotFound(_0x45ba6d,null))[_0xb7b1('0x23')](function(_0x505360){if(_0x505360){_0x398e48=_0x505360;_0x469c54['model']=_['keys'](db['Condition'][_0xb7b1('0x2b')]);_0x469c54[_0xb7b1('0x2f')]=_[_0xb7b1('0x42')](_0xd4e9ef[_0xb7b1('0x2f')]);_0x469c54[_0xb7b1('0x30')]=_[_0xb7b1('0x31')](_0x469c54[_0xb7b1('0x2e')],_0x469c54['query']);_0x480008['attributes']=_['intersection'](_0x469c54[_0xb7b1('0x2e')],qs[_0xb7b1('0x33')](_0xd4e9ef[_0xb7b1('0x2f')][_0xb7b1('0x33')]));_0x480008['attributes']=_0x480008[_0xb7b1('0x32')][_0xb7b1('0x34')]?_0x480008[_0xb7b1('0x32')]:_0x469c54[_0xb7b1('0x2e')];_0x480008[_0xb7b1('0x35')]=qs[_0xb7b1('0x36')](_0xd4e9ef[_0xb7b1('0x2f')][_0xb7b1('0x36')]);_0x480008[_0xb7b1('0x39')]=qs[_0xb7b1('0x30')](_['pick'](_0xd4e9ef[_0xb7b1('0x2f')],_0x469c54[_0xb7b1('0x30')]));if(_0xd4e9ef[_0xb7b1('0x2f')][_0xb7b1('0x38')]){_0x480008['where']=_[_0xb7b1('0x3a')](_0x480008[_0xb7b1('0x39')],{'$or':_['map'](_0x480008[_0xb7b1('0x32')],function(_0x42879c){var _0x4d867a={};_0x4d867a[_0x42879c]={'$like':'%'+_0xd4e9ef[_0xb7b1('0x2f')]['filter']+'%'};return _0x4d867a;})});}_0x480008=_[_0xb7b1('0x3a')]({},_0x480008,_0xd4e9ef[_0xb7b1('0x44')]);return _0x398e48[_0xb7b1('0x54')](_0x480008);}})['then'](function(_0x1751ab){if(_0x1751ab){_0x5eeb5a=_0x1751ab[_0xb7b1('0x34')];if(!_0xd4e9ef['query'][_0xb7b1('0x55')](_0xb7b1('0x56'))){_0x480008[_0xb7b1('0x1c')]=qs['limit'](_0xd4e9ef['query'][_0xb7b1('0x1c')]);_0x480008['offset']=qs[_0xb7b1('0x1b')](_0xd4e9ef['query'][_0xb7b1('0x1b')]);}return _0x398e48['getAllConditions'](_0x480008);}})[_0xb7b1('0x23')](function(_0x9e85f4){if(_0x9e85f4){return _0x9e85f4?{'count':_0x5eeb5a,'rows':_0x9e85f4}:null;}})[_0xb7b1('0x23')](respondWithResult(_0x45ba6d,null))['catch'](handleError(_0x45ba6d,null));};exports[_0xb7b1('0x57')]=function(_0x5dda9c,_0x2af121,_0x1c0fd7){var _0x1fa770={};var _0x51ed00={};var _0x51d008;var _0x4aef5f;return db[_0xb7b1('0x3c')][_0xb7b1('0x58')]({'where':{'id':_0x5dda9c[_0xb7b1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2af121,null))[_0xb7b1('0x23')](function(_0x1fdb0a){if(_0x1fdb0a){_0x51d008=_0x1fdb0a;_0x51ed00[_0xb7b1('0x2e')]=_['keys'](db[_0xb7b1('0x51')][_0xb7b1('0x2b')]);_0x51ed00['query']=_[_0xb7b1('0x42')](_0x5dda9c[_0xb7b1('0x2f')]);_0x51ed00['filters']=_[_0xb7b1('0x31')](_0x51ed00['model'],_0x51ed00[_0xb7b1('0x2f')]);_0x1fa770[_0xb7b1('0x32')]=_['intersection'](_0x51ed00[_0xb7b1('0x2e')],qs[_0xb7b1('0x33')](_0x5dda9c[_0xb7b1('0x2f')][_0xb7b1('0x33')]));_0x1fa770[_0xb7b1('0x32')]=_0x1fa770[_0xb7b1('0x32')][_0xb7b1('0x34')]?_0x1fa770[_0xb7b1('0x32')]:_0x51ed00[_0xb7b1('0x2e')];_0x1fa770[_0xb7b1('0x35')]=qs[_0xb7b1('0x36')](_0x5dda9c[_0xb7b1('0x2f')][_0xb7b1('0x36')]);_0x1fa770[_0xb7b1('0x39')]=qs[_0xb7b1('0x30')](_[_0xb7b1('0x37')](_0x5dda9c[_0xb7b1('0x2f')],_0x51ed00[_0xb7b1('0x30')]));if(_0x5dda9c[_0xb7b1('0x2f')]['filter']){_0x1fa770[_0xb7b1('0x39')]=_['merge'](_0x1fa770['where'],{'$or':_['map'](_0x1fa770[_0xb7b1('0x32')],function(_0x143609){var _0x4d125b={};_0x4d125b[_0x143609]={'$like':'%'+_0x5dda9c['query'][_0xb7b1('0x38')]+'%'};return _0x4d125b;})});}_0x1fa770=_[_0xb7b1('0x3a')]({},_0x1fa770,_0x5dda9c[_0xb7b1('0x44')]);return _0x51d008[_0xb7b1('0x57')](_0x1fa770);}})[_0xb7b1('0x23')](function(_0x2ea39c){if(_0x2ea39c){_0x4aef5f=_0x2ea39c[_0xb7b1('0x34')];if(!_0x5dda9c[_0xb7b1('0x2f')]['hasOwnProperty']('nolimit')){_0x1fa770['limit']=qs[_0xb7b1('0x1c')](_0x5dda9c[_0xb7b1('0x2f')][_0xb7b1('0x1c')]);_0x1fa770[_0xb7b1('0x1b')]=qs[_0xb7b1('0x1b')](_0x5dda9c[_0xb7b1('0x2f')][_0xb7b1('0x1b')]);}return _0x51d008[_0xb7b1('0x57')](_0x1fa770);}})['then'](function(_0x273c16){if(_0x273c16){return _0x273c16?{'count':_0x4aef5f,'rows':_0x273c16}:null;}})[_0xb7b1('0x23')](respondWithResult(_0x2af121,null))[_0xb7b1('0x40')](handleError(_0x2af121,null));};exports['addAction']=function(_0x4a11be,_0x9cf645,_0x59b155){if(_0x4a11be['body']['id']){delete _0x4a11be[_0xb7b1('0x47')]['id'];}return db[_0xb7b1('0x3c')][_0xb7b1('0x45')]({'where':{'id':_0x4a11be[_0xb7b1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x9cf645,null))[_0xb7b1('0x23')](function(_0x65ae7b){if(_0x65ae7b){_0x4a11be['body'][_0xb7b1('0x59')]=_0x65ae7b['id'];return db[_0xb7b1('0x5a')][_0xb7b1('0x46')](_0x4a11be[_0xb7b1('0x47')]);}})[_0xb7b1('0x23')](respondWithResult(_0x9cf645,null))[_0xb7b1('0x40')](handleError(_0x9cf645,null));};exports[_0xb7b1('0x5b')]=function(_0x35a936,_0x57e111,_0x27fd54){var _0x595678={};var _0x5eb7f9={};var _0x208da8;var _0x384b93;return db[_0xb7b1('0x3c')]['findOne']({'where':{'id':_0x35a936['params']['id']}})['then'](handleEntityNotFound(_0x57e111,null))[_0xb7b1('0x23')](function(_0x18185f){if(_0x18185f){_0x208da8=_0x18185f;_0x5eb7f9[_0xb7b1('0x2e')]=_[_0xb7b1('0x42')](db[_0xb7b1('0x5a')][_0xb7b1('0x2b')]);_0x5eb7f9[_0xb7b1('0x2f')]=_[_0xb7b1('0x42')](_0x35a936[_0xb7b1('0x2f')]);_0x5eb7f9[_0xb7b1('0x30')]=_[_0xb7b1('0x31')](_0x5eb7f9['model'],_0x5eb7f9[_0xb7b1('0x2f')]);_0x595678[_0xb7b1('0x32')]=_[_0xb7b1('0x31')](_0x5eb7f9['model'],qs[_0xb7b1('0x33')](_0x35a936[_0xb7b1('0x2f')][_0xb7b1('0x33')]));_0x595678[_0xb7b1('0x32')]=_0x595678[_0xb7b1('0x32')][_0xb7b1('0x34')]?_0x595678[_0xb7b1('0x32')]:_0x5eb7f9[_0xb7b1('0x2e')];_0x595678['order']=qs[_0xb7b1('0x36')](_0x35a936['query'][_0xb7b1('0x36')]);_0x595678['where']=qs[_0xb7b1('0x30')](_['pick'](_0x35a936['query'],_0x5eb7f9[_0xb7b1('0x30')]));if(_0x35a936[_0xb7b1('0x2f')][_0xb7b1('0x38')]){_0x595678[_0xb7b1('0x39')]=_['merge'](_0x595678[_0xb7b1('0x39')],{'$or':_[_0xb7b1('0x2a')](_0x595678[_0xb7b1('0x32')],function(_0xa122fe){var _0x117036={};_0x117036[_0xa122fe]={'$like':'%'+_0x35a936[_0xb7b1('0x2f')][_0xb7b1('0x38')]+'%'};return _0x117036;})});}_0x595678=_[_0xb7b1('0x3a')]({},_0x595678,_0x35a936['options']);return _0x208da8[_0xb7b1('0x5b')](_0x595678);}})[_0xb7b1('0x23')](function(_0x48f0bd){if(_0x48f0bd){_0x384b93=_0x48f0bd[_0xb7b1('0x34')];if(!_0x35a936['query'][_0xb7b1('0x55')](_0xb7b1('0x56'))){_0x595678[_0xb7b1('0x1c')]=qs[_0xb7b1('0x1c')](_0x35a936[_0xb7b1('0x2f')][_0xb7b1('0x1c')]);_0x595678[_0xb7b1('0x1b')]=qs[_0xb7b1('0x1b')](_0x35a936['query'][_0xb7b1('0x1b')]);}return _0x208da8[_0xb7b1('0x5b')](_0x595678);}})['then'](function(_0x521d5e){if(_0x521d5e){return _0x521d5e?{'count':_0x384b93,'rows':_0x521d5e}:null;}})[_0xb7b1('0x23')](respondWithResult(_0x57e111,null))[_0xb7b1('0x40')](handleError(_0x57e111,null));};
\ No newline at end of file
diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js
index 42db5a7..fcae629 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 _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
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./trigger.attributes','exports','Trigger','tools_triggers','lodash','util'];(function(_0x561c10,_0xe9cb){var _0x1c5d24=function(_0x566e57){while(--_0x566e57){_0x561c10['push'](_0x561c10['shift']());}};_0x1c5d24(++_0xe9cb);}(_0x7a54,0x106));var _0x47a5=function(_0x1fad0e,_0x59f521){_0x1fad0e=_0x1fad0e-0x0;var _0xded3b0=_0x7a54[_0x1fad0e];return _0xded3b0;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'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 4e32960..53a7652 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 _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
+var _0x4b17=['http','request','then','info','request\x20sent','debug','stringify','error','message','Trigger,\x20%s,\x20%s','result','GetTrigger','Trigger','findAll','options','raw','where','attributes','include','map','model','catch','ShowTrigger','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x47de9a,_0x40cf23){var _0x4b9d6c=function(_0x507054){while(--_0x507054){_0x47de9a['push'](_0x47de9a['shift']());}};_0x4b9d6c(++_0x40cf23);}(_0x4b17,0x10f));var _0x74b1=function(_0x4de877,_0x340170){_0x4de877=_0x4de877-0x0;var _0xb2cfeb=_0x4b17[_0x4de877];return _0xb2cfeb;};'use strict';var _=require(_0x74b1('0x0'));var util=require('util');var moment=require(_0x74b1('0x1'));var BPromise=require('bluebird');var rs=require(_0x74b1('0x2'));var fs=require('fs');var Redis=require(_0x74b1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x74b1('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x74b1('0x5'));var jayson=require(_0x74b1('0x6'));var client=jayson[_0x74b1('0x7')][_0x74b1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x371c3b,_0x191d2b,_0x16761b){return new BPromise(function(_0x4c293c,_0x287e3e){return client[_0x74b1('0x9')](_0x371c3b,_0x16761b)[_0x74b1('0xa')](function(_0x25382b){logger[_0x74b1('0xb')]('Trigger,\x20%s,\x20%s',_0x191d2b,_0x74b1('0xc'));logger[_0x74b1('0xd')]('Trigger,\x20%s,\x20%s,\x20%s',_0x191d2b,_0x74b1('0xc'),JSON[_0x74b1('0xe')](_0x25382b));if(_0x25382b[_0x74b1('0xf')]){if(_0x25382b[_0x74b1('0xf')]['code']===0x1f4){logger[_0x74b1('0xf')]('Trigger,\x20%s,\x20%s',_0x191d2b,_0x25382b['error'][_0x74b1('0x10')]);return _0x287e3e(_0x25382b[_0x74b1('0xf')]['message']);}logger['error']('Trigger,\x20%s,\x20%s',_0x191d2b,_0x25382b[_0x74b1('0xf')]['message']);return _0x4c293c(_0x25382b['error'][_0x74b1('0x10')]);}else{logger[_0x74b1('0xb')](_0x74b1('0x11'),_0x191d2b,_0x74b1('0xc'));_0x4c293c(_0x25382b[_0x74b1('0x12')][_0x74b1('0x10')]);}})['catch'](function(_0x6237be){logger[_0x74b1('0xf')](_0x74b1('0x11'),_0x191d2b,_0x6237be);_0x287e3e(_0x6237be);});});}exports[_0x74b1('0x13')]=function(_0xde2736){var _0x8c9510=this;return new Promise(function(_0x1ab838,_0x4bb3d2){return db[_0x74b1('0x14')][_0x74b1('0x15')]({'raw':_0xde2736['options']?_0xde2736[_0x74b1('0x16')][_0x74b1('0x17')]===undefined?!![]:![]:!![],'where':_0xde2736[_0x74b1('0x16')]?_0xde2736[_0x74b1('0x16')][_0x74b1('0x18')]||null:null,'attributes':_0xde2736[_0x74b1('0x16')]?_0xde2736[_0x74b1('0x16')][_0x74b1('0x19')]||null:null,'limit':_0xde2736['options']?_0xde2736[_0x74b1('0x16')]['limit']||null:null,'include':_0xde2736['options']?_0xde2736['options'][_0x74b1('0x1a')]?_[_0x74b1('0x1b')](_0xde2736[_0x74b1('0x16')][_0x74b1('0x1a')],function(_0x563781){return{'model':db[_0x563781['model']],'as':_0x563781['as'],'attributes':_0x563781[_0x74b1('0x19')],'include':_0x563781['include']?_[_0x74b1('0x1b')](_0x563781[_0x74b1('0x1a')],function(_0xb5af0){return{'model':db[_0xb5af0[_0x74b1('0x1c')]],'as':_0xb5af0['as'],'attributes':_0xb5af0[_0x74b1('0x19')],'include':_0xb5af0[_0x74b1('0x1a')]?_[_0x74b1('0x1b')](_0xb5af0[_0x74b1('0x1a')],function(_0x4c7f05){return{'model':db[_0x4c7f05[_0x74b1('0x1c')]],'as':_0x4c7f05['as'],'attributes':_0x4c7f05[_0x74b1('0x19')]};}):[]};}):[]};}):[]:[]})[_0x74b1('0xa')](function(_0x5c32d2){logger[_0x74b1('0xb')](_0x74b1('0x13'),_0xde2736);logger[_0x74b1('0xd')](_0x74b1('0x13'),_0xde2736,JSON[_0x74b1('0xe')](_0x5c32d2));_0x1ab838(_0x5c32d2);})[_0x74b1('0x1d')](function(_0x436eda){logger[_0x74b1('0xf')]('GetTrigger',_0x436eda[_0x74b1('0x10')],_0xde2736);_0x4bb3d2(_0x8c9510[_0x74b1('0xf')](0x1f4,_0x436eda['message']));});});};exports[_0x74b1('0x1e')]=function(_0x45404f){var _0x1ac433=this;return new Promise(function(_0x5f4d1b,_0x113300){return db[_0x74b1('0x14')]['find']({'raw':_0x45404f[_0x74b1('0x16')]?_0x45404f[_0x74b1('0x16')][_0x74b1('0x17')]===undefined?!![]:![]:!![],'where':_0x45404f[_0x74b1('0x16')]?_0x45404f[_0x74b1('0x16')][_0x74b1('0x18')]||null:null,'attributes':_0x45404f[_0x74b1('0x16')]?_0x45404f[_0x74b1('0x16')]['attributes']||null:null,'include':_0x45404f[_0x74b1('0x16')]?_0x45404f['options']['include']?_[_0x74b1('0x1b')](_0x45404f['options']['include'],function(_0x3fd43c){return{'model':db[_0x3fd43c[_0x74b1('0x1c')]],'as':_0x3fd43c['as'],'attributes':_0x3fd43c[_0x74b1('0x19')],'include':_0x3fd43c[_0x74b1('0x1a')]?_[_0x74b1('0x1b')](_0x3fd43c[_0x74b1('0x1a')],function(_0x171fa4){return{'model':db[_0x171fa4[_0x74b1('0x1c')]],'as':_0x171fa4['as'],'attributes':_0x171fa4['attributes'],'include':_0x171fa4['include']?_['map'](_0x171fa4[_0x74b1('0x1a')],function(_0x57f7b5){return{'model':db[_0x57f7b5['model']],'as':_0x57f7b5['as'],'attributes':_0x57f7b5[_0x74b1('0x19')]};}):[]};}):[]};}):[]:[]})[_0x74b1('0xa')](function(_0x222783){logger['info'](_0x74b1('0x1e'),_0x45404f);logger['debug'](_0x74b1('0x1e'),_0x45404f,JSON[_0x74b1('0xe')](_0x222783));_0x5f4d1b(_0x222783);})['catch'](function(_0x514d0e){logger[_0x74b1('0xf')](_0x74b1('0x1e'),_0x514d0e['message'],_0x45404f);_0x113300(_0x1ac433['error'](0x1f4,_0x514d0e[_0x74b1('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js
index db8c923..5bb7c1d 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 _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
+var _0xae24=['isAuthenticated','index','/:id','/:id/clone','post','put','update','destroy','multer','path','express','Router','../../config/environment','get'];(function(_0x258257,_0x32042d){var _0xafb58a=function(_0x506b5a){while(--_0x506b5a){_0x258257['push'](_0x258257['shift']());}};_0xafb58a(++_0x32042d);}(_0xae24,0x182));var _0x4ae2=function(_0x57deb3,_0x34fa5e){_0x57deb3=_0x57deb3-0x0;var _0x1d4d73=_0xae24[_0x57deb3];return _0x1d4d73;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ae2('0x4'));var controller=require('./trunk.controller');router[_0x4ae2('0x5')]('/',auth[_0x4ae2('0x6')](),controller[_0x4ae2('0x7')]);router[_0x4ae2('0x5')](_0x4ae2('0x8'),auth[_0x4ae2('0x6')](),controller['show']);router['post'](_0x4ae2('0x9'),auth['isAuthenticated'](),controller['clone']);router[_0x4ae2('0xa')]('/',auth[_0x4ae2('0x6')](),controller['create']);router[_0x4ae2('0xb')](_0x4ae2('0x8'),auth[_0x4ae2('0x6')](),controller[_0x4ae2('0xc')]);router['delete'](_0x4ae2('0x8'),auth[_0x4ae2('0x6')](),controller[_0x4ae2('0xd')]);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 f8b9ea6..448c46d 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 _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
+var _0x816a=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','pai','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','inband','auto','yes','update','outgoing','force_rport,comedia','nat','join','getDataValue','all','ulaw;alaw;gsm','allow','port,invite','insecure'];(function(_0x41667c,_0x5151be){var _0x4a2870=function(_0x2ff741){while(--_0x2ff741){_0x41667c['push'](_0x41667c['shift']());}};_0x4a2870(++_0x5151be);}(_0x816a,0x15f));var _0xa816=function(_0x204057,_0x2fa86e){_0x204057=_0x204057-0x0;var _0x25ce2c=_0x816a[_0x204057];return _0x25ce2c;};'use strict';var Sequelize=require(_0xa816('0x0'));module[_0xa816('0x1')]={'name':{'type':Sequelize[_0xa816('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x4'),_0xa816('0x5'),'peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xa816('0x2')],'allowNull':![],'defaultValue':_0xa816('0x6')},'callingpres':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x7'),_0xa816('0x8'),'ALLOWED_FAILED_SCREEN',_0xa816('0x9'),_0xa816('0xa'),_0xa816('0xb'),_0xa816('0xc'),_0xa816('0xd'))},'deny':{'type':Sequelize[_0xa816('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xa816('0x2')]},'md5secret':{'type':Sequelize[_0xa816('0x2')]},'remotesecret':{'type':Sequelize[_0xa816('0x2')]},'transport':{'type':Sequelize[_0xa816('0x2')],'defaultValue':_0xa816('0xe'),'set':function(_0x3b5b68){this[_0xa816('0xf')](_0xa816('0x10'),_0x3b5b68?_0x3b5b68['join'](','):null);},'get':function(){return this['getDataValue'](_0xa816('0x10'))?this['getDataValue'](_0xa816('0x10'))[_0xa816('0x11')](','):null;},'comment':_0xa816('0x12')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833','info','shortinfo',_0xa816('0x13'),_0xa816('0x14')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x15'),'no','nonat',_0xa816('0x16'),_0xa816('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x15'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa816('0x2')]},'directmediadeny':{'type':Sequelize[_0xa816('0x2')]},'nat':{'type':Sequelize[_0xa816('0x2')],'defaultValue':_0xa816('0x18'),'set':function(_0x980ecf){this[_0xa816('0xf')](_0xa816('0x19'),_0x980ecf?_0x980ecf[_0xa816('0x1a')](','):null);},'get':function(){return this['getDataValue'](_0xa816('0x19'))?this[_0xa816('0x1b')](_0xa816('0x19'))[_0xa816('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xa816('0x2')]},'namedcallgroup':{'type':Sequelize[_0xa816('0x2')]},'pickupgroup':{'type':Sequelize[_0xa816('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa816('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xa816('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4dc150){this[_0xa816('0xf')]('allow',_0x4dc150?_0x4dc150['join'](';'):_0xa816('0x1d'));},'get':function(){return this[_0xa816('0x1b')](_0xa816('0x1e'))?this[_0xa816('0x1b')](_0xa816('0x1e'))[_0xa816('0x11')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xa816('0x15'),'no')},'insecure':{'type':Sequelize[_0xa816('0x2')],'defaultValue':_0xa816('0x1f'),'set':function(_0x17959e){this[_0xa816('0xf')](_0xa816('0x20'),_0x17959e?_0x17959e['join'](','):null);},'get':function(){return this[_0xa816('0x1b')](_0xa816('0x20'))?this[_0xa816('0x1b')](_0xa816('0x20'))[_0xa816('0x11')](','):null;},'comment':_0xa816('0x21')},'trustrpid':{'type':Sequelize[_0xa816('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xa816('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa816('0x3')]('yes','no',_0xa816('0x22'))},'promiscredir':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x15'),'no')},'useclientcode':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x15'),'no')},'accountcode':{'type':Sequelize[_0xa816('0x23')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xa816('0x2')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xa816('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x15'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xa816('0x15'),'no')},'allowtransfer':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x15'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xa816('0x3')]('yes','no',_0xa816('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa816('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xa816('0x15'),'no')},'mailbox':{'type':Sequelize[_0xa816('0x2')]},'session_timers':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x25'),_0xa816('0x26'),_0xa816('0x27'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xa816('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x28'),_0xa816('0x29')),'defaultValue':_0xa816('0x29')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xa816('0x2')]},'fromdomain':{'type':Sequelize[_0xa816('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xa816('0x23')](0x5)},'qualify':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x15'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xa816('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xa816('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xa816('0x23')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0xa816('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa816('0x2')]},'callbackextension':{'type':Sequelize[_0xa816('0x2')]},'timert1':{'type':Sequelize[_0xa816('0x23')](0xb)},'timerb':{'type':Sequelize[_0xa816('0x23')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xa816('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xa816('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xa816('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xa816('0x23')](0xb)},'encryption':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x15'),'no')},'force_avp':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x15'),'no')},'icesupport':{'type':Sequelize[_0xa816('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x15'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0xa816('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0xa816('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xa816('0x2')]},'dtlscafile':{'type':Sequelize[_0xa816('0x2')]},'dtlscapath':{'type':Sequelize[_0xa816('0x2')]},'dtlssetup':{'type':Sequelize[_0xa816('0x3')]('active',_0xa816('0x2b'),_0xa816('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa816('0x2')]},'usereqphone':{'type':Sequelize[_0xa816('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa816('0x2')]},'recordofffeature':{'type':Sequelize[_0xa816('0x2')]},'call_limit':{'type':Sequelize[_0xa816('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x15'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xa816('0x15'),'no')},'vmexten':{'type':Sequelize[_0xa816('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xa816('0x2')]},'parkinglot':{'type':Sequelize[_0xa816('0x2')]},'description':{'type':Sequelize[_0xa816('0x2')]},'host':{'type':Sequelize[_0xa816('0x2')],'defaultValue':_0xa816('0x2d')},'canreinvite':{'type':Sequelize[_0xa816('0x3')](_0xa816('0x15'),'no','nonat','update',_0xa816('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xa816('0x2')]},'otherFields':{'type':Sequelize[_0xa816('0x2')]},'active':{'type':Sequelize[_0xa816('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xa816('0x2')],'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 5c42ef2..0a290ba 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 _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
+var _0x263f=['Trunk','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','show','intersection','catch','clone','params','find','createdAt','updatedAt','body','omit','create','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','render','/etc/asterisk/sip_xcally_trunks.conf','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','server/files/templates/registry.ejs','writeFileSync','Reload','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','client','http','test','ValidationError','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','then','name','send','index','map'];(function(_0x60dfb5,_0x1437a8){var _0x197bce=function(_0x4a5488){while(--_0x4a5488){_0x60dfb5['push'](_0x60dfb5['shift']());}};_0x197bce(++_0x1437a8);}(_0x263f,0x182));var _0xf263=function(_0x2372c7,_0xf20d07){_0x2372c7=_0x2372c7-0x0;var _0xaa8d12=_0x263f[_0x2372c7];return _0xaa8d12;};'use strict';var pdf=require(_0xf263('0x0'));var emlformat=require(_0xf263('0x1'));var rimraf=require(_0xf263('0x2'));var zipdir=require(_0xf263('0x3'));var jsonpatch=require(_0xf263('0x4'));var rp=require(_0xf263('0x5'));var moment=require('moment');var BPromise=require(_0xf263('0x6'));var Mustache=require(_0xf263('0x7'));var util=require(_0xf263('0x8'));var path=require('path');var sox=require(_0xf263('0x9'));var csv=require(_0xf263('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf263('0xb'));var crypto=require(_0xf263('0xc'));var jsforce=require(_0xf263('0xd'));var deskjs=require(_0xf263('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf263('0xf'));var Papa=require(_0xf263('0x10'));var Redis=require(_0xf263('0x11'));var authService=require(_0xf263('0x12'));var qs=require(_0xf263('0x13'));var as=require(_0xf263('0x14'));var hardwareService=require(_0xf263('0x15'));var logger=require('../../config/logger')(_0xf263('0x16'));var utils=require('../../config/utils');var config=require(_0xf263('0x17'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xf263('0x18')][_0xf263('0x19')]({'port':0x232a});function checkPasswordPattern(_0x17471d,_0xd7a907,_0x1037a4){if(_0x1037a4){var _0xc6a733=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc6a733[_0xf263('0x1a')](_0xd7a907)){return _0x17471d;}else{throw new db['Sequelize'][(_0xf263('0x1b'))]('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 _0x17471d;}}function respondWithRpcPromise(_0x2a79aa,_0x27b16a,_0x3ac432,_0x402739){return new BPromise(function(_0x16b4dd,_0xf45ebe){var _0x506789=_0x402739||client;return _0x506789['request'](_0x2a79aa,_0x3ac432)['then'](function(_0x2bbe2f){logger[_0xf263('0x1c')](_0xf263('0x1d'),_0x27b16a,_0xf263('0x1e'));logger[_0xf263('0x1f')]('Trunk,\x20%s,\x20%s,\x20%s',_0x27b16a,_0xf263('0x1e'),JSON['stringify'](_0x2bbe2f));if(_0x2bbe2f[_0xf263('0x20')]){if(_0x2bbe2f[_0xf263('0x20')][_0xf263('0x21')]===0x1f4){logger['error'](_0xf263('0x1d'),_0x27b16a,_0x2bbe2f[_0xf263('0x20')][_0xf263('0x22')]);return _0xf45ebe(_0x2bbe2f['error'][_0xf263('0x22')]);}logger[_0xf263('0x20')](_0xf263('0x1d'),_0x27b16a,_0x2bbe2f[_0xf263('0x20')][_0xf263('0x22')]);return _0x16b4dd(_0x2bbe2f[_0xf263('0x20')][_0xf263('0x22')]);}else{logger[_0xf263('0x1c')](_0xf263('0x1d'),_0x27b16a,_0xf263('0x1e'));_0x16b4dd(_0x2bbe2f[_0xf263('0x23')]['message']);}})['catch'](function(_0x5dc48f){logger[_0xf263('0x20')](_0xf263('0x1d'),_0x27b16a,_0x5dc48f);_0xf45ebe(_0x5dc48f);});});}function respondWithStatusCode(_0x231748,_0x1b3603){_0x1b3603=_0x1b3603||0xcc;return function(_0x36df8e){if(_0x36df8e){return _0x231748[_0xf263('0x24')](_0x1b3603);}return _0x231748[_0xf263('0x25')](_0x1b3603)[_0xf263('0x26')]();};}function respondWithResult(_0x3c44f1,_0xbeabe5){_0xbeabe5=_0xbeabe5||0xc8;return function(_0x2411a2){if(_0x2411a2){return _0x3c44f1['status'](_0xbeabe5)[_0xf263('0x27')](_0x2411a2);}};}function respondWithFilteredResult(_0x4ea2c4,_0x3f74ed){return function(_0x4f148c){if(_0x4f148c){var _0x368cfc=_0x4f148c[_0xf263('0x28')],_0x3500b2=_0x3f74ed[_0xf263('0x29')],_0x5a11bf=_0x3f74ed[_0xf263('0x29')]+_0x3f74ed[_0xf263('0x2a')],_0x57ae2f;if(_0x5a11bf>=_0x368cfc){_0x5a11bf=_0x368cfc;_0x57ae2f=0xc8;}else{_0x57ae2f=0xce;}_0x4ea2c4[_0xf263('0x25')](_0x57ae2f);return _0x4ea2c4[_0xf263('0x2b')](_0xf263('0x2c'),_0x3500b2+'-'+_0x5a11bf+'/'+_0x368cfc)[_0xf263('0x27')](_0x4f148c);}return null;};}function patchUpdates(_0x5383d8){return function(_0x302c81){try{jsonpatch[_0xf263('0x2d')](_0x302c81,_0x5383d8,!![]);}catch(_0x3d6f5e){return BPromise[_0xf263('0x2e')](_0x3d6f5e);}return _0x302c81[_0xf263('0x2f')]();};}function saveUpdates(_0x89770f,_0x213db9){return function(_0x1dcd5f){if(_0x1dcd5f){return _0x1dcd5f[_0xf263('0x30')](_0x89770f)['then'](function(_0x238623){return _0x238623;});}return null;};}function removeEntity(_0x5a202e,_0x48f260){return function(_0xac742e){if(_0xac742e){return _0xac742e[_0xf263('0x31')]()['then'](function(){var _0x36414b=_0xac742e[_0xf263('0x32')]({'plain':!![]});var _0x482251=_0xf263('0x33');return db[_0xf263('0x34')][_0xf263('0x31')]({'where':{'type':_0x482251,'resourceId':_0x36414b['id']}})[_0xf263('0x35')](function(){return _0xac742e;});})[_0xf263('0x35')](function(){_0x5a202e[_0xf263('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x385ba6,_0x13506b){return function(_0x53ac8b){if(!_0x53ac8b){_0x385ba6['sendStatus'](0x194);}return _0x53ac8b;};}function handleError(_0x15ba56,_0x42db2e){_0x42db2e=_0x42db2e||0x1f4;return function(_0x1b942e){logger[_0xf263('0x20')](_0x1b942e['stack']);if(_0x1b942e[_0xf263('0x36')]){delete _0x1b942e[_0xf263('0x36')];}_0x15ba56[_0xf263('0x25')](_0x42db2e)[_0xf263('0x37')](_0x1b942e);};}exports[_0xf263('0x38')]=function(_0x49c9a1,_0x100a45){var _0x3a6834={},_0x1600f8={},_0x4f6875={'count':0x0,'rows':[]};var _0x1ece85=_[_0xf263('0x39')](db[_0xf263('0x3a')][_0xf263('0x3b')],function(_0x3bbe13){return{'name':_0x3bbe13['fieldName'],'type':_0x3bbe13[_0xf263('0x3c')][_0xf263('0x3d')]};});_0x1600f8[_0xf263('0x3e')]=_['map'](_0x1ece85,_0xf263('0x36'));_0x1600f8[_0xf263('0x3f')]=_[_0xf263('0x40')](_0x49c9a1['query']);_0x1600f8[_0xf263('0x41')]=_['intersection'](_0x1600f8[_0xf263('0x3e')],_0x1600f8[_0xf263('0x3f')]);_0x3a6834[_0xf263('0x42')]=_['intersection'](_0x1600f8['model'],qs['fields'](_0x49c9a1[_0xf263('0x3f')][_0xf263('0x43')]));_0x3a6834['attributes']=_0x3a6834['attributes'][_0xf263('0x44')]?_0x3a6834[_0xf263('0x42')]:_0x1600f8[_0xf263('0x3e')];if(!_0x49c9a1[_0xf263('0x3f')][_0xf263('0x45')]('nolimit')){_0x3a6834[_0xf263('0x2a')]=qs[_0xf263('0x2a')](_0x49c9a1[_0xf263('0x3f')][_0xf263('0x2a')]);_0x3a6834[_0xf263('0x29')]=qs['offset'](_0x49c9a1[_0xf263('0x3f')][_0xf263('0x29')]);}_0x3a6834[_0xf263('0x46')]=qs['sort'](_0x49c9a1['query'][_0xf263('0x47')]);_0x3a6834['where']=qs['filters'](_[_0xf263('0x48')](_0x49c9a1[_0xf263('0x3f')],_0x1600f8[_0xf263('0x41')]),_0x1ece85);if(_0x49c9a1['query'][_0xf263('0x49')]){_0x3a6834[_0xf263('0x4a')]=_['merge'](_0x3a6834[_0xf263('0x4a')],{'$or':_[_0xf263('0x39')](_0x1ece85,function(_0x51db8f){if(_0x51db8f[_0xf263('0x3c')]!==_0xf263('0x4b')){var _0x545220={};_0x545220[_0x51db8f[_0xf263('0x36')]]={'$like':'%'+_0x49c9a1[_0xf263('0x3f')][_0xf263('0x49')]+'%'};return _0x545220;}})});}_0x3a6834=_[_0xf263('0x4c')]({},_0x3a6834,_0x49c9a1[_0xf263('0x4d')]);var _0x147e26={'where':_0x3a6834[_0xf263('0x4a')]};return db['Trunk'][_0xf263('0x28')](_0x147e26)[_0xf263('0x35')](function(_0x19e09c){_0x4f6875[_0xf263('0x28')]=_0x19e09c;if(_0x49c9a1[_0xf263('0x3f')][_0xf263('0x4e')]){_0x3a6834[_0xf263('0x4f')]=[{'all':!![]}];}return db[_0xf263('0x3a')]['findAll'](_0x3a6834);})[_0xf263('0x35')](function(_0x227ece){_0x4f6875[_0xf263('0x50')]=_0x227ece;return _0x4f6875;})[_0xf263('0x35')](respondWithFilteredResult(_0x100a45,_0x3a6834))['catch'](handleError(_0x100a45,null));};exports[_0xf263('0x51')]=function(_0x4a3f83,_0x773a03){var _0x159852={'raw':![],'where':{'id':_0x4a3f83['params']['id']}},_0x22f9bd={};_0x22f9bd['model']=_['keys'](db['Trunk']['rawAttributes']);_0x22f9bd[_0xf263('0x3f')]=_[_0xf263('0x40')](_0x4a3f83['query']);_0x22f9bd[_0xf263('0x41')]=_[_0xf263('0x52')](_0x22f9bd[_0xf263('0x3e')],_0x22f9bd[_0xf263('0x3f')]);_0x159852[_0xf263('0x42')]=_[_0xf263('0x52')](_0x22f9bd[_0xf263('0x3e')],qs[_0xf263('0x43')](_0x4a3f83[_0xf263('0x3f')][_0xf263('0x43')]));_0x159852[_0xf263('0x42')]=_0x159852[_0xf263('0x42')]['length']?_0x159852[_0xf263('0x42')]:_0x22f9bd['model'];if(_0x4a3f83['query'][_0xf263('0x4e')]){_0x159852['include']=[{'all':!![]}];}_0x159852=_['merge']({},_0x159852,_0x4a3f83[_0xf263('0x4d')]);return db[_0xf263('0x3a')]['find'](_0x159852)[_0xf263('0x35')](handleEntityNotFound(_0x773a03,null))['then'](respondWithResult(_0x773a03,null))[_0xf263('0x53')](handleError(_0x773a03,null));};exports[_0xf263('0x54')]=function(_0x5611fc,_0x3d5aa2){var _0x28700f={'where':{'id':_0x5611fc[_0xf263('0x55')]['id']}},_0x5b58e8={};_0x5b58e8['model']=_[_0xf263('0x40')](db[_0xf263('0x3a')][_0xf263('0x3b')]);_0x28700f[_0xf263('0x42')]=_[_0xf263('0x52')](_0x5b58e8[_0xf263('0x3e')],qs[_0xf263('0x43')](_0x5611fc[_0xf263('0x3f')][_0xf263('0x43')]));_0x28700f[_0xf263('0x42')]=_0x28700f[_0xf263('0x42')][_0xf263('0x44')]?_0x28700f[_0xf263('0x42')]:_0x5b58e8[_0xf263('0x3e')];if(_0x5611fc['query']['includeAll']){_0x28700f[_0xf263('0x4f')]=[{'all':!![]}];}_0x28700f=_['merge']({},_0x28700f,_0x5611fc[_0xf263('0x4d')]);return db[_0xf263('0x3a')][_0xf263('0x56')](_0x28700f)[_0xf263('0x35')](handleEntityNotFound(_0x3d5aa2,null))[_0xf263('0x35')](function(_0x6423f9){if(_0x6423f9){var _0x22285e=_0x6423f9[_0xf263('0x32')]({'plain':!![]});_0x22285e=qs['omit'](_0x22285e,['id',_0xf263('0x57'),_0xf263('0x58')]);_0x5611fc[_0xf263('0x59')]=_[_0xf263('0x5a')](_0x5611fc[_0xf263('0x59')],['id','createdAt',_0xf263('0x58')]);return db['Trunk'][_0xf263('0x5b')](_['merge'](_0x22285e,_0x5611fc[_0xf263('0x59')]),{'include':_0x5611fc[_0xf263('0x3f')]['includeAll']?[{'all':!![]}]:undefined})[_0xf263('0x35')](function(_0x38fff8){var _0x3d0691=_0x5611fc[_0xf263('0x5c')]['get']({'plain':!![]});if(!_0x3d0691)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d0691[_0xf263('0x5d')]===_0xf263('0x5c')){var _0x53f0be=_0x38fff8[_0xf263('0x32')]({'plain':!![]});var _0x8f88d0=_0xf263('0x33');return db['UserProfileSection']['find']({'where':{'name':_0x8f88d0,'userProfileId':_0x3d0691['userProfileId']},'raw':!![]})['then'](function(_0xfd77e2){if(_0xfd77e2&&_0xfd77e2[_0xf263('0x5e')]===0x0){return db['UserProfileResource'][_0xf263('0x5b')]({'name':_0x53f0be[_0xf263('0x36')],'resourceId':_0x53f0be['id'],'type':_0xfd77e2[_0xf263('0x36')],'sectionId':_0xfd77e2['id']},{})['then'](function(){return _0x38fff8;});}else{return _0x38fff8;}})[_0xf263('0x53')](function(_0x3bd5f2){logger[_0xf263('0x20')](_0xf263('0x5f'),_0x3bd5f2);throw _0x3bd5f2;});}return _0x38fff8;});}})[_0xf263('0x35')](respondWithResult(_0x3d5aa2,0xc9))[_0xf263('0x53')](handleError(_0x3d5aa2,null));};exports[_0xf263('0x5b')]=function(_0x390741,_0x4ba929,_0x40b6d5){var _0x1170c5;return db[_0xf263('0x3a')]['create'](_0x390741[_0xf263('0x59')],{'raw':!![]})[_0xf263('0x35')](function(_0x27a354){_0x1170c5=_0x27a354;return db[_0xf263('0x3a')][_0xf263('0x60')]({'raw':!![]});})[_0xf263('0x35')](function(_0x4a8813){var _0x2e20d1=fs['readFileSync'](path[_0xf263('0x61')](config[_0xf263('0x62')],_0xf263('0x63')),_0xf263('0x64'));var _0x299e52=fs[_0xf263('0x65')](path[_0xf263('0x61')](config[_0xf263('0x62')],'server/files/templates/registry.ejs'),_0xf263('0x64'));var _0x432b96=ejs[_0xf263('0x66')](_0x2e20d1,{'trunks':_0x4a8813||[]});fs['writeFileSync'](_0xf263('0x67'),_0x432b96);if(_0x1170c5['registry']){var _0xa3751c=ejs[_0xf263('0x66')](_0x299e52,{'trunks':_0x4a8813||[]});fs['writeFileSync'](_0xf263('0x68'),_0xa3751c);}})[_0xf263('0x35')](function(){return respondWithRpcPromise('Reload',_0xf263('0x5b'),{'module':_0xf263('0x69')});})[_0xf263('0x35')](function(){var _0x4e85fa=_0x390741['user']['get']({'plain':!![]});if(!_0x4e85fa)throw new Error(_0xf263('0x6a'));if(_0x4e85fa[_0xf263('0x5d')]===_0xf263('0x5c')){var _0x4b5575=_0x1170c5['get']({'plain':!![]});return db[_0xf263('0x6b')][_0xf263('0x56')]({'where':{'name':_0xf263('0x33'),'userProfileId':_0x4e85fa['userProfileId']},'raw':!![]})[_0xf263('0x35')](function(_0x4e574d){if(_0x4e574d&&_0x4e574d[_0xf263('0x5e')]===0x0){return db[_0xf263('0x34')][_0xf263('0x5b')]({'name':_0x4b5575[_0xf263('0x36')],'resourceId':_0x4b5575['id'],'type':_0x4e574d[_0xf263('0x36')],'sectionId':_0x4e574d['id']},{})['then'](function(){return _0x1170c5;});}else{return _0x1170c5;}})['catch'](function(_0x82a7e5){logger[_0xf263('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x82a7e5);throw _0x82a7e5;});}return _0x1170c5;})[_0xf263('0x35')](respondWithResult(_0x4ba929,0xc9))[_0xf263('0x53')](handleError(_0x4ba929,null));};exports[_0xf263('0x30')]=function(_0xbd0f4e,_0x13758d,_0x2ad3e4){var _0x2d4f74;return db['Trunk'][_0xf263('0x56')]({'where':{'id':_0xbd0f4e[_0xf263('0x55')]['id']}})[_0xf263('0x35')](handleEntityNotFound(_0x13758d,null))[_0xf263('0x35')](saveUpdates(_0xbd0f4e[_0xf263('0x59')],null))['then'](function(_0x10b1e9){if(_0x10b1e9){_0x2d4f74=_0x10b1e9;return db['Trunk'][_0xf263('0x60')]({'raw':!![]});}})[_0xf263('0x35')](function(_0x342a5f){if(_0x342a5f){var _0x35c536=fs[_0xf263('0x65')](path['join'](config[_0xf263('0x62')],'server/files/templates/trunk.ejs'),'utf8');var _0x49f93d=fs['readFileSync'](path[_0xf263('0x61')](config[_0xf263('0x62')],_0xf263('0x6c')),_0xf263('0x64'));var _0x38c1a9=ejs[_0xf263('0x66')](_0x35c536,{'trunks':_0x342a5f||[]});fs[_0xf263('0x6d')]('/etc/asterisk/sip_xcally_trunks.conf',_0x38c1a9);var _0x456749=ejs['render'](_0x49f93d,{'trunks':_0x342a5f||[]});fs[_0xf263('0x6d')](_0xf263('0x68'),_0x456749);return respondWithRpcPromise(_0xf263('0x6e'),_0xf263('0x30'),{'module':'chan_sip.so'});}return null;})[_0xf263('0x35')](function(_0x22f274){if(_0x22f274){return _0x2d4f74;}})[_0xf263('0x35')](respondWithResult(_0x13758d,null))[_0xf263('0x53')](handleError(_0x13758d,null));};exports[_0xf263('0x31')]=function(_0x523412,_0xd6d3a7,_0x3d5c09){var _0x174a4a;return db[_0xf263('0x3a')][_0xf263('0x56')]({'where':{'id':_0x523412[_0xf263('0x55')]['id']}})[_0xf263('0x35')](handleEntityNotFound(_0xd6d3a7,null))[_0xf263('0x35')](removeEntity(_0xd6d3a7,null))['then'](function(){return db['Trunk'][_0xf263('0x60')]({'raw':!![]});})[_0xf263('0x35')](function(_0x2a90f8){var _0x5645a8=fs[_0xf263('0x65')](path['join'](config[_0xf263('0x62')],_0xf263('0x63')),'utf8');var _0x178f6c=fs[_0xf263('0x65')](path[_0xf263('0x61')](config[_0xf263('0x62')],_0xf263('0x6c')),_0xf263('0x64'));var _0x18b979=ejs[_0xf263('0x66')](_0x5645a8,{'trunks':_0x2a90f8});var _0x432f2c=ejs[_0xf263('0x66')](_0x178f6c,{'trunks':_0x2a90f8});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x18b979);fs['writeFileSync'](_0xf263('0x68'),_0x432f2c);return respondWithRpcPromise(_0xf263('0x6e'),'destroy',{'module':_0xf263('0x69')});})['catch'](handleError(_0xd6d3a7,null));};
\ No newline at end of file
diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js
index 0d06a0f..c9d5b7d 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 _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
+var _0xcfe6=['bluebird','request-promise','../../config/environment','./trunk.attributes','exports','tools_trunks','util','api'];(function(_0x3d6785,_0x492ea3){var _0x39a624=function(_0x27d7db){while(--_0x27d7db){_0x3d6785['push'](_0x3d6785['shift']());}};_0x39a624(++_0x492ea3);}(_0xcfe6,0x12e));var _0x6cfe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfe6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6cfe('0x0'));var logger=require('../../config/logger')(_0x6cfe('0x1'));var moment=require('moment');var BPromise=require(_0x6cfe('0x2'));var rp=require(_0x6cfe('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6cfe('0x4'));var attributes=require(_0x6cfe('0x5'));module[_0x6cfe('0x6')]=function(_0xd076e2,_0x24de6e){return _0xd076e2['define']('Trunk',attributes,{'tableName':_0x6cfe('0x7'),'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 2478f01..048267d 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 _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
+var _0x1a85=['info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','options','raw','where','limit','include','model','map','attributes','then','ShowTrunk','find','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x1a85,0x178));var _0x51a8=function(_0x44ca27,_0x81f0da){_0x44ca27=_0x44ca27-0x0;var _0x38bc17=_0x1a85[_0x44ca27];return _0x38bc17;};'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')]('Trunk,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});}exports[_0x51a8('0x13')]=function(_0x45a433){var _0xd52230=this;return new Promise(function(_0x23539e,_0x3bc1a2){return db[_0x51a8('0x14')]['findAll']({'raw':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x16')]===undefined?!![]:![]:!![],'where':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x17')]||null:null,'attributes':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')]['attributes']||null:null,'limit':_0x45a433[_0x51a8('0x15')]?_0x45a433['options'][_0x51a8('0x18')]||null:null,'include':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x19')]?_['map'](_0x45a433[_0x51a8('0x15')]['include'],function(_0x47f063){return{'model':db[_0x47f063[_0x51a8('0x1a')]],'as':_0x47f063['as'],'attributes':_0x47f063['attributes'],'include':_0x47f063[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x47f063[_0x51a8('0x19')],function(_0x18e2f3){return{'model':db[_0x18e2f3[_0x51a8('0x1a')]],'as':_0x18e2f3['as'],'attributes':_0x18e2f3[_0x51a8('0x1c')],'include':_0x18e2f3[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x18e2f3['include'],function(_0x273ce2){return{'model':db[_0x273ce2[_0x51a8('0x1a')]],'as':_0x273ce2['as'],'attributes':_0x273ce2[_0x51a8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x51a8('0x1d')](function(_0x1c150d){logger[_0x51a8('0x8')](_0x51a8('0x13'),_0x45a433);logger[_0x51a8('0xb')](_0x51a8('0x13'),_0x45a433,JSON[_0x51a8('0xd')](_0x1c150d));_0x23539e(_0x1c150d);})[_0x51a8('0x12')](function(_0x347a02){logger['error'](_0x51a8('0x13'),_0x347a02['message'],_0x45a433);_0x3bc1a2(_0xd52230[_0x51a8('0xe')](0x1f4,_0x347a02[_0x51a8('0x10')]));});});};exports[_0x51a8('0x1e')]=function(_0x41df56){var _0x2136b4=this;return new Promise(function(_0x4ea271,_0x10c19b){return db['Trunk'][_0x51a8('0x1f')]({'raw':_0x41df56[_0x51a8('0x15')]?_0x41df56[_0x51a8('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x41df56[_0x51a8('0x15')]?_0x41df56['options'][_0x51a8('0x17')]||null:null,'attributes':_0x41df56[_0x51a8('0x15')]?_0x41df56[_0x51a8('0x15')][_0x51a8('0x1c')]||null:null,'include':_0x41df56[_0x51a8('0x15')]?_0x41df56['options'][_0x51a8('0x19')]?_['map'](_0x41df56[_0x51a8('0x15')][_0x51a8('0x19')],function(_0x41561a){return{'model':db[_0x41561a['model']],'as':_0x41561a['as'],'attributes':_0x41561a[_0x51a8('0x1c')],'include':_0x41561a[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x41561a[_0x51a8('0x19')],function(_0x41c020){return{'model':db[_0x41c020['model']],'as':_0x41c020['as'],'attributes':_0x41c020['attributes'],'include':_0x41c020['include']?_[_0x51a8('0x1b')](_0x41c020[_0x51a8('0x19')],function(_0x4ec1db){return{'model':db[_0x4ec1db[_0x51a8('0x1a')]],'as':_0x4ec1db['as'],'attributes':_0x4ec1db['attributes']};}):[]};}):[]};}):[]:[]})[_0x51a8('0x1d')](function(_0x38aa25){logger[_0x51a8('0x8')](_0x51a8('0x1e'),_0x41df56);logger[_0x51a8('0xb')](_0x51a8('0x1e'),_0x41df56,JSON['stringify'](_0x38aa25));_0x4ea271(_0x38aa25);})['catch'](function(_0x377b4c){logger['error']('ShowTrunk',_0x377b4c['message'],_0x41df56);_0x10c19b(_0x2136b4[_0x51a8('0xe')](0x1f4,_0x377b4c[_0x51a8('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/user/index.js b/server/api/user/index.js
index 73e96dd..7c3843e 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 _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
+var _0x972b=['/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','/:id/teams','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','put','update','/:id/password','delete','removeQueues','removeTeams','destroy','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/fax_accounts','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','/:id','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions'];(function(_0x500f2d,_0x293f8d){var _0x222dd7=function(_0x484a05){while(--_0x484a05){_0x500f2d['push'](_0x500f2d['shift']());}};_0x222dd7(++_0x293f8d);}(_0x972b,0xc0));var _0xb972=function(_0x3afb39,_0x1713b5){_0x3afb39=_0x3afb39-0x0;var _0x405d89=_0x972b[_0x3afb39];return _0x405d89;};'use strict';var multer=require(_0xb972('0x0'));var util=require(_0xb972('0x1'));var path=require('path');var timeout=require(_0xb972('0x2'));var express=require(_0xb972('0x3'));var router=express[_0xb972('0x4')]();var auth=require(_0xb972('0x5'));var interaction=require(_0xb972('0x6'));var config=require(_0xb972('0x7'));var controller=require(_0xb972('0x8'));router[_0xb972('0x9')]('/',auth[_0xb972('0xa')](),controller[_0xb972('0xb')]);router[_0xb972('0x9')](_0xb972('0xc'),auth['isAuthenticated'](),controller[_0xb972('0xd')]);router[_0xb972('0x9')](_0xb972('0xe'),auth[_0xb972('0xa')](),controller['whoami']);router['get'](_0xb972('0xf'),auth[_0xb972('0xa')](),controller[_0xb972('0x10')]);router[_0xb972('0x9')](_0xb972('0x11'),controller[_0xb972('0x12')]);router[_0xb972('0x9')](_0xb972('0x13'),auth[_0xb972('0xa')](),controller[_0xb972('0x14')]);router['get'](_0xb972('0x15'),auth[_0xb972('0xa')](),controller[_0xb972('0x16')]);router[_0xb972('0x9')](_0xb972('0x17'),auth[_0xb972('0xa')](),controller[_0xb972('0x18')]);router['get'](_0xb972('0x19'),auth['isAuthenticated'](),controller['getGroups']);router['get'](_0xb972('0x1a'),auth[_0xb972('0xa')](),controller[_0xb972('0x1b')]);router[_0xb972('0x9')](_0xb972('0x1c'),auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0xb972('0x9')]('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0xb972('0x1d')]);router['get'](_0xb972('0x1e'),auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router[_0xb972('0x9')](_0xb972('0x1f'),auth['isAuthenticated'](),controller['getMailInteractions']);router[_0xb972('0x9')]('/:id/sms/interactions',auth[_0xb972('0xa')](),controller['getSmsInteractions']);router[_0xb972('0x9')](_0xb972('0x20'),auth['isAuthenticated'](),controller[_0xb972('0x21')]);router['get']('/:id/whatsapp/interactions',auth[_0xb972('0xa')](),controller[_0xb972('0x22')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xb972('0x23'),auth[_0xb972('0xa')](),controller[_0xb972('0x24')]);router[_0xb972('0x9')](_0xb972('0x25'),auth['isAuthenticated'](),controller[_0xb972('0x26')]);router[_0xb972('0x9')](_0xb972('0x27'),auth['isAuthenticated'](),controller[_0xb972('0x28')]);router[_0xb972('0x9')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xb972('0x29')]);router[_0xb972('0x9')](_0xb972('0x2a'),auth[_0xb972('0xa')](),controller['getMailAccounts']);router[_0xb972('0x9')](_0xb972('0x2b'),auth['isAuthenticated'](),controller[_0xb972('0x2c')]);router[_0xb972('0x9')](_0xb972('0x2d'),auth[_0xb972('0xa')](),controller[_0xb972('0x2e')]);router[_0xb972('0x9')](_0xb972('0x2f'),auth['isAuthenticated'](),controller[_0xb972('0x30')]);router['get'](_0xb972('0x31'),auth['isAuthenticated'](),controller[_0xb972('0x32')]);router[_0xb972('0x9')](_0xb972('0x33'),auth[_0xb972('0xa')](),controller['getSquareProjects']);router[_0xb972('0x9')](_0xb972('0x34'),auth[_0xb972('0xa')](),controller[_0xb972('0x35')]);router['get'](_0xb972('0x36'),auth['isAuthenticated'](),controller[_0xb972('0x37')]);router[_0xb972('0x38')]('/create_many',auth[_0xb972('0xa')](),controller['bulkCreate']);router[_0xb972('0x38')](_0xb972('0x13'),auth[_0xb972('0xa')](),controller[_0xb972('0x39')]);router['post']('/',auth[_0xb972('0xa')](),controller[_0xb972('0x3a')]);router['post']('/:id/queues',auth[_0xb972('0xa')](),controller[_0xb972('0x3b')]);var upload=multer({'storage':multer[_0xb972('0x3c')]({'destination':function(_0x538c79,_0x5827fc,_0xc3bb4b){_0xc3bb4b(null,path[_0xb972('0x3d')](config[_0xb972('0x3e')],_0xb972('0x3f')));},'filename':function(_0x1d56d6,_0x26a0d0,_0x1cfbf7){_0x1cfbf7(null,util[_0xb972('0x40')](_0xb972('0x41'),Date[_0xb972('0x42')](),_0x26a0d0[_0xb972('0x43')]));}})});router[_0xb972('0x38')](_0xb972('0x11'),upload[_0xb972('0x44')]('file'),controller[_0xb972('0x45')]);router[_0xb972('0x38')](_0xb972('0x46'),auth[_0xb972('0xa')](),controller[_0xb972('0x47')]);router[_0xb972('0x38')](_0xb972('0x48'),auth[_0xb972('0xa')](),controller[_0xb972('0x49')]);router['post'](_0xb972('0x4a'),auth[_0xb972('0xa')](),controller[_0xb972('0x4b')]);router[_0xb972('0x38')](_0xb972('0x4c'),auth['isAuthenticated'](),controller['unpause']);router['post'](_0xb972('0x4d'),auth[_0xb972('0xa')](),controller[_0xb972('0x4e')]);router[_0xb972('0x38')](_0xb972('0x4f'),auth[_0xb972('0xa')](),controller['addChatInteractions']);router[_0xb972('0x38')](_0xb972('0x50'),auth[_0xb972('0xa')](),controller[_0xb972('0x51')]);router['post'](_0xb972('0x52'),auth[_0xb972('0xa')](),controller[_0xb972('0x53')]);router[_0xb972('0x38')](_0xb972('0x54'),auth[_0xb972('0xa')](),controller[_0xb972('0x55')]);router['post'](_0xb972('0x56'),auth[_0xb972('0xa')](),controller[_0xb972('0x57')]);router[_0xb972('0x38')](_0xb972('0x58'),auth[_0xb972('0xa')](),controller['addWhatsappInteractions']);router['post']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xb972('0x59')]);router[_0xb972('0x38')](_0xb972('0x2a'),auth[_0xb972('0xa')](),controller[_0xb972('0x5a')]);router[_0xb972('0x38')](_0xb972('0x2b'),auth[_0xb972('0xa')](),controller['addOpenchannelAccounts']);router[_0xb972('0x38')](_0xb972('0x2d'),auth[_0xb972('0xa')](),controller[_0xb972('0x5b')]);router[_0xb972('0x38')](_0xb972('0x2f'),auth['isAuthenticated'](),controller[_0xb972('0x5c')]);router[_0xb972('0x38')](_0xb972('0x31'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0xb972('0x38')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0xb972('0x5d')]);router[_0xb972('0x38')]('/:id/api_key',auth[_0xb972('0xa')](),controller['createApiKey']);router[_0xb972('0x5e')](_0xb972('0xf'),auth[_0xb972('0xa')](),controller[_0xb972('0x5f')]);router[_0xb972('0x5e')](_0xb972('0x60'),auth['isAuthenticated'](),controller['changePassword']);router[_0xb972('0x61')]('/:id/queues',auth[_0xb972('0xa')](),controller[_0xb972('0x62')]);router[_0xb972('0x61')]('/:id/teams',auth[_0xb972('0xa')](),controller[_0xb972('0x63')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb972('0x64')]);router['delete'](_0xb972('0x4f'),auth[_0xb972('0xa')](),controller['removeChatInteractions']);router[_0xb972('0x61')](_0xb972('0x50'),auth[_0xb972('0xa')](),controller['removeMailInteractions']);router[_0xb972('0x61')](_0xb972('0x52'),auth['isAuthenticated'](),controller[_0xb972('0x65')]);router[_0xb972('0x61')](_0xb972('0x54'),auth[_0xb972('0xa')](),controller['removeSmsInteractions']);router[_0xb972('0x61')](_0xb972('0x56'),auth['isAuthenticated'](),controller[_0xb972('0x66')]);router[_0xb972('0x61')](_0xb972('0x58'),auth[_0xb972('0xa')](),controller[_0xb972('0x67')]);router[_0xb972('0x61')](_0xb972('0x68'),auth[_0xb972('0xa')](),controller[_0xb972('0x69')]);router[_0xb972('0x61')]('/:id/mail_accounts',auth[_0xb972('0xa')](),controller['removeMailAccounts']);router[_0xb972('0x61')](_0xb972('0x2b'),auth[_0xb972('0xa')](),controller[_0xb972('0x6a')]);router[_0xb972('0x61')](_0xb972('0x2d'),auth[_0xb972('0xa')](),controller[_0xb972('0x6b')]);router[_0xb972('0x61')](_0xb972('0x2f'),auth[_0xb972('0xa')](),controller[_0xb972('0x6c')]);router['delete'](_0xb972('0x31'),auth[_0xb972('0xa')](),controller[_0xb972('0x6d')]);router[_0xb972('0x61')](_0xb972('0x33'),auth['isAuthenticated'](),controller[_0xb972('0x6e')]);router['delete'](_0xb972('0x36'),auth[_0xb972('0xa')](),controller['removeApiKey']);module[_0xb972('0x6f')]=router;
\ No newline at end of file
diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js
index 54947a5..afdbebd 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 _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
+var _0x7b56=['nonat','update,nonat','showWebBar','get','transport','isArray','wss','encryption','force_avp','dtlsenable','dtlscertfile','dtlsprivatekey','rtcp_mux','avpf','icesupport','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','join','split','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','all','allow','ulaw;alaw;gsm','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','accept','refuse','originate','uac','uas','fingerprint','passive'];(function(_0x52fcbb,_0x374e6b){var _0x2cd70c=function(_0x10f787){while(--_0x10f787){_0x52fcbb['push'](_0x52fcbb['shift']());}};_0x2cd70c(++_0x374e6b);}(_0x7b56,0xc8));var _0x67b5=function(_0x4db3ce,_0x4a722e){_0x4db3ce=_0x4db3ce-0x0;var _0x293191=_0x7b56[_0x4db3ce];return _0x293191;};'use strict';var Sequelize=require(_0x67b5('0x0'));var moment=require(_0x67b5('0x1'));var util=require(_0x67b5('0x2'));var _=require(_0x67b5('0x3'));module['exports']={'name':{'type':Sequelize[_0x67b5('0x4')],'allowNull':![],'unique':_0x67b5('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3f0307){this[_0x67b5('0x6')]('name',_0x3f0307);this['setDataValue'](_0x67b5('0x7'),_0x3f0307);},'comment':_0x67b5('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x534f0a){this['setDataValue']('fullname',_0x534f0a);this['setDataValue'](_0x67b5('0x9'),util[_0x67b5('0xa')]('\x22%s\x22\x20<%s>',_0x534f0a,this[_0x67b5('0xb')](_0x67b5('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x67b5('0x4')],'allowNull':![],'unique':_0x67b5('0xd'),'validate':{'isEmail':!![]},'set':function(_0x2bad09){if(_0x2bad09){this[_0x67b5('0x6')](_0x67b5('0xd'),_0x2bad09[_0x67b5('0xe')]());}}},'role':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x10'),_0x67b5('0x11'),_0x67b5('0x12'),_0x67b5('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x67b5('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x67b5('0x14')},'internal':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':![],'unique':_0x67b5('0xc'),'set':function(_0x394a6e){this[_0x67b5('0x6')](_0x67b5('0xc'),_0x394a6e);this[_0x67b5('0x6')]('accountcode',_0x394a6e);this[_0x67b5('0x6')](_0x67b5('0x9'),util[_0x67b5('0xa')]('\x22%s\x22\x20<%s>',this[_0x67b5('0xb')](_0x67b5('0x16')),_0x394a6e));}},'salt':{'type':Sequelize[_0x67b5('0x4')]},'phone':{'type':Sequelize[_0x67b5('0x4')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x67b5('0x4')]},'zipcode':{'type':Sequelize[_0x67b5('0x4')]},'userpic':{'type':Sequelize[_0x67b5('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x67b5('0x18')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x67b5('0x4')],'defaultValue':_0x67b5('0x19')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x67b5('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x67b5('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x67b5('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x67b5('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x67b5('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x67b5('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![],'defaultValue':_0x67b5('0x1a')},'ipaddr':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x1b'),_0x67b5('0x11'),_0x67b5('0x1c')),'allowNull':!![],'defaultValue':_0x67b5('0x1b')},'context':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x67b5('0xf')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x67b5('0x1d'),'ALLOWED',_0x67b5('0x1e'),'PROHIB_PASSED_SCREEN',_0x67b5('0x1f'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![],'defaultValue':_0x67b5('0x20'),'set':function(_0x122b53){this[_0x67b5('0x6')]('transport',_0x122b53?_0x122b53[_0x67b5('0x21')](','):null);},'get':function(){return this[_0x67b5('0xb')]('transport')?this[_0x67b5('0xb')]('transport')[_0x67b5('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x23'),_0x67b5('0x24'),_0x67b5('0x25'),_0x67b5('0x26'),_0x67b5('0x27')),'allowNull':!![],'defaultValue':_0x67b5('0x23')},'directmedia':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x28'),'no','nonat',_0x67b5('0x29'),_0x67b5('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x67b5('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![],'defaultValue':_0x67b5('0x2b'),'set':function(_0x46fd75){this[_0x67b5('0x6')]('nat',_0x46fd75?_0x46fd75[_0x67b5('0x21')](','):null);},'get':function(){return this[_0x67b5('0xb')](_0x67b5('0x2c'))?this[_0x67b5('0xb')]('nat')[_0x67b5('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x67b5('0x4')]},'pickupgroup':{'type':Sequelize[_0x67b5('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x67b5('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x67b5('0x4')]},'disallow':{'type':Sequelize[_0x67b5('0x4')],'allowNull':![],'defaultValue':_0x67b5('0x2d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x172028){this['setDataValue'](_0x67b5('0x2e'),_0x172028?_0x172028['join'](';'):_0x67b5('0x2f'));},'get':function(){return this[_0x67b5('0xb')](_0x67b5('0x2e'))?this[_0x67b5('0xb')]('allow')[_0x67b5('0x22')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![],'set':function(_0x29ef59){this['setDataValue'](_0x67b5('0x30'),_0x29ef59?_0x29ef59[_0x67b5('0x21')](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0x67b5('0xb')](_0x67b5('0x30'))[_0x67b5('0x22')](','):null;},'comment':_0x67b5('0x31')},'trustrpid':{'type':Sequelize[_0x67b5('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x67b5('0x28'),'no',_0x67b5('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x67b5('0xf')]('yes','no'),'allowNull':!![],'defaultValue':_0x67b5('0x28')},'busylevel':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x67b5('0xf')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x67b5('0xf')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x67b5('0x28'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x28'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x67b5('0x33'),_0x67b5('0x34'),_0x67b5('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x67b5('0x36'),_0x67b5('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x28'),'no'),'allowNull':!![],'defaultValue':_0x67b5('0x28')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x67b5('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x67b5('0xf')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x67b5('0xf')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x28'),'no',_0x67b5('0x38'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x67b5('0x39'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x67b5('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x67b5('0xf')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x67b5('0xf')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x28'),'no',_0x67b5('0x3a'),_0x67b5('0x29'),_0x67b5('0x3b')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x67b5('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4963e5){this[_0x67b5('0x6')](_0x67b5('0x3c'),_0x4963e5);var _0x312b05=this[_0x67b5('0x3d')]({'plain':!![]});switch(_0x4963e5){case 0x0:case 0x1:var _0x30c7f2=_0x312b05[_0x67b5('0x3e')]?_[_0x67b5('0x3f')](_0x312b05[_0x67b5('0x3e')])?_0x312b05[_0x67b5('0x3e')]['join']():_0x312b05[_0x67b5('0x3e')]:_0x67b5('0x20');if(_0x30c7f2===_0x67b5('0x40')){_0x30c7f2=_0x67b5('0x20');}this[_0x67b5('0x6')](_0x67b5('0x3e'),_0x30c7f2);this[_0x67b5('0x6')](_0x67b5('0x41'),'no');this[_0x67b5('0x6')]('avpf',null);this['setDataValue'](_0x67b5('0x42'),null);this[_0x67b5('0x6')]('icesupport',null);this['setDataValue'](_0x67b5('0x43'),null);this[_0x67b5('0x6')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x67b5('0x44'),null);this[_0x67b5('0x6')](_0x67b5('0x45'),null);this[_0x67b5('0x6')](_0x67b5('0x46'),'no');break;case 0x2:this[_0x67b5('0x6')]('transport',_0x67b5('0x40'));this[_0x67b5('0x6')](_0x67b5('0x41'),_0x67b5('0x28'));this[_0x67b5('0x6')](_0x67b5('0x47'),'yes');this[_0x67b5('0x6')](_0x67b5('0x42'),'yes');this[_0x67b5('0x6')](_0x67b5('0x48'),_0x67b5('0x28'));this['setDataValue'](_0x67b5('0x43'),_0x67b5('0x28'));this[_0x67b5('0x6')](_0x67b5('0x49'),'no');this[_0x67b5('0x6')](_0x67b5('0x4a'),_0x67b5('0x4b'));this[_0x67b5('0x6')](_0x67b5('0x44'),_0x312b05[_0x67b5('0x44')]||_0x67b5('0x4c'));this[_0x67b5('0x6')](_0x67b5('0x45'),_0x312b05['dtlsprivatekey']||_0x67b5('0x4d'));this[_0x67b5('0x6')]('rtcp_mux',_0x67b5('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x67b5('0x4e')],'set':function(_0x30c5dd){this[_0x67b5('0x6')](_0x67b5('0x4f'),_0x30c5dd?_0x30c5dd[_0x67b5('0x21')](','):[]);},'get':function(){return this[_0x67b5('0xb')]('permissions')?_['map'](this[_0x67b5('0xb')](_0x67b5('0x4f'))['split'](','),function(_0x27d741){return parseInt(_0x27d741,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x67b5('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x67b5('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x67b5('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x67b5('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x67b5('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x67b5('0xf')](_0x67b5('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x67b5('0x4')]},'passwordResetAt':{'type':Sequelize[_0x67b5('0x18')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x67b5('0xb')](_0x67b5('0x50'))?this['getDataValue'](_0x67b5('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x67b5('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x67b5('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x572b68){if(typeof _0x572b68===_0x67b5('0x51')){var _0x540dc5=_0x572b68==='1'?!![]:_0x572b68==='0'?![]:_0x572b68===_0x67b5('0x52')?!![]:_0x572b68===_0x67b5('0x53')?![]:![];this['setDataValue'](_0x67b5('0x54'),_0x540dc5);}else{this[_0x67b5('0x6')](_0x67b5('0x54'),_0x572b68);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x31a068){this['setDataValue']('blocked',_0x31a068);if(_0x31a068===!![]){this[_0x67b5('0x6')](_0x67b5('0x55'),moment());this['setDataValue']('loginAttempts',0x0);}else{this[_0x67b5('0x6')](_0x67b5('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x67b5('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x67b5('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x67b5('0x17')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js
index 8897785..f67d6bb 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 _0xa070=['User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','all','QueuePause','pause','updateAttributes','getChannels','DEFAULT\x20PAUSE','mailPause','chatPause','faxPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','mail','chat','fax','sms','whatsapp','set','%s%s','Pause','unpause','getTeams','Team','Voice','getChatQueues','setDataValue','Chat','getMailQueues','Mail','getSmsQueues','getWhatsappQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','getDataValue','removeTeams','getFaxQueues','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','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','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','firstName','lastName','Contact','VoiceQueue','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','nonce','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./user.socket','register','jayson/promise','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','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','json','count','offset','limit','apply','reject','save','update','destroy','get','Users','filter','ignore','map','value','role','find','name','UserProfileResource','end','send','User','rawAttributes','fieldName','type','model','differenceBy','keys','query','attributes','intersection','fields','length','sort','where','filters','pick','merge','VIRTUAL','sequelize','col','lower','options','includeAll','show','params','bulkCreate','body','describe','addContacts','ids','omit','agent','telephone','../../config/license/util','getLicense','telephones','isNil','License\x20limit\x20reached','format','create','internal','Setting','findById','min_internal','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)','QueryTypes','SELECT','from','voicemail','mailbox','password','fullname','email','permissions','101','102','103','110','105','107','108','109','100','111','114','VoiceMail','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','Telephones','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','findOne','securePassword','newPassword','authenticate','Wrong\x20credentials','oldPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','admin','Invalid\x20body\x20format.\x20Use\x20newPassword','addQueues','channel','voicePause','interface','isValidChannel','capitalize','toLowerCase','penalty','spread','QueueId','Queue:save','voice','findAll','online','push','SIP/%s','each','UserVoiceQueueRt','upsert','removeQueues','Unknown\x20channel','remove','Queues','emit','addAvatar','getAvatar','root','userpic','download','join','server/files/images/','getContacts','CmContact','order','hasOwnProperty','include','CmList','List','Tag','Tags','color','tag','nolimit','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','rows','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','WhatsappInteraction','getWhatsappInteractions','login','phone','loginInPause','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','x-forwarded-for','remoteAddress','connection','socket'];(function(_0x150ac3,_0x43c78b){var _0x296328=function(_0x3f6cf8){while(--_0x3f6cf8){_0x150ac3['push'](_0x150ac3['shift']());}};_0x296328(++_0x43c78b);}(_0xa070,0x94));var _0x0a07=function(_0x281715,_0x2d0862){_0x281715=_0x281715-0x0;var _0x4f10a1=_0xa070[_0x281715];return _0x4f10a1;};'use strict';var pdf=require(_0x0a07('0x0'));var emlformat=require(_0x0a07('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0a07('0x2'));var jsonpatch=require(_0x0a07('0x3'));var rp=require(_0x0a07('0x4'));var moment=require(_0x0a07('0x5'));var BPromise=require(_0x0a07('0x6'));var Mustache=require(_0x0a07('0x7'));var util=require(_0x0a07('0x8'));var path=require('path');var sox=require(_0x0a07('0x9'));var csv=require(_0x0a07('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0a07('0xb'));var squel=require('squel');var crypto=require(_0x0a07('0xc'));var jsforce=require(_0x0a07('0xd'));var deskjs=require(_0x0a07('0xe'));var toCsv=require(_0x0a07('0xa'));var querystring=require('querystring');var Papa=require(_0x0a07('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0a07('0x10'));var as=require(_0x0a07('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0a07('0x12'))(_0x0a07('0x13'));var utils=require(_0x0a07('0x14'));var config=require(_0x0a07('0x15'));var db=require(_0x0a07('0x16'))['db'];config[_0x0a07('0x17')]=_[_0x0a07('0x18')](config['redis'],{'host':_0x0a07('0x19'),'port':0x18eb});var socket=require(_0x0a07('0x1a'))(new Redis(config[_0x0a07('0x17')]));require(_0x0a07('0x1b'))[_0x0a07('0x1c')](socket);var jayson=require(_0x0a07('0x1d'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x19b7a2,_0xe9a4a3,_0x117c40){if(_0x117c40){var _0x321a15=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x321a15['test'](_0xe9a4a3)){return _0x19b7a2;}else{throw new db[(_0x0a07('0x1e'))][(_0x0a07('0x1f'))](_0x0a07('0x20'));}}else{return _0x19b7a2;}}function respondWithRpcPromise(_0x11f404,_0x5c4959,_0x504ecd,_0x431eba){return new BPromise(function(_0x5cff94,_0x19a8e2){var _0x4f2a9f=_0x431eba||client;return _0x4f2a9f[_0x0a07('0x21')](_0x11f404,_0x504ecd)[_0x0a07('0x22')](function(_0x574745){logger['info'](_0x0a07('0x23'),_0x5c4959,_0x0a07('0x24'));logger[_0x0a07('0x25')](_0x0a07('0x26'),_0x5c4959,'request\x20sent',JSON['stringify'](_0x574745));if(_0x574745[_0x0a07('0x27')]){if(_0x574745[_0x0a07('0x27')][_0x0a07('0x28')]===0x1f4){logger['error'](_0x0a07('0x23'),_0x5c4959,_0x574745[_0x0a07('0x27')][_0x0a07('0x29')]);return _0x19a8e2(_0x574745[_0x0a07('0x27')][_0x0a07('0x29')]);}logger[_0x0a07('0x27')](_0x0a07('0x23'),_0x5c4959,_0x574745[_0x0a07('0x27')]['message']);return _0x5cff94(_0x574745[_0x0a07('0x27')][_0x0a07('0x29')]);}else{logger[_0x0a07('0x2a')](_0x0a07('0x23'),_0x5c4959,_0x0a07('0x24'));_0x5cff94(_0x574745[_0x0a07('0x2b')][_0x0a07('0x29')]);}})[_0x0a07('0x2c')](function(_0x5df87f){logger['error']('User,\x20%s,\x20%s',_0x5c4959,_0x5df87f);_0x19a8e2(_0x5df87f);});});}function respondWithStatusCode(_0x24afe0,_0x57678f){_0x57678f=_0x57678f||0xcc;return function(_0x18471a){if(_0x18471a){return _0x24afe0['sendStatus'](_0x57678f);}return _0x24afe0[_0x0a07('0x2d')](_0x57678f)['end']();};}function respondWithResult(_0x5104de,_0x5176e3){_0x5176e3=_0x5176e3||0xc8;return function(_0xae784f){if(_0xae784f){return _0x5104de[_0x0a07('0x2d')](_0x5176e3)[_0x0a07('0x2e')](_0xae784f);}};}function respondWithFilteredResult(_0x52636e,_0x1821f1){return function(_0x3aeb71){if(_0x3aeb71){var _0x18e127=_0x3aeb71[_0x0a07('0x2f')],_0x134013=_0x1821f1[_0x0a07('0x30')],_0x5c2107=_0x1821f1[_0x0a07('0x30')]+_0x1821f1[_0x0a07('0x31')],_0x3d92b6;if(_0x5c2107>=_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')]=_0x1796f2){_0x2400eb=_0x1796f2;_0x2dc682=0xc8;}else{_0x2dc682=0xce;}_0x110301['status'](_0x2dc682);return _0x110301[_0x9796('0x2e')]('Content-Range',_0x467ed0+'-'+_0x2400eb+'/'+_0x1796f2)[_0x9796('0x2b')](_0x408cb8);}return null;};}function patchUpdates(_0x484d0a){return function(_0x31f450){try{jsonpatch['apply'](_0x31f450,_0x484d0a,!![]);}catch(_0x339cb2){return BPromise[_0x9796('0x2f')](_0x339cb2);}return _0x31f450[_0x9796('0x30')]();};}function saveUpdates(_0x3f2588,_0x3abc57){return function(_0x3c96ff){if(_0x3c96ff){return _0x3c96ff[_0x9796('0x31')](_0x3f2588)[_0x9796('0x32')](function(_0x3ca543){return _0x3ca543;});}return null;};}function removeEntity(_0x344cd8,_0x15c055){return function(_0x1bcfc7){if(_0x1bcfc7){return _0x1bcfc7[_0x9796('0x33')]()[_0x9796('0x32')](function(){var _0x197a32=_0x1bcfc7[_0x9796('0x34')]({'plain':!![]});var _0x7fa85f=[{'name':'Users','value':_0x9796('0x35'),'ignore':!![]},{'name':_0x9796('0x36'),'value':_0x9796('0x37'),'ignore':![]},{'name':_0x9796('0x38'),'value':'telephone','ignore':![]}];var _0x3fe18e=_(_0x7fa85f)['filter'](_0x9796('0x39'))[_0x9796('0x3a')]('value')[_0x9796('0x3b')]();if(_[_0x9796('0x3c')](_0x3fe18e,_0x197a32[_0x9796('0x3d')])){return;}var _0x365da5=_[_0x9796('0x3e')](_0x7fa85f,[_0x9796('0x3b'),_0x197a32[_0x9796('0x3d')]])[_0x9796('0x3f')];return db['UserProfileResource'][_0x9796('0x33')]({'where':{'type':_0x365da5,'resourceId':_0x197a32['id']}})['then'](function(){return _0x1bcfc7;});})[_0x9796('0x32')](function(){_0x344cd8[_0x9796('0x2a')](0xcc)[_0x9796('0x40')]();});}};}function handleEntityNotFound(_0x58c868,_0x1402c8){return function(_0x13ce4d){if(!_0x13ce4d){_0x58c868[_0x9796('0x29')](0x194);}return _0x13ce4d;};}function handleError(_0x10fc94,_0x5d8f65){_0x5d8f65=_0x5d8f65||0x1f4;return function(_0x3321ef){logger[_0x9796('0x25')](_0x3321ef[_0x9796('0x41')]);if(_0x3321ef[_0x9796('0x3f')]){delete _0x3321ef[_0x9796('0x3f')];}_0x10fc94[_0x9796('0x2a')](_0x5d8f65)[_0x9796('0x42')](_0x3321ef);};}exports['index']=function(_0x19e31d,_0x3303b2){var _0x564e79={},_0x4dfc93={},_0x37d409={'count':0x0,'rows':[]};var _0x1d2f2e=_[_0x9796('0x3a')](db['User'][_0x9796('0x43')],function(_0x65202b){return{'name':_0x65202b[_0x9796('0x44')],'type':_0x65202b[_0x9796('0x45')][_0x9796('0x46')]};});_0x4dfc93['model']=_[_0x9796('0x47')](_[_0x9796('0x3a')](_0x1d2f2e,'name'),[_0x9796('0x48'),_0x9796('0x49')]);_0x4dfc93['query']=_['keys'](_0x19e31d[_0x9796('0x4a')]);_0x4dfc93[_0x9796('0x4b')]=_[_0x9796('0x4c')](_0x4dfc93[_0x9796('0x4d')],_0x4dfc93[_0x9796('0x4a')]);_0x564e79[_0x9796('0x4e')]=_[_0x9796('0x4c')](_0x4dfc93[_0x9796('0x4d')],qs['fields'](_0x19e31d[_0x9796('0x4a')][_0x9796('0x4f')]));_0x564e79[_0x9796('0x4e')]=_0x564e79[_0x9796('0x4e')]['length']?_0x564e79[_0x9796('0x4e')]:_0x4dfc93['model'];if(!_0x19e31d[_0x9796('0x4a')][_0x9796('0x50')](_0x9796('0x51'))){_0x564e79[_0x9796('0x52')]=qs[_0x9796('0x52')](_0x19e31d[_0x9796('0x4a')][_0x9796('0x52')]);_0x564e79[_0x9796('0x2d')]=qs[_0x9796('0x2d')](_0x19e31d[_0x9796('0x4a')][_0x9796('0x2d')]);}_0x564e79[_0x9796('0x53')]=qs['sort'](_0x19e31d[_0x9796('0x4a')]['sort']);_0x564e79[_0x9796('0x54')]=qs[_0x9796('0x4b')](_[_0x9796('0x55')](_0x19e31d[_0x9796('0x4a')],_0x4dfc93[_0x9796('0x4b')]),_0x1d2f2e);if(_0x19e31d[_0x9796('0x4a')][_0x9796('0x56')]){_0x564e79[_0x9796('0x54')]=_['merge'](_0x564e79[_0x9796('0x54')],{'$or':_[_0x9796('0x3a')](_0x1d2f2e,function(_0x2ee5f0){if(_0x2ee5f0[_0x9796('0x45')]!=='VIRTUAL'){return db['sequelize'][_0x9796('0x54')](db['sequelize']['fn'](_0x9796('0x57'),db['sequelize'][_0x9796('0x58')](_0x2ee5f0['name'])),{'$like':db[_0x9796('0x59')]['fn'](_0x9796('0x57'),'%'+_0x19e31d[_0x9796('0x4a')][_0x9796('0x56')]+'%')});}})});}_0x564e79=_[_0x9796('0x5a')]({},_0x564e79,_0x19e31d[_0x9796('0x5b')]);var _0x1ac760={'where':_0x564e79[_0x9796('0x54')]};return db[_0x9796('0x5c')][_0x9796('0x2c')](_0x1ac760)[_0x9796('0x32')](function(_0x45b76a){_0x37d409[_0x9796('0x2c')]=_0x45b76a;if(_0x19e31d['query']['includeAll']){_0x564e79[_0x9796('0x5d')]=[{'all':!![]}];}return db[_0x9796('0x5c')]['findAll'](_0x564e79);})['then'](function(_0x17a718){_0x37d409[_0x9796('0x5e')]=_0x17a718;return _0x37d409;})[_0x9796('0x32')](respondWithFilteredResult(_0x3303b2,_0x564e79))['catch'](handleError(_0x3303b2,null));};exports[_0x9796('0x5f')]=function(_0x2b488b,_0x18dc95){var _0x49f7da={'raw':![],'where':{'id':_0x2b488b[_0x9796('0x60')]['id']}},_0x66d42e={};_0x66d42e[_0x9796('0x4d')]=_['differenceBy'](_[_0x9796('0x61')](db[_0x9796('0x5c')][_0x9796('0x43')]),[_0x9796('0x48'),_0x9796('0x49')]);_0x66d42e['query']=_[_0x9796('0x61')](_0x2b488b[_0x9796('0x4a')]);_0x66d42e[_0x9796('0x4b')]=_['intersection'](_0x66d42e[_0x9796('0x4d')],_0x66d42e[_0x9796('0x4a')]);_0x49f7da[_0x9796('0x4e')]=_['intersection'](_0x66d42e['model'],qs['fields'](_0x2b488b[_0x9796('0x4a')]['fields']));_0x49f7da[_0x9796('0x4e')]=_0x49f7da[_0x9796('0x4e')][_0x9796('0x62')]?_0x49f7da[_0x9796('0x4e')]:_0x66d42e['model'];if(_0x2b488b[_0x9796('0x4a')][_0x9796('0x63')]){_0x49f7da[_0x9796('0x5d')]=[{'all':!![]}];}_0x49f7da=_[_0x9796('0x5a')]({},_0x49f7da,_0x2b488b[_0x9796('0x5b')]);return db[_0x9796('0x5c')][_0x9796('0x3e')](_0x49f7da)[_0x9796('0x32')](handleEntityNotFound(_0x18dc95,null))[_0x9796('0x32')](respondWithResult(_0x18dc95,null))['catch'](handleError(_0x18dc95,null));};exports[_0x9796('0x64')]=function(_0x3e6a89,_0x5903c5){return db['User'][_0x9796('0x64')](_0x3e6a89[_0x9796('0x65')],{'raw':![],'individualHooks':!![]})[_0x9796('0x32')](respondWithResult(_0x5903c5,0xc9))[_0x9796('0x28')](handleError(_0x5903c5,null));};exports['update']=function(_0x271ff0,_0x3f7050){if(_0x271ff0[_0x9796('0x65')]['id']){delete _0x271ff0['body']['id'];}delete _0x271ff0[_0x9796('0x65')][_0x9796('0x3d')];return db[_0x9796('0x5c')][_0x9796('0x3e')]({'where':{'id':_0x271ff0[_0x9796('0x60')]['id']}})['then'](handleEntityNotFound(_0x3f7050,null))[_0x9796('0x32')](saveUpdates(_0x271ff0['body'],null))[_0x9796('0x32')](respondWithResult(_0x3f7050,null))[_0x9796('0x28')](handleError(_0x3f7050,null));};exports[_0x9796('0x66')]=function(_0x30ae0f,_0x94c174){return db['User'][_0x9796('0x66')]()[_0x9796('0x32')](respondWithResult(_0x94c174,null))['catch'](handleError(_0x94c174,null));};exports[_0x9796('0x67')]=function(_0x323a05,_0x16fe82,_0x3f2ec1){return db['User'][_0x9796('0x3e')]({'where':{'id':_0x323a05[_0x9796('0x60')]['id']}})[_0x9796('0x32')](handleEntityNotFound(_0x16fe82,null))['then'](function(_0x31c86d){if(_0x31c86d){return _0x31c86d['addContacts'](_0x323a05['body'][_0x9796('0x68')],_['omit'](_0x323a05[_0x9796('0x65')],[_0x9796('0x68'),'id'])||{});}})['then'](respondWithResult(_0x16fe82,null))[_0x9796('0x28')](handleError(_0x16fe82,null));};var getLicense=function(_0x5938c4){return new BPromise(function(_0x355c84,_0x482359){var _0x431197=0x0;_0x5938c4['body'][_0x9796('0x3d')]===_0x9796('0x37')&&_0x355c84(_0x9796('0x69'));return db[_0x9796('0x5c')][_0x9796('0x2c')]({'where':{'$or':[{'role':_0x5938c4[_0x9796('0x65')][_0x9796('0x3d')]===_0x9796('0x6a')?_0x9796('0x6a'):['admin',_0x9796('0x35')]}]}})['then'](function(_0x570118){_0x431197=_0x570118;return require('../../config/license/util')[_0x9796('0x6b')]();})[_0x9796('0x32')](function(_0x5267e5){var _0xe77c95=_0x5938c4[_0x9796('0x65')][_0x9796('0x3d')]===_0x9796('0x6a')?_0x9796('0x6c'):_0x9796('0x6d');if(!_['isNil'](_0x5267e5[_0xe77c95])&&_0x431197>=_0x5267e5[_0xe77c95]){return _0x482359({'message':_0x9796('0x6e')});}return _0x355c84(util[_0x9796('0x6f')](_0x9796('0x70'),_0xe77c95,_0x431197));})['catch'](function(_0x146232){return _0x482359(_0x146232);});});};exports['create']=function(_0x283dbd,_0x1edb72){return getLicense(_0x283dbd)[_0x9796('0x32')](function(_0x3b42c9){if(!_0x283dbd[_0x9796('0x65')][_0x9796('0x71')]){var _0x316772;return db[_0x9796('0x72')][_0x9796('0x73')](0x1)['then'](function(_0xba2b87){return checkPasswordPattern(_0xba2b87,_0x283dbd[_0x9796('0x65')][_0x9796('0x48')],_0xba2b87[_0x9796('0x74')]);})['then'](function(_0x10091b){_0x316772=_0x10091b[_0x9796('0x75')];return db[_0x9796('0x5c')][_0x9796('0x76')](_0x9796('0x71'));})[_0x9796('0x32')](function(_0x1806c3){if(_[_0x9796('0x77')](_0x1806c3)){if(_0x316772){_0x283dbd[_0x9796('0x65')]['internal']=_0x316772;}else{_0x283dbd[_0x9796('0x65')][_0x9796('0x71')]=0x1;}}else{if(_[_0x9796('0x77')](_0x316772)||_0x316772==_0x1806c3){_0x283dbd[_0x9796('0x65')]['internal']=_0x1806c3+0x1;}else if(_0x316772>_0x1806c3){_0x283dbd['body']['internal']=_0x316772;}else{return db[_0x9796('0x59')]['query'](_0x9796('0x78'),{'type':db[_0x9796('0x59')]['QueryTypes']['SELECT']})[_0x9796('0x32')](function(_0x5452bb){if(_0x5452bb&&_0x5452bb[_0x9796('0x62')]){for(var _0x25fe2f=0x0,_0x143d04=_0x5452bb[_0x9796('0x62')];_0x25fe2f<_0x143d04&&_[_0x9796('0x77')](_0x283dbd[_0x9796('0x65')][_0x9796('0x71')]);_0x25fe2f++){if(_0x316772<=_0x5452bb[_0x25fe2f][_0x9796('0x79')]){_0x283dbd[_0x9796('0x65')]['internal']=_0x5452bb[_0x25fe2f][_0x9796('0x79')];}else if(_0x316772>_0x5452bb[_0x25fe2f][_0x9796('0x79')]&&_0x316772<=_0x5452bb[_0x25fe2f]['to']){_0x283dbd[_0x9796('0x65')][_0x9796('0x71')]=_0x316772;}}}if(_['isNil'](_0x283dbd[_0x9796('0x65')]['internal'])){_0x283dbd['body']['internal']=_0x1806c3+0x1;}});}}});}})[_0x9796('0x32')](function(){if(_0x283dbd[_0x9796('0x65')]['voicemail']){_0x283dbd[_0x9796('0x65')][_0x9796('0x7a')]=_0x283dbd['body'][_0x9796('0x71')];_0x283dbd[_0x9796('0x65')][_0x9796('0x7b')]={'mailbox':_0x283dbd['body'][_0x9796('0x71')],'password':_0x283dbd['body'][_0x9796('0x48')],'fullname':_0x283dbd['body']['fullname'],'email':_0x283dbd[_0x9796('0x65')][_0x9796('0x7c')]};}if(_0x283dbd['body']&&_0x283dbd['body']['role']==='agent'){if(!_0x283dbd[_0x9796('0x65')][_0x9796('0x7d')]){_0x283dbd['body']['permissions']=[_0x9796('0x7e'),'102',_0x9796('0x7f'),_0x9796('0x80'),'110',_0x9796('0x81'),_0x9796('0x82'),_0x9796('0x83'),'107','108','109',_0x9796('0x84'),_0x9796('0x85'),_0x9796('0x86')];}}return db['User'][_0x9796('0x87')](_0x283dbd[_0x9796('0x65')],{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0x9796('0x32')](function(_0x2ad22d){if(_0x283dbd[_0x9796('0x65')][_0x9796('0x3d')]===_0x9796('0x35'))return _0x2ad22d;var _0x22ef69=_0x283dbd[_0x9796('0x35')][_0x9796('0x34')]({'plain':!![]});if(!_0x22ef69)throw new Error(_0x9796('0x88'));if(_0x22ef69[_0x9796('0x3d')]===_0x9796('0x35')){var _0x31e623=_0x2ad22d['get']({'plain':!![]});var _0x16110f=[{'name':_0x9796('0x36'),'value':_0x9796('0x37')},{'name':'Telephones','value':_0x9796('0x6a')}];var _0x4e5a32=_[_0x9796('0x3e')](_0x16110f,[_0x9796('0x3b'),_0x31e623['role']])['name'];return db[_0x9796('0x89')][_0x9796('0x3e')]({'where':{'name':_0x4e5a32,'userProfileId':_0x22ef69['userProfileId']},'raw':!![]})[_0x9796('0x32')](function(_0x20949d){if(_0x20949d&&_0x20949d[_0x9796('0x8a')]===0x0){return db[_0x9796('0x8b')][_0x9796('0x87')]({'name':_0x31e623['name'],'resourceId':_0x31e623['id'],'type':_0x20949d[_0x9796('0x3f')],'sectionId':_0x20949d['id']},{})[_0x9796('0x32')](function(){return _0x2ad22d;});}else{return _0x2ad22d;}})[_0x9796('0x28')](function(_0x4c953e){logger['error'](_0x9796('0x8c'),_0x4c953e);throw _0x4c953e;});}return _0x2ad22d;})['then'](respondWithResult(_0x1edb72,0xc9))[_0x9796('0x28')](handleError(_0x1edb72,null));};exports[_0x9796('0x8d')]=function(_0x4bc834,_0x1d88d8,_0x41df08){var _0x19bc93=![];if(_0x4bc834[_0x9796('0x65')]['id']){delete _0x4bc834[_0x9796('0x65')]['id'];}return db[_0x9796('0x72')][_0x9796('0x8e')]({'attributes':['id',_0x9796('0x74')]})[_0x9796('0x32')](function(_0x54b641){_0x19bc93=_0x54b641[_0x9796('0x74')];return db['User'][_0x9796('0x3e')]({'where':{'id':_0x4bc834[_0x9796('0x60')]['id']}});})[_0x9796('0x32')](function(_0x3fb64f){if(_0x3fb64f){if(_0x3fb64f['id']==_0x4bc834[_0x9796('0x35')]['id']){if(!_0x4bc834[_0x9796('0x65')][_0x9796('0x8f')]||!_0x4bc834['body'][_0x9796('0x90')]){throw new db[(_0x9796('0x1d'))][(_0x9796('0x1e'))](_0x9796('0x91'));}if(!_0x3fb64f[_0x9796('0x92')](_0x4bc834[_0x9796('0x65')][_0x9796('0x8f')])){throw new db[(_0x9796('0x1d'))][(_0x9796('0x1e'))](_0x9796('0x93'));}if(_0x4bc834[_0x9796('0x65')][_0x9796('0x8f')]==_0x4bc834[_0x9796('0x65')][_0x9796('0x90')]){throw new db['Sequelize'][(_0x9796('0x1e'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x3fb64f;}else if(_0x4bc834[_0x9796('0x35')][_0x9796('0x3d')]=='admin'){if(!_0x4bc834[_0x9796('0x65')][_0x9796('0x90')]){throw new db[(_0x9796('0x1d'))][(_0x9796('0x1e'))](_0x9796('0x94'));}return _0x3fb64f;}else if(_0x4bc834['user'][_0x9796('0x3d')]==_0x9796('0x35')){if(!_0x4bc834[_0x9796('0x65')][_0x9796('0x90')]){throw new db[(_0x9796('0x1d'))][(_0x9796('0x1e'))](_0x9796('0x94'));}if(_0x3fb64f[_0x9796('0x3d')]!=_0x9796('0x37')){throw new db[(_0x9796('0x1d'))][(_0x9796('0x1e'))](_0x9796('0x95'));}return _0x3fb64f;}else{throw new db[(_0x9796('0x1d'))][(_0x9796('0x1e'))]('Unauthorized');}}return null;})[_0x9796('0x32')](handleEntityNotFound(_0x1d88d8,null))[_0x9796('0x32')](function(_0x252e84){return checkPasswordPattern(_0x252e84,_0x4bc834[_0x9796('0x65')][_0x9796('0x90')],_0x19bc93);})[_0x9796('0x32')](saveUpdates({'password':_0x4bc834['body'][_0x9796('0x90')],'passwordResetAt':_0x4bc834[_0x9796('0x35')]['id']==_0x4bc834[_0x9796('0x60')]['id']?moment():null},null))['then'](respondWithResult(_0x1d88d8,null))[_0x9796('0x28')](handleError(_0x1d88d8,null));};exports['addQueues']=function(_0xac8091,_0x223f3c,_0x2656da){var _0x39978f=_0xac8091[_0x9796('0x65')][_0x9796('0x96')];return db['User'][_0x9796('0x3e')]({'where':{'id':_0xac8091[_0x9796('0x60')]['id']},'attributes':['id',_0x9796('0x3f'),'role',_0x9796('0x97'),_0x9796('0x98'),_0x9796('0x99'),_0x9796('0x9a')]})[_0x9796('0x32')](handleEntityNotFound(_0x223f3c,null))[_0x9796('0x32')](function(_0x277841){if(_0x277841){if(!utils[_0x9796('0x9b')](_0x39978f)){throw new db[(_0x9796('0x1d'))][(_0x9796('0x1e'))]('Unknown\x20channel');}return _0x277841[_0x9796('0x9c')+_['capitalize'](_0x39978f[_0x9796('0x9d')]())+_0x9796('0x9e')](_0xac8091['body']['ids'],{'penalty':_0xac8091['body']['penalty']||0x0})[_0x9796('0x9f')](function(_0x2c63af){for(var _0x585672=0x0;_0x585672<_0xac8091['body'][_0x9796('0x68')][_0x9796('0x62')];_0x585672+=0x1){var _0x3a0d1c={'UserId':_0xac8091['params']['id']};_0x3a0d1c[_[_0x9796('0xa0')](_0x39978f['toLowerCase']())+'QueueId']=_0xac8091[_0x9796('0x65')][_0x9796('0x68')][_0x585672];socket[_0x9796('0xa1')](_0x9796('0x35')+_['capitalize'](_0x39978f[_0x9796('0x9d')]())+_0x9796('0xa2'),_0x3a0d1c);}return _0x2c63af;})['then'](function(){if(_0x39978f===_0x9796('0xa3')){return db[_0x9796('0xa4')]['findAll']({'where':{'id':_0xac8091['body'][_0x9796('0x68')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x9796('0x32')](function(_0x4c23e4){var _0x3428a8=_0x277841[_0x9796('0x34')]({'plain':!![]});var _0x1fc20d=[];if(_0x39978f===_0x9796('0xa3')&&_0x3428a8[_0x9796('0x3d')]===_0x9796('0x37')&&_0x3428a8[_0x9796('0x97')]){for(var _0x5f5900=0x0;_0x5f5900<_0x4c23e4[_0x9796('0x62')];_0x5f5900+=0x1){_0x1fc20d[_0x9796('0xa5')]({'membername':_0x3428a8[_0x9796('0x3f')],'UserId':_0x3428a8['id'],'queue_name':_0x4c23e4[_0x5f5900]['name'],'VoiceQueueId':_0x4c23e4[_0x5f5900]['id'],'interface':_[_0x9796('0x77')](_0x3428a8['interface'])?util[_0x9796('0x6f')](_0x9796('0xa6'),_0x3428a8[_0x9796('0x3f')]):_0x3428a8['interface'],'paused':_0x3428a8[_0x9796('0x99')]||![],'penalty':_0xac8091['body'][_0x9796('0xa7')]||0x0});}return BPromise[_0x9796('0xa8')](_0x1fc20d,function(_0x46adf1){return db[_0x9796('0xa9')][_0x9796('0xaa')](_0x46adf1);});}return _0x277841;});}})[_0x9796('0x32')](respondWithStatusCode(_0x223f3c,null))[_0x9796('0x28')](handleError(_0x223f3c,null));};exports[_0x9796('0xab')]=function(_0x407f3c,_0x40b014,_0x129306){var _0x2808ea;return db[_0x9796('0x5c')][_0x9796('0x3e')]({'where':{'id':_0x407f3c['params']['id']},'attributes':['id',_0x9796('0x3f'),'role']})['then'](handleEntityNotFound(_0x40b014,null))[_0x9796('0x32')](function(_0x56ac78){if(_0x56ac78){_0x2808ea=_0x56ac78;if(!_0x407f3c[_0x9796('0x4a')][_0x9796('0x96')]||!utils[_0x9796('0x9b')](_0x407f3c[_0x9796('0x4a')][_0x9796('0x96')])){throw new db[(_0x9796('0x1d'))]['ValidationError']('Unknown\x20channel');}return _0x56ac78[_0x9796('0xac')+_[_0x9796('0xa0')](_0x407f3c[_0x9796('0x4a')][_0x9796('0x96')][_0x9796('0x9d')]())+_0x9796('0x9e')](_0x407f3c[_0x9796('0x4a')][_0x9796('0x68')]);}})[_0x9796('0x32')](function(_0x571b94){for(var _0x4212f5=0x0;_0x4212f5<_0x407f3c[_0x9796('0x4a')][_0x9796('0x68')]['length'];_0x4212f5+=0x1){var _0x4f0d72={'UserId':_0x407f3c[_0x9796('0x60')]['id']};_0x4f0d72[_[_0x9796('0xa0')](_0x407f3c[_0x9796('0x4a')]['channel'][_0x9796('0x9d')]())+_0x9796('0xad')]=_0x407f3c['query'][_0x9796('0x68')][_0x4212f5];socket[_0x9796('0xa1')](_0x9796('0x35')+_[_0x9796('0xa0')](_0x407f3c['query'][_0x9796('0x96')][_0x9796('0x9d')]())+_0x9796('0xae'),_0x4f0d72);}return _0x571b94;})[_0x9796('0x32')](function(){if(_0x407f3c[_0x9796('0x4a')][_0x9796('0x96')]===_0x9796('0xa3')){return db[_0x9796('0xa9')]['destroy']({'where':{'UserId':_0x407f3c[_0x9796('0x60')]['id'],'VoiceQueueId':_0x407f3c[_0x9796('0x4a')][_0x9796('0x68')]},'individualHooks':!![]})[_0x9796('0x32')](function(){return _0x2808ea;});}return _0x2808ea;})[_0x9796('0x32')](respondWithStatusCode(_0x40b014,null))[_0x9796('0x28')](handleError(_0x40b014,null));};exports[_0x9796('0xaf')]=function(_0x4a486b,_0x2e2326,_0x583aaa){_0x4a486b[_0x9796('0x65')][_0x9796('0xb0')]=_0x4a486b[_0x9796('0xb1')][_0x9796('0xb2')];return db[_0x9796('0x5c')][_0x9796('0x3e')]({'where':{'id':_0x4a486b[_0x9796('0x60')]['id']}})[_0x9796('0x32')](handleEntityNotFound(_0x2e2326,null))[_0x9796('0x32')](saveUpdates(_0x4a486b[_0x9796('0x65')],null))[_0x9796('0x32')](respondWithResult(_0x2e2326,null))[_0x9796('0x28')](handleError(_0x2e2326,null));};exports[_0x9796('0xb3')]=function(_0x430fc2,_0x35a6c6,_0x1184fb){var _0x2edd86=path[_0x9796('0xb4')](config[_0x9796('0xb5')],_0x9796('0xb6'));return db[_0x9796('0x5c')]['find']({'where':{'id':_0x430fc2[_0x9796('0x60')]['id']},'attributes':['id',_0x9796('0xb0')],'raw':!![]})[_0x9796('0x32')](handleEntityNotFound(_0x35a6c6,null))['then'](function(_0x4c65d2){if(_0x4c65d2){if(_[_0x9796('0x77')](_0x4c65d2[_0x9796('0xb0')])){return _0x35a6c6[_0x9796('0xb7')](_0x2edd86);}else{if(!fs[_0x9796('0xb8')](path['join'](config['root'],_0x9796('0xb9'),_0x4c65d2[_0x9796('0xb0')]))){return _0x35a6c6[_0x9796('0xb7')](_0x2edd86);}return _0x35a6c6[_0x9796('0xb7')](path['join'](config['root'],'server/files/images/',_0x4c65d2[_0x9796('0xb0')]));}}})[_0x9796('0x28')](handleError(_0x35a6c6,null));};exports[_0x9796('0xba')]=function(_0x150bf6,_0x4269ac,_0x472eb7){var _0x1e4809={};var _0x6c8de3={};var _0x54af15;var _0x5ce7ba;return db['User']['findOne']({'where':{'id':_0x150bf6[_0x9796('0x60')]['id']}})[_0x9796('0x32')](handleEntityNotFound(_0x4269ac,null))[_0x9796('0x32')](function(_0x4bf175){if(_0x4bf175){_0x54af15=_0x4bf175;_0x6c8de3['model']=_[_0x9796('0x61')](db[_0x9796('0xbb')]['rawAttributes']);_0x6c8de3[_0x9796('0x4a')]=_['keys'](_0x150bf6[_0x9796('0x4a')]);_0x6c8de3['filters']=_[_0x9796('0x4c')](_0x6c8de3[_0x9796('0x4d')],_0x6c8de3[_0x9796('0x4a')]);_0x1e4809[_0x9796('0x4e')]=_['intersection'](_0x6c8de3[_0x9796('0x4d')],qs[_0x9796('0x4f')](_0x150bf6[_0x9796('0x4a')][_0x9796('0x4f')]));_0x1e4809[_0x9796('0x4e')]=_0x1e4809[_0x9796('0x4e')][_0x9796('0x62')]?_0x1e4809[_0x9796('0x4e')]:_0x6c8de3[_0x9796('0x4d')];_0x1e4809[_0x9796('0x53')]=qs['sort'](_0x150bf6[_0x9796('0x4a')][_0x9796('0xbc')]);_0x1e4809[_0x9796('0x54')]=qs[_0x9796('0x4b')](_[_0x9796('0x55')](_0x150bf6[_0x9796('0x4a')],_0x6c8de3['filters']));if(_0x150bf6[_0x9796('0x4a')][_0x9796('0x56')]){_0x1e4809[_0x9796('0x54')]=_[_0x9796('0x5a')](_0x1e4809['where'],{'$or':_[_0x9796('0x3a')](_0x1e4809[_0x9796('0x4e')],function(_0x2ad06c){var _0xd23475={};_0xd23475[_0x2ad06c]={'$like':'%'+_0x150bf6[_0x9796('0x4a')]['filter']+'%'};return _0xd23475;})});}_0x1e4809=_['merge']({},_0x1e4809,_0x150bf6[_0x9796('0x5b')]);return _0x54af15[_0x9796('0xba')](_0x1e4809);}})[_0x9796('0x32')](function(_0x36b880){if(_0x36b880){_0x5ce7ba=_0x36b880['length'];if(_0x150bf6['query'][_0x9796('0x50')](_0x9796('0x63'))){_0x1e4809[_0x9796('0x5d')]=[{'model':db[_0x9796('0xbd')],'as':'List','required':![]},{'model':db[_0x9796('0xbe')],'as':_0x9796('0xbf'),'attributes':['id',_0x9796('0x3f'),'color'],'where':_0x150bf6[_0x9796('0x4a')]['tag']?{'id':_0x150bf6[_0x9796('0x4a')][_0x9796('0xc0')]}:undefined,'required':_0x150bf6[_0x9796('0x4a')][_0x9796('0xc0')]?!![]:![]}];}if(!_0x150bf6[_0x9796('0x4a')][_0x9796('0x50')](_0x9796('0x51'))){_0x1e4809[_0x9796('0x52')]=qs['limit'](_0x150bf6[_0x9796('0x4a')][_0x9796('0x52')]);_0x1e4809[_0x9796('0x2d')]=qs[_0x9796('0x2d')](_0x150bf6[_0x9796('0x4a')]['offset']);}return _0x54af15[_0x9796('0xba')](_0x1e4809);}})[_0x9796('0x32')](function(_0x4120d7){if(_0x4120d7){return _0x4120d7?{'count':_0x5ce7ba,'rows':_0x4120d7}:null;}})[_0x9796('0x32')](respondWithResult(_0x4269ac,null))['catch'](handleError(_0x4269ac,null));};exports[_0x9796('0xc1')]=function(_0xe29425,_0x5a4118,_0x275fa1){var _0x94d397;var _0x9ae2a4;var _0x3d4738={};var _0x40e20e;return db[_0x9796('0x5c')][_0x9796('0x8e')]({'where':{'id':_0xe29425[_0x9796('0x60')]['id']},'attributes':['id',_0x9796('0x3f'),_0x9796('0x3d')]})['then'](handleEntityNotFound(_0x5a4118,null))[_0x9796('0x32')](function(_0x3a7483){if(!utils[_0x9796('0x9b')](_0xe29425['query'][_0x9796('0x96')])){throw new db[(_0x9796('0x1d'))]['ValidationError'](_0x9796('0xc2'));}_0x94d397=_0x3a7483;var _0xd97c41={};_0xd97c41['model']=_[_0x9796('0x61')](db[_[_0x9796('0xa0')](_0xe29425[_0x9796('0x4a')][_0x9796('0x96')])+_0x9796('0xc3')][_0x9796('0x43')]);_0xd97c41['query']=_[_0x9796('0x61')](_0xe29425[_0x9796('0x4a')]);_0xd97c41[_0x9796('0x4b')]=_['intersection'](_0xd97c41[_0x9796('0x4d')],_0xd97c41[_0x9796('0x4a')]);_0x3d4738[_0x9796('0x4e')]=_[_0x9796('0x4c')](_0xd97c41[_0x9796('0x4d')],qs[_0x9796('0x4f')](_0xe29425[_0x9796('0x4a')][_0x9796('0x4f')]));_0x3d4738[_0x9796('0x4e')]=_0x3d4738[_0x9796('0x4e')][_0x9796('0x62')]?_0x3d4738['attributes']:_0xd97c41[_0x9796('0x4d')];_0x3d4738[_0x9796('0x53')]=qs['sort'](_0xe29425[_0x9796('0x4a')][_0x9796('0xbc')]);_0x3d4738[_0x9796('0x54')]=qs['filters'](_[_0x9796('0x55')](_0xe29425[_0x9796('0x4a')],_0xd97c41[_0x9796('0x4b')]));if(_0xe29425[_0x9796('0x4a')][_0x9796('0x56')]){_0x3d4738[_0x9796('0x54')]=_[_0x9796('0x5a')](_0x3d4738[_0x9796('0x54')],{'$or':_[_0x9796('0x3a')](_0x3d4738[_0x9796('0x4e')],function(_0x151cf0){var _0x312afd={};_0x312afd[_0x151cf0]={'$like':'%'+_0xe29425[_0x9796('0x4a')]['filter']+'%'};return _0x312afd;})});}_0x3d4738=_[_0x9796('0x5a')]({},_0x3d4738,_0xe29425[_0x9796('0x5b')]);switch(_0x94d397['role']){case'admin':return db[_['capitalize'](_0xe29425[_0x9796('0x4a')][_0x9796('0x96')])+'Queue']['findAll'](_0x3d4738);case'user':case _0x9796('0x37'):return _0x94d397[_0x9796('0x34')+_[_0x9796('0xa0')](_0xe29425[_0x9796('0x4a')][_0x9796('0x96')])+'Queues'](_0x3d4738);default:throw new db[(_0x9796('0x1d'))][(_0x9796('0x1e'))](_0x9796('0xc4'));}})[_0x9796('0x32')](function(_0x329d6a){_0x40e20e=_0x329d6a[_0x9796('0x62')];if(!_0xe29425['query'][_0x9796('0x50')](_0x9796('0x51'))){_0x3d4738[_0x9796('0x52')]=qs[_0x9796('0x52')](_0xe29425[_0x9796('0x4a')][_0x9796('0x52')]);_0x3d4738[_0x9796('0x2d')]=qs[_0x9796('0x2d')](_0xe29425[_0x9796('0x4a')][_0x9796('0x2d')]);}switch(_0x94d397['role']){case _0x9796('0xc5'):return db[_['capitalize'](_0xe29425['query'][_0x9796('0x96')])+_0x9796('0xc3')][_0x9796('0xc6')](_0x3d4738);case'user':case _0x9796('0x37'):return _0x94d397['get'+_['capitalize'](_0xe29425[_0x9796('0x4a')]['channel'])+'Queues'](_0x3d4738);}})['then'](function(_0x4d6d7b){return{'count':_0x40e20e,'rows':_0x4d6d7b};})[_0x9796('0x32')](respondWithResult(_0x5a4118,null))[_0x9796('0x28')](handleError(_0x5a4118,null));};exports['getVoiceQueuesRt']=function(_0x5a7b18,_0x21e83c,_0x1882c0){var _0x528549={};var _0x591cd8={};var _0x5d8fca;var _0x2e2e86;return db[_0x9796('0x5c')][_0x9796('0x8e')]({'where':{'id':_0x5a7b18[_0x9796('0x60')]['id']}})[_0x9796('0x32')](handleEntityNotFound(_0x21e83c,null))[_0x9796('0x32')](function(_0x4c61ab){if(_0x4c61ab){_0x5d8fca=_0x4c61ab;_0x591cd8[_0x9796('0x4d')]=_[_0x9796('0x61')](db[_0x9796('0xa9')][_0x9796('0x43')]);_0x591cd8[_0x9796('0x4a')]=_[_0x9796('0x61')](_0x5a7b18[_0x9796('0x4a')]);_0x591cd8['filters']=_[_0x9796('0x4c')](_0x591cd8[_0x9796('0x4d')],_0x591cd8['query']);_0x528549['attributes']=_[_0x9796('0x4c')](_0x591cd8[_0x9796('0x4d')],qs['fields'](_0x5a7b18[_0x9796('0x4a')][_0x9796('0x4f')]));_0x528549[_0x9796('0x4e')]=_0x528549['attributes']['length']?_0x528549[_0x9796('0x4e')]:_0x591cd8[_0x9796('0x4d')];_0x528549[_0x9796('0x53')]=qs[_0x9796('0xbc')](_0x5a7b18[_0x9796('0x4a')][_0x9796('0xbc')]);_0x528549[_0x9796('0x54')]=qs['filters'](_['pick'](_0x5a7b18['query'],_0x591cd8[_0x9796('0x4b')]));if(_0x5a7b18[_0x9796('0x4a')][_0x9796('0x56')]){_0x528549[_0x9796('0x54')]=_['merge'](_0x528549[_0x9796('0x54')],{'$or':_[_0x9796('0x3a')](_0x528549[_0x9796('0x4e')],function(_0x10f1c1){var _0x93c431={};_0x93c431[_0x10f1c1]={'$like':'%'+_0x5a7b18['query']['filter']+'%'};return _0x93c431;})});}_0x528549=_[_0x9796('0x5a')]({},_0x528549,_0x5a7b18[_0x9796('0x5b')]);return _0x5d8fca[_0x9796('0xc7')](_0x528549);}})[_0x9796('0x32')](function(_0x53eae3){if(_0x53eae3){_0x2e2e86=_0x53eae3[_0x9796('0x62')];if(!_0x5a7b18[_0x9796('0x4a')][_0x9796('0x50')](_0x9796('0x51'))){_0x528549[_0x9796('0x52')]=qs[_0x9796('0x52')](_0x5a7b18[_0x9796('0x4a')][_0x9796('0x52')]);_0x528549[_0x9796('0x2d')]=qs[_0x9796('0x2d')](_0x5a7b18[_0x9796('0x4a')][_0x9796('0x2d')]);}return _0x5d8fca[_0x9796('0xc7')](_0x528549);}})['then'](function(_0xa936ce){if(_0xa936ce){return _0xa936ce?{'count':_0x2e2e86,'rows':_0xa936ce}:null;}})[_0x9796('0x32')](respondWithResult(_0x21e83c,null))['catch'](handleError(_0x21e83c,null));};exports[_0x9796('0xc8')]=function(_0x254851,_0x19135f,_0x36564f){var _0x1bfab7={};var _0xfa99cb={};var _0x37d730;var _0x411895;return db[_0x9796('0x5c')][_0x9796('0x8e')]({'where':{'id':_0x254851[_0x9796('0x60')]['id']}})[_0x9796('0x32')](handleEntityNotFound(_0x19135f,null))[_0x9796('0x32')](function(_0x251fed){if(_0x251fed){_0x37d730=_0x251fed;_0xfa99cb[_0x9796('0x4d')]=_[_0x9796('0x61')](db[_0x9796('0xc9')]['rawAttributes']);_0xfa99cb[_0x9796('0x4a')]=_['keys'](_0x254851[_0x9796('0x4a')]);_0xfa99cb[_0x9796('0x4b')]=_[_0x9796('0x4c')](_0xfa99cb['model'],_0xfa99cb['query']);_0x1bfab7['attributes']=_[_0x9796('0x4c')](_0xfa99cb[_0x9796('0x4d')],qs[_0x9796('0x4f')](_0x254851['query'][_0x9796('0x4f')]));_0x1bfab7[_0x9796('0x4e')]=_0x1bfab7[_0x9796('0x4e')][_0x9796('0x62')]?_0x1bfab7[_0x9796('0x4e')]:_0xfa99cb['model'];_0x1bfab7[_0x9796('0x53')]=qs[_0x9796('0xbc')](_0x254851['query'][_0x9796('0xbc')]);_0x1bfab7[_0x9796('0x54')]=qs[_0x9796('0x4b')](_[_0x9796('0x55')](_0x254851[_0x9796('0x4a')],_0xfa99cb[_0x9796('0x4b')]));if(_0x254851[_0x9796('0x4a')][_0x9796('0x56')]){_0x1bfab7[_0x9796('0x54')]=_[_0x9796('0x5a')](_0x1bfab7['where'],{'$or':_[_0x9796('0x3a')](_0x1bfab7[_0x9796('0x4e')],function(_0x190574){var _0x506344={};_0x506344[_0x190574]={'$like':'%'+_0x254851[_0x9796('0x4a')][_0x9796('0x56')]+'%'};return _0x506344;})});}_0x1bfab7=_[_0x9796('0x5a')]({},_0x1bfab7,_0x254851[_0x9796('0x5b')]);return _0x37d730[_0x9796('0xc8')](_0x1bfab7);}})[_0x9796('0x32')](function(_0x15ec06){if(_0x15ec06){_0x411895=_0x15ec06[_0x9796('0x62')];if(!_0x254851['query'][_0x9796('0x50')](_0x9796('0x51'))){_0x1bfab7[_0x9796('0x52')]=qs[_0x9796('0x52')](_0x254851[_0x9796('0x4a')][_0x9796('0x52')]);_0x1bfab7['offset']=qs[_0x9796('0x2d')](_0x254851[_0x9796('0x4a')]['offset']);}return _0x37d730[_0x9796('0xc8')](_0x1bfab7);}})[_0x9796('0x32')](function(_0x379f4b){if(_0x379f4b){return _0x379f4b?{'count':_0x411895,'rows':_0x379f4b}:null;}})[_0x9796('0x32')](respondWithResult(_0x19135f,null))[_0x9796('0x28')](handleError(_0x19135f,null));};exports[_0x9796('0xca')]=function(_0x4a7c68,_0x85d03e,_0x517f30){var _0x1c28de={'raw':!![],'where':{}};var _0x54b01f={};var _0x383ee1={'count':0x0,'rows':[]};return db[_0x9796('0x5c')]['findOne']({'where':{'id':_0x4a7c68[_0x9796('0x60')]['id']}})['then'](handleEntityNotFound(_0x85d03e,null))[_0x9796('0x32')](function(_0x196d51){if(_0x196d51){_0x54b01f[_0x9796('0x4d')]=_[_0x9796('0x61')](db[_0x9796('0xcb')][_0x9796('0x43')]);_0x54b01f[_0x9796('0x4a')]=_[_0x9796('0x61')](_0x4a7c68[_0x9796('0x4a')]);_0x54b01f['filters']=_[_0x9796('0x4c')](_0x54b01f[_0x9796('0x4d')],_0x54b01f['query']);_0x1c28de[_0x9796('0x4e')]=_[_0x9796('0x4c')](_0x54b01f[_0x9796('0x4d')],qs[_0x9796('0x4f')](_0x4a7c68[_0x9796('0x4a')]['fields']));_0x1c28de['attributes']=_0x1c28de[_0x9796('0x4e')]['length']?_0x1c28de[_0x9796('0x4e')]:_0x54b01f[_0x9796('0x4d')];if(!_0x4a7c68[_0x9796('0x4a')][_0x9796('0x50')](_0x9796('0x51'))){_0x1c28de[_0x9796('0x52')]=qs[_0x9796('0x52')](_0x4a7c68[_0x9796('0x4a')][_0x9796('0x52')]);_0x1c28de['offset']=qs['offset'](_0x4a7c68['query']['offset']);}_0x1c28de[_0x9796('0x53')]=qs[_0x9796('0xbc')](_0x4a7c68[_0x9796('0x4a')][_0x9796('0xbc')]);_0x1c28de[_0x9796('0x54')]=qs[_0x9796('0x4b')](_[_0x9796('0x55')](_0x4a7c68['query'],_0x54b01f[_0x9796('0x4b')]));_0x1c28de[_0x9796('0x54')][_0x9796('0xcc')]=_0x196d51['id'];if(_0x4a7c68[_0x9796('0x4a')][_0x9796('0x56')]){_0x1c28de[_0x9796('0x54')]=_[_0x9796('0x5a')](_0x1c28de[_0x9796('0x54')],{'$or':_[_0x9796('0x3a')](_0x1c28de[_0x9796('0x4e')],function(_0x3abaee){var _0x2048ac={};_0x2048ac[_0x3abaee]={'$like':'%'+_0x4a7c68[_0x9796('0x4a')][_0x9796('0x56')]+'%'};return _0x2048ac;})});}_0x1c28de=_[_0x9796('0x5a')]({},_0x1c28de,_0x4a7c68[_0x9796('0x5b')]);return db[_0x9796('0xcb')]['count']({'where':_0x1c28de['where']})[_0x9796('0x32')](function(_0x2b5964){_0x383ee1[_0x9796('0x2c')]=_0x2b5964;if(_0x4a7c68[_0x9796('0x4a')][_0x9796('0x63')]){_0x1c28de[_0x9796('0x5d')]=[{'all':!![]}];}return db[_0x9796('0xcb')][_0x9796('0xc6')](_0x1c28de);})[_0x9796('0x32')](function(_0x58727b){_0x383ee1[_0x9796('0x5e')]=_0x58727b;return _0x383ee1;});}})[_0x9796('0x32')](respondWithFilteredResult(_0x85d03e,_0x1c28de))[_0x9796('0x28')](handleError(_0x85d03e,null));};exports[_0x9796('0xcd')]=function(_0x254fed,_0x1ed38e,_0x3d4590){var _0x4bfd2b={'raw':!![],'where':{}};var _0x51a0dc={};var _0x26d755={'count':0x0,'rows':[]};return db[_0x9796('0x5c')]['findOne']({'where':{'id':_0x254fed[_0x9796('0x60')]['id']}})[_0x9796('0x32')](handleEntityNotFound(_0x1ed38e,null))[_0x9796('0x32')](function(_0x3f99c1){if(_0x3f99c1){_0x51a0dc['model']=_[_0x9796('0x61')](db[_0x9796('0xce')][_0x9796('0x43')]);_0x51a0dc[_0x9796('0x4a')]=_[_0x9796('0x61')](_0x254fed[_0x9796('0x4a')]);_0x51a0dc[_0x9796('0x4b')]=_[_0x9796('0x4c')](_0x51a0dc[_0x9796('0x4d')],_0x51a0dc['query']);_0x4bfd2b[_0x9796('0x4e')]=_[_0x9796('0x4c')](_0x51a0dc['model'],qs['fields'](_0x254fed[_0x9796('0x4a')][_0x9796('0x4f')]));_0x4bfd2b[_0x9796('0x4e')]=_0x4bfd2b[_0x9796('0x4e')][_0x9796('0x62')]?_0x4bfd2b[_0x9796('0x4e')]:_0x51a0dc[_0x9796('0x4d')];if(!_0x254fed[_0x9796('0x4a')][_0x9796('0x50')](_0x9796('0x51'))){_0x4bfd2b[_0x9796('0x52')]=qs[_0x9796('0x52')](_0x254fed[_0x9796('0x4a')][_0x9796('0x52')]);_0x4bfd2b[_0x9796('0x2d')]=qs[_0x9796('0x2d')](_0x254fed[_0x9796('0x4a')][_0x9796('0x2d')]);}_0x4bfd2b['order']=qs[_0x9796('0xbc')](_0x254fed[_0x9796('0x4a')][_0x9796('0xbc')]);_0x4bfd2b[_0x9796('0x54')]=qs[_0x9796('0x4b')](_[_0x9796('0x55')](_0x254fed['query'],_0x51a0dc[_0x9796('0x4b')]));_0x4bfd2b[_0x9796('0x54')][_0x9796('0xcc')]=_0x3f99c1['id'];if(_0x254fed[_0x9796('0x4a')][_0x9796('0x56')]){_0x4bfd2b[_0x9796('0x54')]=_[_0x9796('0x5a')](_0x4bfd2b[_0x9796('0x54')],{'$or':_[_0x9796('0x3a')](_0x4bfd2b[_0x9796('0x4e')],function(_0x22824a){var _0x1b33f4={};_0x1b33f4[_0x22824a]={'$like':'%'+_0x254fed[_0x9796('0x4a')][_0x9796('0x56')]+'%'};return _0x1b33f4;})});}_0x4bfd2b=_[_0x9796('0x5a')]({},_0x4bfd2b,_0x254fed[_0x9796('0x5b')]);return db['ScreenRecording']['count']({'where':_0x4bfd2b['where']})[_0x9796('0x32')](function(_0xca00ea){_0x26d755['count']=_0xca00ea;if(_0x254fed['query'][_0x9796('0x63')]){_0x4bfd2b['include']=[{'all':!![]}];}return db[_0x9796('0xce')]['findAll'](_0x4bfd2b);})['then'](function(_0x4eea46){_0x26d755[_0x9796('0x5e')]=_0x4eea46;return _0x26d755;});}})[_0x9796('0x32')](respondWithFilteredResult(_0x1ed38e,_0x4bfd2b))[_0x9796('0x28')](handleError(_0x1ed38e,null));};exports[_0x9796('0xcf')]=function(_0x83757b,_0x16a55a,_0x48de23){var _0x2f15fa={};var _0x1f6740={};var _0x4c3a34;var _0x5f3d78;return db['User'][_0x9796('0x8e')]({'where':{'id':_0x83757b[_0x9796('0x60')]['id']}})[_0x9796('0x32')](handleEntityNotFound(_0x16a55a,null))[_0x9796('0x32')](function(_0x215fe0){if(_0x215fe0){_0x4c3a34=_0x215fe0;_0x1f6740['model']=_[_0x9796('0x61')](db['ChatInteraction']['rawAttributes']);_0x1f6740[_0x9796('0x4a')]=_[_0x9796('0x61')](_0x83757b[_0x9796('0x4a')]);_0x1f6740[_0x9796('0x4b')]=_[_0x9796('0x4c')](_0x1f6740['model'],_0x1f6740[_0x9796('0x4a')]);_0x2f15fa['attributes']=_['intersection'](_0x1f6740[_0x9796('0x4d')],qs['fields'](_0x83757b[_0x9796('0x4a')]['fields']));_0x2f15fa[_0x9796('0x4e')]=_0x2f15fa[_0x9796('0x4e')][_0x9796('0x62')]?_0x2f15fa[_0x9796('0x4e')]:_0x1f6740[_0x9796('0x4d')];_0x2f15fa[_0x9796('0x53')]=qs[_0x9796('0xbc')](_0x83757b[_0x9796('0x4a')]['sort']);_0x2f15fa[_0x9796('0x54')]=qs[_0x9796('0x4b')](_['pick'](_0x83757b[_0x9796('0x4a')],_0x1f6740[_0x9796('0x4b')]));if(_0x83757b[_0x9796('0x4a')][_0x9796('0x56')]){_0x2f15fa[_0x9796('0x54')]=_['merge'](_0x2f15fa[_0x9796('0x54')],{'$or':_['map'](_0x2f15fa[_0x9796('0x4e')],function(_0x5c2f45){var _0x462b44={};_0x462b44[_0x5c2f45]={'$like':'%'+_0x83757b[_0x9796('0x4a')][_0x9796('0x56')]+'%'};return _0x462b44;})});}_0x2f15fa=_[_0x9796('0x5a')]({},_0x2f15fa,_0x83757b[_0x9796('0x5b')]);return _0x4c3a34[_0x9796('0xcf')](_0x2f15fa);}})[_0x9796('0x32')](function(_0xba9dae){if(_0xba9dae){_0x5f3d78=_0xba9dae[_0x9796('0x62')];if(!_0x83757b[_0x9796('0x4a')][_0x9796('0x50')](_0x9796('0x51'))){_0x2f15fa[_0x9796('0x52')]=qs[_0x9796('0x52')](_0x83757b['query'][_0x9796('0x52')]);_0x2f15fa[_0x9796('0x2d')]=qs[_0x9796('0x2d')](_0x83757b[_0x9796('0x4a')]['offset']);}return _0x4c3a34[_0x9796('0xcf')](_0x2f15fa);}})[_0x9796('0x32')](function(_0x2c51f2){if(_0x2c51f2){return _0x2c51f2?{'count':_0x5f3d78,'rows':_0x2c51f2}:null;}})[_0x9796('0x32')](respondWithResult(_0x16a55a,null))[_0x9796('0x28')](handleError(_0x16a55a,null));};exports[_0x9796('0xd0')]=function(_0x32dda6,_0x334711,_0x53e041){var _0x2c8175={};var _0x4ffbc2={};var _0x1655b2;var _0x11de69;return db[_0x9796('0x5c')][_0x9796('0x8e')]({'where':{'id':_0x32dda6['params']['id']}})[_0x9796('0x32')](handleEntityNotFound(_0x334711,null))[_0x9796('0x32')](function(_0x3a53c8){if(_0x3a53c8){_0x1655b2=_0x3a53c8;_0x4ffbc2['model']=_[_0x9796('0x61')](db[_0x9796('0xd1')][_0x9796('0x43')]);_0x4ffbc2['query']=_[_0x9796('0x61')](_0x32dda6[_0x9796('0x4a')]);_0x4ffbc2[_0x9796('0x4b')]=_[_0x9796('0x4c')](_0x4ffbc2[_0x9796('0x4d')],_0x4ffbc2[_0x9796('0x4a')]);_0x2c8175[_0x9796('0x4e')]=_[_0x9796('0x4c')](_0x4ffbc2[_0x9796('0x4d')],qs[_0x9796('0x4f')](_0x32dda6[_0x9796('0x4a')][_0x9796('0x4f')]));_0x2c8175[_0x9796('0x4e')]=_0x2c8175[_0x9796('0x4e')][_0x9796('0x62')]?_0x2c8175[_0x9796('0x4e')]:_0x4ffbc2['model'];_0x2c8175[_0x9796('0x53')]=qs[_0x9796('0xbc')](_0x32dda6['query'][_0x9796('0xbc')]);_0x2c8175[_0x9796('0x54')]=qs[_0x9796('0x4b')](_[_0x9796('0x55')](_0x32dda6[_0x9796('0x4a')],_0x4ffbc2[_0x9796('0x4b')]));if(_0x32dda6[_0x9796('0x4a')][_0x9796('0x56')]){_0x2c8175[_0x9796('0x54')]=_['merge'](_0x2c8175['where'],{'$or':_[_0x9796('0x3a')](_0x2c8175[_0x9796('0x4e')],function(_0x4c5d23){var _0x427f2c={};_0x427f2c[_0x4c5d23]={'$like':'%'+_0x32dda6[_0x9796('0x4a')][_0x9796('0x56')]+'%'};return _0x427f2c;})});}_0x2c8175=_['merge']({},_0x2c8175,_0x32dda6[_0x9796('0x5b')]);return _0x1655b2[_0x9796('0xd0')](_0x2c8175);}})[_0x9796('0x32')](function(_0x28e1c8){if(_0x28e1c8){_0x11de69=_0x28e1c8['length'];if(!_0x32dda6[_0x9796('0x4a')][_0x9796('0x50')](_0x9796('0x51'))){_0x2c8175[_0x9796('0x52')]=qs[_0x9796('0x52')](_0x32dda6[_0x9796('0x4a')][_0x9796('0x52')]);_0x2c8175[_0x9796('0x2d')]=qs[_0x9796('0x2d')](_0x32dda6[_0x9796('0x4a')][_0x9796('0x2d')]);}return _0x1655b2[_0x9796('0xd0')](_0x2c8175);}})[_0x9796('0x32')](function(_0x30c9c4){if(_0x30c9c4){return _0x30c9c4?{'count':_0x11de69,'rows':_0x30c9c4}:null;}})['then'](respondWithResult(_0x334711,null))[_0x9796('0x28')](handleError(_0x334711,null));};exports[_0x9796('0xd2')]=function(_0x122a51,_0x166d7f,_0x3babda){var _0x1b4982={'raw':!![],'where':{}};var _0xf8aaaf={};var _0x31d687={'count':0x0,'rows':[]};return db[_0x9796('0x5c')][_0x9796('0x8e')]({'where':{'id':_0x122a51['params']['id']}})[_0x9796('0x32')](handleEntityNotFound(_0x166d7f,null))[_0x9796('0x32')](function(_0x5964c9){if(_0x5964c9){_0xf8aaaf[_0x9796('0x4d')]=_[_0x9796('0x61')](db['MailInteraction'][_0x9796('0x43')]);_0xf8aaaf['query']=_['keys'](_0x122a51[_0x9796('0x4a')]);_0xf8aaaf[_0x9796('0x4b')]=_[_0x9796('0x4c')](_0xf8aaaf['model'],_0xf8aaaf[_0x9796('0x4a')]);_0x1b4982[_0x9796('0x4e')]=_[_0x9796('0x4c')](_0xf8aaaf['model'],qs[_0x9796('0x4f')](_0x122a51[_0x9796('0x4a')][_0x9796('0x4f')]));_0x1b4982[_0x9796('0x4e')]=_0x1b4982[_0x9796('0x4e')][_0x9796('0x62')]?_0x1b4982[_0x9796('0x4e')]:_0xf8aaaf['model'];if(!_0x122a51[_0x9796('0x4a')][_0x9796('0x50')](_0x9796('0x51'))){_0x1b4982[_0x9796('0x52')]=qs[_0x9796('0x52')](_0x122a51[_0x9796('0x4a')][_0x9796('0x52')]);_0x1b4982[_0x9796('0x2d')]=qs[_0x9796('0x2d')](_0x122a51[_0x9796('0x4a')][_0x9796('0x2d')]);}_0x1b4982[_0x9796('0x53')]=qs[_0x9796('0xbc')](_0x122a51[_0x9796('0x4a')][_0x9796('0xbc')]);_0x1b4982[_0x9796('0x54')]=qs[_0x9796('0x4b')](_[_0x9796('0x55')](_0x122a51[_0x9796('0x4a')],_0xf8aaaf[_0x9796('0x4b')]));_0x1b4982['where'][_0x9796('0xcc')]=_0x5964c9['id'];if(_0x122a51['query'][_0x9796('0x56')]){_0x1b4982[_0x9796('0x54')]=_[_0x9796('0x5a')](_0x1b4982[_0x9796('0x54')],{'$or':_['map'](_0x1b4982[_0x9796('0x4e')],function(_0x1f4ca6){var _0x4e3c40={};_0x4e3c40[_0x1f4ca6]={'$like':'%'+_0x122a51[_0x9796('0x4a')][_0x9796('0x56')]+'%'};return _0x4e3c40;})});}_0x1b4982=_['merge']({},_0x1b4982,_0x122a51[_0x9796('0x5b')]);return db[_0x9796('0xd3')][_0x9796('0x2c')]({'where':_0x1b4982['where']})['then'](function(_0x2b9973){_0x31d687[_0x9796('0x2c')]=_0x2b9973;if(_0x122a51[_0x9796('0x4a')][_0x9796('0x63')]){_0x1b4982[_0x9796('0x5d')]=[{'all':!![]}];}return db['MailInteraction'][_0x9796('0xc6')](_0x1b4982);})[_0x9796('0x32')](function(_0x1cf08b){_0x31d687['rows']=_0x1cf08b;return _0x31d687;});}})[_0x9796('0x32')](respondWithFilteredResult(_0x166d7f,_0x1b4982))[_0x9796('0x28')](handleError(_0x166d7f,null));};exports['getSmsInteractions']=function(_0x5abee6,_0xa1820c,_0x4c68d8){var _0x5b7e57={};var _0x21ca87={};var _0x47a5cc;var _0x1e4b1a;return db[_0x9796('0x5c')][_0x9796('0x8e')]({'where':{'id':_0x5abee6[_0x9796('0x60')]['id']}})[_0x9796('0x32')](handleEntityNotFound(_0xa1820c,null))[_0x9796('0x32')](function(_0x102032){if(_0x102032){_0x47a5cc=_0x102032;_0x21ca87[_0x9796('0x4d')]=_[_0x9796('0x61')](db[_0x9796('0xd4')][_0x9796('0x43')]);_0x21ca87[_0x9796('0x4a')]=_[_0x9796('0x61')](_0x5abee6[_0x9796('0x4a')]);_0x21ca87['filters']=_[_0x9796('0x4c')](_0x21ca87[_0x9796('0x4d')],_0x21ca87[_0x9796('0x4a')]);_0x5b7e57[_0x9796('0x4e')]=_[_0x9796('0x4c')](_0x21ca87[_0x9796('0x4d')],qs[_0x9796('0x4f')](_0x5abee6['query'][_0x9796('0x4f')]));_0x5b7e57[_0x9796('0x4e')]=_0x5b7e57[_0x9796('0x4e')][_0x9796('0x62')]?_0x5b7e57['attributes']:_0x21ca87[_0x9796('0x4d')];_0x5b7e57[_0x9796('0x53')]=qs[_0x9796('0xbc')](_0x5abee6[_0x9796('0x4a')][_0x9796('0xbc')]);_0x5b7e57[_0x9796('0x54')]=qs['filters'](_[_0x9796('0x55')](_0x5abee6[_0x9796('0x4a')],_0x21ca87[_0x9796('0x4b')]));if(_0x5abee6['query']['filter']){_0x5b7e57['where']=_[_0x9796('0x5a')](_0x5b7e57[_0x9796('0x54')],{'$or':_[_0x9796('0x3a')](_0x5b7e57['attributes'],function(_0x3a8e9b){var _0x436e23={};_0x436e23[_0x3a8e9b]={'$like':'%'+_0x5abee6[_0x9796('0x4a')]['filter']+'%'};return _0x436e23;})});}_0x5b7e57=_[_0x9796('0x5a')]({},_0x5b7e57,_0x5abee6[_0x9796('0x5b')]);return _0x47a5cc['getSmsInteractions'](_0x5b7e57);}})['then'](function(_0x1b891f){if(_0x1b891f){_0x1e4b1a=_0x1b891f[_0x9796('0x62')];if(!_0x5abee6[_0x9796('0x4a')][_0x9796('0x50')](_0x9796('0x51'))){_0x5b7e57['limit']=qs[_0x9796('0x52')](_0x5abee6[_0x9796('0x4a')][_0x9796('0x52')]);_0x5b7e57[_0x9796('0x2d')]=qs[_0x9796('0x2d')](_0x5abee6[_0x9796('0x4a')]['offset']);}return _0x47a5cc[_0x9796('0xd5')](_0x5b7e57);}})[_0x9796('0x32')](function(_0x15c904){if(_0x15c904){return _0x15c904?{'count':_0x1e4b1a,'rows':_0x15c904}:null;}})[_0x9796('0x32')](respondWithResult(_0xa1820c,null))[_0x9796('0x28')](handleError(_0xa1820c,null));};exports[_0x9796('0xd6')]=function(_0x3f4ff7,_0x325fcd,_0x5818c5){var _0x8ea339={};var _0x2029cb={};var _0x240035;var _0x28cddc;return db[_0x9796('0x5c')][_0x9796('0x8e')]({'where':{'id':_0x3f4ff7[_0x9796('0x60')]['id']}})['then'](handleEntityNotFound(_0x325fcd,null))[_0x9796('0x32')](function(_0x2d95cc){if(_0x2d95cc){_0x240035=_0x2d95cc;_0x2029cb[_0x9796('0x4d')]=_[_0x9796('0x61')](db[_0x9796('0xd7')]['rawAttributes']);_0x2029cb[_0x9796('0x4a')]=_[_0x9796('0x61')](_0x3f4ff7[_0x9796('0x4a')]);_0x2029cb[_0x9796('0x4b')]=_[_0x9796('0x4c')](_0x2029cb[_0x9796('0x4d')],_0x2029cb[_0x9796('0x4a')]);_0x8ea339['attributes']=_[_0x9796('0x4c')](_0x2029cb[_0x9796('0x4d')],qs['fields'](_0x3f4ff7[_0x9796('0x4a')][_0x9796('0x4f')]));_0x8ea339[_0x9796('0x4e')]=_0x8ea339[_0x9796('0x4e')][_0x9796('0x62')]?_0x8ea339[_0x9796('0x4e')]:_0x2029cb[_0x9796('0x4d')];_0x8ea339[_0x9796('0x53')]=qs['sort'](_0x3f4ff7[_0x9796('0x4a')][_0x9796('0xbc')]);_0x8ea339[_0x9796('0x54')]=qs['filters'](_[_0x9796('0x55')](_0x3f4ff7[_0x9796('0x4a')],_0x2029cb[_0x9796('0x4b')]));if(_0x3f4ff7[_0x9796('0x4a')][_0x9796('0x56')]){_0x8ea339[_0x9796('0x54')]=_['merge'](_0x8ea339[_0x9796('0x54')],{'$or':_['map'](_0x8ea339[_0x9796('0x4e')],function(_0x311169){var _0x50dda7={};_0x50dda7[_0x311169]={'$like':'%'+_0x3f4ff7[_0x9796('0x4a')][_0x9796('0x56')]+'%'};return _0x50dda7;})});}_0x8ea339=_[_0x9796('0x5a')]({},_0x8ea339,_0x3f4ff7['options']);return _0x240035[_0x9796('0xd6')](_0x8ea339);}})[_0x9796('0x32')](function(_0x103407){if(_0x103407){_0x28cddc=_0x103407[_0x9796('0x62')];if(!_0x3f4ff7[_0x9796('0x4a')][_0x9796('0x50')](_0x9796('0x51'))){_0x8ea339[_0x9796('0x52')]=qs['limit'](_0x3f4ff7[_0x9796('0x4a')][_0x9796('0x52')]);_0x8ea339[_0x9796('0x2d')]=qs[_0x9796('0x2d')](_0x3f4ff7[_0x9796('0x4a')][_0x9796('0x2d')]);}return _0x240035[_0x9796('0xd6')](_0x8ea339);}})[_0x9796('0x32')](function(_0x9b031a){if(_0x9b031a){return _0x9b031a?{'count':_0x28cddc,'rows':_0x9b031a}:null;}})[_0x9796('0x32')](respondWithResult(_0x325fcd,null))['catch'](handleError(_0x325fcd,null));};exports['getWhatsappInteractions']=function(_0x15d931,_0x3dea3a,_0x47c701){var _0x2877d8={};var _0x4ddd6e={};var _0x166938;var _0x12303c;return db['User'][_0x9796('0x8e')]({'where':{'id':_0x15d931[_0x9796('0x60')]['id']}})[_0x9796('0x32')](handleEntityNotFound(_0x3dea3a,null))['then'](function(_0x3c3c8e){if(_0x3c3c8e){_0x166938=_0x3c3c8e;_0x4ddd6e['model']=_[_0x9796('0x61')](db[_0x9796('0xd8')]['rawAttributes']);_0x4ddd6e[_0x9796('0x4a')]=_[_0x9796('0x61')](_0x15d931[_0x9796('0x4a')]);_0x4ddd6e[_0x9796('0x4b')]=_[_0x9796('0x4c')](_0x4ddd6e[_0x9796('0x4d')],_0x4ddd6e[_0x9796('0x4a')]);_0x2877d8[_0x9796('0x4e')]=_[_0x9796('0x4c')](_0x4ddd6e[_0x9796('0x4d')],qs['fields'](_0x15d931[_0x9796('0x4a')][_0x9796('0x4f')]));_0x2877d8[_0x9796('0x4e')]=_0x2877d8[_0x9796('0x4e')][_0x9796('0x62')]?_0x2877d8[_0x9796('0x4e')]:_0x4ddd6e['model'];_0x2877d8[_0x9796('0x53')]=qs[_0x9796('0xbc')](_0x15d931[_0x9796('0x4a')]['sort']);_0x2877d8[_0x9796('0x54')]=qs[_0x9796('0x4b')](_['pick'](_0x15d931['query'],_0x4ddd6e[_0x9796('0x4b')]));if(_0x15d931['query'][_0x9796('0x56')]){_0x2877d8[_0x9796('0x54')]=_[_0x9796('0x5a')](_0x2877d8['where'],{'$or':_['map'](_0x2877d8['attributes'],function(_0x1917e3){var _0xef721c={};_0xef721c[_0x1917e3]={'$like':'%'+_0x15d931[_0x9796('0x4a')][_0x9796('0x56')]+'%'};return _0xef721c;})});}_0x2877d8=_['merge']({},_0x2877d8,_0x15d931['options']);return _0x166938[_0x9796('0xd9')](_0x2877d8);}})[_0x9796('0x32')](function(_0x59dad4){if(_0x59dad4){_0x12303c=_0x59dad4[_0x9796('0x62')];if(!_0x15d931[_0x9796('0x4a')][_0x9796('0x50')]('nolimit')){_0x2877d8['limit']=qs['limit'](_0x15d931[_0x9796('0x4a')]['limit']);_0x2877d8['offset']=qs[_0x9796('0x2d')](_0x15d931['query'][_0x9796('0x2d')]);}return _0x166938[_0x9796('0xd9')](_0x2877d8);}})[_0x9796('0x32')](function(_0x1dd402){if(_0x1dd402){return _0x1dd402?{'count':_0x12303c,'rows':_0x1dd402}:null;}})[_0x9796('0x32')](respondWithResult(_0x3dea3a,null))[_0x9796('0x28')](handleError(_0x3dea3a,null));};exports[_0x9796('0xda')]=function(_0x47cb8d,_0x8bd512,_0x46f43d){var _0x1e7954;var _0xed2747;var _0x46e229;var _0x475ed9=!_[_0x9796('0x77')](_0x47cb8d[_0x9796('0x60')]['id'])?_0x47cb8d[_0x9796('0x60')]['id']:!_[_0x9796('0x77')](_0x47cb8d[_0x9796('0x35')]['id'])?_0x47cb8d['user']['id']:null;return db[_0x9796('0x5c')][_0x9796('0x3e')]({'where':{'id':_0x475ed9,'role':{'$or':[_0x9796('0xc5'),'user',_0x9796('0x37')]}},'attributes':['id','name',_0x9796('0xdb'),_0x9796('0xdc'),_0x9796('0x3d'),'internal',_0x9796('0x98')]})['then'](function(_0x39b987){if(_0x39b987){if(_0x39b987[_0x9796('0x3d')]==='agent'){_0x1e7954=_0x39b987;if(_0x47cb8d['body'][_0x9796('0x9a')]){_0x46e229=util[_0x9796('0x6f')](_0x9796('0xdd'),_0x1e7954[_0x47cb8d[_0x9796('0x65')]['interface']]);}else if(_0x47cb8d[_0x9796('0x65')][_0x9796('0xde')]){_0x46e229=util[_0x9796('0x6f')]('SIP/%s',_0x47cb8d['body'][_0x9796('0xde')]);}else{_0x46e229=util[_0x9796('0x6f')](_0x9796('0xa6'),_0x1e7954[_0x9796('0x3f')]);}socket['to'](util[_0x9796('0x6f')](_0x9796('0xdf'),_0x1e7954[_0x9796('0x3f')]))[_0x9796('0xa1')](_0x9796('0xe0'),{'ip':_0x47cb8d[_0x9796('0xe1')][_0x9796('0xe2')]||_0x47cb8d['connection'][_0x9796('0xe3')]||_0x47cb8d[_0x9796('0xe4')][_0x9796('0xe3')]||_0x47cb8d[_0x9796('0xe5')][_0x9796('0xe4')]['remoteAddress']});return db[_0x9796('0xa9')][_0x9796('0x33')]({'where':{'membername':_0x1e7954[_0x9796('0x3f')]},'individualHooks':!![]});}}else{throw new db[(_0x9796('0x1d'))]['ValidationError'](_0x9796('0xe6'));}})[_0x9796('0x32')](function(){if(_0x1e7954){return _0x1e7954[_0x9796('0xe7')]({'raw':!![]});}})[_0x9796('0x32')](function(_0x40e68f){if(_0x1e7954){var _0x38462b=[];if(_0x40e68f){_0xed2747=_0x40e68f;if(_0xed2747[_0x9796('0x62')]){for(var _0x476d53=0x0;_0x476d53<_0xed2747['length'];_0x476d53++){_0x38462b[_0x9796('0xa5')]({'membername':_0x1e7954[_0x9796('0x3f')],'UserId':_0x1e7954['id'],'queue_name':_0xed2747[_0x476d53]['name'],'VoiceQueueId':_0xed2747[_0x476d53]['id'],'interface':_0x46e229,'paused':_0x1e7954[_0x9796('0x98')]||![],'penalty':_0xed2747[_0x476d53]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0x9796('0xa8')](_0x38462b,function(_0xfc5619){return db['UserVoiceQueueRt']['upsert'](_0xfc5619);});}}}})[_0x9796('0x32')](function(){if(_0x1e7954){return db[_0x9796('0xe8')]['findAll']({'where':{'membername':_0x1e7954[_0x9796('0x3f')],'exitAt':null}});}})[_0x9796('0x32')](function(_0x870598){if(_0x1e7954){var _0x2a50f7=[];_0x870598['forEach'](function(_0x1ed859){_0x2a50f7[_0x9796('0xa5')](_0x1ed859['update']({'exitAt':moment()[_0x9796('0x6f')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x9796('0xe9')](_0x2a50f7);}})[_0x9796('0x32')](function(){if(_0x1e7954){var _0x1f34b8=[];var _0xc4a996=[];var _0x2f4038=utils[_0x9796('0xea')]();var _0x810c4c={'membername':_0x1e7954[_0x9796('0x3f')],'interface':_0x46e229,'enterAt':moment()[_0x9796('0x6f')](_0x9796('0xeb')),'role':_0x1e7954[_0x9796('0x3d')],'internal':_0x1e7954[_0x9796('0x71')]};_0x2f4038[_0x9796('0xec')](function(_0x28dfed){_0x1f34b8[_0x9796('0xa5')](_['merge']({'channel':_0x28dfed,'type':_0x9796('0xed'),'data1':_0x47cb8d['body']['device'],'data2':_0x46e229},_0x810c4c));if(_0x1e7954[_0x9796('0x98')]){_0xc4a996[_0x9796('0xa5')](_[_0x9796('0x5a')]({'channel':_0x28dfed,'type':_0x9796('0xee'),'data1':_0x9796('0xef')},_0x810c4c));}});return db[_0x9796('0xe8')][_0x9796('0x64')](_0x1f34b8[_0x9796('0xf0')](_0xc4a996),{'individualHooks':!![]});}})['then'](function(){if(_0x1e7954){return _0x1e7954[_0x9796('0x31')]({'online':!![],'lastLoginAt':moment()[_0x9796('0x6f')](_0x9796('0xeb')),'voicePause':_0x1e7954['loginInPause']||![],'mailPause':_0x1e7954['loginInPause']||![],'chatPause':_0x1e7954['loginInPause']||![],'faxPause':_0x1e7954['loginInPause']||![],'smsPause':_0x1e7954[_0x9796('0x98')]||![],'openchannelPause':_0x1e7954[_0x9796('0x98')]||![],'whatsappPause':_0x1e7954[_0x9796('0x98')]||![],'pauseType':_0x1e7954[_0x9796('0x98')]?_0x9796('0xef'):null,'interface':_0x46e229,'lastPauseAt':moment()[_0x9796('0x6f')](_0x9796('0xeb'))});}})['then'](function(_0x412a10){if(_0x47cb8d['isMiddleware']){return _0x46f43d();}else{return BPromise['resolve'](_0x412a10)[_0x9796('0x32')](respondWithResult(_0x8bd512,null));}})['catch'](handleError(_0x8bd512,null));};exports[_0x9796('0xf1')]=function(_0x21f067,_0x366c93,_0x4e4f75){var _0x15e005;return db[_0x9796('0x5c')][_0x9796('0x3e')]({'where':{'id':_0x21f067['params']['id'],'role':_0x9796('0x37')},'attributes':['id',_0x9796('0x3f'),_0x9796('0x3d')]})[_0x9796('0x32')](handleEntityNotFound(_0x366c93,null))[_0x9796('0x32')](function(_0x5664f3){if(_0x5664f3){_0x15e005=_0x5664f3;return db['UserVoiceQueueRt'][_0x9796('0x33')]({'where':{'membername':_0x15e005[_0x9796('0x3f')]},'individualHooks':!![]});}})[_0x9796('0x32')](function(){return db[_0x9796('0xe8')][_0x9796('0xc6')]({'where':{'membername':_0x15e005[_0x9796('0x3f')],'exitAt':null}});})['then'](function(_0x1ff854){var _0x50cb3c=[];_0x1ff854[_0x9796('0xec')](function(_0x6cc398){_0x50cb3c['push'](_0x6cc398[_0x9796('0x31')]({'exitAt':moment()[_0x9796('0x6f')](_0x9796('0xeb'))}));});return BPromise[_0x9796('0xe9')](_0x50cb3c);})[_0x9796('0x32')](function(){return _0x15e005[_0x9796('0x31')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x366c93,null))[_0x9796('0x28')](handleError(_0x366c93,null));};exports[_0x9796('0xf2')]=function(_0x3205b5,_0x371dc3,_0x145b9c){var _0x1bab2c;return db[_0x9796('0xa9')][_0x9796('0x31')]({'paused':0x1},{'where':{'UserId':_0x3205b5['params']['id']},'individualHooks':!![]})[_0x9796('0x32')](function(){return db[_0x9796('0x5c')][_0x9796('0x3e')]({'where':{'id':_0x3205b5[_0x9796('0x60')]['id'],'role':'agent'},'attributes':['id',_0x9796('0x3f'),_0x9796('0x3d'),_0x9796('0x71'),'interface']});})['then'](handleEntityNotFound(_0x371dc3,null))['then'](function(_0x28db4b){if(_0x28db4b){_0x1bab2c=_0x28db4b;return respondWithRpcPromise(_0x9796('0xf3'),_0x9796('0xf2'),{'id':_0x1bab2c['id'],'name':_0x1bab2c[_0x9796('0x3f')],'pause':!![]});}})[_0x9796('0x32')](function(){if(_0x1bab2c){return db[_0x9796('0xe8')][_0x9796('0xc6')]({'where':{'membername':_0x1bab2c['name'],'type':_0x9796('0xee'),'exitAt':null}});}})[_0x9796('0x32')](function(_0x7d46aa){if(_0x7d46aa[_0x9796('0x62')]){var _0x2b9ac2=moment()[_0x9796('0x6f')](_0x9796('0xeb'));for(var _0x1f1974=0x0,_0x4e8c22=_0x7d46aa['length'];_0x1f1974<_0x4e8c22;_0x1f1974++){_0x7d46aa[_0x1f1974][_0x9796('0xf4')]({'exitAt':_0x2b9ac2});}}})[_0x9796('0x32')](function(){var _0x1d4c2f=[];var _0x3269a5=utils[_0x9796('0xea')]();_0x3269a5[_0x9796('0xec')](function(_0x4e603c){_0x1d4c2f[_0x9796('0xa5')]({'channel':_0x4e603c,'membername':_0x1bab2c['name'],'interface':_[_0x9796('0x77')](_0x1bab2c[_0x9796('0x9a')])?util['format']('SIP/%s',_0x1bab2c[_0x9796('0x3f')]):_0x1bab2c[_0x9796('0x9a')],'type':_0x9796('0xee'),'enterAt':moment()[_0x9796('0x6f')](_0x9796('0xeb')),'data1':_0x3205b5[_0x9796('0x65')][_0x9796('0x45')]||_0x9796('0xf5'),'role':_0x1bab2c['role'],'internal':_0x1bab2c['internal']});});return db[_0x9796('0xe8')]['bulkCreate'](_0x1d4c2f,{'individualHooks':!![]});})[_0x9796('0x32')](function(){return _0x1bab2c[_0x9796('0x31')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3205b5[_0x9796('0x65')][_0x9796('0x45')]||_0x9796('0xf5'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x9796('0x32')](respondWithResult(_0x371dc3,null))[_0x9796('0x28')](handleError(_0x371dc3,null));};exports[_0x9796('0xf6')]=function(_0x4cdab2,_0x513597,_0x43f970){var _0x125a84;return db[_0x9796('0x5c')][_0x9796('0x3e')]({'where':{'id':_0x4cdab2[_0x9796('0x60')]['id']},'attributes':['id','name',_0x9796('0x3d'),_0x9796('0x99'),'mailPause','chatPause',_0x9796('0xf7'),'openchannelPause',_0x9796('0xf8'),_0x9796('0xf9'),_0x9796('0xfa'),_0x9796('0xfb')]})['then'](handleEntityNotFound(_0x513597,null))[_0x9796('0x32')](function(_0x242465){if(_0x242465){_0x125a84=_0x242465;if(_0x4cdab2[_0x9796('0x65')][_0x9796('0x96')]&&!utils[_0x9796('0x9b')](_0x4cdab2['body'][_0x9796('0x96')])){throw new db[(_0x9796('0x1d'))][(_0x9796('0x1e'))](_0x9796('0xc2'));}switch(_0x4cdab2[_0x9796('0x65')][_0x9796('0x96')]){case _0x9796('0xa3'):return respondWithRpcPromise(_0x9796('0xf3'),'unpause',{'id':_0x125a84['id'],'name':_0x125a84[_0x9796('0x3f')],'pause':![]})[_0x9796('0x32')](function(){return db['UserVoiceQueueRt'][_0x9796('0x31')]({'paused':0x0},{'where':{'UserId':_0x125a84['id']},'individualHooks':!![]});})[_0x9796('0x32')](function(){return db[_0x9796('0xe8')][_0x9796('0x3e')]({'where':{'channel':_0x4cdab2[_0x9796('0x65')][_0x9796('0x96')],'membername':_0x125a84['name'],'type':_0x9796('0xee'),'exitAt':null}});})[_0x9796('0x32')](function(_0x291c93){if(_0x291c93){return _0x291c93['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x9796('0x32')](function(){return _0x125a84[_0x9796('0x31')]({'voicePause':![]});});case _0x9796('0xfc'):case _0x9796('0xfd'):case _0x9796('0xfe'):case _0x9796('0xff'):case _0x9796('0x100'):case'openchannel':return db['MemberReport'][_0x9796('0x3e')]({'where':{'channel':_0x4cdab2[_0x9796('0x65')][_0x9796('0x96')],'membername':_0x125a84[_0x9796('0x3f')],'type':'PAUSE','exitAt':null}})[_0x9796('0x32')](function(_0x38db66){if(_0x38db66){return _0x38db66[_0x9796('0x31')]({'exitAt':moment()['format'](_0x9796('0xeb')),'data2':_0x9796('0x101')},{'individualHooks':!![]});}return null;})[_0x9796('0x32')](function(){var _0x339571={};_[_0x9796('0x2e')](_0x339571,util[_0x9796('0x6f')](_0x9796('0x102'),_0x4cdab2[_0x9796('0x65')]['channel'],'Pause'),![]);return _0x125a84['update'](_0x339571);});default:return respondWithRpcPromise(_0x9796('0xf3'),_0x9796('0xf6'),{'id':_0x125a84['id'],'name':_0x125a84['name'],'pause':![]})[_0x9796('0x32')](function(){return db[_0x9796('0xa9')][_0x9796('0x31')]({'paused':0x0},{'where':{'UserId':_0x125a84['id']}});})[_0x9796('0x32')](function(){return db[_0x9796('0xe8')][_0x9796('0xc6')]({'where':{'membername':_0x125a84[_0x9796('0x3f')],'type':_0x9796('0xee'),'exitAt':null}});})[_0x9796('0x32')](function(_0x27add4){var _0x1e37d1=[];_0x27add4[_0x9796('0xec')](function(_0x2dc888){_0x1e37d1[_0x9796('0xa5')](_0x2dc888[_0x9796('0x31')]({'exitAt':moment()[_0x9796('0x6f')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x9796('0x101')}));});return BPromise['all'](_0x1e37d1);})[_0x9796('0x32')](function(){return _0x125a84['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x9796('0x32')](respondWithResult(_0x513597,null))[_0x9796('0x28')](handleError(_0x513597,null));};exports[_0x9796('0x103')]=function(_0x4a5c05,_0x1fd195,_0x2cb1b8){var _0x18f892={};var _0x34f9b5={};var _0x15b08c;var _0x1701a0;return db[_0x9796('0x5c')]['findOne']({'where':{'id':_0x4a5c05['params']['id']}})[_0x9796('0x32')](handleEntityNotFound(_0x1fd195,null))['then'](function(_0x30f077){if(_0x30f077){_0x15b08c=_0x30f077;_0x34f9b5[_0x9796('0x4d')]=_[_0x9796('0x61')](db[_0x9796('0x104')]['rawAttributes']);_0x34f9b5[_0x9796('0x4a')]=_['keys'](_0x4a5c05[_0x9796('0x4a')]);_0x34f9b5[_0x9796('0x4b')]=_[_0x9796('0x4c')](_0x34f9b5[_0x9796('0x4d')],_0x34f9b5[_0x9796('0x4a')]);_0x18f892[_0x9796('0x4e')]=_[_0x9796('0x4c')](_0x34f9b5[_0x9796('0x4d')],qs[_0x9796('0x4f')](_0x4a5c05[_0x9796('0x4a')]['fields']));_0x18f892[_0x9796('0x4e')]=_0x18f892[_0x9796('0x4e')][_0x9796('0x62')]?_0x18f892[_0x9796('0x4e')]:_0x34f9b5[_0x9796('0x4d')];_0x18f892[_0x9796('0x53')]=qs[_0x9796('0xbc')](_0x4a5c05[_0x9796('0x4a')][_0x9796('0xbc')]);_0x18f892[_0x9796('0x54')]=qs[_0x9796('0x4b')](_[_0x9796('0x55')](_0x4a5c05['query'],_0x34f9b5[_0x9796('0x4b')]));if(_0x4a5c05['query'][_0x9796('0x56')]){_0x18f892[_0x9796('0x54')]=_[_0x9796('0x5a')](_0x18f892[_0x9796('0x54')],{'$or':_[_0x9796('0x3a')](_0x18f892['attributes'],function(_0x19d0e5){var _0x2f73d5={};_0x2f73d5[_0x19d0e5]={'$like':'%'+_0x4a5c05[_0x9796('0x4a')][_0x9796('0x56')]+'%'};return _0x2f73d5;})});}_0x18f892=_[_0x9796('0x5a')]({},_0x18f892,_0x4a5c05[_0x9796('0x5b')]);return _0x15b08c[_0x9796('0x103')](_0x18f892);}})[_0x9796('0x32')](function(_0x2dfc3e){if(_0x2dfc3e){_0x1701a0=_0x2dfc3e[_0x9796('0x62')];if(!_0x4a5c05['query'][_0x9796('0x50')]('nolimit')){_0x18f892[_0x9796('0x52')]=qs['limit'](_0x4a5c05[_0x9796('0x4a')]['limit']);_0x18f892[_0x9796('0x2d')]=qs[_0x9796('0x2d')](_0x4a5c05[_0x9796('0x4a')][_0x9796('0x2d')]);}return _0x15b08c[_0x9796('0x103')](_0x18f892);}})['then'](function(_0x51e6b3){if(_0x51e6b3){return _0x51e6b3?{'count':_0x1701a0,'rows':_0x51e6b3}:null;}})[_0x9796('0x32')](respondWithResult(_0x1fd195,null))[_0x9796('0x28')](handleError(_0x1fd195,null));};exports[_0x9796('0x105')]=function(_0x3ef20,_0x1fbc03){return db[_0x9796('0x5c')][_0x9796('0x3e')]({'where':{'id':_0x3ef20[_0x9796('0x60')]['id']}})[_0x9796('0x32')](handleEntityNotFound(_0x1fbc03,null))[_0x9796('0x32')](function(_0x416949){if(_0x416949){var _0x2f3fd4=_0x416949[_0x9796('0x34')]({'plain':!![]});return _0x416949[_0x9796('0x105')](_0x3ef20[_0x9796('0x65')][_0x9796('0x68')],_[_0x9796('0x106')](_0x3ef20[_0x9796('0x65')],[_0x9796('0x68'),'id'])||{})['then'](function(){for(var _0x40ee0c=0x0;_0x40ee0c<_0x3ef20['body'][_0x9796('0x68')][_0x9796('0x62')];_0x40ee0c++){var _0xb86eb3=[];db[_0x9796('0x104')][_0x9796('0x8e')]({'where':{'id':_0x3ef20[_0x9796('0x65')]['ids'][_0x40ee0c]}})[_0x9796('0x32')](function(_0x118c0e){_0xb86eb3[_0x9796('0xa5')](_0x118c0e[_0x9796('0xe7')]()[_0x9796('0x32')](function(_0x1ab223){for(var _0x35f65b=0x0;_0x35f65b<_0x1ab223[_0x9796('0x62')];_0x35f65b++){_0x1ab223[_0x35f65b][_0x9796('0x107')](_0x9796('0x96'),'Voice');}return _0x1ab223;}));_0xb86eb3[_0x9796('0xa5')](_0x118c0e[_0x9796('0x108')]()['then'](function(_0x4d300){for(var _0x3ff426=0x0;_0x3ff426<_0x4d300[_0x9796('0x62')];_0x3ff426++){_0x4d300[_0x3ff426]['setDataValue'](_0x9796('0x96'),_0x9796('0x109'));}return _0x4d300;}));_0xb86eb3['push'](_0x118c0e[_0x9796('0x10a')]()['then'](function(_0x917f0){for(var _0x5a26a5=0x0;_0x5a26a5<_0x917f0[_0x9796('0x62')];_0x5a26a5++){_0x917f0[_0x5a26a5][_0x9796('0x107')]('channel',_0x9796('0x10b'));}return _0x917f0;}));_0xb86eb3[_0x9796('0xa5')](_0x118c0e[_0x9796('0x10c')]()['then'](function(_0x35f3eb){for(var _0x3d18a1=0x0;_0x3d18a1<_0x35f3eb['length'];_0x3d18a1++){_0x35f3eb[_0x3d18a1][_0x9796('0x107')]('channel',_0x9796('0x10d'));}return _0x35f3eb;}));_0xb86eb3['push'](_0x118c0e[_0x9796('0x10e')]()[_0x9796('0x32')](function(_0x4251b9){for(var _0x2108e4=0x0;_0x2108e4<_0x4251b9[_0x9796('0x62')];_0x2108e4++){_0x4251b9[_0x2108e4][_0x9796('0x107')](_0x9796('0x96'),_0x9796('0x10f'));}return _0x4251b9;}));_0xb86eb3[_0x9796('0xa5')](_0x118c0e[_0x9796('0x110')]()[_0x9796('0x32')](function(_0x372262){for(var _0x109006=0x0;_0x109006<_0x372262[_0x9796('0x62')];_0x109006++){_0x372262[_0x109006][_0x9796('0x107')](_0x9796('0x96'),_0x9796('0x111'));}return _0x372262;}));_0xb86eb3[_0x9796('0xa5')](_0x118c0e[_0x9796('0x112')]()[_0x9796('0x32')](function(_0x144c63){for(var _0x186262=0x0;_0x186262<_0x144c63[_0x9796('0x62')];_0x186262++){_0x144c63[_0x186262]['setDataValue'](_0x9796('0x96'),_0x9796('0x113'));}return _0x144c63;}));return BPromise[_0x9796('0xe9')](_0xb86eb3);})[_0x9796('0x32')](function(_0x5b29a6){var _0x51a375=_[_0x9796('0x114')](_0x5b29a6);_0xb86eb3=[];return db[_0x9796('0x59')][_0x9796('0x115')](function(_0x5e8b13){for(var _0x44e353=0x0;_0x44e353<_0x51a375[_0x9796('0x62')];_0x44e353++){_0xb86eb3[_0x9796('0xa5')](_0x51a375[_0x44e353][_0x9796('0x116')](_0x2f3fd4['id']),{'transaction':_0x5e8b13});}return BPromise[_0x9796('0xe9')](_0xb86eb3)['then'](function(){if(_0x2f3fd4['online']){return BPromise[_0x9796('0xa8')](_[_0x9796('0x56')](_0x51a375,function(_0x5df0ad){return _0x5df0ad[_0x9796('0x117')](_0x9796('0x96'))===_0x9796('0x118');}),function(_0xe7a5be){return db[_0x9796('0xa9')][_0x9796('0xaa')]({'membername':_0x2f3fd4['name'],'UserId':_0x2f3fd4['id'],'queue_name':_0xe7a5be[_0x9796('0x3f')],'VoiceQueueId':_0xe7a5be['id'],'interface':_[_0x9796('0x77')](_0x2f3fd4[_0x9796('0x9a')])?util[_0x9796('0x6f')](_0x9796('0xa6'),_0x2f3fd4['name']):_0x2f3fd4[_0x9796('0x9a')],'paused':_0x2f3fd4['voicePause']||![],'penalty':_0x2f3fd4['penalty']},{'transaction':_0x5e8b13});});}else{return;}})[_0x9796('0x32')](function(){for(var _0x180da0=0x0;_0x180da0<_0x51a375[_0x9796('0x62')];_0x180da0++){var _0x1dffbb=_0x51a375[_0x180da0]['getDataValue'](_0x9796('0x96'));var _0x14d269=_0x1dffbb+_0x9796('0xad');socket['emit'](_0x9796('0x35')+_0x1dffbb+_0x9796('0xa2'),{'UserId':_0x2f3fd4['id'],['queueField']:_0x51a375[_0x180da0]['id']});}});});});}});}})[_0x9796('0x32')](respondWithStatusCode(_0x1fbc03,null))['catch'](handleError(_0x1fbc03,null));};exports[_0x9796('0x119')]=function(_0x161bbb,_0x43de6d){return db['User'][_0x9796('0x8e')]({'where':{'id':_0x161bbb[_0x9796('0x60')]['id']}})[_0x9796('0x32')](handleEntityNotFound(_0x43de6d,null))[_0x9796('0x32')](function(_0x541072){if(_0x541072){var _0x5067d3=_0x541072[_0x9796('0x34')]({'plain':!![]});var _0x128f60=_0x161bbb[_0x9796('0x4a')][_0x9796('0x68')];return _0x541072[_0x9796('0x119')](_0x128f60)[_0x9796('0x32')](function(){for(var _0x17a18c=0x0;_0x17a18c<_0x128f60['length'];_0x17a18c++){var _0xeef095=[];db['Team'][_0x9796('0x8e')]({'where':{'id':_0x128f60[_0x17a18c]}})[_0x9796('0x32')](function(_0x428af4){_0xeef095['push'](_0x428af4[_0x9796('0xe7')]()[_0x9796('0x32')](function(_0x5f0c81){for(var _0x515c58=0x0;_0x515c58<_0x5f0c81[_0x9796('0x62')];_0x515c58++){_0x5f0c81[_0x515c58][_0x9796('0x107')](_0x9796('0x96'),'Voice');}return _0x5f0c81;}));_0xeef095[_0x9796('0xa5')](_0x428af4[_0x9796('0x108')]()['then'](function(_0x3a9b7c){for(var _0x4a9c0f=0x0;_0x4a9c0f<_0x3a9b7c['length'];_0x4a9c0f++){_0x3a9b7c[_0x4a9c0f][_0x9796('0x107')](_0x9796('0x96'),_0x9796('0x109'));}return _0x3a9b7c;}));_0xeef095[_0x9796('0xa5')](_0x428af4['getMailQueues']()[_0x9796('0x32')](function(_0x3d421b){for(var _0x474bed=0x0;_0x474bed<_0x3d421b[_0x9796('0x62')];_0x474bed++){_0x3d421b[_0x474bed][_0x9796('0x107')](_0x9796('0x96'),_0x9796('0x10b'));}return _0x3d421b;}));_0xeef095[_0x9796('0xa5')](_0x428af4['getSmsQueues']()[_0x9796('0x32')](function(_0x5ca08e){for(var _0x385593=0x0;_0x385593<_0x5ca08e[_0x9796('0x62')];_0x385593++){_0x5ca08e[_0x385593]['setDataValue'](_0x9796('0x96'),_0x9796('0x10d'));}return _0x5ca08e;}));_0xeef095[_0x9796('0xa5')](_0x428af4[_0x9796('0x10e')]()[_0x9796('0x32')](function(_0x3c0c56){for(var _0x1c3b35=0x0;_0x1c3b35<_0x3c0c56[_0x9796('0x62')];_0x1c3b35++){_0x3c0c56[_0x1c3b35][_0x9796('0x107')](_0x9796('0x96'),_0x9796('0x10f'));}return _0x3c0c56;}));_0xeef095[_0x9796('0xa5')](_0x428af4[_0x9796('0x110')]()[_0x9796('0x32')](function(_0x497474){for(var _0x1a9756=0x0;_0x1a9756<_0x497474[_0x9796('0x62')];_0x1a9756++){_0x497474[_0x1a9756]['setDataValue'](_0x9796('0x96'),_0x9796('0x111'));}return _0x497474;}));_0xeef095['push'](_0x428af4[_0x9796('0x112')]()['then'](function(_0x328439){for(var _0x542357=0x0;_0x542357<_0x328439[_0x9796('0x62')];_0x542357++){_0x328439[_0x542357]['setDataValue'](_0x9796('0x96'),_0x9796('0x113'));}return _0x328439;}));return BPromise[_0x9796('0xe9')](_0xeef095);})['then'](function(_0x1d9448){var _0x459a9e=_[_0x9796('0x114')](_0x1d9448);_0xeef095=[];return db[_0x9796('0x59')][_0x9796('0x115')](function(_0x1f9160){for(var _0x3363e7=0x0;_0x3363e7<_0x459a9e['length'];_0x3363e7++){_0xeef095[_0x9796('0xa5')](_0x459a9e[_0x3363e7][_0x9796('0x11a')](_0x5067d3['id']),{'transaction':_0x1f9160});}return BPromise[_0x9796('0xe9')](_0xeef095)['then'](function(){if(_0x5067d3[_0x9796('0x97')]){return BPromise['each'](_[_0x9796('0x56')](_0x459a9e,function(_0x4c813b){return _0x4c813b[_0x9796('0x117')]('channel')===_0x9796('0x118');}),function(_0xb334f6){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0xb334f6['id'],'UserId':_0x5067d3['id']},'transaction':_0x1f9160});});}else{return;}})[_0x9796('0x32')](function(){for(var _0x54ea9f=0x0;_0x54ea9f<_0x459a9e[_0x9796('0x62')];_0x54ea9f++){var _0x1f1344=_0x459a9e[_0x54ea9f][_0x9796('0x117')](_0x9796('0x96'));var _0x3463ea=_0x1f1344+'QueueId';socket[_0x9796('0xa1')](_0x9796('0x35')+_0x1f1344+_0x9796('0xae'),{'UserId':_0x5067d3['id'],['queueField']:_0x459a9e[_0x54ea9f]['id']});}});});});}});}})[_0x9796('0x32')](respondWithStatusCode(_0x43de6d,null))[_0x9796('0x28')](handleError(_0x43de6d,null));};exports[_0x9796('0x11b')]=function(_0x42a555,_0x2916c0,_0x5a8893){var _0x392617={};var _0x3d22d3={};var _0x3ba883;var _0x14c956;return db['User'][_0x9796('0x8e')]({'where':{'id':_0x42a555[_0x9796('0x60')]['id']}})[_0x9796('0x32')](handleEntityNotFound(_0x2916c0,null))['then'](function(_0x56558c){if(_0x56558c){_0x3ba883=_0x56558c;_0x3d22d3['model']=_[_0x9796('0x61')](db['CmList'][_0x9796('0x43')]);_0x3d22d3[_0x9796('0x4a')]=_[_0x9796('0x61')](_0x42a555[_0x9796('0x4a')]);_0x3d22d3['filters']=_[_0x9796('0x4c')](_0x3d22d3[_0x9796('0x4d')],_0x3d22d3[_0x9796('0x4a')]);_0x392617['attributes']=_[_0x9796('0x4c')](_0x3d22d3[_0x9796('0x4d')],qs[_0x9796('0x4f')](_0x42a555[_0x9796('0x4a')][_0x9796('0x4f')]));_0x392617['attributes']=_0x392617[_0x9796('0x4e')][_0x9796('0x62')]?_0x392617[_0x9796('0x4e')]:_0x3d22d3[_0x9796('0x4d')];_0x392617[_0x9796('0x53')]=qs[_0x9796('0xbc')](_0x42a555[_0x9796('0x4a')][_0x9796('0xbc')]);_0x392617['where']=qs[_0x9796('0x4b')](_[_0x9796('0x55')](_0x42a555[_0x9796('0x4a')],_0x3d22d3[_0x9796('0x4b')]));if(_0x42a555['query'][_0x9796('0x56')]){_0x392617[_0x9796('0x54')]=_[_0x9796('0x5a')](_0x392617[_0x9796('0x54')],{'$or':_[_0x9796('0x3a')](_0x392617[_0x9796('0x4e')],function(_0x375e0c){var _0x51718c={};_0x51718c[_0x375e0c]={'$like':'%'+_0x42a555['query'][_0x9796('0x56')]+'%'};return _0x51718c;})});}_0x392617=_[_0x9796('0x5a')]({},_0x392617,_0x42a555['options']);return _0x3ba883[_0x9796('0x11b')](_0x392617);}})[_0x9796('0x32')](function(_0x9fe2ed){if(_0x9fe2ed){_0x14c956=_0x9fe2ed['length'];if(!_0x42a555[_0x9796('0x4a')][_0x9796('0x50')](_0x9796('0x51'))){_0x392617[_0x9796('0x52')]=qs[_0x9796('0x52')](_0x42a555['query'][_0x9796('0x52')]);_0x392617[_0x9796('0x2d')]=qs[_0x9796('0x2d')](_0x42a555[_0x9796('0x4a')][_0x9796('0x2d')]);}return _0x3ba883[_0x9796('0x11b')](_0x392617);}})[_0x9796('0x32')](function(_0x441d5a){if(_0x441d5a){return _0x441d5a?{'count':_0x14c956,'rows':_0x441d5a}:null;}})[_0x9796('0x32')](respondWithResult(_0x2916c0,null))[_0x9796('0x28')](handleError(_0x2916c0,null));};exports[_0x9796('0x11c')]=function(_0x4a9879,_0x552503,_0x45821a){var _0x49933e={};var _0x558bc8={};var _0x33a820;var _0x56b844;return db[_0x9796('0x5c')][_0x9796('0x8e')]({'where':{'id':_0x4a9879[_0x9796('0x60')]['id']}})[_0x9796('0x32')](handleEntityNotFound(_0x552503,null))[_0x9796('0x32')](function(_0x260596){if(_0x260596){_0x33a820=_0x260596;_0x558bc8[_0x9796('0x4d')]=_[_0x9796('0x61')](db['User'][_0x9796('0x43')]);_0x558bc8[_0x9796('0x4a')]=_[_0x9796('0x61')](_0x4a9879[_0x9796('0x4a')]);_0x558bc8[_0x9796('0x4b')]=_[_0x9796('0x4c')](_0x558bc8[_0x9796('0x4d')],_0x558bc8[_0x9796('0x4a')]);_0x49933e[_0x9796('0x4e')]=_[_0x9796('0x4c')](_0x558bc8[_0x9796('0x4d')],qs[_0x9796('0x4f')](_0x4a9879['query'][_0x9796('0x4f')]));_0x49933e['attributes']=_0x49933e[_0x9796('0x4e')][_0x9796('0x62')]?_0x49933e[_0x9796('0x4e')]:_0x558bc8[_0x9796('0x4d')];_0x49933e[_0x9796('0x53')]=qs[_0x9796('0xbc')](_0x4a9879['query'][_0x9796('0xbc')]);_0x49933e['where']=qs[_0x9796('0x4b')](_[_0x9796('0x55')](_0x4a9879[_0x9796('0x4a')],_0x558bc8['filters']));if(_0x4a9879[_0x9796('0x4a')]['filter']){_0x49933e['where']=_[_0x9796('0x5a')](_0x49933e[_0x9796('0x54')],{'$or':_[_0x9796('0x3a')](_0x49933e[_0x9796('0x4e')],function(_0x43e66a){var _0x4801b9={};_0x4801b9[_0x43e66a]={'$like':'%'+_0x4a9879[_0x9796('0x4a')][_0x9796('0x56')]+'%'};return _0x4801b9;})});}_0x49933e[_0x9796('0x4d')]=db['User'];_0x49933e['as']=_0x9796('0x36');_0x49933e=_[_0x9796('0x5a')]({},_0x49933e,_0x4a9879['options']);return _0x33a820['getVoiceQueues']({'include':[_0x49933e]});}})[_0x9796('0x32')](function(_0x30eb11){if(_0x30eb11){var _0x6c1b42={},_0x3b3ca4=[],_0x4e4f05=0x0;for(var _0x2ba44e=0x0;_0x2ba44e<_0x30eb11[_0x9796('0x62')];_0x2ba44e+=0x1){for(var _0x75884a=0x0,_0x94c6aa;_0x75884a<_0x30eb11[_0x2ba44e][_0x9796('0x36')][_0x9796('0x62')];_0x75884a+=0x1){_0x94c6aa=_0x30eb11[_0x2ba44e]['Agents'][_0x75884a][_0x9796('0x34')]({'plain':!![]});_0x6c1b42[_0x94c6aa['id']]=_0x94c6aa;}}_0x6c1b42=_['values'](_0x6c1b42);for(var _0x1a1cac=qs[_0x9796('0x2d')](_0x4a9879[_0x9796('0x4a')]['offset']);_0x1a1cac<_0x6c1b42['length']&&_0x3b3ca4['length']=_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
+var _0x3db2=['getLicense','agents','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','callysquare','LOGININPAUSE','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','code','error','User,\x20%s,\x20%s','message','result','User','findAll','options','raw','where','limit','map','model','attributes','include','info','GetUser','ShowUser','find','catch','PauseUser','name','internal','update','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','interface','body','type','role','MemberReport','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','findOne','isValidChannel','channel','chat','fax','sms','openchannel','set','Pause','UserVoiceQueueRt','system','all','destroy','LoginUser','mobile','phone','loginInPause','SIP/%s','count','agent','../../config/license/util'];(function(_0x5a5cba,_0x5d270b){var _0x3a7e16=function(_0x2f9098){while(--_0x2f9098){_0x5a5cba['push'](_0x5a5cba['shift']());}};_0x3a7e16(++_0x5d270b);}(_0x3db2,0x1bb));var _0x23db=function(_0x512b48,_0xa3924f){_0x512b48=_0x512b48-0x0;var _0x278a76=_0x3db2[_0x512b48];return _0x278a76;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x23db('0x0'));var BPromise=require('bluebird');var rs=require(_0x23db('0x1'));var fs=require('fs');var Redis=require(_0x23db('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x23db('0x3'));var logger=require(_0x23db('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x23db('0x5'));var client=jayson[_0x23db('0x6')][_0x23db('0x7')]({'port':0x232a});config[_0x23db('0x8')]=_[_0x23db('0x9')](config[_0x23db('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x23db('0xa'))(new Redis(config[_0x23db('0x8')]));require('./user.socket')[_0x23db('0xb')](socket);function respondWithRpcPromise(_0x360b78,_0xa6149f,_0xace545){return new BPromise(function(_0x94630b,_0x1d4e02){return client[_0x23db('0xc')](_0x360b78,_0xace545)[_0x23db('0xd')](function(_0x514add){logger['info']('User,\x20%s,\x20%s',_0xa6149f,_0x23db('0xe'));logger[_0x23db('0xf')](_0x23db('0x10'),_0xa6149f,'request\x20sent',JSON[_0x23db('0x11')](_0x514add));if(_0x514add['error']){if(_0x514add['error'][_0x23db('0x12')]===0x1f4){logger[_0x23db('0x13')](_0x23db('0x14'),_0xa6149f,_0x514add[_0x23db('0x13')][_0x23db('0x15')]);return _0x1d4e02(_0x514add[_0x23db('0x13')][_0x23db('0x15')]);}logger[_0x23db('0x13')](_0x23db('0x14'),_0xa6149f,_0x514add[_0x23db('0x13')][_0x23db('0x15')]);return _0x94630b(_0x514add[_0x23db('0x13')][_0x23db('0x15')]);}else{logger['info']('User,\x20%s,\x20%s',_0xa6149f,_0x23db('0xe'));_0x94630b(_0x514add[_0x23db('0x16')]['message']);}})['catch'](function(_0x105c84){logger[_0x23db('0x13')](_0x23db('0x14'),_0xa6149f,_0x105c84);_0x1d4e02(_0x105c84);});});}exports['GetUser']=function(_0x60e546){var _0x3a2f17=this;return new Promise(function(_0x436bbf,_0x3d5ae8){return db[_0x23db('0x17')][_0x23db('0x18')]({'raw':_0x60e546[_0x23db('0x19')]?_0x60e546[_0x23db('0x19')][_0x23db('0x1a')]===undefined?!![]:![]:!![],'where':_0x60e546[_0x23db('0x19')]?_0x60e546[_0x23db('0x19')][_0x23db('0x1b')]||null:null,'attributes':_0x60e546[_0x23db('0x19')]?_0x60e546['options']['attributes']||null:null,'limit':_0x60e546['options']?_0x60e546[_0x23db('0x19')][_0x23db('0x1c')]||null:null,'include':_0x60e546[_0x23db('0x19')]?_0x60e546[_0x23db('0x19')]['include']?_[_0x23db('0x1d')](_0x60e546[_0x23db('0x19')]['include'],function(_0x443d2a){return{'model':db[_0x443d2a[_0x23db('0x1e')]],'as':_0x443d2a['as'],'attributes':_0x443d2a[_0x23db('0x1f')],'include':_0x443d2a[_0x23db('0x20')]?_['map'](_0x443d2a[_0x23db('0x20')],function(_0xbc8096){return{'model':db[_0xbc8096[_0x23db('0x1e')]],'as':_0xbc8096['as'],'attributes':_0xbc8096[_0x23db('0x1f')],'include':_0xbc8096[_0x23db('0x20')]?_['map'](_0xbc8096[_0x23db('0x20')],function(_0x227971){return{'model':db[_0x227971[_0x23db('0x1e')]],'as':_0x227971['as'],'attributes':_0x227971['attributes']};}):[]};}):[]};}):[]:[]})[_0x23db('0xd')](function(_0x574f18){logger[_0x23db('0x21')](_0x23db('0x22'),_0x60e546);logger[_0x23db('0xf')](_0x23db('0x22'),_0x60e546,JSON[_0x23db('0x11')](_0x574f18));_0x436bbf(_0x574f18);})['catch'](function(_0x235afd){logger[_0x23db('0x13')]('GetUser',_0x235afd['message'],_0x60e546);_0x3d5ae8(_0x3a2f17[_0x23db('0x13')](0x1f4,_0x235afd[_0x23db('0x15')]));});});};exports[_0x23db('0x23')]=function(_0x434354){var _0x445511=this;return new Promise(function(_0x33bfee,_0x541332){return db[_0x23db('0x17')][_0x23db('0x24')]({'raw':_0x434354[_0x23db('0x19')]?_0x434354[_0x23db('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x434354['options']?_0x434354[_0x23db('0x19')]['where']||null:null,'attributes':_0x434354[_0x23db('0x19')]?_0x434354[_0x23db('0x19')][_0x23db('0x1f')]||null:null,'include':_0x434354['options']?_0x434354[_0x23db('0x19')][_0x23db('0x20')]?_[_0x23db('0x1d')](_0x434354['options'][_0x23db('0x20')],function(_0x1336b1){return{'model':db[_0x1336b1[_0x23db('0x1e')]],'as':_0x1336b1['as'],'attributes':_0x1336b1['attributes'],'include':_0x1336b1['include']?_[_0x23db('0x1d')](_0x1336b1['include'],function(_0x3d7a35){return{'model':db[_0x3d7a35[_0x23db('0x1e')]],'as':_0x3d7a35['as'],'attributes':_0x3d7a35['attributes'],'include':_0x3d7a35[_0x23db('0x20')]?_[_0x23db('0x1d')](_0x3d7a35['include'],function(_0x31f891){return{'model':db[_0x31f891[_0x23db('0x1e')]],'as':_0x31f891['as'],'attributes':_0x31f891[_0x23db('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x23db('0xd')](function(_0x54a2b8){logger['info'](_0x23db('0x23'),_0x434354);logger[_0x23db('0xf')](_0x23db('0x23'),_0x434354,JSON['stringify'](_0x54a2b8));_0x33bfee(_0x54a2b8);})[_0x23db('0x25')](function(_0xb81f5d){logger[_0x23db('0x13')](_0x23db('0x23'),_0xb81f5d[_0x23db('0x15')],_0x434354);_0x541332(_0x445511['error'](0x1f4,_0xb81f5d['message']));});});};exports[_0x23db('0x26')]=function(_0x1146ba){var _0x361394=this;return new Promise(function(_0x1399be,_0x4186d0){var _0x13b95a;return db[_0x23db('0x17')][_0x23db('0x24')]({'where':_0x1146ba[_0x23db('0x19')][_0x23db('0x1b')]||{},'attributes':['id',_0x23db('0x27'),'role',_0x23db('0x28'),'interface']})[_0x23db('0xd')](function(_0x4790e4){if(_0x4790e4){_0x13b95a=_0x4790e4;return db['UserVoiceQueueRt'][_0x23db('0x29')]({'paused':0x1},{'where':{'UserId':_0x13b95a['id']},'individualHooks':!![]});}})['then'](function(){if(_0x13b95a){return db['MemberReport'][_0x23db('0x18')]({'where':{'membername':_0x13b95a[_0x23db('0x27')],'type':_0x23db('0x2a'),'exitAt':null}});}})['then'](function(_0x5717c5){if(_0x13b95a){if(_0x5717c5&&_0x5717c5[_0x23db('0x2b')]){var _0x4b30ca=moment()[_0x23db('0x2c')](_0x23db('0x2d'));for(var _0x4238c8=0x0,_0x44f979=_0x5717c5[_0x23db('0x2b')];_0x4238c8<_0x44f979;_0x4238c8++){_0x5717c5[_0x4238c8][_0x23db('0x2e')]({'exitAt':_0x4b30ca});}}}})[_0x23db('0xd')](function(){if(_0x13b95a){var _0x1fdcfd=[];var _0x41b526=utils[_0x23db('0x2f')]();_0x41b526[_0x23db('0x30')](function(_0x350c2d){_0x1fdcfd[_0x23db('0x31')]({'channel':_0x350c2d,'membername':_0x13b95a[_0x23db('0x27')],'interface':_['isNil'](_0x13b95a[_0x23db('0x32')])?util[_0x23db('0x2c')]('SIP/%s',_0x13b95a[_0x23db('0x27')]):_0x13b95a['interface'],'type':_0x23db('0x2a'),'enterAt':moment()[_0x23db('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x1146ba[_0x23db('0x33')][_0x23db('0x34')]||'DEFAULT\x20PAUSE','role':_0x13b95a[_0x23db('0x35')],'internal':_0x13b95a[_0x23db('0x28')],'uniqueid':_0x1146ba[_0x23db('0x33')]['uniqueid']||null});});return db[_0x23db('0x36')][_0x23db('0x37')](_0x1fdcfd,{'individualHooks':!![]});}})['then'](function(){if(_0x13b95a){return _0x13b95a['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x1146ba[_0x23db('0x33')][_0x23db('0x34')]||_0x23db('0x38'),'lastPauseAt':moment()[_0x23db('0x2c')](_0x23db('0x2d'))});}})['then'](function(_0xc6febf){_0x1399be(_0xc6febf);})['catch'](function(_0x517536){_0x4186d0(_0x361394[_0x23db('0x13')](0x1f4,_0x517536[_0x23db('0x15')]));});});};exports[_0x23db('0x39')]=function(_0x4b4be3){var _0x329fad=this;return new Promise(function(_0x330e8f,_0x33f2a8){var _0x501f07;return db[_0x23db('0x17')][_0x23db('0x3a')]({'where':_0x4b4be3['options'][_0x23db('0x1b')]||{},'attributes':['id',_0x23db('0x27')]})[_0x23db('0xd')](function(_0x323bb9){if(_0x323bb9){_0x501f07=_0x323bb9;if(_0x4b4be3[_0x23db('0x33')]['channel']&&!utils[_0x23db('0x3b')](_0x4b4be3[_0x23db('0x33')][_0x23db('0x3c')])){throw new Error('Unknown\x20channel');}switch(_0x4b4be3[_0x23db('0x33')][_0x23db('0x3c')]){case'voice':return db['UserVoiceQueueRt'][_0x23db('0x29')]({'paused':0x0},{'where':{'UserId':_0x501f07['id']}})[_0x23db('0xd')](function(){return db[_0x23db('0x36')]['find']({'where':{'channel':_0x4b4be3[_0x23db('0x33')]['channel'],'membername':_0x501f07[_0x23db('0x27')],'type':'PAUSE','exitAt':null}});})[_0x23db('0xd')](function(_0x3e9a01){if(_0x3e9a01){return _0x3e9a01[_0x23db('0x29')]({'exitAt':moment()[_0x23db('0x2c')](_0x23db('0x2d')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x23db('0xd')](function(){return _0x501f07['update']({'voicePause':![]});});case'mail':case _0x23db('0x3d'):case _0x23db('0x3e'):case _0x23db('0x3f'):case _0x23db('0x40'):return db[_0x23db('0x36')][_0x23db('0x24')]({'where':{'channel':_0x4b4be3[_0x23db('0x33')][_0x23db('0x3c')],'membername':_0x501f07[_0x23db('0x27')],'type':_0x23db('0x2a'),'exitAt':null}})[_0x23db('0xd')](function(_0x5d77ac){return _0x5d77ac[_0x23db('0x29')]({'exitAt':moment()[_0x23db('0x2c')](_0x23db('0x2d')),'data2':'system'},{'individualHooks':!![]});})[_0x23db('0xd')](function(){var _0x191ec4={};_[_0x23db('0x41')](_0x191ec4,util[_0x23db('0x2c')]('%s%s',_0x4b4be3[_0x23db('0x33')][_0x23db('0x3c')],_0x23db('0x42')),![]);return _0x501f07[_0x23db('0x29')](_0x191ec4);});default:return db[_0x23db('0x43')][_0x23db('0x29')]({'paused':0x0},{'where':{'UserId':_0x501f07['id']}})[_0x23db('0xd')](function(){return db[_0x23db('0x36')][_0x23db('0x18')]({'where':{'membername':_0x501f07[_0x23db('0x27')],'type':_0x23db('0x2a'),'exitAt':null}});})[_0x23db('0xd')](function(_0xde729e){var _0x2dcb0c=[];_0xde729e[_0x23db('0x30')](function(_0x1904e1){_0x2dcb0c[_0x23db('0x31')](_0x1904e1[_0x23db('0x29')]({'exitAt':moment()[_0x23db('0x2c')](_0x23db('0x2d')),'data2':_0x23db('0x44')}));});return BPromise[_0x23db('0x45')](_0x2dcb0c);})[_0x23db('0xd')](function(){return _0x501f07[_0x23db('0x29')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x23db('0xd')](function(_0x39831f){_0x330e8f(_0x39831f);})[_0x23db('0x25')](function(_0x541c5a){_0x33f2a8(_0x329fad['error'](0x1f4,_0x541c5a[_0x23db('0x15')]));});});};exports['LogoutUser']=function(_0x45e280){var _0x50c90a=this;return new Promise(function(_0x1484bc,_0x1b283a){var _0x6b6d50;return db[_0x23db('0x17')]['findOne']({'where':_0x45e280[_0x23db('0x19')][_0x23db('0x1b')]||{},'attributes':['id',_0x23db('0x27')]})[_0x23db('0xd')](function(_0x2d38c4){if(_0x2d38c4){_0x6b6d50=_0x2d38c4;return db[_0x23db('0x43')][_0x23db('0x46')]({'where':{'membername':_0x6b6d50[_0x23db('0x27')]},'individualHooks':!![]});}})[_0x23db('0xd')](function(){if(_0x6b6d50){return db[_0x23db('0x36')][_0x23db('0x18')]({'where':{'membername':_0x6b6d50['name'],'exitAt':null}});}})[_0x23db('0xd')](function(_0x1865f3){if(_0x6b6d50){if(_0x1865f3&&_0x1865f3[_0x23db('0x2b')]){var _0x50cbcf=[];_0x1865f3[_0x23db('0x30')](function(_0x136885){_0x50cbcf[_0x23db('0x31')](_0x136885[_0x23db('0x29')]({'exitAt':moment()[_0x23db('0x2c')](_0x23db('0x2d'))}));});return BPromise[_0x23db('0x45')](_0x50cbcf);}}})['then'](function(){if(_0x6b6d50){return _0x6b6d50[_0x23db('0x29')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x23db('0xd')](function(_0x44e794){_0x1484bc(_0x44e794);})[_0x23db('0x25')](function(_0x34344a){_0x1b283a(_0x50c90a[_0x23db('0x13')](0x1f4,_0x34344a[_0x23db('0x15')]));});});};exports[_0x23db('0x47')]=function(_0x3654de){var _0x1c97a1=this;return new Promise(function(_0x2e2b8b,_0x2fd98c){var _0x527024;var _0xa9eef4;var _0x3057ee;var _0x3490e8;return db['User'][_0x23db('0x3a')]({'where':_0x3654de[_0x23db('0x19')][_0x23db('0x1b')]||{},'attributes':['id',_0x23db('0x27'),_0x23db('0x35'),_0x23db('0x48'),_0x23db('0x49'),_0x23db('0x28'),_0x23db('0x4a'),_0x23db('0x32')]})[_0x23db('0xd')](function(_0x15e346){if(_0x15e346){_0x527024=_0x15e346;_0x3490e8=_0x3654de[_0x23db('0x33')][_0x23db('0x32')]?_0x3654de[_0x23db('0x33')]['interface']:util[_0x23db('0x2c')](_0x23db('0x4b'),_0x527024[_0x23db('0x27')]);return db[_0x23db('0x17')][_0x23db('0x4c')]({'where':{'role':_0x23db('0x4d'),'online':!![],'id':{'$ne':_0x527024['id']}}});}})[_0x23db('0xd')](function(_0x44cf48){if(_0x44cf48){_0x3057ee=_0x44cf48;return require(_0x23db('0x4e'))[_0x23db('0x4f')]();}})['then'](function(_0x26b624){if(_0x26b624&&_0x26b624[_0x23db('0x50')]&&_0x3057ee>=_0x26b624[_0x23db('0x50')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x23db('0xd')](function(){if(_0x527024){return db[_0x23db('0x43')][_0x23db('0x46')]({'where':{'membername':_0x527024[_0x23db('0x27')]},'individualHooks':!![]});}})[_0x23db('0xd')](function(){if(_0x527024){return _0x527024[_0x23db('0x51')]({'raw':!![]});}})[_0x23db('0xd')](function(_0x5dce92){if(_0x527024){if(_0x5dce92){var _0x3f162d=[];_0xa9eef4=_0x5dce92;if(_0xa9eef4[_0x23db('0x2b')]){for(var _0x1c48e0=0x0;_0x1c48e0<_0xa9eef4['length'];_0x1c48e0++){_0x3f162d[_0x23db('0x31')](db[_0x23db('0x43')][_0x23db('0x52')]({'membername':_0x527024['name'],'UserId':_0x527024['id'],'queue_name':_0xa9eef4[_0x1c48e0][_0x23db('0x27')],'VoiceQueueId':_0xa9eef4[_0x1c48e0]['id'],'interface':_0x3490e8,'paused':_0x527024[_0x23db('0x4a')]||![],'penalty':_0xa9eef4[_0x1c48e0][_0x23db('0x53')]||0x0}));}return BPromise['all'](_0x3f162d);}}}})[_0x23db('0xd')](function(){if(_0x527024){return db[_0x23db('0x36')][_0x23db('0x18')]({'where':{'membername':_0x527024[_0x23db('0x27')],'exitAt':null}});}})[_0x23db('0xd')](function(_0x2620f9){if(_0x527024){if(_0x2620f9&&_0x2620f9[_0x23db('0x2b')]){var _0x20c682=[];_0x2620f9[_0x23db('0x30')](function(_0x4ae0f4){_0x20c682[_0x23db('0x31')](_0x4ae0f4['update']({'exitAt':moment()[_0x23db('0x2c')](_0x23db('0x2d'))}));});return BPromise[_0x23db('0x45')](_0x20c682);}}})[_0x23db('0xd')](function(_0x4e388e){if(_0x527024){var _0x1a7929=[];var _0x2c0def=[];var _0x548671=utils[_0x23db('0x2f')]();var _0x2712d9={'membername':_0x527024['name'],'interface':_0x3490e8,'enterAt':moment()[_0x23db('0x2c')](_0x23db('0x2d')),'role':_0x527024[_0x23db('0x35')],'internal':_0x527024['internal']};_0x548671[_0x23db('0x30')](function(_0x399416){_0x1a7929[_0x23db('0x31')](_[_0x23db('0x54')]({'channel':_0x399416,'type':'LOGIN','data1':_0x23db('0x55'),'data2':_0x3490e8},_0x2712d9));if(_0x527024[_0x23db('0x4a')]){_0x2c0def[_0x23db('0x31')](_[_0x23db('0x54')]({'channel':_0x399416,'type':'PAUSE','data1':_0x23db('0x56')},_0x2712d9));}});return db['MemberReport'][_0x23db('0x37')](_0x1a7929['concat'](_0x2c0def),{'individualHooks':!![]});}})[_0x23db('0xd')](function(){if(_0x527024){return _0x527024[_0x23db('0x29')]({'online':!![],'lastLoginAt':moment()[_0x23db('0x2c')](_0x23db('0x2d')),'voicePause':_0x527024[_0x23db('0x4a')]||![],'mailPause':_0x527024['loginInPause']||![],'chatPause':_0x527024[_0x23db('0x4a')]||![],'faxPause':_0x527024[_0x23db('0x4a')]||![],'smsPause':_0x527024['loginInPause']||![],'openchannelPause':_0x527024['loginInPause']||![],'pauseType':_0x527024[_0x23db('0x4a')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x23db('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x3490e8});}})['then'](function(_0x36906b){_0x2e2b8b(_0x36906b);})[_0x23db('0x25')](function(_0x5a516d){_0x2fd98c(_0x1c97a1[_0x23db('0x13')](0x1f4,_0x5a516d[_0x23db('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js
index 2cac8fc..5eb3d8d 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 _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
+var _0x66f3=['emit','register','length','user:','./user.events','save','remove','update'];(function(_0x3dbb67,_0xc55005){var _0x2d1b74=function(_0x50f863){while(--_0x50f863){_0x3dbb67['push'](_0x3dbb67['shift']());}};_0x2d1b74(++_0xc55005);}(_0x66f3,0xbc));var _0x366f=function(_0x4a1835,_0xe4a237){_0x4a1835=_0x4a1835-0x0;var _0x203f1b=_0x66f3[_0x4a1835];return _0x203f1b;};'use strict';var UserEvents=require(_0x366f('0x0'));var events=[_0x366f('0x1'),_0x366f('0x2'),_0x366f('0x3')];function createListener(_0x11ac54,_0x2483b1){return function(_0x87b42c){_0x2483b1[_0x366f('0x4')](_0x11ac54,_0x87b42c);};}function removeListener(_0x4a3ecd,_0x983bda){return function(){UserEvents['removeListener'](_0x4a3ecd,_0x983bda);};}exports[_0x366f('0x5')]=function(_0x5caca6){for(var _0x25168e=0x0,_0x5fba18=events[_0x366f('0x6')];_0x25168e<_0x5fba18;_0x25168e++){var _0x4b9513=events[_0x25168e];var _0x3cfbda=createListener(_0x366f('0x7')+_0x4b9513,_0x5caca6);UserEvents['on'](_0x4b9513,_0x3cfbda);}};
\ No newline at end of file
diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js
index 262665a..c25cee2 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 _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
+var _0x9976=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','exports','multer'];(function(_0x5794a3,_0x13eb5d){var _0x534c7c=function(_0x4c6f91){while(--_0x4c6f91){_0x5794a3['push'](_0x5794a3['shift']());}};_0x534c7c(++_0x13eb5d);}(_0x9976,0x11f));var _0x6997=function(_0x757e65,_0x300f53){_0x757e65=_0x757e65-0x0;var _0x2e7d9b=_0x9976[_0x757e65];return _0x2e7d9b;};'use strict';var multer=require(_0x6997('0x0'));var util=require(_0x6997('0x1'));var path=require(_0x6997('0x2'));var timeout=require(_0x6997('0x3'));var express=require(_0x6997('0x4'));var router=express[_0x6997('0x5')]();var auth=require(_0x6997('0x6'));var interaction=require(_0x6997('0x7'));var config=require('../../config/environment');module[_0x6997('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 88bf729..ed9aa91 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(_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
+var _0xd8b0=['exports','sequelize'];(function(_0x42a206,_0x2b1612){var _0x35eb3b=function(_0x3e5c46){while(--_0x3e5c46){_0x42a206['push'](_0x42a206['shift']());}};_0x35eb3b(++_0x2b1612);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js
index 030721e..3566797 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 _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
+var _0xaef9=['UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xaef9,0x182));var _0x9aef=function(_0x27acd4,_0x2cb514){_0x27acd4=_0x27acd4-0x0;var _0xa64ff3=_0xaef9[_0x27acd4];return _0xa64ff3;};'use strict';var _=require('lodash');var util=require(_0x9aef('0x0'));var logger=require(_0x9aef('0x1'))(_0x9aef('0x2'));var moment=require(_0x9aef('0x3'));var BPromise=require(_0x9aef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9aef('0x5'));var rimraf=require(_0x9aef('0x6'));var config=require(_0x9aef('0x7'));var attributes=require('./userChatQueue.attributes');module[_0x9aef('0x8')]=function(_0xff8ce7,_0x5eecf8){return _0xff8ce7[_0x9aef('0x9')](_0x9aef('0xa'),attributes,{'tableName':_0x9aef('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 b006195..7ff52b6 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 _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
+var _0x41b4=['jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x3cae69,_0x233c38){var _0x3128eb=function(_0x21d64e){while(--_0x21d64e){_0x3cae69['push'](_0x3cae69['shift']());}};_0x3128eb(++_0x233c38);}(_0x41b4,0x150));var _0x441b=function(_0x568f96,_0x32d489){_0x568f96=_0x568f96-0x0;var _0x5a053a=_0x41b4[_0x568f96];return _0x5a053a;};'use strict';var _=require(_0x441b('0x0'));var util=require(_0x441b('0x1'));var moment=require(_0x441b('0x2'));var BPromise=require(_0x441b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x441b('0x4'));var db=require(_0x441b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x441b('0x6'))(_0x441b('0x7'));var config=require(_0x441b('0x8'));var jayson=require(_0x441b('0x9'));var client=jayson[_0x441b('0xa')][_0x441b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x518425,_0xa3c66d,_0x279f08){return new BPromise(function(_0x431129,_0x3d4db8){return client[_0x441b('0xc')](_0x518425,_0x279f08)[_0x441b('0xd')](function(_0x2c4e49){logger[_0x441b('0xe')](_0x441b('0xf'),_0xa3c66d,_0x441b('0x10'));logger['debug'](_0x441b('0x11'),_0xa3c66d,_0x441b('0x10'),JSON[_0x441b('0x12')](_0x2c4e49));if(_0x2c4e49[_0x441b('0x13')]){if(_0x2c4e49['error'][_0x441b('0x14')]===0x1f4){logger['error'](_0x441b('0xf'),_0xa3c66d,_0x2c4e49[_0x441b('0x13')]['message']);return _0x3d4db8(_0x2c4e49[_0x441b('0x13')][_0x441b('0x15')]);}logger[_0x441b('0x13')](_0x441b('0xf'),_0xa3c66d,_0x2c4e49[_0x441b('0x13')][_0x441b('0x15')]);return _0x431129(_0x2c4e49['error'][_0x441b('0x15')]);}else{logger[_0x441b('0xe')](_0x441b('0xf'),_0xa3c66d,_0x441b('0x10'));_0x431129(_0x2c4e49[_0x441b('0x16')][_0x441b('0x15')]);}})['catch'](function(_0x56e63a){logger[_0x441b('0x13')]('UserChatQueue,\x20%s,\x20%s',_0xa3c66d,_0x56e63a);_0x3d4db8(_0x56e63a);});});}
\ No newline at end of file
diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js
index 93abf71..fcf1d71 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 _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
+var _0xeefe=['util','express','Router','../../components/interaction/service','../../config/environment','multer'];(function(_0x4dc539,_0x68f43c){var _0x48782b=function(_0x2a203b){while(--_0x2a203b){_0x4dc539['push'](_0x4dc539['shift']());}};_0x48782b(++_0x68f43c);}(_0xeefe,0x119));var _0xeeef=function(_0x46ec87,_0x527194){_0x46ec87=_0x46ec87-0x0;var _0x2ddae8=_0xeefe[_0x46ec87];return _0x2ddae8;};'use strict';var multer=require(_0xeeef('0x0'));var util=require(_0xeeef('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeeef('0x2'));var router=express[_0xeeef('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xeeef('0x4'));var config=require(_0xeeef('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 b2deb71..64a8e66 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 _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
+var _0x80ed=['INTEGER','STRING','sequelize'];(function(_0x25406d,_0xde26bf){var _0x20bfa2=function(_0x24e45e){while(--_0x24e45e){_0x25406d['push'](_0x25406d['shift']());}};_0x20bfa2(++_0xde26bf);}(_0x80ed,0x11c));var _0xd80e=function(_0x39d928,_0x572e72){_0x39d928=_0x39d928-0x0;var _0x2b26a8=_0x80ed[_0x39d928];return _0x2b26a8;};'use strict';var Sequelize=require(_0xd80e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xd80e('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xd80e('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xd80e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js
index dc35960..e82de44 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 _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
+var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','../../config/logger'];(function(_0x4d121d,_0x3fe733){var _0xffa031=function(_0x1fec1b){while(--_0x1fec1b){_0x4d121d['push'](_0x4d121d['shift']());}};_0xffa031(++_0x3fe733);}(_0xb10b,0x12a));var _0xbb10=function(_0xfc2644,_0x4a3b13){_0xfc2644=_0xfc2644-0x0;var _0x4873b7=_0xb10b[_0xfc2644];return _0x4873b7;};'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')]('UserFaxQueue',attributes,{'tableName':_0xbb10('0xb'),'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 3af841a..a2ca691 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 _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
+var _0x6e1c=['rpc','../../config/environment','jayson/promise','client','http','request','info','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4c8b0e,_0x4bad2b){var _0x2e784e=function(_0x28ccc0){while(--_0x28ccc0){_0x4c8b0e['push'](_0x4c8b0e['shift']());}};_0x2e784e(++_0x4bad2b);}(_0x6e1c,0xb6));var _0xc6e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e1c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc6e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc6e1('0x1'));var rs=require(_0xc6e1('0x2'));var fs=require('fs');var Redis=require(_0xc6e1('0x3'));var db=require(_0xc6e1('0x4'))['db'];var utils=require(_0xc6e1('0x5'));var logger=require(_0xc6e1('0x6'))(_0xc6e1('0x7'));var config=require(_0xc6e1('0x8'));var jayson=require(_0xc6e1('0x9'));var client=jayson[_0xc6e1('0xa')][_0xc6e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5247f1,_0x3ff10c,_0x1242d5){return new BPromise(function(_0x39000a,_0x2ffee0){return client[_0xc6e1('0xc')](_0x5247f1,_0x1242d5)['then'](function(_0xa29af9){logger[_0xc6e1('0xd')](_0xc6e1('0xe'),_0x3ff10c,'request\x20sent');logger['debug'](_0xc6e1('0xf'),_0x3ff10c,_0xc6e1('0x10'),JSON['stringify'](_0xa29af9));if(_0xa29af9[_0xc6e1('0x11')]){if(_0xa29af9[_0xc6e1('0x11')][_0xc6e1('0x12')]===0x1f4){logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0xa29af9[_0xc6e1('0x11')]['message']);return _0x2ffee0(_0xa29af9[_0xc6e1('0x11')][_0xc6e1('0x13')]);}logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0xa29af9[_0xc6e1('0x11')]['message']);return _0x39000a(_0xa29af9['error'][_0xc6e1('0x13')]);}else{logger[_0xc6e1('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x3ff10c,_0xc6e1('0x10'));_0x39000a(_0xa29af9[_0xc6e1('0x14')][_0xc6e1('0x13')]);}})['catch'](function(_0x44ef6c){logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0x44ef6c);_0x2ffee0(_0x44ef6c);});});}
\ No newline at end of file
diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js
index cd6f71c..59854c9 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 _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
+var _0x10f3=['../../components/interaction/service','exports','multer','util','path','connect-timeout','express'];(function(_0x52c9fa,_0x372fbf){var _0x4a4bbc=function(_0x68b742){while(--_0x68b742){_0x52c9fa['push'](_0x52c9fa['shift']());}};_0x4a4bbc(++_0x372fbf);}(_0x10f3,0xb1));var _0x310f=function(_0x4be431,_0x5b576a){_0x4be431=_0x4be431-0x0;var _0x347bca=_0x10f3[_0x4be431];return _0x347bca;};'use strict';var multer=require(_0x310f('0x0'));var util=require(_0x310f('0x1'));var path=require(_0x310f('0x2'));var timeout=require(_0x310f('0x3'));var express=require(_0x310f('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x310f('0x5'));var config=require('../../config/environment');module[_0x310f('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js
index 2f7e954..18e981f 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 _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
+var _0xe706=['INTEGER','sequelize','exports'];(function(_0x5a5422,_0x485c4f){var _0x14cb82=function(_0x2bfc63){while(--_0x2bfc63){_0x5a5422['push'](_0x5a5422['shift']());}};_0x14cb82(++_0x485c4f);}(_0xe706,0xa3));var _0x6e70=function(_0x53b37c,_0x1e3dae){_0x53b37c=_0x53b37c-0x0;var _0x912a5=_0xe706[_0x53b37c];return _0x912a5;};'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/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js
index c05549d..2f247b6 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(_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
+var _0xa9e0=['../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x128e71,_0x21eea8){var _0x938bdb=function(_0x386713){while(--_0x386713){_0x128e71['push'](_0x128e71['shift']());}};_0x938bdb(++_0x21eea8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 e1d36f0..802f039 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 _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
+var _0xc569=['then','request\x20sent','debug','error','code','UserMailQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xc569,0x159));var _0x9c56=function(_0x535a53,_0x542718){_0x535a53=_0x535a53-0x0;var _0x2919a3=_0xc569[_0x535a53];return _0x2919a3;};'use strict';var _=require(_0x9c56('0x0'));var util=require(_0x9c56('0x1'));var moment=require(_0x9c56('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c56('0x3'));var fs=require('fs');var Redis=require(_0x9c56('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c56('0x5'));var logger=require(_0x9c56('0x6'))(_0x9c56('0x7'));var config=require('../../config/environment');var jayson=require(_0x9c56('0x8'));var client=jayson[_0x9c56('0x9')][_0x9c56('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38a9cf,_0x564e30,_0x15206f){return new BPromise(function(_0xaba9c7,_0x35baa0){return client[_0x9c56('0xb')](_0x38a9cf,_0x15206f)[_0x9c56('0xc')](function(_0x582e29){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x564e30,_0x9c56('0xd'));logger[_0x9c56('0xe')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x564e30,_0x9c56('0xd'),JSON['stringify'](_0x582e29));if(_0x582e29[_0x9c56('0xf')]){if(_0x582e29[_0x9c56('0xf')][_0x9c56('0x10')]===0x1f4){logger[_0x9c56('0xf')](_0x9c56('0x11'),_0x564e30,_0x582e29[_0x9c56('0xf')][_0x9c56('0x12')]);return _0x35baa0(_0x582e29['error'][_0x9c56('0x12')]);}logger[_0x9c56('0xf')](_0x9c56('0x11'),_0x564e30,_0x582e29[_0x9c56('0xf')][_0x9c56('0x12')]);return _0xaba9c7(_0x582e29['error'][_0x9c56('0x12')]);}else{logger['info'](_0x9c56('0x11'),_0x564e30,_0x9c56('0xd'));_0xaba9c7(_0x582e29[_0x9c56('0x13')][_0x9c56('0x12')]);}})[_0x9c56('0x14')](function(_0x20467d){logger[_0x9c56('0xf')](_0x9c56('0x11'),_0x564e30,_0x20467d);_0x35baa0(_0x20467d);});});}
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js
index 208f549..ceb8ef7 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 _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
+var _0xf8aa=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0x168484,_0x3124ad){var _0x3af701=function(_0x552ef3){while(--_0x552ef3){_0x168484['push'](_0x168484['shift']());}};_0x3af701(++_0x3124ad);}(_0xf8aa,0x126));var _0xaf8a=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xf8aa[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require(_0xaf8a('0x0'));var util=require(_0xaf8a('0x1'));var path=require(_0xaf8a('0x2'));var timeout=require(_0xaf8a('0x3'));var express=require('express');var router=express[_0xaf8a('0x4')]();var auth=require(_0xaf8a('0x5'));var interaction=require(_0xaf8a('0x6'));var config=require(_0xaf8a('0x7'));module[_0xaf8a('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
index 81576c4..5b1d176 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 _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
+var _0xe706=['INTEGER','sequelize','exports'];(function(_0x4e13f6,_0x55677f){var _0x30a767=function(_0x496a6c){while(--_0x496a6c){_0x4e13f6['push'](_0x4e13f6['shift']());}};_0x30a767(++_0x55677f);}(_0xe706,0xa3));var _0x6e70=function(_0x150a67,_0x4406ca){_0x150a67=_0x150a67-0x0;var _0x505c8f=_0xe706[_0x150a67];return _0x505c8f;};'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/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
index d58b058..d0e482b 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 _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
+var _0x4d2d=['./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x210b71,_0x46c412){var _0x2551a3=function(_0x1fce22){while(--_0x1fce22){_0x210b71['push'](_0x210b71['shift']());}};_0x2551a3(++_0x46c412);}(_0x4d2d,0x17a));var _0xd4d2=function(_0x3f9584,_0x5ab12c){_0x3f9584=_0x3f9584-0x0;var _0x9d54c=_0x4d2d[_0x3f9584];return _0x9d54c;};'use strict';var _=require(_0xd4d2('0x0'));var util=require('util');var logger=require(_0xd4d2('0x1'))(_0xd4d2('0x2'));var moment=require('moment');var BPromise=require(_0xd4d2('0x3'));var rp=require(_0xd4d2('0x4'));var fs=require('fs');var path=require(_0xd4d2('0x5'));var rimraf=require('rimraf');var config=require(_0xd4d2('0x6'));var attributes=require(_0xd4d2('0x7'));module[_0xd4d2('0x8')]=function(_0x4ca991,_0x39b61c){return _0x4ca991[_0xd4d2('0x9')](_0xd4d2('0xa'),attributes,{'tableName':'user_has_openchannel_queues','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 4ac401a..3bcfd52 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 _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
+var _0xba61=['request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x2a4b27,_0x415629){var _0x22192b=function(_0x53b1a6){while(--_0x53b1a6){_0x2a4b27['push'](_0x2a4b27['shift']());}};_0x22192b(++_0x415629);}(_0xba61,0xf1));var _0x1ba6=function(_0x1cb2d,_0x1a35c7){_0x1cb2d=_0x1cb2d-0x0;var _0x1882e9=_0xba61[_0x1cb2d];return _0x1882e9;};'use strict';var _=require(_0x1ba6('0x0'));var util=require(_0x1ba6('0x1'));var moment=require(_0x1ba6('0x2'));var BPromise=require(_0x1ba6('0x3'));var rs=require(_0x1ba6('0x4'));var fs=require('fs');var Redis=require(_0x1ba6('0x5'));var db=require(_0x1ba6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ba6('0x7'))(_0x1ba6('0x8'));var config=require(_0x1ba6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1ba6('0xa')][_0x1ba6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26d90a,_0x14061d,_0x518494){return new BPromise(function(_0x2c81a4,_0x49226f){return client[_0x1ba6('0xc')](_0x26d90a,_0x518494)[_0x1ba6('0xd')](function(_0x174025){logger[_0x1ba6('0xe')](_0x1ba6('0xf'),_0x14061d,_0x1ba6('0x10'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x14061d,_0x1ba6('0x10'),JSON[_0x1ba6('0x11')](_0x174025));if(_0x174025[_0x1ba6('0x12')]){if(_0x174025[_0x1ba6('0x12')][_0x1ba6('0x13')]===0x1f4){logger[_0x1ba6('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x14061d,_0x174025[_0x1ba6('0x12')]['message']);return _0x49226f(_0x174025[_0x1ba6('0x12')]['message']);}logger[_0x1ba6('0x12')](_0x1ba6('0xf'),_0x14061d,_0x174025[_0x1ba6('0x12')][_0x1ba6('0x14')]);return _0x2c81a4(_0x174025[_0x1ba6('0x12')][_0x1ba6('0x14')]);}else{logger[_0x1ba6('0xe')](_0x1ba6('0xf'),_0x14061d,_0x1ba6('0x10'));_0x2c81a4(_0x174025[_0x1ba6('0x15')][_0x1ba6('0x14')]);}})[_0x1ba6('0x16')](function(_0x56777f){logger[_0x1ba6('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x14061d,_0x56777f);_0x49226f(_0x56777f);});});}
\ No newline at end of file
diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js
index 40bdce0..45c34a5 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 _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
+var _0x267b=['/:id','update','delete','destroy','removeSections','/:id/resources','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','/:id/sections','post','create','clone','addSections','addResources'];(function(_0x4a104c,_0x31eb74){var _0x11f870=function(_0x3b18c3){while(--_0x3b18c3){_0x4a104c['push'](_0x4a104c['shift']());}};_0x11f870(++_0x31eb74);}(_0x267b,0x130));var _0xb267=function(_0x2d1fb2,_0x2640e4){_0x2d1fb2=_0x2d1fb2-0x0;var _0x4a484d=_0x267b[_0x2d1fb2];return _0x4a484d;};'use strict';var multer=require(_0xb267('0x0'));var util=require(_0xb267('0x1'));var path=require(_0xb267('0x2'));var timeout=require('connect-timeout');var express=require(_0xb267('0x3'));var router=express[_0xb267('0x4')]();var auth=require(_0xb267('0x5'));var interaction=require(_0xb267('0x6'));var config=require(_0xb267('0x7'));var controller=require('./userProfile.controller');router[_0xb267('0x8')]('/',auth['isAuthenticated'](),controller[_0xb267('0x9')]);router['get'](_0xb267('0xa'),auth[_0xb267('0xb')](),controller[_0xb267('0xc')]);router[_0xb267('0x8')]('/:id',auth[_0xb267('0xb')](),controller[_0xb267('0xd')]);router[_0xb267('0x8')](_0xb267('0xe'),auth[_0xb267('0xb')](),controller['getSections']);router[_0xb267('0x8')]('/:id/resources',auth[_0xb267('0xb')](),controller['getResources']);router[_0xb267('0xf')]('/',auth['isAuthenticated'](),controller[_0xb267('0x10')]);router[_0xb267('0xf')]('/:id/clone',auth[_0xb267('0xb')](),controller[_0xb267('0x11')]);router[_0xb267('0xf')](_0xb267('0xe'),auth[_0xb267('0xb')](),controller[_0xb267('0x12')]);router['post']('/:id/resources',auth[_0xb267('0xb')](),controller[_0xb267('0x13')]);router['put'](_0xb267('0x14'),auth[_0xb267('0xb')](),controller[_0xb267('0x15')]);router[_0xb267('0x16')]('/:id',auth[_0xb267('0xb')](),controller[_0xb267('0x17')]);router['delete'](_0xb267('0xe'),auth[_0xb267('0xb')](),controller[_0xb267('0x18')]);router[_0xb267('0x16')](_0xb267('0x19'),auth[_0xb267('0xb')](),controller['removeResources']);module[_0xb267('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js
index 4400112..72425f0 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 _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
+var _0x505c=['sequelize','STRING','name','setDataValue','crudPermissions','getDataValue','split'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x505c,0x149));var _0xc505=function(_0x48f4c5,_0x56e4c3){_0x48f4c5=_0x48f4c5-0x0;var _0x40ab65=_0x505c[_0x48f4c5];return _0x40ab65;};'use strict';var Sequelize=require(_0xc505('0x0'));module['exports']={'name':{'type':Sequelize[_0xc505('0x1')],'allowNull':![],'unique':_0xc505('0x2')},'crudPermissions':{'type':Sequelize[_0xc505('0x1')],'set':function(_0x132a07){this[_0xc505('0x3')](_0xc505('0x4'),_0x132a07?_0x132a07['join'](''):[]);},'get':function(){return this[_0xc505('0x5')](_0xc505('0x4'))?this[_0xc505('0x5')]('crudPermissions')[_0xc505('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xc505('0x1')],'allowNull':!![]}};
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js
index ce421ab..62e17d7 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 _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
+var _0xe728=['globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','FaxAccount','inboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','agents','telephones','Users','admin','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','pauses','Pause','scheduler','Schedule','Sound','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','catch','show','params','includeAll','options','create','body','clone','find','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','Resources','destroy','describe','addSections','push','removeSections','ids','getSections','includes','isEmpty','enabled','subsections','findOne','Dashboard','forEach','userProfileId','bulkCreate','removeResources','getResources','section','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','undefined','Invalid\x20section\x20\x27','parentSections','all','ignore','nolimit','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','DefaultReports','CustomReports','rows','CmContact','Tag','Tags','color','tag','ThroughTags','value','resourceId','toLowerCase','squareprojects','SquareProject','SquareOdbc','squarerecordings','SquareRecording','projectName','JscriptyProject','contacts','lists','CmList','companies','CmCompany'];(function(_0x436194,_0x5bf22c){var _0x43fc99=function(_0xc3bf0f){while(--_0xc3bf0f){_0x436194['push'](_0x436194['shift']());}};_0x43fc99(++_0x5bf22c);}(_0xe728,0x14e));var _0x8e72=function(_0x339070,_0x58c633){_0x339070=_0x339070-0x0;var _0x1b94ea=_0xe728[_0x339070];return _0x1b94ea;};'use strict';var pdf=require(_0x8e72('0x0'));var emlformat=require(_0x8e72('0x1'));var rimraf=require(_0x8e72('0x2'));var zipdir=require(_0x8e72('0x3'));var jsonpatch=require(_0x8e72('0x4'));var rp=require('request-promise');var moment=require(_0x8e72('0x5'));var BPromise=require(_0x8e72('0x6'));var Mustache=require(_0x8e72('0x7'));var util=require('util');var path=require(_0x8e72('0x8'));var sox=require(_0x8e72('0x9'));var csv=require(_0x8e72('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8e72('0xb'));var squel=require(_0x8e72('0xc'));var crypto=require('crypto');var jsforce=require(_0x8e72('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8e72('0xa'));var querystring=require(_0x8e72('0xe'));var Papa=require(_0x8e72('0xf'));var Redis=require(_0x8e72('0x10'));var authService=require(_0x8e72('0x11'));var qs=require(_0x8e72('0x12'));var as=require(_0x8e72('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8e72('0x14'))(_0x8e72('0x15'));var utils=require('../../config/utils');var config=require(_0x8e72('0x16'));var db=require(_0x8e72('0x17'))['db'];config['redis']=_[_0x8e72('0x18')](config[_0x8e72('0x19')],{'host':_0x8e72('0x1a'),'port':0x18eb});var socket=require(_0x8e72('0x1b'))(new Redis(config['redis']));require('./userProfile.socket')[_0x8e72('0x1c')](socket);function respondWithStatusCode(_0x3ea6c7,_0x167fac){_0x167fac=_0x167fac||0xcc;return function(_0x2d90d1){if(_0x2d90d1){return _0x3ea6c7[_0x8e72('0x1d')](_0x167fac);}return _0x3ea6c7[_0x8e72('0x1e')](_0x167fac)[_0x8e72('0x1f')]();};}function respondWithResult(_0x453ecf,_0x3965f8){_0x3965f8=_0x3965f8||0xc8;return function(_0x9cf81f){if(_0x9cf81f){return _0x453ecf[_0x8e72('0x1e')](_0x3965f8)['json'](_0x9cf81f);}};}function respondWithFilteredResult(_0x3f8189,_0x415d17){return function(_0x141d67){if(_0x141d67){var _0x213c86=_0x141d67[_0x8e72('0x20')],_0xba90ea=_0x415d17[_0x8e72('0x21')],_0x358af0=_0x415d17[_0x8e72('0x21')]+_0x415d17[_0x8e72('0x22')],_0x4b2ac8;if(_0x358af0>=_0x213c86){_0x358af0=_0x213c86;_0x4b2ac8=0xc8;}else{_0x4b2ac8=0xce;}_0x3f8189[_0x8e72('0x1e')](_0x4b2ac8);return _0x3f8189[_0x8e72('0x23')](_0x8e72('0x24'),_0xba90ea+'-'+_0x358af0+'/'+_0x213c86)[_0x8e72('0x25')](_0x141d67);}return null;};}function patchUpdates(_0x1cf9fb){return function(_0x5c7daf){try{jsonpatch[_0x8e72('0x26')](_0x5c7daf,_0x1cf9fb,!![]);}catch(_0x1d7661){return BPromise[_0x8e72('0x27')](_0x1d7661);}return _0x5c7daf['save']();};}function saveUpdates(_0x55bfa7,_0x532e72){return function(_0x18eaa1){if(_0x18eaa1){return _0x18eaa1['update'](_0x55bfa7)[_0x8e72('0x28')](function(_0x1b0749){return _0x1b0749;});}return null;};}function removeEntity(_0x3a3263,_0x4f097c){return function(_0x544719){if(_0x544719){return _0x544719['destroy']()[_0x8e72('0x28')](function(){_0x3a3263[_0x8e72('0x1e')](0xcc)[_0x8e72('0x1f')]();});}};}function handleEntityNotFound(_0x2e25d1,_0x57ae51){return function(_0x43961e){if(!_0x43961e){_0x2e25d1['sendStatus'](0x194);}return _0x43961e;};}function handleError(_0x3f6d24,_0x116130){_0x116130=_0x116130||0x1f4;return function(_0x52b0c8){logger[_0x8e72('0x29')](_0x52b0c8[_0x8e72('0x2a')]);if(_0x52b0c8[_0x8e72('0x2b')]){delete _0x52b0c8['name'];}_0x3f6d24['status'](_0x116130)[_0x8e72('0x2c')](_0x52b0c8);};}exports[_0x8e72('0x2d')]=function(_0x269078,_0x236322){var _0x167eed={},_0x121051={},_0x2a241a={'count':0x0,'rows':[]};var _0x1acf23=_[_0x8e72('0x2e')](db[_0x8e72('0x2f')][_0x8e72('0x30')],function(_0x421884){return{'name':_0x421884[_0x8e72('0x31')],'type':_0x421884[_0x8e72('0x32')][_0x8e72('0x33')]};});_0x121051[_0x8e72('0x34')]=_[_0x8e72('0x2e')](_0x1acf23,_0x8e72('0x2b'));_0x121051[_0x8e72('0x35')]=_[_0x8e72('0x36')](_0x269078[_0x8e72('0x35')]);_0x121051[_0x8e72('0x37')]=_[_0x8e72('0x38')](_0x121051[_0x8e72('0x34')],_0x121051[_0x8e72('0x35')]);_0x167eed[_0x8e72('0x39')]=_[_0x8e72('0x38')](_0x121051['model'],qs['fields'](_0x269078[_0x8e72('0x35')][_0x8e72('0x3a')]));_0x167eed['attributes']=_0x167eed[_0x8e72('0x39')][_0x8e72('0x3b')]?_0x167eed['attributes']:_0x121051[_0x8e72('0x34')];if(!_0x269078[_0x8e72('0x35')][_0x8e72('0x3c')]('nolimit')){_0x167eed[_0x8e72('0x22')]=qs[_0x8e72('0x22')](_0x269078[_0x8e72('0x35')][_0x8e72('0x22')]);_0x167eed[_0x8e72('0x21')]=qs[_0x8e72('0x21')](_0x269078['query'][_0x8e72('0x21')]);}_0x167eed[_0x8e72('0x3d')]=qs[_0x8e72('0x3e')](_0x269078['query']['sort']);_0x167eed['where']=qs[_0x8e72('0x37')](_[_0x8e72('0x3f')](_0x269078[_0x8e72('0x35')],_0x121051['filters']),_0x1acf23);if(_0x269078['query'][_0x8e72('0x40')]){_0x167eed[_0x8e72('0x41')]=_[_0x8e72('0x42')](_0x167eed[_0x8e72('0x41')],{'$or':_[_0x8e72('0x2e')](_0x1acf23,function(_0x1fff2d){if(_0x1fff2d[_0x8e72('0x32')]!==_0x8e72('0x43')){var _0x21b87c={};_0x21b87c[_0x1fff2d[_0x8e72('0x2b')]]={'$like':'%'+_0x269078[_0x8e72('0x35')][_0x8e72('0x40')]+'%'};return _0x21b87c;}})});}_0x167eed=_[_0x8e72('0x42')]({},_0x167eed,_0x269078['options']);var _0x5e7bdc={'where':_0x167eed[_0x8e72('0x41')]};return db[_0x8e72('0x2f')][_0x8e72('0x20')](_0x5e7bdc)[_0x8e72('0x28')](function(_0x155cde){_0x2a241a['count']=_0x155cde;if(_0x269078['query']['includeAll']){_0x167eed[_0x8e72('0x44')]=[{'all':!![]}];}return db[_0x8e72('0x2f')][_0x8e72('0x45')](_0x167eed);})[_0x8e72('0x28')](function(_0x294d34){_0x2a241a['rows']=_0x294d34;return _0x2a241a;})[_0x8e72('0x28')](respondWithFilteredResult(_0x236322,_0x167eed))[_0x8e72('0x46')](handleError(_0x236322,null));};exports[_0x8e72('0x47')]=function(_0x16426b,_0x4cd273){var _0x3cbf1a={'raw':![],'where':{'id':_0x16426b[_0x8e72('0x48')]['id']}},_0x610731={};_0x610731[_0x8e72('0x34')]=_[_0x8e72('0x36')](db[_0x8e72('0x2f')]['rawAttributes']);_0x610731['query']=_[_0x8e72('0x36')](_0x16426b[_0x8e72('0x35')]);_0x610731[_0x8e72('0x37')]=_['intersection'](_0x610731['model'],_0x610731[_0x8e72('0x35')]);_0x3cbf1a[_0x8e72('0x39')]=_[_0x8e72('0x38')](_0x610731['model'],qs['fields'](_0x16426b[_0x8e72('0x35')]['fields']));_0x3cbf1a[_0x8e72('0x39')]=_0x3cbf1a[_0x8e72('0x39')][_0x8e72('0x3b')]?_0x3cbf1a[_0x8e72('0x39')]:_0x610731[_0x8e72('0x34')];if(_0x16426b['query'][_0x8e72('0x49')]){_0x3cbf1a[_0x8e72('0x44')]=[{'all':!![]}];}_0x3cbf1a=_[_0x8e72('0x42')]({},_0x3cbf1a,_0x16426b[_0x8e72('0x4a')]);return db[_0x8e72('0x2f')]['find'](_0x3cbf1a)['then'](handleEntityNotFound(_0x4cd273,null))[_0x8e72('0x28')](respondWithResult(_0x4cd273,null))[_0x8e72('0x46')](handleError(_0x4cd273,null));};exports[_0x8e72('0x4b')]=function(_0x38ec07,_0x31c39b){return db['UserProfile']['create'](_0x38ec07[_0x8e72('0x4c')],{})[_0x8e72('0x28')](respondWithResult(_0x31c39b,0xc9))[_0x8e72('0x46')](handleError(_0x31c39b,null));};exports[_0x8e72('0x4d')]=function(_0x37da7a,_0x11c6d8){var _0x358766={'where':{'id':_0x37da7a[_0x8e72('0x48')]['id']}},_0x407d48={};_0x407d48['model']=_[_0x8e72('0x36')](db[_0x8e72('0x2f')][_0x8e72('0x30')]);_0x358766[_0x8e72('0x39')]=_[_0x8e72('0x38')](_0x407d48['model'],qs[_0x8e72('0x3a')](_0x37da7a[_0x8e72('0x35')]['fields']));_0x358766[_0x8e72('0x39')]=_0x358766[_0x8e72('0x39')][_0x8e72('0x3b')]?_0x358766['attributes']:_0x407d48[_0x8e72('0x34')];if(_0x37da7a[_0x8e72('0x35')][_0x8e72('0x49')]){_0x358766[_0x8e72('0x44')]=[{'all':!![]}];}_0x358766=_[_0x8e72('0x42')]({},_0x358766,_0x37da7a['options']);return db['UserProfile'][_0x8e72('0x4e')](_0x358766)[_0x8e72('0x28')](handleEntityNotFound(_0x11c6d8,null))[_0x8e72('0x28')](function(_0x55b958){if(_0x55b958){var _0x50f6f1=_0x55b958[_0x8e72('0x4f')]({'plain':!![]});_0x50f6f1=qs[_0x8e72('0x50')](_0x50f6f1,['id',_0x8e72('0x51'),_0x8e72('0x52'),_0x8e72('0x53')]);_0x37da7a['body']=_[_0x8e72('0x50')](_0x37da7a['body'],['id',_0x8e72('0x51'),_0x8e72('0x52')]);return db[_0x8e72('0x54')][_0x8e72('0x55')](function(_0x3205f8){return db['UserProfile'][_0x8e72('0x4b')](_[_0x8e72('0x42')](_0x50f6f1,_0x37da7a[_0x8e72('0x4c')]),{'include':_0x37da7a[_0x8e72('0x35')][_0x8e72('0x49')]?[{'all':!![]}]:undefined,'transaction':_0x3205f8})[_0x8e72('0x28')](function(_0x53ecb6){var _0xe805cc=_0x53ecb6[_0x8e72('0x4f')]({'plain':!![]});return db[_0x8e72('0x56')]['findAll']({'where':{'userProfileId':_0x37da7a[_0x8e72('0x48')]['id']},'raw':!![]})['then'](function(_0xde2d9){if(_0xde2d9){return BPromise[_0x8e72('0x57')](_0xde2d9,function(_0x443421){return new BPromise(function(_0x51baa4,_0x5c9337){if(_0x443421[_0x8e72('0x58')]===null||_0x443421['autoAssociation']===0x1)_0x51baa4(null);return db[_0x8e72('0x59')]['findAll']({'where':{'sectionId':_0x443421['id']},'raw':!![]})['then'](function(_0x22d135){var _0x371adc=_['map'](_0x22d135,function(_0x272374){return qs[_0x8e72('0x50')](_0x272374,['id',_0x8e72('0x51'),_0x8e72('0x52'),_0x8e72('0x5a')]);});_0x51baa4(_0x371adc);})[_0x8e72('0x46')](function(_0x4b30b6){_0x5c9337(_0x4b30b6);});})['then'](function(_0x5e2b49){var _0x85cece=qs[_0x8e72('0x50')](_0x443421,['id','createdAt',_0x8e72('0x52')]);_0x85cece['userProfileId']=_0xe805cc['id'];if(_0x5e2b49)_0x85cece['Resources']=_0x5e2b49;return _0x85cece;})[_0x8e72('0x28')](function(_0x3ad909){return db['UserProfileSection'][_0x8e72('0x4b')](_0x3ad909,{'include':[{'model':db[_0x8e72('0x59')],'as':_0x8e72('0x5b')}],'raw':!![],'transaction':_0x3205f8});});})[_0x8e72('0x28')](function(){return _0xe805cc;});}});});});}})[_0x8e72('0x28')](respondWithResult(_0x11c6d8,0xc9))[_0x8e72('0x46')](handleError(_0x11c6d8,null));};exports['update']=function(_0x54adac,_0x3bc2c8){if(_0x54adac[_0x8e72('0x4c')]['id']){delete _0x54adac['body']['id'];}return db[_0x8e72('0x2f')]['find']({'where':{'id':_0x54adac[_0x8e72('0x48')]['id']}})['then'](handleEntityNotFound(_0x3bc2c8,null))[_0x8e72('0x28')](saveUpdates(_0x54adac[_0x8e72('0x4c')],null))['then'](respondWithResult(_0x3bc2c8,null))[_0x8e72('0x46')](handleError(_0x3bc2c8,null));};exports[_0x8e72('0x5c')]=function(_0x17df07,_0x33d5c0){return db[_0x8e72('0x2f')]['find']({'where':{'id':_0x17df07[_0x8e72('0x48')]['id']}})[_0x8e72('0x28')](handleEntityNotFound(_0x33d5c0,null))[_0x8e72('0x28')](removeEntity(_0x33d5c0,null))[_0x8e72('0x46')](handleError(_0x33d5c0,null));};exports[_0x8e72('0x5d')]=function(_0x50fd6a,_0x59b7cb){return db[_0x8e72('0x2f')][_0x8e72('0x5d')]()[_0x8e72('0x28')](respondWithResult(_0x59b7cb,null))[_0x8e72('0x46')](handleError(_0x59b7cb,null));};exports[_0x8e72('0x5e')]=function(_0x108404,_0x476ead){var _0x57f889=_0x108404[_0x8e72('0x4c')];return db[_0x8e72('0x2f')]['find']({'where':{'id':_0x108404['params']['id']}})[_0x8e72('0x28')](handleEntityNotFound(_0x476ead,null))[_0x8e72('0x28')](function(_0x5a37d5){if(_0x5a37d5){return db['sequelize'][_0x8e72('0x55')](function(_0x5f477a){return db[_0x8e72('0x56')][_0x8e72('0x5c')]({'where':{'userProfileId':_0x108404[_0x8e72('0x48')]['id'],'sectionId':_[_0x8e72('0x2e')](_0x57f889,function(_0x53d51d){return _0x53d51d['sectionId'];})},'transaction':_0x5f477a})[_0x8e72('0x28')](function(){var _0xd1e82=_[_0x8e72('0x2e')](_0x57f889,function(_0x586f32){_0x586f32['userProfileId']=_0x108404[_0x8e72('0x48')]['id'];return _0x586f32;});var _0x4736bc=[];return BPromise[_0x8e72('0x57')](_0xd1e82,function(_0x2ef66e){return db['UserProfileSection'][_0x8e72('0x4b')](_0x2ef66e,{'include':[{'model':db[_0x8e72('0x59')],'as':'Resources'}],'raw':!![],'transaction':_0x5f477a})[_0x8e72('0x28')](function(_0x180d22){_0x4736bc[_0x8e72('0x5f')](_0x180d22[_0x8e72('0x4f')]({'plain':!![]}));});})[_0x8e72('0x28')](function(){return _0x4736bc;});});});}})['then'](function(_0x4b29d0){return _0x4b29d0;})[_0x8e72('0x28')](respondWithResult(_0x476ead,null))['catch'](handleError(_0x476ead,null));};exports[_0x8e72('0x60')]=function(_0x176c09,_0x2b886b){var _0x365d52;return db[_0x8e72('0x2f')][_0x8e72('0x4e')]({'where':{'id':_0x176c09[_0x8e72('0x48')]['id']},'attributes':['id',_0x8e72('0x2b')]})[_0x8e72('0x28')](handleEntityNotFound(_0x2b886b,null))['then'](function(_0x3c5535){if(_0x3c5535){_0x365d52=_0x3c5535;return db[_0x8e72('0x56')][_0x8e72('0x5c')]({'where':{'userProfileId':_0x176c09[_0x8e72('0x48')]['id'],'sectionId':_0x176c09[_0x8e72('0x35')][_0x8e72('0x61')]}});}})['then'](function(){return _0x365d52;})[_0x8e72('0x28')](respondWithStatusCode(_0x2b886b,null))[_0x8e72('0x46')](handleError(_0x2b886b,null));};exports[_0x8e72('0x62')]=function(_0x524775,_0x1dfc0c){var _0x196cf2=[];var _0xa8a30f=[];return db['UserProfileSection'][_0x8e72('0x45')]({'where':{'userProfileId':_0x524775[_0x8e72('0x48')]['id']},'raw':!![]})[_0x8e72('0x28')](function(_0x5bcfd2){_0x196cf2=_[_0x8e72('0x40')](_0x5bcfd2,function(_0x846856){return _0x846856['enabled']===0x1||_[_0x8e72('0x63')]([0x3eb,0x709],_0x846856[_0x8e72('0x5a')]);});if(!_[_0x8e72('0x64')](_0x196cf2)){return _[_0x8e72('0x2e')](_0x196cf2,function(_0xeae23d){return _0xeae23d[_0x8e72('0x5a')];});}else{return;}})['then'](function(_0x450a81){if(_0x450a81)_0xa8a30f=_0x450a81;if(_[_0x8e72('0x63')](_0xa8a30f,0x64)){var _0x51f53a=_[_0x8e72('0x4e')](_0x196cf2,{'sectionId':0x64});return hasDefaultDashboard(_0x51f53a)[_0x8e72('0x28')](function(_0x46c5d3){return _['map'](_0x196cf2,function(_0x3bda74){if(_0x3bda74[_0x8e72('0x5a')]===0x64){_0x3bda74['subsections']=_0x46c5d3;}return _0x3bda74;});});}else{return;}})['then'](function(_0x8399bc){if(_0x8399bc)_0x196cf2=_0x8399bc;if(_['includes'](_0xa8a30f,0x3eb)){var _0x3cbb1b=_['find'](_0x196cf2,{'sectionId':0x3eb});return getCustomDashboards(_0x3cbb1b)[_0x8e72('0x28')](function(_0x62d33f){return _[_0x8e72('0x2e')](_0x196cf2,function(_0x576c21){if(_0x3cbb1b[_0x8e72('0x65')]){if(_0x576c21[_0x8e72('0x5a')]===0x3eb){_0x576c21['subsections']=_0x62d33f;}}else{if(_0x576c21[_0x8e72('0x5a')]===0x64){_0x576c21[_0x8e72('0x66')]=_0x62d33f;}}return _0x576c21;});});}else{return;}})['then'](function(_0x47c4a1){if(_0x47c4a1)_0x196cf2=_0x47c4a1;if(_[_0x8e72('0x63')](_0xa8a30f,0x709)){var _0x3856ef=_[_0x8e72('0x4e')](_0x196cf2,{'sectionId':0x709});return getPlugins(_0x3856ef)[_0x8e72('0x28')](function(_0x442e30){if(_0x3856ef['enabled']){return _[_0x8e72('0x2e')](_0x196cf2,function(_0x51bdfe){if(_0x51bdfe[_0x8e72('0x5a')]===0x709){_0x51bdfe[_0x8e72('0x66')]=_0x442e30;}return _0x51bdfe;});}else{var _0x164a46={'sectionId':0x76c,'enabled':0x1,'subsections':_0x442e30};var _0x38b8da=_[_0x8e72('0x2e')](_0x196cf2);_0x38b8da[_0x8e72('0x5f')](_0x164a46);return _0x38b8da;}});}else{return;}})[_0x8e72('0x28')](function(_0x10e299){if(_0x10e299)_0x196cf2=_0x10e299;return _[_0x8e72('0x40')](_0x196cf2,[_0x8e72('0x65'),0x1]);})[_0x8e72('0x28')](respondWithResult(_0x1dfc0c,null))[_0x8e72('0x46')](handleError(_0x1dfc0c,null));};function hasDefaultDashboard(_0xb0558a){var _0x20e010=[0x65];return new BPromise(function(_0x579924,_0x4aaf79){try{if(_0xb0558a[_0x8e72('0x58')]){_0x579924(_0x20e010);}else{return db[_0x8e72('0x59')][_0x8e72('0x67')]({'where':{'sectionId':_0xb0558a['id']},'raw':!![]})[_0x8e72('0x28')](function(_0x21f07a){_0x21f07a?_0x579924(_0x20e010):_0x579924();});}}catch(_0x409c1d){_0x4aaf79(_0x409c1d);}});}function getCustomDashboards(_0x4b3ae7){var _0x5ab0ba=[];return new BPromise(function(_0x332119,_0x2a41ad){try{if(_0x4b3ae7[_0x8e72('0x58')]){return db[_0x8e72('0x68')]['findAll']({'raw':!![]})[_0x8e72('0x28')](function(_0x524ebd){_0x524ebd[_0x8e72('0x69')](function(_0x4d310e){_0x5ab0ba[_0x8e72('0x5f')](_0x4d310e['id']+0x1869f);});_0x332119(_0x5ab0ba);});}else{return db[_0x8e72('0x59')][_0x8e72('0x45')]({'where':{'sectionId':_0x4b3ae7['id']},'raw':!![]})[_0x8e72('0x28')](function(_0x50dac6){_0x50dac6[_0x8e72('0x69')](function(_0x4e64e6){_0x5ab0ba['push'](_0x4e64e6['resourceId']+0x1869f);});_0x332119(_0x5ab0ba);});}}catch(_0x5b3e15){_0x2a41ad(_0x5b3e15);}});}function getPlugins(_0x4bfe32){var _0x470dac=[];return new BPromise(function(_0x43c0e6,_0x349b11){try{if(_0x4bfe32[_0x8e72('0x58')]){return db['Plugin'][_0x8e72('0x45')]({'raw':!![]})[_0x8e72('0x28')](function(_0x32bfd7){_0x32bfd7[_0x8e72('0x69')](function(_0xd1e1d2){_0x470dac[_0x8e72('0x5f')](_0xd1e1d2['id']+0x15b38);});_0x43c0e6(_0x470dac);});}else{return db[_0x8e72('0x59')]['findAll']({'where':{'sectionId':_0x4bfe32['id']},'raw':!![]})[_0x8e72('0x28')](function(_0x2ffb52){_0x2ffb52[_0x8e72('0x69')](function(_0x4dbfcc){_0x470dac[_0x8e72('0x5f')](_0x4dbfcc['resourceId']+0x15b38);});_0x43c0e6(_0x470dac);});}}catch(_0x178329){_0x349b11(_0x178329);}});}exports['addResources']=function(_0x54b4ed,_0x1df021){return db[_0x8e72('0x2f')][_0x8e72('0x4e')]({'where':{'id':_0x54b4ed[_0x8e72('0x48')]['id']}})['then'](handleEntityNotFound(_0x1df021,null))[_0x8e72('0x28')](function(_0x1b90b0){if(_0x1b90b0){return db[_0x8e72('0x54')][_0x8e72('0x55')](function(_0x1ba19f){return db[_0x8e72('0x56')][_0x8e72('0x45')]({'where':{'userProfileId':_0x54b4ed[_0x8e72('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0x8e72('0x28')](function(_0x397bb1){if(_0x397bb1){return db[_0x8e72('0x56')][_0x8e72('0x5c')]({'where':{'userProfileId':_0x54b4ed[_0x8e72('0x48')]['id'],'id':_[_0x8e72('0x2e')](_0x397bb1,function(_0x35bef8){return _0x35bef8['id'];})},'transaction':_0x1ba19f});}})[_0x8e72('0x28')](function(_0x513a59){var _0x3eda51=_['map'](_0x54b4ed[_0x8e72('0x4c')],function(_0x1065e2){_0x1065e2[_0x8e72('0x6a')]=_0x54b4ed['params']['id'];return _0x1065e2;});return db[_0x8e72('0x56')][_0x8e72('0x6b')](_0x3eda51,{'raw':!![],'transaction':_0x1ba19f});})[_0x8e72('0x28')](function(_0x2a8ba9){var _0x3202a2=_[_0x8e72('0x40')](_[_0x8e72('0x2e')](_0x2a8ba9,function(_0x390643){return _0x390643[_0x8e72('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x3202a2){return db[_0x8e72('0x56')][_0x8e72('0x45')]({'where':{'userProfileId':_0x54b4ed[_0x8e72('0x48')]['id'],'sectionId':_[_0x8e72('0x2e')](_0x3202a2,function(_0x539005){return _0x539005['sectionId'];})},'attributes':['id',_0x8e72('0x5a')],'raw':!![]})[_0x8e72('0x28')](function(_0x47d126){var _0x5318a2=_['map'](_0x54b4ed['body'],function(_0x49dd49){_0x49dd49['userProfileId']=_0x54b4ed[_0x8e72('0x48')]['id'];return _0x49dd49;});return db['UserProfileResource'][_0x8e72('0x6b')](_0x5318a2,{'raw':!![],'transaction':_0x1ba19f});});}})[_0x8e72('0x46')](handleError(_0x1df021,null));});}})[_0x8e72('0x28')](function(_0x1ec545){var _0x56d5d0=_[_0x8e72('0x2e')](_0x1ec545,function(_0x1700a0){return _0x1700a0['get']({'plain':!![]});});})[_0x8e72('0x28')](respondWithResult(_0x1df021,null))[_0x8e72('0x46')](handleError(_0x1df021,null));};exports[_0x8e72('0x6c')]=function(_0x34ee51,_0x4f1863,_0x10b436){return db['UserProfile']['find']({'where':{'id':_0x34ee51[_0x8e72('0x48')]['id']}})[_0x8e72('0x28')](handleEntityNotFound(_0x4f1863,null))[_0x8e72('0x28')](function(_0x394bfe){if(_0x394bfe){return _0x394bfe[_0x8e72('0x6c')](_0x34ee51[_0x8e72('0x35')]['ids']);}})['then'](respondWithStatusCode(_0x4f1863,null))['catch'](handleError(_0x4f1863,null));};exports[_0x8e72('0x6d')]=function(_0xe7ad85,_0x453609){var _0x3a3be4={'raw':![],'where':{}};var _0x3a45f7={};var _0x582008={'count':0x0,'rows':[]};var _0x78e930=_0xe7ad85[_0x8e72('0x35')][_0x8e72('0x6e')];if(typeof _0x78e930==='undefined'){throw new db[(_0x8e72('0x6f'))][(_0x8e72('0x70'))](_0x8e72('0x71'));}var _0x478f5b=_0xe7ad85[_0x8e72('0x35')][_0x8e72('0x72')]||![];var _0x2edbee=getQueryModels(_0x78e930,_0x478f5b);if(typeof _0x2edbee[_0x8e72('0x73')]===_0x8e72('0x74')){throw new db['Sequelize'][(_0x8e72('0x70'))](_0x8e72('0x75')+_0x78e930+'\x27');}var _0x3adff4=[];if(!_[_0x8e72('0x64')](_0x2edbee[_0x8e72('0x76')])){_0x3adff4=_0x2edbee[_0x8e72('0x76')];}else{_0x3adff4=[{'name':_0x78e930}];}return db[_0x8e72('0x2f')]['findOne']({'where':{'id':_0xe7ad85[_0x8e72('0x48')]['id']}})[_0x8e72('0x28')](handleEntityNotFound(_0x453609,null))[_0x8e72('0x28')](function(_0x3c9d2e){if(_0x3c9d2e){var _0xd42673=[];for(var _0x3482ac=0x0;_0x3482ac<_0x3adff4[_0x8e72('0x3b')];_0x3482ac++){_0xd42673[_0x8e72('0x5f')](db['UserProfileSection'][_0x8e72('0x67')]({'where':{'userProfileId':_0x3c9d2e['id'],'name':_0x3adff4[_0x3482ac][_0x8e72('0x2b')]},'raw':!![]}));}return BPromise[_0x8e72('0x77')](_0xd42673);}})[_0x8e72('0x28')](function(_0x2e0edc){var _0x5224bf=_['filter'](_0x2e0edc,function(_0x319d9c){return _0x319d9c?_0x319d9c:undefined;});var _0xdc45ad=_['filter'](_0x3adff4,['ignore',!![]]);var _0x55cd81=_['isEmpty'](_0x5224bf)&&_[_0x8e72('0x64')](_0xdc45ad)?null:_['union'](_0xdc45ad,_0x5224bf);if(_0x55cd81){var _0x12081e=[];for(var _0x15af80=0x0;_0x15af80<_0x55cd81['length'];_0x15af80++){var _0x360a53=_[_0x8e72('0x4e')](_0x3adff4,function(_0x3d846a){return _0x55cd81[_0x15af80]?_0x3d846a[_0x8e72('0x2b')]===_0x55cd81[_0x15af80][_0x8e72('0x2b')]:null;});if(_0x360a53){if(_0x55cd81[_0x15af80][_0x8e72('0x78')]){_0x12081e[_0x8e72('0x5f')](getAllResources(_0x2edbee[_0x8e72('0x73')],_0x55cd81[_0x15af80]));}else{if(!_0x55cd81[_0x15af80][_0x8e72('0x58')]){_0x12081e[_0x8e72('0x5f')](getAllowedResources(_0x360a53,_0x55cd81[_0x15af80],_0x2edbee[_0x8e72('0x73')]));}else{if(_0x360a53[_0x8e72('0x34')]){_0x12081e[_0x8e72('0x5f')](getAllFilteredResources(_0x360a53,_0x55cd81[_0x15af80]));}}}}}return BPromise['all'](_0x12081e);}else{return null;}})[_0x8e72('0x28')](function(_0x46338c){var _0x160dc5=_0x46338c;var _0x6d048d=null;if(_0x160dc5){_0x6d048d=_0x160dc5[_0x8e72('0x3b')]===0x1?_0x160dc5[0x0]:null;}if(_0x6d048d||_0x160dc5){var _0x328fce=db[_0x2edbee[_0x8e72('0x73')]][_0x8e72('0x30')];_0x3a45f7[_0x8e72('0x34')]=_['keys'](_0x328fce);_0x3a45f7['query']=_[_0x8e72('0x36')](_0xe7ad85['query']);_0x3a45f7['filters']=_[_0x8e72('0x38')](_0x3a45f7['model'],_0x3a45f7[_0x8e72('0x35')]);_0x3a3be4[_0x8e72('0x39')]=_[_0x8e72('0x38')](_0x3a45f7[_0x8e72('0x34')],qs[_0x8e72('0x3a')](_0xe7ad85[_0x8e72('0x35')][_0x8e72('0x3a')]));_0x3a3be4[_0x8e72('0x39')]=_0x3a3be4[_0x8e72('0x39')][_0x8e72('0x3b')]?_0x3a3be4[_0x8e72('0x39')]:_0x3a45f7['model'];if(!_0xe7ad85['query'][_0x8e72('0x3c')](_0x8e72('0x79'))){_0x3a3be4['limit']=qs[_0x8e72('0x22')](_0xe7ad85[_0x8e72('0x35')][_0x8e72('0x22')]);_0x3a3be4[_0x8e72('0x21')]=qs[_0x8e72('0x21')](_0xe7ad85[_0x8e72('0x35')]['offset']);}_0x3a3be4[_0x8e72('0x3d')]=qs[_0x8e72('0x3e')](_0xe7ad85[_0x8e72('0x35')]['sort']);_0x3a3be4[_0x8e72('0x41')]=qs[_0x8e72('0x37')](_['pick'](_0xe7ad85[_0x8e72('0x35')],_0x3a45f7[_0x8e72('0x37')]));if(_0xe7ad85[_0x8e72('0x35')][_0x8e72('0x40')]){_0x3a3be4['where']=_[_0x8e72('0x42')](_0x3a3be4['where'],{'$or':_['map'](_0x328fce,function(_0x3bafce){if(_0x3bafce[_0x8e72('0x32')][_0x8e72('0x33')]!==_0x8e72('0x43')){var _0x492576={};_0x492576[_0x3bafce[_0x8e72('0x7a')]]={'$like':'%'+_0xe7ad85[_0x8e72('0x35')]['filter']+'%'};return _0x492576;}})});}var _0x374aaa=[];if(_0x6d048d){var _0x498e20=_[_0x8e72('0x4e')](_0x3adff4,[_0x8e72('0x2b'),_0x6d048d[_0x8e72('0x2b')]]);if(_0x498e20[_0x8e72('0x7a')]){var _0x57ff25={};if(_0x2edbee[_0x8e72('0x73')]===_0x8e72('0x7b')){_0x57ff25[_0x498e20[_0x8e72('0x7c')]]=_['map'](_0x6d048d[_0x8e72('0x7d')],'id');}else{_0x57ff25[_0x498e20[_0x8e72('0x7c')]]=_0x6d048d['associatedResources'];}_0x374aaa['push'](_0x57ff25);}else{_0x3a3be4[_0x8e72('0x41')]['id']=_0x6d048d[_0x8e72('0x7d')];}}else{for(var _0xb300dd=0x0;_0xb300dd<_0x160dc5[_0x8e72('0x3b')];_0xb300dd++){var _0x498e20=_[_0x8e72('0x4e')](_0x3adff4,[_0x8e72('0x2b'),_0x160dc5[_0xb300dd][_0x8e72('0x2b')]]);if(_0x498e20[_0x8e72('0x7a')]){var _0x57ff25={};_0x57ff25[_0x498e20['foreignKey']]=_0x160dc5[_0xb300dd][_0x8e72('0x7d')];_0x374aaa['push'](_0x57ff25);}else{if(!_0x3a3be4[_0x8e72('0x41')]['id'])_0x3a3be4[_0x8e72('0x41')]['id']=[];_0x160dc5[_0xb300dd][_0x8e72('0x7d')][_0x8e72('0x69')](function(_0x496898){_0x3a3be4[_0x8e72('0x41')]['id'][_0x8e72('0x5f')](_0x496898);});}}}if(!_[_0x8e72('0x64')](_0x374aaa)){_0x3a3be4[_0x8e72('0x41')]=_[_0x8e72('0x42')](_0x3a3be4[_0x8e72('0x41')],{'$and':{'$or':_0x374aaa}});}_0x3a3be4=_[_0x8e72('0x42')]({},_0x3a3be4,_0xe7ad85[_0x8e72('0x4a')]);if(_0x6d048d&&!_0x6d048d[_0x8e72('0x58')]&&_0x2edbee[_0x8e72('0x73')]===_0x8e72('0x7b')){if(_0xe7ad85[_0x8e72('0x35')]['includeAll']){_0x3a3be4[_0x8e72('0x44')]=[{'all':!![]}];}return db[_0x2edbee[_0x8e72('0x73')]][_0x8e72('0x45')](_0x3a3be4)[_0x8e72('0x28')](function(_0x5ea990){var _0x2f0810=[];_0x5ea990[_0x8e72('0x69')](function(_0x4c4e77){var _0x14830a;switch(_0x4c4e77[_0x8e72('0x7e')]){case _0x8e72('0x7f'):_0x14830a=_[_0x8e72('0x4e')](_0x6d048d[_0x8e72('0x7d')],function(_0x4901c0){return _0x4901c0['id']===_0x4c4e77['reportId']&&_0x4901c0['type']===_0x8e72('0x80');});break;case'custom':_0x14830a=_[_0x8e72('0x4e')](_0x6d048d[_0x8e72('0x7d')],function(_0x24a9cd){return _0x24a9cd['id']===_0x4c4e77['reportId']&&_0x24a9cd[_0x8e72('0x32')]===_0x8e72('0x81');});break;}if(_0x14830a)_0x2f0810[_0x8e72('0x5f')](_0x4c4e77);});_0x582008[_0x8e72('0x20')]=_0x2f0810[_0x8e72('0x3b')];_0x582008[_0x8e72('0x82')]=_0x2f0810;return _0x582008;});}else{return db[_0x2edbee['childModel']][_0x8e72('0x20')]({'where':_0x3a3be4[_0x8e72('0x41')]})[_0x8e72('0x28')](function(_0x52b2a8){_0x582008[_0x8e72('0x20')]=_0x52b2a8;if(_0xe7ad85[_0x8e72('0x35')]['includeAll']){if(_0x2edbee[_0x8e72('0x73')]===_0x8e72('0x83')){_0x3a3be4['include']=[{'model':db[_0x8e72('0x84')],'as':_0x8e72('0x85'),'attributes':['id',_0x8e72('0x2b'),_0x8e72('0x86')],'required':_0xe7ad85[_0x8e72('0x35')][_0x8e72('0x87')]?!![]:![]},{'model':db[_0x8e72('0x84')],'as':_0x8e72('0x88'),'attributes':['id',_0x8e72('0x2b'),_0x8e72('0x86')],'through':_0xe7ad85['query']['tag']?{'attributes':[],'where':{'TagId':_0xe7ad85[_0x8e72('0x35')][_0x8e72('0x87')]||undefined}}:{},'required':_0xe7ad85[_0x8e72('0x35')][_0x8e72('0x87')]?!![]:![]}];}else{_0x3a3be4[_0x8e72('0x44')]=[{'all':!![]}];}}return db[_0x2edbee[_0x8e72('0x73')]]['findAll'](_0x3a3be4);})[_0x8e72('0x28')](function(_0x1d0cf6){_0x582008[_0x8e72('0x82')]=_0x1d0cf6;return _0x582008;});}}else{return _0x582008;}})['then'](respondWithFilteredResult(_0x453609,_0x3a3be4))[_0x8e72('0x46')](handleError(_0x453609,null));};function getAllResources(_0x434c18,_0x2690d1){return new BPromise(function(_0x12c8b0,_0x239d01){if(_0x2690d1){var _0x34a6df=_0x2690d1[_0x8e72('0x40')]?{[_0x2690d1[_0x8e72('0x40')]['field']]:_0x2690d1[_0x8e72('0x40')][_0x8e72('0x89')]}:undefined;return db[_0x434c18][_0x8e72('0x45')]({'where':_0x34a6df,'raw':!![]})['then'](function(_0x934762){_0x2690d1['associatedResources']=_[_0x8e72('0x2e')](_0x934762,'id');_0x12c8b0(_0x2690d1);})[_0x8e72('0x46')](function(_0x99691b){_0x239d01(_0x99691b);});}else{_0x12c8b0(null);}});}function getAllFilteredResources(_0x5f492f,_0x5751ea){return new BPromise(function(_0x3ee746,_0x3db9ae){var _0x34c0e4=_0x5f492f[_0x8e72('0x40')]?{[_0x5f492f[_0x8e72('0x40')][_0x8e72('0x7a')]]:_0x5f492f[_0x8e72('0x40')][_0x8e72('0x89')]}:undefined;return db[_0x5f492f[_0x8e72('0x34')]]['findAll']({'where':_0x34c0e4,'raw':!![]})[_0x8e72('0x28')](function(_0x55eecc){_0x5751ea[_0x8e72('0x7d')]=_[_0x8e72('0x2e')](_0x55eecc,function(_0x1b0c65){return _0x1b0c65['name'];});_0x3ee746(_0x5751ea);})[_0x8e72('0x46')](function(_0x109a72){_0x3db9ae(_0x109a72);});});}function getAllowedResources(_0x47bca8,_0x369270,_0x5eefcb){return new BPromise(function(_0x2fa494,_0x14d652){if(_0x369270){return db[_0x8e72('0x59')][_0x8e72('0x45')]({'where':{'sectionId':_0x369270['id']},'raw':!![]})[_0x8e72('0x28')](function(_0x40b5f5){if(_0x47bca8[_0x8e72('0x7a')]&&_0x47bca8['field']!=='id'){_0x369270[_0x8e72('0x7d')]=_[_0x8e72('0x2e')](_0x40b5f5,function(_0xd2675e){return _0xd2675e[_0x47bca8[_0x8e72('0x7a')]];});}else{if(_0x5eefcb===_0x8e72('0x7b')){_0x369270[_0x8e72('0x7d')]=_['map'](_0x40b5f5,function(_0x514248){return{'id':_0x514248[_0x8e72('0x8a')],'type':_0x514248[_0x8e72('0x32')]};});}else{_0x369270[_0x8e72('0x7d')]=_[_0x8e72('0x2e')](_0x40b5f5,function(_0x43b3b1){return _0x43b3b1[_0x8e72('0x8a')];});}}_0x2fa494(_0x369270);})[_0x8e72('0x46')](function(_0x26915a){_0x14d652(_0x26915a);});}else{_0x2fa494(null);}});}function getQueryModels(_0x3cb884,_0x556a9b){var _0x276e20=_0x3cb884[_0x8e72('0x8b')]();var _0xf1a1ce={'childModel':undefined,'parentSections':[]};switch(_0x276e20){case _0x8e72('0x8c'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0x8d');break;case'odbc':_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0x8e');break;case _0x8e72('0x8f'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0x90');_0xf1a1ce[_0x8e72('0x76')]=[{'name':'SquareProjects','field':_0x8e72('0x2b'),'foreignKey':_0x8e72('0x91')}];break;case'projects':_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0x92');break;case _0x8e72('0x93'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0x83');_0xf1a1ce[_0x8e72('0x76')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0x8e72('0x94'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0x95');break;case _0x8e72('0x96'):_0xf1a1ce['childModel']=_0x8e72('0x97');break;case _0x8e72('0x98'):_0xf1a1ce[_0x8e72('0x73')]='CmCustomField';break;case _0x8e72('0x99'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0x9a');break;case _0x8e72('0x9b'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0x9c');break;case'faxqueues':_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0x9d');break;case'faxaccounts':_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0x9e');break;case _0x8e72('0x9f'):case'internalroutes':case'outboundroutes':_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xa0');break;case _0x8e72('0xa1'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xa2');break;case _0x8e72('0xa3'):_0xf1a1ce[_0x8e72('0x73')]='VoiceMail';break;case _0x8e72('0xa4'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xa5');_0xf1a1ce[_0x8e72('0x76')]=[{'name':_0x8e72('0xa6'),'field':_0x8e72('0x2b'),'foreignKey':_0x8e72('0xa7'),'model':_0x8e72('0xa8'),'filter':{'field':'role','value':[_0x8e72('0xa9')]}},{'name':_0x8e72('0xaa'),'field':_0x8e72('0x2b'),'foreignKey':_0x8e72('0xa7'),'model':_0x8e72('0xa8'),'filter':{'field':_0x8e72('0xab'),'value':[_0x8e72('0xac')]}},{'name':_0x8e72('0xad'),'field':_0x8e72('0x2b'),'foreignKey':_0x8e72('0xae'),'model':_0x8e72('0xaf'),'filter':{'field':_0x8e72('0x32'),'value':['inbound']}},{'name':'QueueCampaigns','field':_0x8e72('0x2b'),'foreignKey':_0x8e72('0xae'),'model':_0x8e72('0xaf'),'filter':{'field':_0x8e72('0x32'),'value':[_0x8e72('0xb0')]}}];break;case _0x8e72('0xb1'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xb2');break;case _0x8e72('0xb3'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xb4');break;case _0x8e72('0xb5'):_0xf1a1ce[_0x8e72('0x73')]='VoicePrefix';break;case _0x8e72('0xb6'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xb7');break;case _0x8e72('0xb8'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xb9');break;case'mailaccounts':_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xba');break;case _0x8e72('0xbb'):_0xf1a1ce['childModel']='MailSubstatus';break;case'openchannelqueues':_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xbc');break;case _0x8e72('0xbd'):_0xf1a1ce[_0x8e72('0x73')]='OpenchannelAccount';break;case _0x8e72('0xbe'):_0xf1a1ce['childModel']=_0x8e72('0xbf');break;case _0x8e72('0xc0'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xc1');break;case _0x8e72('0xc2'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xc3');break;case _0x8e72('0xc4'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xc5');break;case _0x8e72('0xc6'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xc7');break;case _0x8e72('0xc8'):case'queuecampaigns':_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xaf');if(_0x556a9b){_0xf1a1ce[_0x8e72('0x76')]=[{'name':_0x8e72('0xad')},{'name':'QueueCampaigns'}];}break;case _0x8e72('0xc9'):case _0x8e72('0xca'):case _0x8e72('0xcb'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xa8');if(_0x556a9b){_0xf1a1ce[_0x8e72('0x76')]=[{'name':_0x8e72('0xcc'),'filter':{'field':_0x8e72('0xab'),'value':[_0x8e72('0xcd'),'user']},'ignore':!![]},{'name':_0x8e72('0xa6')},{'name':_0x8e72('0xaa')}];}break;case _0x8e72('0xce'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xcf');break;case'salesforceaccounts':_0xf1a1ce['childModel']=_0x8e72('0xd0');break;case _0x8e72('0xd1'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xd2');break;case _0x8e72('0xd3'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xd4');break;case _0x8e72('0xd5'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xd6');break;case _0x8e72('0xd7'):_0xf1a1ce['childModel']=_0x8e72('0xd8');break;case _0x8e72('0xd9'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xa8');break;case _0x8e72('0xda'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xdb');break;case _0x8e72('0xdc'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xdd');break;case _0x8e72('0xde'):_0xf1a1ce[_0x8e72('0x73')]='Dashboard';break;case _0x8e72('0xdf'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xe0');break;case _0x8e72('0xe1'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xe2');break;case _0x8e72('0xe3'):_0xf1a1ce['childModel']=_0x8e72('0xe4');break;case'sounds':_0xf1a1ce['childModel']=_0x8e72('0xe5');break;case'tags':_0xf1a1ce[_0x8e72('0x73')]='Tag';break;case'templates':_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xe6');break;case _0x8e72('0xe7'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xe8');break;case'trunks':_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xe9');break;case _0x8e72('0xea'):_0xf1a1ce['childModel']=_0x8e72('0xeb');break;case _0x8e72('0xec'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xed');break;case _0x8e72('0xee'):_0xf1a1ce['childModel']=_0x8e72('0x7b');_0xf1a1ce[_0x8e72('0x76')]=[{'name':_0x8e72('0xef'),'field':'id','foreignKey':_0x8e72('0xf0')}];break;case _0x8e72('0xf1'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xf2');break;case _0x8e72('0xc4'):_0xf1a1ce[_0x8e72('0x73')]=_0x8e72('0xc5');break;default:return _0xf1a1ce;}return _0xf1a1ce;}
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js
index 86f5601..3dd68f6 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 _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
+var _0x1a18=['save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x332357,_0x3e2e83){var _0x36dea0=function(_0x475113){while(--_0x475113){_0x332357['push'](_0x332357['shift']());}};_0x36dea0(++_0x3e2e83);}(_0x1a18,0x102));var _0x81a1=function(_0x211bc3,_0x5860c8){_0x211bc3=_0x211bc3-0x0;var _0x34c9a2=_0x1a18[_0x211bc3];return _0x34c9a2;};'use strict';var EventEmitter=require(_0x81a1('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x81a1('0x1'),'afterUpdate':'update','afterDestroy':_0x81a1('0x2')};function emitEvent(_0x4508fb){return function(_0x473703,_0x30c6c8,_0x29477a){UserProfileEvents[_0x81a1('0x3')](_0x4508fb+':'+_0x473703['id'],_0x473703);UserProfileEvents[_0x81a1('0x3')](_0x4508fb,_0x473703);_0x29477a(null);};}for(var e in events){if(events[_0x81a1('0x4')](e)){var event=events[e];UserProfile[_0x81a1('0x5')](e,emitEvent(event));}}module[_0x81a1('0x6')]=UserProfileEvents;
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js
index 70ae2b7..fff459a 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 _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
+var _0x887f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfile.attributes','define','UserProfile'];(function(_0x5258af,_0x1a7744){var _0x4ad327=function(_0x1b8bce){while(--_0x1b8bce){_0x5258af['push'](_0x5258af['shift']());}};_0x4ad327(++_0x1a7744);}(_0x887f,0x1a2));var _0xf887=function(_0x190a90,_0x188a70){_0x190a90=_0x190a90-0x0;var _0x12140f=_0x887f[_0x190a90];return _0x12140f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf887('0x0'))(_0xf887('0x1'));var moment=require(_0xf887('0x2'));var BPromise=require(_0xf887('0x3'));var rp=require(_0xf887('0x4'));var fs=require('fs');var path=require(_0xf887('0x5'));var rimraf=require(_0xf887('0x6'));var config=require(_0xf887('0x7'));var attributes=require(_0xf887('0x8'));module['exports']=function(_0x419315,_0x1050e0){return _0x419315[_0xf887('0x9')](_0xf887('0xa'),attributes,{'tableName':'user_profiles','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 39bc7ae..5066518 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 _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
+var _0xbd51=['request','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket'];(function(_0x13d0e6,_0x136cc8){var _0x4c62f0=function(_0x59655a){while(--_0x59655a){_0x13d0e6['push'](_0x13d0e6['shift']());}};_0x4c62f0(++_0x136cc8);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x89c375,_0x1b7328){_0x89c375=_0x89c375-0x0;var _0x23b702=_0xbd51[_0x89c375];return _0x23b702;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var moment=require(_0x1bd5('0x1'));var BPromise=require(_0x1bd5('0x2'));var rs=require(_0x1bd5('0x3'));var fs=require('fs');var Redis=require(_0x1bd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1bd5('0x5'));var jayson=require(_0x1bd5('0x6'));var client=jayson[_0x1bd5('0x7')]['http']({'port':0x232a});config[_0x1bd5('0x8')]=_[_0x1bd5('0x9')](config[_0x1bd5('0x8')],{'host':_0x1bd5('0xa'),'port':0x18eb});var socket=require(_0x1bd5('0xb'))(new Redis(config['redis']));require(_0x1bd5('0xc'))['register'](socket);function respondWithRpcPromise(_0x2bd975,_0x28df8e,_0x3b868a){return new BPromise(function(_0x1fbc68,_0x2344e1){return client[_0x1bd5('0xd')](_0x2bd975,_0x3b868a)['then'](function(_0x456ef8){logger['info'](_0x1bd5('0xe'),_0x28df8e,_0x1bd5('0xf'));logger[_0x1bd5('0x10')](_0x1bd5('0x11'),_0x28df8e,_0x1bd5('0xf'),JSON[_0x1bd5('0x12')](_0x456ef8));if(_0x456ef8[_0x1bd5('0x13')]){if(_0x456ef8['error']['code']===0x1f4){logger[_0x1bd5('0x13')](_0x1bd5('0xe'),_0x28df8e,_0x456ef8[_0x1bd5('0x13')][_0x1bd5('0x14')]);return _0x2344e1(_0x456ef8['error']['message']);}logger[_0x1bd5('0x13')](_0x1bd5('0xe'),_0x28df8e,_0x456ef8[_0x1bd5('0x13')][_0x1bd5('0x14')]);return _0x1fbc68(_0x456ef8[_0x1bd5('0x13')][_0x1bd5('0x14')]);}else{logger[_0x1bd5('0x15')](_0x1bd5('0xe'),_0x28df8e,_0x1bd5('0xf'));_0x1fbc68(_0x456ef8['result']['message']);}})[_0x1bd5('0x16')](function(_0x260827){logger[_0x1bd5('0x13')](_0x1bd5('0xe'),_0x28df8e,_0x260827);_0x2344e1(_0x260827);});});}
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js
index ba395d2..4c05d45 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 _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
+var _0xbe0d=['length','userProfile:','./userProfile.events','save','remove','removeListener'];(function(_0x157298,_0x2f1dd2){var _0x43368c=function(_0x5848ff){while(--_0x5848ff){_0x157298['push'](_0x157298['shift']());}};_0x43368c(++_0x2f1dd2);}(_0xbe0d,0xbc));var _0xdbe0=function(_0xf22ee8,_0x41b0c5){_0xf22ee8=_0xf22ee8-0x0;var _0x57bd7c=_0xbe0d[_0xf22ee8];return _0x57bd7c;};'use strict';var UserProfileEvents=require(_0xdbe0('0x0'));var events=[_0xdbe0('0x1'),_0xdbe0('0x2'),'update'];function createListener(_0x2ea02a,_0x378b58){return function(_0x1f5459){_0x378b58['emit'](_0x2ea02a,_0x1f5459);};}function removeListener(_0x184817,_0x3af08f){return function(){UserProfileEvents[_0xdbe0('0x3')](_0x184817,_0x3af08f);};}exports['register']=function(_0x2d9b65){for(var _0x64e108=0x0,_0x54ad00=events[_0xdbe0('0x4')];_0x64e108<_0x54ad00;_0x64e108++){var _0xf6705e=events[_0x64e108];var _0x281ca1=createListener(_0xdbe0('0x5')+_0xf6705e,_0x2d9b65);UserProfileEvents['on'](_0xf6705e,_0x281ca1);}};
\ No newline at end of file
diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js
index 0057cb3..ef82393 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 _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
+var _0xaa2d=['./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','exports','util','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa2d,0x11c));var _0xdaa2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa2d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xdaa2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdaa2('0x1')]();var auth=require(_0xdaa2('0x2'));var interaction=require(_0xdaa2('0x3'));var config=require('../../config/environment');var controller=require(_0xdaa2('0x4'));router[_0xdaa2('0x5')]('/',auth[_0xdaa2('0x6')](),controller['index']);router['get'](_0xdaa2('0x7'),auth['isAuthenticated'](),controller[_0xdaa2('0x8')]);router[_0xdaa2('0x5')](_0xdaa2('0x9'),auth['isAuthenticated'](),controller[_0xdaa2('0xa')]);router[_0xdaa2('0xb')]('/',auth[_0xdaa2('0x6')](),controller[_0xdaa2('0xc')]);router[_0xdaa2('0xd')](_0xdaa2('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xdaa2('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xdaa2('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js
index 09806cc..b2ca2b7 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 _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
+var _0xfd8c=['exports','STRING','sequelize'];(function(_0x487715,_0x3f6cc8){var _0x28b4b3=function(_0x5f87b6){while(--_0x5f87b6){_0x487715['push'](_0x487715['shift']());}};_0x28b4b3(++_0x3f6cc8);}(_0xfd8c,0x101));var _0xcfd8=function(_0x3fab8d,_0x3a43e0){_0x3fab8d=_0x3fab8d-0x0;var _0x652a13=_0xfd8c[_0x3fab8d];return _0x652a13;};'use strict';var Sequelize=require(_0xcfd8('0x0'));module[_0xcfd8('0x1')]={'name':{'type':Sequelize[_0xcfd8('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 456729b..3992141 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 _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
+var _0xac9d=['destroy','error','name','send','map','UserProfileResource','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','apply','save','then'];(function(_0x420665,_0x538c27){var _0x3c85be=function(_0x28f63c){while(--_0x28f63c){_0x420665['push'](_0x420665['shift']());}};_0x3c85be(++_0x538c27);}(_0xac9d,0x14d));var _0xdac9=function(_0x22e101,_0x412840){_0x22e101=_0x22e101-0x0;var _0xa51f61=_0xac9d[_0x22e101];return _0xa51f61;};'use strict';var pdf=require(_0xdac9('0x0'));var emlformat=require(_0xdac9('0x1'));var rimraf=require(_0xdac9('0x2'));var zipdir=require(_0xdac9('0x3'));var jsonpatch=require(_0xdac9('0x4'));var rp=require(_0xdac9('0x5'));var moment=require(_0xdac9('0x6'));var BPromise=require(_0xdac9('0x7'));var Mustache=require('mustache');var util=require(_0xdac9('0x8'));var path=require('path');var sox=require(_0xdac9('0x9'));var csv=require(_0xdac9('0xa'));var ejs=require(_0xdac9('0xb'));var fs=require('fs');var _=require(_0xdac9('0xc'));var squel=require(_0xdac9('0xd'));var crypto=require(_0xdac9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdac9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdac9('0x10'));var Papa=require(_0xdac9('0x11'));var Redis=require(_0xdac9('0x12'));var authService=require(_0xdac9('0x13'));var qs=require(_0xdac9('0x14'));var as=require(_0xdac9('0x15'));var hardwareService=require(_0xdac9('0x16'));var logger=require(_0xdac9('0x17'))(_0xdac9('0x18'));var utils=require('../../config/utils');var config=require(_0xdac9('0x19'));var db=require(_0xdac9('0x1a'))['db'];function respondWithStatusCode(_0x5a9bde,_0x3d8e97){_0x3d8e97=_0x3d8e97||0xcc;return function(_0xeddbc1){if(_0xeddbc1){return _0x5a9bde[_0xdac9('0x1b')](_0x3d8e97);}return _0x5a9bde['status'](_0x3d8e97)[_0xdac9('0x1c')]();};}function respondWithResult(_0x33ba20,_0x9e1bf6){_0x9e1bf6=_0x9e1bf6||0xc8;return function(_0x5f0bbd){if(_0x5f0bbd){return _0x33ba20['status'](_0x9e1bf6)[_0xdac9('0x1d')](_0x5f0bbd);}};}function respondWithFilteredResult(_0x3d9fcf,_0x50f9fe){return function(_0x76af7a){if(_0x76af7a){var _0x36cbe4=_0x76af7a[_0xdac9('0x1e')],_0x152ea5=_0x50f9fe[_0xdac9('0x1f')],_0x5b2f1b=_0x50f9fe[_0xdac9('0x1f')]+_0x50f9fe['limit'],_0x2221f8;if(_0x5b2f1b>=_0x36cbe4){_0x5b2f1b=_0x36cbe4;_0x2221f8=0xc8;}else{_0x2221f8=0xce;}_0x3d9fcf[_0xdac9('0x20')](_0x2221f8);return _0x3d9fcf[_0xdac9('0x21')]('Content-Range',_0x152ea5+'-'+_0x5b2f1b+'/'+_0x36cbe4)[_0xdac9('0x1d')](_0x76af7a);}return null;};}function patchUpdates(_0xa57f2d){return function(_0x171df1){try{jsonpatch[_0xdac9('0x22')](_0x171df1,_0xa57f2d,!![]);}catch(_0x522dc3){return BPromise['reject'](_0x522dc3);}return _0x171df1[_0xdac9('0x23')]();};}function saveUpdates(_0x20ece3,_0x2b9d91){return function(_0x395ec7){if(_0x395ec7){return _0x395ec7['update'](_0x20ece3)[_0xdac9('0x24')](function(_0x33cb7d){return _0x33cb7d;});}return null;};}function removeEntity(_0x27f473,_0xae680a){return function(_0xe7bd10){if(_0xe7bd10){return _0xe7bd10[_0xdac9('0x25')]()[_0xdac9('0x24')](function(){_0x27f473[_0xdac9('0x20')](0xcc)[_0xdac9('0x1c')]();});}};}function handleEntityNotFound(_0x33de5c,_0x5a0fa2){return function(_0x2943f5){if(!_0x2943f5){_0x33de5c[_0xdac9('0x1b')](0x194);}return _0x2943f5;};}function handleError(_0x3c942c,_0x34a255){_0x34a255=_0x34a255||0x1f4;return function(_0x5ca076){logger[_0xdac9('0x26')](_0x5ca076['stack']);if(_0x5ca076[_0xdac9('0x27')]){delete _0x5ca076[_0xdac9('0x27')];}_0x3c942c['status'](_0x34a255)[_0xdac9('0x28')](_0x5ca076);};}exports['index']=function(_0x450f91,_0x3743f7){var _0xeff4b2={},_0xfe4468={},_0x57d76a={'count':0x0,'rows':[]};var _0x4b87bc=_[_0xdac9('0x29')](db[_0xdac9('0x2a')]['rawAttributes'],function(_0x4c4e21){return{'name':_0x4c4e21[_0xdac9('0x2b')],'type':_0x4c4e21[_0xdac9('0x2c')][_0xdac9('0x2d')]};});_0xfe4468[_0xdac9('0x2e')]=_[_0xdac9('0x29')](_0x4b87bc,_0xdac9('0x27'));_0xfe4468[_0xdac9('0x2f')]=_[_0xdac9('0x30')](_0x450f91[_0xdac9('0x2f')]);_0xfe4468[_0xdac9('0x31')]=_[_0xdac9('0x32')](_0xfe4468[_0xdac9('0x2e')],_0xfe4468[_0xdac9('0x2f')]);_0xeff4b2[_0xdac9('0x33')]=_[_0xdac9('0x32')](_0xfe4468[_0xdac9('0x2e')],qs[_0xdac9('0x34')](_0x450f91[_0xdac9('0x2f')][_0xdac9('0x34')]));_0xeff4b2[_0xdac9('0x33')]=_0xeff4b2[_0xdac9('0x33')]['length']?_0xeff4b2['attributes']:_0xfe4468[_0xdac9('0x2e')];if(!_0x450f91[_0xdac9('0x2f')][_0xdac9('0x35')](_0xdac9('0x36'))){_0xeff4b2[_0xdac9('0x37')]=qs['limit'](_0x450f91[_0xdac9('0x2f')]['limit']);_0xeff4b2[_0xdac9('0x1f')]=qs[_0xdac9('0x1f')](_0x450f91['query'][_0xdac9('0x1f')]);}_0xeff4b2['order']=qs['sort'](_0x450f91[_0xdac9('0x2f')][_0xdac9('0x38')]);_0xeff4b2[_0xdac9('0x39')]=qs[_0xdac9('0x31')](_[_0xdac9('0x3a')](_0x450f91[_0xdac9('0x2f')],_0xfe4468['filters']),_0x4b87bc);if(_0x450f91[_0xdac9('0x2f')][_0xdac9('0x3b')]){_0xeff4b2['where']=_[_0xdac9('0x3c')](_0xeff4b2[_0xdac9('0x39')],{'$or':_[_0xdac9('0x29')](_0x4b87bc,function(_0x27bdfb){if(_0x27bdfb[_0xdac9('0x2c')]!==_0xdac9('0x3d')){var _0x3ac9ae={};_0x3ac9ae[_0x27bdfb['name']]={'$like':'%'+_0x450f91[_0xdac9('0x2f')][_0xdac9('0x3b')]+'%'};return _0x3ac9ae;}})});}_0xeff4b2=_[_0xdac9('0x3c')]({},_0xeff4b2,_0x450f91['options']);var _0x9c732e={'where':_0xeff4b2[_0xdac9('0x39')]};return db[_0xdac9('0x2a')][_0xdac9('0x1e')](_0x9c732e)['then'](function(_0x58fd14){_0x57d76a[_0xdac9('0x1e')]=_0x58fd14;if(_0x450f91[_0xdac9('0x2f')][_0xdac9('0x3e')]){_0xeff4b2[_0xdac9('0x3f')]=[{'all':!![]}];}return db[_0xdac9('0x2a')]['findAll'](_0xeff4b2);})[_0xdac9('0x24')](function(_0x482f4a){_0x57d76a[_0xdac9('0x40')]=_0x482f4a;return _0x57d76a;})[_0xdac9('0x24')](respondWithFilteredResult(_0x3743f7,_0xeff4b2))[_0xdac9('0x41')](handleError(_0x3743f7,null));};exports[_0xdac9('0x42')]=function(_0x2a50f0,_0x386b74){var _0x413fb1={'raw':![],'where':{'id':_0x2a50f0[_0xdac9('0x43')]['id']}},_0xb176e0={};_0xb176e0[_0xdac9('0x2e')]=_[_0xdac9('0x30')](db[_0xdac9('0x2a')][_0xdac9('0x44')]);_0xb176e0[_0xdac9('0x2f')]=_['keys'](_0x2a50f0[_0xdac9('0x2f')]);_0xb176e0[_0xdac9('0x31')]=_['intersection'](_0xb176e0[_0xdac9('0x2e')],_0xb176e0[_0xdac9('0x2f')]);_0x413fb1[_0xdac9('0x33')]=_[_0xdac9('0x32')](_0xb176e0[_0xdac9('0x2e')],qs[_0xdac9('0x34')](_0x2a50f0['query'][_0xdac9('0x34')]));_0x413fb1['attributes']=_0x413fb1[_0xdac9('0x33')][_0xdac9('0x45')]?_0x413fb1[_0xdac9('0x33')]:_0xb176e0[_0xdac9('0x2e')];if(_0x2a50f0['query']['includeAll']){_0x413fb1['include']=[{'all':!![]}];}_0x413fb1=_[_0xdac9('0x3c')]({},_0x413fb1,_0x2a50f0['options']);return db['UserProfileResource'][_0xdac9('0x46')](_0x413fb1)[_0xdac9('0x24')](handleEntityNotFound(_0x386b74,null))['then'](respondWithResult(_0x386b74,null))['catch'](handleError(_0x386b74,null));};exports[_0xdac9('0x47')]=function(_0x24f045,_0x2a31e8){return db[_0xdac9('0x2a')][_0xdac9('0x47')](_0x24f045[_0xdac9('0x48')],{})[_0xdac9('0x24')](respondWithResult(_0x2a31e8,0xc9))[_0xdac9('0x41')](handleError(_0x2a31e8,null));};exports['update']=function(_0x621cf,_0x3bd946){if(_0x621cf[_0xdac9('0x48')]['id']){delete _0x621cf[_0xdac9('0x48')]['id'];}return db[_0xdac9('0x2a')][_0xdac9('0x46')]({'where':{'id':_0x621cf[_0xdac9('0x43')]['id']}})[_0xdac9('0x24')](handleEntityNotFound(_0x3bd946,null))[_0xdac9('0x24')](saveUpdates(_0x621cf[_0xdac9('0x48')],null))[_0xdac9('0x24')](respondWithResult(_0x3bd946,null))[_0xdac9('0x41')](handleError(_0x3bd946,null));};exports[_0xdac9('0x25')]=function(_0x3f092d,_0x53b349){return db['UserProfileResource']['find']({'where':{'id':_0x3f092d[_0xdac9('0x43')]['id']}})[_0xdac9('0x24')](handleEntityNotFound(_0x53b349,null))['then'](removeEntity(_0x53b349,null))[_0xdac9('0x41')](handleError(_0x53b349,null));};exports[_0xdac9('0x49')]=function(_0x45c869,_0x4df45b){return db[_0xdac9('0x2a')][_0xdac9('0x49')]()['then'](respondWithResult(_0x4df45b,null))['catch'](handleError(_0x4df45b,null));};
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js
index 383e08e..208151f 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 _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
+var _0xee5b=['request-promise','path','rimraf','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0xee5b,0x1f4));var _0xbee5=function(_0x40905a,_0x1d0112){_0x40905a=_0x40905a-0x0;var _0x3a3c90=_0xee5b[_0x40905a];return _0x3a3c90;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var moment=require('moment');var BPromise=require(_0xbee5('0x3'));var rp=require(_0xbee5('0x4'));var fs=require('fs');var path=require(_0xbee5('0x5'));var rimraf=require(_0xbee5('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0xbee5('0x7')]=function(_0x2c0bde,_0xab6e4d){return _0x2c0bde[_0xbee5('0x8')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId','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 00c3aa0..a5c6007 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 _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
+var _0xa786=['request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xa786,0x1ef));var _0x6a78=function(_0xc606,_0x4bfd52){_0xc606=_0xc606-0x0;var _0x2abd89=_0xa786[_0xc606];return _0x2abd89;};'use strict';var _=require(_0x6a78('0x0'));var util=require('util');var moment=require(_0x6a78('0x1'));var BPromise=require('bluebird');var rs=require(_0x6a78('0x2'));var fs=require('fs');var Redis=require(_0x6a78('0x3'));var db=require(_0x6a78('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a78('0x5'))(_0x6a78('0x6'));var config=require(_0x6a78('0x7'));var jayson=require(_0x6a78('0x8'));var client=jayson[_0x6a78('0x9')][_0x6a78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f50cd,_0x49ac4e,_0x521fdc){return new BPromise(function(_0x1a0f36,_0x55a167){return client[_0x6a78('0xb')](_0x1f50cd,_0x521fdc)[_0x6a78('0xc')](function(_0x5a7e77){logger[_0x6a78('0xd')](_0x6a78('0xe'),_0x49ac4e,_0x6a78('0xf'));logger[_0x6a78('0x10')](_0x6a78('0x11'),_0x49ac4e,_0x6a78('0xf'),JSON[_0x6a78('0x12')](_0x5a7e77));if(_0x5a7e77['error']){if(_0x5a7e77[_0x6a78('0x13')]['code']===0x1f4){logger[_0x6a78('0x13')](_0x6a78('0xe'),_0x49ac4e,_0x5a7e77[_0x6a78('0x13')]['message']);return _0x55a167(_0x5a7e77['error'][_0x6a78('0x14')]);}logger[_0x6a78('0x13')](_0x6a78('0xe'),_0x49ac4e,_0x5a7e77[_0x6a78('0x13')][_0x6a78('0x14')]);return _0x1a0f36(_0x5a7e77[_0x6a78('0x13')][_0x6a78('0x14')]);}else{logger[_0x6a78('0xd')](_0x6a78('0xe'),_0x49ac4e,_0x6a78('0xf'));_0x1a0f36(_0x5a7e77[_0x6a78('0x15')][_0x6a78('0x14')]);}})[_0x6a78('0x16')](function(_0x5b6a6d){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x49ac4e,_0x5b6a6d);_0x55a167(_0x5b6a6d);});});}
\ No newline at end of file
diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js
index bdd5a06..eb62e21 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 _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
+var _0xcb83=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','/describe','/:id','show','post','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x11b55e,_0x47f1ff){var _0x268a13=function(_0x3dc694){while(--_0x3dc694){_0x11b55e['push'](_0x11b55e['shift']());}};_0x268a13(++_0x47f1ff);}(_0xcb83,0x1c5));var _0x3cb8=function(_0x42c581,_0x1c0689){_0x42c581=_0x42c581-0x0;var _0x1d09cd=_0xcb83[_0x42c581];return _0x1d09cd;};'use strict';var multer=require(_0x3cb8('0x0'));var util=require('util');var path=require(_0x3cb8('0x1'));var timeout=require(_0x3cb8('0x2'));var express=require(_0x3cb8('0x3'));var router=express[_0x3cb8('0x4')]();var auth=require(_0x3cb8('0x5'));var interaction=require(_0x3cb8('0x6'));var config=require(_0x3cb8('0x7'));var controller=require(_0x3cb8('0x8'));router[_0x3cb8('0x9')]('/',auth[_0x3cb8('0xa')](),controller['index']);router[_0x3cb8('0x9')](_0x3cb8('0xb'),auth[_0x3cb8('0xa')](),controller['describe']);router[_0x3cb8('0x9')](_0x3cb8('0xc'),auth[_0x3cb8('0xa')](),controller[_0x3cb8('0xd')]);router[_0x3cb8('0xe')]('/',auth[_0x3cb8('0xa')](),controller['create']);router['put'](_0x3cb8('0xc'),auth['isAuthenticated'](),controller[_0x3cb8('0xf')]);router[_0x3cb8('0x10')](_0x3cb8('0xc'),auth[_0x3cb8('0xa')](),controller[_0x3cb8('0x11')]);module[_0x3cb8('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js
index 111827d..ea1a9a9 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 _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
+var _0xef1c=['BOOLEAN','crudPermissions','join','getDataValue','split','sequelize','exports','STRING','INTEGER'];(function(_0x259ce9,_0x1ab741){var _0x44207f=function(_0xa35d41){while(--_0xa35d41){_0x259ce9['push'](_0x259ce9['shift']());}};_0x44207f(++_0x1ab741);}(_0xef1c,0x176));var _0xcef1=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xef1c[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0xcef1('0x0'));module[_0xcef1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xcef1('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xcef1('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xcef1('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xcef1('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xcef1('0x2')],'set':function(_0x3872e2){this['setDataValue'](_0xcef1('0x5'),_0x3872e2?_0x3872e2[_0xcef1('0x6')](''):[]);},'get':function(){return this[_0xcef1('0x7')]('crudPermissions')?this[_0xcef1('0x7')]('crudPermissions')[_0xcef1('0x8')](''):[];}}};
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js
index 0586f2a..312ebcf 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 _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
+var _0x9d0d=['offset','sort','where','filter','merge','options','include','findAll','rows','show','params','rawAttributes','length','includeAll','find','create','body','catch','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','UserProfileSection','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x24f4df,_0x562845){var _0xc070f4=function(_0x23ee55){while(--_0x23ee55){_0x24f4df['push'](_0x24f4df['shift']());}};_0xc070f4(++_0x562845);}(_0x9d0d,0xe7));var _0xd9d0=function(_0x52ac43,_0x33cddd){_0x52ac43=_0x52ac43-0x0;var _0x2cb1c5=_0x9d0d[_0x52ac43];return _0x2cb1c5;};'use strict';var pdf=require(_0xd9d0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd9d0('0x1'));var zipdir=require(_0xd9d0('0x2'));var jsonpatch=require(_0xd9d0('0x3'));var rp=require(_0xd9d0('0x4'));var moment=require(_0xd9d0('0x5'));var BPromise=require(_0xd9d0('0x6'));var Mustache=require(_0xd9d0('0x7'));var util=require(_0xd9d0('0x8'));var path=require(_0xd9d0('0x9'));var sox=require(_0xd9d0('0xa'));var csv=require(_0xd9d0('0xb'));var ejs=require(_0xd9d0('0xc'));var fs=require('fs');var _=require(_0xd9d0('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd9d0('0xe'));var deskjs=require(_0xd9d0('0xf'));var toCsv=require(_0xd9d0('0xb'));var querystring=require(_0xd9d0('0x10'));var Papa=require(_0xd9d0('0x11'));var Redis=require(_0xd9d0('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9d0('0x13'));var logger=require('../../config/logger')(_0xd9d0('0x14'));var utils=require(_0xd9d0('0x15'));var config=require(_0xd9d0('0x16'));var db=require(_0xd9d0('0x17'))['db'];function respondWithStatusCode(_0xf1a169,_0x397e9f){_0x397e9f=_0x397e9f||0xcc;return function(_0x396376){if(_0x396376){return _0xf1a169[_0xd9d0('0x18')](_0x397e9f);}return _0xf1a169[_0xd9d0('0x19')](_0x397e9f)[_0xd9d0('0x1a')]();};}function respondWithResult(_0xb7a1b5,_0x43c898){_0x43c898=_0x43c898||0xc8;return function(_0x205d3f){if(_0x205d3f){return _0xb7a1b5[_0xd9d0('0x19')](_0x43c898)[_0xd9d0('0x1b')](_0x205d3f);}};}function respondWithFilteredResult(_0x55a341,_0x32194b){return function(_0x4e25e4){if(_0x4e25e4){var _0x3ba5eb=_0x4e25e4[_0xd9d0('0x1c')],_0x3c915c=_0x32194b['offset'],_0x171caa=_0x32194b['offset']+_0x32194b[_0xd9d0('0x1d')],_0x36ea53;if(_0x171caa>=_0x3ba5eb){_0x171caa=_0x3ba5eb;_0x36ea53=0xc8;}else{_0x36ea53=0xce;}_0x55a341[_0xd9d0('0x19')](_0x36ea53);return _0x55a341[_0xd9d0('0x1e')](_0xd9d0('0x1f'),_0x3c915c+'-'+_0x171caa+'/'+_0x3ba5eb)[_0xd9d0('0x1b')](_0x4e25e4);}return null;};}function patchUpdates(_0x3b4ec4){return function(_0x4a4db3){try{jsonpatch[_0xd9d0('0x20')](_0x4a4db3,_0x3b4ec4,!![]);}catch(_0x4419ae){return BPromise[_0xd9d0('0x21')](_0x4419ae);}return _0x4a4db3[_0xd9d0('0x22')]();};}function saveUpdates(_0x45b14b,_0x2c1157){return function(_0x4f516f){if(_0x4f516f){return _0x4f516f['update'](_0x45b14b)[_0xd9d0('0x23')](function(_0x184a1f){return _0x184a1f;});}return null;};}function removeEntity(_0x11dc2d,_0x11cf46){return function(_0x5aec94){if(_0x5aec94){return _0x5aec94[_0xd9d0('0x24')]()[_0xd9d0('0x23')](function(){_0x11dc2d[_0xd9d0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3996f0,_0x425410){return function(_0x58e8af){if(!_0x58e8af){_0x3996f0[_0xd9d0('0x18')](0x194);}return _0x58e8af;};}function handleError(_0x149971,_0x1b4989){_0x1b4989=_0x1b4989||0x1f4;return function(_0x105817){logger[_0xd9d0('0x25')](_0x105817[_0xd9d0('0x26')]);if(_0x105817[_0xd9d0('0x27')]){delete _0x105817[_0xd9d0('0x27')];}_0x149971[_0xd9d0('0x19')](_0x1b4989)[_0xd9d0('0x28')](_0x105817);};}exports['index']=function(_0x4a245b,_0x23ef9b){var _0x554071={},_0x1229fa={},_0x3d5a6a={'count':0x0,'rows':[]};var _0x5ab0c9=_[_0xd9d0('0x29')](db[_0xd9d0('0x2a')]['rawAttributes'],function(_0x35bd29){return{'name':_0x35bd29[_0xd9d0('0x2b')],'type':_0x35bd29['type'][_0xd9d0('0x2c')]};});_0x1229fa[_0xd9d0('0x2d')]=_['map'](_0x5ab0c9,_0xd9d0('0x27'));_0x1229fa[_0xd9d0('0x2e')]=_[_0xd9d0('0x2f')](_0x4a245b['query']);_0x1229fa[_0xd9d0('0x30')]=_[_0xd9d0('0x31')](_0x1229fa[_0xd9d0('0x2d')],_0x1229fa[_0xd9d0('0x2e')]);_0x554071[_0xd9d0('0x32')]=_[_0xd9d0('0x31')](_0x1229fa[_0xd9d0('0x2d')],qs[_0xd9d0('0x33')](_0x4a245b[_0xd9d0('0x2e')][_0xd9d0('0x33')]));_0x554071['attributes']=_0x554071['attributes']['length']?_0x554071[_0xd9d0('0x32')]:_0x1229fa[_0xd9d0('0x2d')];if(!_0x4a245b[_0xd9d0('0x2e')][_0xd9d0('0x34')]('nolimit')){_0x554071[_0xd9d0('0x1d')]=qs[_0xd9d0('0x1d')](_0x4a245b[_0xd9d0('0x2e')][_0xd9d0('0x1d')]);_0x554071['offset']=qs['offset'](_0x4a245b[_0xd9d0('0x2e')][_0xd9d0('0x35')]);}_0x554071['order']=qs[_0xd9d0('0x36')](_0x4a245b[_0xd9d0('0x2e')][_0xd9d0('0x36')]);_0x554071[_0xd9d0('0x37')]=qs['filters'](_['pick'](_0x4a245b[_0xd9d0('0x2e')],_0x1229fa['filters']),_0x5ab0c9);if(_0x4a245b[_0xd9d0('0x2e')][_0xd9d0('0x38')]){_0x554071['where']=_[_0xd9d0('0x39')](_0x554071[_0xd9d0('0x37')],{'$or':_['map'](_0x5ab0c9,function(_0x2cbbad){if(_0x2cbbad['type']!=='VIRTUAL'){var _0x1be62d={};_0x1be62d[_0x2cbbad[_0xd9d0('0x27')]]={'$like':'%'+_0x4a245b[_0xd9d0('0x2e')][_0xd9d0('0x38')]+'%'};return _0x1be62d;}})});}_0x554071=_[_0xd9d0('0x39')]({},_0x554071,_0x4a245b[_0xd9d0('0x3a')]);var _0x4b613d={'where':_0x554071[_0xd9d0('0x37')]};return db['UserProfileSection'][_0xd9d0('0x1c')](_0x4b613d)[_0xd9d0('0x23')](function(_0x524d94){_0x3d5a6a[_0xd9d0('0x1c')]=_0x524d94;if(_0x4a245b['query']['includeAll']){_0x554071[_0xd9d0('0x3b')]=[{'all':!![]}];}return db['UserProfileSection'][_0xd9d0('0x3c')](_0x554071);})[_0xd9d0('0x23')](function(_0x12d4e5){_0x3d5a6a[_0xd9d0('0x3d')]=_0x12d4e5;return _0x3d5a6a;})['then'](respondWithFilteredResult(_0x23ef9b,_0x554071))['catch'](handleError(_0x23ef9b,null));};exports[_0xd9d0('0x3e')]=function(_0x57fae5,_0x1cfa82){var _0x3a55f5={'raw':![],'where':{'id':_0x57fae5[_0xd9d0('0x3f')]['id']}},_0x4d61ba={};_0x4d61ba[_0xd9d0('0x2d')]=_['keys'](db['UserProfileSection'][_0xd9d0('0x40')]);_0x4d61ba['query']=_[_0xd9d0('0x2f')](_0x57fae5[_0xd9d0('0x2e')]);_0x4d61ba[_0xd9d0('0x30')]=_[_0xd9d0('0x31')](_0x4d61ba[_0xd9d0('0x2d')],_0x4d61ba[_0xd9d0('0x2e')]);_0x3a55f5[_0xd9d0('0x32')]=_[_0xd9d0('0x31')](_0x4d61ba[_0xd9d0('0x2d')],qs['fields'](_0x57fae5['query'][_0xd9d0('0x33')]));_0x3a55f5[_0xd9d0('0x32')]=_0x3a55f5[_0xd9d0('0x32')][_0xd9d0('0x41')]?_0x3a55f5[_0xd9d0('0x32')]:_0x4d61ba[_0xd9d0('0x2d')];if(_0x57fae5['query'][_0xd9d0('0x42')]){_0x3a55f5[_0xd9d0('0x3b')]=[{'all':!![]}];}_0x3a55f5=_[_0xd9d0('0x39')]({},_0x3a55f5,_0x57fae5[_0xd9d0('0x3a')]);return db[_0xd9d0('0x2a')][_0xd9d0('0x43')](_0x3a55f5)[_0xd9d0('0x23')](handleEntityNotFound(_0x1cfa82,null))[_0xd9d0('0x23')](respondWithResult(_0x1cfa82,null))['catch'](handleError(_0x1cfa82,null));};exports[_0xd9d0('0x44')]=function(_0x33c768,_0x22d020){return db['UserProfileSection']['create'](_0x33c768[_0xd9d0('0x45')],{})[_0xd9d0('0x23')](respondWithResult(_0x22d020,0xc9))[_0xd9d0('0x46')](handleError(_0x22d020,null));};exports['update']=function(_0x1534d2,_0x6268c5){if(_0x1534d2[_0xd9d0('0x45')]['id']){delete _0x1534d2['body']['id'];}return db[_0xd9d0('0x2a')][_0xd9d0('0x43')]({'where':{'id':_0x1534d2[_0xd9d0('0x3f')]['id']}})[_0xd9d0('0x23')](handleEntityNotFound(_0x6268c5,null))[_0xd9d0('0x23')](saveUpdates(_0x1534d2['body'],null))[_0xd9d0('0x23')](respondWithResult(_0x6268c5,null))[_0xd9d0('0x46')](handleError(_0x6268c5,null));};exports[_0xd9d0('0x24')]=function(_0x3dfef8,_0x2187a6){return db['UserProfileSection'][_0xd9d0('0x43')]({'where':{'id':_0x3dfef8[_0xd9d0('0x3f')]['id']}})[_0xd9d0('0x23')](handleEntityNotFound(_0x2187a6,null))[_0xd9d0('0x23')](removeEntity(_0x2187a6,null))[_0xd9d0('0x46')](handleError(_0x2187a6,null));};exports['describe']=function(_0x579ade,_0x84dac6){return db[_0xd9d0('0x2a')]['describe']()['then'](respondWithResult(_0x84dac6,null))[_0xd9d0('0x46')](handleError(_0x84dac6,null));};
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js
index 7335633..bf6b8a5 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 _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
+var _0x818d=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId'];(function(_0x498279,_0x1063fe){var _0x89afa3=function(_0xf1c163){while(--_0xf1c163){_0x498279['push'](_0x498279['shift']());}};_0x89afa3(++_0x1063fe);}(_0x818d,0x87));var _0xd818=function(_0x12742e,_0x43f6fa){_0x12742e=_0x12742e-0x0;var _0x173452=_0x818d[_0x12742e];return _0x173452;};'use strict';var _=require('lodash');var util=require(_0xd818('0x0'));var logger=require(_0xd818('0x1'))('api');var moment=require(_0xd818('0x2'));var BPromise=require(_0xd818('0x3'));var rp=require(_0xd818('0x4'));var fs=require('fs');var path=require(_0xd818('0x5'));var rimraf=require('rimraf');var config=require(_0xd818('0x6'));var attributes=require(_0xd818('0x7'));module[_0xd818('0x8')]=function(_0x5ec6d0,_0x4c6f8a){return _0x5ec6d0[_0xd818('0x9')](_0xd818('0xa'),attributes,{'tableName':_0xd818('0xb'),'paranoid':![],'indexes':[{'name':_0xd818('0xc'),'fields':[_0xd818('0xd'),_0xd818('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js
index 658601d..3add84f 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 _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
+var _0x3902=['UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x1d572f,_0x1ab2fd){var _0x56a622=function(_0x4b1819){while(--_0x4b1819){_0x1d572f['push'](_0x1d572f['shift']());}};_0x56a622(++_0x1ab2fd);}(_0x3902,0xe4));var _0x2390=function(_0x1a104e,_0x1bce95){_0x1a104e=_0x1a104e-0x0;var _0x4ce390=_0x3902[_0x1a104e];return _0x4ce390;};'use strict';var _=require(_0x2390('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2390('0x1'));var fs=require('fs');var Redis=require(_0x2390('0x2'));var db=require(_0x2390('0x3'))['db'];var utils=require(_0x2390('0x4'));var logger=require(_0x2390('0x5'))(_0x2390('0x6'));var config=require(_0x2390('0x7'));var jayson=require(_0x2390('0x8'));var client=jayson[_0x2390('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x463d1d,_0x162754,_0x4bf268){return new BPromise(function(_0x3ff52e,_0x148ac8){return client[_0x2390('0xa')](_0x463d1d,_0x4bf268)[_0x2390('0xb')](function(_0x2a05d8){logger[_0x2390('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x162754,_0x2390('0xd'));logger['debug'](_0x2390('0xe'),_0x162754,'request\x20sent',JSON[_0x2390('0xf')](_0x2a05d8));if(_0x2a05d8[_0x2390('0x10')]){if(_0x2a05d8[_0x2390('0x10')][_0x2390('0x11')]===0x1f4){logger[_0x2390('0x10')](_0x2390('0x12'),_0x162754,_0x2a05d8[_0x2390('0x10')][_0x2390('0x13')]);return _0x148ac8(_0x2a05d8['error'][_0x2390('0x13')]);}logger[_0x2390('0x10')](_0x2390('0x12'),_0x162754,_0x2a05d8[_0x2390('0x10')][_0x2390('0x13')]);return _0x3ff52e(_0x2a05d8[_0x2390('0x10')]['message']);}else{logger[_0x2390('0xc')](_0x2390('0x12'),_0x162754,_0x2390('0xd'));_0x3ff52e(_0x2a05d8[_0x2390('0x14')][_0x2390('0x13')]);}})[_0x2390('0x15')](function(_0x390f28){logger[_0x2390('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x162754,_0x390f28);_0x148ac8(_0x390f28);});});}
\ No newline at end of file
diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js
index 2dd15b2..0c093d6 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 _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
+var _0x21e0=['../../config/environment','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x356bb0,_0x2acb60){var _0x188610=function(_0x14c53b){while(--_0x14c53b){_0x356bb0['push'](_0x356bb0['shift']());}};_0x188610(++_0x2acb60);}(_0x21e0,0x1ea));var _0x021e=function(_0x3ab11a,_0x8712cb){_0x3ab11a=_0x3ab11a-0x0;var _0x2f9373=_0x21e0[_0x3ab11a];return _0x2f9373;};'use strict';var multer=require(_0x021e('0x0'));var util=require('util');var path=require(_0x021e('0x1'));var timeout=require(_0x021e('0x2'));var express=require(_0x021e('0x3'));var router=express[_0x021e('0x4')]();var auth=require(_0x021e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x021e('0x6'));module[_0x021e('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js
index 530f201..2a5a676 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 _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
+var _0xbaf0=['exports','INTEGER'];(function(_0x5bce33,_0x4a4b06){var _0x15bc20=function(_0x56c711){while(--_0x56c711){_0x5bce33['push'](_0x5bce33['shift']());}};_0x15bc20(++_0x4a4b06);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'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/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js
index 19d70c9..e8d3abb 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 _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
+var _0x33a1=['exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','request-promise','path','rimraf','./userSmsQueue.attributes'];(function(_0x3bfd5c,_0x32a410){var _0x5507ff=function(_0x3911af){while(--_0x3911af){_0x3bfd5c['push'](_0x3bfd5c['shift']());}};_0x5507ff(++_0x32a410);}(_0x33a1,0x7c));var _0x133a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x33a1[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x133a('0x0'));var util=require(_0x133a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x133a('0x2'));var fs=require('fs');var path=require(_0x133a('0x3'));var rimraf=require(_0x133a('0x4'));var config=require('../../config/environment');var attributes=require(_0x133a('0x5'));module[_0x133a('0x6')]=function(_0x23c48d,_0x557b93){return _0x23c48d[_0x133a('0x7')](_0x133a('0x8'),attributes,{'tableName':_0x133a('0x9'),'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 4085d1f..1be65d1 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 _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
+var _0x0c58=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0c58,0x161));var _0x80c5=function(_0xda8e73,_0x53e1b8){_0xda8e73=_0xda8e73-0x0;var _0x3495d6=_0x0c58[_0xda8e73];return _0x3495d6;};'use strict';var _=require(_0x80c5('0x0'));var util=require(_0x80c5('0x1'));var moment=require(_0x80c5('0x2'));var BPromise=require(_0x80c5('0x3'));var rs=require(_0x80c5('0x4'));var fs=require('fs');var Redis=require(_0x80c5('0x5'));var db=require(_0x80c5('0x6'))['db'];var utils=require(_0x80c5('0x7'));var logger=require(_0x80c5('0x8'))(_0x80c5('0x9'));var config=require('../../config/environment');var jayson=require(_0x80c5('0xa'));var client=jayson[_0x80c5('0xb')][_0x80c5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa9a4be,_0x535950,_0xb87655){return new BPromise(function(_0xa39670,_0x559cfa){return client[_0x80c5('0xd')](_0xa9a4be,_0xb87655)[_0x80c5('0xe')](function(_0x507ebd){logger[_0x80c5('0xf')](_0x80c5('0x10'),_0x535950,_0x80c5('0x11'));logger[_0x80c5('0x12')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x535950,'request\x20sent',JSON[_0x80c5('0x13')](_0x507ebd));if(_0x507ebd[_0x80c5('0x14')]){if(_0x507ebd[_0x80c5('0x14')]['code']===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x535950,_0x507ebd[_0x80c5('0x14')][_0x80c5('0x15')]);return _0x559cfa(_0x507ebd[_0x80c5('0x14')]['message']);}logger[_0x80c5('0x14')](_0x80c5('0x10'),_0x535950,_0x507ebd[_0x80c5('0x14')]['message']);return _0xa39670(_0x507ebd[_0x80c5('0x14')][_0x80c5('0x15')]);}else{logger[_0x80c5('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x535950,_0x80c5('0x11'));_0xa39670(_0x507ebd[_0x80c5('0x16')][_0x80c5('0x15')]);}})[_0x80c5('0x17')](function(_0x470087){logger[_0x80c5('0x14')](_0x80c5('0x10'),_0x535950,_0x470087);_0x559cfa(_0x470087);});});}
\ No newline at end of file
diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js
index f4cf34a..2dc3533 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 _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
+var _0x9561=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x10c9be,_0x244d9f){var _0x48658d=function(_0x4a012f){while(--_0x4a012f){_0x10c9be['push'](_0x10c9be['shift']());}};_0x48658d(++_0x244d9f);}(_0x9561,0x122));var _0x1956=function(_0x296994,_0xa61895){_0x296994=_0x296994-0x0;var _0x3241ca=_0x9561[_0x296994];return _0x3241ca;};'use strict';var multer=require(_0x1956('0x0'));var util=require(_0x1956('0x1'));var path=require(_0x1956('0x2'));var timeout=require(_0x1956('0x3'));var express=require(_0x1956('0x4'));var router=express[_0x1956('0x5')]();var auth=require(_0x1956('0x6'));var interaction=require(_0x1956('0x7'));var config=require(_0x1956('0x8'));module[_0x1956('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js
index 7745863..faba492 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 _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
+var _0xbaf0=['exports','INTEGER'];(function(_0x34f7bb,_0x547eb3){var _0x2efee3=function(_0x1fc766){while(--_0x1fc766){_0x34f7bb['push'](_0x34f7bb['shift']());}};_0x2efee3(++_0x547eb3);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'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/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js
index 8654b66..94677db 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 _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
+var _0xcedc=['lodash','util','api','moment','bluebird','request-promise','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues'];(function(_0xf9136d,_0x2358d6){var _0x1b9543=function(_0x480b90){while(--_0x480b90){_0xf9136d['push'](_0xf9136d['shift']());}};_0x1b9543(++_0x2358d6);}(_0xcedc,0x174));var _0xcced=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcedc[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xcced('0x0'));var util=require(_0xcced('0x1'));var logger=require('../../config/logger')(_0xcced('0x2'));var moment=require(_0xcced('0x3'));var BPromise=require(_0xcced('0x4'));var rp=require(_0xcced('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcced('0x6'));var attributes=require(_0xcced('0x7'));module[_0xcced('0x8')]=function(_0x4ec4b3,_0x24fdae){return _0x4ec4b3[_0xcced('0x9')](_0xcced('0xa'),attributes,{'tableName':_0xcced('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 6e801d4..a44435d 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 _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
+var _0xe653=['result','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x542b14,_0x582941){var _0x58695c=function(_0x3ac352){while(--_0x3ac352){_0x542b14['push'](_0x542b14['shift']());}};_0x58695c(++_0x582941);}(_0xe653,0x1cd));var _0x3e65=function(_0x34f8ba,_0x2bb6a8){_0x34f8ba=_0x34f8ba-0x0;var _0xa5ed05=_0xe653[_0x34f8ba];return _0xa5ed05;};'use strict';var _=require('lodash');var util=require(_0x3e65('0x0'));var moment=require(_0x3e65('0x1'));var BPromise=require(_0x3e65('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e65('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3e65('0x4'));var logger=require(_0x3e65('0x5'))(_0x3e65('0x6'));var config=require('../../config/environment');var jayson=require(_0x3e65('0x7'));var client=jayson[_0x3e65('0x8')][_0x3e65('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10a928,_0x31d0af,_0x278f1c){return new BPromise(function(_0x5f0f9e,_0x20ad0f){return client['request'](_0x10a928,_0x278f1c)[_0x3e65('0xa')](function(_0x174698){logger[_0x3e65('0xb')]('UserVoiceQueue,\x20%s,\x20%s',_0x31d0af,'request\x20sent');logger['debug'](_0x3e65('0xc'),_0x31d0af,'request\x20sent',JSON[_0x3e65('0xd')](_0x174698));if(_0x174698[_0x3e65('0xe')]){if(_0x174698[_0x3e65('0xe')][_0x3e65('0xf')]===0x1f4){logger[_0x3e65('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x31d0af,_0x174698[_0x3e65('0xe')][_0x3e65('0x10')]);return _0x20ad0f(_0x174698[_0x3e65('0xe')][_0x3e65('0x10')]);}logger[_0x3e65('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x31d0af,_0x174698[_0x3e65('0xe')][_0x3e65('0x10')]);return _0x5f0f9e(_0x174698[_0x3e65('0xe')]['message']);}else{logger[_0x3e65('0xb')](_0x3e65('0x11'),_0x31d0af,_0x3e65('0x12'));_0x5f0f9e(_0x174698[_0x3e65('0x13')][_0x3e65('0x10')]);}})['catch'](function(_0x142768){logger['error'](_0x3e65('0x11'),_0x31d0af,_0x142768);_0x20ad0f(_0x142768);});});}
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js
index 7d95d15..c8c6302 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 _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
+var _0xafb9=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util','path','connect-timeout'];(function(_0x30fae8,_0x3e6842){var _0x5e0832=function(_0x5ad946){while(--_0x5ad946){_0x30fae8['push'](_0x30fae8['shift']());}};_0x5e0832(++_0x3e6842);}(_0xafb9,0x68));var _0x9afb=function(_0x49d80a,_0x46fc38){_0x49d80a=_0x49d80a-0x0;var _0x2bbafc=_0xafb9[_0x49d80a];return _0x2bbafc;};'use strict';var multer=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var path=require(_0x9afb('0x2'));var timeout=require(_0x9afb('0x3'));var express=require(_0x9afb('0x4'));var router=express[_0x9afb('0x5')]();var auth=require(_0x9afb('0x6'));var interaction=require(_0x9afb('0x7'));var config=require(_0x9afb('0x8'));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 80cb616..3a9e529 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 _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
+var _0x1c08=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports'];(function(_0x870bd,_0xaf1c4b){var _0x5ba5e5=function(_0x3b53a6){while(--_0x3b53a6){_0x870bd['push'](_0x870bd['shift']());}};_0x5ba5e5(++_0xaf1c4b);}(_0x1c08,0x11e));var _0x81c0=function(_0x2d33c7,_0x20e736){_0x2d33c7=_0x2d33c7-0x0;var _0x3f5a29=_0x1c08[_0x2d33c7];return _0x3f5a29;};'use strict';var Sequelize=require(_0x81c0('0x0'));module[_0x81c0('0x1')]={'uniqueid':{'type':Sequelize[_0x81c0('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x81c0('0x3')},'membername':{'type':Sequelize[_0x81c0('0x4')],'allowNull':![],'comment':_0x81c0('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x81c0('0x4')],'allowNull':![],'unique':_0x81c0('0x5'),'comment':_0x81c0('0x3')},'VoiceQueueId':{'type':Sequelize[_0x81c0('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x81c0('0x4')],'allowNull':![],'unique':_0x81c0('0x5'),'comment':_0x81c0('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x81c0('0x3')}};
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
index 7acff55..0b6bd43 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 _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
+var _0xb662=['update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x4c7108,_0xb67906){var _0x3fb2c3=function(_0x3b29b6){while(--_0x3b29b6){_0x4c7108['push'](_0x4c7108['shift']());}};_0x3fb2c3(++_0xb67906);}(_0xb662,0x90));var _0x2b66=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0xb662[_0x39c734];return _0xb2a2f9;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x2b66('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2b66('0x1'),'afterDestroy':_0x2b66('0x2')};function emitEvent(_0x5b9222){return function(_0x5bb06f,_0x23ec60,_0x121c6a){UserVoiceQueueRtEvents[_0x2b66('0x3')](_0x5b9222+':'+_0x5bb06f['id'],_0x5bb06f);UserVoiceQueueRtEvents['emit'](_0x5b9222,_0x5bb06f);_0x121c6a(null);};}for(var e in events){if(events[_0x2b66('0x4')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents;
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
index 1fa9845..40aa27d 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 _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
+var _0xd308=['bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xd308,0x1d8));var _0x8d30=function(_0x11f6d1,_0x47a9b7){_0x11f6d1=_0x11f6d1-0x0;var _0x2c3949=_0xd308[_0x11f6d1];return _0x2c3949;};'use strict';var _=require(_0x8d30('0x0'));var util=require(_0x8d30('0x1'));var logger=require(_0x8d30('0x2'))(_0x8d30('0x3'));var moment=require('moment');var BPromise=require(_0x8d30('0x4'));var rp=require(_0x8d30('0x5'));var fs=require('fs');var path=require(_0x8d30('0x6'));var rimraf=require(_0x8d30('0x7'));var config=require(_0x8d30('0x8'));var attributes=require(_0x8d30('0x9'));module[_0x8d30('0xa')]=function(_0x25b128,_0x59f50d){return _0x25b128[_0x8d30('0xb')](_0x8d30('0xc'),attributes,{'tableName':_0x8d30('0xd'),'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 f595841..8b7942e 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 _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
+var _0xeba8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x9cf14e,_0x57d04f){var _0x14877a=function(_0x35e94f){while(--_0x35e94f){_0x9cf14e['push'](_0x9cf14e['shift']());}};_0x14877a(++_0x57d04f);}(_0xeba8,0x133));var _0x8eba=function(_0x209f9c,_0x4ea385){_0x209f9c=_0x209f9c-0x0;var _0x13c1ef=_0xeba8[_0x209f9c];return _0x13c1ef;};'use strict';var _=require(_0x8eba('0x0'));var util=require(_0x8eba('0x1'));var moment=require(_0x8eba('0x2'));var BPromise=require(_0x8eba('0x3'));var rs=require(_0x8eba('0x4'));var fs=require('fs');var Redis=require(_0x8eba('0x5'));var db=require(_0x8eba('0x6'))['db'];var utils=require(_0x8eba('0x7'));var logger=require(_0x8eba('0x8'))(_0x8eba('0x9'));var config=require(_0x8eba('0xa'));var jayson=require(_0x8eba('0xb'));var client=jayson[_0x8eba('0xc')]['http']({'port':0x232a});config[_0x8eba('0xd')]=_[_0x8eba('0xe')](config[_0x8eba('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x8eba('0xf'))(new Redis(config['redis']));require(_0x8eba('0x10'))[_0x8eba('0x11')](socket);function respondWithRpcPromise(_0x1fbdf4,_0x23a053,_0x13e772){return new BPromise(function(_0x24c837,_0x3a9608){return client['request'](_0x1fbdf4,_0x13e772)[_0x8eba('0x12')](function(_0x5a9bf7){logger[_0x8eba('0x13')](_0x8eba('0x14'),_0x23a053,'request\x20sent');logger[_0x8eba('0x15')](_0x8eba('0x16'),_0x23a053,_0x8eba('0x17'),JSON['stringify'](_0x5a9bf7));if(_0x5a9bf7[_0x8eba('0x18')]){if(_0x5a9bf7['error'][_0x8eba('0x19')]===0x1f4){logger[_0x8eba('0x18')](_0x8eba('0x14'),_0x23a053,_0x5a9bf7['error'][_0x8eba('0x1a')]);return _0x3a9608(_0x5a9bf7[_0x8eba('0x18')][_0x8eba('0x1a')]);}logger[_0x8eba('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x23a053,_0x5a9bf7['error'][_0x8eba('0x1a')]);return _0x24c837(_0x5a9bf7['error'][_0x8eba('0x1a')]);}else{logger[_0x8eba('0x13')](_0x8eba('0x14'),_0x23a053,_0x8eba('0x17'));_0x24c837(_0x5a9bf7['result'][_0x8eba('0x1a')]);}})['catch'](function(_0x2540dc){logger[_0x8eba('0x18')](_0x8eba('0x14'),_0x23a053,_0x2540dc);_0x3a9608(_0x2540dc);});});}exports[_0x8eba('0x1b')]=function(_0x3da278){var _0x489cbe=this;return new Promise(function(_0x1db13c,_0x2a5e5f){return db[_0x8eba('0x1c')][_0x8eba('0x1d')]({'raw':_0x3da278[_0x8eba('0x1e')]?_0x3da278[_0x8eba('0x1e')][_0x8eba('0x1f')]===undefined?!![]:![]:!![],'where':_0x3da278[_0x8eba('0x1e')]?_0x3da278[_0x8eba('0x1e')][_0x8eba('0x20')]||null:null,'attributes':[[db[_0x8eba('0x21')]['fn'](_0x8eba('0x22'),db['sequelize']['fn']('IF',db[_0x8eba('0x21')][_0x8eba('0x23')](_0x8eba('0x24')))),_0x8eba('0x25')]]})[_0x8eba('0x12')](function(_0x1d7b81){logger[_0x8eba('0x13')](_0x8eba('0x1b'),_0x3da278);logger[_0x8eba('0x15')](_0x8eba('0x1b'),_0x3da278,JSON[_0x8eba('0x26')](_0x1d7b81));_0x1db13c(_0x1d7b81);})['catch'](function(_0x2a1e72){logger['error'](_0x8eba('0x1b'),_0x2a1e72['message'],_0x3da278);_0x2a5e5f(_0x489cbe['error'](0x1f4,_0x2a1e72['message']));});});};
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
index 72783f2..335f5c7 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 _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
+var _0x7927=['userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update'];(function(_0x27089f,_0xccd301){var _0x40874f=function(_0x5a81e4){while(--_0x5a81e4){_0x27089f['push'](_0x27089f['shift']());}};_0x40874f(++_0xccd301);}(_0x7927,0x185));var _0x7792=function(_0x532ab7,_0x35a7be){_0x532ab7=_0x532ab7-0x0;var _0xa84ea=_0x7927[_0x532ab7];return _0xa84ea;};'use strict';var UserVoiceQueueRtEvents=require(_0x7792('0x0'));var events=['save',_0x7792('0x1'),_0x7792('0x2')];function createListener(_0x15005f,_0x248a1c){return function(_0x5e66b0){_0x248a1c['emit'](_0x15005f,_0x5e66b0);};}function removeListener(_0x3ed83a,_0x36027d){return function(){UserVoiceQueueRtEvents['removeListener'](_0x3ed83a,_0x36027d);};}exports['register']=function(_0x511c2a){for(var _0x4d282b=0x0,_0xfb1c10=events['length'];_0x4d282b<_0xfb1c10;_0x4d282b++){var _0x358186=events[_0x4d282b];var _0x36c864=createListener(_0x7792('0x3')+_0x358186,_0x511c2a);UserVoiceQueueRtEvents['on'](_0x358186,_0x36c864);}};
\ No newline at end of file
diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js
index 5c3f0a2..1228fcc 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 _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
+var _0x41f1=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x336b92,_0x4472ad){var _0xa2c5ef=function(_0x1a8c0d){while(--_0x1a8c0d){_0x336b92['push'](_0x336b92['shift']());}};_0xa2c5ef(++_0x4472ad);}(_0x41f1,0x15e));var _0x141f=function(_0x23b980,_0x57697f){_0x23b980=_0x23b980-0x0;var _0x475354=_0x41f1[_0x23b980];return _0x475354;};'use strict';var multer=require(_0x141f('0x0'));var util=require(_0x141f('0x1'));var path=require(_0x141f('0x2'));var timeout=require(_0x141f('0x3'));var express=require('express');var router=express[_0x141f('0x4')]();var auth=require(_0x141f('0x5'));var interaction=require(_0x141f('0x6'));var config=require(_0x141f('0x7'));module[_0x141f('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js
index 9744525..542614d 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 _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
+var _0xd8b0=['exports','sequelize'];(function(_0x44cb2d,_0x58ebd3){var _0x4d996a=function(_0x388b61){while(--_0x388b61){_0x44cb2d['push'](_0x44cb2d['shift']());}};_0x4d996a(++_0x58ebd3);}(_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')]={'penalty':{'type':Sequelize['INTEGER'],'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 095807c..e12fc2b 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 _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
+var _0x423c=['define','UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports'];(function(_0x4297af,_0x2882f5){var _0x10ad5d=function(_0x452a2a){while(--_0x452a2a){_0x4297af['push'](_0x4297af['shift']());}};_0x10ad5d(++_0x2882f5);}(_0x423c,0x107));var _0xc423=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x423c[_0x279d37];return _0x530173;};'use strict';var _=require('lodash');var util=require(_0xc423('0x0'));var logger=require(_0xc423('0x1'))('api');var moment=require(_0xc423('0x2'));var BPromise=require(_0xc423('0x3'));var rp=require(_0xc423('0x4'));var fs=require('fs');var path=require(_0xc423('0x5'));var rimraf=require(_0xc423('0x6'));var config=require(_0xc423('0x7'));var attributes=require(_0xc423('0x8'));module[_0xc423('0x9')]=function(_0x56f8fe,_0x4c3df5){return _0x56f8fe[_0xc423('0xa')](_0xc423('0xb'),attributes,{'tableName':_0xc423('0xc'),'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 5ee0738..9cda4b5 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(_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
+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(_0x5e2073,_0x660af8){var _0x248d1a=function(_0x5ab67c){while(--_0x5ab67c){_0x5e2073['push'](_0x5e2073['shift']());}};_0x248d1a(++_0x660af8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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 78a3249..72f19fa 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 _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
+var _0x6c95=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','post','create','put','update','/:id','destroy','exports','multer','util','path','express'];(function(_0x44fd52,_0x3a072a){var _0x511c38=function(_0x450383){while(--_0x450383){_0x44fd52['push'](_0x44fd52['shift']());}};_0x511c38(++_0x3a072a);}(_0x6c95,0x178));var _0x56c9=function(_0x3dade5,_0x56d6cb){_0x3dade5=_0x3dade5-0x0;var _0xd6b087=_0x6c95[_0x3dade5];return _0xd6b087;};'use strict';var multer=require(_0x56c9('0x0'));var util=require(_0x56c9('0x1'));var path=require(_0x56c9('0x2'));var timeout=require('connect-timeout');var express=require(_0x56c9('0x3'));var router=express[_0x56c9('0x4')]();var auth=require(_0x56c9('0x5'));var interaction=require(_0x56c9('0x6'));var config=require(_0x56c9('0x7'));var controller=require(_0x56c9('0x8'));router[_0x56c9('0x9')]('/',auth[_0x56c9('0xa')](),controller[_0x56c9('0xb')]);router[_0x56c9('0x9')]('/:id',auth[_0x56c9('0xa')](),controller[_0x56c9('0xc')]);router[_0x56c9('0xd')]('/',auth[_0x56c9('0xa')](),controller[_0x56c9('0xe')]);router[_0x56c9('0xf')]('/:id',auth[_0x56c9('0xa')](),controller[_0x56c9('0x10')]);router['delete'](_0x56c9('0x11'),auth[_0x56c9('0xa')](),controller[_0x56c9('0x12')]);module[_0x56c9('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js
index 1d12663..7b80c65 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 _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
+var _0xbc59=['exports','STRING','name'];(function(_0x46af0f,_0x13b316){var _0x458655=function(_0x371b5a){while(--_0x371b5a){_0x46af0f['push'](_0x46af0f['shift']());}};_0x458655(++_0x13b316);}(_0xbc59,0x123));var _0x9bc5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbc59[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0x9bc5('0x0')]={'name':{'type':Sequelize[_0x9bc5('0x1')],'unique':_0x9bc5('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 7e2b53d..2595c2c 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 _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
+var _0xc87f=['Variable','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','params','includeAll','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','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','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','Variables','UserProfileResource','stack','name','index','map'];(function(_0x1ad926,_0x3e1fed){var _0x1b81dc=function(_0x506f83){while(--_0x506f83){_0x1ad926['push'](_0x1ad926['shift']());}};_0x1b81dc(++_0x3e1fed);}(_0xc87f,0x169));var _0xfc87=function(_0x3da4c1,_0x6dc138){_0x3da4c1=_0x3da4c1-0x0;var _0x36aa2b=_0xc87f[_0x3da4c1];return _0x36aa2b;};'use strict';var pdf=require(_0xfc87('0x0'));var emlformat=require(_0xfc87('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xfc87('0x2'));var jsonpatch=require(_0xfc87('0x3'));var rp=require(_0xfc87('0x4'));var moment=require(_0xfc87('0x5'));var BPromise=require(_0xfc87('0x6'));var Mustache=require('mustache');var util=require(_0xfc87('0x7'));var path=require(_0xfc87('0x8'));var sox=require(_0xfc87('0x9'));var csv=require(_0xfc87('0xa'));var ejs=require(_0xfc87('0xb'));var fs=require('fs');var _=require(_0xfc87('0xc'));var squel=require(_0xfc87('0xd'));var crypto=require(_0xfc87('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfc87('0xf'));var toCsv=require(_0xfc87('0xa'));var querystring=require('querystring');var Papa=require(_0xfc87('0x10'));var Redis=require(_0xfc87('0x11'));var authService=require(_0xfc87('0x12'));var qs=require(_0xfc87('0x13'));var as=require(_0xfc87('0x14'));var hardwareService=require(_0xfc87('0x15'));var logger=require(_0xfc87('0x16'))('api');var utils=require(_0xfc87('0x17'));var config=require(_0xfc87('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x366400,_0x440721){_0x440721=_0x440721||0xcc;return function(_0x1638bb){if(_0x1638bb){return _0x366400[_0xfc87('0x19')](_0x440721);}return _0x366400[_0xfc87('0x1a')](_0x440721)[_0xfc87('0x1b')]();};}function respondWithResult(_0x29fca9,_0x4c7299){_0x4c7299=_0x4c7299||0xc8;return function(_0x55b7c7){if(_0x55b7c7){return _0x29fca9[_0xfc87('0x1a')](_0x4c7299)[_0xfc87('0x1c')](_0x55b7c7);}};}function respondWithFilteredResult(_0x21ec06,_0x30cc39){return function(_0x191b0e){if(_0x191b0e){var _0x122f3a=_0x191b0e[_0xfc87('0x1d')],_0x8895a2=_0x30cc39[_0xfc87('0x1e')],_0x3e2008=_0x30cc39[_0xfc87('0x1e')]+_0x30cc39[_0xfc87('0x1f')],_0xd8d539;if(_0x3e2008>=_0x122f3a){_0x3e2008=_0x122f3a;_0xd8d539=0xc8;}else{_0xd8d539=0xce;}_0x21ec06[_0xfc87('0x1a')](_0xd8d539);return _0x21ec06['set'](_0xfc87('0x20'),_0x8895a2+'-'+_0x3e2008+'/'+_0x122f3a)[_0xfc87('0x1c')](_0x191b0e);}return null;};}function patchUpdates(_0x52bcb5){return function(_0x57aa72){try{jsonpatch['apply'](_0x57aa72,_0x52bcb5,!![]);}catch(_0x269762){return BPromise[_0xfc87('0x21')](_0x269762);}return _0x57aa72[_0xfc87('0x22')]();};}function saveUpdates(_0x76f51f,_0x201234){return function(_0x41f19b){if(_0x41f19b){return _0x41f19b[_0xfc87('0x23')](_0x76f51f)[_0xfc87('0x24')](function(_0x24bc8f){return _0x24bc8f;});}return null;};}function removeEntity(_0xfb438f,_0x2a6323){return function(_0x480e26){if(_0x480e26){return _0x480e26[_0xfc87('0x25')]()[_0xfc87('0x24')](function(){var _0x32d171=_0x480e26['get']({'plain':!![]});var _0x33cf13=_0xfc87('0x26');return db[_0xfc87('0x27')][_0xfc87('0x25')]({'where':{'type':_0x33cf13,'resourceId':_0x32d171['id']}})[_0xfc87('0x24')](function(){return _0x480e26;});})[_0xfc87('0x24')](function(){_0xfb438f[_0xfc87('0x1a')](0xcc)[_0xfc87('0x1b')]();});}};}function handleEntityNotFound(_0x52156d,_0x4f58fd){return function(_0x32d46b){if(!_0x32d46b){_0x52156d[_0xfc87('0x19')](0x194);}return _0x32d46b;};}function handleError(_0x55ecc7,_0x3c7d48){_0x3c7d48=_0x3c7d48||0x1f4;return function(_0xb35ed0){logger['error'](_0xb35ed0[_0xfc87('0x28')]);if(_0xb35ed0[_0xfc87('0x29')]){delete _0xb35ed0[_0xfc87('0x29')];}_0x55ecc7[_0xfc87('0x1a')](_0x3c7d48)['send'](_0xb35ed0);};}exports[_0xfc87('0x2a')]=function(_0xdd680a,_0x35fc28){var _0x8e45={},_0x48bfd3={},_0x11a866={'count':0x0,'rows':[]};var _0x296be3=_[_0xfc87('0x2b')](db[_0xfc87('0x2c')][_0xfc87('0x2d')],function(_0x341619){return{'name':_0x341619['fieldName'],'type':_0x341619[_0xfc87('0x2e')][_0xfc87('0x2f')]};});_0x48bfd3[_0xfc87('0x30')]=_[_0xfc87('0x2b')](_0x296be3,'name');_0x48bfd3[_0xfc87('0x31')]=_[_0xfc87('0x32')](_0xdd680a[_0xfc87('0x31')]);_0x48bfd3['filters']=_[_0xfc87('0x33')](_0x48bfd3['model'],_0x48bfd3[_0xfc87('0x31')]);_0x8e45[_0xfc87('0x34')]=_[_0xfc87('0x33')](_0x48bfd3['model'],qs[_0xfc87('0x35')](_0xdd680a['query'][_0xfc87('0x35')]));_0x8e45[_0xfc87('0x34')]=_0x8e45[_0xfc87('0x34')]['length']?_0x8e45['attributes']:_0x48bfd3['model'];if(!_0xdd680a['query'][_0xfc87('0x36')](_0xfc87('0x37'))){_0x8e45[_0xfc87('0x1f')]=qs[_0xfc87('0x1f')](_0xdd680a[_0xfc87('0x31')][_0xfc87('0x1f')]);_0x8e45[_0xfc87('0x1e')]=qs[_0xfc87('0x1e')](_0xdd680a[_0xfc87('0x31')]['offset']);}_0x8e45[_0xfc87('0x38')]=qs[_0xfc87('0x39')](_0xdd680a[_0xfc87('0x31')][_0xfc87('0x39')]);_0x8e45[_0xfc87('0x3a')]=qs[_0xfc87('0x3b')](_[_0xfc87('0x3c')](_0xdd680a[_0xfc87('0x31')],_0x48bfd3['filters']),_0x296be3);if(_0xdd680a[_0xfc87('0x31')][_0xfc87('0x3d')]){_0x8e45[_0xfc87('0x3a')]=_['merge'](_0x8e45['where'],{'$or':_[_0xfc87('0x2b')](_0x296be3,function(_0x5a13c0){if(_0x5a13c0[_0xfc87('0x2e')]!=='VIRTUAL'){var _0x6aff71={};_0x6aff71[_0x5a13c0['name']]={'$like':'%'+_0xdd680a[_0xfc87('0x31')][_0xfc87('0x3d')]+'%'};return _0x6aff71;}})});}_0x8e45=_[_0xfc87('0x3e')]({},_0x8e45,_0xdd680a[_0xfc87('0x3f')]);var _0x1d1ced={'where':_0x8e45[_0xfc87('0x3a')]};return db[_0xfc87('0x2c')]['count'](_0x1d1ced)[_0xfc87('0x24')](function(_0x531b04){_0x11a866[_0xfc87('0x1d')]=_0x531b04;if(_0xdd680a[_0xfc87('0x31')]['includeAll']){_0x8e45[_0xfc87('0x40')]=[{'all':!![]}];}return db[_0xfc87('0x2c')][_0xfc87('0x41')](_0x8e45);})[_0xfc87('0x24')](function(_0xa35665){_0x11a866[_0xfc87('0x42')]=_0xa35665;return _0x11a866;})['then'](respondWithFilteredResult(_0x35fc28,_0x8e45))[_0xfc87('0x43')](handleError(_0x35fc28,null));};exports['show']=function(_0x429bbd,_0x47cab9){var _0x3646a7={'raw':!![],'where':{'id':_0x429bbd[_0xfc87('0x44')]['id']}},_0x320c56={};_0x320c56[_0xfc87('0x30')]=_['keys'](db[_0xfc87('0x2c')][_0xfc87('0x2d')]);_0x320c56['query']=_['keys'](_0x429bbd['query']);_0x320c56[_0xfc87('0x3b')]=_[_0xfc87('0x33')](_0x320c56['model'],_0x320c56['query']);_0x3646a7[_0xfc87('0x34')]=_[_0xfc87('0x33')](_0x320c56['model'],qs[_0xfc87('0x35')](_0x429bbd['query']['fields']));_0x3646a7[_0xfc87('0x34')]=_0x3646a7[_0xfc87('0x34')]['length']?_0x3646a7[_0xfc87('0x34')]:_0x320c56[_0xfc87('0x30')];if(_0x429bbd[_0xfc87('0x31')][_0xfc87('0x45')]){_0x3646a7[_0xfc87('0x40')]=[{'all':!![]}];}_0x3646a7=_[_0xfc87('0x3e')]({},_0x3646a7,_0x429bbd[_0xfc87('0x3f')]);return db[_0xfc87('0x2c')]['find'](_0x3646a7)[_0xfc87('0x24')](handleEntityNotFound(_0x47cab9,null))[_0xfc87('0x24')](respondWithResult(_0x47cab9,null))[_0xfc87('0x43')](handleError(_0x47cab9,null));};exports[_0xfc87('0x46')]=function(_0x49e368,_0x411da2){return db[_0xfc87('0x2c')][_0xfc87('0x46')](_0x49e368[_0xfc87('0x47')],{})[_0xfc87('0x24')](function(_0x5d27e1){var _0x30815e=_0x49e368[_0xfc87('0x48')][_0xfc87('0x49')]({'plain':!![]});if(!_0x30815e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30815e[_0xfc87('0x4a')]===_0xfc87('0x48')){var _0x5bc6ae=_0x5d27e1[_0xfc87('0x49')]({'plain':!![]});var _0xe174ad='Variables';return db[_0xfc87('0x4b')]['find']({'where':{'name':_0xe174ad,'userProfileId':_0x30815e[_0xfc87('0x4c')]},'raw':!![]})[_0xfc87('0x24')](function(_0x301994){if(_0x301994&&_0x301994[_0xfc87('0x4d')]===0x0){return db['UserProfileResource'][_0xfc87('0x46')]({'name':_0x5bc6ae['name'],'resourceId':_0x5bc6ae['id'],'type':_0x301994[_0xfc87('0x29')],'sectionId':_0x301994['id']},{})[_0xfc87('0x24')](function(){return _0x5d27e1;});}else{return _0x5d27e1;}})['catch'](function(_0x48e7f1){logger[_0xfc87('0x4e')](_0xfc87('0x4f'),_0x48e7f1);throw _0x48e7f1;});}return _0x5d27e1;})[_0xfc87('0x24')](respondWithResult(_0x411da2,0xc9))[_0xfc87('0x43')](handleError(_0x411da2,null));};exports['update']=function(_0x1a9af5,_0x54763f){if(_0x1a9af5[_0xfc87('0x47')]['id']){delete _0x1a9af5[_0xfc87('0x47')]['id'];}return db[_0xfc87('0x2c')][_0xfc87('0x50')]({'where':{'id':_0x1a9af5[_0xfc87('0x44')]['id']}})[_0xfc87('0x24')](handleEntityNotFound(_0x54763f,null))['then'](saveUpdates(_0x1a9af5[_0xfc87('0x47')],null))['then'](respondWithResult(_0x54763f,null))['catch'](handleError(_0x54763f,null));};exports[_0xfc87('0x25')]=function(_0x26fdd3,_0xc0c366){return db[_0xfc87('0x2c')][_0xfc87('0x50')]({'where':{'id':_0x26fdd3[_0xfc87('0x44')]['id']}})[_0xfc87('0x24')](handleEntityNotFound(_0xc0c366,null))['then'](removeEntity(_0xc0c366,null))['catch'](handleError(_0xc0c366,null));};
\ No newline at end of file
diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js
index 15f8253..d9189d8 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 _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
+var _0x3918=['rimraf','../../config/environment','./variable.attributes','exports','Variable','tools_variables','lodash','util','api','moment','bluebird','request-promise'];(function(_0x33cf94,_0x1fe289){var _0x19d5e8=function(_0x151f0a){while(--_0x151f0a){_0x33cf94['push'](_0x33cf94['shift']());}};_0x19d5e8(++_0x1fe289);}(_0x3918,0x1aa));var _0x8391=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3918[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8391('0x0'));var util=require(_0x8391('0x1'));var logger=require('../../config/logger')(_0x8391('0x2'));var moment=require(_0x8391('0x3'));var BPromise=require(_0x8391('0x4'));var rp=require(_0x8391('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8391('0x6'));var config=require(_0x8391('0x7'));var attributes=require(_0x8391('0x8'));module[_0x8391('0x9')]=function(_0x462672,_0x40bedb){return _0x462672['define'](_0x8391('0xa'),attributes,{'tableName':_0x8391('0xb'),'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 0309500..88f851f 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 _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
+var _0x6de4=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','Variable','find','options','where','attributes','map','include','model','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x10a109,_0x32ef1c){var _0x10e632=function(_0x31f3ee){while(--_0x31f3ee){_0x10a109['push'](_0x10a109['shift']());}};_0x10e632(++_0x32ef1c);}(_0x6de4,0x9e));var _0x46de=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6de4[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x46de('0x0'));var util=require(_0x46de('0x1'));var moment=require(_0x46de('0x2'));var BPromise=require(_0x46de('0x3'));var rs=require(_0x46de('0x4'));var fs=require('fs');var Redis=require(_0x46de('0x5'));var db=require(_0x46de('0x6'))['db'];var utils=require(_0x46de('0x7'));var logger=require(_0x46de('0x8'))(_0x46de('0x9'));var config=require(_0x46de('0xa'));var jayson=require(_0x46de('0xb'));var client=jayson[_0x46de('0xc')][_0x46de('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x40f6c1,_0x518381,_0x5dcd71){return new BPromise(function(_0x35040b,_0x1134f1){return client[_0x46de('0xe')](_0x40f6c1,_0x5dcd71)[_0x46de('0xf')](function(_0x482939){logger[_0x46de('0x10')](_0x46de('0x11'),_0x518381,_0x46de('0x12'));logger['debug']('Variable,\x20%s,\x20%s,\x20%s',_0x518381,_0x46de('0x12'),JSON[_0x46de('0x13')](_0x482939));if(_0x482939['error']){if(_0x482939[_0x46de('0x14')][_0x46de('0x15')]===0x1f4){logger[_0x46de('0x14')](_0x46de('0x11'),_0x518381,_0x482939[_0x46de('0x14')][_0x46de('0x16')]);return _0x1134f1(_0x482939['error'][_0x46de('0x16')]);}logger[_0x46de('0x14')](_0x46de('0x11'),_0x518381,_0x482939[_0x46de('0x14')][_0x46de('0x16')]);return _0x35040b(_0x482939[_0x46de('0x14')][_0x46de('0x16')]);}else{logger[_0x46de('0x10')](_0x46de('0x11'),_0x518381,'request\x20sent');_0x35040b(_0x482939['result'][_0x46de('0x16')]);}})[_0x46de('0x17')](function(_0xaa77b6){logger['error'](_0x46de('0x11'),_0x518381,_0xaa77b6);_0x1134f1(_0xaa77b6);});});}exports['ShowVariable']=function(_0x21c264){var _0x28223a=this;return new Promise(function(_0x224f46,_0x1cc22b){return db[_0x46de('0x18')][_0x46de('0x19')]({'raw':_0x21c264['options']?_0x21c264[_0x46de('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x21c264[_0x46de('0x1a')]?_0x21c264[_0x46de('0x1a')][_0x46de('0x1b')]||null:null,'attributes':_0x21c264['options']?_0x21c264[_0x46de('0x1a')][_0x46de('0x1c')]||null:null,'include':_0x21c264[_0x46de('0x1a')]?_0x21c264[_0x46de('0x1a')]['include']?_[_0x46de('0x1d')](_0x21c264[_0x46de('0x1a')][_0x46de('0x1e')],function(_0x4340d6){return{'model':db[_0x4340d6[_0x46de('0x1f')]],'as':_0x4340d6['as'],'attributes':_0x4340d6[_0x46de('0x1c')],'include':_0x4340d6[_0x46de('0x1e')]?_[_0x46de('0x1d')](_0x4340d6[_0x46de('0x1e')],function(_0x5b38ed){return{'model':db[_0x5b38ed[_0x46de('0x1f')]],'as':_0x5b38ed['as'],'attributes':_0x5b38ed[_0x46de('0x1c')],'include':_0x5b38ed[_0x46de('0x1e')]?_[_0x46de('0x1d')](_0x5b38ed[_0x46de('0x1e')],function(_0x57ad55){return{'model':db[_0x57ad55[_0x46de('0x1f')]],'as':_0x57ad55['as'],'attributes':_0x57ad55[_0x46de('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x46de('0xf')](function(_0x288f06){logger[_0x46de('0x10')](_0x46de('0x20'),_0x21c264);logger['debug'](_0x46de('0x20'),_0x21c264,JSON[_0x46de('0x13')](_0x288f06));_0x224f46(_0x288f06);})[_0x46de('0x17')](function(_0x4c1b67){logger[_0x46de('0x14')](_0x46de('0x20'),_0x4c1b67[_0x46de('0x16')],_0x21c264);_0x1cc22b(_0x28223a[_0x46de('0x14')](0x1f4,_0x4c1b67[_0x46de('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/version/index.js b/server/api/version/index.js
index 41496ce..93175ba 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 _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
+var _0x21ce=['restart','migrations','exports','../../components/auth/service','get','index','/fetch','isAuthenticated','canUpdate','/reset','reset','/pull','pull'];(function(_0x129487,_0xf469cf){var _0x5ad6ad=function(_0x202862){while(--_0x202862){_0x129487['push'](_0x129487['shift']());}};_0x5ad6ad(++_0xf469cf);}(_0x21ce,0x196));var _0xe21c=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x21ce[_0x5d2803];return _0xdcad2c;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xe21c('0x0'));var controller=require('./version.controller');router[_0xe21c('0x1')]('/',controller[_0xe21c('0x2')]);router[_0xe21c('0x1')](_0xe21c('0x3'),auth[_0xe21c('0x4')](),auth[_0xe21c('0x5')](),controller['fetch']);router[_0xe21c('0x1')](_0xe21c('0x6'),auth['isAuthenticated'](),auth[_0xe21c('0x5')](),controller[_0xe21c('0x7')]);router['get'](_0xe21c('0x8'),auth[_0xe21c('0x4')](),auth['canUpdate'](),controller[_0xe21c('0x9')]);router[_0xe21c('0x1')]('/restart',auth['isAuthenticated'](),controller[_0xe21c('0xa')]);router[_0xe21c('0x1')]('/migrations',controller[_0xe21c('0xb')]);module[_0xe21c('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js
index e52cb31..f0bbfcb 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 _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
+var _0x1261=['master','error','git\x20fetch','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','join','server','replace','.js','push','length','sort','sequelize','Migration','getQueryInterface','constructor','map','\x20to\x20','catch','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','simple-git','root','exports','query','latest','fetch','2.0.0','status','json'];(function(_0x8f8163,_0x397024){var _0x1fcf14=function(_0x2a7e6e){while(--_0x2a7e6e){_0x8f8163['push'](_0x8f8163['shift']());}};_0x1fcf14(++_0x397024);}(_0x1261,0x144));var _0x1126=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0x1261[_0x390733];return _0x33beb9;};'use strict';var Umzug=require('umzug');var path=require(_0x1126('0x0'));var fs=require('fs');var _=require(_0x1126('0x1'));var pkginfo=require(_0x1126('0x2'))(module,_0x1126('0x3'));var compareVersions=require(_0x1126('0x4'));var exec=require(_0x1126('0x5'))[_0x1126('0x6')];var db=require(_0x1126('0x7'))['db'];var config=require(_0x1126('0x8'));var pm2=require(_0x1126('0x9'));var logger=require('../../config/logger')('update');var git=require(_0x1126('0xa'))(config[_0x1126('0xb')]);exports['index']=function(_0x17e5f0,_0x28772d){var _0x245be9={'current':module[_0x1126('0xc')][_0x1126('0x3')],'phonebar':0x2};if(_0x17e5f0['query']&&_0x17e5f0[_0x1126('0xd')][_0x1126('0xe')]){return git[_0x1126('0xf')]()['tags'](function(_0x34571c,_0x5d581b){_0x245be9['latest']=(_0x34571c?module[_0x1126('0xc')]['version']:_0x5d581b[_0x1126('0xe')])||_0x1126('0x10');return _0x28772d[_0x1126('0x11')](0xc8)[_0x1126('0x12')](_0x245be9);});}else{return _0x28772d[_0x1126('0x11')](0xc8)[_0x1126('0x12')](_0x245be9);}};exports[_0x1126('0xf')]=function(_0x2048ad,_0x43850b){return git['fetch'](['origin',_0x1126('0x13')],function(_0x154e20){if(_0x154e20){logger[_0x1126('0x14')](_0x154e20);return _0x43850b['status'](0x1f4)[_0x1126('0x12')](_0x154e20);}logger['info'](_0x1126('0x15'));return _0x43850b[_0x1126('0x11')](0xc8)[_0x1126('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x1126('0x16')]=function(_0x1695f6,_0x4a7b49){return git['reset']([_0x1126('0x17'),_0x1126('0x18')],function(_0x58d11a){if(_0x58d11a){logger['error'](_0x58d11a);return _0x4a7b49[_0x1126('0x11')](0x1f4)['json'](_0x58d11a);}logger[_0x1126('0x19')](_0x1126('0x1a'));return _0x4a7b49[_0x1126('0x11')](0xc8)['json']({'output':_0x1126('0x1b')});});};exports['pull']=function(_0x56efeb,_0x30f6b3){exec(_0x1126('0x1c'),function(_0x25b24b,_0x36d254,_0x526ca1){logger[_0x1126('0x19')](_0x36d254);logger[_0x1126('0x19')](_0x526ca1);if(_0x25b24b){logger['error'](_0x25b24b);return _0x30f6b3[_0x1126('0x11')](0x1f4)['json'](_0x25b24b);}return _0x30f6b3['status'](0xc8)['json']({'output':_0x36d254});});};exports[_0x1126('0x1d')]=function(_0x15bcc3,_0x329914){return pm2[_0x1126('0x1d')](_0x1126('0x1e'))[_0x1126('0x1f')](function(_0xea0971){logger[_0x1126('0x19')]('pm2\x20restart\x20motion\x20%s',_0xea0971);return _0x329914[_0x1126('0x11')](0xc8)[_0x1126('0x12')]({'output':_0x1126('0x20')});})['catch'](function(_0x541bc9){logger[_0x1126('0x14')](_0x541bc9);return _0x329914[_0x1126('0x11')](0x1f4)['json'](_0x541bc9);});};exports[_0x1126('0x21')]=function(_0x23d2bc,_0x4a334a){var _0x3fa694=fs['readdirSync'](path[_0x1126('0x22')](config['root'],_0x1126('0x23'),'migrations'));var _0x378f4d=[];for(var _0x5f2611=0x0;_0x5f2611<_0x3fa694['length'];_0x5f2611++){var _0x4a53ab=_0x3fa694[_0x5f2611][_0x1126('0x24')](_0x1126('0x25'),'');if(compareVersions(module[_0x1126('0xc')]['version'],_0x4a53ab)===-0x1){_0x378f4d[_0x1126('0x26')](_0x4a53ab);}}if(_0x378f4d[_0x1126('0x27')]){var _0x56f7f8=_0x378f4d[_0x1126('0x28')](compareVersions);var _0x1e80aa=new Umzug({'storage':_0x1126('0x29'),'storageOptions':{'model':db[_0x1126('0x2a')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0x1126('0x29')][_0x1126('0x2b')](),db[_0x1126('0x29')][_0x1126('0x2c')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x1126('0x22')](config[_0x1126('0xb')],_0x1126('0x23'),_0x1126('0x21')),'pattern':/\.js$/}});_0x1e80aa['up']({'migrations':_[_0x1126('0x2d')](_0x56f7f8,function(_0x5df232){return _0x5df232+_0x1126('0x25');})})[_0x1126('0x1f')](function(){return _0x4a334a[_0x1126('0x11')](0xc8)[_0x1126('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0x1126('0x3')]+_0x1126('0x2e')+_['last'](_0x56f7f8),'migrations':_[_0x1126('0x22')](_0x56f7f8)});})[_0x1126('0x2f')](function(_0x11b0f6){if(_0x11b0f6 instanceof db['sequelize']['UniqueConstraintError']){return _0x4a334a[_0x1126('0x11')](0xc8)[_0x1126('0x12')]({'output':_0x1126('0x30')});}else{return _0x4a334a[_0x1126('0x11')](0x1f4)['json'](_0x11b0f6);}});}else{return _0x4a334a[_0x1126('0x11')](0xc8)['json']({'output':_0x1126('0x30')});}};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js
index 81b865c..0c44a79 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 _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
+var _0xf432=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x2979d3,_0x54ff61){var _0x2a9a36=function(_0x215f64){while(--_0x215f64){_0x2979d3['push'](_0x2979d3['shift']());}};_0x2a9a36(++_0x54ff61);}(_0xf432,0x84));var _0x2f43=function(_0x32e2eb,_0x3347b7){_0x32e2eb=_0x32e2eb-0x0;var _0x2418ce=_0xf432[_0x32e2eb];return _0x2418ce;};'use strict';var multer=require(_0x2f43('0x0'));var util=require(_0x2f43('0x1'));var path=require('path');var timeout=require(_0x2f43('0x2'));var express=require(_0x2f43('0x3'));var router=express[_0x2f43('0x4')]();var auth=require(_0x2f43('0x5'));var interaction=require(_0x2f43('0x6'));var config=require('../../config/environment');var controller=require(_0x2f43('0x7'));router[_0x2f43('0x8')]('/',auth[_0x2f43('0x9')](),controller[_0x2f43('0xa')]);router[_0x2f43('0x8')](_0x2f43('0xb'),auth[_0x2f43('0x9')](),controller[_0x2f43('0xc')]);router[_0x2f43('0x8')](_0x2f43('0xd'),auth['isAuthenticated'](),controller[_0x2f43('0xe')]);router['post']('/',auth[_0x2f43('0x9')](),controller[_0x2f43('0xf')]);router[_0x2f43('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2f43('0x11')]);router[_0x2f43('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x2f43('0x13')]);module[_0x2f43('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js
index 4606d1a..5cf094c 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 _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
+var _0x33c5=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','INTEGER'];(function(_0xede2f8,_0x6cf5c1){var _0x1dedf0=function(_0xbf8cd5){while(--_0xbf8cd5){_0xede2f8['push'](_0xede2f8['shift']());}};_0x1dedf0(++_0x6cf5c1);}(_0x33c5,0xe6));var _0x533c=function(_0xd0cd0b,_0x490956){_0xd0cd0b=_0xd0cd0b-0x0;var _0x59cced=_0x33c5[_0xd0cd0b];return _0x59cced;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'type':{'type':Sequelize[_0x533c('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x533c('0x1')]},'calleridname':{'type':Sequelize[_0x533c('0x1')]},'queue':{'type':Sequelize[_0x533c('0x1')]},'interface':{'type':Sequelize[_0x533c('0x1')]},'membername':{'type':Sequelize[_0x533c('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x533c('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x533c('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x533c('0x2')]},'agentdumpAt':{'type':Sequelize[_0x533c('0x2')]},'holdtime':{'type':Sequelize[_0x533c('0x3')]},'agentcomplete':{'type':Sequelize[_0x533c('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x533c('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x533c('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x533c('0x3')]},'agentacw':{'type':Sequelize[_0x533c('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x533c('0x3')]},'reason':{'type':Sequelize[_0x533c('0x1')]},'lastevent':{'type':Sequelize[_0x533c('0x1')]},'channel':{'type':Sequelize[_0x533c('0x1')]},'channelstate':{'type':Sequelize[_0x533c('0x3')]},'channelstatedesc':{'type':Sequelize[_0x533c('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x533c('0x1')]},'language':{'type':Sequelize[_0x533c('0x1')]},'accountcode':{'type':Sequelize[_0x533c('0x1')]},'context':{'type':Sequelize[_0x533c('0x1')]},'exten':{'type':Sequelize[_0x533c('0x1')]},'priority':{'type':Sequelize[_0x533c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x533c('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x533c('0x1')]},'destcalleridnum':{'type':Sequelize[_0x533c('0x1')]},'destcalleridname':{'type':Sequelize[_0x533c('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x533c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x533c('0x1')]},'destlanguage':{'type':Sequelize[_0x533c('0x1')]},'destaccountcode':{'type':Sequelize[_0x533c('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x533c('0x1')]},'destpriority':{'type':Sequelize[_0x533c('0x1')]},'destuniqueid':{'type':Sequelize[_0x533c('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x533c('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x533c('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x533c('0x1')],'comment':_0x533c('0x5')},'transferexten':{'type':Sequelize[_0x533c('0x1')]},'transferuniqueid':{'type':Sequelize[_0x533c('0x1')]},'agententerreason':{'type':Sequelize[_0x533c('0x3')],'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 5f037c7..3b0273b 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 _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
+var _0x1090=['zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','reject','save','update','then','destroy','error','stack','name','send','map','VoiceAgentReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','find','create','body','catch','describe','html-pdf','rimraf'];(function(_0x48df8d,_0x42fd50){var _0x3125bf=function(_0x2bd552){while(--_0x2bd552){_0x48df8d['push'](_0x48df8d['shift']());}};_0x3125bf(++_0x42fd50);}(_0x1090,0x1a2));var _0x0109=function(_0xcdd89b,_0x40b13f){_0xcdd89b=_0xcdd89b-0x0;var _0x1c525d=_0x1090[_0xcdd89b];return _0x1c525d;};'use strict';var pdf=require(_0x0109('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0109('0x1'));var zipdir=require(_0x0109('0x2'));var jsonpatch=require(_0x0109('0x3'));var rp=require(_0x0109('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0109('0x5'));var util=require(_0x0109('0x6'));var path=require(_0x0109('0x7'));var sox=require('sox');var csv=require(_0x0109('0x8'));var ejs=require(_0x0109('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0109('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0109('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0109('0xc'));var Papa=require('papaparse');var Redis=require(_0x0109('0xd'));var authService=require(_0x0109('0xe'));var qs=require(_0x0109('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0109('0x10'));var logger=require(_0x0109('0x11'))('api');var utils=require(_0x0109('0x12'));var config=require('../../config/environment');var db=require(_0x0109('0x13'))['db'];function respondWithStatusCode(_0x38c4d2,_0x263f0c){_0x263f0c=_0x263f0c||0xcc;return function(_0x2f9780){if(_0x2f9780){return _0x38c4d2[_0x0109('0x14')](_0x263f0c);}return _0x38c4d2[_0x0109('0x15')](_0x263f0c)[_0x0109('0x16')]();};}function respondWithResult(_0x3020d5,_0x304c5e){_0x304c5e=_0x304c5e||0xc8;return function(_0x58cb1f){if(_0x58cb1f){return _0x3020d5['status'](_0x304c5e)[_0x0109('0x17')](_0x58cb1f);}};}function respondWithFilteredResult(_0x1e1757,_0x409b93){return function(_0x4021fe){if(_0x4021fe){var _0x2b50b6=_0x4021fe[_0x0109('0x18')],_0x446314=_0x409b93[_0x0109('0x19')],_0x42b2ce=_0x409b93['offset']+_0x409b93['limit'],_0x44b637;if(_0x42b2ce>=_0x2b50b6){_0x42b2ce=_0x2b50b6;_0x44b637=0xc8;}else{_0x44b637=0xce;}_0x1e1757[_0x0109('0x15')](_0x44b637);return _0x1e1757[_0x0109('0x1a')]('Content-Range',_0x446314+'-'+_0x42b2ce+'/'+_0x2b50b6)[_0x0109('0x17')](_0x4021fe);}return null;};}function patchUpdates(_0x3343e4){return function(_0x22a092){try{jsonpatch['apply'](_0x22a092,_0x3343e4,!![]);}catch(_0x123733){return BPromise[_0x0109('0x1b')](_0x123733);}return _0x22a092[_0x0109('0x1c')]();};}function saveUpdates(_0x21cee2,_0xf63fc7){return function(_0x4c745f){if(_0x4c745f){return _0x4c745f[_0x0109('0x1d')](_0x21cee2)[_0x0109('0x1e')](function(_0x383890){return _0x383890;});}return null;};}function removeEntity(_0x35f956,_0x33fee3){return function(_0x168197){if(_0x168197){return _0x168197[_0x0109('0x1f')]()[_0x0109('0x1e')](function(){_0x35f956[_0x0109('0x15')](0xcc)[_0x0109('0x16')]();});}};}function handleEntityNotFound(_0xab68ed,_0x20ec21){return function(_0x333502){if(!_0x333502){_0xab68ed[_0x0109('0x14')](0x194);}return _0x333502;};}function handleError(_0xfbc253,_0x352843){_0x352843=_0x352843||0x1f4;return function(_0x1034cf){logger[_0x0109('0x20')](_0x1034cf[_0x0109('0x21')]);if(_0x1034cf[_0x0109('0x22')]){delete _0x1034cf[_0x0109('0x22')];}_0xfbc253[_0x0109('0x15')](_0x352843)[_0x0109('0x23')](_0x1034cf);};}exports['index']=function(_0x4ddb27,_0xc49c49){var _0x1d680b={},_0x21b99a={},_0x26c201={'count':0x0,'rows':[]};var _0x5ee15f=_[_0x0109('0x24')](db[_0x0109('0x25')][_0x0109('0x26')],function(_0x1ffe27){return{'name':_0x1ffe27[_0x0109('0x27')],'type':_0x1ffe27[_0x0109('0x28')][_0x0109('0x29')]};});_0x21b99a[_0x0109('0x2a')]=_[_0x0109('0x24')](_0x5ee15f,_0x0109('0x22'));_0x21b99a[_0x0109('0x2b')]=_[_0x0109('0x2c')](_0x4ddb27[_0x0109('0x2b')]);_0x21b99a[_0x0109('0x2d')]=_['intersection'](_0x21b99a[_0x0109('0x2a')],_0x21b99a[_0x0109('0x2b')]);_0x1d680b['attributes']=_[_0x0109('0x2e')](_0x21b99a[_0x0109('0x2a')],qs[_0x0109('0x2f')](_0x4ddb27[_0x0109('0x2b')][_0x0109('0x2f')]));_0x1d680b[_0x0109('0x30')]=_0x1d680b[_0x0109('0x30')][_0x0109('0x31')]?_0x1d680b[_0x0109('0x30')]:_0x21b99a[_0x0109('0x2a')];if(!_0x4ddb27[_0x0109('0x2b')]['hasOwnProperty'](_0x0109('0x32'))){_0x1d680b[_0x0109('0x33')]=qs[_0x0109('0x33')](_0x4ddb27[_0x0109('0x2b')][_0x0109('0x33')]);_0x1d680b[_0x0109('0x19')]=qs['offset'](_0x4ddb27[_0x0109('0x2b')][_0x0109('0x19')]);}_0x1d680b[_0x0109('0x34')]=qs[_0x0109('0x35')](_0x4ddb27[_0x0109('0x2b')][_0x0109('0x35')]);_0x1d680b[_0x0109('0x36')]=qs['filters'](_[_0x0109('0x37')](_0x4ddb27[_0x0109('0x2b')],_0x21b99a[_0x0109('0x2d')]),_0x5ee15f);if(_0x4ddb27['query']['filter']){_0x1d680b['where']=_['merge'](_0x1d680b[_0x0109('0x36')],{'$or':_[_0x0109('0x24')](_0x5ee15f,function(_0x33dcce){if(_0x33dcce[_0x0109('0x28')]!==_0x0109('0x38')){var _0x2dd018={};_0x2dd018[_0x33dcce[_0x0109('0x22')]]={'$like':'%'+_0x4ddb27[_0x0109('0x2b')][_0x0109('0x39')]+'%'};return _0x2dd018;}})});}_0x1d680b=_[_0x0109('0x3a')]({},_0x1d680b,_0x4ddb27[_0x0109('0x3b')]);var _0x439591={'where':_0x1d680b[_0x0109('0x36')]};return db[_0x0109('0x25')]['count'](_0x439591)[_0x0109('0x1e')](function(_0x246154){_0x26c201[_0x0109('0x18')]=_0x246154;if(_0x4ddb27[_0x0109('0x2b')][_0x0109('0x3c')]){_0x1d680b[_0x0109('0x3d')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0109('0x3e')](_0x1d680b);})['then'](function(_0x51de56){_0x26c201[_0x0109('0x3f')]=_0x51de56;return _0x26c201;})['then'](respondWithFilteredResult(_0xc49c49,_0x1d680b))['catch'](handleError(_0xc49c49,null));};exports['show']=function(_0x44a29d,_0x403796){var _0x1da824={'raw':![],'where':{'id':_0x44a29d[_0x0109('0x40')]['id']}},_0x582ab4={};_0x582ab4[_0x0109('0x2a')]=_[_0x0109('0x2c')](db[_0x0109('0x25')][_0x0109('0x26')]);_0x582ab4[_0x0109('0x2b')]=_[_0x0109('0x2c')](_0x44a29d[_0x0109('0x2b')]);_0x582ab4[_0x0109('0x2d')]=_[_0x0109('0x2e')](_0x582ab4['model'],_0x582ab4[_0x0109('0x2b')]);_0x1da824[_0x0109('0x30')]=_[_0x0109('0x2e')](_0x582ab4[_0x0109('0x2a')],qs['fields'](_0x44a29d[_0x0109('0x2b')]['fields']));_0x1da824['attributes']=_0x1da824[_0x0109('0x30')][_0x0109('0x31')]?_0x1da824[_0x0109('0x30')]:_0x582ab4[_0x0109('0x2a')];if(_0x44a29d[_0x0109('0x2b')][_0x0109('0x3c')]){_0x1da824['include']=[{'all':!![]}];}_0x1da824=_['merge']({},_0x1da824,_0x44a29d[_0x0109('0x3b')]);return db[_0x0109('0x25')][_0x0109('0x41')](_0x1da824)[_0x0109('0x1e')](handleEntityNotFound(_0x403796,null))[_0x0109('0x1e')](respondWithResult(_0x403796,null))['catch'](handleError(_0x403796,null));};exports[_0x0109('0x42')]=function(_0x4aaf2a,_0x4512c3){return db[_0x0109('0x25')][_0x0109('0x42')](_0x4aaf2a[_0x0109('0x43')],{})[_0x0109('0x1e')](respondWithResult(_0x4512c3,0xc9))[_0x0109('0x44')](handleError(_0x4512c3,null));};exports['update']=function(_0x51a42d,_0xbc0dc5){if(_0x51a42d[_0x0109('0x43')]['id']){delete _0x51a42d[_0x0109('0x43')]['id'];}return db[_0x0109('0x25')][_0x0109('0x41')]({'where':{'id':_0x51a42d[_0x0109('0x40')]['id']}})['then'](handleEntityNotFound(_0xbc0dc5,null))[_0x0109('0x1e')](saveUpdates(_0x51a42d[_0x0109('0x43')],null))[_0x0109('0x1e')](respondWithResult(_0xbc0dc5,null))[_0x0109('0x44')](handleError(_0xbc0dc5,null));};exports['destroy']=function(_0x350e34,_0x12de79){return db[_0x0109('0x25')]['find']({'where':{'id':_0x350e34[_0x0109('0x40')]['id']}})[_0x0109('0x1e')](handleEntityNotFound(_0x12de79,null))[_0x0109('0x1e')](removeEntity(_0x12de79,null))['catch'](handleError(_0x12de79,null));};exports[_0x0109('0x45')]=function(_0x4d692c,_0x122842){return db['VoiceAgentReport'][_0x0109('0x45')]()['then'](respondWithResult(_0x122842,null))[_0x0109('0x44')](handleError(_0x122842,null));};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js
index f02a6e5..1c1c8a4 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 _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
+var _0xa9e0=['define','VoiceAgentReport','destuniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid',_0x0a9e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js
index 61faa6b..ab65a62 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 _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
+var _0x6ba7=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateVoiceAgentReport','VoiceAgentReport','create','options','UpdateVoiceAgentReport','update','body','limit','catch','lodash','moment','randomstring','ioredis'];(function(_0x5b5027,_0x54ae4a){var _0x399a16=function(_0x233b0d){while(--_0x233b0d){_0x5b5027['push'](_0x5b5027['shift']());}};_0x399a16(++_0x54ae4a);}(_0x6ba7,0x146));var _0x76ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ba7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x76ba('0x0'));var util=require('util');var moment=require(_0x76ba('0x1'));var BPromise=require('bluebird');var rs=require(_0x76ba('0x2'));var fs=require('fs');var Redis=require(_0x76ba('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x76ba('0x4'));var logger=require('../../config/logger')(_0x76ba('0x5'));var config=require(_0x76ba('0x6'));var jayson=require(_0x76ba('0x7'));var client=jayson[_0x76ba('0x8')][_0x76ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x409562,_0x22342a,_0x52c0bd){return new BPromise(function(_0x1d916c,_0x2428db){return client['request'](_0x409562,_0x52c0bd)[_0x76ba('0xa')](function(_0x203312){logger[_0x76ba('0xb')](_0x76ba('0xc'),_0x22342a,'request\x20sent');logger[_0x76ba('0xd')](_0x76ba('0xe'),_0x22342a,_0x76ba('0xf'),JSON[_0x76ba('0x10')](_0x203312));if(_0x203312[_0x76ba('0x11')]){if(_0x203312['error'][_0x76ba('0x12')]===0x1f4){logger[_0x76ba('0x11')](_0x76ba('0xc'),_0x22342a,_0x203312[_0x76ba('0x11')]['message']);return _0x2428db(_0x203312[_0x76ba('0x11')]['message']);}logger[_0x76ba('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x22342a,_0x203312[_0x76ba('0x11')][_0x76ba('0x13')]);return _0x1d916c(_0x203312[_0x76ba('0x11')][_0x76ba('0x13')]);}else{logger[_0x76ba('0xb')](_0x76ba('0xc'),_0x22342a,_0x76ba('0xf'));_0x1d916c(_0x203312[_0x76ba('0x14')][_0x76ba('0x13')]);}})['catch'](function(_0x1a6c3b){logger['error'](_0x76ba('0xc'),_0x22342a,_0x1a6c3b);_0x2428db(_0x1a6c3b);});});}exports[_0x76ba('0x15')]=function(_0x36f8ee){var _0x2d95f9=this;return new Promise(function(_0xb369c1,_0x1e4066){return db[_0x76ba('0x16')][_0x76ba('0x17')](_0x36f8ee['body'],{'raw':_0x36f8ee[_0x76ba('0x18')]?_0x36f8ee[_0x76ba('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x76ba('0xa')](function(_0xeef85f){logger[_0x76ba('0xb')](_0x76ba('0x15'),_0x36f8ee);logger[_0x76ba('0xd')](_0x76ba('0x15'),_0x36f8ee,JSON[_0x76ba('0x10')](_0xeef85f));_0xb369c1(_0xeef85f);})['catch'](function(_0x53325e){logger[_0x76ba('0x11')](_0x76ba('0x15'),_0x53325e['message'],_0x36f8ee);_0x1e4066(_0x2d95f9[_0x76ba('0x11')](0x1f4,_0x53325e['message']));});});};exports[_0x76ba('0x19')]=function(_0x543db4){var _0x4034e9=this;return new Promise(function(_0x509d88,_0x229f01){return db[_0x76ba('0x16')][_0x76ba('0x1a')](_0x543db4[_0x76ba('0x1b')],{'raw':_0x543db4[_0x76ba('0x18')]?_0x543db4[_0x76ba('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x543db4[_0x76ba('0x18')]?_0x543db4['options']['where']||null:null,'attributes':_0x543db4[_0x76ba('0x18')]?_0x543db4['options']['attributes']||null:null,'limit':_0x543db4[_0x76ba('0x18')]?_0x543db4[_0x76ba('0x18')][_0x76ba('0x1c')]||null:null})[_0x76ba('0xa')](function(_0x47c25c){logger[_0x76ba('0xb')](_0x76ba('0x19'),_0x543db4);logger['debug'](_0x76ba('0x19'),_0x543db4,JSON[_0x76ba('0x10')](_0x47c25c));_0x509d88(_0x47c25c);})[_0x76ba('0x1d')](function(_0x3c530){logger[_0x76ba('0x11')](_0x76ba('0x19'),_0x3c530[_0x76ba('0x13')],_0x543db4);_0x229f01(_0x4034e9['error'](0x1f4,_0x3c530[_0x76ba('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js
index 87acf36..d629889 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 _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
+var _0x1c4f=['/:id','show','create','put','update','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x1dd30c,_0x585158){var _0x491688=function(_0x56d0a0){while(--_0x56d0a0){_0x1dd30c['push'](_0x1dd30c['shift']());}};_0x491688(++_0x585158);}(_0x1c4f,0x1a4));var _0xf1c4=function(_0x22a4a3,_0xaaa808){_0x22a4a3=_0x22a4a3-0x0;var _0x306843=_0x1c4f[_0x22a4a3];return _0x306843;};'use strict';var multer=require(_0xf1c4('0x0'));var util=require('util');var path=require(_0xf1c4('0x1'));var timeout=require(_0xf1c4('0x2'));var express=require(_0xf1c4('0x3'));var router=express[_0xf1c4('0x4')]();var auth=require(_0xf1c4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf1c4('0x6'));var controller=require('./voiceCallReport.controller');router[_0xf1c4('0x7')]('/',auth[_0xf1c4('0x8')](),controller[_0xf1c4('0x9')]);router['get'](_0xf1c4('0xa'),auth[_0xf1c4('0x8')](),controller[_0xf1c4('0xb')]);router[_0xf1c4('0x7')](_0xf1c4('0xc'),auth['isAuthenticated'](),controller[_0xf1c4('0xd')]);router['post']('/',auth[_0xf1c4('0x8')](),controller[_0xf1c4('0xe')]);router[_0xf1c4('0xf')](_0xf1c4('0xc'),auth[_0xf1c4('0x8')](),controller[_0xf1c4('0x10')]);router['delete'](_0xf1c4('0xc'),auth[_0xf1c4('0x8')](),controller[_0xf1c4('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js
index c7cde53..a74ef26 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(_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
+var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x17c1bf,_0x3e50e8){var _0x51166c=function(_0x40651e){while(--_0x40651e){_0x17c1bf['push'](_0x17c1bf['shift']());}};_0x51166c(++_0x3e50e8);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js
index 88bbbf5..4083621 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 _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
+var _0xc4b7=['mustache','util','sox','to-csv','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','set','apply','reject','save','update','then','end','error','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','include','fullname','alias','show','filters','includeAll','options','find','catch','create','body','destroy','params','describe','uniqueid','user','html-pdf','rimraf','fast-json-patch','moment'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xc4b7,0xdd));var _0x7c4b=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xc4b7[_0x49b207];return _0x2dc8fa;};'use strict';var pdf=require(_0x7c4b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7c4b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c4b('0x2'));var rp=require('request-promise');var moment=require(_0x7c4b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7c4b('0x4'));var util=require(_0x7c4b('0x5'));var path=require('path');var sox=require(_0x7c4b('0x6'));var csv=require(_0x7c4b('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7c4b('0x8'));var squel=require('squel');var crypto=require(_0x7c4b('0x9'));var jsforce=require(_0x7c4b('0xa'));var deskjs=require(_0x7c4b('0xb'));var toCsv=require(_0x7c4b('0x7'));var querystring=require(_0x7c4b('0xc'));var Papa=require(_0x7c4b('0xd'));var Redis=require('ioredis');var authService=require(_0x7c4b('0xe'));var qs=require(_0x7c4b('0xf'));var as=require(_0x7c4b('0x10'));var hardwareService=require(_0x7c4b('0x11'));var logger=require(_0x7c4b('0x12'))(_0x7c4b('0x13'));var utils=require(_0x7c4b('0x14'));var config=require(_0x7c4b('0x15'));var db=require(_0x7c4b('0x16'))['db'];function respondWithStatusCode(_0xd9e614,_0x54480a){_0x54480a=_0x54480a||0xcc;return function(_0x3a6b01){if(_0x3a6b01){return _0xd9e614[_0x7c4b('0x17')](_0x54480a);}return _0xd9e614[_0x7c4b('0x18')](_0x54480a)['end']();};}function respondWithResult(_0x368f9e,_0x46aa1c){_0x46aa1c=_0x46aa1c||0xc8;return function(_0x4d69be){if(_0x4d69be){return _0x368f9e[_0x7c4b('0x18')](_0x46aa1c)[_0x7c4b('0x19')](_0x4d69be);}};}function respondWithFilteredResult(_0x31f96b,_0x2af5e9){return function(_0x574a97){if(_0x574a97){var _0x429789=_0x574a97[_0x7c4b('0x1a')],_0x36b2b8=_0x2af5e9[_0x7c4b('0x1b')],_0x31db3f=_0x2af5e9[_0x7c4b('0x1b')]+_0x2af5e9['limit'],_0x4507bb;if(_0x31db3f>=_0x429789){_0x31db3f=_0x429789;_0x4507bb=0xc8;}else{_0x4507bb=0xce;}_0x31f96b['status'](_0x4507bb);return _0x31f96b[_0x7c4b('0x1c')]('Content-Range',_0x36b2b8+'-'+_0x31db3f+'/'+_0x429789)['json'](_0x574a97);}return null;};}function patchUpdates(_0x39a0fe){return function(_0x1724a6){try{jsonpatch[_0x7c4b('0x1d')](_0x1724a6,_0x39a0fe,!![]);}catch(_0xb2c2e0){return BPromise[_0x7c4b('0x1e')](_0xb2c2e0);}return _0x1724a6[_0x7c4b('0x1f')]();};}function saveUpdates(_0x14cd74,_0x3f07e7){return function(_0x3ec1b0){if(_0x3ec1b0){return _0x3ec1b0[_0x7c4b('0x20')](_0x14cd74)[_0x7c4b('0x21')](function(_0x239619){return _0x239619;});}return null;};}function removeEntity(_0x5abd92,_0x279f00){return function(_0x3e2a3f){if(_0x3e2a3f){return _0x3e2a3f['destroy']()[_0x7c4b('0x21')](function(){_0x5abd92[_0x7c4b('0x18')](0xcc)[_0x7c4b('0x22')]();});}};}function handleEntityNotFound(_0x510739,_0x38b077){return function(_0x4859fb){if(!_0x4859fb){_0x510739[_0x7c4b('0x17')](0x194);}return _0x4859fb;};}function handleError(_0xc6298e,_0xdf145){_0xdf145=_0xdf145||0x1f4;return function(_0x56a4ed){logger[_0x7c4b('0x23')](_0x56a4ed['stack']);if(_0x56a4ed[_0x7c4b('0x24')]){delete _0x56a4ed[_0x7c4b('0x24')];}_0xc6298e[_0x7c4b('0x18')](_0xdf145)['send'](_0x56a4ed);};}exports[_0x7c4b('0x25')]=function(_0x3efad7,_0x5e1f23){var _0x145fee={},_0x24bd85={},_0x361343={'count':0x0,'rows':[]};var _0x347fe6=_[_0x7c4b('0x26')](db[_0x7c4b('0x27')][_0x7c4b('0x28')],function(_0x9d10d1){return{'name':_0x9d10d1[_0x7c4b('0x29')],'type':_0x9d10d1[_0x7c4b('0x2a')][_0x7c4b('0x2b')]};});_0x24bd85[_0x7c4b('0x2c')]=_[_0x7c4b('0x26')](_0x347fe6,_0x7c4b('0x24'));_0x24bd85[_0x7c4b('0x2d')]=_[_0x7c4b('0x2e')](_0x3efad7[_0x7c4b('0x2d')]);_0x24bd85['filters']=_[_0x7c4b('0x2f')](_0x24bd85[_0x7c4b('0x2c')],_0x24bd85[_0x7c4b('0x2d')]);_0x145fee[_0x7c4b('0x30')]=_['intersection'](_0x24bd85[_0x7c4b('0x2c')],qs[_0x7c4b('0x31')](_0x3efad7[_0x7c4b('0x2d')]['fields']));_0x145fee[_0x7c4b('0x30')]=_0x145fee['attributes'][_0x7c4b('0x32')]?_0x145fee[_0x7c4b('0x30')]:_0x24bd85['model'];if(!_0x3efad7[_0x7c4b('0x2d')][_0x7c4b('0x33')]('nolimit')){_0x145fee[_0x7c4b('0x34')]=qs[_0x7c4b('0x34')](_0x3efad7[_0x7c4b('0x2d')][_0x7c4b('0x34')]);_0x145fee[_0x7c4b('0x1b')]=qs[_0x7c4b('0x1b')](_0x3efad7[_0x7c4b('0x2d')][_0x7c4b('0x1b')]);}_0x145fee['order']=qs[_0x7c4b('0x35')](_0x3efad7['query'][_0x7c4b('0x35')]);_0x145fee[_0x7c4b('0x36')]=qs['filters'](_[_0x7c4b('0x37')](_0x3efad7[_0x7c4b('0x2d')],_0x24bd85['filters']),_0x347fe6);if(_0x3efad7[_0x7c4b('0x2d')][_0x7c4b('0x38')]){_0x145fee[_0x7c4b('0x36')]=_[_0x7c4b('0x39')](_0x145fee[_0x7c4b('0x36')],{'$or':_[_0x7c4b('0x26')](_0x347fe6,function(_0x173946){if(_0x173946[_0x7c4b('0x2a')]!==_0x7c4b('0x3a')){var _0x50fe8c={};_0x50fe8c[_0x173946[_0x7c4b('0x24')]]={'$like':'%'+_0x3efad7[_0x7c4b('0x2d')][_0x7c4b('0x38')]+'%'};return _0x50fe8c;}})});}_0x145fee=_[_0x7c4b('0x39')]({},_0x145fee,_0x3efad7['options']);var _0x4040aa={'where':_0x145fee['where']};return db[_0x7c4b('0x27')]['count'](_0x4040aa)[_0x7c4b('0x21')](function(_0x2ed8bf){_0x361343['count']=_0x2ed8bf;if(_0x3efad7[_0x7c4b('0x2d')]['includeAll']){_0x145fee[_0x7c4b('0x3b')]=[{'attributes':['id',_0x7c4b('0x24'),_0x7c4b('0x3c'),_0x7c4b('0x3d')],'model':db['User'],'as':'User'}];}return db['VoiceCallReport']['findAll'](_0x145fee);})['then'](function(_0x178c76){_0x361343['rows']=_0x178c76;return _0x361343;})['then'](respondWithFilteredResult(_0x5e1f23,_0x145fee))['catch'](handleError(_0x5e1f23,null));};exports[_0x7c4b('0x3e')]=function(_0x9edaff,_0x2ebf7d){var _0x4e435b={'raw':!![],'where':{'id':_0x9edaff['params']['id']}},_0x1e64e7={};_0x1e64e7[_0x7c4b('0x2c')]=_[_0x7c4b('0x2e')](db[_0x7c4b('0x27')][_0x7c4b('0x28')]);_0x1e64e7[_0x7c4b('0x2d')]=_['keys'](_0x9edaff[_0x7c4b('0x2d')]);_0x1e64e7[_0x7c4b('0x3f')]=_[_0x7c4b('0x2f')](_0x1e64e7[_0x7c4b('0x2c')],_0x1e64e7['query']);_0x4e435b[_0x7c4b('0x30')]=_[_0x7c4b('0x2f')](_0x1e64e7[_0x7c4b('0x2c')],qs[_0x7c4b('0x31')](_0x9edaff['query']['fields']));_0x4e435b[_0x7c4b('0x30')]=_0x4e435b[_0x7c4b('0x30')][_0x7c4b('0x32')]?_0x4e435b[_0x7c4b('0x30')]:_0x1e64e7[_0x7c4b('0x2c')];if(_0x9edaff['query'][_0x7c4b('0x40')]){_0x4e435b[_0x7c4b('0x3b')]=[{'all':!![]}];}_0x4e435b=_['merge']({},_0x4e435b,_0x9edaff[_0x7c4b('0x41')]);return db[_0x7c4b('0x27')][_0x7c4b('0x42')](_0x4e435b)['then'](handleEntityNotFound(_0x2ebf7d,null))[_0x7c4b('0x21')](respondWithResult(_0x2ebf7d,null))[_0x7c4b('0x43')](handleError(_0x2ebf7d,null));};exports[_0x7c4b('0x44')]=function(_0x4caa24,_0x5bfa6b){return db[_0x7c4b('0x27')][_0x7c4b('0x44')](_0x4caa24[_0x7c4b('0x45')],{})[_0x7c4b('0x21')](respondWithResult(_0x5bfa6b,0xc9))[_0x7c4b('0x43')](handleError(_0x5bfa6b,null));};exports[_0x7c4b('0x46')]=function(_0x5d50f1,_0x10f3bb){return db[_0x7c4b('0x27')][_0x7c4b('0x42')]({'where':{'id':_0x5d50f1[_0x7c4b('0x47')]['id']}})[_0x7c4b('0x21')](handleEntityNotFound(_0x10f3bb,null))[_0x7c4b('0x21')](removeEntity(_0x10f3bb,null))[_0x7c4b('0x43')](handleError(_0x10f3bb,null));};exports['describe']=function(_0x20c16d,_0x2115fc){return db['VoiceCallReport'][_0x7c4b('0x48')]()[_0x7c4b('0x21')](respondWithResult(_0x2115fc,null))[_0x7c4b('0x43')](handleError(_0x2115fc,null));};exports[_0x7c4b('0x20')]=function(_0x3a10e6,_0x238bef){if(_0x3a10e6[_0x7c4b('0x45')][_0x7c4b('0x49')]){delete _0x3a10e6[_0x7c4b('0x45')]['uniqueid'];}return db[_0x7c4b('0x27')][_0x7c4b('0x42')]({'where':{'uniqueid':_0x3a10e6[_0x7c4b('0x47')]['id'],'UserId':{'$or':[null,_0x3a10e6[_0x7c4b('0x4a')]['id']]}}})['then'](handleEntityNotFound(_0x238bef,null))[_0x7c4b('0x21')](saveUpdates(_0x3a10e6[_0x7c4b('0x45')],null))['then'](respondWithResult(_0x238bef,null))[_0x7c4b('0x43')](handleError(_0x238bef,null));};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js
index 70d8f02..e04ef3f 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 _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
+var _0xc759=['api','moment','bluebird','request-promise','rimraf','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','util','../../config/logger'];(function(_0x43d874,_0x589981){var _0xc1e168=function(_0x4e2aef){while(--_0x4e2aef){_0x43d874['push'](_0x43d874['shift']());}};_0xc1e168(++_0x589981);}(_0xc759,0xa6));var _0x9c75=function(_0x2e45b6,_0x1df2b1){_0x2e45b6=_0x2e45b6-0x0;var _0x33b662=_0xc759[_0x2e45b6];return _0x33b662;};'use strict';var _=require('lodash');var util=require(_0x9c75('0x0'));var logger=require(_0x9c75('0x1'))(_0x9c75('0x2'));var moment=require(_0x9c75('0x3'));var BPromise=require(_0x9c75('0x4'));var rp=require(_0x9c75('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c75('0x6'));var config=require('../../config/environment');var attributes=require(_0x9c75('0x7'));module[_0x9c75('0x8')]=function(_0x494e5f,_0x110bcd){return _0x494e5f[_0x9c75('0x9')](_0x9c75('0xa'),attributes,{'tableName':_0x9c75('0xb'),'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 8df9b11..cd4134f 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 _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
+var _0x32ce=['VoiceCallReport','options','where','attributes','include','map','model','info','GetVoiceCallReport','debug','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x4e24a6,_0x1a7f44){var _0x235d8e=function(_0x590bd6){while(--_0x590bd6){_0x4e24a6['push'](_0x4e24a6['shift']());}};_0x235d8e(++_0x1a7f44);}(_0x32ce,0x1eb));var _0xe32c=function(_0x42d1cc,_0x515c4a){_0x42d1cc=_0x42d1cc-0x0;var _0x1adc04=_0x32ce[_0x42d1cc];return _0x1adc04;};'use strict';var _=require(_0xe32c('0x0'));var util=require('util');var moment=require(_0xe32c('0x1'));var BPromise=require(_0xe32c('0x2'));var rs=require(_0xe32c('0x3'));var fs=require('fs');var Redis=require(_0xe32c('0x4'));var db=require(_0xe32c('0x5'))['db'];var utils=require(_0xe32c('0x6'));var logger=require(_0xe32c('0x7'))(_0xe32c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe32c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbb007,_0x2b61f4,_0x2763ae){return new BPromise(function(_0x47f8f7,_0x264835){return client[_0xe32c('0xa')](_0xbb007,_0x2763ae)[_0xe32c('0xb')](function(_0x3b2632){logger['info'](_0xe32c('0xc'),_0x2b61f4,'request\x20sent');logger['debug'](_0xe32c('0xd'),_0x2b61f4,'request\x20sent',JSON[_0xe32c('0xe')](_0x3b2632));if(_0x3b2632[_0xe32c('0xf')]){if(_0x3b2632['error'][_0xe32c('0x10')]===0x1f4){logger[_0xe32c('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x2b61f4,_0x3b2632[_0xe32c('0xf')][_0xe32c('0x11')]);return _0x264835(_0x3b2632['error'][_0xe32c('0x11')]);}logger['error'](_0xe32c('0xc'),_0x2b61f4,_0x3b2632[_0xe32c('0xf')][_0xe32c('0x11')]);return _0x47f8f7(_0x3b2632[_0xe32c('0xf')][_0xe32c('0x11')]);}else{logger['info'](_0xe32c('0xc'),_0x2b61f4,'request\x20sent');_0x47f8f7(_0x3b2632['result'][_0xe32c('0x11')]);}})[_0xe32c('0x12')](function(_0x3eb689){logger[_0xe32c('0xf')](_0xe32c('0xc'),_0x2b61f4,_0x3eb689);_0x264835(_0x3eb689);});});}exports['GetVoiceCallReport']=function(_0x2f1b0e){var _0x1bce4a=this;return new Promise(function(_0x4d5f10,_0x423dbc){return db[_0xe32c('0x13')]['findAll']({'raw':_0x2f1b0e['options']?_0x2f1b0e[_0xe32c('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2f1b0e[_0xe32c('0x14')]?_0x2f1b0e[_0xe32c('0x14')][_0xe32c('0x15')]||null:null,'attributes':_0x2f1b0e[_0xe32c('0x14')]?_0x2f1b0e[_0xe32c('0x14')][_0xe32c('0x16')]||null:null,'limit':_0x2f1b0e[_0xe32c('0x14')]?_0x2f1b0e[_0xe32c('0x14')]['limit']||null:null,'include':_0x2f1b0e['options']?_0x2f1b0e[_0xe32c('0x14')][_0xe32c('0x17')]?_[_0xe32c('0x18')](_0x2f1b0e[_0xe32c('0x14')]['include'],function(_0x352fc5){return{'model':db[_0x352fc5[_0xe32c('0x19')]],'as':_0x352fc5['as'],'attributes':_0x352fc5[_0xe32c('0x16')],'include':_0x352fc5[_0xe32c('0x17')]?_[_0xe32c('0x18')](_0x352fc5['include'],function(_0x5e01ee){return{'model':db[_0x5e01ee['model']],'as':_0x5e01ee['as'],'attributes':_0x5e01ee['attributes'],'include':_0x5e01ee[_0xe32c('0x17')]?_[_0xe32c('0x18')](_0x5e01ee[_0xe32c('0x17')],function(_0x5cf543){return{'model':db[_0x5cf543[_0xe32c('0x19')]],'as':_0x5cf543['as'],'attributes':_0x5cf543[_0xe32c('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b2b94){logger[_0xe32c('0x1a')](_0xe32c('0x1b'),_0x2f1b0e);logger[_0xe32c('0x1c')](_0xe32c('0x1b'),_0x2f1b0e,JSON[_0xe32c('0xe')](_0x5b2b94));_0x4d5f10(_0x5b2b94);})[_0xe32c('0x12')](function(_0x44bfc6){logger['error'](_0xe32c('0x1b'),_0x44bfc6[_0xe32c('0x11')],_0x2f1b0e);_0x423dbc(_0x1bce4a[_0xe32c('0xf')](0x1f4,_0x44bfc6['message']));});});};exports[_0xe32c('0x1d')]=function(_0x1cb5e7){var _0xf00c81=this;return new Promise(function(_0x1a0d2a,_0x5081a8){return db[_0xe32c('0x13')][_0xe32c('0x1e')](_0x1cb5e7['body'],{'raw':_0x1cb5e7[_0xe32c('0x14')]?_0x1cb5e7['options']['raw']===undefined?!![]:![]:!![]})[_0xe32c('0xb')](function(_0x5ebe79){logger[_0xe32c('0x1a')](_0xe32c('0x1d'),_0x1cb5e7);logger[_0xe32c('0x1c')]('CreateVoiceCallReport',_0x1cb5e7,JSON[_0xe32c('0xe')](_0x5ebe79));_0x1a0d2a(_0x5ebe79);})['catch'](function(_0x27ca25){logger[_0xe32c('0xf')]('CreateVoiceCallReport',_0x27ca25[_0xe32c('0x11')],_0x1cb5e7);_0x5081a8(_0xf00c81[_0xe32c('0xf')](0x1f4,_0x27ca25[_0xe32c('0x11')]));});});};exports[_0xe32c('0x1f')]=function(_0x561492){var _0x397300=this;return new Promise(function(_0x23b231,_0x286ef3){return db[_0xe32c('0x13')][_0xe32c('0x20')](_0x561492['body'],{'raw':_0x561492[_0xe32c('0x14')]?_0x561492[_0xe32c('0x14')][_0xe32c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x561492[_0xe32c('0x14')]?_0x561492[_0xe32c('0x14')][_0xe32c('0x15')]||null:null,'attributes':_0x561492[_0xe32c('0x14')]?_0x561492['options']['attributes']||null:null,'limit':_0x561492['options']?_0x561492[_0xe32c('0x14')]['limit']||null:null})[_0xe32c('0xb')](function(_0xf42734){logger[_0xe32c('0x1a')](_0xe32c('0x1f'),_0x561492);logger[_0xe32c('0x1c')](_0xe32c('0x1f'),_0x561492,JSON[_0xe32c('0xe')](_0xf42734));_0x23b231(_0xf42734);})[_0xe32c('0x12')](function(_0x24f493){logger[_0xe32c('0xf')](_0xe32c('0x1f'),_0x24f493[_0xe32c('0x11')],_0x561492);_0x286ef3(_0x397300[_0xe32c('0xf')](0x1f4,_0x24f493[_0xe32c('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js
index d0464d7..e6f3c1e 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 _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
+var _0xfc03=['post','create','put','delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./voiceChanSpy.controller','get','/:id','isAuthenticated'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0xfc03,0x103));var _0x3fc0=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xfc03[_0x36884e];return _0x1cc367;};'use strict';var multer=require(_0x3fc0('0x0'));var util=require(_0x3fc0('0x1'));var path=require(_0x3fc0('0x2'));var timeout=require(_0x3fc0('0x3'));var express=require(_0x3fc0('0x4'));var router=express[_0x3fc0('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x3fc0('0x6'));var config=require('../../config/environment');var controller=require(_0x3fc0('0x7'));router[_0x3fc0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3fc0('0x8')](_0x3fc0('0x9'),auth[_0x3fc0('0xa')](),controller['show']);router[_0x3fc0('0xb')]('/',auth['isAuthenticated'](),controller[_0x3fc0('0xc')]);router[_0x3fc0('0xd')](_0x3fc0('0x9'),auth[_0x3fc0('0xa')](),controller['update']);router[_0x3fc0('0xe')](_0x3fc0('0x9'),auth[_0x3fc0('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js
index 9ed2556..665fb31 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 _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
+var _0xbd54=['getDataValue','options','split','BOOLEAN','sequelize','exports','STRING','name','join'];(function(_0x2f31b1,_0x17daa8){var _0x448988=function(_0x540f6b){while(--_0x540f6b){_0x2f31b1['push'](_0x2f31b1['shift']());}};_0x448988(++_0x17daa8);}(_0xbd54,0x67));var _0x4bd5=function(_0x583b14,_0x59fe86){_0x583b14=_0x583b14-0x0;var _0x8214dc=_0xbd54[_0x583b14];return _0x8214dc;};'use strict';var Sequelize=require(_0x4bd5('0x0'));module[_0x4bd5('0x1')]={'name':{'type':Sequelize[_0x4bd5('0x2')]},'prefix':{'type':Sequelize[_0x4bd5('0x2')],'unique':_0x4bd5('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x4bd5('0x2')],'set':function(_0x436531){this['setDataValue']('options',_0x436531?_0x436531[_0x4bd5('0x4')](''):[]);},'get':function(){return this[_0x4bd5('0x5')](_0x4bd5('0x6'))?this[_0x4bd5('0x5')](_0x4bd5('0x6'))[_0x4bd5('0x7')](''):[];}},'auth':{'type':Sequelize[_0x4bd5('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x4bd5('0x2')]},'record':{'type':Sequelize[_0x4bd5('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x4bd5('0x2')]},'description':{'type':Sequelize[_0x4bd5('0x2')]}};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js
index 47c111c..2563813 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 _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
+var _0x3f6d=['mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','count','offset','apply','reject','save','update','destroy','then','get','UserProfileResource','stack','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3f6d,0x1da));var _0xd3f6=function(_0x3526a5,_0x56825d){_0x3526a5=_0x3526a5-0x0;var _0x44f869=_0x3f6d[_0x3526a5];return _0x44f869;};'use strict';var pdf=require(_0xd3f6('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd3f6('0x1'));var jsonpatch=require(_0xd3f6('0x2'));var rp=require(_0xd3f6('0x3'));var moment=require(_0xd3f6('0x4'));var BPromise=require(_0xd3f6('0x5'));var Mustache=require(_0xd3f6('0x6'));var util=require(_0xd3f6('0x7'));var path=require(_0xd3f6('0x8'));var sox=require(_0xd3f6('0x9'));var csv=require(_0xd3f6('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd3f6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd3f6('0xc'));var deskjs=require(_0xd3f6('0xd'));var toCsv=require(_0xd3f6('0xa'));var querystring=require('querystring');var Papa=require(_0xd3f6('0xe'));var Redis=require(_0xd3f6('0xf'));var authService=require(_0xd3f6('0x10'));var qs=require(_0xd3f6('0x11'));var as=require(_0xd3f6('0x12'));var hardwareService=require(_0xd3f6('0x13'));var logger=require(_0xd3f6('0x14'))(_0xd3f6('0x15'));var utils=require('../../config/utils');var config=require(_0xd3f6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eb549,_0x1fc584){_0x1fc584=_0x1fc584||0xcc;return function(_0x2e4541){if(_0x2e4541){return _0x3eb549[_0xd3f6('0x17')](_0x1fc584);}return _0x3eb549['status'](_0x1fc584)[_0xd3f6('0x18')]();};}function respondWithResult(_0x1492ca,_0x40c3b4){_0x40c3b4=_0x40c3b4||0xc8;return function(_0xea6e23){if(_0xea6e23){return _0x1492ca[_0xd3f6('0x19')](_0x40c3b4)['json'](_0xea6e23);}};}function respondWithFilteredResult(_0x383e6e,_0x2e07a1){return function(_0x45297b){if(_0x45297b){var _0x4fad75=_0x45297b[_0xd3f6('0x1a')],_0x3ff280=_0x2e07a1[_0xd3f6('0x1b')],_0x36b01=_0x2e07a1[_0xd3f6('0x1b')]+_0x2e07a1['limit'],_0x3d8399;if(_0x36b01>=_0x4fad75){_0x36b01=_0x4fad75;_0x3d8399=0xc8;}else{_0x3d8399=0xce;}_0x383e6e[_0xd3f6('0x19')](_0x3d8399);return _0x383e6e['set']('Content-Range',_0x3ff280+'-'+_0x36b01+'/'+_0x4fad75)['json'](_0x45297b);}return null;};}function patchUpdates(_0x210dbc){return function(_0x425c2b){try{jsonpatch[_0xd3f6('0x1c')](_0x425c2b,_0x210dbc,!![]);}catch(_0x46aefc){return BPromise[_0xd3f6('0x1d')](_0x46aefc);}return _0x425c2b[_0xd3f6('0x1e')]();};}function saveUpdates(_0x588218,_0x3abe54){return function(_0x5d79a0){if(_0x5d79a0){return _0x5d79a0[_0xd3f6('0x1f')](_0x588218)['then'](function(_0x2fa62e){return _0x2fa62e;});}return null;};}function removeEntity(_0x5087de,_0x197685){return function(_0x52eb64){if(_0x52eb64){return _0x52eb64[_0xd3f6('0x20')]()[_0xd3f6('0x21')](function(){var _0x1e33bd=_0x52eb64[_0xd3f6('0x22')]({'plain':!![]});var _0x3579fe='ChanSpies';return db[_0xd3f6('0x23')][_0xd3f6('0x20')]({'where':{'type':_0x3579fe,'resourceId':_0x1e33bd['id']}})[_0xd3f6('0x21')](function(){return _0x52eb64;});})[_0xd3f6('0x21')](function(){_0x5087de[_0xd3f6('0x19')](0xcc)[_0xd3f6('0x18')]();});}};}function handleEntityNotFound(_0x58b0e5,_0x51b013){return function(_0x2d2b86){if(!_0x2d2b86){_0x58b0e5['sendStatus'](0x194);}return _0x2d2b86;};}function handleError(_0x352d88,_0x1570a8){_0x1570a8=_0x1570a8||0x1f4;return function(_0x29b78b){logger['error'](_0x29b78b[_0xd3f6('0x24')]);if(_0x29b78b[_0xd3f6('0x25')]){delete _0x29b78b['name'];}_0x352d88['status'](_0x1570a8)[_0xd3f6('0x26')](_0x29b78b);};}exports[_0xd3f6('0x27')]=function(_0x40cdc8,_0x5a4458){var _0x43bff1={},_0x385ea9={},_0x4989c1={'count':0x0,'rows':[]};var _0x34de82=_[_0xd3f6('0x28')](db[_0xd3f6('0x29')]['rawAttributes'],function(_0x48cb0d){return{'name':_0x48cb0d[_0xd3f6('0x2a')],'type':_0x48cb0d[_0xd3f6('0x2b')][_0xd3f6('0x2c')]};});_0x385ea9[_0xd3f6('0x2d')]=_[_0xd3f6('0x28')](_0x34de82,_0xd3f6('0x25'));_0x385ea9[_0xd3f6('0x2e')]=_[_0xd3f6('0x2f')](_0x40cdc8[_0xd3f6('0x2e')]);_0x385ea9[_0xd3f6('0x30')]=_[_0xd3f6('0x31')](_0x385ea9['model'],_0x385ea9[_0xd3f6('0x2e')]);_0x43bff1[_0xd3f6('0x32')]=_[_0xd3f6('0x31')](_0x385ea9[_0xd3f6('0x2d')],qs[_0xd3f6('0x33')](_0x40cdc8[_0xd3f6('0x2e')][_0xd3f6('0x33')]));_0x43bff1[_0xd3f6('0x32')]=_0x43bff1[_0xd3f6('0x32')][_0xd3f6('0x34')]?_0x43bff1['attributes']:_0x385ea9['model'];if(!_0x40cdc8[_0xd3f6('0x2e')]['hasOwnProperty']('nolimit')){_0x43bff1[_0xd3f6('0x35')]=qs['limit'](_0x40cdc8[_0xd3f6('0x2e')][_0xd3f6('0x35')]);_0x43bff1[_0xd3f6('0x1b')]=qs['offset'](_0x40cdc8[_0xd3f6('0x2e')]['offset']);}_0x43bff1[_0xd3f6('0x36')]=qs[_0xd3f6('0x37')](_0x40cdc8['query'][_0xd3f6('0x37')]);_0x43bff1[_0xd3f6('0x38')]=qs[_0xd3f6('0x30')](_[_0xd3f6('0x39')](_0x40cdc8['query'],_0x385ea9[_0xd3f6('0x30')]),_0x34de82);if(_0x40cdc8[_0xd3f6('0x2e')][_0xd3f6('0x3a')]){_0x43bff1[_0xd3f6('0x38')]=_[_0xd3f6('0x3b')](_0x43bff1['where'],{'$or':_[_0xd3f6('0x28')](_0x34de82,function(_0x2e9893){if(_0x2e9893[_0xd3f6('0x2b')]!==_0xd3f6('0x3c')){var _0xc8e997={};_0xc8e997[_0x2e9893['name']]={'$like':'%'+_0x40cdc8[_0xd3f6('0x2e')][_0xd3f6('0x3a')]+'%'};return _0xc8e997;}})});}_0x43bff1=_[_0xd3f6('0x3b')]({},_0x43bff1,_0x40cdc8[_0xd3f6('0x3d')]);var _0xe61af8={'where':_0x43bff1['where']};return db['VoiceChanSpy'][_0xd3f6('0x1a')](_0xe61af8)[_0xd3f6('0x21')](function(_0x4de058){_0x4989c1['count']=_0x4de058;if(_0x40cdc8[_0xd3f6('0x2e')]['includeAll']){_0x43bff1[_0xd3f6('0x3e')]=[{'all':!![]}];}return db[_0xd3f6('0x29')]['findAll'](_0x43bff1);})[_0xd3f6('0x21')](function(_0x2d3020){_0x4989c1[_0xd3f6('0x3f')]=_0x2d3020;return _0x4989c1;})[_0xd3f6('0x21')](respondWithFilteredResult(_0x5a4458,_0x43bff1))[_0xd3f6('0x40')](handleError(_0x5a4458,null));};exports['show']=function(_0x3df6f2,_0x1c28ce){var _0x407a3e={'raw':![],'where':{'id':_0x3df6f2['params']['id']}},_0x1a1b2b={};_0x1a1b2b['model']=_[_0xd3f6('0x2f')](db['VoiceChanSpy'][_0xd3f6('0x41')]);_0x1a1b2b[_0xd3f6('0x2e')]=_[_0xd3f6('0x2f')](_0x3df6f2[_0xd3f6('0x2e')]);_0x1a1b2b['filters']=_[_0xd3f6('0x31')](_0x1a1b2b['model'],_0x1a1b2b[_0xd3f6('0x2e')]);_0x407a3e[_0xd3f6('0x32')]=_[_0xd3f6('0x31')](_0x1a1b2b[_0xd3f6('0x2d')],qs['fields'](_0x3df6f2[_0xd3f6('0x2e')][_0xd3f6('0x33')]));_0x407a3e[_0xd3f6('0x32')]=_0x407a3e[_0xd3f6('0x32')]['length']?_0x407a3e[_0xd3f6('0x32')]:_0x1a1b2b[_0xd3f6('0x2d')];if(_0x3df6f2[_0xd3f6('0x2e')][_0xd3f6('0x42')]){_0x407a3e['include']=[{'all':!![]}];}_0x407a3e=_['merge']({},_0x407a3e,_0x3df6f2[_0xd3f6('0x3d')]);return db[_0xd3f6('0x29')][_0xd3f6('0x43')](_0x407a3e)[_0xd3f6('0x21')](handleEntityNotFound(_0x1c28ce,null))[_0xd3f6('0x21')](respondWithResult(_0x1c28ce,null))['catch'](handleError(_0x1c28ce,null));};exports[_0xd3f6('0x44')]=function(_0x2f7a42,_0x1ffa3e){return db[_0xd3f6('0x29')][_0xd3f6('0x44')](_0x2f7a42[_0xd3f6('0x45')],{})['then'](function(_0x3a0e88){var _0x53c1b7=_0x2f7a42[_0xd3f6('0x46')][_0xd3f6('0x22')]({'plain':!![]});if(!_0x53c1b7)throw new Error(_0xd3f6('0x47'));if(_0x53c1b7[_0xd3f6('0x48')]===_0xd3f6('0x46')){var _0x180738=_0x3a0e88[_0xd3f6('0x22')]({'plain':!![]});var _0xa794d6=_0xd3f6('0x49');return db[_0xd3f6('0x4a')]['find']({'where':{'name':_0xa794d6,'userProfileId':_0x53c1b7[_0xd3f6('0x4b')]},'raw':!![]})[_0xd3f6('0x21')](function(_0x1c0ed0){if(_0x1c0ed0&&_0x1c0ed0[_0xd3f6('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x180738[_0xd3f6('0x25')],'resourceId':_0x180738['id'],'type':_0x1c0ed0[_0xd3f6('0x25')],'sectionId':_0x1c0ed0['id']},{})['then'](function(){return _0x3a0e88;});}else{return _0x3a0e88;}})[_0xd3f6('0x40')](function(_0x149b4b){logger[_0xd3f6('0x4d')](_0xd3f6('0x4e'),_0x149b4b);throw _0x149b4b;});}return _0x3a0e88;})[_0xd3f6('0x21')](respondWithResult(_0x1ffa3e,0xc9))['catch'](handleError(_0x1ffa3e,null));};exports[_0xd3f6('0x1f')]=function(_0x38f71f,_0x5aceb2){if(_0x38f71f['body']['id']){delete _0x38f71f[_0xd3f6('0x45')]['id'];}return db[_0xd3f6('0x29')][_0xd3f6('0x43')]({'where':{'id':_0x38f71f[_0xd3f6('0x4f')]['id']}})[_0xd3f6('0x21')](handleEntityNotFound(_0x5aceb2,null))[_0xd3f6('0x21')](saveUpdates(_0x38f71f[_0xd3f6('0x45')],null))['then'](respondWithResult(_0x5aceb2,null))[_0xd3f6('0x40')](handleError(_0x5aceb2,null));};exports[_0xd3f6('0x20')]=function(_0x486a3b,_0x17163e){return db[_0xd3f6('0x29')][_0xd3f6('0x43')]({'where':{'id':_0x486a3b['params']['id']}})[_0xd3f6('0x21')](handleEntityNotFound(_0x17163e,null))[_0xd3f6('0x21')](removeEntity(_0x17163e,null))[_0xd3f6('0x40')](handleError(_0x17163e,null));};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js
index 6b7a3c1..53e6ed3 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 _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
+var _0x847d=['options','record','StopMixMonitor','length','internal','concat','agent','then','catch','exports','models','voice_chanspy','VoiceExtension','bulkCreate','destroy','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','system','push','merge','Set','CDR(type)=%s','chanspy','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','name'];(function(_0x142b47,_0x2355cd){var _0x2904b1=function(_0xb4dcf7){while(--_0xb4dcf7){_0x142b47['push'](_0x142b47['shift']());}};_0x2904b1(++_0x2355cd);}(_0x847d,0x14a));var _0xd847=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0x847d[_0x16dbfd];return _0x382254;};'use strict';var _=require('lodash');var util=require(_0xd847('0x0'));var BPromise=require(_0xd847('0x1'));var attributes=require(_0xd847('0x2'));var getUserApplications=function(_0x4f2500,_0x202b1c,_0x4a85d8){var _0x116caa=0x1;var _0x18051f=[];var _0x5258c0={'context':_0x202b1c[_0xd847('0x3')]||_0xd847('0x4'),'exten':util[_0xd847('0x5')](_0xd847('0x6'),_0x4f2500['prefix'],_0x4a85d8),'type':_0xd847('0x7'),'isApp':![],'ChanSpyId':_0x4f2500['id'],'UserId':_0x202b1c['id']};_0x18051f[_0xd847('0x8')](_[_0xd847('0x9')]({'app':_0xd847('0xa'),'appdata':util[_0xd847('0x5')](_0xd847('0xb'),_0xd847('0xc')),'priority':_0x116caa++},_0x5258c0));if(_0x4f2500['record']){_0x18051f['push'](_['merge']({'app':'MixMonitor','appdata':util[_0xd847('0x5')](_0xd847('0xd'),_0x4f2500[_0xd847('0xe')]),'priority':_0x116caa++},_0x5258c0));}if(_0x4f2500['auth']){_0x18051f['push'](_[_0xd847('0x9')]({'app':_0xd847('0xf'),'appdata':_0x4f2500[_0xd847('0x10')],'priority':_0x116caa++},_0x5258c0));}_0x18051f[_0xd847('0x8')](_[_0xd847('0x9')]({'app':_0xd847('0x11'),'appdata':util[_0xd847('0x5')](_0xd847('0x12'),_0x202b1c[_0xd847('0x13')],_0x4f2500[_0xd847('0x14')]?_0x4f2500[_0xd847('0x14')]['join'](''):''),'priority':_0x116caa++},_0x5258c0));if(_0x4f2500[_0xd847('0x15')]){_0x18051f[_0xd847('0x8')](_[_0xd847('0x9')]({'app':_0xd847('0x16'),'priority':_0x116caa++},_0x5258c0));}return _0x18051f;};var getChanSpyApplications=function(_0x16c79a,_0x586c6e){var _0x39e11b=[];for(var _0x3e1e1c=0x0,_0xfa297d=0x1;_0x3e1e1c<_0x586c6e[_0xd847('0x17')];_0x3e1e1c++,_0xfa297d=0x1){_0x39e11b=_0x39e11b['concat'](getUserApplications(_0x16c79a,_0x586c6e[_0x3e1e1c],_0x586c6e[_0x3e1e1c][_0xd847('0x18')]));if(_0x586c6e[_0x3e1e1c]['internal']!=_0x586c6e[_0x3e1e1c][_0xd847('0x13')]){_0x39e11b=_0x39e11b[_0xd847('0x19')](getUserApplications(_0x16c79a,_0x586c6e[_0x3e1e1c],_0x586c6e[_0x3e1e1c][_0xd847('0x13')]));}}return _0x39e11b;};var getChanSpyPromise=function(_0xf6e434,_0x3905b8){return new BPromise(function(_0x5a58f3,_0x6e91ab){return _0xf6e434['User']['findAll']({'attributes':['id',_0xd847('0x13'),_0xd847('0x18')],'where':{'role':_0xd847('0x1a'),'chanspy':!![]},'raw':!![]})[_0xd847('0x1b')](function(_0x43edca){if(_0x43edca){return _0x5a58f3(getChanSpyApplications(_0x3905b8,_0x43edca));}return _0x5a58f3([]);})[_0xd847('0x1c')](function(_0x1490a1){_0x6e91ab(_0x1490a1);});});};module[_0xd847('0x1d')]=function(_0x1eaf08,_0x27c9f2){var _0x351ffb=_0x1eaf08[_0xd847('0x1e')];return _0x1eaf08['define']('VoiceChanSpy',attributes,{'tableName':_0xd847('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1312ce,_0x388f58,_0x5075a2){return getChanSpyPromise(_0x351ffb,_0x1312ce)[_0xd847('0x1b')](function(_0x246920){if(_0x246920&&_0x246920[_0xd847('0x17')]){return _0x351ffb[_0xd847('0x20')][_0xd847('0x21')](_0x246920);}})[_0xd847('0x1b')](function(){_0x5075a2();})[_0xd847('0x1c')](function(_0x460eba){_0x5075a2(_0x460eba);});},'afterUpdate':function(_0x1b80a2,_0x59296b,_0x46b213){return _0x351ffb[_0xd847('0x20')][_0xd847('0x22')]({'where':{'ChanSpyId':_0x1b80a2['id']}})[_0xd847('0x1b')](function(){return getChanSpyPromise(_0x351ffb,_0x1b80a2);})[_0xd847('0x1b')](function(_0x3301cd){if(_0x3301cd&&_0x3301cd['length']){return _0x351ffb[_0xd847('0x20')]['bulkCreate'](_0x3301cd);}})['then'](function(){_0x46b213();})['catch'](function(_0x184513){_0x46b213(_0x184513);});},'afterDestroy':function(_0x3654e8,_0x2678dc,_0x18d162){return _0x351ffb[_0xd847('0x20')][_0xd847('0x22')]({'where':{'ChanSpyId':_0x3654e8['id']}})[_0xd847('0x1b')](function(){_0x18d162();})[_0xd847('0x1c')](function(_0x3d7082){_0x18d162(_0x3d7082);});}}});};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js
index ffb9e25..399590f 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 _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
+var _0x0291=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x198b73,_0x3edf54){var _0x48f220=function(_0x5ebee7){while(--_0x5ebee7){_0x198b73['push'](_0x198b73['shift']());}};_0x48f220(++_0x3edf54);}(_0x0291,0xde));var _0x1029=function(_0x300884,_0x4b19d1){_0x300884=_0x300884-0x0;var _0xbdd533=_0x0291[_0x300884];return _0xbdd533;};'use strict';var _=require(_0x1029('0x0'));var util=require(_0x1029('0x1'));var moment=require(_0x1029('0x2'));var BPromise=require(_0x1029('0x3'));var rs=require(_0x1029('0x4'));var fs=require('fs');var Redis=require(_0x1029('0x5'));var db=require(_0x1029('0x6'))['db'];var utils=require(_0x1029('0x7'));var logger=require('../../config/logger')(_0x1029('0x8'));var config=require(_0x1029('0x9'));var jayson=require(_0x1029('0xa'));var client=jayson[_0x1029('0xb')][_0x1029('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x562cc4,_0x11d300,_0x32aa56){return new BPromise(function(_0x58f2ba,_0x3b63cc){return client['request'](_0x562cc4,_0x32aa56)[_0x1029('0xd')](function(_0x596f24){logger[_0x1029('0xe')](_0x1029('0xf'),_0x11d300,_0x1029('0x10'));logger[_0x1029('0x11')](_0x1029('0x12'),_0x11d300,_0x1029('0x10'),JSON[_0x1029('0x13')](_0x596f24));if(_0x596f24[_0x1029('0x14')]){if(_0x596f24['error'][_0x1029('0x15')]===0x1f4){logger['error'](_0x1029('0xf'),_0x11d300,_0x596f24[_0x1029('0x14')][_0x1029('0x16')]);return _0x3b63cc(_0x596f24['error'][_0x1029('0x16')]);}logger['error'](_0x1029('0xf'),_0x11d300,_0x596f24[_0x1029('0x14')][_0x1029('0x16')]);return _0x58f2ba(_0x596f24[_0x1029('0x14')][_0x1029('0x16')]);}else{logger[_0x1029('0xe')](_0x1029('0xf'),_0x11d300,'request\x20sent');_0x58f2ba(_0x596f24[_0x1029('0x17')]['message']);}})[_0x1029('0x18')](function(_0x5be6e0){logger[_0x1029('0x14')](_0x1029('0xf'),_0x11d300,_0x5be6e0);_0x3b63cc(_0x5be6e0);});});}
\ No newline at end of file
diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js
index 35bf220..f8126ab 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 _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
+var _0x4fa7=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','post','create','/:id','delete','destroy','exports'];(function(_0x3033ca,_0x2f1643){var _0x1ef9a1=function(_0x338c2a){while(--_0x338c2a){_0x3033ca['push'](_0x3033ca['shift']());}};_0x1ef9a1(++_0x2f1643);}(_0x4fa7,0xd2));var _0x74fa=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0x4fa7[_0x48e1ec];return _0x3b33eb;};'use strict';var multer=require('multer');var util=require(_0x74fa('0x0'));var path=require(_0x74fa('0x1'));var timeout=require(_0x74fa('0x2'));var express=require(_0x74fa('0x3'));var router=express[_0x74fa('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x74fa('0x5'));var config=require(_0x74fa('0x6'));var controller=require(_0x74fa('0x7'));router['get']('/',auth[_0x74fa('0x8')](),controller['index']);router['get']('/:id',auth[_0x74fa('0x8')](),controller['show']);router[_0x74fa('0x9')]('/',auth[_0x74fa('0x8')](),controller[_0x74fa('0xa')]);router['put'](_0x74fa('0xb'),auth[_0x74fa('0x8')](),controller['update']);router[_0x74fa('0xc')](_0x74fa('0xb'),auth[_0x74fa('0x8')](),controller[_0x74fa('0xd')]);module[_0x74fa('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js
index ab8bd72..699d093 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 _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
+var _0x34e8=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x4870c0,_0xbdef87){var _0x14e716=function(_0x3e43d0){while(--_0x3e43d0){_0x4870c0['push'](_0x4870c0['shift']());}};_0x14e716(++_0xbdef87);}(_0x34e8,0x12c));var _0x834e=function(_0x12babd,_0x14b607){_0x12babd=_0x12babd-0x0;var _0x29102b=_0x34e8[_0x12babd];return _0x29102b;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'unique':_0x834e('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x834e('0x4')],'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 b5fe6c0..16eecb8 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 _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
+var _0x3e74=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','get','Contexts','UserProfileResource','destroy','stack','name','send','map','VoiceContext','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','includeAll','findAll','show','params','include','find','create','join','root','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','readFileSync','server/files/templates/context.ejs','chan_sip.so','render','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','request','then'];(function(_0x2ac6e5,_0x2749ea){var _0xdf0f6=function(_0x58a645){while(--_0x58a645){_0x2ac6e5['push'](_0x2ac6e5['shift']());}};_0xdf0f6(++_0x2749ea);}(_0x3e74,0x175));var _0x43e7=function(_0x589a07,_0x2d3519){_0x589a07=_0x589a07-0x0;var _0x71c639=_0x3e74[_0x589a07];return _0x71c639;};'use strict';var pdf=require(_0x43e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x43e7('0x1'));var zipdir=require(_0x43e7('0x2'));var jsonpatch=require(_0x43e7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43e7('0x4'));var Mustache=require('mustache');var util=require(_0x43e7('0x5'));var path=require(_0x43e7('0x6'));var sox=require(_0x43e7('0x7'));var csv=require(_0x43e7('0x8'));var ejs=require(_0x43e7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x8'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var db=require('../../mysqldb')['db'];var jayson=require(_0x43e7('0x14'));var client=jayson[_0x43e7('0x15')][_0x43e7('0x16')]({'port':0x232a});function checkPasswordPattern(_0x3bb83f,_0x4e008c,_0x583d85){if(_0x583d85){var _0x2fcb36=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2fcb36[_0x43e7('0x17')](_0x4e008c)){return _0x3bb83f;}else{throw new db[(_0x43e7('0x18'))]['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 _0x3bb83f;}}function respondWithRpcPromise(_0x16849c,_0x14c146,_0x203378,_0x328445){return new BPromise(function(_0x4de324,_0x5c4eaa){var _0xdf16c=_0x328445||client;return _0xdf16c[_0x43e7('0x19')](_0x16849c,_0x203378)[_0x43e7('0x1a')](function(_0x5d346f){logger['info'](_0x43e7('0x1b'),_0x14c146,_0x43e7('0x1c'));logger[_0x43e7('0x1d')](_0x43e7('0x1e'),_0x14c146,_0x43e7('0x1c'),JSON[_0x43e7('0x1f')](_0x5d346f));if(_0x5d346f[_0x43e7('0x20')]){if(_0x5d346f[_0x43e7('0x20')][_0x43e7('0x21')]===0x1f4){logger[_0x43e7('0x20')](_0x43e7('0x1b'),_0x14c146,_0x5d346f[_0x43e7('0x20')]['message']);return _0x5c4eaa(_0x5d346f[_0x43e7('0x20')][_0x43e7('0x22')]);}logger['error'](_0x43e7('0x1b'),_0x14c146,_0x5d346f[_0x43e7('0x20')][_0x43e7('0x22')]);return _0x4de324(_0x5d346f[_0x43e7('0x20')][_0x43e7('0x22')]);}else{logger[_0x43e7('0x23')]('VoiceContext,\x20%s,\x20%s',_0x14c146,_0x43e7('0x1c'));_0x4de324(_0x5d346f['result']['message']);}})[_0x43e7('0x24')](function(_0x43f4ff){logger['error'](_0x43e7('0x1b'),_0x14c146,_0x43f4ff);_0x5c4eaa(_0x43f4ff);});});}function respondWithStatusCode(_0x4ca5cf,_0x326dab){_0x326dab=_0x326dab||0xcc;return function(_0x5c5e67){if(_0x5c5e67){return _0x4ca5cf[_0x43e7('0x25')](_0x326dab);}return _0x4ca5cf[_0x43e7('0x26')](_0x326dab)[_0x43e7('0x27')]();};}function respondWithResult(_0x405f85,_0x51f4d7){_0x51f4d7=_0x51f4d7||0xc8;return function(_0x52b7b3){if(_0x52b7b3){return _0x405f85[_0x43e7('0x26')](_0x51f4d7)['json'](_0x52b7b3);}};}function respondWithFilteredResult(_0x2dd5f,_0x40dc8f){return function(_0x3565cf){if(_0x3565cf){var _0xb1fc63=_0x3565cf[_0x43e7('0x28')],_0x5087d7=_0x40dc8f[_0x43e7('0x29')],_0x33a1a5=_0x40dc8f[_0x43e7('0x29')]+_0x40dc8f[_0x43e7('0x2a')],_0x4690a6;if(_0x33a1a5>=_0xb1fc63){_0x33a1a5=_0xb1fc63;_0x4690a6=0xc8;}else{_0x4690a6=0xce;}_0x2dd5f[_0x43e7('0x26')](_0x4690a6);return _0x2dd5f[_0x43e7('0x2b')](_0x43e7('0x2c'),_0x5087d7+'-'+_0x33a1a5+'/'+_0xb1fc63)[_0x43e7('0x2d')](_0x3565cf);}return null;};}function patchUpdates(_0x17df44){return function(_0x19725a){try{jsonpatch[_0x43e7('0x2e')](_0x19725a,_0x17df44,!![]);}catch(_0x208706){return BPromise['reject'](_0x208706);}return _0x19725a[_0x43e7('0x2f')]();};}function saveUpdates(_0x44f6b0,_0x3b8f78){return function(_0x183c81){if(_0x183c81){return _0x183c81[_0x43e7('0x30')](_0x44f6b0)['then'](function(_0x1eba65){return _0x1eba65;});}return null;};}function removeEntity(_0x49b83d,_0x30d47e){return function(_0x3f280d){if(_0x3f280d){return _0x3f280d['destroy']()['then'](function(){var _0x5e203f=_0x3f280d[_0x43e7('0x31')]({'plain':!![]});var _0xbe6e28=_0x43e7('0x32');return db[_0x43e7('0x33')][_0x43e7('0x34')]({'where':{'type':_0xbe6e28,'resourceId':_0x5e203f['id']}})[_0x43e7('0x1a')](function(){return _0x3f280d;});})['then'](function(){_0x49b83d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59e5b2,_0x4e8e86){return function(_0x564f0e){if(!_0x564f0e){_0x59e5b2['sendStatus'](0x194);}return _0x564f0e;};}function handleError(_0x14d888,_0x49cda6){_0x49cda6=_0x49cda6||0x1f4;return function(_0x2b4bfd){logger[_0x43e7('0x20')](_0x2b4bfd[_0x43e7('0x35')]);if(_0x2b4bfd[_0x43e7('0x36')]){delete _0x2b4bfd[_0x43e7('0x36')];}_0x14d888[_0x43e7('0x26')](_0x49cda6)[_0x43e7('0x37')](_0x2b4bfd);};}exports['index']=function(_0x5332d9,_0x5d84f4){var _0xfa0474={},_0xfe70e9={},_0x199ff6={'count':0x0,'rows':[]};var _0x16cdba=_[_0x43e7('0x38')](db[_0x43e7('0x39')][_0x43e7('0x3a')],function(_0x2ffd43){return{'name':_0x2ffd43['fieldName'],'type':_0x2ffd43[_0x43e7('0x3b')][_0x43e7('0x3c')]};});_0xfe70e9['model']=_[_0x43e7('0x38')](_0x16cdba,'name');_0xfe70e9[_0x43e7('0x3d')]=_[_0x43e7('0x3e')](_0x5332d9[_0x43e7('0x3d')]);_0xfe70e9[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0xfe70e9[_0x43e7('0x41')],_0xfe70e9['query']);_0xfa0474['attributes']=_[_0x43e7('0x40')](_0xfe70e9[_0x43e7('0x41')],qs[_0x43e7('0x42')](_0x5332d9[_0x43e7('0x3d')][_0x43e7('0x42')]));_0xfa0474['attributes']=_0xfa0474[_0x43e7('0x43')][_0x43e7('0x44')]?_0xfa0474['attributes']:_0xfe70e9[_0x43e7('0x41')];if(!_0x5332d9['query'][_0x43e7('0x45')]('nolimit')){_0xfa0474[_0x43e7('0x2a')]=qs[_0x43e7('0x2a')](_0x5332d9[_0x43e7('0x3d')][_0x43e7('0x2a')]);_0xfa0474['offset']=qs['offset'](_0x5332d9[_0x43e7('0x3d')][_0x43e7('0x29')]);}_0xfa0474[_0x43e7('0x46')]=qs[_0x43e7('0x47')](_0x5332d9['query']['sort']);_0xfa0474['where']=qs[_0x43e7('0x3f')](_['pick'](_0x5332d9[_0x43e7('0x3d')],_0xfe70e9['filters']),_0x16cdba);if(_0x5332d9['query'][_0x43e7('0x48')]){_0xfa0474['where']=_[_0x43e7('0x49')](_0xfa0474[_0x43e7('0x4a')],{'$or':_[_0x43e7('0x38')](_0x16cdba,function(_0x99b9e1){if(_0x99b9e1['type']!==_0x43e7('0x4b')){var _0x2b9046={};_0x2b9046[_0x99b9e1[_0x43e7('0x36')]]={'$like':'%'+_0x5332d9[_0x43e7('0x3d')][_0x43e7('0x48')]+'%'};return _0x2b9046;}})});}_0xfa0474=_[_0x43e7('0x49')]({},_0xfa0474,_0x5332d9['options']);var _0x4930a2={'where':_0xfa0474[_0x43e7('0x4a')]};return db[_0x43e7('0x39')][_0x43e7('0x28')](_0x4930a2)['then'](function(_0x5c1c18){_0x199ff6['count']=_0x5c1c18;if(_0x5332d9[_0x43e7('0x3d')][_0x43e7('0x4c')]){_0xfa0474['include']=[{'all':!![]}];}return db[_0x43e7('0x39')][_0x43e7('0x4d')](_0xfa0474);})[_0x43e7('0x1a')](function(_0x560329){_0x199ff6['rows']=_0x560329;return _0x199ff6;})['then'](respondWithFilteredResult(_0x5d84f4,_0xfa0474))['catch'](handleError(_0x5d84f4,null));};exports[_0x43e7('0x4e')]=function(_0xe955fc,_0x52fea5){var _0x23e7cb={'raw':![],'where':{'id':_0xe955fc[_0x43e7('0x4f')]['id']}},_0x82d32f={};_0x82d32f[_0x43e7('0x41')]=_['keys'](db[_0x43e7('0x39')]['rawAttributes']);_0x82d32f['query']=_[_0x43e7('0x3e')](_0xe955fc[_0x43e7('0x3d')]);_0x82d32f[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0x82d32f[_0x43e7('0x41')],_0x82d32f[_0x43e7('0x3d')]);_0x23e7cb[_0x43e7('0x43')]=_[_0x43e7('0x40')](_0x82d32f[_0x43e7('0x41')],qs[_0x43e7('0x42')](_0xe955fc['query'][_0x43e7('0x42')]));_0x23e7cb[_0x43e7('0x43')]=_0x23e7cb['attributes'][_0x43e7('0x44')]?_0x23e7cb['attributes']:_0x82d32f[_0x43e7('0x41')];if(_0xe955fc[_0x43e7('0x3d')][_0x43e7('0x4c')]){_0x23e7cb[_0x43e7('0x50')]=[{'all':!![]}];}_0x23e7cb=_[_0x43e7('0x49')]({},_0x23e7cb,_0xe955fc['options']);return db['VoiceContext'][_0x43e7('0x51')](_0x23e7cb)[_0x43e7('0x1a')](handleEntityNotFound(_0x52fea5,null))[_0x43e7('0x1a')](respondWithResult(_0x52fea5,null))[_0x43e7('0x24')](handleError(_0x52fea5,null));};exports[_0x43e7('0x52')]=function(_0x25bb44,_0xa47464,_0x44f8a0){var _0x26d86c;return db[_0x43e7('0x39')][_0x43e7('0x52')](_0x25bb44['body'],{'raw':!![]})[_0x43e7('0x1a')](function(_0x2da2f3){_0x26d86c=_0x2da2f3;return db['VoiceContext'][_0x43e7('0x4d')]({'raw':!![]});})[_0x43e7('0x1a')](function(_0x2d0052){var _0x558d54=fs['readFileSync'](path[_0x43e7('0x53')](config[_0x43e7('0x54')],'server/files/templates/context.ejs'),_0x43e7('0x55'));var _0x54506d=ejs['render'](_0x558d54,{'contexts':_0x2d0052||[]});fs[_0x43e7('0x56')](_0x43e7('0x57'),_0x54506d);})[_0x43e7('0x1a')](function(){return respondWithRpcPromise(_0x43e7('0x58'),_0x43e7('0x52'),{'module':'chan_sip.so'});})[_0x43e7('0x1a')](function(){var _0xdb9fbe=_0x25bb44['user'][_0x43e7('0x31')]({'plain':!![]});if(!_0xdb9fbe)throw new Error(_0x43e7('0x59'));if(_0xdb9fbe[_0x43e7('0x5a')]==='user'){var _0x5a4c95=_0x26d86c['get']({'plain':!![]});return db[_0x43e7('0x5b')][_0x43e7('0x51')]({'where':{'name':_0x43e7('0x32'),'userProfileId':_0xdb9fbe[_0x43e7('0x5c')]},'raw':!![]})['then'](function(_0x5a50fc){if(_0x5a50fc&&_0x5a50fc[_0x43e7('0x5d')]===0x0){return db[_0x43e7('0x33')][_0x43e7('0x52')]({'name':_0x5a4c95[_0x43e7('0x36')],'resourceId':_0x5a4c95['id'],'type':_0x5a50fc['name'],'sectionId':_0x5a50fc['id']},{})[_0x43e7('0x1a')](function(){return _0x26d86c;});}else{return _0x26d86c;}})[_0x43e7('0x24')](function(_0x23595c){logger[_0x43e7('0x20')](_0x43e7('0x5e'),_0x23595c);throw _0x23595c;});}return _0x26d86c;})[_0x43e7('0x1a')](respondWithResult(_0xa47464,0xc9))[_0x43e7('0x24')](handleError(_0xa47464,null));};exports[_0x43e7('0x30')]=function(_0x406155,_0x381208,_0x252f00){var _0x57fdfe;return db['VoiceContext'][_0x43e7('0x51')]({'where':{'id':_0x406155['params']['id']}})['then'](handleEntityNotFound(_0x381208,null))['then'](saveUpdates(_0x406155[_0x43e7('0x5f')],null))[_0x43e7('0x1a')](function(_0x5d7b37){if(_0x5d7b37){_0x57fdfe=_0x5d7b37;return db[_0x43e7('0x39')][_0x43e7('0x4d')]({'raw':!![]});}})[_0x43e7('0x1a')](function(_0x537a53){var _0x2b7406=fs[_0x43e7('0x60')](path[_0x43e7('0x53')](config[_0x43e7('0x54')],_0x43e7('0x61')),_0x43e7('0x55'));var _0x1e02fa=ejs['render'](_0x2b7406,{'contexts':_0x537a53||[]});fs[_0x43e7('0x56')](_0x43e7('0x57'),_0x1e02fa);})[_0x43e7('0x1a')](function(){return respondWithRpcPromise('Reload','update',{'module':_0x43e7('0x62')});})['then'](function(){return _0x57fdfe;})['then'](respondWithResult(_0x381208,null))[_0x43e7('0x24')](handleError(_0x381208,null));};exports[_0x43e7('0x34')]=function(_0x5b5833,_0x88c7f,_0x28b21d){var _0x1e2fed;return db[_0x43e7('0x39')][_0x43e7('0x51')]({'where':{'id':_0x5b5833[_0x43e7('0x4f')]['id']}})[_0x43e7('0x1a')](handleEntityNotFound(_0x88c7f,null))['then'](removeEntity(_0x88c7f,null))[_0x43e7('0x1a')](function(){return db[_0x43e7('0x39')]['findAll']({'raw':!![]});})[_0x43e7('0x1a')](function(_0x5c2c5f){var _0x26ee52=fs[_0x43e7('0x60')](path[_0x43e7('0x53')](config[_0x43e7('0x54')],'server/files/templates/context.ejs'),_0x43e7('0x55'));var _0x2646c2=ejs[_0x43e7('0x63')](_0x26ee52,{'contexts':_0x5c2c5f});fs['writeFileSync'](_0x43e7('0x57'),_0x2646c2);return respondWithRpcPromise(_0x43e7('0x58'),_0x43e7('0x34'),{'module':_0x43e7('0x62')});})[_0x43e7('0x24')](handleError(_0x88c7f,null));};
\ No newline at end of file
diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js
index 9650e36..cda0d92 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(_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
+var _0x9957=['exports','define','VoiceContext','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceContext.attributes'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_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':'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 792cf32..53c22a9 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 _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
+var _0x84be=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','result','catch','lodash'];(function(_0x2806f7,_0x188414){var _0x1ba2d8=function(_0x5ee87e){while(--_0x5ee87e){_0x2806f7['push'](_0x2806f7['shift']());}};_0x1ba2d8(++_0x188414);}(_0x84be,0xc7));var _0xe84b=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x84be[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0xe84b('0x0'));var util=require(_0xe84b('0x1'));var moment=require(_0xe84b('0x2'));var BPromise=require(_0xe84b('0x3'));var rs=require(_0xe84b('0x4'));var fs=require('fs');var Redis=require(_0xe84b('0x5'));var db=require(_0xe84b('0x6'))['db'];var utils=require(_0xe84b('0x7'));var logger=require(_0xe84b('0x8'))('rpc');var config=require(_0xe84b('0x9'));var jayson=require(_0xe84b('0xa'));var client=jayson[_0xe84b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e3a2,_0x545154,_0x11409){return new BPromise(function(_0x200b7f,_0x223d97){return client[_0xe84b('0xc')](_0x56e3a2,_0x11409)[_0xe84b('0xd')](function(_0x3ac04f){logger[_0xe84b('0xe')]('VoiceContext,\x20%s,\x20%s',_0x545154,_0xe84b('0xf'));logger[_0xe84b('0x10')](_0xe84b('0x11'),_0x545154,'request\x20sent',JSON[_0xe84b('0x12')](_0x3ac04f));if(_0x3ac04f[_0xe84b('0x13')]){if(_0x3ac04f[_0xe84b('0x13')][_0xe84b('0x14')]===0x1f4){logger[_0xe84b('0x13')]('VoiceContext,\x20%s,\x20%s',_0x545154,_0x3ac04f[_0xe84b('0x13')][_0xe84b('0x15')]);return _0x223d97(_0x3ac04f[_0xe84b('0x13')][_0xe84b('0x15')]);}logger[_0xe84b('0x13')](_0xe84b('0x16'),_0x545154,_0x3ac04f[_0xe84b('0x13')]['message']);return _0x200b7f(_0x3ac04f[_0xe84b('0x13')][_0xe84b('0x15')]);}else{logger[_0xe84b('0xe')](_0xe84b('0x16'),_0x545154,_0xe84b('0xf'));_0x200b7f(_0x3ac04f[_0xe84b('0x17')][_0xe84b('0x15')]);}})[_0xe84b('0x18')](function(_0x11dc65){logger['error'](_0xe84b('0x16'),_0x545154,_0x11dc65);_0x223d97(_0x11dc65);});});}
\ No newline at end of file
diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js
index 401d19e..6119013 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 _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
+var _0x6fda=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','get','describe','/:id','post','create','put','update','delete'];(function(_0x1e91eb,_0x5829a3){var _0x2af75a=function(_0x1815d1){while(--_0x1815d1){_0x1e91eb['push'](_0x1e91eb['shift']());}};_0x2af75a(++_0x5829a3);}(_0x6fda,0x1ce));var _0xa6fd=function(_0x44e9b1,_0x24243b){_0x44e9b1=_0x44e9b1-0x0;var _0x5d6eb2=_0x6fda[_0x44e9b1];return _0x5d6eb2;};'use strict';var multer=require(_0xa6fd('0x0'));var util=require(_0xa6fd('0x1'));var path=require(_0xa6fd('0x2'));var timeout=require(_0xa6fd('0x3'));var express=require(_0xa6fd('0x4'));var router=express[_0xa6fd('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xa6fd('0x6'));var config=require(_0xa6fd('0x7'));var controller=require(_0xa6fd('0x8'));router['get']('/',auth[_0xa6fd('0x9')](),controller['index']);router[_0xa6fd('0xa')]('/describe',auth[_0xa6fd('0x9')](),controller[_0xa6fd('0xb')]);router[_0xa6fd('0xa')](_0xa6fd('0xc'),auth[_0xa6fd('0x9')](),controller['show']);router[_0xa6fd('0xd')]('/',auth['isAuthenticated'](),controller[_0xa6fd('0xe')]);router[_0xa6fd('0xf')](_0xa6fd('0xc'),auth[_0xa6fd('0x9')](),controller[_0xa6fd('0x10')]);router[_0xa6fd('0x11')](_0xa6fd('0xc'),auth[_0xa6fd('0x9')](),controller[_0xa6fd('0x12')]);module[_0xa6fd('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 d4a7ff5..7991266 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 _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
+var _0x4d31=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4d31,0x188));var _0x14d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4d31[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x14d3('0x0'));module[_0x14d3('0x1')]={'privilege':{'type':Sequelize[_0x14d3('0x2')]},'channel':{'type':Sequelize[_0x14d3('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x14d3('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x14d3('0x2')]},'connectedlinenum':{'type':Sequelize[_0x14d3('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x14d3('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x14d3('0x2')]},'exten':{'type':Sequelize[_0x14d3('0x2')]},'priority':{'type':Sequelize[_0x14d3('0x3')]},'uniqueid':{'type':Sequelize[_0x14d3('0x2')]},'linkedid':{'type':Sequelize[_0x14d3('0x2')]},'destchannel':{'type':Sequelize[_0x14d3('0x2')]},'destchannelstate':{'type':Sequelize[_0x14d3('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x14d3('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x14d3('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x14d3('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x14d3('0x2')]},'destexten':{'type':Sequelize[_0x14d3('0x2')]},'destpriority':{'type':Sequelize[_0x14d3('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x14d3('0x2')]},'dialstring':{'type':Sequelize[_0x14d3('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x14d3('0x4')]},'answertime':{'type':Sequelize[_0x14d3('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':_0x14d3('0x5')},'routeId':{'type':Sequelize[_0x14d3('0x3')]},'duration':{'type':Sequelize[_0x14d3('0x3')]},'holdtime':{'type':Sequelize[_0x14d3('0x3')]},'billableseconds':{'type':Sequelize[_0x14d3('0x3')]}};
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js
index e92203f..dc284df 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 _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
+var _0xda49=['rows','catch','show','params','options','find','update','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','lodash','querystring','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','then','destroy','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x47ea4d,_0x483a90){var _0x21136d=function(_0x54fe97){while(--_0x54fe97){_0x47ea4d['push'](_0x47ea4d['shift']());}};_0x21136d(++_0x483a90);}(_0xda49,0x1b3));var _0x9da4=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xda49[_0x28aea5];return _0x6a55f9;};'use strict';var pdf=require(_0x9da4('0x0'));var emlformat=require(_0x9da4('0x1'));var rimraf=require(_0x9da4('0x2'));var zipdir=require(_0x9da4('0x3'));var jsonpatch=require(_0x9da4('0x4'));var rp=require('request-promise');var moment=require(_0x9da4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9da4('0x6'));var util=require(_0x9da4('0x7'));var path=require(_0x9da4('0x8'));var sox=require('sox');var csv=require(_0x9da4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9da4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9da4('0x9'));var querystring=require(_0x9da4('0xb'));var Papa=require(_0x9da4('0xc'));var Redis=require(_0x9da4('0xd'));var authService=require(_0x9da4('0xe'));var qs=require(_0x9da4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9da4('0x10'));var logger=require(_0x9da4('0x11'))(_0x9da4('0x12'));var utils=require(_0x9da4('0x13'));var config=require('../../config/environment');var db=require(_0x9da4('0x14'))['db'];function respondWithStatusCode(_0x481cb2,_0xf7faae){_0xf7faae=_0xf7faae||0xcc;return function(_0xb2c76a){if(_0xb2c76a){return _0x481cb2[_0x9da4('0x15')](_0xf7faae);}return _0x481cb2[_0x9da4('0x16')](_0xf7faae)[_0x9da4('0x17')]();};}function respondWithResult(_0x1ec8ee,_0x5bbcd8){_0x5bbcd8=_0x5bbcd8||0xc8;return function(_0x253af1){if(_0x253af1){return _0x1ec8ee[_0x9da4('0x16')](_0x5bbcd8)[_0x9da4('0x18')](_0x253af1);}};}function respondWithFilteredResult(_0x37159e,_0x473927){return function(_0x2675d1){if(_0x2675d1){var _0x1685c4=_0x2675d1[_0x9da4('0x19')],_0x72909c=_0x473927[_0x9da4('0x1a')],_0x146b17=_0x473927[_0x9da4('0x1a')]+_0x473927[_0x9da4('0x1b')],_0x38a5e2;if(_0x146b17>=_0x1685c4){_0x146b17=_0x1685c4;_0x38a5e2=0xc8;}else{_0x38a5e2=0xce;}_0x37159e[_0x9da4('0x16')](_0x38a5e2);return _0x37159e[_0x9da4('0x1c')](_0x9da4('0x1d'),_0x72909c+'-'+_0x146b17+'/'+_0x1685c4)[_0x9da4('0x18')](_0x2675d1);}return null;};}function patchUpdates(_0x1d3d53){return function(_0xdfb622){try{jsonpatch[_0x9da4('0x1e')](_0xdfb622,_0x1d3d53,!![]);}catch(_0x24ef41){return BPromise['reject'](_0x24ef41);}return _0xdfb622[_0x9da4('0x1f')]();};}function saveUpdates(_0x3baaa6,_0x4a1753){return function(_0x5a4f92){if(_0x5a4f92){return _0x5a4f92['update'](_0x3baaa6)[_0x9da4('0x20')](function(_0x40f4a5){return _0x40f4a5;});}return null;};}function removeEntity(_0x577ab4,_0x2b561c){return function(_0x1658e0){if(_0x1658e0){return _0x1658e0[_0x9da4('0x21')]()[_0x9da4('0x20')](function(){_0x577ab4[_0x9da4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xee6081,_0x401ec2){return function(_0x33fed8){if(!_0x33fed8){_0xee6081[_0x9da4('0x15')](0x194);}return _0x33fed8;};}function handleError(_0x3dc54c,_0x4cf793){_0x4cf793=_0x4cf793||0x1f4;return function(_0x39c404){logger[_0x9da4('0x22')](_0x39c404[_0x9da4('0x23')]);if(_0x39c404[_0x9da4('0x24')]){delete _0x39c404[_0x9da4('0x24')];}_0x3dc54c[_0x9da4('0x16')](_0x4cf793)[_0x9da4('0x25')](_0x39c404);};}exports[_0x9da4('0x26')]=function(_0x3dea12,_0x40aaef){var _0x39f0d6={},_0x4a6b88={},_0x5ad1e7={'count':0x0,'rows':[]};var _0x15e6c0=_[_0x9da4('0x27')](db[_0x9da4('0x28')][_0x9da4('0x29')],function(_0x498fe8){return{'name':_0x498fe8['fieldName'],'type':_0x498fe8[_0x9da4('0x2a')]['key']};});_0x4a6b88[_0x9da4('0x2b')]=_[_0x9da4('0x27')](_0x15e6c0,_0x9da4('0x24'));_0x4a6b88['query']=_[_0x9da4('0x2c')](_0x3dea12[_0x9da4('0x2d')]);_0x4a6b88[_0x9da4('0x2e')]=_[_0x9da4('0x2f')](_0x4a6b88[_0x9da4('0x2b')],_0x4a6b88[_0x9da4('0x2d')]);_0x39f0d6[_0x9da4('0x30')]=_[_0x9da4('0x2f')](_0x4a6b88[_0x9da4('0x2b')],qs[_0x9da4('0x31')](_0x3dea12[_0x9da4('0x2d')][_0x9da4('0x31')]));_0x39f0d6[_0x9da4('0x30')]=_0x39f0d6[_0x9da4('0x30')][_0x9da4('0x32')]?_0x39f0d6[_0x9da4('0x30')]:_0x4a6b88[_0x9da4('0x2b')];if(!_0x3dea12[_0x9da4('0x2d')][_0x9da4('0x33')]('nolimit')){_0x39f0d6[_0x9da4('0x1b')]=qs[_0x9da4('0x1b')](_0x3dea12[_0x9da4('0x2d')][_0x9da4('0x1b')]);_0x39f0d6[_0x9da4('0x1a')]=qs[_0x9da4('0x1a')](_0x3dea12['query'][_0x9da4('0x1a')]);}_0x39f0d6[_0x9da4('0x34')]=qs[_0x9da4('0x35')](_0x3dea12[_0x9da4('0x2d')]['sort']);_0x39f0d6[_0x9da4('0x36')]=qs[_0x9da4('0x2e')](_[_0x9da4('0x37')](_0x3dea12[_0x9da4('0x2d')],_0x4a6b88['filters']),_0x15e6c0);if(_0x3dea12[_0x9da4('0x2d')][_0x9da4('0x38')]){_0x39f0d6['where']=_[_0x9da4('0x39')](_0x39f0d6['where'],{'$or':_[_0x9da4('0x27')](_0x15e6c0,function(_0x3bc912){if(_0x3bc912['type']!==_0x9da4('0x3a')){var _0x5dc920={};_0x5dc920[_0x3bc912[_0x9da4('0x24')]]={'$like':'%'+_0x3dea12[_0x9da4('0x2d')][_0x9da4('0x38')]+'%'};return _0x5dc920;}})});}_0x39f0d6=_[_0x9da4('0x39')]({},_0x39f0d6,_0x3dea12['options']);var _0x202580={'where':_0x39f0d6[_0x9da4('0x36')]};return db['VoiceDialReport'][_0x9da4('0x19')](_0x202580)[_0x9da4('0x20')](function(_0x589906){_0x5ad1e7[_0x9da4('0x19')]=_0x589906;if(_0x3dea12[_0x9da4('0x2d')][_0x9da4('0x3b')]){_0x39f0d6[_0x9da4('0x3c')]=[{'all':!![]}];}return db[_0x9da4('0x28')][_0x9da4('0x3d')](_0x39f0d6);})[_0x9da4('0x20')](function(_0xb8016c){_0x5ad1e7[_0x9da4('0x3e')]=_0xb8016c;return _0x5ad1e7;})['then'](respondWithFilteredResult(_0x40aaef,_0x39f0d6))[_0x9da4('0x3f')](handleError(_0x40aaef,null));};exports[_0x9da4('0x40')]=function(_0x206726,_0x80df4b){var _0x595fc4={'raw':!![],'where':{'id':_0x206726[_0x9da4('0x41')]['id']}},_0x12f775={};_0x12f775[_0x9da4('0x2b')]=_[_0x9da4('0x2c')](db['VoiceDialReport'][_0x9da4('0x29')]);_0x12f775['query']=_[_0x9da4('0x2c')](_0x206726[_0x9da4('0x2d')]);_0x12f775[_0x9da4('0x2e')]=_[_0x9da4('0x2f')](_0x12f775[_0x9da4('0x2b')],_0x12f775[_0x9da4('0x2d')]);_0x595fc4[_0x9da4('0x30')]=_[_0x9da4('0x2f')](_0x12f775[_0x9da4('0x2b')],qs[_0x9da4('0x31')](_0x206726['query'][_0x9da4('0x31')]));_0x595fc4[_0x9da4('0x30')]=_0x595fc4['attributes'][_0x9da4('0x32')]?_0x595fc4[_0x9da4('0x30')]:_0x12f775[_0x9da4('0x2b')];if(_0x206726[_0x9da4('0x2d')][_0x9da4('0x3b')]){_0x595fc4[_0x9da4('0x3c')]=[{'all':!![]}];}_0x595fc4=_[_0x9da4('0x39')]({},_0x595fc4,_0x206726[_0x9da4('0x42')]);return db['VoiceDialReport'][_0x9da4('0x43')](_0x595fc4)[_0x9da4('0x20')](handleEntityNotFound(_0x80df4b,null))['then'](respondWithResult(_0x80df4b,null))[_0x9da4('0x3f')](handleError(_0x80df4b,null));};exports['create']=function(_0x516020,_0x198842){return db[_0x9da4('0x28')]['create'](_0x516020['body'],{})[_0x9da4('0x20')](respondWithResult(_0x198842,0xc9))[_0x9da4('0x3f')](handleError(_0x198842,null));};exports[_0x9da4('0x44')]=function(_0x2b2b14,_0xd36cc){if(_0x2b2b14[_0x9da4('0x45')]['id']){delete _0x2b2b14['body']['id'];}return db['VoiceDialReport'][_0x9da4('0x43')]({'where':{'id':_0x2b2b14[_0x9da4('0x41')]['id']}})[_0x9da4('0x20')](handleEntityNotFound(_0xd36cc,null))['then'](saveUpdates(_0x2b2b14[_0x9da4('0x45')],null))[_0x9da4('0x20')](respondWithResult(_0xd36cc,null))['catch'](handleError(_0xd36cc,null));};exports[_0x9da4('0x21')]=function(_0x9de6ff,_0xb134ea){return db[_0x9da4('0x28')][_0x9da4('0x43')]({'where':{'id':_0x9de6ff[_0x9da4('0x41')]['id']}})['then'](handleEntityNotFound(_0xb134ea,null))[_0x9da4('0x20')](removeEntity(_0xb134ea,null))['catch'](handleError(_0xb134ea,null));};exports[_0x9da4('0x46')]=function(_0x462adc,_0x48e5b2){return db[_0x9da4('0x28')]['describe']()[_0x9da4('0x20')](respondWithResult(_0x48e5b2,null))[_0x9da4('0x3f')](handleError(_0x48e5b2,null));};
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js
index 0bd1657..2f80217 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 _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
+var _0x1971=['rimraf','exports','VoiceDialReport','report_dial','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x1971,0x102));var _0x1197=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x1971[_0x174ef5];return _0x1cc379;};'use strict';var _=require(_0x1197('0x0'));var util=require('util');var logger=require(_0x1197('0x1'))('api');var moment=require(_0x1197('0x2'));var BPromise=require(_0x1197('0x3'));var rp=require(_0x1197('0x4'));var fs=require('fs');var path=require(_0x1197('0x5'));var rimraf=require(_0x1197('0x6'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0x1197('0x7')]=function(_0x259b76,_0x44c6cd){return _0x259b76['define'](_0x1197('0x8'),attributes,{'tableName':_0x1197('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1197('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js
index f61b6b8..dac63e3 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 _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
+var _0xf00e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','request\x20sent','stringify','VoiceDialReport,\x20%s,\x20%s','message','error','result','catch','body','options','raw','then','CreateVoiceDialReport','UpdateVoiceDialReport','VoiceDialReport','update','where','limit','lodash','util','moment'];(function(_0x40f639,_0x2f9df4){var _0x549354=function(_0x5478fa){while(--_0x5478fa){_0x40f639['push'](_0x40f639['shift']());}};_0x549354(++_0x2f9df4);}(_0xf00e,0x12f));var _0xef00=function(_0x224e96,_0x4dcd36){_0x224e96=_0x224e96-0x0;var _0x210e15=_0xf00e[_0x224e96];return _0x210e15;};'use strict';var _=require(_0xef00('0x0'));var util=require(_0xef00('0x1'));var moment=require(_0xef00('0x2'));var BPromise=require(_0xef00('0x3'));var rs=require(_0xef00('0x4'));var fs=require('fs');var Redis=require(_0xef00('0x5'));var db=require(_0xef00('0x6'))['db'];var utils=require(_0xef00('0x7'));var logger=require(_0xef00('0x8'))(_0xef00('0x9'));var config=require(_0xef00('0xa'));var jayson=require(_0xef00('0xb'));var client=jayson[_0xef00('0xc')][_0xef00('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x254f2e,_0x17ec9e,_0x2245a3){return new BPromise(function(_0xdfd1bd,_0x543859){return client[_0xef00('0xe')](_0x254f2e,_0x2245a3)['then'](function(_0x50e9c9){logger[_0xef00('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x17ec9e,'request\x20sent');logger[_0xef00('0x10')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x17ec9e,_0xef00('0x11'),JSON[_0xef00('0x12')](_0x50e9c9));if(_0x50e9c9['error']){if(_0x50e9c9['error']['code']===0x1f4){logger['error'](_0xef00('0x13'),_0x17ec9e,_0x50e9c9['error'][_0xef00('0x14')]);return _0x543859(_0x50e9c9['error'][_0xef00('0x14')]);}logger[_0xef00('0x15')](_0xef00('0x13'),_0x17ec9e,_0x50e9c9[_0xef00('0x15')][_0xef00('0x14')]);return _0xdfd1bd(_0x50e9c9['error'][_0xef00('0x14')]);}else{logger[_0xef00('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x17ec9e,_0xef00('0x11'));_0xdfd1bd(_0x50e9c9[_0xef00('0x16')][_0xef00('0x14')]);}})[_0xef00('0x17')](function(_0x581008){logger[_0xef00('0x15')](_0xef00('0x13'),_0x17ec9e,_0x581008);_0x543859(_0x581008);});});}exports['CreateVoiceDialReport']=function(_0x45a9d4){var _0x387453=this;return new Promise(function(_0x242658,_0x5e266d){return db['VoiceDialReport']['create'](_0x45a9d4[_0xef00('0x18')],{'raw':_0x45a9d4[_0xef00('0x19')]?_0x45a9d4['options'][_0xef00('0x1a')]===undefined?!![]:![]:!![]})[_0xef00('0x1b')](function(_0x4e4157){logger['info'](_0xef00('0x1c'),_0x45a9d4);logger[_0xef00('0x10')]('CreateVoiceDialReport',_0x45a9d4,JSON[_0xef00('0x12')](_0x4e4157));_0x242658(_0x4e4157);})[_0xef00('0x17')](function(_0x54cd84){logger[_0xef00('0x15')]('CreateVoiceDialReport',_0x54cd84['message'],_0x45a9d4);_0x5e266d(_0x387453[_0xef00('0x15')](0x1f4,_0x54cd84['message']));});});};exports[_0xef00('0x1d')]=function(_0x1f6b50){var _0x2118b8=this;return new Promise(function(_0x332195,_0x57f4eb){return db[_0xef00('0x1e')][_0xef00('0x1f')](_0x1f6b50[_0xef00('0x18')],{'raw':_0x1f6b50['options']?_0x1f6b50[_0xef00('0x19')][_0xef00('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f6b50[_0xef00('0x19')]?_0x1f6b50[_0xef00('0x19')][_0xef00('0x20')]||null:null,'attributes':_0x1f6b50[_0xef00('0x19')]?_0x1f6b50[_0xef00('0x19')]['attributes']||null:null,'limit':_0x1f6b50['options']?_0x1f6b50[_0xef00('0x19')][_0xef00('0x21')]||null:null})[_0xef00('0x1b')](function(_0x5c6eb1){logger[_0xef00('0xf')](_0xef00('0x1d'),_0x1f6b50);logger[_0xef00('0x10')](_0xef00('0x1d'),_0x1f6b50,JSON[_0xef00('0x12')](_0x5c6eb1));_0x332195(_0x5c6eb1);})['catch'](function(_0x26f3c0){logger[_0xef00('0x15')]('UpdateVoiceDialReport',_0x26f3c0[_0xef00('0x14')],_0x1f6b50);_0x57f4eb(_0x2118b8[_0xef00('0x15')](0x1f4,_0x26f3c0[_0xef00('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js
index bdc2bb9..f36319f 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 _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
+var _0x0a1f=['util','path','express','Router','../../components/auth/service','./voiceExtension.controller','get','isAuthenticated','index','/:id','post','create','/:id/applications','put','update','delete','exports'];(function(_0x4dd2e4,_0x5a1252){var _0x166758=function(_0x26e508){while(--_0x26e508){_0x4dd2e4['push'](_0x4dd2e4['shift']());}};_0x166758(++_0x5a1252);}(_0x0a1f,0x88));var _0xf0a1=function(_0x1a2ea6,_0x135188){_0x1a2ea6=_0x1a2ea6-0x0;var _0x5e08ac=_0x0a1f[_0x1a2ea6];return _0x5e08ac;};'use strict';var multer=require('multer');var util=require(_0xf0a1('0x0'));var path=require(_0xf0a1('0x1'));var timeout=require('connect-timeout');var express=require(_0xf0a1('0x2'));var router=express[_0xf0a1('0x3')]();var auth=require(_0xf0a1('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf0a1('0x5'));router[_0xf0a1('0x6')]('/',auth[_0xf0a1('0x7')](),controller[_0xf0a1('0x8')]);router[_0xf0a1('0x6')](_0xf0a1('0x9'),auth[_0xf0a1('0x7')](),controller['show']);router[_0xf0a1('0xa')]('/',auth[_0xf0a1('0x7')](),controller[_0xf0a1('0xb')]);router[_0xf0a1('0xa')](_0xf0a1('0xc'),auth[_0xf0a1('0x7')](),controller['addApplications']);router[_0xf0a1('0xd')](_0xf0a1('0x9'),auth[_0xf0a1('0x7')](),controller[_0xf0a1('0xe')]);router[_0xf0a1('0xf')](_0xf0a1('0x9'),auth[_0xf0a1('0x7')](),controller['destroy']);module[_0xf0a1('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js
index 73f897a..03bbbd0 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(_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
+var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x209255,_0x15e90d){var _0xf98aa5=function(_0x412555){while(--_0x412555){_0x209255['push'](_0x209255['shift']());}};_0xf98aa5(++_0x15e90d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 bde8fee..16a3631 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 _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
+var _0x2542=['includes','type','find','name','UserProfileResource','error','stack','send','index','VoiceExtension','rawAttributes','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','create','body','startsWith','exten','role','user','OutboundRoutes','InternalRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','cutdigits','mandatoryDisposition','sequelize','transaction','bulkCreate','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','destroy','then','get','InboundRoutes','outbound','internal','filter','ignore','map','value'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2542,0x169));var _0x2254=function(_0x141a31,_0x3ab263){_0x141a31=_0x141a31-0x0;var _0x44b4e3=_0x2542[_0x141a31];return _0x44b4e3;};'use strict';var pdf=require(_0x2254('0x0'));var emlformat=require(_0x2254('0x1'));var rimraf=require(_0x2254('0x2'));var zipdir=require(_0x2254('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2254('0x4'));var moment=require('moment');var BPromise=require(_0x2254('0x5'));var Mustache=require(_0x2254('0x6'));var util=require(_0x2254('0x7'));var path=require(_0x2254('0x8'));var sox=require(_0x2254('0x9'));var csv=require('to-csv');var ejs=require(_0x2254('0xa'));var fs=require('fs');var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x10'));var querystring=require(_0x2254('0x11'));var Papa=require(_0x2254('0x12'));var Redis=require(_0x2254('0x13'));var authService=require(_0x2254('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x15'));var hardwareService=require(_0x2254('0x16'));var logger=require(_0x2254('0x17'))(_0x2254('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2254('0x19'))['db'];config[_0x2254('0x1a')]=_[_0x2254('0x1b')](config[_0x2254('0x1a')],{'host':_0x2254('0x1c'),'port':0x18eb});var socket=require(_0x2254('0x1d'))(new Redis(config['redis']));require(_0x2254('0x1e'))[_0x2254('0x1f')](socket);function respondWithStatusCode(_0x504749,_0x2f4de){_0x2f4de=_0x2f4de||0xcc;return function(_0x1e582d){if(_0x1e582d){return _0x504749[_0x2254('0x20')](_0x2f4de);}return _0x504749[_0x2254('0x21')](_0x2f4de)[_0x2254('0x22')]();};}function respondWithResult(_0xbc5548,_0x50f137){_0x50f137=_0x50f137||0xc8;return function(_0x18baf4){if(_0x18baf4){return _0xbc5548['status'](_0x50f137)[_0x2254('0x23')](_0x18baf4);}};}function respondWithFilteredResult(_0x2a2470,_0x170ffa){return function(_0x25f8b2){if(_0x25f8b2){var _0x1ae11e=_0x25f8b2['count'],_0x34f90e=_0x170ffa[_0x2254('0x24')],_0x497724=_0x170ffa[_0x2254('0x24')]+_0x170ffa[_0x2254('0x25')],_0x51b395;if(_0x497724>=_0x1ae11e){_0x497724=_0x1ae11e;_0x51b395=0xc8;}else{_0x51b395=0xce;}_0x2a2470[_0x2254('0x21')](_0x51b395);return _0x2a2470[_0x2254('0x26')](_0x2254('0x27'),_0x34f90e+'-'+_0x497724+'/'+_0x1ae11e)['json'](_0x25f8b2);}return null;};}function patchUpdates(_0x28381e){return function(_0x16148d){try{jsonpatch[_0x2254('0x28')](_0x16148d,_0x28381e,!![]);}catch(_0x576369){return BPromise['reject'](_0x576369);}return _0x16148d['save']();};}function saveUpdates(_0x1e8a98,_0x559af4){return function(_0xf88b56){if(_0xf88b56){return _0xf88b56['update'](_0x1e8a98)['then'](function(_0x4d8faf){return _0x4d8faf;});}return null;};}function removeEntity(_0x540020,_0x5e5edb){return function(_0x4f797d){if(_0x4f797d){return _0x4f797d[_0x2254('0x29')]()[_0x2254('0x2a')](function(){var _0x2f3037=_0x4f797d[_0x2254('0x2b')]({'plain':!![]});var _0x13522d=[{'name':_0x2254('0x2c'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0x2254('0x2d'),'ignore':![]},{'name':'InternalRoutes','value':_0x2254('0x2e'),'ignore':![]}];var _0x141dc5=_(_0x13522d)[_0x2254('0x2f')](_0x2254('0x30'))[_0x2254('0x31')]('value')[_0x2254('0x32')]();if(_[_0x2254('0x33')](_0x141dc5,_0x2f3037[_0x2254('0x34')])){return;}var _0x37af8b=_[_0x2254('0x35')](_0x13522d,[_0x2254('0x32'),_0x2f3037[_0x2254('0x34')]])[_0x2254('0x36')];return db[_0x2254('0x37')][_0x2254('0x29')]({'where':{'type':_0x37af8b,'resourceId':_0x2f3037['id']}})[_0x2254('0x2a')](function(){return _0x4f797d;});})[_0x2254('0x2a')](function(){_0x540020[_0x2254('0x21')](0xcc)[_0x2254('0x22')]();});}};}function handleEntityNotFound(_0x4577f4,_0x1b16c8){return function(_0x2c929f){if(!_0x2c929f){_0x4577f4[_0x2254('0x20')](0x194);}return _0x2c929f;};}function handleError(_0x2f32f8,_0x4e3658){_0x4e3658=_0x4e3658||0x1f4;return function(_0xe29526){logger[_0x2254('0x38')](_0xe29526[_0x2254('0x39')]);if(_0xe29526[_0x2254('0x36')]){delete _0xe29526[_0x2254('0x36')];}_0x2f32f8[_0x2254('0x21')](_0x4e3658)[_0x2254('0x3a')](_0xe29526);};}exports[_0x2254('0x3b')]=function(_0x5b84ce,_0x59c6c9){var _0x835a0e={},_0x3aa0bb={},_0x503540={'count':0x0,'rows':[]};var _0x240d4e=_[_0x2254('0x31')](db[_0x2254('0x3c')][_0x2254('0x3d')],function(_0x538e7b){return{'name':_0x538e7b['fieldName'],'type':_0x538e7b[_0x2254('0x34')]['key']};});_0x3aa0bb[_0x2254('0x3e')]=_[_0x2254('0x31')](_0x240d4e,_0x2254('0x36'));_0x3aa0bb[_0x2254('0x3f')]=_[_0x2254('0x40')](_0x5b84ce[_0x2254('0x3f')]);_0x3aa0bb[_0x2254('0x41')]=_['intersection'](_0x3aa0bb[_0x2254('0x3e')],_0x3aa0bb[_0x2254('0x3f')]);_0x835a0e[_0x2254('0x42')]=_[_0x2254('0x43')](_0x3aa0bb[_0x2254('0x3e')],qs[_0x2254('0x44')](_0x5b84ce[_0x2254('0x3f')][_0x2254('0x44')]));_0x835a0e[_0x2254('0x42')]=_0x835a0e[_0x2254('0x42')]['length']?_0x835a0e[_0x2254('0x42')]:_0x3aa0bb[_0x2254('0x3e')];if(!_0x5b84ce[_0x2254('0x3f')][_0x2254('0x45')]('nolimit')){_0x835a0e[_0x2254('0x25')]=qs[_0x2254('0x25')](_0x5b84ce[_0x2254('0x3f')][_0x2254('0x25')]);_0x835a0e[_0x2254('0x24')]=qs[_0x2254('0x24')](_0x5b84ce[_0x2254('0x3f')][_0x2254('0x24')]);}_0x835a0e['order']=qs[_0x2254('0x46')](_0x5b84ce['query'][_0x2254('0x46')]);_0x835a0e[_0x2254('0x47')]=qs[_0x2254('0x41')](_[_0x2254('0x48')](_0x5b84ce[_0x2254('0x3f')],_0x3aa0bb[_0x2254('0x41')]),_0x240d4e);if(_0x5b84ce[_0x2254('0x3f')]['filter']){_0x835a0e[_0x2254('0x47')]=_[_0x2254('0x49')](_0x835a0e[_0x2254('0x47')],{'$or':_[_0x2254('0x31')](_0x240d4e,function(_0x40d4da){if(_0x40d4da['type']!==_0x2254('0x4a')){var _0x1dec43={};_0x1dec43[_0x40d4da[_0x2254('0x36')]]={'$like':'%'+_0x5b84ce[_0x2254('0x3f')][_0x2254('0x2f')]+'%'};return _0x1dec43;}})});}_0x835a0e=_['merge']({},_0x835a0e,_0x5b84ce[_0x2254('0x4b')]);var _0x47c933={'where':_0x835a0e[_0x2254('0x47')]};return db[_0x2254('0x3c')][_0x2254('0x4c')](_0x47c933)[_0x2254('0x2a')](function(_0x362562){_0x503540[_0x2254('0x4c')]=_0x362562;if(_0x5b84ce[_0x2254('0x3f')][_0x2254('0x4d')]){_0x835a0e[_0x2254('0x4e')]=[{'all':!![]}];}return db[_0x2254('0x3c')][_0x2254('0x4f')](_0x835a0e);})[_0x2254('0x2a')](function(_0x83f44b){_0x503540['rows']=_0x83f44b;return _0x503540;})[_0x2254('0x2a')](respondWithFilteredResult(_0x59c6c9,_0x835a0e))[_0x2254('0x50')](handleError(_0x59c6c9,null));};exports[_0x2254('0x51')]=function(_0x5cc8fc,_0x94f5be){var _0x1c087b={'raw':![],'where':{'id':_0x5cc8fc[_0x2254('0x52')]['id']}},_0x400bb3={};_0x400bb3[_0x2254('0x3e')]=_[_0x2254('0x40')](db[_0x2254('0x3c')][_0x2254('0x3d')]);_0x400bb3[_0x2254('0x3f')]=_['keys'](_0x5cc8fc[_0x2254('0x3f')]);_0x400bb3[_0x2254('0x41')]=_[_0x2254('0x43')](_0x400bb3[_0x2254('0x3e')],_0x400bb3[_0x2254('0x3f')]);_0x1c087b[_0x2254('0x42')]=_[_0x2254('0x43')](_0x400bb3[_0x2254('0x3e')],qs[_0x2254('0x44')](_0x5cc8fc[_0x2254('0x3f')]['fields']));_0x1c087b[_0x2254('0x42')]=_0x1c087b[_0x2254('0x42')]['length']?_0x1c087b[_0x2254('0x42')]:_0x400bb3[_0x2254('0x3e')];if(_0x5cc8fc[_0x2254('0x3f')][_0x2254('0x4d')]){_0x1c087b['include']=[{'all':!![]}];}_0x1c087b=_[_0x2254('0x49')]({},_0x1c087b,_0x5cc8fc[_0x2254('0x4b')]);return db['VoiceExtension'][_0x2254('0x35')](_0x1c087b)[_0x2254('0x2a')](handleEntityNotFound(_0x94f5be,null))[_0x2254('0x2a')](respondWithResult(_0x94f5be,null))[_0x2254('0x50')](handleError(_0x94f5be,null));};exports['destroy']=function(_0x166d56,_0x106282){return db[_0x2254('0x3c')]['find']({'where':{'id':_0x166d56['params']['id']}})[_0x2254('0x2a')](handleEntityNotFound(_0x106282,null))[_0x2254('0x2a')](removeEntity(_0x106282,null))['catch'](handleError(_0x106282,null));};exports[_0x2254('0x53')]=function(_0x5bc29a,_0x4addb0){if(_0x5bc29a[_0x2254('0x54')][_0x2254('0x34')]===_0x2254('0x2d')&&!_[_0x2254('0x55')](_0x5bc29a[_0x2254('0x54')]['exten'],'_')){_0x5bc29a['body'][_0x2254('0x56')]='_'['concat'](_0x5bc29a[_0x2254('0x54')][_0x2254('0x56')]);}return db[_0x2254('0x3c')][_0x2254('0x53')](_0x5bc29a['body'],{'raw':![]})[_0x2254('0x2a')](function(_0x240716){var _0x49fe68=_0x5bc29a['user'][_0x2254('0x2b')]({'plain':!![]});if(!_0x49fe68)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49fe68[_0x2254('0x57')]===_0x2254('0x58')){var _0x2ef4a0=_0x240716[_0x2254('0x2b')]({'plain':!![]});var _0x301a12=[{'name':'InboundRoutes','value':'inbound'},{'name':_0x2254('0x59'),'value':'outbound'},{'name':_0x2254('0x5a'),'value':'internal'}];var _0x4da493=_['find'](_0x301a12,[_0x2254('0x32'),_0x2ef4a0[_0x2254('0x34')]])[_0x2254('0x36')];return db[_0x2254('0x5b')][_0x2254('0x35')]({'where':{'name':_0x4da493,'userProfileId':_0x49fe68[_0x2254('0x5c')]},'raw':!![]})[_0x2254('0x2a')](function(_0x25137c){if(_0x25137c&&_0x25137c[_0x2254('0x5d')]===0x0){return db[_0x2254('0x37')][_0x2254('0x53')]({'name':_0x2ef4a0[_0x2254('0x36')],'resourceId':_0x2ef4a0['id'],'type':_0x25137c[_0x2254('0x36')],'sectionId':_0x25137c['id']},{})[_0x2254('0x2a')](function(){return _0x240716;});}else{return _0x240716;}})[_0x2254('0x50')](function(_0x3b81bb){logger[_0x2254('0x38')](_0x2254('0x5e'),_0x3b81bb);throw _0x3b81bb;});}return _0x240716;})[_0x2254('0x2a')](respondWithResult(_0x4addb0,0xc9))['catch'](handleError(_0x4addb0,null));};exports[_0x2254('0x5f')]=function(_0xae171c,_0x3b1aae){if(_0xae171c[_0x2254('0x54')]['id']){delete _0xae171c['body']['id'];}return db['VoiceExtension'][_0x2254('0x35')]({'where':{'id':_0xae171c[_0x2254('0x52')]['id']}})[_0x2254('0x2a')](handleEntityNotFound(_0x3b1aae,null))[_0x2254('0x2a')](function(_0x1021b2){if(_0x1021b2){return db['VoiceExtension'][_0x2254('0x5f')](_[_0x2254('0x48')](_0xae171c[_0x2254('0x54')],['exten','context',_0x2254('0x60'),'recordingFormat',_0x2254('0x61'),_0x2254('0x62')]),{'where':{'context':_0x1021b2['context'],'exten':_0x1021b2[_0x2254('0x56')]},'individualHooks':!![]})[_0x2254('0x2a')](function(_0x4d30a5){return _0x4d30a5;});}return null;})[_0x2254('0x2a')](respondWithStatusCode(_0x3b1aae,null))[_0x2254('0x50')](handleError(_0x3b1aae,null));};exports['addApplications']=function(_0x5cc6bd,_0xde4e7,_0xa159a4){return db['VoiceExtension']['findOne']({'where':{'id':_0x5cc6bd[_0x2254('0x52')]['id']}})['then'](handleEntityNotFound(_0xde4e7,null))[_0x2254('0x2a')](function(_0x5d0229){if(_0x5d0229){return db[_0x2254('0x63')][_0x2254('0x64')](function(_0xaa9767){return db[_0x2254('0x3c')]['destroy']({'where':{'VoiceExtensionId':_0x5cc6bd[_0x2254('0x52')]['id']},'transaction':_0xaa9767})['then'](function(_0x1c2158){var _0x33cab6=_['map'](_0x5cc6bd[_0x2254('0x54')],function(_0x23a889){_0x23a889['VoiceExtensionId']=_0x5cc6bd[_0x2254('0x52')]['id'];return _0x23a889;});return db[_0x2254('0x3c')][_0x2254('0x65')](_0x33cab6,{'transaction':_0xaa9767});});})[_0x2254('0x2a')](function(){return db['VoiceExtension'][_0x2254('0x66')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5cc6bd[_0x2254('0x52')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x2254('0x2a')](respondWithResult(_0xde4e7,null))[_0x2254('0x50')](handleError(_0xde4e7,null));};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js
index c6fa290..0f39982 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 _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
+var _0x5007=['setMaxListeners','save','update','remove','emit','exports','events','VoiceExtension'];(function(_0x27398c,_0x4ea33f){var _0x155fc5=function(_0x1e1c53){while(--_0x1e1c53){_0x27398c['push'](_0x27398c['shift']());}};_0x155fc5(++_0x4ea33f);}(_0x5007,0xfe));var _0x7500=function(_0x5dfcc2,_0x318559){_0x5dfcc2=_0x5dfcc2-0x0;var _0x101cdf=_0x5007[_0x5dfcc2];return _0x101cdf;};'use strict';var EventEmitter=require(_0x7500('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x7500('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x7500('0x2')](0x0);var events={'afterCreate':_0x7500('0x3'),'afterUpdate':_0x7500('0x4'),'afterDestroy':_0x7500('0x5')};function emitEvent(_0x1b636e){return function(_0x55fd27,_0x5b4a79,_0x1b2057){VoiceExtensionEvents[_0x7500('0x6')](_0x1b636e+':'+_0x55fd27['id'],_0x55fd27);VoiceExtensionEvents[_0x7500('0x6')](_0x1b636e,_0x55fd27);_0x1b2057(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x7500('0x7')]=VoiceExtensionEvents;
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js
index 612faee..d7eaacb 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 _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
+var _0x5f66=['request-promise','path','../../config/environment','exports','VoiceExtension','voice_extensions','util','api','moment','bluebird'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'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('./voiceExtension.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
diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js
index 3957b8c..a41103e 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 _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
+var _0x4bc5=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','VoiceExtension,\x20%s,\x20%s','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','options','where','limit','include','map','model','attributes','then','info','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0x4bc5,0x1bb));var _0x54bc=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x4bc5[_0x476bf4];return _0x788ffe;};'use strict';var _=require(_0x54bc('0x0'));var util=require(_0x54bc('0x1'));var moment=require(_0x54bc('0x2'));var BPromise=require(_0x54bc('0x3'));var rs=require(_0x54bc('0x4'));var fs=require('fs');var Redis=require(_0x54bc('0x5'));var db=require(_0x54bc('0x6'))['db'];var utils=require(_0x54bc('0x7'));var logger=require(_0x54bc('0x8'))(_0x54bc('0x9'));var config=require(_0x54bc('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x54bc('0xb')][_0x54bc('0xc')]({'port':0x232a});config[_0x54bc('0xd')]=_[_0x54bc('0xe')](config[_0x54bc('0xd')],{'host':_0x54bc('0xf'),'port':0x18eb});var socket=require(_0x54bc('0x10'))(new Redis(config['redis']));require(_0x54bc('0x11'))[_0x54bc('0x12')](socket);function respondWithRpcPromise(_0x39cfc7,_0x2e768a,_0x2e1f32){return new BPromise(function(_0xb2d61a,_0xc1b837){return client[_0x54bc('0x13')](_0x39cfc7,_0x2e1f32)['then'](function(_0x1fd211){logger['info'](_0x54bc('0x14'),_0x2e768a,'request\x20sent');logger['debug'](_0x54bc('0x15'),_0x2e768a,_0x54bc('0x16'),JSON[_0x54bc('0x17')](_0x1fd211));if(_0x1fd211[_0x54bc('0x18')]){if(_0x1fd211[_0x54bc('0x18')][_0x54bc('0x19')]===0x1f4){logger[_0x54bc('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x2e768a,_0x1fd211[_0x54bc('0x18')]['message']);return _0xc1b837(_0x1fd211['error'][_0x54bc('0x1a')]);}logger[_0x54bc('0x18')](_0x54bc('0x14'),_0x2e768a,_0x1fd211[_0x54bc('0x18')][_0x54bc('0x1a')]);return _0xb2d61a(_0x1fd211[_0x54bc('0x18')][_0x54bc('0x1a')]);}else{logger['info'](_0x54bc('0x14'),_0x2e768a,_0x54bc('0x16'));_0xb2d61a(_0x1fd211[_0x54bc('0x1b')][_0x54bc('0x1a')]);}})[_0x54bc('0x1c')](function(_0x47368e){logger['error'](_0x54bc('0x14'),_0x2e768a,_0x47368e);_0xc1b837(_0x47368e);});});}exports[_0x54bc('0x1d')]=function(_0x16ad36){var _0x255fe2=this;return new Promise(function(_0x5a0a8d,_0x196af3){return db[_0x54bc('0x1e')]['findAll']({'raw':_0x16ad36['options']?_0x16ad36[_0x54bc('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x16ad36[_0x54bc('0x1f')]?_0x16ad36[_0x54bc('0x1f')][_0x54bc('0x20')]||null:null,'attributes':_0x16ad36[_0x54bc('0x1f')]?_0x16ad36[_0x54bc('0x1f')]['attributes']||null:null,'limit':_0x16ad36['options']?_0x16ad36[_0x54bc('0x1f')][_0x54bc('0x21')]||null:null,'include':_0x16ad36['options']?_0x16ad36[_0x54bc('0x1f')][_0x54bc('0x22')]?_[_0x54bc('0x23')](_0x16ad36[_0x54bc('0x1f')][_0x54bc('0x22')],function(_0x1d1bfb){return{'model':db[_0x1d1bfb[_0x54bc('0x24')]],'as':_0x1d1bfb['as'],'attributes':_0x1d1bfb[_0x54bc('0x25')],'include':_0x1d1bfb[_0x54bc('0x22')]?_[_0x54bc('0x23')](_0x1d1bfb[_0x54bc('0x22')],function(_0x5498bd){return{'model':db[_0x5498bd['model']],'as':_0x5498bd['as'],'attributes':_0x5498bd[_0x54bc('0x25')],'include':_0x5498bd['include']?_['map'](_0x5498bd[_0x54bc('0x22')],function(_0x5a1ae9){return{'model':db[_0x5a1ae9[_0x54bc('0x24')]],'as':_0x5a1ae9['as'],'attributes':_0x5a1ae9['attributes']};}):[]};}):[]};}):[]:[]})[_0x54bc('0x26')](function(_0x291247){logger[_0x54bc('0x27')](_0x54bc('0x1d'),_0x16ad36);logger[_0x54bc('0x28')]('GetVoiceExtension',_0x16ad36,JSON[_0x54bc('0x17')](_0x291247));_0x5a0a8d(_0x291247);})[_0x54bc('0x1c')](function(_0x26d835){logger['error'](_0x54bc('0x1d'),_0x26d835[_0x54bc('0x1a')],_0x16ad36);_0x196af3(_0x255fe2[_0x54bc('0x18')](0x1f4,_0x26d835['message']));});});};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js
index 79cd877..0be2b1e 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 _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
+var _0x5919=['remove','update','emit','register','length','./voiceExtension.events','save'];(function(_0x442d04,_0x39bab6){var _0x18c8c7=function(_0x23a331){while(--_0x23a331){_0x442d04['push'](_0x442d04['shift']());}};_0x18c8c7(++_0x39bab6);}(_0x5919,0x1be));var _0x9591=function(_0x5b04ac,_0x14b9b5){_0x5b04ac=_0x5b04ac-0x0;var _0x106281=_0x5919[_0x5b04ac];return _0x106281;};'use strict';var VoiceExtensionEvents=require(_0x9591('0x0'));var events=[_0x9591('0x1'),_0x9591('0x2'),_0x9591('0x3')];function createListener(_0x215511,_0x1b4839){return function(_0x2338e1){_0x1b4839[_0x9591('0x4')](_0x215511,_0x2338e1);};}function removeListener(_0x16a412,_0x4cdd4c){return function(){VoiceExtensionEvents['removeListener'](_0x16a412,_0x4cdd4c);};}exports[_0x9591('0x5')]=function(_0x4bf9a9){for(var _0x4cc192=0x0,_0x24d21a=events[_0x9591('0x6')];_0x4cc192<_0x24d21a;_0x4cc192++){var _0x144b87=events[_0x4cc192];var _0x13b251=createListener('voiceExtension:'+_0x144b87,_0x4bf9a9);VoiceExtensionEvents['on'](_0x144b87,_0x13b251);}};
\ No newline at end of file
diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js
index 5da238a..3b74fda 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 _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
+var _0x0b1a=['/:id','isAuthenticated','show','getMessages','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','index','get'];(function(_0x32f3bc,_0x2b5218){var _0x3f8cc2=function(_0x5dca80){while(--_0x5dca80){_0x32f3bc['push'](_0x32f3bc['shift']());}};_0x3f8cc2(++_0x2b5218);}(_0x0b1a,0x10c));var _0xa0b1=function(_0x322e1b,_0xfac9f9){_0x322e1b=_0x322e1b-0x0;var _0x4f9e63=_0x0b1a[_0x322e1b];return _0x4f9e63;};'use strict';var multer=require(_0xa0b1('0x0'));var util=require(_0xa0b1('0x1'));var path=require(_0xa0b1('0x2'));var timeout=require(_0xa0b1('0x3'));var express=require(_0xa0b1('0x4'));var router=express[_0xa0b1('0x5')]();var auth=require(_0xa0b1('0x6'));var interaction=require(_0xa0b1('0x7'));var config=require(_0xa0b1('0x8'));var controller=require(_0xa0b1('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xa0b1('0xa')]);router[_0xa0b1('0xb')](_0xa0b1('0xc'),auth[_0xa0b1('0xd')](),controller[_0xa0b1('0xe')]);router['get']('/:id/messages',auth[_0xa0b1('0xd')](),controller[_0xa0b1('0xf')]);router['post']('/',auth[_0xa0b1('0xd')](),controller[_0xa0b1('0x10')]);router[_0xa0b1('0x11')](_0xa0b1('0xc'),auth[_0xa0b1('0xd')](),controller['update']);router['delete'](_0xa0b1('0xc'),auth[_0xa0b1('0xd')](),controller[_0xa0b1('0x12')]);module[_0xa0b1('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js
index 1c45d70..b104d0e 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 _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
+var _0x3423=['email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','STRING','from-voicemail','contest_mailbox','setDataValue'];(function(_0x275c6e,_0x476557){var _0x269d2b=function(_0x3259a7){while(--_0x3259a7){_0x275c6e['push'](_0x275c6e['shift']());}};_0x269d2b(++_0x476557);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x3342('0x0')]},'context':{'type':Sequelize[_0x3342('0x0')],'defaultValue':_0x3342('0x1'),'unique':_0x3342('0x2')},'mailbox':{'type':Sequelize[_0x3342('0x0')],'defaultValue':'','allowNull':![],'unique':_0x3342('0x2')},'password':{'type':Sequelize[_0x3342('0x0')]},'fullname':{'type':Sequelize[_0x3342('0x0')]},'email':{'type':Sequelize[_0x3342('0x0')],'validate':{'isEmail':!![]},'set':function(_0x19206f){this[_0x3342('0x3')](_0x3342('0x4'),typeof _0x19206f===_0x3342('0x5')&&_0x19206f[_0x3342('0x6')]()?_0x19206f[_0x3342('0x6')]():null);}},'pager':{'type':Sequelize[_0x3342('0x0')]},'tz':{'type':Sequelize[_0x3342('0x0')],'defaultValue':_0x3342('0x7')},'attach':{'type':Sequelize[_0x3342('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x3342('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x3342('0x8')](_0x3342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x3342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x3342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3342('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3342('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3342('0x8')](_0x3342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3342('0x8')](_0x3342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3342('0x8')](_0x3342('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x3342('0x8')](_0x3342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x3342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3342('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x3342('0xb')},'emailsubject':{'type':Sequelize[_0x3342('0x0')]},'emailbody':{'type':Sequelize[_0x3342('0x0')]},'maxsecs':{'type':Sequelize[_0x3342('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3342('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x3342('0xd')],'get':function(){return this[_0x3342('0xe')](_0x3342('0xf'))+_0x3342('0x10')+this['getDataValue'](_0x3342('0x11'));}}};
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js
index 6a132ca..5b95849 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 _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
+var _0x6415=['reject','save','destroy','get','Voicemails','UserProfileResource','then','end','error','name','send','index','VoiceMail','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','findOne','VoiceMailMessage','findAndCountAll','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','count','offset','limit','set','Content-Range','json','apply'];(function(_0x56f239,_0xebb908){var _0x1636fc=function(_0x29d2c3){while(--_0x29d2c3){_0x56f239['push'](_0x56f239['shift']());}};_0x1636fc(++_0xebb908);}(_0x6415,0x1ef));var _0x5641=function(_0x2fdac0,_0x17b486){_0x2fdac0=_0x2fdac0-0x0;var _0x5c12ac=_0x6415[_0x2fdac0];return _0x5c12ac;};'use strict';var pdf=require(_0x5641('0x0'));var emlformat=require(_0x5641('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5641('0x2'));var jsonpatch=require(_0x5641('0x3'));var rp=require(_0x5641('0x4'));var moment=require(_0x5641('0x5'));var BPromise=require(_0x5641('0x6'));var Mustache=require(_0x5641('0x7'));var util=require(_0x5641('0x8'));var path=require(_0x5641('0x9'));var sox=require('sox');var csv=require(_0x5641('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5641('0xb'));var squel=require(_0x5641('0xc'));var crypto=require(_0x5641('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5641('0xa'));var querystring=require(_0x5641('0xe'));var Papa=require(_0x5641('0xf'));var Redis=require(_0x5641('0x10'));var authService=require(_0x5641('0x11'));var qs=require(_0x5641('0x12'));var as=require(_0x5641('0x13'));var hardwareService=require(_0x5641('0x14'));var logger=require(_0x5641('0x15'))(_0x5641('0x16'));var utils=require(_0x5641('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf830aa,_0x267028){_0x267028=_0x267028||0xcc;return function(_0x2d5428){if(_0x2d5428){return _0xf830aa[_0x5641('0x18')](_0x267028);}return _0xf830aa['status'](_0x267028)['end']();};}function respondWithResult(_0x4dee0d,_0x52c09d){_0x52c09d=_0x52c09d||0xc8;return function(_0x5c6053){if(_0x5c6053){return _0x4dee0d[_0x5641('0x19')](_0x52c09d)['json'](_0x5c6053);}};}function respondWithFilteredResult(_0x5b7308,_0x252540){return function(_0x4de08f){if(_0x4de08f){var _0x35387e=_0x4de08f[_0x5641('0x1a')],_0x5a0abc=_0x252540[_0x5641('0x1b')],_0x2772fd=_0x252540[_0x5641('0x1b')]+_0x252540[_0x5641('0x1c')],_0x516494;if(_0x2772fd>=_0x35387e){_0x2772fd=_0x35387e;_0x516494=0xc8;}else{_0x516494=0xce;}_0x5b7308[_0x5641('0x19')](_0x516494);return _0x5b7308[_0x5641('0x1d')](_0x5641('0x1e'),_0x5a0abc+'-'+_0x2772fd+'/'+_0x35387e)[_0x5641('0x1f')](_0x4de08f);}return null;};}function patchUpdates(_0x1fafa4){return function(_0x24ec97){try{jsonpatch[_0x5641('0x20')](_0x24ec97,_0x1fafa4,!![]);}catch(_0xae8a37){return BPromise[_0x5641('0x21')](_0xae8a37);}return _0x24ec97[_0x5641('0x22')]();};}function saveUpdates(_0x351637,_0x660f5){return function(_0x25a906){if(_0x25a906){return _0x25a906['update'](_0x351637)['then'](function(_0x74a5c5){return _0x74a5c5;});}return null;};}function removeEntity(_0x106196,_0x45d012){return function(_0x4232c4){if(_0x4232c4){return _0x4232c4[_0x5641('0x23')]()['then'](function(){var _0x1fb05c=_0x4232c4[_0x5641('0x24')]({'plain':!![]});var _0x7ea4c6=_0x5641('0x25');return db[_0x5641('0x26')][_0x5641('0x23')]({'where':{'type':_0x7ea4c6,'resourceId':_0x1fb05c['id']}})[_0x5641('0x27')](function(){return _0x4232c4;});})['then'](function(){_0x106196['status'](0xcc)[_0x5641('0x28')]();});}};}function handleEntityNotFound(_0x153587,_0x1a6d7a){return function(_0x3e0f75){if(!_0x3e0f75){_0x153587['sendStatus'](0x194);}return _0x3e0f75;};}function handleError(_0x48fb51,_0x43ce06){_0x43ce06=_0x43ce06||0x1f4;return function(_0xb4a28a){logger[_0x5641('0x29')](_0xb4a28a['stack']);if(_0xb4a28a['name']){delete _0xb4a28a[_0x5641('0x2a')];}_0x48fb51[_0x5641('0x19')](_0x43ce06)[_0x5641('0x2b')](_0xb4a28a);};}exports[_0x5641('0x2c')]=function(_0x1ce1e8,_0x1051a3){var _0x70eadd={},_0xd6084f={},_0x39abdc={'count':0x0,'rows':[]};var _0x45402d=_['map'](db[_0x5641('0x2d')][_0x5641('0x2e')],function(_0x449b73){return{'name':_0x449b73[_0x5641('0x2f')],'type':_0x449b73[_0x5641('0x30')][_0x5641('0x31')]};});_0xd6084f[_0x5641('0x32')]=_[_0x5641('0x33')](_0x45402d,_0x5641('0x2a'));_0xd6084f[_0x5641('0x34')]=_[_0x5641('0x35')](_0x1ce1e8[_0x5641('0x34')]);_0xd6084f[_0x5641('0x36')]=_[_0x5641('0x37')](_0xd6084f[_0x5641('0x32')],_0xd6084f[_0x5641('0x34')]);_0x70eadd[_0x5641('0x38')]=_[_0x5641('0x37')](_0xd6084f[_0x5641('0x32')],qs['fields'](_0x1ce1e8[_0x5641('0x34')][_0x5641('0x39')]));_0x70eadd[_0x5641('0x38')]=_0x70eadd[_0x5641('0x38')][_0x5641('0x3a')]?_0x70eadd[_0x5641('0x38')]:_0xd6084f[_0x5641('0x32')];if(!_0x1ce1e8['query'][_0x5641('0x3b')](_0x5641('0x3c'))){_0x70eadd[_0x5641('0x1c')]=qs['limit'](_0x1ce1e8[_0x5641('0x34')][_0x5641('0x1c')]);_0x70eadd[_0x5641('0x1b')]=qs[_0x5641('0x1b')](_0x1ce1e8[_0x5641('0x34')]['offset']);}_0x70eadd[_0x5641('0x3d')]=qs[_0x5641('0x3e')](_0x1ce1e8[_0x5641('0x34')][_0x5641('0x3e')]);_0x70eadd[_0x5641('0x3f')]=qs['filters'](_[_0x5641('0x40')](_0x1ce1e8[_0x5641('0x34')],_0xd6084f[_0x5641('0x36')]),_0x45402d);if(_0x1ce1e8['query'][_0x5641('0x41')]){_0x70eadd[_0x5641('0x3f')]=_[_0x5641('0x42')](_0x70eadd[_0x5641('0x3f')],{'$or':_['map'](_0x45402d,function(_0x33665b){if(_0x33665b[_0x5641('0x30')]!==_0x5641('0x43')){var _0x463633={};_0x463633[_0x33665b['name']]={'$like':'%'+_0x1ce1e8[_0x5641('0x34')][_0x5641('0x41')]+'%'};return _0x463633;}})});}_0x70eadd=_[_0x5641('0x42')]({},_0x70eadd,_0x1ce1e8[_0x5641('0x44')]);var _0x228483={'where':_0x70eadd['where']};return db[_0x5641('0x2d')]['count'](_0x228483)[_0x5641('0x27')](function(_0x54e165){_0x39abdc['count']=_0x54e165;if(_0x1ce1e8['query'][_0x5641('0x45')]){_0x70eadd[_0x5641('0x46')]=[{'all':!![]}];}return db['VoiceMail'][_0x5641('0x47')](_0x70eadd);})[_0x5641('0x27')](function(_0xbf94ff){_0x39abdc['rows']=_0xbf94ff;return _0x39abdc;})[_0x5641('0x27')](respondWithFilteredResult(_0x1051a3,_0x70eadd))[_0x5641('0x48')](handleError(_0x1051a3,null));};exports[_0x5641('0x49')]=function(_0x6d39c8,_0x318fac){var _0x419485={'raw':!![],'where':{'id':_0x6d39c8[_0x5641('0x4a')]['id']}},_0x5c5732={};_0x5c5732[_0x5641('0x32')]=_['keys'](db[_0x5641('0x2d')][_0x5641('0x2e')]);_0x5c5732[_0x5641('0x34')]=_[_0x5641('0x35')](_0x6d39c8[_0x5641('0x34')]);_0x5c5732[_0x5641('0x36')]=_[_0x5641('0x37')](_0x5c5732[_0x5641('0x32')],_0x5c5732['query']);_0x419485[_0x5641('0x38')]=_[_0x5641('0x37')](_0x5c5732[_0x5641('0x32')],qs[_0x5641('0x39')](_0x6d39c8[_0x5641('0x34')]['fields']));_0x419485['attributes']=_0x419485['attributes'][_0x5641('0x3a')]?_0x419485[_0x5641('0x38')]:_0x5c5732[_0x5641('0x32')];if(_0x6d39c8[_0x5641('0x34')][_0x5641('0x45')]){_0x419485[_0x5641('0x46')]=[{'all':!![]}];}_0x419485=_[_0x5641('0x42')]({},_0x419485,_0x6d39c8['options']);return db[_0x5641('0x2d')][_0x5641('0x4b')](_0x419485)[_0x5641('0x27')](handleEntityNotFound(_0x318fac,null))[_0x5641('0x27')](respondWithResult(_0x318fac,null))[_0x5641('0x48')](handleError(_0x318fac,null));};exports[_0x5641('0x4c')]=function(_0xaf120d,_0x542578){return db[_0x5641('0x2d')][_0x5641('0x4c')](_0xaf120d['body'],{})['then'](function(_0x478808){var _0x25f0c7=_0xaf120d['user']['get']({'plain':!![]});if(!_0x25f0c7)throw new Error(_0x5641('0x4d'));if(_0x25f0c7[_0x5641('0x4e')]===_0x5641('0x4f')){var _0x30b1ed=_0x478808['get']({'plain':!![]});var _0x528a75=_0x5641('0x25');return db[_0x5641('0x50')][_0x5641('0x4b')]({'where':{'name':_0x528a75,'userProfileId':_0x25f0c7[_0x5641('0x51')]},'raw':!![]})['then'](function(_0x316309){if(_0x316309&&_0x316309['autoAssociation']===0x0){return db[_0x5641('0x26')][_0x5641('0x4c')]({'name':_0x30b1ed[_0x5641('0x2a')],'resourceId':_0x30b1ed['id'],'type':_0x316309[_0x5641('0x2a')],'sectionId':_0x316309['id']},{})[_0x5641('0x27')](function(){return _0x478808;});}else{return _0x478808;}})[_0x5641('0x48')](function(_0x1ddc57){logger['error'](_0x5641('0x52'),_0x1ddc57);throw _0x1ddc57;});}return _0x478808;})[_0x5641('0x27')](respondWithResult(_0x542578,0xc9))[_0x5641('0x48')](handleError(_0x542578,null));};exports['update']=function(_0x544d0c,_0x559a0c){if(_0x544d0c['body']['id']){delete _0x544d0c[_0x5641('0x53')]['id'];}return db[_0x5641('0x2d')][_0x5641('0x4b')]({'where':{'id':_0x544d0c[_0x5641('0x4a')]['id']}})[_0x5641('0x27')](handleEntityNotFound(_0x559a0c,null))[_0x5641('0x27')](saveUpdates(_0x544d0c['body'],null))[_0x5641('0x27')](respondWithResult(_0x559a0c,null))['catch'](handleError(_0x559a0c,null));};exports[_0x5641('0x23')]=function(_0x30f569,_0x3cf0dc){return db[_0x5641('0x2d')][_0x5641('0x4b')]({'where':{'id':_0x30f569[_0x5641('0x4a')]['id']}})[_0x5641('0x27')](handleEntityNotFound(_0x3cf0dc,null))[_0x5641('0x27')](removeEntity(_0x3cf0dc,null))[_0x5641('0x48')](handleError(_0x3cf0dc,null));};exports[_0x5641('0x54')]=function(_0x29d93c,_0xaed48c,_0xf189ee){return db[_0x5641('0x2d')][_0x5641('0x55')]({'where':{'id':_0x29d93c[_0x5641('0x4a')]['id']}})['then'](handleEntityNotFound(_0xaed48c,null))[_0x5641('0x27')](function(_0x5a19f5){var _0x45e71d;var _0x5dd1b2={},_0x100c75={};_0x100c75['model']=_[_0x5641('0x35')](db[_0x5641('0x56')][_0x5641('0x2e')]);_0x100c75['query']=_[_0x5641('0x35')](_0x29d93c[_0x5641('0x34')]);_0x100c75[_0x5641('0x36')]=_[_0x5641('0x37')](_0x100c75[_0x5641('0x32')],_0x100c75[_0x5641('0x34')]);_0x5dd1b2[_0x5641('0x38')]=_['intersection'](_0x100c75[_0x5641('0x32')],qs[_0x5641('0x39')](_0x29d93c[_0x5641('0x34')][_0x5641('0x39')]));_0x5dd1b2[_0x5641('0x38')]=_0x5dd1b2[_0x5641('0x38')]['length']?_0x5dd1b2['attributes']:_0x100c75[_0x5641('0x32')];if(!_0x29d93c[_0x5641('0x34')][_0x5641('0x3b')](_0x5641('0x3c'))){_0x5dd1b2[_0x5641('0x1c')]=qs[_0x5641('0x1c')](_0x29d93c[_0x5641('0x34')][_0x5641('0x1c')]);_0x5dd1b2[_0x5641('0x1b')]=qs[_0x5641('0x1b')](_0x29d93c[_0x5641('0x34')][_0x5641('0x1b')]);}_0x5dd1b2[_0x5641('0x3d')]=qs[_0x5641('0x3e')](_0x29d93c[_0x5641('0x34')]['sort']);_0x5dd1b2[_0x5641('0x3f')]=qs['filters'](_[_0x5641('0x40')](_0x29d93c[_0x5641('0x34')],_0x100c75[_0x5641('0x36')]));if(_0x29d93c[_0x5641('0x34')][_0x5641('0x41')]){_0x5dd1b2['where']=_['merge'](_0x5dd1b2[_0x5641('0x3f')],{'$or':_[_0x5641('0x33')](_0x5dd1b2[_0x5641('0x38')],function(_0x53754e){var _0x375ef8={};_0x375ef8[_0x53754e]={'$like':'%'+_0x29d93c[_0x5641('0x34')]['filter']+'%'};return _0x375ef8;})});}_0x5dd1b2[_0x5641('0x3f')]=_[_0x5641('0x42')](_0x5dd1b2[_0x5641('0x3f')],{'mailboxuser':_0x5a19f5['mailbox']});_0x5dd1b2=_[_0x5641('0x42')]({},_0x5dd1b2,_0x29d93c['options']);return db[_0x5641('0x56')][_0x5641('0x57')](_0x5dd1b2)[_0x5641('0x27')](respondWithFilteredResult(_0xaed48c,_0x5dd1b2));})['catch'](handleError(_0xaed48c,null));};
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js
index c8c652c..162d02a 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 _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
+var _0x631f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','voice_voicemail','mailbox_context','mailbox','util','../../config/logger'];(function(_0x3c007e,_0x2e6adc){var _0x851f31=function(_0x12bf84){while(--_0x12bf84){_0x3c007e['push'](_0x3c007e['shift']());}};_0x851f31(++_0x2e6adc);}(_0x631f,0x191));var _0xf631=function(_0x44b7d6,_0x4a3f3f){_0x44b7d6=_0x44b7d6-0x0;var _0x5346f0=_0x631f[_0x44b7d6];return _0x5346f0;};'use strict';var _=require('lodash');var util=require(_0xf631('0x0'));var logger=require(_0xf631('0x1'))('api');var moment=require(_0xf631('0x2'));var BPromise=require(_0xf631('0x3'));var rp=require(_0xf631('0x4'));var fs=require('fs');var path=require(_0xf631('0x5'));var rimraf=require(_0xf631('0x6'));var config=require(_0xf631('0x7'));var attributes=require(_0xf631('0x8'));module[_0xf631('0x9')]=function(_0x4a1fd5,_0x37b3a8){return _0x4a1fd5['define']('VoiceMail',attributes,{'tableName':_0xf631('0xa'),'paranoid':![],'indexes':[{'name':_0xf631('0xb'),'fields':[_0xf631('0xc'),'context']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js
index 6fb1c0e..c1856aa 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 _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
+var _0xe346=['error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1cfdc3,_0x1222e3){var _0x37799f=function(_0x69ba0f){while(--_0x69ba0f){_0x1cfdc3['push'](_0x1cfdc3['shift']());}};_0x37799f(++_0x1222e3);}(_0xe346,0xb7));var _0x6e34=function(_0x50d588,_0x38c604){_0x50d588=_0x50d588-0x0;var _0x501c28=_0xe346[_0x50d588];return _0x501c28;};'use strict';var _=require(_0x6e34('0x0'));var util=require('util');var moment=require(_0x6e34('0x1'));var BPromise=require(_0x6e34('0x2'));var rs=require(_0x6e34('0x3'));var fs=require('fs');var Redis=require(_0x6e34('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e34('0x5'));var logger=require(_0x6e34('0x6'))(_0x6e34('0x7'));var config=require(_0x6e34('0x8'));var jayson=require(_0x6e34('0x9'));var client=jayson[_0x6e34('0xa')][_0x6e34('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x163226,_0x46c347,_0x2ed31d){return new BPromise(function(_0x2290df,_0x2a92b1){return client['request'](_0x163226,_0x2ed31d)['then'](function(_0x124ede){logger[_0x6e34('0xc')](_0x6e34('0xd'),_0x46c347,_0x6e34('0xe'));logger[_0x6e34('0xf')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x46c347,_0x6e34('0xe'),JSON[_0x6e34('0x10')](_0x124ede));if(_0x124ede[_0x6e34('0x11')]){if(_0x124ede['error']['code']===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x46c347,_0x124ede[_0x6e34('0x11')][_0x6e34('0x12')]);return _0x2a92b1(_0x124ede[_0x6e34('0x11')][_0x6e34('0x12')]);}logger[_0x6e34('0x11')]('VoiceMail,\x20%s,\x20%s',_0x46c347,_0x124ede[_0x6e34('0x11')][_0x6e34('0x12')]);return _0x2290df(_0x124ede[_0x6e34('0x11')]['message']);}else{logger[_0x6e34('0xc')](_0x6e34('0xd'),_0x46c347,_0x6e34('0xe'));_0x2290df(_0x124ede['result']['message']);}})[_0x6e34('0x13')](function(_0x198cb4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x46c347,_0x198cb4);_0x2a92b1(_0x198cb4);});});}
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js
index 1009c77..fc6342b 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 _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
+var _0x31f0=['get','/:id','show','/:id/download','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller'];(function(_0x323577,_0x2843ca){var _0x29254b=function(_0x3bd754){while(--_0x3bd754){_0x323577['push'](_0x323577['shift']());}};_0x29254b(++_0x2843ca);}(_0x31f0,0xb7));var _0x031f=function(_0x21904a,_0x3e9ae1){_0x21904a=_0x21904a-0x0;var _0x255d61=_0x31f0[_0x21904a];return _0x255d61;};'use strict';var multer=require(_0x031f('0x0'));var util=require('util');var path=require(_0x031f('0x1'));var timeout=require('connect-timeout');var express=require(_0x031f('0x2'));var router=express[_0x031f('0x3')]();var auth=require(_0x031f('0x4'));var interaction=require(_0x031f('0x5'));var config=require('../../config/environment');var controller=require(_0x031f('0x6'));router[_0x031f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x031f('0x8'),auth['isAuthenticated'](),controller[_0x031f('0x9')]);router[_0x031f('0x7')](_0x031f('0xa'),auth[_0x031f('0xb')](),controller['download']);router[_0x031f('0xc')]('/',auth[_0x031f('0xb')](),controller[_0x031f('0xd')]);router[_0x031f('0xe')](_0x031f('0x8'),auth[_0x031f('0xb')](),controller[_0x031f('0xf')]);router[_0x031f('0x10')]('/:id',auth[_0x031f('0xb')](),controller[_0x031f('0x11')]);module[_0x031f('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js
index ef097b6..2bce6c2 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 _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
+var _0x8085=['VIRTUAL','getDataValue','INTEGER','STRING','BLOB','TIMESTAMP','sequelize','exports'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x8085,0x1ce));var _0x5808=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x8085[_0x5a79e2];return _0x266c45;};'use strict';var Sequelize=require(_0x5808('0x0'));module[_0x5808('0x1')]={'name':{'type':Sequelize[_0x5808('0x2')],'get':function(_0x3e44e6){return this[_0x5808('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x5808('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5808('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x5808('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5808('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x5808('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x5808('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x5808('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x5808('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5808('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x5808('0x6')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x5808('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5808('0x5')],'defaultValue':''},'stamp':{'type':_0x5808('0x7'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js
index 908dc0f..2b8b4e8 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 _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
+var _0xd52a=['then','stack','name','send','index','map','VoiceMailMessage','fieldName','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','catch','create','body','destroy','download','recording','Sequelize','audio/wav','attachment','msg_id','Content-Disposition','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','lodash','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','count','limit','set','Content-Range','reject','save','update'];(function(_0x70bcda,_0x4305b6){var _0xdc765=function(_0x359921){while(--_0x359921){_0x70bcda['push'](_0x70bcda['shift']());}};_0xdc765(++_0x4305b6);}(_0xd52a,0xca));var _0xad52=function(_0x28ac6b,_0x2011f4){_0x28ac6b=_0x28ac6b-0x0;var _0x2dd56c=_0xd52a[_0x28ac6b];return _0x2dd56c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xad52('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xad52('0x1'));var jsonpatch=require(_0xad52('0x2'));var rp=require(_0xad52('0x3'));var moment=require('moment');var BPromise=require(_0xad52('0x4'));var Mustache=require(_0xad52('0x5'));var util=require(_0xad52('0x6'));var path=require(_0xad52('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xad52('0x8'));var squel=require('squel');var crypto=require(_0xad52('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xad52('0xa'));var toCsv=require(_0xad52('0xb'));var querystring=require('querystring');var Papa=require(_0xad52('0xc'));var Redis=require('ioredis');var authService=require(_0xad52('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xad52('0xe'));var hardwareService=require(_0xad52('0xf'));var logger=require(_0xad52('0x10'))(_0xad52('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25c86a,_0x79b1e7){_0x79b1e7=_0x79b1e7||0xcc;return function(_0x378b0c){if(_0x378b0c){return _0x25c86a[_0xad52('0x12')](_0x79b1e7);}return _0x25c86a[_0xad52('0x13')](_0x79b1e7)[_0xad52('0x14')]();};}function respondWithResult(_0x16e0f7,_0xd04cde){_0xd04cde=_0xd04cde||0xc8;return function(_0x3d2df6){if(_0x3d2df6){return _0x16e0f7['status'](_0xd04cde)[_0xad52('0x15')](_0x3d2df6);}};}function respondWithFilteredResult(_0x139305,_0x3bc8f6){return function(_0x42eb20){if(_0x42eb20){var _0x38be7e=_0x42eb20[_0xad52('0x16')],_0xcb6cd5=_0x3bc8f6['offset'],_0x2bbaad=_0x3bc8f6['offset']+_0x3bc8f6[_0xad52('0x17')],_0x3aed76;if(_0x2bbaad>=_0x38be7e){_0x2bbaad=_0x38be7e;_0x3aed76=0xc8;}else{_0x3aed76=0xce;}_0x139305[_0xad52('0x13')](_0x3aed76);return _0x139305[_0xad52('0x18')](_0xad52('0x19'),_0xcb6cd5+'-'+_0x2bbaad+'/'+_0x38be7e)[_0xad52('0x15')](_0x42eb20);}return null;};}function patchUpdates(_0x59a5e4){return function(_0x5696a4){try{jsonpatch['apply'](_0x5696a4,_0x59a5e4,!![]);}catch(_0x164ffd){return BPromise[_0xad52('0x1a')](_0x164ffd);}return _0x5696a4[_0xad52('0x1b')]();};}function saveUpdates(_0x5f2bea,_0x24fb52){return function(_0x593dfd){if(_0x593dfd){return _0x593dfd[_0xad52('0x1c')](_0x5f2bea)[_0xad52('0x1d')](function(_0x3262e4){return _0x3262e4;});}return null;};}function removeEntity(_0x23cfee,_0x2c182f){return function(_0x2f1526){if(_0x2f1526){return _0x2f1526['destroy']()[_0xad52('0x1d')](function(){_0x23cfee['status'](0xcc)[_0xad52('0x14')]();});}};}function handleEntityNotFound(_0x2acbb4,_0x2fa90c){return function(_0x5bce67){if(!_0x5bce67){_0x2acbb4[_0xad52('0x12')](0x194);}return _0x5bce67;};}function handleError(_0x579b9d,_0x5437e3){_0x5437e3=_0x5437e3||0x1f4;return function(_0x2809f7){logger['error'](_0x2809f7[_0xad52('0x1e')]);if(_0x2809f7[_0xad52('0x1f')]){delete _0x2809f7['name'];}_0x579b9d['status'](_0x5437e3)[_0xad52('0x20')](_0x2809f7);};}exports[_0xad52('0x21')]=function(_0x42db69,_0x50431e){var _0x132e94={},_0x5771ce={},_0x18c819={'count':0x0,'rows':[]};var _0x3b5613=_[_0xad52('0x22')](db[_0xad52('0x23')]['rawAttributes'],function(_0x426106){return{'name':_0x426106[_0xad52('0x24')],'type':_0x426106['type'][_0xad52('0x25')]};});_0x5771ce[_0xad52('0x26')]=_[_0xad52('0x27')](_[_0xad52('0x22')](_0x3b5613,_0xad52('0x1f')),['name']);_0x5771ce['query']=_['keys'](_0x42db69[_0xad52('0x28')]);_0x5771ce[_0xad52('0x29')]=_[_0xad52('0x2a')](_0x5771ce['model'],_0x5771ce['query']);_0x132e94[_0xad52('0x2b')]=_[_0xad52('0x2a')](_0x5771ce[_0xad52('0x26')],qs[_0xad52('0x2c')](_0x42db69[_0xad52('0x28')][_0xad52('0x2c')]));_0x132e94['attributes']=_0x132e94[_0xad52('0x2b')][_0xad52('0x2d')]?_0x132e94[_0xad52('0x2b')]:_0x5771ce[_0xad52('0x26')];if(!_0x42db69[_0xad52('0x28')][_0xad52('0x2e')](_0xad52('0x2f'))){_0x132e94[_0xad52('0x17')]=qs[_0xad52('0x17')](_0x42db69[_0xad52('0x28')][_0xad52('0x17')]);_0x132e94['offset']=qs[_0xad52('0x30')](_0x42db69[_0xad52('0x28')][_0xad52('0x30')]);}_0x132e94[_0xad52('0x31')]=qs[_0xad52('0x32')](_0x42db69[_0xad52('0x28')]['sort']);_0x132e94[_0xad52('0x33')]=qs[_0xad52('0x29')](_[_0xad52('0x34')](_0x42db69['query'],_0x5771ce[_0xad52('0x29')]),_0x3b5613);if(_0x42db69[_0xad52('0x28')][_0xad52('0x35')]){_0x132e94['where']=_[_0xad52('0x36')](_0x132e94[_0xad52('0x33')],{'$or':_[_0xad52('0x22')](_0x3b5613,function(_0x49260f){if(_0x49260f[_0xad52('0x37')]!==_0xad52('0x38')){var _0xe562e4={};_0xe562e4[_0x49260f[_0xad52('0x1f')]]={'$like':'%'+_0x42db69[_0xad52('0x28')][_0xad52('0x35')]+'%'};return _0xe562e4;}})});}_0x132e94=_['merge']({},_0x132e94,_0x42db69[_0xad52('0x39')]);var _0x5775b4={'where':_0x132e94[_0xad52('0x33')]};return db[_0xad52('0x23')][_0xad52('0x16')](_0x5775b4)[_0xad52('0x1d')](function(_0x1d5e8a){_0x18c819['count']=_0x1d5e8a;if(_0x42db69[_0xad52('0x28')][_0xad52('0x3a')]){_0x132e94[_0xad52('0x3b')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xad52('0x3c')](_0x132e94);})[_0xad52('0x1d')](function(_0x17ef03){_0x18c819['rows']=_0x17ef03;return _0x18c819;})[_0xad52('0x1d')](respondWithFilteredResult(_0x50431e,_0x132e94))['catch'](handleError(_0x50431e,null));};exports[_0xad52('0x3d')]=function(_0x355381,_0x272907){var _0xa1c4a9={'raw':!![],'where':{'id':_0x355381[_0xad52('0x3e')]['id']}},_0x52aa18={};_0x52aa18[_0xad52('0x26')]=_[_0xad52('0x3f')](db[_0xad52('0x23')][_0xad52('0x40')]);_0x52aa18[_0xad52('0x28')]=_[_0xad52('0x3f')](_0x355381[_0xad52('0x28')]);_0x52aa18['filters']=_[_0xad52('0x2a')](_0x52aa18['model'],_0x52aa18[_0xad52('0x28')]);_0xa1c4a9[_0xad52('0x2b')]=_[_0xad52('0x2a')](_0x52aa18[_0xad52('0x26')],qs[_0xad52('0x2c')](_0x355381[_0xad52('0x28')][_0xad52('0x2c')]));_0xa1c4a9[_0xad52('0x2b')]=_0xa1c4a9[_0xad52('0x2b')][_0xad52('0x2d')]?_0xa1c4a9[_0xad52('0x2b')]:_0x52aa18[_0xad52('0x26')];if(_0x355381[_0xad52('0x28')][_0xad52('0x3a')]){_0xa1c4a9[_0xad52('0x3b')]=[{'all':!![]}];}_0xa1c4a9=_[_0xad52('0x36')]({},_0xa1c4a9,_0x355381[_0xad52('0x39')]);return db[_0xad52('0x23')][_0xad52('0x41')](_0xa1c4a9)[_0xad52('0x1d')](handleEntityNotFound(_0x272907,null))['then'](respondWithResult(_0x272907,null))[_0xad52('0x42')](handleError(_0x272907,null));};exports[_0xad52('0x43')]=function(_0x14b87b,_0x5cb877){return db[_0xad52('0x23')]['create'](_0x14b87b[_0xad52('0x44')],{})['then'](respondWithResult(_0x5cb877,0xc9))['catch'](handleError(_0x5cb877,null));};exports[_0xad52('0x1c')]=function(_0x1746b0,_0x4554da){if(_0x1746b0[_0xad52('0x44')]['id']){delete _0x1746b0['body']['id'];}return db['VoiceMailMessage'][_0xad52('0x41')]({'where':{'id':_0x1746b0['params']['id']}})[_0xad52('0x1d')](handleEntityNotFound(_0x4554da,null))['then'](saveUpdates(_0x1746b0[_0xad52('0x44')],null))[_0xad52('0x1d')](respondWithResult(_0x4554da,null))[_0xad52('0x42')](handleError(_0x4554da,null));};exports[_0xad52('0x45')]=function(_0x12880f,_0x382b60){return db['VoiceMailMessage'][_0xad52('0x41')]({'where':{'id':_0x12880f[_0xad52('0x3e')]['id']}})[_0xad52('0x1d')](handleEntityNotFound(_0x382b60,null))[_0xad52('0x1d')](removeEntity(_0x382b60,null))['catch'](handleError(_0x382b60,null));};exports[_0xad52('0x46')]=function(_0x413338,_0x406a8f,_0x5a6ab3){return db[_0xad52('0x23')][_0xad52('0x41')]({'where':{'id':_0x413338[_0xad52('0x3e')]['id']},'attributes':['id',_0xad52('0x47'),'msg_id']})[_0xad52('0x1d')](handleEntityNotFound(_0x406a8f,null))[_0xad52('0x1d')](function(_0x15533a){if(_0x15533a){if(!_0x15533a[_0xad52('0x47')]){throw new db[(_0xad52('0x48'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x5d0cbb={'Content-Type':_0xad52('0x49'),'Content-Disposition':_0xad52('0x4a')};if(_0x15533a[_0xad52('0x4b')]){_0x5d0cbb[_0xad52('0x4c')]='attachment;\x20filename=\x22'+_0x15533a[_0xad52('0x4b')]+'.wav\x22';}_0x406a8f[_0xad52('0x18')](_0x5d0cbb);return _0x406a8f[_0xad52('0x20')](new Buffer(_0x15533a[_0xad52('0x47')]));}})['catch'](handleError(_0x406a8f,null));};
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js
index f33340d..913c0fc 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 _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
+var _0x7a40=['exports','define','voice_voicemail_messages','dir','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes'];(function(_0x4ef77b,_0x6a3df){var _0x58d1a6=function(_0x3b7e29){while(--_0x3b7e29){_0x4ef77b['push'](_0x4ef77b['shift']());}};_0x58d1a6(++_0x6a3df);}(_0x7a40,0x197));var _0x07a4=function(_0x14a283,_0x39964c){_0x14a283=_0x14a283-0x0;var _0x4db6a5=_0x7a40[_0x14a283];return _0x4db6a5;};'use strict';var _=require(_0x07a4('0x0'));var util=require(_0x07a4('0x1'));var logger=require(_0x07a4('0x2'))('api');var moment=require(_0x07a4('0x3'));var BPromise=require(_0x07a4('0x4'));var rp=require(_0x07a4('0x5'));var fs=require('fs');var path=require(_0x07a4('0x6'));var rimraf=require(_0x07a4('0x7'));var config=require('../../config/environment');var attributes=require(_0x07a4('0x8'));module[_0x07a4('0x9')]=function(_0x3a53fb,_0x399d0f){return _0x3a53fb[_0x07a4('0xa')]('VoiceMailMessage',attributes,{'tableName':_0x07a4('0xb'),'paranoid':![],'indexes':[{'name':_0x07a4('0xc'),'fields':[_0x07a4('0xc')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js
index 1c5cf70..a58a910 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 _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
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3ddf73,_0x17fb51){var _0x5930e5=function(_0x41d4f9){while(--_0x41d4f9){_0x3ddf73['push'](_0x3ddf73['shift']());}};_0x5930e5(++_0x17fb51);}(_0x2ef3,0xba));var _0x32ef=function(_0x2e7067,_0xf44954){_0x2e7067=_0x2e7067-0x0;var _0x45dfe0=_0x2ef3[_0x2e7067];return _0x45dfe0;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js
index 9c3d518..6d715a0 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 _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
+var _0x1bc6=['post','create','addSound','update','destroy','delete','/:id/sounds/:id2','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds'];(function(_0x19ae88,_0xa7d7bf){var _0x397856=function(_0x55d1b3){while(--_0x55d1b3){_0x19ae88['push'](_0x19ae88['shift']());}};_0x397856(++_0xa7d7bf);}(_0x1bc6,0x1b8));var _0x61bc=function(_0x39d51c,_0x2a7da4){_0x39d51c=_0x39d51c-0x0;var _0x1419ca=_0x1bc6[_0x39d51c];return _0x1419ca;};'use strict';var multer=require(_0x61bc('0x0'));var util=require(_0x61bc('0x1'));var path=require(_0x61bc('0x2'));var timeout=require(_0x61bc('0x3'));var express=require(_0x61bc('0x4'));var router=express[_0x61bc('0x5')]();var auth=require(_0x61bc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x61bc('0x7'));var controller=require(_0x61bc('0x8'));router[_0x61bc('0x9')]('/',auth[_0x61bc('0xa')](),controller[_0x61bc('0xb')]);router['get'](_0x61bc('0xc'),auth['isAuthenticated'](),controller[_0x61bc('0xd')]);router[_0x61bc('0x9')](_0x61bc('0xe'),auth[_0x61bc('0xa')](),controller[_0x61bc('0xf')]);router[_0x61bc('0x10')]('/',auth[_0x61bc('0xa')](),controller[_0x61bc('0x11')]);router[_0x61bc('0x10')](_0x61bc('0xe'),auth[_0x61bc('0xa')](),controller[_0x61bc('0x12')]);router['put'](_0x61bc('0xc'),auth['isAuthenticated'](),controller[_0x61bc('0x13')]);router['delete'](_0x61bc('0xc'),auth[_0x61bc('0xa')](),controller[_0x61bc('0x14')]);router[_0x61bc('0x15')](_0x61bc('0x16'),auth[_0x61bc('0xa')](),controller['removeSound']);module[_0x61bc('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
index 25adad7..4e9601e 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 _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
+var _0x69f6=['name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','TIMESTAMP','BOOLEAN','sequelize','exports','STRING'];(function(_0x4b839d,_0x4c1a4a){var _0x1ac602=function(_0x3ee5c9){while(--_0x3ee5c9){_0x4b839d['push'](_0x4b839d['shift']());}};_0x1ac602(++_0x4c1a4a);}(_0x69f6,0xcd));var _0x669f=function(_0x31e489,_0x24a27a){_0x31e489=_0x31e489-0x0;var _0x133200=_0x69f6[_0x31e489];return _0x133200;};'use strict';var Sequelize=require(_0x669f('0x0'));module[_0x669f('0x1')]={'name':{'type':Sequelize[_0x669f('0x2')],'allowNull':![],'unique':_0x669f('0x3')},'mode':{'type':Sequelize[_0x669f('0x4')](_0x669f('0x5'),_0x669f('0x6'),_0x669f('0x7'),_0x669f('0x8'),_0x669f('0x9'),_0x669f('0xa')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x669f('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x669f('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x669f('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x669f('0x2')],'allowNull':!![]},'stamp':{'type':_0x669f('0xb')},'defaultEntry':{'type':Sequelize[_0x669f('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 385d185..f5e3104 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 _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
+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(_0x1f0dce,_0x1d50a){var _0x1ae63a=function(_0x1c1e6a){while(--_0x1c1e6a){_0x1f0dce['push'](_0x1f0dce['shift']());}};_0x1ae63a(++_0x1d50a);}(_0xb10b,0x12a));var _0xbb10=function(_0x1fc82b,_0x5150a6){_0x1fc82b=_0x1fc82b-0x0;var _0x4c6679=_0xb10b[_0x1fc82b];return _0x4c6679;};'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
diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
index 91d4bfd..7d8d181 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 _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
+var _0x718a=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','moment'];(function(_0x54b730,_0x501ff7){var _0x444deb=function(_0x5cdffe){while(--_0x5cdffe){_0x54b730['push'](_0x54b730['shift']());}};_0x444deb(++_0x501ff7);}(_0x718a,0x7a));var _0xa718=function(_0x5e5123,_0x47bfeb){_0x5e5123=_0x5e5123-0x0;var _0x31c641=_0x718a[_0x5e5123];return _0x31c641;};'use strict';var _=require(_0xa718('0x0'));var util=require(_0xa718('0x1'));var logger=require(_0xa718('0x2'))('api');var moment=require(_0xa718('0x3'));var BPromise=require(_0xa718('0x4'));var rp=require(_0xa718('0x5'));var fs=require('fs');var path=require(_0xa718('0x6'));var rimraf=require(_0xa718('0x7'));var config=require(_0xa718('0x8'));var attributes=require(_0xa718('0x9'));module[_0xa718('0xa')]=function(_0x329dc1,_0x34aa62){return _0x329dc1[_0xa718('0xb')](_0xa718('0xc'),attributes,{'tableName':_0xa718('0xd'),'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 2438a51..7cf72c4 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 _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
+var _0xf449=['../../config/environment','jayson/promise','client','request','VoiceMusicOnHold,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','randomstring','ioredis','../../config/utils','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf449,0x6b));var _0x9f44=function(_0x162f01,_0x5d03ca){_0x162f01=_0x162f01-0x0;var _0x38e64a=_0xf449[_0x162f01];return _0x38e64a;};'use strict';var _=require(_0x9f44('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9f44('0x1'));var fs=require('fs');var Redis=require(_0x9f44('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x9f44('0x3'));var logger=require('../../config/logger')(_0x9f44('0x4'));var config=require(_0x9f44('0x5'));var jayson=require(_0x9f44('0x6'));var client=jayson[_0x9f44('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x121947,_0x15231a,_0xde2318){return new BPromise(function(_0x31fef8,_0x297126){return client[_0x9f44('0x8')](_0x121947,_0xde2318)['then'](function(_0x31bbb7){logger['info'](_0x9f44('0x9'),_0x15231a,'request\x20sent');logger[_0x9f44('0xa')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x15231a,_0x9f44('0xb'),JSON['stringify'](_0x31bbb7));if(_0x31bbb7[_0x9f44('0xc')]){if(_0x31bbb7[_0x9f44('0xc')][_0x9f44('0xd')]===0x1f4){logger[_0x9f44('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x15231a,_0x31bbb7[_0x9f44('0xc')][_0x9f44('0xe')]);return _0x297126(_0x31bbb7[_0x9f44('0xc')][_0x9f44('0xe')]);}logger[_0x9f44('0xc')](_0x9f44('0x9'),_0x15231a,_0x31bbb7[_0x9f44('0xc')]['message']);return _0x31fef8(_0x31bbb7[_0x9f44('0xc')]['message']);}else{logger['info'](_0x9f44('0x9'),_0x15231a,'request\x20sent');_0x31fef8(_0x31bbb7[_0x9f44('0xf')]['message']);}})['catch'](function(_0x4591bc){logger[_0x9f44('0xc')](_0x9f44('0x9'),_0x15231a,_0x4591bc);_0x297126(_0x4591bc);});});}
\ No newline at end of file
diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js
index fb427d3..ca6639e 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 _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
+var _0xa71c=['destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','/describe','describe','isAuthenticated','show','getAgents','create','post','/:id/users','addAgents','put','/:id','update','delete'];(function(_0x3132e8,_0x499a0e){var _0x43eb8c=function(_0x2321e1){while(--_0x2321e1){_0x3132e8['push'](_0x3132e8['shift']());}};_0x43eb8c(++_0x499a0e);}(_0xa71c,0x155));var _0xca71=function(_0x31d833,_0x9590c2){_0x31d833=_0x31d833-0x0;var _0x2927a2=_0xa71c[_0x31d833];return _0x2927a2;};'use strict';var multer=require(_0xca71('0x0'));var util=require(_0xca71('0x1'));var path=require(_0xca71('0x2'));var timeout=require(_0xca71('0x3'));var express=require('express');var router=express[_0xca71('0x4')]();var auth=require(_0xca71('0x5'));var interaction=require(_0xca71('0x6'));var config=require(_0xca71('0x7'));var controller=require(_0xca71('0x8'));router[_0xca71('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xca71('0x9')](_0xca71('0xa'),auth['isAuthenticated'](),controller[_0xca71('0xb')]);router[_0xca71('0x9')]('/:id',auth[_0xca71('0xc')](),controller[_0xca71('0xd')]);router[_0xca71('0x9')]('/:id/users',auth[_0xca71('0xc')](),controller[_0xca71('0xe')]);router['post']('/',auth[_0xca71('0xc')](),controller[_0xca71('0xf')]);router[_0xca71('0x10')](_0xca71('0x11'),auth['isAuthenticated'](),controller[_0xca71('0x12')]);router[_0xca71('0x13')](_0xca71('0x14'),auth[_0xca71('0xc')](),controller[_0xca71('0x15')]);router[_0xca71('0x16')](_0xca71('0x14'),auth[_0xca71('0xc')](),controller[_0xca71('0x17')]);router[_0xca71('0x16')](_0xca71('0x11'),auth[_0xca71('0xc')](),controller[_0xca71('0x18')]);module[_0xca71('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js
index 5cf1617..4a4ab92 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 _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
+var _0x4cc9=['sequelize','STRING','VIRTUAL','system-','getDataValue','name','INTEGER'];(function(_0x4d3e08,_0x535f74){var _0x3d256d=function(_0x4b09a2){while(--_0x4b09a2){_0x4d3e08['push'](_0x4d3e08['shift']());}};_0x3d256d(++_0x535f74);}(_0x4cc9,0x173));var _0x94cc=function(_0xae8b55,_0x228972){_0xae8b55=_0xae8b55-0x0;var _0x14e982=_0x4cc9[_0xae8b55];return _0x14e982;};'use strict';var Sequelize=require(_0x94cc('0x0'));module['exports']={'name':{'type':Sequelize[_0x94cc('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x94cc('0x2')],'get':function(_0x44fbff){return _0x94cc('0x3')+this[_0x94cc('0x4')](_0x94cc('0x5'))+'-';}},'description':{'type':Sequelize[_0x94cc('0x1')]},'callerIdAll':{'type':Sequelize[_0x94cc('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x94cc('0x6')]}};
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js
index cae3300..1ed9218 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 _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
+var _0x2ce2=['CDR(prefix)=','Set','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','body','system-','addAgents','ids','omit','spread','emit','userVoicePrefix:save','userVoicePrefix:remove','getAgents','findOne','User','nolimit','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','redis','localhost','./voicePrefix.socket','sendStatus','status','json','count','offset','limit','set','apply','reject','then','destroy','get','VoicePrefixes','UserProfileResource','end','error','stack','name','map','VoicePrefix','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','options','includeAll','include','findAll','rows','catch','params','merge','find','describe','create','sequelize','transaction','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','appdata','NoOp','VoicePrefixId','VoiceExtensionId','Extensions\x20creation\x20failed','prefix','push'];(function(_0x510a15,_0x10679b){var _0x283f38=function(_0x19079f){while(--_0x19079f){_0x510a15['push'](_0x510a15['shift']());}};_0x283f38(++_0x10679b);}(_0x2ce2,0xfd));var _0x22ce=function(_0x340380,_0x4bd2a8){_0x340380=_0x340380-0x0;var _0x49ce1c=_0x2ce2[_0x340380];return _0x49ce1c;};'use strict';var pdf=require(_0x22ce('0x0'));var emlformat=require(_0x22ce('0x1'));var rimraf=require(_0x22ce('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x22ce('0x3'));var rp=require(_0x22ce('0x4'));var moment=require(_0x22ce('0x5'));var BPromise=require(_0x22ce('0x6'));var Mustache=require(_0x22ce('0x7'));var util=require('util');var path=require(_0x22ce('0x8'));var sox=require(_0x22ce('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x22ce('0xa'));var squel=require(_0x22ce('0xb'));var crypto=require(_0x22ce('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x22ce('0xd'));var toCsv=require(_0x22ce('0xe'));var querystring=require('querystring');var Papa=require(_0x22ce('0xf'));var Redis=require(_0x22ce('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x22ce('0x11'));var as=require(_0x22ce('0x12'));var hardwareService=require(_0x22ce('0x13'));var logger=require(_0x22ce('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x22ce('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x22ce('0x16')],{'host':_0x22ce('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x22ce('0x16')]));require(_0x22ce('0x18'))['register'](socket);function respondWithStatusCode(_0x10ada1,_0x2b7f40){_0x2b7f40=_0x2b7f40||0xcc;return function(_0x24129e){if(_0x24129e){return _0x10ada1[_0x22ce('0x19')](_0x2b7f40);}return _0x10ada1['status'](_0x2b7f40)['end']();};}function respondWithResult(_0x498a66,_0x3077e7){_0x3077e7=_0x3077e7||0xc8;return function(_0x2710fd){if(_0x2710fd){return _0x498a66[_0x22ce('0x1a')](_0x3077e7)[_0x22ce('0x1b')](_0x2710fd);}};}function respondWithFilteredResult(_0x31b053,_0x43ebfc){return function(_0x147b3f){if(_0x147b3f){var _0x10a1e6=_0x147b3f[_0x22ce('0x1c')],_0x22492e=_0x43ebfc[_0x22ce('0x1d')],_0x235c27=_0x43ebfc[_0x22ce('0x1d')]+_0x43ebfc[_0x22ce('0x1e')],_0x3cbacc;if(_0x235c27>=_0x10a1e6){_0x235c27=_0x10a1e6;_0x3cbacc=0xc8;}else{_0x3cbacc=0xce;}_0x31b053[_0x22ce('0x1a')](_0x3cbacc);return _0x31b053[_0x22ce('0x1f')]('Content-Range',_0x22492e+'-'+_0x235c27+'/'+_0x10a1e6)[_0x22ce('0x1b')](_0x147b3f);}return null;};}function patchUpdates(_0x484c03){return function(_0x521e4d){try{jsonpatch[_0x22ce('0x20')](_0x521e4d,_0x484c03,!![]);}catch(_0x2691d0){return BPromise[_0x22ce('0x21')](_0x2691d0);}return _0x521e4d['save']();};}function saveUpdates(_0x4818ab,_0x208af0){return function(_0x2cdb2a){if(_0x2cdb2a){return _0x2cdb2a['update'](_0x4818ab)[_0x22ce('0x22')](function(_0x52e735){return _0x52e735;});}return null;};}function removeEntity(_0x479921,_0x547bf8){return function(_0x91833d){if(_0x91833d){return _0x91833d[_0x22ce('0x23')]()[_0x22ce('0x22')](function(){var _0x25e196=_0x91833d[_0x22ce('0x24')]({'plain':!![]});var _0x4fad41=_0x22ce('0x25');return db[_0x22ce('0x26')]['destroy']({'where':{'type':_0x4fad41,'resourceId':_0x25e196['id']}})['then'](function(){return _0x91833d;});})[_0x22ce('0x22')](function(){_0x479921['status'](0xcc)[_0x22ce('0x27')]();});}};}function handleEntityNotFound(_0x454a63,_0xa8e5c3){return function(_0x5c24d6){if(!_0x5c24d6){_0x454a63[_0x22ce('0x19')](0x194);}return _0x5c24d6;};}function handleError(_0x32db96,_0x3797d6){_0x3797d6=_0x3797d6||0x1f4;return function(_0xc1d94f){logger[_0x22ce('0x28')](_0xc1d94f[_0x22ce('0x29')]);if(_0xc1d94f[_0x22ce('0x2a')]){delete _0xc1d94f['name'];}_0x32db96['status'](_0x3797d6)['send'](_0xc1d94f);};}exports['index']=function(_0x4792b7,_0xfb84b3){var _0xfe7520={},_0x4883a6={},_0x8fb91f={'count':0x0,'rows':[]};var _0x2b3f2b=_[_0x22ce('0x2b')](db[_0x22ce('0x2c')][_0x22ce('0x2d')],function(_0xce4709){return{'name':_0xce4709['fieldName'],'type':_0xce4709[_0x22ce('0x2e')][_0x22ce('0x2f')]};});_0x4883a6[_0x22ce('0x30')]=_[_0x22ce('0x2b')](_0x2b3f2b,'name');_0x4883a6[_0x22ce('0x31')]=_[_0x22ce('0x32')](_0x4792b7[_0x22ce('0x31')]);_0x4883a6[_0x22ce('0x33')]=_[_0x22ce('0x34')](_0x4883a6['model'],_0x4883a6[_0x22ce('0x31')]);_0xfe7520[_0x22ce('0x35')]=_[_0x22ce('0x34')](_0x4883a6['model'],qs['fields'](_0x4792b7[_0x22ce('0x31')][_0x22ce('0x36')]));_0xfe7520[_0x22ce('0x35')]=_0xfe7520['attributes'][_0x22ce('0x37')]?_0xfe7520[_0x22ce('0x35')]:_0x4883a6['model'];if(!_0x4792b7[_0x22ce('0x31')][_0x22ce('0x38')]('nolimit')){_0xfe7520[_0x22ce('0x1e')]=qs[_0x22ce('0x1e')](_0x4792b7[_0x22ce('0x31')][_0x22ce('0x1e')]);_0xfe7520[_0x22ce('0x1d')]=qs[_0x22ce('0x1d')](_0x4792b7['query'][_0x22ce('0x1d')]);}_0xfe7520[_0x22ce('0x39')]=qs[_0x22ce('0x3a')](_0x4792b7[_0x22ce('0x31')][_0x22ce('0x3a')]);_0xfe7520[_0x22ce('0x3b')]=qs[_0x22ce('0x33')](_['pick'](_0x4792b7[_0x22ce('0x31')],_0x4883a6['filters']),_0x2b3f2b);if(_0x4792b7[_0x22ce('0x31')][_0x22ce('0x3c')]){_0xfe7520[_0x22ce('0x3b')]=_['merge'](_0xfe7520['where'],{'$or':_[_0x22ce('0x2b')](_0x2b3f2b,function(_0x2579e9){if(_0x2579e9[_0x22ce('0x2e')]!=='VIRTUAL'){var _0x5a0ac5={};_0x5a0ac5[_0x2579e9[_0x22ce('0x2a')]]={'$like':'%'+_0x4792b7[_0x22ce('0x31')][_0x22ce('0x3c')]+'%'};return _0x5a0ac5;}})});}_0xfe7520=_['merge']({},_0xfe7520,_0x4792b7[_0x22ce('0x3d')]);var _0x5ed743={'where':_0xfe7520[_0x22ce('0x3b')]};return db[_0x22ce('0x2c')][_0x22ce('0x1c')](_0x5ed743)[_0x22ce('0x22')](function(_0xab3f65){_0x8fb91f['count']=_0xab3f65;if(_0x4792b7[_0x22ce('0x31')][_0x22ce('0x3e')]){_0xfe7520[_0x22ce('0x3f')]=[{'all':!![]}];}return db[_0x22ce('0x2c')][_0x22ce('0x40')](_0xfe7520);})[_0x22ce('0x22')](function(_0x2200e2){_0x8fb91f[_0x22ce('0x41')]=_0x2200e2;return _0x8fb91f;})[_0x22ce('0x22')](respondWithFilteredResult(_0xfb84b3,_0xfe7520))[_0x22ce('0x42')](handleError(_0xfb84b3,null));};exports['show']=function(_0x3f545c,_0x3bdf2a){var _0x4bdaba={'raw':![],'where':{'id':_0x3f545c[_0x22ce('0x43')]['id']}},_0x4d7ead={};_0x4d7ead['model']=_[_0x22ce('0x32')](db['VoicePrefix'][_0x22ce('0x2d')]);_0x4d7ead[_0x22ce('0x31')]=_['keys'](_0x3f545c[_0x22ce('0x31')]);_0x4d7ead[_0x22ce('0x33')]=_[_0x22ce('0x34')](_0x4d7ead[_0x22ce('0x30')],_0x4d7ead['query']);_0x4bdaba[_0x22ce('0x35')]=_[_0x22ce('0x34')](_0x4d7ead[_0x22ce('0x30')],qs[_0x22ce('0x36')](_0x3f545c[_0x22ce('0x31')][_0x22ce('0x36')]));_0x4bdaba[_0x22ce('0x35')]=_0x4bdaba[_0x22ce('0x35')]['length']?_0x4bdaba[_0x22ce('0x35')]:_0x4d7ead[_0x22ce('0x30')];if(_0x3f545c[_0x22ce('0x31')][_0x22ce('0x3e')]){_0x4bdaba[_0x22ce('0x3f')]=[{'all':!![]}];}_0x4bdaba=_[_0x22ce('0x44')]({},_0x4bdaba,_0x3f545c[_0x22ce('0x3d')]);return db[_0x22ce('0x2c')][_0x22ce('0x45')](_0x4bdaba)[_0x22ce('0x22')](handleEntityNotFound(_0x3bdf2a,null))['then'](respondWithResult(_0x3bdf2a,null))['catch'](handleError(_0x3bdf2a,null));};exports[_0x22ce('0x23')]=function(_0x606a79,_0x375d9e){return db[_0x22ce('0x2c')][_0x22ce('0x45')]({'where':{'id':_0x606a79[_0x22ce('0x43')]['id']}})['then'](handleEntityNotFound(_0x375d9e,null))[_0x22ce('0x22')](removeEntity(_0x375d9e,null))[_0x22ce('0x42')](handleError(_0x375d9e,null));};exports[_0x22ce('0x46')]=function(_0x27f4d3,_0x164a6b){return db[_0x22ce('0x2c')][_0x22ce('0x46')]()[_0x22ce('0x22')](respondWithResult(_0x164a6b,null))[_0x22ce('0x42')](handleError(_0x164a6b,null));};exports[_0x22ce('0x47')]=function(_0x4a8877,_0x5dee63){var _0xbcf728;return db[_0x22ce('0x48')][_0x22ce('0x49')](function(_0x83224c){return db[_0x22ce('0x2c')]['create'](_0x4a8877['body'],{'transaction':_0x83224c})['then'](function(_0x158078){_0xbcf728=_0x158078[_0x22ce('0x24')]({'plain':!![]});return db[_0x22ce('0x4a')][_0x22ce('0x45')]({'where':{'id':_0xbcf728['VoiceExtensionId']},'raw':!![]})['then'](function(_0x4f8662){return createVoicePrefixExtensions(_0xbcf728,_0x4f8662,_0x83224c);});});})[_0x22ce('0x22')](function(){var _0x56d22e=_0x4a8877[_0x22ce('0x4b')]['get']({'plain':!![]});if(!_0x56d22e)throw new Error(_0x22ce('0x4c'));if(_0x56d22e[_0x22ce('0x4d')]===_0x22ce('0x4b')){var _0x5b07fc=_0xbcf728;return db[_0x22ce('0x4e')][_0x22ce('0x45')]({'where':{'name':_0x22ce('0x25'),'userProfileId':_0x56d22e[_0x22ce('0x4f')]},'raw':!![]})[_0x22ce('0x22')](function(_0x16af46){if(_0x16af46&&_0x16af46[_0x22ce('0x50')]===0x0){return db[_0x22ce('0x26')][_0x22ce('0x47')]({'name':_0x5b07fc[_0x22ce('0x2a')],'resourceId':_0x5b07fc['id'],'type':_0x16af46[_0x22ce('0x2a')],'sectionId':_0x16af46['id']},{})['then'](function(){return _0xbcf728;});}else{return _0xbcf728;}})[_0x22ce('0x42')](function(_0x218411){logger[_0x22ce('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x218411);throw _0x218411;});}return _0xbcf728;})[_0x22ce('0x22')](respondWithResult(_0x5dee63,null))[_0x22ce('0x42')](handleError(_0x5dee63,null));};function Extension(_0x190f61,_0x30f0f4,_0x2e8caa,_0x2a58a2){this[_0x22ce('0x51')]=_0x22ce('0x52');this[_0x22ce('0x53')]=_0x190f61;this[_0x22ce('0x54')]=_0x2e8caa;this[_0x22ce('0x2e')]=_0x22ce('0x55');this[_0x22ce('0x56')]=_0x22ce('0x57');this['priority']=_0x30f0f4;this[_0x22ce('0x58')]=_0x2a58a2;}function createVoicePrefixExtensions(_0x5487b3,_0x2e8ac3,_0x590beb){return new BPromise(function(_0x77884f,_0x2f7723){var _0x4206ce=new Extension(formatPrefixName(_0x5487b3['prefix']),0x1,_0x22ce('0x59'),'Voice\x20Prefix');_0x4206ce[_0x22ce('0x5a')]=_0x5487b3['id'];return db['VoiceExtension'][_0x22ce('0x47')](_0x4206ce,{'transaction':_0x590beb})[_0x22ce('0x22')](function(_0x169495){var _0x474a3b=_0x169495[_0x22ce('0x24')]({'plain':!![]});var _0x809c05=_[_0x22ce('0x2b')](addVoicePrefixExtensions(_0x5487b3,_0x2e8ac3),function(_0x23e576){_0x23e576[_0x22ce('0x5b')]=_0x474a3b['id'];_0x23e576[_0x22ce('0x5a')]=_0x5487b3['id'];return _0x23e576;});return db[_0x22ce('0x4a')]['bulkCreate'](_0x809c05,{'transaction':_0x590beb})[_0x22ce('0x22')](function(_0x2f759d){if(!_0x2f759d){return _0x2f7723(_0x22ce('0x5c'));}else{return _0x77884f(_0x2f759d);}})[_0x22ce('0x42')](function(_0x1bc23d){return _0x2f7723(_0x1bc23d);});});;});};function addVoicePrefixExtensions(_0x314d33,_0xfdd7c4){var _0xd720b8=[];var _0x4fd80c=formatPrefixName(_0x314d33[_0x22ce('0x5d')]);_0xd720b8[_0x22ce('0x5e')](new Extension(_0x4fd80c,0x2,'Set',_0x22ce('0x5f')+_0x314d33[_0x22ce('0x2a')]));if(_0x314d33['callerIdAll']){_0xd720b8[_0x22ce('0x5e')](new Extension(_0x4fd80c,0x3,_0x22ce('0x60'),'PREFIX-CALLERIDALL='+_0x314d33[_0x22ce('0x61')]));}else{_0xd720b8[_0x22ce('0x5e')](new Extension(_0x4fd80c,0x3,_0x22ce('0x59'),_0x22ce('0x62')));}_0xd720b8[_0x22ce('0x5e')](new Extension(_0x4fd80c,0x4,_0x22ce('0x63'),_0xfdd7c4[_0x22ce('0x51')]+','+_0x22ce('0x64')+(0x8+_0x314d33['name']['length'])+'}'+','+0x1));return _0xd720b8;}function formatPrefixName(_0x45a80a){var _0x306991='_';for(var _0x3eb91f=0x0;_0x3eb91f<_0x45a80a[_0x22ce('0x37')];_0x3eb91f++){if(_0x45a80a[_0x22ce('0x65')](_0x3eb91f)=='-'){_0x306991+=_0x45a80a[_0x22ce('0x65')](_0x3eb91f);}else{_0x306991+='['+_0x45a80a[_0x22ce('0x65')](_0x3eb91f)+']';}}_0x306991+='.';return _0x306991;}exports[_0x22ce('0x66')]=function(_0x127ca7,_0x19f9da,_0x31f56f){var _0x1155ef=_0x127ca7[_0x22ce('0x67')];_0x1155ef['prefix']=_0x22ce('0x68')+_0x1155ef[_0x22ce('0x2a')]+'-';return db[_0x22ce('0x48')][_0x22ce('0x49')](function(_0x296247){return db['VoicePrefix']['update'](_0x1155ef,{'where':{'id':_0x1155ef['id']},'transaction':_0x296247})[_0x22ce('0x22')](function(){return db[_0x22ce('0x4a')]['destroy']({'where':{'VoicePrefixId':_0x1155ef['id']},'transaction':_0x296247})[_0x22ce('0x22')](function(){return db[_0x22ce('0x4a')][_0x22ce('0x45')]({'where':{'id':_0x1155ef[_0x22ce('0x5b')]},'raw':!![]})[_0x22ce('0x22')](function(_0x52ebe5){return createVoicePrefixExtensions(_0x1155ef,_0x52ebe5,_0x296247);});});});})[_0x22ce('0x22')](function(){return db[_0x22ce('0x2c')]['findById'](_0x1155ef['id']);})['then'](respondWithResult(_0x19f9da,null))[_0x22ce('0x42')](handleError(_0x19f9da,null));};exports[_0x22ce('0x69')]=function(_0x31d6f7,_0x1b68f9,_0x569e72){return db['VoicePrefix'][_0x22ce('0x45')]({'where':{'id':_0x31d6f7[_0x22ce('0x43')]['id']}})[_0x22ce('0x22')](handleEntityNotFound(_0x1b68f9,null))[_0x22ce('0x22')](function(_0x46aff9){if(_0x46aff9){return _0x46aff9['addAgents'](_0x31d6f7['body'][_0x22ce('0x6a')],_[_0x22ce('0x6b')](_0x31d6f7[_0x22ce('0x67')],[_0x22ce('0x6a'),'id'])||{})[_0x22ce('0x6c')](function(_0x27d7af){for(var _0x1a2eb1=0x0;_0x1a2eb1<_0x31d6f7[_0x22ce('0x67')]['ids'][_0x22ce('0x37')];_0x1a2eb1+=0x1){socket[_0x22ce('0x6d')](_0x22ce('0x6e'),{'UserId':_0x31d6f7[_0x22ce('0x67')][_0x22ce('0x6a')][_0x1a2eb1],'VoicePrefixId':_0x31d6f7[_0x22ce('0x43')]['id']});}return _0x27d7af;});}})[_0x22ce('0x22')](respondWithResult(_0x1b68f9,null))['catch'](handleError(_0x1b68f9,null));};exports['removeAgents']=function(_0x1488fa,_0x45ff05,_0x76ac33){return db[_0x22ce('0x2c')]['find']({'where':{'id':_0x1488fa['params']['id']}})[_0x22ce('0x22')](handleEntityNotFound(_0x45ff05,null))[_0x22ce('0x22')](function(_0x477e0f){if(_0x477e0f){return _0x477e0f['removeAgents'](_0x1488fa[_0x22ce('0x31')]['ids'])[_0x22ce('0x22')](function(){if(_['isArray'](_0x1488fa['query'][_0x22ce('0x6a')])){for(var _0x5a6716=0x0;_0x5a6716<_0x1488fa[_0x22ce('0x31')][_0x22ce('0x6a')][_0x22ce('0x37')];_0x5a6716+=0x1){socket['emit'](_0x22ce('0x6f'),{'UserId':Number(_0x1488fa['query'][_0x22ce('0x6a')][_0x5a6716]),'VoicePrefixId':Number(_0x1488fa[_0x22ce('0x43')]['id'])});}}else{socket[_0x22ce('0x6d')](_0x22ce('0x6f'),{'UserId':Number(_0x1488fa[_0x22ce('0x31')][_0x22ce('0x6a')]),'VoicePrefixId':Number(_0x1488fa['params']['id'])});}});}})[_0x22ce('0x22')](respondWithStatusCode(_0x45ff05,null))[_0x22ce('0x42')](handleError(_0x45ff05,null));};exports[_0x22ce('0x70')]=function(_0xd02191,_0x2f92fb,_0x3f72c5){var _0x273215={};var _0x1e58f6={};var _0xdb0e2b;var _0x5516e5;return db[_0x22ce('0x2c')][_0x22ce('0x71')]({'where':{'id':_0xd02191[_0x22ce('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f92fb,null))[_0x22ce('0x22')](function(_0x2d14a2){if(_0x2d14a2){_0xdb0e2b=_0x2d14a2;_0x1e58f6[_0x22ce('0x30')]=_[_0x22ce('0x32')](db[_0x22ce('0x72')]['rawAttributes']);_0x1e58f6[_0x22ce('0x31')]=_[_0x22ce('0x32')](_0xd02191['query']);_0x1e58f6[_0x22ce('0x33')]=_[_0x22ce('0x34')](_0x1e58f6[_0x22ce('0x30')],_0x1e58f6[_0x22ce('0x31')]);_0x273215[_0x22ce('0x35')]=_[_0x22ce('0x34')](_0x1e58f6['model'],qs[_0x22ce('0x36')](_0xd02191['query'][_0x22ce('0x36')]));_0x273215[_0x22ce('0x35')]=_0x273215[_0x22ce('0x35')][_0x22ce('0x37')]?_0x273215[_0x22ce('0x35')]:_0x1e58f6[_0x22ce('0x30')];_0x273215[_0x22ce('0x39')]=qs['sort'](_0xd02191[_0x22ce('0x31')][_0x22ce('0x3a')]);_0x273215['where']=qs[_0x22ce('0x33')](_['pick'](_0xd02191['query'],_0x1e58f6['filters']));if(_0xd02191[_0x22ce('0x31')]['filter']){_0x273215[_0x22ce('0x3b')]=_['merge'](_0x273215[_0x22ce('0x3b')],{'$or':_[_0x22ce('0x2b')](_0x273215[_0x22ce('0x35')],function(_0x6a8642){var _0x393bf2={};_0x393bf2[_0x6a8642]={'$like':'%'+_0xd02191[_0x22ce('0x31')][_0x22ce('0x3c')]+'%'};return _0x393bf2;})});}_0x273215=_['merge']({},_0x273215,_0xd02191[_0x22ce('0x3d')]);return _0xdb0e2b[_0x22ce('0x70')](_0x273215);}})[_0x22ce('0x22')](function(_0x5ead78){if(_0x5ead78){_0x5516e5=_0x5ead78[_0x22ce('0x37')];if(!_0xd02191[_0x22ce('0x31')][_0x22ce('0x38')](_0x22ce('0x73'))){_0x273215[_0x22ce('0x1e')]=qs[_0x22ce('0x1e')](_0xd02191[_0x22ce('0x31')][_0x22ce('0x1e')]);_0x273215['offset']=qs['offset'](_0xd02191[_0x22ce('0x31')][_0x22ce('0x1d')]);}return _0xdb0e2b[_0x22ce('0x70')](_0x273215);}})[_0x22ce('0x22')](function(_0x7903d){if(_0x7903d){return _0x7903d?{'count':_0x5516e5,'rows':_0x7903d}:null;}})['then'](respondWithResult(_0x2f92fb,null))[_0x22ce('0x42')](handleError(_0x2f92fb,null));};
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js
index 17ac91a..6a24ba0 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 _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
+var _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x34e8,0x12c));var _0x834e=function(_0x13b161,_0x977373){_0x13b161=_0x13b161-0x0;var _0xab2cba=_0x34e8[_0x13b161];return _0xab2cba;};'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
diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js
index 42441e2..220beea 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 _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
+var _0xa790=['../../config/logger','moment','bluebird','path','rimraf','./voicePrefix.attributes','VoicePrefix'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa790,0x181));var _0x0a79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa790[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0a79('0x0'))('api');var moment=require(_0x0a79('0x1'));var BPromise=require(_0x0a79('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a79('0x3'));var rimraf=require(_0x0a79('0x4'));var config=require('../../config/environment');var attributes=require(_0x0a79('0x5'));module['exports']=function(_0x226b26,_0x37b7a4){return _0x226b26['define'](_0x0a79('0x6'),attributes,{'tableName':'voice_prefixes','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 60837dc..44757af 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 _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
+var _0x2c70=['VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5ce033,_0x279d25){var _0xf8dc80=function(_0xaa3ddb){while(--_0xaa3ddb){_0x5ce033['push'](_0x5ce033['shift']());}};_0xf8dc80(++_0x279d25);}(_0x2c70,0x19f));var _0x02c7=function(_0x157c7b,_0x199a92){_0x157c7b=_0x157c7b-0x0;var _0x37b43e=_0x2c70[_0x157c7b];return _0x37b43e;};'use strict';var _=require(_0x02c7('0x0'));var util=require('util');var moment=require(_0x02c7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02c7('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x02c7('0x3'))(_0x02c7('0x4'));var config=require('../../config/environment');var jayson=require(_0x02c7('0x5'));var client=jayson[_0x02c7('0x6')][_0x02c7('0x7')]({'port':0x232a});config[_0x02c7('0x8')]=_[_0x02c7('0x9')](config[_0x02c7('0x8')],{'host':_0x02c7('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02c7('0x8')]));require('./voicePrefix.socket')[_0x02c7('0xb')](socket);function respondWithRpcPromise(_0x1c9028,_0x1b1d1e,_0xc867db){return new BPromise(function(_0x2fb929,_0x504316){return client['request'](_0x1c9028,_0xc867db)[_0x02c7('0xc')](function(_0x38b03d){logger[_0x02c7('0xd')](_0x02c7('0xe'),_0x1b1d1e,_0x02c7('0xf'));logger[_0x02c7('0x10')](_0x02c7('0x11'),_0x1b1d1e,_0x02c7('0xf'),JSON[_0x02c7('0x12')](_0x38b03d));if(_0x38b03d[_0x02c7('0x13')]){if(_0x38b03d[_0x02c7('0x13')][_0x02c7('0x14')]===0x1f4){logger[_0x02c7('0x13')](_0x02c7('0xe'),_0x1b1d1e,_0x38b03d['error'][_0x02c7('0x15')]);return _0x504316(_0x38b03d[_0x02c7('0x13')][_0x02c7('0x15')]);}logger[_0x02c7('0x13')](_0x02c7('0xe'),_0x1b1d1e,_0x38b03d[_0x02c7('0x13')][_0x02c7('0x15')]);return _0x2fb929(_0x38b03d['error']['message']);}else{logger[_0x02c7('0xd')](_0x02c7('0xe'),_0x1b1d1e,_0x02c7('0xf'));_0x2fb929(_0x38b03d[_0x02c7('0x16')][_0x02c7('0x15')]);}})[_0x02c7('0x17')](function(_0x610e89){logger[_0x02c7('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x1b1d1e,_0x610e89);_0x504316(_0x610e89);});});}
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js
index 1a09f82..45ff49e 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 _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
+var _0xfe48=['register','length','voicePrefix:','./voicePrefix.events','save','update','emit','removeListener'];(function(_0xb5bd62,_0x1b6d62){var _0x2d5e4d=function(_0x450d73){while(--_0x450d73){_0xb5bd62['push'](_0xb5bd62['shift']());}};_0x2d5e4d(++_0x1b6d62);}(_0xfe48,0xcb));var _0x8fe4=function(_0x443089,_0x1e0b97){_0x443089=_0x443089-0x0;var _0xecbe89=_0xfe48[_0x443089];return _0xecbe89;};'use strict';var VoicePrefixEvents=require(_0x8fe4('0x0'));var events=[_0x8fe4('0x1'),'remove',_0x8fe4('0x2')];function createListener(_0x5e701b,_0x181a3e){return function(_0xf55789){_0x181a3e[_0x8fe4('0x3')](_0x5e701b,_0xf55789);};}function removeListener(_0x582f00,_0x16de95){return function(){VoicePrefixEvents[_0x8fe4('0x4')](_0x582f00,_0x16de95);};}exports[_0x8fe4('0x5')]=function(_0x1c2cef){for(var _0x174d7d=0x0,_0x11cd8f=events[_0x8fe4('0x6')];_0x174d7d<_0x11cd8f;_0x174d7d++){var _0xb259e0=events[_0x174d7d];var _0x148188=createListener(_0x8fe4('0x7')+_0xb259e0,_0x1c2cef);VoicePrefixEvents['on'](_0xb259e0,_0x148188);}};
\ No newline at end of file
diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js
index c21b7e6..810827d 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 _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
+var _0x6a87=['../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getAgents','/:id/members','/:id/lists','getLists','/:id/blacklists','post','/:id/clone','clone','addAgents','addLists','addBlackLists','put','/:id','update','destroy','removeTeams','/:id/users','delete','removeLists','removeBlackLists','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x426dde,_0xb910a3){var _0x43d3ec=function(_0x643340){while(--_0x643340){_0x426dde['push'](_0x426dde['shift']());}};_0x43d3ec(++_0xb910a3);}(_0x6a87,0xf0));var _0x76a8=function(_0x54a7a0,_0x27095e){_0x54a7a0=_0x54a7a0-0x0;var _0x1ea5fc=_0x6a87[_0x54a7a0];return _0x1ea5fc;};'use strict';var multer=require('multer');var util=require(_0x76a8('0x0'));var path=require(_0x76a8('0x1'));var timeout=require(_0x76a8('0x2'));var express=require(_0x76a8('0x3'));var router=express[_0x76a8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x76a8('0x5'));var config=require(_0x76a8('0x6'));var controller=require(_0x76a8('0x7'));router[_0x76a8('0x8')]('/',auth['isAuthenticated'](),controller[_0x76a8('0x9')]);router[_0x76a8('0x8')]('/:id',auth[_0x76a8('0xa')](),controller[_0x76a8('0xb')]);router[_0x76a8('0x8')](_0x76a8('0xc'),auth[_0x76a8('0xa')](),controller[_0x76a8('0xd')]);router['get'](_0x76a8('0xe'),auth[_0x76a8('0xa')](),controller[_0x76a8('0xf')]);router[_0x76a8('0x8')](_0x76a8('0x10'),auth['isAuthenticated'](),controller[_0x76a8('0x11')]);router[_0x76a8('0x8')](_0x76a8('0x12'),auth[_0x76a8('0xa')](),controller[_0x76a8('0x13')]);router[_0x76a8('0x8')](_0x76a8('0x14'),auth['isAuthenticated'](),controller['getTeams']);router[_0x76a8('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x76a8('0x15')]);router[_0x76a8('0x8')](_0x76a8('0x16'),auth[_0x76a8('0xa')](),controller['getMembers']);router['get'](_0x76a8('0x17'),auth[_0x76a8('0xa')](),controller[_0x76a8('0x18')]);router[_0x76a8('0x8')](_0x76a8('0x19'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x76a8('0x1a')](_0x76a8('0x1b'),auth[_0x76a8('0xa')](),controller[_0x76a8('0x1c')]);router[_0x76a8('0x1a')](_0x76a8('0x14'),auth[_0x76a8('0xa')](),controller['addTeams']);router[_0x76a8('0x1a')]('/:id/users',auth[_0x76a8('0xa')](),controller[_0x76a8('0x1d')]);router['post'](_0x76a8('0x17'),auth['isAuthenticated'](),controller[_0x76a8('0x1e')]);router['post'](_0x76a8('0x19'),auth['isAuthenticated'](),controller[_0x76a8('0x1f')]);router[_0x76a8('0x20')](_0x76a8('0x21'),auth['isAuthenticated'](),controller[_0x76a8('0x22')]);router['delete'](_0x76a8('0x21'),auth[_0x76a8('0xa')](),controller[_0x76a8('0x23')]);router['delete']('/:id/teams',auth[_0x76a8('0xa')](),controller[_0x76a8('0x24')]);router['delete'](_0x76a8('0x25'),auth[_0x76a8('0xa')](),controller['removeAgents']);router[_0x76a8('0x26')](_0x76a8('0x17'),auth[_0x76a8('0xa')](),controller[_0x76a8('0x27')]);router[_0x76a8('0x26')](_0x76a8('0x19'),auth[_0x76a8('0xa')](),controller[_0x76a8('0x28')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js
index e7df890..5d28292 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(_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
+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(_0x5e343c,_0x5d5c6a){var _0x497243=function(_0x49bcda){while(--_0x49bcda){_0x5e343c['push'](_0x5e343c['shift']());}};_0x497243(++_0x5d5c6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 849f9b8..4a66f14 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 _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
+var _0x646e=['ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','status','json','offset','limit','Content-Range','reject','save','update','then','get','VoiceQueues','inbound','outbound','filter','value','includes','type','find','name','UserProfileResource','destroy','end','sendStatus','stack','send','index','map','VoiceQueue','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','options','count','findAll','rows','catch','params','keys','includeAll','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','autoAssociation','getHoppers','findOne','CmHopper','pick','VoiceQueueId','getHopperHistories','CmHopperHistory','nolimit','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','each','UserVoiceQueue','isNil','format','SIP/%s','emit','userVoiceQueue:save','ids','field','tq.TeamId','from','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','TeamId','all','union','compact','transaction','removeTeams','removeAgents','UserVoiceQueueRt','addAgents','spread','isEmpty','isArray','userVoiceQueue:remove','getAgents','getMembers','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','CmListId','cm_contacts'];(function(_0x17d92b,_0x28d893){var _0x7054b6=function(_0xe55dee){while(--_0xe55dee){_0x17d92b['push'](_0x17d92b['shift']());}};_0x7054b6(++_0x28d893);}(_0x646e,0xc2));var _0xe646=function(_0x5170dc,_0x1b8cde){_0x5170dc=_0x5170dc-0x0;var _0x1dff10=_0x646e[_0x5170dc];return _0x1dff10;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe646('0x0'));var rimraf=require(_0xe646('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe646('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe646('0x3'));var Mustache=require('mustache');var util=require(_0xe646('0x4'));var path=require(_0xe646('0x5'));var sox=require(_0xe646('0x6'));var csv=require(_0xe646('0x7'));var ejs=require(_0xe646('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe646('0x9'));var crypto=require(_0xe646('0xa'));var jsforce=require(_0xe646('0xb'));var deskjs=require(_0xe646('0xc'));var toCsv=require(_0xe646('0x7'));var querystring=require(_0xe646('0xd'));var Papa=require(_0xe646('0xe'));var Redis=require(_0xe646('0xf'));var authService=require(_0xe646('0x10'));var qs=require(_0xe646('0x11'));var as=require(_0xe646('0x12'));var hardwareService=require(_0xe646('0x13'));var logger=require(_0xe646('0x14'))('api');var utils=require(_0xe646('0x15'));var config=require(_0xe646('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe646('0x17')](config[_0xe646('0x18')],{'host':_0xe646('0x19'),'port':0x18eb});var socket=require(_0xe646('0x1a'))(new Redis(config[_0xe646('0x18')]));require(_0xe646('0x1b'))[_0xe646('0x1c')](socket);function respondWithStatusCode(_0x51fc6f,_0x597e4e){_0x597e4e=_0x597e4e||0xcc;return function(_0x1aa76){if(_0x1aa76){return _0x51fc6f['sendStatus'](_0x597e4e);}return _0x51fc6f[_0xe646('0x1d')](_0x597e4e)['end']();};}function respondWithResult(_0x1e48c8,_0x454db5){_0x454db5=_0x454db5||0xc8;return function(_0x9112b5){if(_0x9112b5){return _0x1e48c8[_0xe646('0x1d')](_0x454db5)[_0xe646('0x1e')](_0x9112b5);}};}function respondWithFilteredResult(_0xbf4e41,_0x3980aa){return function(_0x28fb04){if(_0x28fb04){var _0x4394ea=_0x28fb04['count'],_0x4589f7=_0x3980aa[_0xe646('0x1f')],_0x119bdd=_0x3980aa[_0xe646('0x1f')]+_0x3980aa[_0xe646('0x20')],_0x453da7;if(_0x119bdd>=_0x4394ea){_0x119bdd=_0x4394ea;_0x453da7=0xc8;}else{_0x453da7=0xce;}_0xbf4e41[_0xe646('0x1d')](_0x453da7);return _0xbf4e41['set'](_0xe646('0x21'),_0x4589f7+'-'+_0x119bdd+'/'+_0x4394ea)[_0xe646('0x1e')](_0x28fb04);}return null;};}function patchUpdates(_0x37d0cd){return function(_0x4ff5da){try{jsonpatch['apply'](_0x4ff5da,_0x37d0cd,!![]);}catch(_0x4d0ff4){return BPromise[_0xe646('0x22')](_0x4d0ff4);}return _0x4ff5da[_0xe646('0x23')]();};}function saveUpdates(_0x481788,_0x1cabad){return function(_0x43cc00){if(_0x43cc00){return _0x43cc00[_0xe646('0x24')](_0x481788)[_0xe646('0x25')](function(_0x3179b3){return _0x3179b3;});}return null;};}function removeEntity(_0x51dee7,_0x18d727){return function(_0x2e893b){if(_0x2e893b){return _0x2e893b['destroy']()['then'](function(){var _0x4c11dd=_0x2e893b[_0xe646('0x26')]({'plain':!![]});var _0x232857=[{'name':_0xe646('0x27'),'value':_0xe646('0x28'),'ignore':![]},{'name':'QueueCampaigns','value':_0xe646('0x29'),'ignore':![]}];var _0x5a5060=_(_0x232857)[_0xe646('0x2a')]('ignore')['map'](_0xe646('0x2b'))['value']();if(_[_0xe646('0x2c')](_0x5a5060,_0x4c11dd[_0xe646('0x2d')])){return;}var _0x46b226=_[_0xe646('0x2e')](_0x232857,[_0xe646('0x2b'),_0x4c11dd[_0xe646('0x2d')]])[_0xe646('0x2f')];return db[_0xe646('0x30')][_0xe646('0x31')]({'where':{'type':_0x46b226,'resourceId':_0x4c11dd['id']}})[_0xe646('0x25')](function(){return _0x2e893b;});})[_0xe646('0x25')](function(){_0x51dee7[_0xe646('0x1d')](0xcc)[_0xe646('0x32')]();});}};}function handleEntityNotFound(_0x351ac7,_0x168908){return function(_0x49e4c5){if(!_0x49e4c5){_0x351ac7[_0xe646('0x33')](0x194);}return _0x49e4c5;};}function handleError(_0x45ab51,_0x4e2475){_0x4e2475=_0x4e2475||0x1f4;return function(_0x16167b){logger['error'](_0x16167b[_0xe646('0x34')]);if(_0x16167b[_0xe646('0x2f')]){delete _0x16167b[_0xe646('0x2f')];}_0x45ab51[_0xe646('0x1d')](_0x4e2475)[_0xe646('0x35')](_0x16167b);};}exports[_0xe646('0x36')]=function(_0x2e431e,_0x57c618){var _0x39744e={},_0x58b12e={},_0x53fcb9={'count':0x0,'rows':[]};var _0x31e665=_[_0xe646('0x37')](db[_0xe646('0x38')][_0xe646('0x39')],function(_0x4a7563){return{'name':_0x4a7563[_0xe646('0x3a')],'type':_0x4a7563[_0xe646('0x2d')][_0xe646('0x3b')]};});_0x58b12e[_0xe646('0x3c')]=_['map'](_0x31e665,_0xe646('0x2f'));_0x58b12e[_0xe646('0x3d')]=_['keys'](_0x2e431e[_0xe646('0x3d')]);_0x58b12e[_0xe646('0x3e')]=_[_0xe646('0x3f')](_0x58b12e[_0xe646('0x3c')],_0x58b12e[_0xe646('0x3d')]);_0x39744e[_0xe646('0x40')]=_['intersection'](_0x58b12e[_0xe646('0x3c')],qs[_0xe646('0x41')](_0x2e431e['query'][_0xe646('0x41')]));_0x39744e[_0xe646('0x40')]=_0x39744e[_0xe646('0x40')][_0xe646('0x42')]?_0x39744e['attributes']:_0x58b12e[_0xe646('0x3c')];if(!_0x2e431e['query'][_0xe646('0x43')]('nolimit')){_0x39744e['limit']=qs[_0xe646('0x20')](_0x2e431e['query'][_0xe646('0x20')]);_0x39744e[_0xe646('0x1f')]=qs[_0xe646('0x1f')](_0x2e431e[_0xe646('0x3d')]['offset']);}_0x39744e[_0xe646('0x44')]=qs[_0xe646('0x45')](_0x2e431e[_0xe646('0x3d')][_0xe646('0x45')]);_0x39744e[_0xe646('0x46')]=qs['filters'](_['pick'](_0x2e431e['query'],_0x58b12e[_0xe646('0x3e')]),_0x31e665);if(_0x2e431e['query'][_0xe646('0x2a')]){_0x39744e[_0xe646('0x46')]=_['merge'](_0x39744e[_0xe646('0x46')],{'$or':_[_0xe646('0x37')](_0x31e665,function(_0x2a3e9a){if(_0x2a3e9a[_0xe646('0x2d')]!==_0xe646('0x47')){var _0x28ece0={};_0x28ece0[_0x2a3e9a[_0xe646('0x2f')]]={'$like':'%'+_0x2e431e[_0xe646('0x3d')][_0xe646('0x2a')]+'%'};return _0x28ece0;}})});}_0x39744e=_['merge']({},_0x39744e,_0x2e431e[_0xe646('0x48')]);var _0x461e42={'where':_0x39744e['where']};return db[_0xe646('0x38')][_0xe646('0x49')](_0x461e42)['then'](function(_0x264db4){_0x53fcb9[_0xe646('0x49')]=_0x264db4;if(_0x2e431e['query']['includeAll']){_0x39744e['include']=[{'all':!![]}];}return db[_0xe646('0x38')][_0xe646('0x4a')](_0x39744e);})[_0xe646('0x25')](function(_0x50a3ba){_0x53fcb9[_0xe646('0x4b')]=_0x50a3ba;return _0x53fcb9;})[_0xe646('0x25')](respondWithFilteredResult(_0x57c618,_0x39744e))[_0xe646('0x4c')](handleError(_0x57c618,null));};exports['show']=function(_0x282512,_0x3192a1){var _0x226b89={'raw':![],'where':{'id':_0x282512[_0xe646('0x4d')]['id']}},_0x4f0fe6={};_0x4f0fe6[_0xe646('0x3c')]=_[_0xe646('0x4e')](db[_0xe646('0x38')][_0xe646('0x39')]);_0x4f0fe6['query']=_[_0xe646('0x4e')](_0x282512[_0xe646('0x3d')]);_0x4f0fe6['filters']=_[_0xe646('0x3f')](_0x4f0fe6[_0xe646('0x3c')],_0x4f0fe6[_0xe646('0x3d')]);_0x226b89['attributes']=_[_0xe646('0x3f')](_0x4f0fe6[_0xe646('0x3c')],qs['fields'](_0x282512['query'][_0xe646('0x41')]));_0x226b89[_0xe646('0x40')]=_0x226b89[_0xe646('0x40')]['length']?_0x226b89['attributes']:_0x4f0fe6['model'];if(_0x282512['query'][_0xe646('0x4f')]){_0x226b89['include']=[{'all':!![]}];}_0x226b89=_[_0xe646('0x50')]({},_0x226b89,_0x282512[_0xe646('0x48')]);return db[_0xe646('0x38')][_0xe646('0x2e')](_0x226b89)[_0xe646('0x25')](handleEntityNotFound(_0x3192a1,null))[_0xe646('0x25')](respondWithResult(_0x3192a1,null))[_0xe646('0x4c')](handleError(_0x3192a1,null));};exports[_0xe646('0x51')]=function(_0xe5321d,_0x5e17eb){return db[_0xe646('0x38')][_0xe646('0x51')](_0xe5321d[_0xe646('0x52')],{})[_0xe646('0x25')](function(_0x4b5a18){var _0x485848=_0xe5321d[_0xe646('0x53')][_0xe646('0x26')]({'plain':!![]});if(!_0x485848)throw new Error(_0xe646('0x54'));if(_0x485848[_0xe646('0x55')]===_0xe646('0x53')){var _0x47a231=_0x4b5a18[_0xe646('0x26')]({'plain':!![]});var _0x7a4847=[{'name':_0xe646('0x27'),'value':_0xe646('0x28')},{'name':_0xe646('0x56'),'value':_0xe646('0x29')}];var _0x3c0dd1=_['find'](_0x7a4847,[_0xe646('0x2b'),_0x47a231[_0xe646('0x2d')]])[_0xe646('0x2f')];return db[_0xe646('0x57')][_0xe646('0x2e')]({'where':{'name':_0x3c0dd1,'userProfileId':_0x485848[_0xe646('0x58')]},'raw':!![]})[_0xe646('0x25')](function(_0x52051b){if(_0x52051b&&_0x52051b['autoAssociation']===0x0){return db[_0xe646('0x30')]['create']({'name':_0x47a231['name'],'resourceId':_0x47a231['id'],'type':_0x52051b[_0xe646('0x2f')],'sectionId':_0x52051b['id']},{})[_0xe646('0x25')](function(){return _0x4b5a18;});}else{return _0x4b5a18;}})['catch'](function(_0x49b814){logger[_0xe646('0x59')](_0xe646('0x5a'),_0x49b814);throw _0x49b814;});}return _0x4b5a18;})[_0xe646('0x25')](respondWithResult(_0x5e17eb,0xc9))[_0xe646('0x4c')](handleError(_0x5e17eb,null));};exports[_0xe646('0x5b')]=function(_0x17071d,_0x327d4d){var _0x1b1cbb={'where':{'id':_0x17071d[_0xe646('0x4d')]['id']}},_0x561188={};_0x561188['model']=_[_0xe646('0x4e')](db[_0xe646('0x38')][_0xe646('0x39')]);_0x1b1cbb[_0xe646('0x40')]=_[_0xe646('0x3f')](_0x561188['model'],qs[_0xe646('0x41')](_0x17071d[_0xe646('0x3d')][_0xe646('0x41')]));_0x1b1cbb[_0xe646('0x40')]=_0x1b1cbb['attributes']['length']?_0x1b1cbb[_0xe646('0x40')]:_0x561188[_0xe646('0x3c')];if(_0x17071d[_0xe646('0x3d')][_0xe646('0x4f')]){_0x1b1cbb[_0xe646('0x5c')]=[{'all':!![]}];}_0x1b1cbb=_[_0xe646('0x50')]({},_0x1b1cbb,_0x17071d['options']);return db[_0xe646('0x38')][_0xe646('0x2e')](_0x1b1cbb)['then'](handleEntityNotFound(_0x327d4d,null))[_0xe646('0x25')](function(_0x265f66){if(_0x265f66){var _0x377819=_0x265f66[_0xe646('0x26')]({'plain':!![]});_0x377819=qs[_0xe646('0x5d')](_0x377819,['id',_0xe646('0x5e'),_0xe646('0x5f')]);_0x17071d['body']=_[_0xe646('0x5d')](_0x17071d['body'],['id',_0xe646('0x5e'),_0xe646('0x5f')]);return db['VoiceQueue']['create'](_['merge'](_0x377819,_0x17071d[_0xe646('0x52')]),{'include':_0x17071d[_0xe646('0x3d')]['includeAll']?[{'all':!![]}]:undefined})[_0xe646('0x25')](function(_0x5bb9c2){var _0x4f7e30=_0x17071d[_0xe646('0x53')]['get']({'plain':!![]});if(!_0x4f7e30)throw new Error(_0xe646('0x54'));if(_0x4f7e30['role']==='user'){var _0x4179ca=_0x5bb9c2[_0xe646('0x26')]({'plain':!![]});var _0x307e74=[{'name':'VoiceQueues','value':_0xe646('0x28')},{'name':_0xe646('0x56'),'value':_0xe646('0x29')}];var _0x33c4e9=_[_0xe646('0x2e')](_0x307e74,[_0xe646('0x2b'),_0x4179ca[_0xe646('0x2d')]])[_0xe646('0x2f')];return db[_0xe646('0x57')]['find']({'where':{'name':_0x33c4e9,'userProfileId':_0x4f7e30[_0xe646('0x58')]},'raw':!![]})[_0xe646('0x25')](function(_0x13c5e4){if(_0x13c5e4&&_0x13c5e4[_0xe646('0x60')]===0x0){return db[_0xe646('0x30')][_0xe646('0x51')]({'name':_0x4179ca[_0xe646('0x2f')],'resourceId':_0x4179ca['id'],'type':_0x13c5e4[_0xe646('0x2f')],'sectionId':_0x13c5e4['id']},{})[_0xe646('0x25')](function(){return _0x5bb9c2;});}else{return _0x5bb9c2;}})[_0xe646('0x4c')](function(_0x8e5c08){logger['error'](_0xe646('0x5a'),_0x8e5c08);throw _0x8e5c08;});}return _0x5bb9c2;});}})['then'](respondWithResult(_0x327d4d,0xc9))[_0xe646('0x4c')](handleError(_0x327d4d,null));};exports[_0xe646('0x24')]=function(_0x955356,_0x2b5ef0){if(_0x955356[_0xe646('0x52')]['id']){delete _0x955356['body']['id'];}return db[_0xe646('0x38')][_0xe646('0x2e')]({'where':{'id':_0x955356['params']['id']}})['then'](handleEntityNotFound(_0x2b5ef0,null))[_0xe646('0x25')](saveUpdates(_0x955356[_0xe646('0x52')],null))[_0xe646('0x25')](respondWithResult(_0x2b5ef0,null))[_0xe646('0x4c')](handleError(_0x2b5ef0,null));};exports[_0xe646('0x31')]=function(_0x211624,_0x28879b){return db[_0xe646('0x38')][_0xe646('0x2e')]({'where':{'id':_0x211624['params']['id']}})['then'](handleEntityNotFound(_0x28879b,null))[_0xe646('0x25')](removeEntity(_0x28879b,null))[_0xe646('0x4c')](handleError(_0x28879b,null));};exports[_0xe646('0x61')]=function(_0xfb4e69,_0x47e4e5,_0x1a19d0){var _0xe1ad7={'raw':![],'where':{}};var _0x159c16={};var _0x4c8944={'count':0x0,'rows':[]};return db[_0xe646('0x38')][_0xe646('0x62')]({'where':{'id':_0xfb4e69[_0xe646('0x4d')]['id']}})[_0xe646('0x25')](handleEntityNotFound(_0x47e4e5,null))[_0xe646('0x25')](function(_0x56afba){if(_0x56afba){_0x159c16[_0xe646('0x3c')]=_[_0xe646('0x4e')](db[_0xe646('0x63')][_0xe646('0x39')]);_0x159c16[_0xe646('0x3d')]=_[_0xe646('0x4e')](_0xfb4e69[_0xe646('0x3d')]);_0x159c16[_0xe646('0x3e')]=_['intersection'](_0x159c16[_0xe646('0x3c')],_0x159c16['query']);_0xe1ad7[_0xe646('0x40')]=_[_0xe646('0x3f')](_0x159c16[_0xe646('0x3c')],qs[_0xe646('0x41')](_0xfb4e69[_0xe646('0x3d')][_0xe646('0x41')]));_0xe1ad7[_0xe646('0x40')]=_0xe1ad7[_0xe646('0x40')][_0xe646('0x42')]?_0xe1ad7[_0xe646('0x40')]:_0x159c16[_0xe646('0x3c')];if(!_0xfb4e69[_0xe646('0x3d')][_0xe646('0x43')]('nolimit')){_0xe1ad7[_0xe646('0x20')]=qs[_0xe646('0x20')](_0xfb4e69[_0xe646('0x3d')][_0xe646('0x20')]);_0xe1ad7[_0xe646('0x1f')]=qs[_0xe646('0x1f')](_0xfb4e69[_0xe646('0x3d')][_0xe646('0x1f')]);}_0xe1ad7[_0xe646('0x44')]=qs[_0xe646('0x45')](_0xfb4e69[_0xe646('0x3d')]['sort']);_0xe1ad7[_0xe646('0x46')]=qs[_0xe646('0x3e')](_[_0xe646('0x64')](_0xfb4e69[_0xe646('0x3d')],_0x159c16[_0xe646('0x3e')]));_0xe1ad7[_0xe646('0x46')][_0xe646('0x65')]=_0x56afba['id'];if(_0xfb4e69[_0xe646('0x3d')][_0xe646('0x2a')]){_0xe1ad7['where']=_[_0xe646('0x50')](_0xe1ad7[_0xe646('0x46')],{'$or':_[_0xe646('0x37')](_0xe1ad7[_0xe646('0x40')],function(_0x20e6ab){var _0x24d065={};_0x24d065[_0x20e6ab]={'$like':'%'+_0xfb4e69[_0xe646('0x3d')][_0xe646('0x2a')]+'%'};return _0x24d065;})});}_0xe1ad7=_['merge']({},_0xe1ad7,_0xfb4e69[_0xe646('0x48')]);return db[_0xe646('0x63')][_0xe646('0x49')]({'where':_0xe1ad7[_0xe646('0x46')]})['then'](function(_0x5030f2){_0x4c8944[_0xe646('0x49')]=_0x5030f2;if(_0xfb4e69[_0xe646('0x3d')][_0xe646('0x4f')]){_0xe1ad7['include']=[{'all':!![]}];}return db['CmHopper'][_0xe646('0x4a')](_0xe1ad7);})['then'](function(_0x195700){_0x4c8944[_0xe646('0x4b')]=_0x195700;return _0x4c8944;});}})[_0xe646('0x25')](respondWithFilteredResult(_0x47e4e5,_0xe1ad7))[_0xe646('0x4c')](handleError(_0x47e4e5,null));};exports[_0xe646('0x66')]=function(_0x31e34d,_0x3ec453,_0x5a3264){var _0x383f81={'raw':!![],'where':{}};var _0x1e5ded={};var _0x3899c2={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xe646('0x62')]({'where':{'id':_0x31e34d[_0xe646('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3ec453,null))['then'](function(_0x574bab){if(_0x574bab){_0x1e5ded['model']=_[_0xe646('0x4e')](db[_0xe646('0x67')][_0xe646('0x39')]);_0x1e5ded[_0xe646('0x3d')]=_[_0xe646('0x4e')](_0x31e34d['query']);_0x1e5ded[_0xe646('0x3e')]=_[_0xe646('0x3f')](_0x1e5ded[_0xe646('0x3c')],_0x1e5ded[_0xe646('0x3d')]);_0x383f81[_0xe646('0x40')]=_[_0xe646('0x3f')](_0x1e5ded[_0xe646('0x3c')],qs[_0xe646('0x41')](_0x31e34d[_0xe646('0x3d')]['fields']));_0x383f81[_0xe646('0x40')]=_0x383f81['attributes'][_0xe646('0x42')]?_0x383f81[_0xe646('0x40')]:_0x1e5ded[_0xe646('0x3c')];if(!_0x31e34d[_0xe646('0x3d')][_0xe646('0x43')]('nolimit')){_0x383f81[_0xe646('0x20')]=qs[_0xe646('0x20')](_0x31e34d[_0xe646('0x3d')][_0xe646('0x20')]);_0x383f81[_0xe646('0x1f')]=qs['offset'](_0x31e34d[_0xe646('0x3d')][_0xe646('0x1f')]);}_0x383f81['order']=qs[_0xe646('0x45')](_0x31e34d['query'][_0xe646('0x45')]);_0x383f81[_0xe646('0x46')]=qs['filters'](_['pick'](_0x31e34d['query'],_0x1e5ded[_0xe646('0x3e')]));_0x383f81[_0xe646('0x46')][_0xe646('0x65')]=_0x574bab['id'];if(_0x31e34d[_0xe646('0x3d')][_0xe646('0x2a')]){_0x383f81['where']=_['merge'](_0x383f81['where'],{'$or':_[_0xe646('0x37')](_0x383f81[_0xe646('0x40')],function(_0x16873d){var _0x449c03={};_0x449c03[_0x16873d]={'$like':'%'+_0x31e34d['query'][_0xe646('0x2a')]+'%'};return _0x449c03;})});}_0x383f81=_[_0xe646('0x50')]({},_0x383f81,_0x31e34d['options']);return db[_0xe646('0x67')][_0xe646('0x49')]({'where':_0x383f81[_0xe646('0x46')]})['then'](function(_0x59a6db){_0x3899c2[_0xe646('0x49')]=_0x59a6db;if(_0x31e34d['query'][_0xe646('0x4f')]){_0x383f81[_0xe646('0x5c')]=[{'all':!![]}];}return db[_0xe646('0x67')][_0xe646('0x4a')](_0x383f81);})['then'](function(_0x3e2294){_0x3899c2[_0xe646('0x4b')]=_0x3e2294;return _0x3899c2;});}})[_0xe646('0x25')](respondWithFilteredResult(_0x3ec453,_0x383f81))[_0xe646('0x4c')](handleError(_0x3ec453,null));};exports['getHopperFinals']=function(_0x44952b,_0x5527c2,_0x4176a9){var _0x1bd09e={'raw':!![],'where':{}};var _0x380271={};var _0x44411b={'count':0x0,'rows':[]};return db[_0xe646('0x38')]['findOne']({'where':{'id':_0x44952b[_0xe646('0x4d')]['id']}})[_0xe646('0x25')](handleEntityNotFound(_0x5527c2,null))['then'](function(_0x3cbfff){if(_0x3cbfff){_0x380271[_0xe646('0x3c')]=_[_0xe646('0x4e')](db['CmHopperFinal'][_0xe646('0x39')]);_0x380271[_0xe646('0x3d')]=_[_0xe646('0x4e')](_0x44952b[_0xe646('0x3d')]);_0x380271[_0xe646('0x3e')]=_[_0xe646('0x3f')](_0x380271[_0xe646('0x3c')],_0x380271[_0xe646('0x3d')]);_0x1bd09e[_0xe646('0x40')]=_['intersection'](_0x380271['model'],qs['fields'](_0x44952b[_0xe646('0x3d')][_0xe646('0x41')]));_0x1bd09e[_0xe646('0x40')]=_0x1bd09e['attributes'][_0xe646('0x42')]?_0x1bd09e[_0xe646('0x40')]:_0x380271[_0xe646('0x3c')];if(!_0x44952b[_0xe646('0x3d')][_0xe646('0x43')](_0xe646('0x68'))){_0x1bd09e[_0xe646('0x20')]=qs[_0xe646('0x20')](_0x44952b[_0xe646('0x3d')][_0xe646('0x20')]);_0x1bd09e['offset']=qs[_0xe646('0x1f')](_0x44952b[_0xe646('0x3d')][_0xe646('0x1f')]);}_0x1bd09e[_0xe646('0x44')]=qs[_0xe646('0x45')](_0x44952b[_0xe646('0x3d')]['sort']);_0x1bd09e[_0xe646('0x46')]=qs[_0xe646('0x3e')](_[_0xe646('0x64')](_0x44952b[_0xe646('0x3d')],_0x380271[_0xe646('0x3e')]));_0x1bd09e[_0xe646('0x46')][_0xe646('0x65')]=_0x3cbfff['id'];if(_0x44952b['query']['filter']){_0x1bd09e[_0xe646('0x46')]=_[_0xe646('0x50')](_0x1bd09e[_0xe646('0x46')],{'$or':_[_0xe646('0x37')](_0x1bd09e[_0xe646('0x40')],function(_0x20eba7){var _0x5791bc={};_0x5791bc[_0x20eba7]={'$like':'%'+_0x44952b[_0xe646('0x3d')][_0xe646('0x2a')]+'%'};return _0x5791bc;})});}_0x1bd09e=_[_0xe646('0x50')]({},_0x1bd09e,_0x44952b['options']);return db[_0xe646('0x69')][_0xe646('0x49')]({'where':_0x1bd09e['where']})[_0xe646('0x25')](function(_0x51fa39){_0x44411b[_0xe646('0x49')]=_0x51fa39;if(_0x44952b['query'][_0xe646('0x4f')]){_0x1bd09e[_0xe646('0x5c')]=[{'all':!![]}];}return db[_0xe646('0x69')][_0xe646('0x4a')](_0x1bd09e);})[_0xe646('0x25')](function(_0x47ee02){_0x44411b[_0xe646('0x4b')]=_0x47ee02;return _0x44411b;});}})[_0xe646('0x25')](respondWithFilteredResult(_0x5527c2,_0x1bd09e))[_0xe646('0x4c')](handleError(_0x5527c2,null));};exports['getHopperBlacks']=function(_0x6f54ab,_0x3acf87,_0x13500b){var _0x52a504={'raw':!![],'where':{}};var _0x61705f={};var _0x299f98={'count':0x0,'rows':[]};return db[_0xe646('0x38')]['findOne']({'where':{'id':_0x6f54ab[_0xe646('0x4d')]['id']}})[_0xe646('0x25')](handleEntityNotFound(_0x3acf87,null))[_0xe646('0x25')](function(_0xaf7804){if(_0xaf7804){_0x61705f[_0xe646('0x3c')]=_['keys'](db[_0xe646('0x6a')][_0xe646('0x39')]);_0x61705f[_0xe646('0x3d')]=_[_0xe646('0x4e')](_0x6f54ab[_0xe646('0x3d')]);_0x61705f['filters']=_[_0xe646('0x3f')](_0x61705f[_0xe646('0x3c')],_0x61705f[_0xe646('0x3d')]);_0x52a504[_0xe646('0x40')]=_['intersection'](_0x61705f[_0xe646('0x3c')],qs[_0xe646('0x41')](_0x6f54ab[_0xe646('0x3d')]['fields']));_0x52a504[_0xe646('0x40')]=_0x52a504[_0xe646('0x40')][_0xe646('0x42')]?_0x52a504[_0xe646('0x40')]:_0x61705f[_0xe646('0x3c')];if(!_0x6f54ab['query'][_0xe646('0x43')]('nolimit')){_0x52a504['limit']=qs[_0xe646('0x20')](_0x6f54ab[_0xe646('0x3d')][_0xe646('0x20')]);_0x52a504[_0xe646('0x1f')]=qs[_0xe646('0x1f')](_0x6f54ab[_0xe646('0x3d')]['offset']);}_0x52a504[_0xe646('0x44')]=qs[_0xe646('0x45')](_0x6f54ab[_0xe646('0x3d')]['sort']);_0x52a504[_0xe646('0x46')]=qs[_0xe646('0x3e')](_[_0xe646('0x64')](_0x6f54ab['query'],_0x61705f['filters']));_0x52a504['where'][_0xe646('0x65')]=_0xaf7804['id'];if(_0x6f54ab[_0xe646('0x3d')][_0xe646('0x2a')]){_0x52a504[_0xe646('0x46')]=_[_0xe646('0x50')](_0x52a504['where'],{'$or':_['map'](_0x52a504[_0xe646('0x40')],function(_0x104269){var _0x58bfa8={};_0x58bfa8[_0x104269]={'$like':'%'+_0x6f54ab[_0xe646('0x3d')][_0xe646('0x2a')]+'%'};return _0x58bfa8;})});}_0x52a504=_['merge']({},_0x52a504,_0x6f54ab[_0xe646('0x48')]);return db['CmHopperBlack'][_0xe646('0x49')]({'where':_0x52a504[_0xe646('0x46')]})[_0xe646('0x25')](function(_0x8cfb91){_0x299f98['count']=_0x8cfb91;if(_0x6f54ab[_0xe646('0x3d')][_0xe646('0x4f')]){_0x52a504['include']=[{'all':!![]}];}return db[_0xe646('0x6a')][_0xe646('0x4a')](_0x52a504);})['then'](function(_0x18e62a){_0x299f98[_0xe646('0x4b')]=_0x18e62a;return _0x299f98;});}})[_0xe646('0x25')](respondWithFilteredResult(_0x3acf87,_0x52a504))[_0xe646('0x4c')](handleError(_0x3acf87,null));};exports[_0xe646('0x6b')]=function(_0x3c9ea5,_0x4f2124,_0x5a5408){var _0x334e69={};var _0xe1ce43={};var _0x3054d4;var _0x580dd2;return db[_0xe646('0x38')][_0xe646('0x62')]({'where':{'id':_0x3c9ea5[_0xe646('0x4d')]['id']}})[_0xe646('0x25')](handleEntityNotFound(_0x4f2124,null))[_0xe646('0x25')](function(_0x226392){if(_0x226392){_0x3054d4=_0x226392;_0xe1ce43['model']=_[_0xe646('0x4e')](db[_0xe646('0x6c')][_0xe646('0x39')]);_0xe1ce43[_0xe646('0x3d')]=_[_0xe646('0x4e')](_0x3c9ea5[_0xe646('0x3d')]);_0xe1ce43[_0xe646('0x3e')]=_['intersection'](_0xe1ce43['model'],_0xe1ce43[_0xe646('0x3d')]);_0x334e69[_0xe646('0x40')]=_[_0xe646('0x3f')](_0xe1ce43[_0xe646('0x3c')],qs[_0xe646('0x41')](_0x3c9ea5[_0xe646('0x3d')]['fields']));_0x334e69[_0xe646('0x40')]=_0x334e69[_0xe646('0x40')][_0xe646('0x42')]?_0x334e69['attributes']:_0xe1ce43['model'];_0x334e69[_0xe646('0x44')]=qs[_0xe646('0x45')](_0x3c9ea5['query'][_0xe646('0x45')]);_0x334e69['where']=qs[_0xe646('0x3e')](_[_0xe646('0x64')](_0x3c9ea5[_0xe646('0x3d')],_0xe1ce43['filters']));if(_0x3c9ea5[_0xe646('0x3d')][_0xe646('0x2a')]){_0x334e69[_0xe646('0x46')]=_[_0xe646('0x50')](_0x334e69[_0xe646('0x46')],{'$or':_['map'](_0x334e69[_0xe646('0x40')],function(_0x37559c){var _0x1f4b67={};_0x1f4b67[_0x37559c]={'$like':'%'+_0x3c9ea5['query'][_0xe646('0x2a')]+'%'};return _0x1f4b67;})});}_0x334e69=_[_0xe646('0x50')]({},_0x334e69,_0x3c9ea5[_0xe646('0x48')]);return _0x3054d4[_0xe646('0x6b')](_0x334e69);}})[_0xe646('0x25')](function(_0x39e359){if(_0x39e359){_0x580dd2=_0x39e359[_0xe646('0x42')];if(!_0x3c9ea5[_0xe646('0x3d')][_0xe646('0x43')](_0xe646('0x68'))){_0x334e69[_0xe646('0x20')]=qs[_0xe646('0x20')](_0x3c9ea5['query'][_0xe646('0x20')]);_0x334e69[_0xe646('0x1f')]=qs[_0xe646('0x1f')](_0x3c9ea5[_0xe646('0x3d')][_0xe646('0x1f')]);}return _0x3054d4[_0xe646('0x6b')](_0x334e69);}})[_0xe646('0x25')](function(_0xf38c98){if(_0xf38c98){return _0xf38c98?{'count':_0x580dd2,'rows':_0xf38c98}:null;}})[_0xe646('0x25')](respondWithResult(_0x4f2124,null))[_0xe646('0x4c')](handleError(_0x4f2124,null));};exports[_0xe646('0x6d')]=function(_0x33e3f4,_0xf7442c,_0x5a5b5a){var _0x2ba79b=_0x33e3f4[_0xe646('0x52')][_0xe646('0x6e')];var _0x4f37de=_['map'](_0x2ba79b,'id');return db[_0xe646('0x6c')][_0xe646('0x4a')]({'where':{'id':_0x4f37de},'attributes':['id'],'include':[{'model':db[_0xe646('0x6f')],'as':_0xe646('0x70'),'attributes':['id',_0xe646('0x2f'),_0xe646('0x71'),_0xe646('0x72'),_0xe646('0x73')],'raw':!![]}]})[_0xe646('0x25')](function(_0x523bf3){if(_0x523bf3){var _0x57682e=_[_0xe646('0x74')](_0x523bf3,function(_0x55abed){var _0x2caef4=_0x55abed[_0xe646('0x26')]({'plain':!![]});_0x2caef4[_0xe646('0x70')][_0xe646('0x75')](function(_0x4d054b){_0x4d054b[_0xe646('0x76')]=_[_0xe646('0x2e')](_0x2ba79b,{'id':_0x2caef4['id']})[_0xe646('0x76')];});return _0x2caef4['Agents'];});return db[_0xe646('0x38')][_0xe646('0x2e')]({'where':{'id':_0x33e3f4[_0xe646('0x4d')]['id']}})[_0xe646('0x25')](function(_0x3bc07e){return db['sequelize']['transaction'](function(_0x3ed24b){return _0x3bc07e[_0xe646('0x6d')](_0x4f37de,{'transaction':_0x3ed24b})[_0xe646('0x25')](function(){return BPromise[_0xe646('0x77')](_0x57682e,function(_0x998fd9){return db[_0xe646('0x78')]['findOrCreate']({'where':{'UserId':_0x998fd9['id'],'VoiceQueueId':_0x33e3f4[_0xe646('0x4d')]['id']},'defaults':{'penalty':_0x998fd9[_0xe646('0x76')]},'transaction':_0x3ed24b});});})[_0xe646('0x25')](function(){return BPromise['each'](_[_0xe646('0x2a')](_0x57682e,{'online':!![]}),function(_0xdede8c){return db['UserVoiceQueueRt']['upsert']({'membername':_0xdede8c['name'],'UserId':_0xdede8c['id'],'queue_name':_0x3bc07e[_0xe646('0x2f')],'VoiceQueueId':_0x3bc07e['id'],'interface':_[_0xe646('0x79')](_0xdede8c['interface'])?util[_0xe646('0x7a')](_0xe646('0x7b'),_0xdede8c[_0xe646('0x2f')]):_0xdede8c[_0xe646('0x73')],'paused':_0xdede8c['voicePause']||![],'penalty':_0xdede8c['penalty']},{'transaction':_0x3ed24b});});})['then'](function(){_0x57682e['forEach'](function(_0x1ac18c){socket[_0xe646('0x7c')](_0xe646('0x7d'),{'UserId':_0x1ac18c['id'],'VoiceQueueId':_0x3bc07e['id']});});});});});}})[_0xe646('0x25')](respondWithStatusCode(_0xf7442c,null))[_0xe646('0x4c')](handleError(_0xf7442c,null));};exports['removeTeams']=function(_0x1644f7,_0x20def0,_0xe484f1){return db[_0xe646('0x6c')][_0xe646('0x4a')]({'where':{'id':_0x1644f7[_0xe646('0x3d')][_0xe646('0x7e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe646('0x70'),'attributes':['id'],'raw':!![]}]})[_0xe646('0x25')](handleEntityNotFound(_0x20def0,null))[_0xe646('0x25')](function(_0xff3073){var _0x1c3d8f=_['map'](_0xff3073,'id');var _0x1a359e=[];var _0x2413d8=[];var _0x525be4=squel['select']();_0x525be4[_0xe646('0x7f')](_0xe646('0x80'))[_0xe646('0x81')]('team_has_voice_queues','tq')[_0xe646('0x82')](_0xe646('0x83'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe646('0x46')](_0xe646('0x84'),_0x1644f7[_0xe646('0x4d')]['id']);for(var _0xf076e8=0x0;_0xf076e8<_0xff3073[_0xe646('0x42')];_0xf076e8+=0x1){let _0x2f86fc=_0xff3073[_0xf076e8];for(var _0xb4d47f=0x0;_0xb4d47f<_0x2f86fc[_0xe646('0x70')][_0xe646('0x42')];_0xb4d47f+=0x1){let _0xbd9e3d=_0x2f86fc[_0xe646('0x70')][_0xb4d47f];var _0x3098a5=_0x525be4[_0xe646('0x5b')]();_0x3098a5[_0xe646('0x46')](_0xe646('0x85'),_0xbd9e3d['id']);_0x2413d8[_0xe646('0x86')](db[_0xe646('0x87')]['query'](_0x3098a5[_0xe646('0x88')](),{'type':db[_0xe646('0x87')]['QueryTypes']['SELECT']})[_0xe646('0x25')](function(_0x55cf6d){if(_0x55cf6d[_0xe646('0x42')]===0x1){return _0xbd9e3d['id'];}else{var _0x14f768=_['every'](_[_0xe646('0x37')](_0x55cf6d,_0xe646('0x89')),function(_0x12a914){return _['includes'](_0x1c3d8f,_0x12a914);});if(_0x14f768){return _0xbd9e3d['id'];}}}));}}return BPromise[_0xe646('0x8a')](_0x2413d8)[_0xe646('0x25')](function(_0x2744b1){_0x1a359e=_(_0x1a359e)[_0xe646('0x8b')](_0x2744b1)[_0xe646('0x8c')]()[_0xe646('0x2b')]();return db[_0xe646('0x38')][_0xe646('0x2e')]({'where':{'id':_0x1644f7[_0xe646('0x4d')]['id']}})['then'](function(_0x507065){return db[_0xe646('0x87')][_0xe646('0x8d')](function(_0x57a866){return _0x507065[_0xe646('0x8e')](_0x1644f7[_0xe646('0x3d')]['ids'],{'transaction':_0x57a866})[_0xe646('0x25')](function(){if(!_['isEmpty'](_0x1a359e)){return _0x507065[_0xe646('0x8f')](_0x1a359e,{'transaction':_0x57a866})['then'](function(){return db[_0xe646('0x90')][_0xe646('0x31')]({'where':{'VoiceQueueId':_0x1644f7[_0xe646('0x4d')]['id'],'UserId':_0x1a359e},'transaction':_0x57a866});});}})['then'](function(){_0x1a359e[_0xe646('0x75')](function(_0x1253e0){socket[_0xe646('0x7c')]('userVoiceQueue:remove',{'UserId':_0x1253e0,'VoiceQueueId':_0x507065['id']});});});});});});})[_0xe646('0x25')](respondWithStatusCode(_0x20def0,null))['catch'](handleError(_0x20def0,null));};exports[_0xe646('0x91')]=function(_0x5a3896,_0xa26c27,_0x2c373f){var _0x3476aa,_0x3c92c0;return db[_0xe646('0x38')][_0xe646('0x2e')]({'where':{'id':_0x5a3896['params']['id']}})['then'](handleEntityNotFound(_0xa26c27,null))['then'](function(_0x5b9a98){if(_0x5b9a98){_0x3c92c0=_0x5b9a98;return _0x5b9a98[_0xe646('0x91')](_0x5a3896[_0xe646('0x52')][_0xe646('0x7e')],_['omit'](_0x5a3896['body'],[_0xe646('0x7e'),'id'])||{})[_0xe646('0x92')](function(_0x211ad8){for(var _0x55407b=0x0;_0x55407b<_0x5a3896['body']['ids']['length'];_0x55407b+=0x1){socket[_0xe646('0x7c')](_0xe646('0x7d'),{'UserId':_0x5a3896[_0xe646('0x52')][_0xe646('0x7e')][_0x55407b],'VoiceQueueId':_0x5a3896[_0xe646('0x4d')]['id']});}return _0x211ad8;});}})[_0xe646('0x25')](function(_0x31920b){_0x3476aa=_0x31920b||[];if(_0x3c92c0){return db[_0xe646('0x6f')]['findAll']({'where':{'id':_0x5a3896[_0xe646('0x52')]['ids']},'attributes':['id',_0xe646('0x2f'),'online',_0xe646('0x72'),_0xe646('0x73')],'raw':!![]});}})[_0xe646('0x25')](function(_0x330b9a){if(!_[_0xe646('0x93')](_0x330b9a)){var _0x404a4f=[];for(var _0x104a73=0x0;_0x104a73<_0x330b9a['length'];_0x104a73++){if(_0x330b9a[_0x104a73]['online']){_0x404a4f[_0xe646('0x86')](db[_0xe646('0x90')]['upsert']({'membername':_0x330b9a[_0x104a73]['name'],'UserId':_0x330b9a[_0x104a73]['id'],'queue_name':_0x3c92c0['name'],'VoiceQueueId':_0x3c92c0['id'],'interface':_['isNil'](_0x330b9a[_0x104a73][_0xe646('0x73')])?util[_0xe646('0x7a')]('SIP/%s',_0x330b9a[_0x104a73][_0xe646('0x2f')]):_0x330b9a[_0x104a73][_0xe646('0x73')],'paused':_0x330b9a[_0x104a73][_0xe646('0x72')]||![],'penalty':_0x5a3896[_0xe646('0x52')][_0xe646('0x76')]||0x0}));}}return BPromise[_0xe646('0x8a')](_0x404a4f);}})[_0xe646('0x25')](function(){return _0x3476aa;})[_0xe646('0x25')](respondWithResult(_0xa26c27,null))[_0xe646('0x4c')](handleError(_0xa26c27,null));};exports[_0xe646('0x8f')]=function(_0x36e799,_0x5ddcb4,_0x21d12f){return db['VoiceQueue'][_0xe646('0x2e')]({'where':{'id':_0x36e799[_0xe646('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5ddcb4,null))[_0xe646('0x25')](function(_0x1d6b81){if(_0x1d6b81){return _0x1d6b81[_0xe646('0x8f')](_0x36e799['query'][_0xe646('0x7e')])['then'](function(){if(_[_0xe646('0x94')](_0x36e799[_0xe646('0x3d')][_0xe646('0x7e')])){for(var _0x150d74=0x0;_0x150d74<_0x36e799[_0xe646('0x3d')][_0xe646('0x7e')][_0xe646('0x42')];_0x150d74+=0x1){socket[_0xe646('0x7c')](_0xe646('0x95'),{'UserId':Number(_0x36e799[_0xe646('0x3d')][_0xe646('0x7e')][_0x150d74]),'VoiceQueueId':Number(_0x36e799[_0xe646('0x4d')]['id'])});}}else{socket['emit'](_0xe646('0x95'),{'UserId':Number(_0x36e799[_0xe646('0x3d')][_0xe646('0x7e')]),'VoiceQueueId':Number(_0x36e799[_0xe646('0x4d')]['id'])});}});}})[_0xe646('0x25')](function(_0x1c5b7e){return db['UserVoiceQueueRt'][_0xe646('0x31')]({'where':{'VoiceQueueId':_0x36e799[_0xe646('0x4d')]['id'],'UserId':_0x36e799['query']['ids']}})[_0xe646('0x25')](function(){return _0x1c5b7e;});})[_0xe646('0x25')](respondWithStatusCode(_0x5ddcb4,null))[_0xe646('0x4c')](handleError(_0x5ddcb4,null));};exports['getAgents']=function(_0x3f4d2e,_0x4f953e,_0x1335fc){var _0x15e5c8={};var _0x271b90={};var _0x4703e1;var _0x224ce6;return db['VoiceQueue']['findOne']({'where':{'id':_0x3f4d2e['params']['id']}})['then'](handleEntityNotFound(_0x4f953e,null))['then'](function(_0x5f4ec3){if(_0x5f4ec3){_0x4703e1=_0x5f4ec3;_0x271b90[_0xe646('0x3c')]=_['keys'](db[_0xe646('0x6f')][_0xe646('0x39')]);_0x271b90[_0xe646('0x3d')]=_['keys'](_0x3f4d2e[_0xe646('0x3d')]);_0x271b90[_0xe646('0x3e')]=_[_0xe646('0x3f')](_0x271b90[_0xe646('0x3c')],_0x271b90[_0xe646('0x3d')]);_0x15e5c8['attributes']=_[_0xe646('0x3f')](_0x271b90[_0xe646('0x3c')],qs[_0xe646('0x41')](_0x3f4d2e[_0xe646('0x3d')][_0xe646('0x41')]));_0x15e5c8[_0xe646('0x40')]=_0x15e5c8[_0xe646('0x40')][_0xe646('0x42')]?_0x15e5c8[_0xe646('0x40')]:_0x271b90['model'];_0x15e5c8[_0xe646('0x44')]=qs['sort'](_0x3f4d2e['query'][_0xe646('0x45')]);_0x15e5c8[_0xe646('0x46')]=qs[_0xe646('0x3e')](_[_0xe646('0x64')](_0x3f4d2e[_0xe646('0x3d')],_0x271b90[_0xe646('0x3e')]));if(_0x3f4d2e['query'][_0xe646('0x2a')]){_0x15e5c8['where']=_[_0xe646('0x50')](_0x15e5c8[_0xe646('0x46')],{'$or':_[_0xe646('0x37')](_0x15e5c8[_0xe646('0x40')],function(_0x523d13){var _0x2f9fbf={};_0x2f9fbf[_0x523d13]={'$like':'%'+_0x3f4d2e[_0xe646('0x3d')][_0xe646('0x2a')]+'%'};return _0x2f9fbf;})});}_0x15e5c8=_['merge']({},_0x15e5c8,_0x3f4d2e[_0xe646('0x48')]);return _0x4703e1['getAgents'](_0x15e5c8);}})[_0xe646('0x25')](function(_0x327b34){if(_0x327b34){_0x224ce6=_0x327b34['length'];if(!_0x3f4d2e[_0xe646('0x3d')][_0xe646('0x43')](_0xe646('0x68'))){_0x15e5c8[_0xe646('0x20')]=qs[_0xe646('0x20')](_0x3f4d2e[_0xe646('0x3d')][_0xe646('0x20')]);_0x15e5c8['offset']=qs[_0xe646('0x1f')](_0x3f4d2e[_0xe646('0x3d')][_0xe646('0x1f')]);}return _0x4703e1[_0xe646('0x96')](_0x15e5c8);}})[_0xe646('0x25')](function(_0x2970b2){if(_0x2970b2){return _0x2970b2?{'count':_0x224ce6,'rows':_0x2970b2}:null;}})[_0xe646('0x25')](respondWithResult(_0x4f953e,null))[_0xe646('0x4c')](handleError(_0x4f953e,null));};exports[_0xe646('0x97')]=function(_0x327ab6,_0xe6c3bf,_0x509305){var _0x3a5b20={};var _0x19ccd5={};var _0x273a02;var _0x32f8c3;return db[_0xe646('0x38')][_0xe646('0x62')]({'where':{'id':_0x327ab6[_0xe646('0x4d')]['id']}})['then'](handleEntityNotFound(_0xe6c3bf,null))[_0xe646('0x25')](function(_0x29d022){if(_0x29d022){_0x273a02=_0x29d022;_0x19ccd5[_0xe646('0x3c')]=_[_0xe646('0x4e')](db[_0xe646('0x90')][_0xe646('0x39')]);_0x19ccd5[_0xe646('0x3d')]=_[_0xe646('0x4e')](_0x327ab6[_0xe646('0x3d')]);_0x19ccd5[_0xe646('0x3e')]=_[_0xe646('0x3f')](_0x19ccd5[_0xe646('0x3c')],_0x19ccd5[_0xe646('0x3d')]);_0x3a5b20[_0xe646('0x40')]=_[_0xe646('0x3f')](_0x19ccd5[_0xe646('0x3c')],qs['fields'](_0x327ab6[_0xe646('0x3d')][_0xe646('0x41')]));_0x3a5b20[_0xe646('0x40')]=_0x3a5b20['attributes']['length']?_0x3a5b20[_0xe646('0x40')]:_0x19ccd5[_0xe646('0x3c')];_0x3a5b20[_0xe646('0x44')]=qs['sort'](_0x327ab6['query'][_0xe646('0x45')]);_0x3a5b20['where']=qs[_0xe646('0x3e')](_['pick'](_0x327ab6[_0xe646('0x3d')],_0x19ccd5['filters']));if(_0x327ab6['query']['filter']){_0x3a5b20['where']=_[_0xe646('0x50')](_0x3a5b20[_0xe646('0x46')],{'$or':_[_0xe646('0x37')](_0x3a5b20[_0xe646('0x40')],function(_0x35ebb1){var _0xe64e7c={};_0xe64e7c[_0x35ebb1]={'$like':'%'+_0x327ab6[_0xe646('0x3d')]['filter']+'%'};return _0xe64e7c;})});}_0x3a5b20=_[_0xe646('0x50')]({},_0x3a5b20,_0x327ab6['options']);return _0x273a02[_0xe646('0x97')](_0x3a5b20);}})[_0xe646('0x25')](function(_0x4c2b53){if(_0x4c2b53){_0x32f8c3=_0x4c2b53['length'];if(!_0x327ab6[_0xe646('0x3d')][_0xe646('0x43')](_0xe646('0x68'))){_0x3a5b20[_0xe646('0x20')]=qs[_0xe646('0x20')](_0x327ab6[_0xe646('0x3d')][_0xe646('0x20')]);_0x3a5b20[_0xe646('0x1f')]=qs[_0xe646('0x1f')](_0x327ab6[_0xe646('0x3d')][_0xe646('0x1f')]);}return _0x273a02[_0xe646('0x97')](_0x3a5b20);}})[_0xe646('0x25')](function(_0x3a00ab){return _0x3a00ab?{'count':_0x32f8c3,'rows':_0x3a00ab}:null;})[_0xe646('0x25')](respondWithResult(_0xe6c3bf,null))['catch'](handleError(_0xe6c3bf,null));};exports['getLists']=function(_0x551edf,_0x47dec3,_0x5c531d){var _0x521d40={};var _0x5298df={};var _0x220b7d;var _0x21e4f9;return db[_0xe646('0x38')][_0xe646('0x62')]({'where':{'id':_0x551edf[_0xe646('0x4d')]['id']}})[_0xe646('0x25')](handleEntityNotFound(_0x47dec3,null))[_0xe646('0x25')](function(_0x187cf0){if(_0x187cf0){_0x220b7d=_0x187cf0;_0x5298df['model']=_[_0xe646('0x4e')](db[_0xe646('0x98')]['rawAttributes']);_0x5298df[_0xe646('0x3d')]=_[_0xe646('0x4e')](_0x551edf[_0xe646('0x3d')]);_0x5298df['filters']=_['intersection'](_0x5298df['model'],_0x5298df[_0xe646('0x3d')]);_0x521d40[_0xe646('0x40')]=_['intersection'](_0x5298df['model'],qs[_0xe646('0x41')](_0x551edf[_0xe646('0x3d')][_0xe646('0x41')]));_0x521d40[_0xe646('0x40')]=_0x521d40[_0xe646('0x40')]['length']?_0x521d40[_0xe646('0x40')]:_0x5298df[_0xe646('0x3c')];_0x521d40['order']=qs[_0xe646('0x45')](_0x551edf[_0xe646('0x3d')][_0xe646('0x45')]);_0x521d40[_0xe646('0x46')]=qs[_0xe646('0x3e')](_[_0xe646('0x64')](_0x551edf['query'],_0x5298df[_0xe646('0x3e')]));if(_0x551edf[_0xe646('0x3d')][_0xe646('0x2a')]){_0x521d40[_0xe646('0x46')]=_['merge'](_0x521d40[_0xe646('0x46')],{'$or':_[_0xe646('0x37')](_0x521d40[_0xe646('0x40')],function(_0x5322a9){var _0x5b486d={};_0x5b486d[_0x5322a9]={'$like':'%'+_0x551edf[_0xe646('0x3d')]['filter']+'%'};return _0x5b486d;})});}_0x521d40=_[_0xe646('0x50')]({},_0x521d40,_0x551edf[_0xe646('0x48')]);return _0x220b7d['getLists'](_0x521d40);}})[_0xe646('0x25')](function(_0x499179){if(_0x499179){_0x21e4f9=_0x499179[_0xe646('0x42')];if(!_0x551edf['query']['hasOwnProperty']('nolimit')){_0x521d40[_0xe646('0x20')]=qs[_0xe646('0x20')](_0x551edf[_0xe646('0x3d')][_0xe646('0x20')]);_0x521d40['offset']=qs[_0xe646('0x1f')](_0x551edf[_0xe646('0x3d')][_0xe646('0x1f')]);}return _0x220b7d['getLists'](_0x521d40);}})[_0xe646('0x25')](function(_0x5cad57){if(_0x5cad57){return _0x5cad57?{'count':_0x21e4f9,'rows':_0x5cad57}:null;}})[_0xe646('0x25')](respondWithResult(_0x47dec3,null))[_0xe646('0x4c')](handleError(_0x47dec3,null));};exports[_0xe646('0x99')]=function(_0x4eafb5,_0xe2da24,_0xaa403){var _0x5a2d85,_0x13ff37;return db['VoiceQueue'][_0xe646('0x2e')]({'where':{'id':_0x4eafb5[_0xe646('0x4d')]['id']}})['then'](handleEntityNotFound(_0xe2da24,null))[_0xe646('0x25')](function(_0xeea719){if(_0xeea719){_0x13ff37=_0xeea719;return _0xeea719['addLists'](_0x4eafb5[_0xe646('0x52')][_0xe646('0x7e')],_[_0xe646('0x5d')](_0x4eafb5[_0xe646('0x52')],[_0xe646('0x7e'),'id'])||{});}return null;})[_0xe646('0x92')](function(_0x480bb0){var _0x26f127;_0x5a2d85=_0x480bb0||[];var _0xfbcfc1=[];if(_0x480bb0){for(var _0x4059a6=0x0;_0x4059a6<_0x480bb0['length'];_0x4059a6+=0x1){var _0x33cc98=_0x480bb0[_0x4059a6][_0xe646('0x26')]({'plain':!![]});_0x13ff37[_0xe646('0x9a')]=_0x4eafb5['body'][_0xe646('0x9a')]?_0x4eafb5[_0xe646('0x52')][_0xe646('0x9a')]:_0x13ff37[_0xe646('0x9a')];switch(_0x13ff37[_0xe646('0x9a')]){case _0xe646('0x9b'):_0x26f127=squel[_0xe646('0x9c')]()[_0xe646('0x9d')](_0xe646('0x9e'))[_0xe646('0x9f')]([_0xe646('0xa0'),_0xe646('0xa1'),_0xe646('0xa2'),_0xe646('0xa3'),_0xe646('0x65'),'createdAt',_0xe646('0x5f')],squel[_0xe646('0xa4')]()[_0xe646('0x7f')]('phone',_0xe646('0xa0'))[_0xe646('0x7f')](_0xe646('0xa5'),_0xe646('0xa1'))[_0xe646('0x7f')]('id',_0xe646('0xa2'))[_0xe646('0x7f')](_0x33cc98[_0xe646('0xa6')]['toString'](),'ListId')['field'](_0x4eafb5['params']['id'][_0xe646('0x88')](),'VoiceQueueId')[_0xe646('0x7f')]('NOW()','createdAt')[_0xe646('0x7f')](_0xe646('0xa5'),'updatedAt')[_0xe646('0x81')](_0xe646('0xa7'))[_0xe646('0x46')]('deletedAt\x20IS\x20NULL')[_0xe646('0x46')](_0xe646('0xa8'),_0x33cc98[_0xe646('0xa6')][_0xe646('0x88')]())['where'](_0xe646('0xa9'))['where'](_0xe646('0xaa'),squel[_0xe646('0xa4')]()[_0xe646('0x7f')](_0xe646('0xab'))['from'](_0xe646('0xac'))['where'](_0xe646('0x84'),_0x4eafb5[_0xe646('0x4d')]['id'][_0xe646('0x88')]()))['where'](_0xe646('0xaa'),squel[_0xe646('0xa4')]()[_0xe646('0x7f')](_0xe646('0xad'))['from'](_0xe646('0x9e'))[_0xe646('0x46')]('VoiceQueueId\x20=\x20?',_0x4eafb5[_0xe646('0x4d')]['id'][_0xe646('0x88')]())))[_0xe646('0x88')]();break;case _0xe646('0xae'):_0x26f127=squel[_0xe646('0x9c')]()['into'](_0xe646('0x9e'))[_0xe646('0x9f')]([_0xe646('0xa0'),_0xe646('0xa1'),_0xe646('0xa2'),_0xe646('0xa3'),_0xe646('0x65'),_0xe646('0x5e'),'updatedAt'],squel['select']()['field'](_0xe646('0xa0'),_0xe646('0xa0'))[_0xe646('0x7f')](_0xe646('0xa5'),_0xe646('0xa1'))['field']('id','ContactId')[_0xe646('0x7f')](_0x33cc98[_0xe646('0xa6')][_0xe646('0x88')](),_0xe646('0xa3'))[_0xe646('0x7f')](_0x4eafb5['params']['id'][_0xe646('0x88')](),_0xe646('0x65'))[_0xe646('0x7f')]('NOW()',_0xe646('0x5e'))['field']('NOW()',_0xe646('0x5f'))[_0xe646('0x81')](_0xe646('0xa7'))[_0xe646('0x46')](_0xe646('0xaf'))['where'](_0xe646('0xa8'),_0x33cc98[_0xe646('0xa6')][_0xe646('0x88')]())[_0xe646('0x46')](_0xe646('0xa9'))[_0xe646('0x46')](_0xe646('0xaa'),squel[_0xe646('0xa4')]()['field'](_0xe646('0xad'))[_0xe646('0x81')](_0xe646('0x9e'))['where'](_0xe646('0x84'),_0x4eafb5[_0xe646('0x4d')]['id']['toString']())))[_0xe646('0x88')]();break;default:_0x26f127=squel[_0xe646('0x9c')]()[_0xe646('0x9d')](_0xe646('0x9e'))[_0xe646('0x9f')]([_0xe646('0xa0'),_0xe646('0xa1'),_0xe646('0xa2'),'ListId',_0xe646('0x65'),_0xe646('0x5e'),_0xe646('0x5f')],squel[_0xe646('0xa4')]()['field'](_0xe646('0xa0'),_0xe646('0xa0'))[_0xe646('0x7f')](_0xe646('0xa5'),_0xe646('0xa1'))[_0xe646('0x7f')]('id',_0xe646('0xa2'))[_0xe646('0x7f')](_0x33cc98[_0xe646('0xa6')][_0xe646('0x88')](),'ListId')['field'](_0x4eafb5[_0xe646('0x4d')]['id'][_0xe646('0x88')](),'VoiceQueueId')['field']('NOW()','createdAt')[_0xe646('0x7f')](_0xe646('0xa5'),_0xe646('0x5f'))[_0xe646('0x81')](_0xe646('0xa7'))[_0xe646('0x46')]('deletedAt\x20IS\x20NULL')[_0xe646('0x46')](_0xe646('0xa8'),_0x33cc98[_0xe646('0xa6')][_0xe646('0x88')]())[_0xe646('0x46')](_0xe646('0xa9')))[_0xe646('0x88')]();}_0xfbcfc1[_0xe646('0x86')](db[_0xe646('0x87')][_0xe646('0x3d')](_0x26f127));}return BPromise[_0xe646('0x8a')](_0xfbcfc1);}})['then'](function(){return _0x5a2d85;})[_0xe646('0x25')](respondWithResult(_0xe2da24,null))[_0xe646('0x4c')](handleError(_0xe2da24,null));};exports['removeLists']=function(_0x54e428,_0x51b793,_0x4933a4){return db['VoiceQueue']['find']({'where':{'id':_0x54e428[_0xe646('0x4d')]['id']}})[_0xe646('0x25')](handleEntityNotFound(_0x51b793,null))[_0xe646('0x25')](function(_0xfbe1a0){if(_0xfbe1a0){return _0xfbe1a0[_0xe646('0xb0')](_0x54e428['query'][_0xe646('0x7e')]);}})[_0xe646('0x25')](function(_0x127bc3){if(_0x127bc3){return db[_0xe646('0x63')]['destroy']({'where':{'ListId':_0x54e428[_0xe646('0x3d')][_0xe646('0x7e')],'VoiceQueueId':_0x54e428['params']['id']}})['then'](function(){return _0x127bc3;});}})[_0xe646('0x25')](respondWithStatusCode(_0x51b793,null))[_0xe646('0x4c')](handleError(_0x51b793,null));};exports[_0xe646('0xb1')]=function(_0x58039e,_0x3adb32,_0x35bd6d){var _0x3abc82={};var _0x42908f={};var _0x2005a9;var _0x2549e9;return db[_0xe646('0x38')][_0xe646('0x62')]({'where':{'id':_0x58039e[_0xe646('0x4d')]['id']}})[_0xe646('0x25')](handleEntityNotFound(_0x3adb32,null))[_0xe646('0x25')](function(_0x2dfa28){if(_0x2dfa28){_0x2005a9=_0x2dfa28;_0x42908f['model']=_[_0xe646('0x4e')](db[_0xe646('0x98')][_0xe646('0x39')]);_0x42908f[_0xe646('0x3d')]=_[_0xe646('0x4e')](_0x58039e[_0xe646('0x3d')]);_0x42908f[_0xe646('0x3e')]=_[_0xe646('0x3f')](_0x42908f['model'],_0x42908f[_0xe646('0x3d')]);_0x3abc82['attributes']=_[_0xe646('0x3f')](_0x42908f[_0xe646('0x3c')],qs[_0xe646('0x41')](_0x58039e[_0xe646('0x3d')][_0xe646('0x41')]));_0x3abc82[_0xe646('0x40')]=_0x3abc82[_0xe646('0x40')]['length']?_0x3abc82[_0xe646('0x40')]:_0x42908f['model'];_0x3abc82[_0xe646('0x44')]=qs['sort'](_0x58039e['query'][_0xe646('0x45')]);_0x3abc82[_0xe646('0x46')]=qs[_0xe646('0x3e')](_[_0xe646('0x64')](_0x58039e[_0xe646('0x3d')],_0x42908f[_0xe646('0x3e')]));if(_0x58039e[_0xe646('0x3d')][_0xe646('0x2a')]){_0x3abc82['where']=_['merge'](_0x3abc82['where'],{'$or':_[_0xe646('0x37')](_0x3abc82[_0xe646('0x40')],function(_0xa95f73){var _0x59401d={};_0x59401d[_0xa95f73]={'$like':'%'+_0x58039e['query'][_0xe646('0x2a')]+'%'};return _0x59401d;})});}_0x3abc82=_[_0xe646('0x50')]({},_0x3abc82,_0x58039e[_0xe646('0x48')]);return _0x2005a9[_0xe646('0xb1')](_0x3abc82);}})[_0xe646('0x25')](function(_0x1581f4){if(_0x1581f4){_0x2549e9=_0x1581f4['length'];if(!_0x58039e[_0xe646('0x3d')]['hasOwnProperty'](_0xe646('0x68'))){_0x3abc82['limit']=qs[_0xe646('0x20')](_0x58039e[_0xe646('0x3d')]['limit']);_0x3abc82[_0xe646('0x1f')]=qs['offset'](_0x58039e[_0xe646('0x3d')][_0xe646('0x1f')]);}return _0x2005a9[_0xe646('0xb1')](_0x3abc82);}})[_0xe646('0x25')](function(_0x1eb7c7){if(_0x1eb7c7){return _0x1eb7c7?{'count':_0x2549e9,'rows':_0x1eb7c7}:null;}})['then'](respondWithResult(_0x3adb32,null))['catch'](handleError(_0x3adb32,null));};exports[_0xe646('0xb2')]=function(_0x137eb9,_0x32d4f0,_0x91c4ea){var _0x205553,_0x549fc5;return db['VoiceQueue'][_0xe646('0x2e')]({'where':{'id':_0x137eb9[_0xe646('0x4d')]['id']}})['then'](handleEntityNotFound(_0x32d4f0,null))[_0xe646('0x25')](function(_0x1ba840){if(_0x1ba840){_0x549fc5=_0x1ba840;return _0x1ba840[_0xe646('0xb2')](_0x137eb9[_0xe646('0x52')][_0xe646('0x7e')],_[_0xe646('0x5d')](_0x137eb9[_0xe646('0x52')],['ids','id'])||{});}return null;})['spread'](function(_0x554a49){var _0x42ec2e;_0x205553=_0x554a49||[];var _0x41582a=[];if(_0x554a49){for(var _0x116289=0x0;_0x116289<_0x554a49[_0xe646('0x42')];_0x116289+=0x1){var _0xd055d2=_0x554a49[_0x116289]['get']({'plain':!![]});_0x42ec2e=squel[_0xe646('0x9c')]()[_0xe646('0x9d')](_0xe646('0xb3'))['fromQuery']([_0xe646('0xa0'),'ContactId',_0xe646('0xa3'),_0xe646('0x65'),_0xe646('0x5e'),_0xe646('0x5f')],squel['select']()[_0xe646('0x7f')](_0xe646('0xa0'),_0xe646('0xa0'))['field']('id',_0xe646('0xa2'))[_0xe646('0x7f')](_0xd055d2[_0xe646('0xa6')][_0xe646('0x88')](),'ListId')[_0xe646('0x7f')](_0x137eb9[_0xe646('0x4d')]['id']['toString'](),_0xe646('0x65'))[_0xe646('0x7f')]('NOW()',_0xe646('0x5e'))[_0xe646('0x7f')](_0xe646('0xa5'),'updatedAt')[_0xe646('0x81')](_0xe646('0xa7'))[_0xe646('0x46')](_0xe646('0xaf'))['where'](_0xe646('0xa8'),_0xd055d2[_0xe646('0xa6')][_0xe646('0x88')]())[_0xe646('0x46')](_0xe646('0xa9')))[_0xe646('0x88')]();_0x41582a[_0xe646('0x86')](db[_0xe646('0x87')]['query'](_0x42ec2e));}return BPromise[_0xe646('0x8a')](_0x41582a);}})[_0xe646('0x25')](function(){return _0x205553;})[_0xe646('0x25')](respondWithResult(_0x32d4f0,null))[_0xe646('0x4c')](handleError(_0x32d4f0,null));};exports[_0xe646('0xb4')]=function(_0x5ca124,_0x3d2acc,_0x39d1b2){return db[_0xe646('0x38')][_0xe646('0x2e')]({'where':{'id':_0x5ca124[_0xe646('0x4d')]['id']}})[_0xe646('0x25')](handleEntityNotFound(_0x3d2acc,null))['then'](function(_0x5c0ed9){if(_0x5c0ed9){return _0x5c0ed9[_0xe646('0xb4')](_0x5ca124[_0xe646('0x3d')][_0xe646('0x7e')]);}})[_0xe646('0x25')](function(_0x4bdbcf){if(_0x4bdbcf){return db[_0xe646('0x6a')][_0xe646('0x31')]({'where':{'ListId':_0x5ca124['query'][_0xe646('0x7e')],'VoiceQueueId':_0x5ca124['params']['id']}})['then'](function(){return _0x4bdbcf;});}})[_0xe646('0x25')](respondWithStatusCode(_0x3d2acc,null))[_0xe646('0x4c')](handleError(_0x3d2acc,null));};
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js
index 242018a..da88bff 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 _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
+var _0x17ae=['emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','update','remove'];(function(_0x22f17b,_0x42051b){var _0x77e8b1=function(_0x59ebc2){while(--_0x59ebc2){_0x22f17b['push'](_0x22f17b['shift']());}};_0x77e8b1(++_0x42051b);}(_0x17ae,0x1e9));var _0xe17a=function(_0x2946cb,_0x1aed1e){_0x2946cb=_0x2946cb-0x0;var _0xae7041=_0x17ae[_0x2946cb];return _0xae7041;};'use strict';var EventEmitter=require(_0xe17a('0x0'));var VoiceQueue=require(_0xe17a('0x1'))['db'][_0xe17a('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xe17a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe17a('0x4'),'afterDestroy':_0xe17a('0x5')};function emitEvent(_0x58818d){return function(_0x4ce3f1,_0x17cdcf,_0x5ca90e){VoiceQueueEvents[_0xe17a('0x6')](_0x58818d+':'+_0x4ce3f1['id'],_0x4ce3f1);VoiceQueueEvents[_0xe17a('0x6')](_0x58818d,_0x4ce3f1);_0x5ca90e(null);};}for(var e in events){if(events[_0xe17a('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xe17a('0x8')]=VoiceQueueEvents;
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js
index 07349c4..2257c86 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 _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
+var _0x7401=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','voice_queues','lodash','util'];(function(_0x1c9616,_0x3c2df0){var _0x950b78=function(_0x1099a5){while(--_0x1099a5){_0x1c9616['push'](_0x1c9616['shift']());}};_0x950b78(++_0x3c2df0);}(_0x7401,0xf5));var _0x1740=function(_0x1e1c71,_0x22e136){_0x1e1c71=_0x1e1c71-0x0;var _0x395717=_0x7401[_0x1e1c71];return _0x395717;};'use strict';var _=require(_0x1740('0x0'));var util=require(_0x1740('0x1'));var logger=require(_0x1740('0x2'))(_0x1740('0x3'));var moment=require(_0x1740('0x4'));var BPromise=require('bluebird');var rp=require(_0x1740('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1740('0x6'));var config=require(_0x1740('0x7'));var attributes=require(_0x1740('0x8'));module[_0x1740('0x9')]=function(_0x5bb0ff,_0x3b1e5){return _0x5bb0ff[_0x1740('0xa')](_0x1740('0xb'),attributes,{'tableName':_0x1740('0xc'),'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 c4ab88d..436370a 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 _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
+var _0x92a6=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetVoiceQueue','findAll','options','raw','attributes','include','map','model','then','stringify','ShowVoiceQueue','VoiceQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3cef48,_0x4b8910){var _0x25b578=function(_0xe33e9e){while(--_0xe33e9e){_0x3cef48['push'](_0x3cef48['shift']());}};_0x25b578(++_0x4b8910);}(_0x92a6,0xa4));var _0x692a=function(_0x5b323a,_0x17f67f){_0x5b323a=_0x5b323a-0x0;var _0x1c2826=_0x92a6[_0x5b323a];return _0x1c2826;};'use strict';var _=require(_0x692a('0x0'));var util=require(_0x692a('0x1'));var moment=require(_0x692a('0x2'));var BPromise=require(_0x692a('0x3'));var rs=require(_0x692a('0x4'));var fs=require('fs');var Redis=require(_0x692a('0x5'));var db=require(_0x692a('0x6'))['db'];var utils=require(_0x692a('0x7'));var logger=require(_0x692a('0x8'))(_0x692a('0x9'));var config=require(_0x692a('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x692a('0xb')][_0x692a('0xc')]({'port':0x232a});config[_0x692a('0xd')]=_[_0x692a('0xe')](config[_0x692a('0xd')],{'host':_0x692a('0xf'),'port':0x18eb});var socket=require(_0x692a('0x10'))(new Redis(config['redis']));require(_0x692a('0x11'))[_0x692a('0x12')](socket);function respondWithRpcPromise(_0x2d4ae3,_0xda3fa3,_0x418635){return new BPromise(function(_0x375afc,_0x12220f){return client[_0x692a('0x13')](_0x2d4ae3,_0x418635)['then'](function(_0x140acc){logger[_0x692a('0x14')](_0x692a('0x15'),_0xda3fa3,'request\x20sent');logger[_0x692a('0x16')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0xda3fa3,_0x692a('0x17'),JSON['stringify'](_0x140acc));if(_0x140acc['error']){if(_0x140acc[_0x692a('0x18')][_0x692a('0x19')]===0x1f4){logger[_0x692a('0x18')](_0x692a('0x15'),_0xda3fa3,_0x140acc[_0x692a('0x18')][_0x692a('0x1a')]);return _0x12220f(_0x140acc[_0x692a('0x18')]['message']);}logger['error'](_0x692a('0x15'),_0xda3fa3,_0x140acc[_0x692a('0x18')]['message']);return _0x375afc(_0x140acc[_0x692a('0x18')][_0x692a('0x1a')]);}else{logger[_0x692a('0x14')](_0x692a('0x15'),_0xda3fa3,_0x692a('0x17'));_0x375afc(_0x140acc[_0x692a('0x1b')][_0x692a('0x1a')]);}})[_0x692a('0x1c')](function(_0x57c4e1){logger[_0x692a('0x18')]('VoiceQueue,\x20%s,\x20%s',_0xda3fa3,_0x57c4e1);_0x12220f(_0x57c4e1);});});}exports[_0x692a('0x1d')]=function(_0xde407b){var _0x283928=this;return new Promise(function(_0x89524c,_0xabe7e0){return db['VoiceQueue'][_0x692a('0x1e')]({'raw':_0xde407b[_0x692a('0x1f')]?_0xde407b[_0x692a('0x1f')][_0x692a('0x20')]===undefined?!![]:![]:!![],'where':_0xde407b[_0x692a('0x1f')]?_0xde407b['options']['where']||null:null,'attributes':_0xde407b[_0x692a('0x1f')]?_0xde407b['options'][_0x692a('0x21')]||null:null,'limit':_0xde407b['options']?_0xde407b[_0x692a('0x1f')]['limit']||null:null,'include':_0xde407b['options']?_0xde407b[_0x692a('0x1f')][_0x692a('0x22')]?_[_0x692a('0x23')](_0xde407b[_0x692a('0x1f')]['include'],function(_0x5a7c8c){return{'model':db[_0x5a7c8c[_0x692a('0x24')]],'as':_0x5a7c8c['as'],'attributes':_0x5a7c8c[_0x692a('0x21')],'include':_0x5a7c8c['include']?_[_0x692a('0x23')](_0x5a7c8c[_0x692a('0x22')],function(_0x22b8c9){return{'model':db[_0x22b8c9[_0x692a('0x24')]],'as':_0x22b8c9['as'],'attributes':_0x22b8c9[_0x692a('0x21')],'include':_0x22b8c9[_0x692a('0x22')]?_['map'](_0x22b8c9[_0x692a('0x22')],function(_0x1374ed){return{'model':db[_0x1374ed[_0x692a('0x24')]],'as':_0x1374ed['as'],'attributes':_0x1374ed[_0x692a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x692a('0x25')](function(_0x1c90dc){logger['info']('GetVoiceQueue',_0xde407b);logger[_0x692a('0x16')](_0x692a('0x1d'),_0xde407b,JSON[_0x692a('0x26')](_0x1c90dc));_0x89524c(_0x1c90dc);})[_0x692a('0x1c')](function(_0x1f80c3){logger[_0x692a('0x18')](_0x692a('0x1d'),_0x1f80c3[_0x692a('0x1a')],_0xde407b);_0xabe7e0(_0x283928['error'](0x1f4,_0x1f80c3['message']));});});};exports[_0x692a('0x27')]=function(_0x4171b7){var _0xef1d7a=this;return new Promise(function(_0x20a8c4,_0x4742ee){return db[_0x692a('0x28')][_0x692a('0x29')]({'raw':_0x4171b7[_0x692a('0x1f')]?_0x4171b7[_0x692a('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x4171b7[_0x692a('0x1f')]?_0x4171b7[_0x692a('0x1f')][_0x692a('0x2a')]||null:null,'attributes':_0x4171b7[_0x692a('0x1f')]?_0x4171b7[_0x692a('0x1f')]['attributes']||null:null,'include':_0x4171b7[_0x692a('0x1f')]?_0x4171b7[_0x692a('0x1f')]['include']?_[_0x692a('0x23')](_0x4171b7[_0x692a('0x1f')][_0x692a('0x22')],function(_0x1dab59){return{'model':db[_0x1dab59[_0x692a('0x24')]],'as':_0x1dab59['as'],'attributes':_0x1dab59['attributes'],'include':_0x1dab59[_0x692a('0x22')]?_[_0x692a('0x23')](_0x1dab59[_0x692a('0x22')],function(_0x209b30){return{'model':db[_0x209b30[_0x692a('0x24')]],'as':_0x209b30['as'],'attributes':_0x209b30['attributes'],'include':_0x209b30['include']?_['map'](_0x209b30['include'],function(_0x3b2aef){return{'model':db[_0x3b2aef[_0x692a('0x24')]],'as':_0x3b2aef['as'],'attributes':_0x3b2aef['attributes']};}):[]};}):[]};}):[]:[]})[_0x692a('0x25')](function(_0x1e8fe4){logger[_0x692a('0x14')](_0x692a('0x27'),_0x4171b7);logger[_0x692a('0x16')](_0x692a('0x27'),_0x4171b7,JSON[_0x692a('0x26')](_0x1e8fe4));_0x20a8c4(_0x1e8fe4);})[_0x692a('0x1c')](function(_0x47b319){logger['error'](_0x692a('0x27'),_0x47b319[_0x692a('0x1a')],_0x4171b7);_0x4742ee(_0xef1d7a[_0x692a('0x18')](0x1f4,_0x47b319[_0x692a('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js
index 2b3c09f..f3861d5 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 _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
+var _0x6215=['./voiceQueue.events','save','remove','emit','length','voiceQueue:'];(function(_0x2d16c5,_0x15675c){var _0x29b9f0=function(_0x35408f){while(--_0x35408f){_0x2d16c5['push'](_0x2d16c5['shift']());}};_0x29b9f0(++_0x15675c);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueEvents=require(_0x5621('0x0'));var events=[_0x5621('0x1'),_0x5621('0x2'),'update'];function createListener(_0x944eb2,_0x2304a6){return function(_0x24464a){_0x2304a6[_0x5621('0x3')](_0x944eb2,_0x24464a);};}function removeListener(_0x204284,_0x13397a){return function(){VoiceQueueEvents['removeListener'](_0x204284,_0x13397a);};}exports['register']=function(_0x52f3c6){for(var _0x5ae3af=0x0,_0x431e77=events[_0x5621('0x4')];_0x5ae3af<_0x431e77;_0x5ae3af++){var _0x2b7275=events[_0x5ae3af];var _0x253c0b=createListener(_0x5621('0x5')+_0x2b7275,_0x52f3c6);VoiceQueueEvents['on'](_0x2b7275,_0x253c0b);}};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js
index 5091942..cf8641f 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 _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
+var _0xd101=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','update','delete','destroy'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0xd101,0xc1));var _0x1d10=function(_0x5227ae,_0x3e11cc){_0x5227ae=_0x5227ae-0x0;var _0x32e03e=_0xd101[_0x5227ae];return _0x32e03e;};'use strict';var multer=require(_0x1d10('0x0'));var util=require('util');var path=require(_0x1d10('0x1'));var timeout=require(_0x1d10('0x2'));var express=require(_0x1d10('0x3'));var router=express[_0x1d10('0x4')]();var auth=require(_0x1d10('0x5'));var interaction=require(_0x1d10('0x6'));var config=require(_0x1d10('0x7'));var controller=require(_0x1d10('0x8'));router['get']('/',auth[_0x1d10('0x9')](),controller[_0x1d10('0xa')]);router[_0x1d10('0xb')](_0x1d10('0xc'),auth[_0x1d10('0x9')](),controller[_0x1d10('0xd')]);router[_0x1d10('0xb')](_0x1d10('0xe'),auth[_0x1d10('0x9')](),controller[_0x1d10('0xf')]);router[_0x1d10('0xb')](_0x1d10('0x10'),auth[_0x1d10('0x9')](),controller[_0x1d10('0x11')]);router[_0x1d10('0x12')]('/',auth[_0x1d10('0x9')](),controller[_0x1d10('0x13')]);router['put'](_0x1d10('0x10'),auth[_0x1d10('0x9')](),controller[_0x1d10('0x14')]);router[_0x1d10('0x15')](_0x1d10('0x10'),auth['isAuthenticated'](),controller[_0x1d10('0x16')]);module[_0x1d10('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js
index 7aeb8b4..9ec303d 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 _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
+var _0xf65d=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN'];(function(_0xfa63c4,_0x146b06){var _0x5bd378=function(_0x36bf9b){while(--_0x36bf9b){_0xfa63c4['push'](_0xfa63c4['shift']());}};_0x5bd378(++_0x146b06);}(_0xf65d,0x13a));var _0xdf65=function(_0x24f04d,_0x198dc7){_0x24f04d=_0x24f04d-0x0;var _0x2930f0=_0xf65d[_0x24f04d];return _0x2930f0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0xdf65('0x0')]},'uniqueid':{'type':Sequelize[_0xdf65('0x0')]},'calleridnum':{'type':Sequelize[_0xdf65('0x0')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xdf65('0x0')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xdf65('0x1')],'set':function(_0x4fc8da){var _0xe502d1=moment(_0x4fc8da);var _0x14446d=moment(this[_0xdf65('0x2')](_0xdf65('0x3')))[_0xdf65('0x4')](_0xdf65('0x5'));var _0x915d4=_0xe502d1['diff'](_0x14446d,'seconds');this[_0xdf65('0x6')](_0xdf65('0x7'),_0x4fc8da);this[_0xdf65('0x6')](_0xdf65('0x8'),_0x915d4||null);}},'position':{'type':Sequelize[_0xdf65('0x9')]},'count':{'type':Sequelize[_0xdf65('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xdf65('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xdf65('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xdf65('0x1')]},'queuecallerexit':{'type':Sequelize[_0xdf65('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xdf65('0x0')],'comment':_0xdf65('0xb')},'originalposition':{'type':Sequelize[_0xdf65('0x9')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xdf65('0x0')]},'connectedlinename':{'type':Sequelize[_0xdf65('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xdf65('0x0')]},'exten':{'type':Sequelize[_0xdf65('0x0')]},'priority':{'type':Sequelize[_0xdf65('0x0')]},'holdtime':{'type':Sequelize[_0xdf65('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xdf65('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xdf65('0x0')]},'transfer':{'type':Sequelize[_0xdf65('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xdf65('0x0')],'comment':_0xdf65('0xc')},'transferexten':{'type':Sequelize[_0xdf65('0x0')]},'transferuniqueid':{'type':Sequelize[_0xdf65('0x0')]},'disposition':{'type':Sequelize[_0xdf65('0x0')]},'queuecallerenterreason':{'type':Sequelize[_0xdf65('0x9')],'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 b76e0a4..d5f046a 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 _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
+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(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x7a54,0x106));var _0x47a5=function(_0x25c25b,_0x35b945){_0x25c25b=_0x25c25b-0x0;var _0x2ce5f0=_0x7a54[_0x25c25b];return _0x2ce5f0;};'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 81f2f34..4769ac7 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 _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
+var _0xf4d7=['../../mysqldb','VoiceQueueReport','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x112d38,_0x1ca311){var _0x5cf717=function(_0x5a625c){while(--_0x5a625c){_0x112d38['push'](_0x112d38['shift']());}};_0x5cf717(++_0x1ca311);}(_0xf4d7,0xd7));var _0x7f4d=function(_0x20bf83,_0x269f57){_0x20bf83=_0x20bf83-0x0;var _0x23cbc7=_0xf4d7[_0x20bf83];return _0x23cbc7;};'use strict';var EventEmitter=require(_0x7f4d('0x0'));var VoiceQueueReport=require(_0x7f4d('0x1'))['db'][_0x7f4d('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7f4d('0x3'),'afterUpdate':_0x7f4d('0x4'),'afterDestroy':_0x7f4d('0x5')};function emitEvent(_0xfa1133){return function(_0x34f6f6,_0x1047c1,_0x5384ec){VoiceQueueReportEvents[_0x7f4d('0x6')](_0xfa1133+':'+_0x34f6f6['id'],_0x34f6f6);VoiceQueueReportEvents['emit'](_0xfa1133,_0x34f6f6);_0x5384ec(null);};}for(var e in events){if(events[_0x7f4d('0x7')](e)){var event=events[e];VoiceQueueReport[_0x7f4d('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js
index 2afbb4d..9aa832a 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 _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
+var _0xc42a=['moment','bluebird','request-promise','rimraf','../../config/environment','VoiceQueueReport','report_queue','uniqueid','lodash','api'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc42a,0x17a));var _0xac42=function(_0x1b9ee6,_0x5db9f4){_0x1b9ee6=_0x1b9ee6-0x0;var _0x38a508=_0xc42a[_0x1b9ee6];return _0x38a508;};'use strict';var _=require(_0xac42('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xac42('0x1'));var moment=require(_0xac42('0x2'));var BPromise=require(_0xac42('0x3'));var rp=require(_0xac42('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac42('0x5'));var config=require(_0xac42('0x6'));var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x8f713,_0x5b2f1e){return _0x8f713['define'](_0xac42('0x7'),attributes,{'tableName':_0xac42('0x8'),'paranoid':![],'indexes':[{'fields':[_0xac42('0x9')]},{'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 f47f2e4..5b96a5f 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 _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
+var _0xec60=['request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','then','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x5ea819,_0x25ca6c){var _0x2cac78=function(_0x503a5d){while(--_0x503a5d){_0x5ea819['push'](_0x5ea819['shift']());}};_0x2cac78(++_0x25ca6c);}(_0xec60,0x11f));var _0x0ec6=function(_0x16743c,_0x4ed346){_0x16743c=_0x16743c-0x0;var _0x32ddba=_0xec60[_0x16743c];return _0x32ddba;};'use strict';var _=require(_0x0ec6('0x0'));var util=require(_0x0ec6('0x1'));var moment=require(_0x0ec6('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ec6('0x3'));var fs=require('fs');var Redis=require(_0x0ec6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0ec6('0x5'));var logger=require(_0x0ec6('0x6'))(_0x0ec6('0x7'));var config=require(_0x0ec6('0x8'));var jayson=require(_0x0ec6('0x9'));var client=jayson[_0x0ec6('0xa')][_0x0ec6('0xb')]({'port':0x232a});config[_0x0ec6('0xc')]=_[_0x0ec6('0xd')](config['redis'],{'host':_0x0ec6('0xe'),'port':0x18eb});var socket=require(_0x0ec6('0xf'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x0ec6('0x10')](socket);function respondWithRpcPromise(_0x2d52bd,_0x22590b,_0x35a166){return new BPromise(function(_0x57597f,_0x5834db){return client['request'](_0x2d52bd,_0x35a166)['then'](function(_0x151016){logger[_0x0ec6('0x11')](_0x0ec6('0x12'),_0x22590b,'request\x20sent');logger[_0x0ec6('0x13')](_0x0ec6('0x14'),_0x22590b,_0x0ec6('0x15'),JSON[_0x0ec6('0x16')](_0x151016));if(_0x151016[_0x0ec6('0x17')]){if(_0x151016[_0x0ec6('0x17')][_0x0ec6('0x18')]===0x1f4){logger[_0x0ec6('0x17')](_0x0ec6('0x12'),_0x22590b,_0x151016[_0x0ec6('0x17')][_0x0ec6('0x19')]);return _0x5834db(_0x151016[_0x0ec6('0x17')]['message']);}logger[_0x0ec6('0x17')](_0x0ec6('0x12'),_0x22590b,_0x151016['error'][_0x0ec6('0x19')]);return _0x57597f(_0x151016[_0x0ec6('0x17')][_0x0ec6('0x19')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x22590b,_0x0ec6('0x15'));_0x57597f(_0x151016[_0x0ec6('0x1a')]['message']);}})[_0x0ec6('0x1b')](function(_0x172e67){logger[_0x0ec6('0x17')](_0x0ec6('0x12'),_0x22590b,_0x172e67);_0x5834db(_0x172e67);});});}exports[_0x0ec6('0x1c')]=function(_0x525441){var _0x5beefb=this;return new Promise(function(_0x5bd844,_0x35adb2){return db[_0x0ec6('0x1d')][_0x0ec6('0x1e')]({'raw':_0x525441['options']?_0x525441[_0x0ec6('0x1f')][_0x0ec6('0x20')]===undefined?!![]:![]:!![],'where':_0x525441[_0x0ec6('0x1f')]?_0x525441[_0x0ec6('0x1f')][_0x0ec6('0x21')]||null:null,'attributes':_0x525441[_0x0ec6('0x1f')]?_0x525441['options'][_0x0ec6('0x22')]||null:null,'limit':_0x525441[_0x0ec6('0x1f')]?_0x525441[_0x0ec6('0x1f')][_0x0ec6('0x23')]||null:null,'include':_0x525441['options']?_0x525441[_0x0ec6('0x1f')][_0x0ec6('0x24')]?_[_0x0ec6('0x25')](_0x525441['options']['include'],function(_0x582477){return{'model':db[_0x582477[_0x0ec6('0x26')]],'as':_0x582477['as'],'attributes':_0x582477['attributes'],'include':_0x582477[_0x0ec6('0x24')]?_[_0x0ec6('0x25')](_0x582477[_0x0ec6('0x24')],function(_0x50de99){return{'model':db[_0x50de99[_0x0ec6('0x26')]],'as':_0x50de99['as'],'attributes':_0x50de99[_0x0ec6('0x22')],'include':_0x50de99['include']?_[_0x0ec6('0x25')](_0x50de99[_0x0ec6('0x24')],function(_0x4829c3){return{'model':db[_0x4829c3[_0x0ec6('0x26')]],'as':_0x4829c3['as'],'attributes':_0x4829c3['attributes']};}):[]};}):[]};}):[]:[]})[_0x0ec6('0x27')](function(_0x218489){logger[_0x0ec6('0x11')](_0x0ec6('0x1c'),_0x525441);logger['debug'](_0x0ec6('0x1c'),_0x525441,JSON[_0x0ec6('0x16')](_0x218489));_0x5bd844(_0x218489);})[_0x0ec6('0x1b')](function(_0x451047){logger[_0x0ec6('0x17')](_0x0ec6('0x1c'),_0x451047['message'],_0x525441);_0x35adb2(_0x5beefb[_0x0ec6('0x17')](0x1f4,_0x451047[_0x0ec6('0x19')]));});});};exports[_0x0ec6('0x28')]=function(_0x5287e8){var _0xe10da3=this;return new Promise(function(_0xf4af73,_0x277284){return db[_0x0ec6('0x1d')][_0x0ec6('0x29')](_0x5287e8[_0x0ec6('0x2a')],{'raw':_0x5287e8[_0x0ec6('0x1f')]?_0x5287e8['options'][_0x0ec6('0x20')]===undefined?!![]:![]:!![]})[_0x0ec6('0x27')](function(_0x6aefdb){logger[_0x0ec6('0x11')](_0x0ec6('0x28'),_0x5287e8);logger[_0x0ec6('0x13')](_0x0ec6('0x28'),_0x5287e8,JSON[_0x0ec6('0x16')](_0x6aefdb));_0xf4af73(_0x6aefdb);})[_0x0ec6('0x1b')](function(_0x2beda8){logger['error']('CreateVoiceQueueReport',_0x2beda8['message'],_0x5287e8);_0x277284(_0xe10da3[_0x0ec6('0x17')](0x1f4,_0x2beda8[_0x0ec6('0x19')]));});});};exports[_0x0ec6('0x2b')]=function(_0x4bb510){var _0x36f653=this;return new Promise(function(_0x480609,_0x4e91ed){return db['VoiceQueueReport']['update'](_0x4bb510['body'],{'raw':_0x4bb510[_0x0ec6('0x1f')]?_0x4bb510[_0x0ec6('0x1f')][_0x0ec6('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bb510[_0x0ec6('0x1f')]?_0x4bb510['options'][_0x0ec6('0x21')]||null:null,'attributes':_0x4bb510[_0x0ec6('0x1f')]?_0x4bb510[_0x0ec6('0x1f')][_0x0ec6('0x22')]||null:null,'limit':_0x4bb510[_0x0ec6('0x1f')]?_0x4bb510[_0x0ec6('0x1f')][_0x0ec6('0x23')]||null:null})[_0x0ec6('0x27')](function(_0x31fcc2){logger['info'](_0x0ec6('0x2b'),_0x4bb510);logger[_0x0ec6('0x13')](_0x0ec6('0x2b'),_0x4bb510,JSON['stringify'](_0x31fcc2));_0x480609(_0x31fcc2);})[_0x0ec6('0x1b')](function(_0x66288e){logger[_0x0ec6('0x17')](_0x0ec6('0x2b'),_0x66288e[_0x0ec6('0x19')],_0x4bb510);_0x4e91ed(_0x36f653['error'](0x1f4,_0x66288e[_0x0ec6('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js
index fad5ce5..fef6e8a 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 _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
+var _0xe054=['length','voiceQueueReport:','./voiceQueueReport.events','remove','update','emit','register'];(function(_0x5d8b92,_0x1cbd6f){var _0x1e9863=function(_0x49465e){while(--_0x49465e){_0x5d8b92['push'](_0x5d8b92['shift']());}};_0x1e9863(++_0x1cbd6f);}(_0xe054,0xd4));var _0x4e05=function(_0x509239,_0x4fab00){_0x509239=_0x509239-0x0;var _0x39eae0=_0xe054[_0x509239];return _0x39eae0;};'use strict';var VoiceQueueReportEvents=require(_0x4e05('0x0'));var events=['save',_0x4e05('0x1'),_0x4e05('0x2')];function createListener(_0x5e677c,_0x5da77e){return function(_0x11d32d){_0x5da77e[_0x4e05('0x3')](_0x5e677c,_0x11d32d);};}function removeListener(_0x21fa0c,_0x199471){return function(){VoiceQueueReportEvents['removeListener'](_0x21fa0c,_0x199471);};}exports[_0x4e05('0x4')]=function(_0x470380){for(var _0x94d5c3=0x0,_0x14318d=events[_0x4e05('0x5')];_0x94d5c3<_0x14318d;_0x94d5c3++){var _0x215f81=events[_0x94d5c3];var _0x5c2fd0=createListener(_0x4e05('0x6')+_0x215f81,_0x470380);VoiceQueueReportEvents['on'](_0x215f81,_0x5c2fd0);}};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js
index 0efd417..6a77773 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 _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
+var _0x8135=['../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x375325,_0x57a850){var _0x228f57=function(_0x2ad744){while(--_0x2ad744){_0x375325['push'](_0x375325['shift']());}};_0x228f57(++_0x57a850);}(_0x8135,0xdb));var _0x5813=function(_0xe3ec36,_0x509f67){_0xe3ec36=_0xe3ec36-0x0;var _0x53115c=_0x8135[_0xe3ec36];return _0x53115c;};'use strict';var multer=require(_0x5813('0x0'));var util=require('util');var path=require(_0x5813('0x1'));var timeout=require(_0x5813('0x2'));var express=require(_0x5813('0x3'));var router=express[_0x5813('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5813('0x5'));var config=require(_0x5813('0x6'));var controller=require(_0x5813('0x7'));router[_0x5813('0x8')]('/',auth[_0x5813('0x9')](),controller['index']);router[_0x5813('0x8')](_0x5813('0xa'),auth[_0x5813('0x9')](),controller[_0x5813('0xb')]);router['post']('/',auth[_0x5813('0x9')](),controller['create']);router['put'](_0x5813('0xa'),auth[_0x5813('0x9')](),controller[_0x5813('0xc')]);router[_0x5813('0xd')](_0x5813('0xa'),auth[_0x5813('0x9')](),controller[_0x5813('0xe')]);module[_0x5813('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
index 69dc95b..55f86db 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 _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
+var _0xb1ef=['YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING','format'];(function(_0x45578f,_0x11c97e){var _0x4461bc=function(_0x2e67ad){while(--_0x2e67ad){_0x45578f['push'](_0x45578f['shift']());}};_0x4461bc(++_0x11c97e);}(_0xb1ef,0x146));var _0xfb1e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb1ef[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xfb1e('0x0'));var moment=require('moment');module[_0xfb1e('0x1')]={'time':{'type':Sequelize[_0xfb1e('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xfb1e('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xfb1e('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xfb1e('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xfb1e('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xfb1e('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xfb1e('0x3')](_0xfb1e('0x4'))}};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js
index d95dc83..4cfabb1 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 _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
+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(_0x3602d4,_0x127c1a){var _0x360b73=function(_0xc374b5){while(--_0xc374b5){_0x3602d4['push'](_0x3602d4['shift']());}};_0x360b73(++_0x127c1a);}(_0xb10b,0x12a));var _0xbb10=function(_0x554b96,_0xa7f28){_0x554b96=_0x554b96-0x0;var _0xe445a8=_0xb10b[_0x554b96];return _0xe445a8;};'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
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js
index 4f8fbd0..94c2d0e 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 _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
+var _0x3f8a=['rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2e30ad,_0x3a4619){var _0x50bb7e=function(_0x19c68c){while(--_0x19c68c){_0x2e30ad['push'](_0x2e30ad['shift']());}};_0x50bb7e(++_0x3a4619);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x45db29,_0x31f6e6){_0x45db29=_0x45db29-0x0;var _0x5f4881=_0x3f8a[_0x45db29];return _0x5f4881;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));module[_0xa3f8('0xa')]=function(_0x471464,_0x1f160a){return _0x471464[_0xa3f8('0xb')](_0xa3f8('0xc'),attributes,{'tableName':_0xa3f8('0xd'),'paranoid':![],'indexes':[{'name':_0xa3f8('0xe'),'fields':[_0xa3f8('0xf'),_0xa3f8('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
index ccb7227..233e682 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 _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
+var _0xa699=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3c9b8b,_0x2861a9){var _0x5325ae=function(_0x206748){while(--_0x206748){_0x3c9b8b['push'](_0x3c9b8b['shift']());}};_0x5325ae(++_0x2861a9);}(_0xa699,0x6b));var _0x9a69=function(_0x1c9c24,_0x2a517b){_0x1c9c24=_0x1c9c24-0x0;var _0x349c69=_0xa699[_0x1c9c24];return _0x349c69;};'use strict';var _=require(_0x9a69('0x0'));var util=require(_0x9a69('0x1'));var moment=require(_0x9a69('0x2'));var BPromise=require(_0x9a69('0x3'));var rs=require(_0x9a69('0x4'));var fs=require('fs');var Redis=require(_0x9a69('0x5'));var db=require(_0x9a69('0x6'))['db'];var utils=require(_0x9a69('0x7'));var logger=require(_0x9a69('0x8'))(_0x9a69('0x9'));var config=require(_0x9a69('0xa'));var jayson=require(_0x9a69('0xb'));var client=jayson[_0x9a69('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26b842,_0x3f9bce,_0x3bb021){return new BPromise(function(_0x4665a9,_0x5031b0){return client[_0x9a69('0xd')](_0x26b842,_0x3bb021)[_0x9a69('0xe')](function(_0x3fb953){logger[_0x9a69('0xf')](_0x9a69('0x10'),_0x3f9bce,'request\x20sent');logger['debug'](_0x9a69('0x11'),_0x3f9bce,'request\x20sent',JSON[_0x9a69('0x12')](_0x3fb953));if(_0x3fb953[_0x9a69('0x13')]){if(_0x3fb953['error'][_0x9a69('0x14')]===0x1f4){logger[_0x9a69('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3f9bce,_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);return _0x5031b0(_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);}logger[_0x9a69('0x13')](_0x9a69('0x10'),_0x3f9bce,_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);return _0x4665a9(_0x3fb953[_0x9a69('0x13')]['message']);}else{logger[_0x9a69('0xf')](_0x9a69('0x10'),_0x3f9bce,_0x9a69('0x16'));_0x4665a9(_0x3fb953['result'][_0x9a69('0x15')]);}})[_0x9a69('0x17')](function(_0x380e46){logger[_0x9a69('0x13')](_0x9a69('0x10'),_0x3f9bce,_0x380e46);_0x5031b0(_0x380e46);});});}
\ No newline at end of file
diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js
index 6aee9a5..9f5cd85 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(_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
+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(_0x5da1f5,_0x5d5afe){var _0x51e6e6=function(_0x3005ce){while(--_0x3005ce){_0x5da1f5['push'](_0x5da1f5['shift']());}};_0x51e6e6(++_0x5d5afe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 b64ff34..728ed3a 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 _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
+var _0xa71f=['TEXT','NEW','FLOAT','BOOLEAN','DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','sequelize','moment','path','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','channel','membername','split','INTEGER'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0xa71f,0x111));var _0xfa71=function(_0x451f29,_0x3fae69){_0x451f29=_0x451f29-0x0;var _0x3ff282=_0xa71f[_0x451f29];return _0x3ff282;};'use strict';var Sequelize=require(_0xfa71('0x0'));var moment=require(_0xfa71('0x1'));var path=require(_0xfa71('0x2'));module['exports']={'format':{'type':Sequelize[_0xfa71('0x3')],'get':function(){return this[_0xfa71('0x4')](_0xfa71('0x5'))?path[_0xfa71('0x6')](this[_0xfa71('0x4')](_0xfa71('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0xfa71('0x7')]},'channel':{'type':Sequelize['STRING'],'set':function(_0x3b16e3){if(_0x3b16e3){this[_0xfa71('0x8')](_0xfa71('0x9'),_0x3b16e3);this['setDataValue'](_0xfa71('0xa'),_0x3b16e3[_0xfa71('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xfa71('0x7')]},'calleridnum':{'type':Sequelize[_0xfa71('0x7')]},'calleridname':{'type':Sequelize[_0xfa71('0x7')]},'connectedlinenum':{'type':Sequelize[_0xfa71('0x7')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xfa71('0x7')]},'context':{'type':Sequelize[_0xfa71('0x7')]},'exten':{'type':Sequelize[_0xfa71('0x7')]},'value':{'type':Sequelize[_0xfa71('0x7')]},'type':{'type':Sequelize[_0xfa71('0x7')]},'rating':{'type':Sequelize[_0xfa71('0xc')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xfa71('0x7')]},'location':{'type':Sequelize[_0xfa71('0xd')]},'transcribeName':{'type':Sequelize['STRING']},'transcribeStatus':{'type':Sequelize[_0xfa71('0x7')],'defaultValue':_0xfa71('0xe')},'fileUri':{'type':Sequelize[_0xfa71('0xd')]},'fileText':{'type':Sequelize[_0xfa71('0xd')]},'failureReason':{'type':Sequelize['TEXT']},'sentiment':{'type':Sequelize[_0xfa71('0x7')]},'sPositive':{'type':Sequelize[_0xfa71('0xf')]},'sNegative':{'type':Sequelize[_0xfa71('0xf')]},'sNeutral':{'type':Sequelize[_0xfa71('0xf')]},'sMixed':{'type':Sequelize[_0xfa71('0xf')]},'tempSentiment':{'type':Sequelize[_0xfa71('0x10')],'defaultValue':![]},'createdAt':{'type':Sequelize[_0xfa71('0x11')],'get':function(){return moment(this[_0xfa71('0x4')](_0xfa71('0x12')))[_0xfa71('0x13')](_0xfa71('0x14'))[_0xfa71('0x15')]();}},'updatedAt':{'type':Sequelize[_0xfa71('0x11')],'get':function(){return moment(this[_0xfa71('0x4')]('updatedAt'))[_0xfa71('0x13')](_0xfa71('0x14'))[_0xfa71('0x15')]();}}};
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js
index ed9f232..f72a81c 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 _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
+var _0x8076=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','VoiceRecording','fieldName','type','key','differenceBy','map','query','keys','intersection','model','attributes','fields','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','rows','catch','params','rawAttributes','include','options','find','create','body','describe','download','../../components/encryptor','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','send','Not\x20found','downloads','sequelize','MD5','col','token','uniqueid','$and','push','extname','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','TranscribeService','startTranscriptionJob','info','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','html-pdf','eml-format','rimraf','zip-dir','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','ioredis'];(function(_0x131f2e,_0x495832){var _0x548acf=function(_0xe1c41c){while(--_0xe1c41c){_0x131f2e['push'](_0x131f2e['shift']());}};_0x548acf(++_0x495832);}(_0x8076,0x86));var _0x6807=function(_0x379397,_0x37fbf4){_0x379397=_0x379397-0x0;var _0x289867=_0x8076[_0x379397];return _0x289867;};'use strict';var pdf=require(_0x6807('0x0'));var emlformat=require(_0x6807('0x1'));var rimraf=require(_0x6807('0x2'));var zipdir=require(_0x6807('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6807('0x4'));var Mustache=require('mustache');var util=require(_0x6807('0x5'));var path=require('path');var sox=require(_0x6807('0x6'));var csv=require('to-csv');var ejs=require(_0x6807('0x7'));var fs=require('fs');var _=require(_0x6807('0x8'));var squel=require(_0x6807('0x9'));var crypto=require(_0x6807('0xa'));var jsforce=require(_0x6807('0xb'));var deskjs=require(_0x6807('0xc'));var toCsv=require(_0x6807('0xd'));var querystring=require(_0x6807('0xe'));var Papa=require(_0x6807('0xf'));var AWS=require(_0x6807('0x10'));var uuidv4=require(_0x6807('0x11'));var Redis=require(_0x6807('0x12'));var authService=require(_0x6807('0x13'));var qs=require(_0x6807('0x14'));var as=require(_0x6807('0x15'));var hardwareService=require(_0x6807('0x16'));var logger=require(_0x6807('0x17'))(_0x6807('0x18'));var utils=require(_0x6807('0x19'));var config=require('../../config/environment');var db=require(_0x6807('0x1a'))['db'];function respondWithStatusCode(_0x3f9275,_0x105c68){_0x105c68=_0x105c68||0xcc;return function(_0x3fd1be){if(_0x3fd1be){return _0x3f9275['sendStatus'](_0x105c68);}return _0x3f9275[_0x6807('0x1b')](_0x105c68)[_0x6807('0x1c')]();};}function respondWithResult(_0x5ce17c,_0x4305a3){_0x4305a3=_0x4305a3||0xc8;return function(_0x4c3609){if(_0x4c3609){return _0x5ce17c[_0x6807('0x1b')](_0x4305a3)[_0x6807('0x1d')](_0x4c3609);}};}function respondWithFilteredResult(_0xe5efdc,_0x2e23fb){return function(_0x5baedd){if(_0x5baedd){var _0x414b7a=_0x5baedd[_0x6807('0x1e')],_0x334ae4=_0x2e23fb[_0x6807('0x1f')],_0x3b32ca=_0x2e23fb[_0x6807('0x1f')]+_0x2e23fb[_0x6807('0x20')],_0x100d92;if(_0x3b32ca>=_0x414b7a){_0x3b32ca=_0x414b7a;_0x100d92=0xc8;}else{_0x100d92=0xce;}_0xe5efdc[_0x6807('0x1b')](_0x100d92);return _0xe5efdc[_0x6807('0x21')]('Content-Range',_0x334ae4+'-'+_0x3b32ca+'/'+_0x414b7a)[_0x6807('0x1d')](_0x5baedd);}return null;};}function patchUpdates(_0x2b74ae){return function(_0x4ee9ee){try{jsonpatch[_0x6807('0x22')](_0x4ee9ee,_0x2b74ae,!![]);}catch(_0x598769){return BPromise[_0x6807('0x23')](_0x598769);}return _0x4ee9ee[_0x6807('0x24')]();};}function saveUpdates(_0x468f01,_0x4f9573){return function(_0x455654){if(_0x455654){return _0x455654[_0x6807('0x25')](_0x468f01)[_0x6807('0x26')](function(_0x42faba){return _0x42faba;});}return null;};}function removeEntity(_0x3c4a60,_0x1f41f5){return function(_0x494baf){if(_0x494baf){return _0x494baf[_0x6807('0x27')]()['then'](function(){_0x3c4a60['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bd366,_0xcb6d8){return function(_0x56ebd2){if(!_0x56ebd2){_0x1bd366[_0x6807('0x28')](0x194);}return _0x56ebd2;};}function handleError(_0x2683e4,_0x3ecb2d){_0x3ecb2d=_0x3ecb2d||0x1f4;return function(_0x321eca){logger[_0x6807('0x29')](_0x321eca[_0x6807('0x2a')]);if(_0x321eca[_0x6807('0x2b')]){delete _0x321eca[_0x6807('0x2b')];}_0x2683e4[_0x6807('0x1b')](_0x3ecb2d)['send'](_0x321eca);};}exports[_0x6807('0x2c')]=function(_0x2436cc,_0x48c795){var _0x46921e={},_0x4c7485={},_0x358c38={'count':0x0,'rows':[]};var _0x539a78=_['map'](db[_0x6807('0x2d')]['rawAttributes'],function(_0x26ec23){return{'name':_0x26ec23[_0x6807('0x2e')],'type':_0x26ec23[_0x6807('0x2f')][_0x6807('0x30')]};});_0x4c7485['model']=_[_0x6807('0x31')](_[_0x6807('0x32')](_0x539a78,'name'),['format']);_0x4c7485[_0x6807('0x33')]=_[_0x6807('0x34')](_0x2436cc[_0x6807('0x33')]);_0x4c7485['filters']=_[_0x6807('0x35')](_0x4c7485[_0x6807('0x36')],_0x4c7485['query']);_0x46921e[_0x6807('0x37')]=_[_0x6807('0x35')](_0x4c7485[_0x6807('0x36')],qs['fields'](_0x2436cc[_0x6807('0x33')][_0x6807('0x38')]));_0x46921e[_0x6807('0x37')]=_0x46921e['attributes'][_0x6807('0x39')]?_0x46921e[_0x6807('0x37')]:_0x4c7485[_0x6807('0x36')];if(!_0x2436cc[_0x6807('0x33')]['hasOwnProperty'](_0x6807('0x3a'))){_0x46921e[_0x6807('0x20')]=qs[_0x6807('0x20')](_0x2436cc[_0x6807('0x33')][_0x6807('0x20')]);_0x46921e['offset']=qs['offset'](_0x2436cc[_0x6807('0x33')][_0x6807('0x1f')]);}_0x46921e['order']=qs[_0x6807('0x3b')](_0x2436cc['query'][_0x6807('0x3b')]);_0x46921e[_0x6807('0x3c')]=qs[_0x6807('0x3d')](_['pick'](_0x2436cc['query'],_0x4c7485[_0x6807('0x3d')]),_0x539a78);if(_0x2436cc['query'][_0x6807('0x3e')]){_0x46921e[_0x6807('0x3c')]=_[_0x6807('0x3f')](_0x46921e['where'],{'$or':_[_0x6807('0x32')](_0x539a78,function(_0x3dd57f){if(_0x3dd57f[_0x6807('0x2f')]!==_0x6807('0x40')){var _0xbdab2b={};_0xbdab2b[_0x3dd57f[_0x6807('0x2b')]]={'$like':'%'+_0x2436cc[_0x6807('0x33')][_0x6807('0x3e')]+'%'};return _0xbdab2b;}})});}_0x46921e=_[_0x6807('0x3f')]({},_0x46921e,_0x2436cc['options']);var _0x2b3f01={'where':_0x46921e[_0x6807('0x3c')]};return db[_0x6807('0x2d')]['count'](_0x2b3f01)[_0x6807('0x26')](function(_0x5273ea){_0x358c38[_0x6807('0x1e')]=_0x5273ea;if(_0x2436cc[_0x6807('0x33')]['includeAll']){_0x46921e['include']=[{'all':!![]}];}return db[_0x6807('0x2d')]['findAll'](_0x46921e);})[_0x6807('0x26')](function(_0x446223){_0x358c38[_0x6807('0x41')]=_0x446223;return _0x358c38;})[_0x6807('0x26')](respondWithFilteredResult(_0x48c795,_0x46921e))[_0x6807('0x42')](handleError(_0x48c795,null));};exports['show']=function(_0x224271,_0x14e4db){var _0xc58de6={'raw':![],'where':{'id':_0x224271[_0x6807('0x43')]['id']}},_0x38d43b={};_0x38d43b['model']=_[_0x6807('0x34')](db['VoiceRecording'][_0x6807('0x44')]);_0x38d43b['query']=_[_0x6807('0x34')](_0x224271[_0x6807('0x33')]);_0x38d43b[_0x6807('0x3d')]=_['intersection'](_0x38d43b[_0x6807('0x36')],_0x38d43b[_0x6807('0x33')]);_0xc58de6[_0x6807('0x37')]=_[_0x6807('0x35')](_0x38d43b[_0x6807('0x36')],qs[_0x6807('0x38')](_0x224271['query'][_0x6807('0x38')]));_0xc58de6['attributes']=_0xc58de6[_0x6807('0x37')][_0x6807('0x39')]?_0xc58de6['attributes']:_0x38d43b[_0x6807('0x36')];if(_0x224271['query']['includeAll']){_0xc58de6[_0x6807('0x45')]=[{'all':!![]}];}_0xc58de6=_[_0x6807('0x3f')]({},_0xc58de6,_0x224271[_0x6807('0x46')]);return db[_0x6807('0x2d')][_0x6807('0x47')](_0xc58de6)[_0x6807('0x26')](handleEntityNotFound(_0x14e4db,null))[_0x6807('0x26')](respondWithResult(_0x14e4db,null))[_0x6807('0x42')](handleError(_0x14e4db,null));};exports[_0x6807('0x48')]=function(_0x403bce,_0x1f0096){return db['VoiceRecording'][_0x6807('0x48')](_0x403bce[_0x6807('0x49')],{})[_0x6807('0x26')](respondWithResult(_0x1f0096,0xc9))[_0x6807('0x42')](handleError(_0x1f0096,null));};exports[_0x6807('0x25')]=function(_0x3283d8,_0x131160){if(_0x3283d8[_0x6807('0x49')]['id']){delete _0x3283d8[_0x6807('0x49')]['id'];}return db['VoiceRecording'][_0x6807('0x47')]({'where':{'id':_0x3283d8[_0x6807('0x43')]['id']}})[_0x6807('0x26')](handleEntityNotFound(_0x131160,null))['then'](saveUpdates(_0x3283d8[_0x6807('0x49')],null))[_0x6807('0x26')](respondWithResult(_0x131160,null))[_0x6807('0x42')](handleError(_0x131160,null));};exports[_0x6807('0x4a')]=function(_0x2001f2,_0x489094){return db[_0x6807('0x2d')][_0x6807('0x4a')]()[_0x6807('0x26')](respondWithResult(_0x489094,null))['catch'](handleError(_0x489094,null));};exports[_0x6807('0x4b')]=function(_0x4fa1b1,_0xa915ce,_0x2ee706){var _0x16efed=require(_0x6807('0x4c'));var _0x354096=![];var _0xaf1fd8={};if(_0x4fa1b1[_0x6807('0x33')]['type']&&_0x4fa1b1['query'][_0x6807('0x2f')]==='uniqueid'){_0xaf1fd8['uniqueid']=_0x4fa1b1[_0x6807('0x43')]['id'];}else{_0xaf1fd8['id']=_0x4fa1b1[_0x6807('0x43')]['id'];}return db[_0x6807('0x2d')][_0x6807('0x47')]({'where':_0xaf1fd8,'attributes':['id',_0x6807('0x4d')],'raw':!![]})[_0x6807('0x26')](handleEntityNotFound(_0xa915ce,null))[_0x6807('0x26')](function(_0x207ba8){if(_0x207ba8){var _0x4dfe78=_0x207ba8[_0x6807('0x4d')];var _0x110f4f=util[_0x6807('0x4e')](_0x6807('0x4f'),_0x4dfe78);if(fs[_0x6807('0x50')](_0x110f4f)){_0x354096=!![];return _0x16efed[_0x6807('0x51')](_0x110f4f,_0x4dfe78,config[_0x6807('0x52')][_0x6807('0x53')])[_0x6807('0x26')](function(){return _0x207ba8;});}return _0x207ba8;}})[_0x6807('0x26')](function(_0x162a2e){if(_0x162a2e){var _0x3b3d0c=_0x162a2e[_0x6807('0x4d')];if(!fs['existsSync'](_0x3b3d0c)){throw new db[(_0x6807('0x54'))][(_0x6807('0x55'))](_0x6807('0x56'));}if(_0x162a2e[_0x6807('0x57')]){return _0xa915ce['download'](_0x3b3d0c,_0x162a2e[_0x6807('0x57')]+path['extname'](_0x3b3d0c),function(){if(_0x354096){fs[_0x6807('0x58')](_0x3b3d0c);}});}else{return _0xa915ce['download'](_0x3b3d0c,function(_0x445323){if(_0x354096){fs[_0x6807('0x58')](_0x3b3d0c);}});}}})[_0x6807('0x42')](function(_0xd0e24a){if(_0xd0e24a[_0x6807('0x59')]===_0x6807('0x56')){_0xa915ce[_0x6807('0x1b')](0x194)[_0x6807('0x5a')](_0x6807('0x5b'));}else{return handleError(_0xa915ce,null);}});};exports[_0x6807('0x5c')]=function(_0x240ba3,_0x5cea5b,_0x39f1ba){var _0x281e73=require(_0x6807('0x4c'));var _0x59b51b=![];var _0x1b6d6c={'$and':[db[_0x6807('0x5d')][_0x6807('0x3c')](db['sequelize']['fn'](_0x6807('0x5e'),db['sequelize'][_0x6807('0x5f')]('uniqueid')),_0x240ba3[_0x6807('0x33')][_0x6807('0x60')])]};if(_0x240ba3[_0x6807('0x33')]['type']&&_0x240ba3[_0x6807('0x33')][_0x6807('0x2f')]===_0x6807('0x61')){_0x1b6d6c['$and']['push']({'uniqueid':_0x240ba3[_0x6807('0x43')]['id']});}else{_0x1b6d6c[_0x6807('0x62')][_0x6807('0x63')]({'id':_0x240ba3['params']['id']});}return db['VoiceRecording'][_0x6807('0x47')]({'where':_0x1b6d6c,'attributes':['id',_0x6807('0x4d')],'raw':!![]})[_0x6807('0x26')](handleEntityNotFound(_0x5cea5b,null))['then'](function(_0x3faea3){if(_0x3faea3){var _0xd7f841=util['format'](_0x6807('0x4f'),_0x3faea3[_0x6807('0x4d')]);if(fs[_0x6807('0x50')](_0xd7f841)){_0x59b51b=!![];return _0x281e73[_0x6807('0x51')](_0xd7f841,_0x3faea3[_0x6807('0x4d')],config['secrets'][_0x6807('0x53')])[_0x6807('0x26')](function(){return _0x3faea3;});}return _0x3faea3;}})['then'](function(_0x210670){if(_0x210670){if(!fs['existsSync'](_0x210670[_0x6807('0x4d')])){throw new db['Sequelize'][(_0x6807('0x55'))](_0x6807('0x56'));}if(_0x210670['filename']){return _0x5cea5b[_0x6807('0x4b')](_0x210670['value'],_0x210670[_0x6807('0x57')]+path[_0x6807('0x64')](_0x210670[_0x6807('0x4d')]),function(){if(_0x59b51b){fs[_0x6807('0x58')](_0x210670['value']);}});}else{return _0x5cea5b['download'](_0x210670[_0x6807('0x4d')],function(_0x181614){if(_0x59b51b){fs[_0x6807('0x58')](_0x210670['value']);}});}}})[_0x6807('0x42')](handleError(_0x5cea5b,null));};exports[_0x6807('0x27')]=function(_0x352d3c,_0x2bafa9){return db[_0x6807('0x2d')][_0x6807('0x47')]({'where':{'id':_0x352d3c[_0x6807('0x43')]['id']}})['then'](function(_0x3e56f5){if(!_0x3e56f5)throw new ReferenceError('Entity\x20not\x20found');return _0x3e56f5;})[_0x6807('0x26')](function(_0x57207b){var _0x18891a=_0x57207b[_0x6807('0x4d')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x18891a);if(!_[_0x6807('0x65')](_0x57207b[_0x6807('0x4d')])&&fs['existsSync'](_0x18891a)){logger['info'](_0x6807('0x66')+_0x18891a+_0x6807('0x67'));fs[_0x6807('0x68')](_0x18891a);}_0x18891a=_0x18891a+_0x6807('0x69');if(!_['isNil'](_0x57207b['value'])&&fs[_0x6807('0x50')](_0x18891a)){logger['info'](_0x6807('0x66')+_0x18891a+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x18891a);}return _0x57207b;})[_0x6807('0x26')](function(_0x54d3f7){if(!_0x54d3f7)throw new InternalError();return _0x54d3f7['destroy']();})[_0x6807('0x26')](function(){_0x2bafa9[_0x6807('0x1b')](0xcc)[_0x6807('0x1c')]();})[_0x6807('0x42')](handleError(_0x2bafa9,null));};function getBucketslist(_0x32f984,_0x1d979f,_0x15f22e){return new Promise(function(_0x4da98a,_0xcdf95f){var _0x5d4729=new AWS['S3']({'accessKeyId':_0x1d979f,'secretAccessKey':_0x32f984,'region':_0x15f22e});_0x5d4729[_0x6807('0x6a')]({},function(_0x479be0,_0x32822b){if(_0x479be0){return _0xcdf95f(_0x479be0);}else{return _0x4da98a(_0x32822b);}});});}function createBucket(_0xff86d1,_0x142e28,_0x4ef63d,_0x40659b){return new Promise(function(_0xb5348d,_0x42597d){var _0x5f3063=new AWS['S3']({'accessKeyId':_0x142e28,'secretAccessKey':_0xff86d1,'region':_0x4ef63d});_0x5f3063[_0x6807('0x6b')]({'Bucket':_0x40659b},function(_0x43a6a9,_0x589470){if(_0x43a6a9){return _0x42597d(_0x43a6a9);}else{return _0xb5348d(_0x589470);}});});}function uploadFile(_0x12028e,_0x37bc8c,_0x284b8c,_0x565cc3,_0x464423,_0x50325d){return new Promise(function(_0x52e727,_0xca6203){var _0x58756c=new AWS['S3']({'accessKeyId':_0x37bc8c,'secretAccessKey':_0x12028e,'region':_0x284b8c});_0x58756c['upload']({'Bucket':_0x565cc3,'Key':_0x464423,'Body':_0x50325d},function(_0x31a656,_0x1f9d44){if(_0x31a656){return _0xca6203(_0x31a656);}else{return _0x52e727(_0x1f9d44);}});});}function startTranscribe(_0x4d5fb7,_0x401e5c,_0x43698a,_0x482d0c,_0x42a5db,_0x3b9d40){return new Promise(function(_0x3abd9d,_0x47fe1a){var _0x484baf=new AWS[(_0x6807('0x6c'))]({'accessKeyId':_0x401e5c,'secretAccessKey':_0x4d5fb7,'region':_0x43698a});_0x484baf[_0x6807('0x6d')]({'TranscriptionJobName':_0x482d0c,'LanguageCode':_0x42a5db,'Media':{'MediaFileUri':_0x3b9d40}},function(_0x1f6e3e,_0x322acc){if(_0x1f6e3e){return _0x47fe1a(_0x1f6e3e);}else{return _0x3abd9d(_0x322acc);}});});}function transcribe(_0x311c7a,_0x248d24,_0x5544b5,_0x15ff6b,_0xb025ad,_0x5b0b7f,_0x375493){return new Promise(function(_0x3246cb,_0x203b60){var _0x4aadc3={};logger[_0x6807('0x6e')](util['format'](_0x6807('0x6f'),_0x311c7a,_0xb025ad));return uploadFile(_0x248d24,_0x5544b5,_0x15ff6b,_0xb025ad,path['basename'](_0x5b0b7f),fs[_0x6807('0x70')](_0x5b0b7f))[_0x6807('0x26')](function(_0x1381eb){logger[_0x6807('0x6e')](util[_0x6807('0x4e')](_0x6807('0x71'),_0x311c7a,_0xb025ad,_0x1381eb[_0x6807('0x72')]));_0x4aadc3[_0x6807('0x73')]=_0x1381eb['Bucket'];_0x4aadc3[_0x6807('0x74')]=_0x1381eb[_0x6807('0x72')];logger[_0x6807('0x6e')](util[_0x6807('0x4e')](_0x6807('0x75'),_0x311c7a));return startTranscribe(_0x248d24,_0x5544b5,_0x15ff6b,uuidv4(),_0x375493,_0x1381eb[_0x6807('0x72')]);})[_0x6807('0x26')](function(_0x30a408){logger[_0x6807('0x6e')](util[_0x6807('0x4e')](_0x6807('0x76'),_0x311c7a,_0x30a408[_0x6807('0x77')][_0x6807('0x78')]));_0x4aadc3[_0x6807('0x79')]=_0x30a408[_0x6807('0x77')][_0x6807('0x78')];_0x4aadc3[_0x6807('0x7a')]=_0x30a408['TranscriptionJob'][_0x6807('0x7b')];return _0x3246cb(_0x4aadc3);})[_0x6807('0x42')](function(_0x4675cb){return _0x203b60(_0x4675cb);});});}exports[_0x6807('0x7c')]=function(_0x4712be,_0x31aead,_0x33037c){var _0x187cad;var _0x10e3c0;var _0x379cea;var _0x3118c1=require(_0x6807('0x4c'));return db['VoiceRecording'][_0x6807('0x7d')]({'where':{'id':_0x4712be['params']['id']}})['then'](function(_0x584f56){if(_0x584f56){var _0x4c2225=util[_0x6807('0x4e')](_0x6807('0x4f'),_0x584f56[_0x6807('0x4d')]);if(fs[_0x6807('0x50')](_0x4c2225)){cypher=!![];return _0x3118c1[_0x6807('0x51')](_0x4c2225,_0x584f56['value'],config['secrets'][_0x6807('0x53')])[_0x6807('0x26')](function(){return _0x584f56;});}return _0x584f56;}})[_0x6807('0x26')](function(_0xdc896f){if(!_0xdc896f){throw new db['Sequelize']['ValidationError'](_0x6807('0x7e'));}_0x10e3c0=_0xdc896f;return db[_0x6807('0x7f')]['findOne']({'where':{'id':0x1}});})[_0x6807('0x26')](handleEntityNotFound(_0x31aead,null))[_0x6807('0x26')](function(_0x275f37){if(_0x275f37){_0x187cad=_0x275f37;if(!_0x187cad[_0x6807('0x80')]||!_0x187cad[_0x6807('0x81')]||!_0x187cad['transcribeRegion']||!_0x187cad[_0x6807('0x82')]||!_0x187cad[_0x6807('0x73')]){throw new db[(_0x6807('0x54'))]['ValidationError'](_0x6807('0x83'));}if(_0x4712be[_0x6807('0x49')]['runSentiment']&&(!_0x187cad['sentiment']||!_0x187cad[_0x6807('0x84')]||!_0x187cad[_0x6807('0x85')]||!_0x187cad[_0x6807('0x82')]||!_0x187cad[_0x6807('0x73')])){throw new db['Sequelize']['ValidationError'](_0x6807('0x86'));}return db['CloudProvider']['findOne']({'where':{'id':_0x187cad[_0x6807('0x81')]}});}})[_0x6807('0x26')](function(_0x460b58){if(!_0x460b58){throw new db[(_0x6807('0x54'))][(_0x6807('0x55'))](_0x6807('0x87'));}if(!_0x460b58[_0x6807('0x88')]||!_0x460b58[_0x6807('0x89')]){throw new db['Sequelize'][(_0x6807('0x55'))]('Cloud\x20Provider\x20not\x20configured');}_0x379cea=_0x460b58;return getBucketslist(_0x379cea['data1'],_0x379cea[_0x6807('0x89')],_0x187cad[_0x6807('0x8a')]);})[_0x6807('0x26')](function(_0x222bf0){if(_0x222bf0&&_0x222bf0[_0x6807('0x8b')]){var _0x10b486=_[_0x6807('0x47')](_0x222bf0[_0x6807('0x8b')],function(_0x5c3f17){return _0x5c3f17['Name']===_0x187cad['bucket'];});if(!_0x10b486){logger['info'](util[_0x6807('0x4e')](_0x6807('0x8c'),_0x4712be['params']['id'],_0x187cad[_0x6807('0x73')]));return createBucket(_0x379cea[_0x6807('0x88')],_0x379cea[_0x6807('0x89')],_0x187cad[_0x6807('0x8a')],_0x187cad[_0x6807('0x73')]);}logger[_0x6807('0x6e')](util[_0x6807('0x4e')](_0x6807('0x8d'),_0x4712be[_0x6807('0x43')]['id'],_0x187cad[_0x6807('0x73')]));return;}})[_0x6807('0x26')](function(_0x2adfcc){if(_0x10e3c0[_0x6807('0x7a')]===_0x6807('0x8e')){return transcribe(_0x4712be[_0x6807('0x43')]['id'],_0x379cea[_0x6807('0x88')],_0x379cea[_0x6807('0x89')],_0x187cad[_0x6807('0x8a')],_0x187cad[_0x6807('0x73')],_0x10e3c0[_0x6807('0x4d')],_0x187cad[_0x6807('0x82')]);}else{logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x4712be[_0x6807('0x43')]['id']));return{'transcribeStatus':_0x6807('0x8f')};}})[_0x6807('0x26')](function(_0x5b88c5){if(_0x5b88c5){_0x5b88c5['tempSentiment']=_0x4712be['body'][_0x6807('0x90')];return _0x10e3c0[_0x6807('0x91')](_0x5b88c5);}})[_0x6807('0x26')](respondWithResult(_0x31aead,null))[_0x6807('0x42')](handleError(_0x31aead,null));};function writeFile(_0x4f58e8,_0x30e5ee){return new Promise(function(_0x58a5d6,_0x1c481a){fs[_0x6807('0x92')](_0x30e5ee,_0x4f58e8,function(_0x2209c3,_0x4cf1b1){if(_0x2209c3){return _0x1c481a(_0x2209c3);}else{return _0x58a5d6(_0x4cf1b1);}});});}exports[_0x6807('0x93')]=function(_0x217716,_0x4ccd2a,_0xf8415f){return db[_0x6807('0x2d')][_0x6807('0x7d')]({'where':{'id':_0x217716[_0x6807('0x43')]['id']}})[_0x6807('0x26')](handleEntityNotFound(_0x4ccd2a))['then'](function(_0x557e4d){if(_0x557e4d&&_0x557e4d[_0x6807('0x94')]){var _0x12a7f9=_0x557e4d[_0x6807('0x94')];var _0x3e2279=config[_0x6807('0x95')]+_0x6807('0x96')+_0x557e4d['id']+_0x6807('0x97');if(fs['existsSync'](_0x3e2279)){return _0x3e2279;}return writeFile(_0x12a7f9,_0x3e2279)[_0x6807('0x26')](function(){return _0x3e2279;});}else{throw new db[(_0x6807('0x54'))][(_0x6807('0x55'))](_0x6807('0x98'));}})[_0x6807('0x26')](function(_0x29046e){return _0x4ccd2a[_0x6807('0x4b')](_0x29046e);})[_0x6807('0x42')](handleError(_0x4ccd2a));};
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js
index b58fb3c..7f64aaf 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 _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
+var _0x2e65=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util'];(function(_0x16e0c8,_0x4861eb){var _0xe4b5af=function(_0x5248bc){while(--_0x5248bc){_0x16e0c8['push'](_0x16e0c8['shift']());}};_0xe4b5af(++_0x4861eb);}(_0x2e65,0x193));var _0x52e6=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x2e65[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0x52e6('0x0'));var util=require(_0x52e6('0x1'));var logger=require(_0x52e6('0x2'))(_0x52e6('0x3'));var moment=require(_0x52e6('0x4'));var BPromise=require(_0x52e6('0x5'));var rp=require(_0x52e6('0x6'));var fs=require('fs');var path=require(_0x52e6('0x7'));var rimraf=require('rimraf');var config=require(_0x52e6('0x8'));var attributes=require(_0x52e6('0x9'));module[_0x52e6('0xa')]=function(_0xe67caa,_0x1cf6d2){return _0xe67caa[_0x52e6('0xb')](_0x52e6('0xc'),attributes,{'tableName':_0x52e6('0xd'),'paranoid':![],'indexes':[{'name':_0x52e6('0xe'),'fields':[_0x52e6('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js
index 6905f81..240ac35 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(_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
+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(_0x197837,_0x439ae2){var _0x3eed5f=function(_0x4cb7da){while(--_0x4cb7da){_0x197837['push'](_0x197837['shift']());}};_0x3eed5f(++_0x439ae2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 006cb56..e9796d1 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 _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
+var _0xdbf5=['index','/:id','show','put','update','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated'];(function(_0x417534,_0x59d401){var _0xfe2f8a=function(_0x2b9286){while(--_0x2b9286){_0x417534['push'](_0x417534['shift']());}};_0xfe2f8a(++_0x59d401);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x4c11b0,_0x347de0){_0x4c11b0=_0x4c11b0-0x0;var _0x58c3b4=_0xdbf5[_0x4c11b0];return _0x58c3b4;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var auth=require(_0x5dbf('0x3'));var interaction=require(_0x5dbf('0x4'));var config=require(_0x5dbf('0x5'));var controller=require(_0x5dbf('0x6'));router[_0x5dbf('0x7')]('/',auth[_0x5dbf('0x8')](),controller[_0x5dbf('0x9')]);router[_0x5dbf('0x7')](_0x5dbf('0xa'),auth[_0x5dbf('0x8')](),controller[_0x5dbf('0xb')]);router['post']('/',auth[_0x5dbf('0x8')](),controller['create']);router[_0x5dbf('0xc')](_0x5dbf('0xa'),auth[_0x5dbf('0x8')](),controller[_0x5dbf('0xd')]);router['delete'](_0x5dbf('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5dbf('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js
index 4820ded..3b520cc 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 _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
+var _0xe54c=['exports','ENUM','attended','STRING','Yes','moment'];(function(_0x42c939,_0x2a2e64){var _0x21cd7f=function(_0x5481da){while(--_0x5481da){_0x42c939['push'](_0x42c939['shift']());}};_0x21cd7f(++_0x2a2e64);}(_0xe54c,0x11f));var _0xce54=function(_0x2ca0cf,_0x2f56c3){_0x2ca0cf=_0x2ca0cf-0x0;var _0x12e852=_0xe54c[_0x2ca0cf];return _0x12e852;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xce54('0x0'));module[_0xce54('0x1')]={'type':{'type':Sequelize[_0xce54('0x2')]('blind',_0xce54('0x3'))},'result':{'type':Sequelize[_0xce54('0x4')]},'transfererchannel':{'type':Sequelize[_0xce54('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xce54('0x4')]},'transferercalleridname':{'type':Sequelize[_0xce54('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xce54('0x4')]},'transfererexten':{'type':Sequelize[_0xce54('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xce54('0x4')]},'transfereechannel':{'type':Sequelize[_0xce54('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xce54('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xce54('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xce54('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xce54('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xce54('0x4')]},'transfereecontext':{'type':Sequelize[_0xce54('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0xce54('0x4')]},'isexternal':{'type':Sequelize[_0xce54('0x2')](_0xce54('0x5'),'No')},'context':{'type':Sequelize[_0xce54('0x4')]},'extension':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js
index 6d94d71..b540b47 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 _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
+var _0xfdec=['sort','where','filters','pick','filter','merge','options','include','catch','params','length','includeAll','find','create','body','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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','../../config/utils','../../mysqldb','sendStatus','end','status','count','offset','Content-Range','json','apply','update','then','error','name','send','map','VoiceTransferReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','hasOwnProperty','limit','order'];(function(_0x32ef38,_0x126f8f){var _0x552e43=function(_0x36ec91){while(--_0x36ec91){_0x32ef38['push'](_0x32ef38['shift']());}};_0x552e43(++_0x126f8f);}(_0xfdec,0x98));var _0xcfde=function(_0xa89c3e,_0x144268){_0xa89c3e=_0xa89c3e-0x0;var _0x48072f=_0xfdec[_0xa89c3e];return _0x48072f;};'use strict';var pdf=require(_0xcfde('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcfde('0x1'));var zipdir=require(_0xcfde('0x2'));var jsonpatch=require(_0xcfde('0x3'));var rp=require('request-promise');var moment=require(_0xcfde('0x4'));var BPromise=require(_0xcfde('0x5'));var Mustache=require(_0xcfde('0x6'));var util=require(_0xcfde('0x7'));var path=require(_0xcfde('0x8'));var sox=require(_0xcfde('0x9'));var csv=require(_0xcfde('0xa'));var ejs=require(_0xcfde('0xb'));var fs=require('fs');var _=require(_0xcfde('0xc'));var squel=require(_0xcfde('0xd'));var crypto=require(_0xcfde('0xe'));var jsforce=require(_0xcfde('0xf'));var deskjs=require(_0xcfde('0x10'));var toCsv=require(_0xcfde('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcfde('0x11'));var authService=require(_0xcfde('0x12'));var qs=require(_0xcfde('0x13'));var as=require(_0xcfde('0x14'));var hardwareService=require(_0xcfde('0x15'));var logger=require(_0xcfde('0x16'))('api');var utils=require(_0xcfde('0x17'));var config=require('../../config/environment');var db=require(_0xcfde('0x18'))['db'];function respondWithStatusCode(_0x5a9f8f,_0x52ee92){_0x52ee92=_0x52ee92||0xcc;return function(_0x1abb88){if(_0x1abb88){return _0x5a9f8f[_0xcfde('0x19')](_0x52ee92);}return _0x5a9f8f['status'](_0x52ee92)[_0xcfde('0x1a')]();};}function respondWithResult(_0x2613b1,_0x1259e0){_0x1259e0=_0x1259e0||0xc8;return function(_0x1a3512){if(_0x1a3512){return _0x2613b1[_0xcfde('0x1b')](_0x1259e0)['json'](_0x1a3512);}};}function respondWithFilteredResult(_0x4421e4,_0x31f385){return function(_0x3871f6){if(_0x3871f6){var _0x3b3be4=_0x3871f6[_0xcfde('0x1c')],_0x4b83ab=_0x31f385[_0xcfde('0x1d')],_0x2e7924=_0x31f385['offset']+_0x31f385['limit'],_0xb4959;if(_0x2e7924>=_0x3b3be4){_0x2e7924=_0x3b3be4;_0xb4959=0xc8;}else{_0xb4959=0xce;}_0x4421e4['status'](_0xb4959);return _0x4421e4['set'](_0xcfde('0x1e'),_0x4b83ab+'-'+_0x2e7924+'/'+_0x3b3be4)[_0xcfde('0x1f')](_0x3871f6);}return null;};}function patchUpdates(_0x547566){return function(_0x5e5625){try{jsonpatch[_0xcfde('0x20')](_0x5e5625,_0x547566,!![]);}catch(_0xf6b3f3){return BPromise['reject'](_0xf6b3f3);}return _0x5e5625['save']();};}function saveUpdates(_0x3e2f76,_0x23c5fe){return function(_0x160a2c){if(_0x160a2c){return _0x160a2c[_0xcfde('0x21')](_0x3e2f76)[_0xcfde('0x22')](function(_0x30deb5){return _0x30deb5;});}return null;};}function removeEntity(_0x301fde,_0x50f496){return function(_0x2ed64b){if(_0x2ed64b){return _0x2ed64b['destroy']()[_0xcfde('0x22')](function(){_0x301fde[_0xcfde('0x1b')](0xcc)[_0xcfde('0x1a')]();});}};}function handleEntityNotFound(_0xb1f304,_0x36e125){return function(_0x503375){if(!_0x503375){_0xb1f304[_0xcfde('0x19')](0x194);}return _0x503375;};}function handleError(_0x559a8b,_0x183632){_0x183632=_0x183632||0x1f4;return function(_0x4a347c){logger[_0xcfde('0x23')](_0x4a347c['stack']);if(_0x4a347c[_0xcfde('0x24')]){delete _0x4a347c[_0xcfde('0x24')];}_0x559a8b[_0xcfde('0x1b')](_0x183632)[_0xcfde('0x25')](_0x4a347c);};}exports['index']=function(_0x36c864,_0x4fe081){var _0x46901e={},_0x578761={},_0x53f967={'count':0x0,'rows':[]};var _0x2005b4=_[_0xcfde('0x26')](db[_0xcfde('0x27')][_0xcfde('0x28')],function(_0x4882a8){return{'name':_0x4882a8[_0xcfde('0x29')],'type':_0x4882a8[_0xcfde('0x2a')]['key']};});_0x578761['model']=_[_0xcfde('0x26')](_0x2005b4,_0xcfde('0x24'));_0x578761[_0xcfde('0x2b')]=_[_0xcfde('0x2c')](_0x36c864['query']);_0x578761['filters']=_[_0xcfde('0x2d')](_0x578761[_0xcfde('0x2e')],_0x578761[_0xcfde('0x2b')]);_0x46901e[_0xcfde('0x2f')]=_['intersection'](_0x578761[_0xcfde('0x2e')],qs[_0xcfde('0x30')](_0x36c864['query']['fields']));_0x46901e[_0xcfde('0x2f')]=_0x46901e[_0xcfde('0x2f')]['length']?_0x46901e['attributes']:_0x578761['model'];if(!_0x36c864[_0xcfde('0x2b')][_0xcfde('0x31')]('nolimit')){_0x46901e[_0xcfde('0x32')]=qs[_0xcfde('0x32')](_0x36c864['query'][_0xcfde('0x32')]);_0x46901e[_0xcfde('0x1d')]=qs['offset'](_0x36c864[_0xcfde('0x2b')][_0xcfde('0x1d')]);}_0x46901e[_0xcfde('0x33')]=qs[_0xcfde('0x34')](_0x36c864[_0xcfde('0x2b')][_0xcfde('0x34')]);_0x46901e[_0xcfde('0x35')]=qs[_0xcfde('0x36')](_[_0xcfde('0x37')](_0x36c864['query'],_0x578761['filters']),_0x2005b4);if(_0x36c864[_0xcfde('0x2b')][_0xcfde('0x38')]){_0x46901e[_0xcfde('0x35')]=_['merge'](_0x46901e[_0xcfde('0x35')],{'$or':_[_0xcfde('0x26')](_0x2005b4,function(_0x42b277){if(_0x42b277[_0xcfde('0x2a')]!=='VIRTUAL'){var _0x2c0487={};_0x2c0487[_0x42b277[_0xcfde('0x24')]]={'$like':'%'+_0x36c864[_0xcfde('0x2b')][_0xcfde('0x38')]+'%'};return _0x2c0487;}})});}_0x46901e=_[_0xcfde('0x39')]({},_0x46901e,_0x36c864[_0xcfde('0x3a')]);var _0x4033f7={'where':_0x46901e[_0xcfde('0x35')]};return db[_0xcfde('0x27')][_0xcfde('0x1c')](_0x4033f7)[_0xcfde('0x22')](function(_0x4330db){_0x53f967[_0xcfde('0x1c')]=_0x4330db;if(_0x36c864[_0xcfde('0x2b')]['includeAll']){_0x46901e[_0xcfde('0x3b')]=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0x46901e);})[_0xcfde('0x22')](function(_0x231f11){_0x53f967['rows']=_0x231f11;return _0x53f967;})[_0xcfde('0x22')](respondWithFilteredResult(_0x4fe081,_0x46901e))[_0xcfde('0x3c')](handleError(_0x4fe081,null));};exports['show']=function(_0x4c0f5c,_0x80cf6a){var _0x51b7f7={'raw':!![],'where':{'id':_0x4c0f5c[_0xcfde('0x3d')]['id']}},_0xb6ea92={};_0xb6ea92[_0xcfde('0x2e')]=_['keys'](db[_0xcfde('0x27')][_0xcfde('0x28')]);_0xb6ea92[_0xcfde('0x2b')]=_['keys'](_0x4c0f5c[_0xcfde('0x2b')]);_0xb6ea92['filters']=_[_0xcfde('0x2d')](_0xb6ea92[_0xcfde('0x2e')],_0xb6ea92['query']);_0x51b7f7['attributes']=_[_0xcfde('0x2d')](_0xb6ea92[_0xcfde('0x2e')],qs['fields'](_0x4c0f5c[_0xcfde('0x2b')][_0xcfde('0x30')]));_0x51b7f7[_0xcfde('0x2f')]=_0x51b7f7[_0xcfde('0x2f')][_0xcfde('0x3e')]?_0x51b7f7[_0xcfde('0x2f')]:_0xb6ea92[_0xcfde('0x2e')];if(_0x4c0f5c[_0xcfde('0x2b')][_0xcfde('0x3f')]){_0x51b7f7['include']=[{'all':!![]}];}_0x51b7f7=_[_0xcfde('0x39')]({},_0x51b7f7,_0x4c0f5c[_0xcfde('0x3a')]);return db[_0xcfde('0x27')][_0xcfde('0x40')](_0x51b7f7)['then'](handleEntityNotFound(_0x80cf6a,null))['then'](respondWithResult(_0x80cf6a,null))['catch'](handleError(_0x80cf6a,null));};exports[_0xcfde('0x41')]=function(_0x11fd9d,_0x3219f9){return db['VoiceTransferReport'][_0xcfde('0x41')](_0x11fd9d[_0xcfde('0x42')],{})['then'](respondWithResult(_0x3219f9,0xc9))['catch'](handleError(_0x3219f9,null));};exports[_0xcfde('0x21')]=function(_0x389c4e,_0x9b0ddd){if(_0x389c4e[_0xcfde('0x42')]['id']){delete _0x389c4e['body']['id'];}return db[_0xcfde('0x27')][_0xcfde('0x40')]({'where':{'id':_0x389c4e[_0xcfde('0x3d')]['id']}})['then'](handleEntityNotFound(_0x9b0ddd,null))[_0xcfde('0x22')](saveUpdates(_0x389c4e[_0xcfde('0x42')],null))[_0xcfde('0x22')](respondWithResult(_0x9b0ddd,null))['catch'](handleError(_0x9b0ddd,null));};exports[_0xcfde('0x43')]=function(_0x3ffd55,_0x35b9d9){return db['VoiceTransferReport']['find']({'where':{'id':_0x3ffd55['params']['id']}})[_0xcfde('0x22')](handleEntityNotFound(_0x35b9d9,null))[_0xcfde('0x22')](removeEntity(_0x35b9d9,null))[_0xcfde('0x3c')](handleError(_0x35b9d9,null));};
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js
index 684916f..ad0c086 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 _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
+var _0x0699=['report_call_transfer','../../config/logger','api','moment','path','rimraf','../../config/environment','define'];(function(_0x36ae06,_0x57da2d){var _0x25ffc7=function(_0x38be3a){while(--_0x38be3a){_0x36ae06['push'](_0x36ae06['shift']());}};_0x25ffc7(++_0x57da2d);}(_0x0699,0x129));var _0x9069=function(_0x19e6bd,_0x15a963){_0x19e6bd=_0x19e6bd-0x0;var _0x4d0e8e=_0x0699[_0x19e6bd];return _0x4d0e8e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9069('0x0'))(_0x9069('0x1'));var moment=require(_0x9069('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9069('0x3'));var rimraf=require(_0x9069('0x4'));var config=require(_0x9069('0x5'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x452690,_0x28cdc9){return _0x452690[_0x9069('0x6')]('VoiceTransferReport',attributes,{'tableName':_0x9069('0x7'),'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 2d9dac3..2e6398f 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 _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
+var _0x09e4=['message','catch','VoiceTransferReport,\x20%s,\x20%s','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','info','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','request\x20sent','stringify','error'];(function(_0xaf2425,_0xbb7aa3){var _0x1a2890=function(_0x2fb53a){while(--_0x2fb53a){_0xaf2425['push'](_0xaf2425['shift']());}};_0x1a2890(++_0xbb7aa3);}(_0x09e4,0x177));var _0x409e=function(_0x4f79b8,_0x3f14f5){_0x4f79b8=_0x4f79b8-0x0;var _0x458dfe=_0x09e4[_0x4f79b8];return _0x458dfe;};'use strict';var _=require(_0x409e('0x0'));var util=require(_0x409e('0x1'));var moment=require(_0x409e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x409e('0x3'));var db=require(_0x409e('0x4'))['db'];var utils=require(_0x409e('0x5'));var logger=require(_0x409e('0x6'))('rpc');var config=require(_0x409e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x409e('0x8')][_0x409e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x357ef7,_0x5b892c,_0x1a0e3d){return new BPromise(function(_0x366004,_0xd87d83){return client[_0x409e('0xa')](_0x357ef7,_0x1a0e3d)[_0x409e('0xb')](function(_0x5ceb38){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x5b892c,_0x409e('0xc'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x5b892c,'request\x20sent',JSON[_0x409e('0xd')](_0x5ceb38));if(_0x5ceb38[_0x409e('0xe')]){if(_0x5ceb38['error']['code']===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x5b892c,_0x5ceb38[_0x409e('0xe')][_0x409e('0xf')]);return _0xd87d83(_0x5ceb38['error'][_0x409e('0xf')]);}logger[_0x409e('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x5b892c,_0x5ceb38[_0x409e('0xe')]['message']);return _0x366004(_0x5ceb38[_0x409e('0xe')][_0x409e('0xf')]);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x5b892c,_0x409e('0xc'));_0x366004(_0x5ceb38['result']['message']);}})[_0x409e('0x10')](function(_0x3480fd){logger['error'](_0x409e('0x11'),_0x5b892c,_0x3480fd);_0xd87d83(_0x3480fd);});});}exports[_0x409e('0x12')]=function(_0x824155){var _0x332820=this;return new Promise(function(_0x2babd7,_0x58599d){return db[_0x409e('0x13')][_0x409e('0x14')](_0x824155[_0x409e('0x15')],{'raw':_0x824155[_0x409e('0x16')]?_0x824155[_0x409e('0x16')][_0x409e('0x17')]===undefined?!![]:![]:!![]})[_0x409e('0xb')](function(_0x342925){logger[_0x409e('0x18')](_0x409e('0x12'),_0x824155);logger[_0x409e('0x19')](_0x409e('0x12'),_0x824155,JSON[_0x409e('0xd')](_0x342925));_0x2babd7(_0x342925);})[_0x409e('0x10')](function(_0x2f0af6){logger[_0x409e('0xe')](_0x409e('0x12'),_0x2f0af6[_0x409e('0xf')],_0x824155);_0x58599d(_0x332820['error'](0x1f4,_0x2f0af6[_0x409e('0xf')]));});});};
\ No newline at end of file
diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js
index 9c11207..a0d54d8 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 _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
+var _0x4f17=['./webbar.controller','/originate','isAuthenticated','canUpdate','originate','post','answer','/hold','/unhold','unhold','/calls','calls','/transfer','exports','express','../../components/auth/service'];(function(_0x576bbf,_0x37b324){var _0x46e1fb=function(_0x575565){while(--_0x575565){_0x576bbf['push'](_0x576bbf['shift']());}};_0x46e1fb(++_0x37b324);}(_0x4f17,0x9e));var _0x74f1=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0x4f17[_0x3902c1];return _0x1266cc;};'use strict';var express=require(_0x74f1('0x0'));var router=express['Router']();var auth=require(_0x74f1('0x1'));var controller=require(_0x74f1('0x2'));router['post'](_0x74f1('0x3'),auth[_0x74f1('0x4')](),auth[_0x74f1('0x5')](),controller[_0x74f1('0x6')]);router[_0x74f1('0x7')]('/hangup',auth['isAuthenticated'](),auth[_0x74f1('0x5')](),controller['hangup']);router[_0x74f1('0x7')]('/answer',auth[_0x74f1('0x4')](),auth[_0x74f1('0x5')](),controller[_0x74f1('0x8')]);router['post'](_0x74f1('0x9'),auth['isAuthenticated'](),auth[_0x74f1('0x5')](),controller['hold']);router[_0x74f1('0x7')](_0x74f1('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x74f1('0xb')]);router[_0x74f1('0x7')](_0x74f1('0xc'),auth[_0x74f1('0x4')](),auth[_0x74f1('0x5')](),controller[_0x74f1('0xd')]);router[_0x74f1('0x7')](_0x74f1('0xe'),auth[_0x74f1('0x4')](),auth[_0x74f1('0x5')](),controller['transfer']);module[_0x74f1('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js
index e83d691..0637e13 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 _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
+var _0xdeb3=['unhold\x20fired:','webbar:unhold','calls\x20fired:','filter','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','info','log','stack','name','status','NotFound','request','then','error','code','message','result','catch','User','findOne','agent','VoiceChannels','all','rows','UserId','sessionId','\x20not\x20found!','originate','originate\x20fired:','body','validate','length','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','answer','answer\x20fired:','webbar:answer','hold','webbar:hold','unhold'];(function(_0x44aa40,_0x5946eb){var _0x16ddac=function(_0x4124a5){while(--_0x4124a5){_0x44aa40['push'](_0x44aa40['shift']());}};_0x16ddac(++_0x5946eb);}(_0xdeb3,0xeb));var _0x3deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb3[_0x2641f9];return _0x585741;};'use strict';var path=require(_0x3deb('0x0'));var fs=require('fs');var _=require(_0x3deb('0x1'));var db=require(_0x3deb('0x2'))['db'];var config=require(_0x3deb('0x3'));var util=require(_0x3deb('0x4'));var BPromise=require(_0x3deb('0x5'));var jayson=require(_0x3deb('0x6'));var amiClient=jayson[_0x3deb('0x7')][_0x3deb('0x8')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require('ioredis');config[_0x3deb('0x9')]=_[_0x3deb('0xa')](config[_0x3deb('0x9')],{'host':_0x3deb('0xb'),'port':0x18eb});var io=require(_0x3deb('0xc'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x3deb('0xd'),'required':[!![],_0x3deb('0xe')]},'callNumber':{'type':_0x3deb('0xf'),'required':[!![],_0x3deb('0x10')]},'callerId':{'type':_0x3deb('0xf')},'callbackUrl':{'type':_0x3deb('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x3deb('0xd'),'required':[!![],_0x3deb('0xe')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x3deb('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3deb('0xe')]},'sessionId':{'type':_0x3deb('0xf'),'required':[!![],_0x3deb('0x11')]},'transferNumber':{'type':_0x3deb('0xf'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x3deb('0xd'),'required':[!![],_0x3deb('0xe')]},'sessionId':{'type':_0x3deb('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x3deb('0xd'),'required':[!![],_0x3deb('0xe')]},'sessionId':{'type':_0x3deb('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x3deb('0xd'),'required':[!![],_0x3deb('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3deb('0xe')]}});function emit(_0xa45605,_0x5f2d6c,_0x201ca8){logger[_0x3deb('0x12')](_0xa45605,_0x5f2d6c,JSON['stringify'](_0x201ca8));io['to'](_0xa45605)['emit'](_0x5f2d6c,_0x201ca8);}function handleError(_0x4ae786){return function(_0x2a8ec4){console[_0x3deb('0x13')]('handleError:',_0x2a8ec4,_0x2a8ec4 instanceof RangeError);logger['error'](_0x2a8ec4[_0x3deb('0x14')]);if(_0x2a8ec4 instanceof RangeError){if(_0x2a8ec4[_0x3deb('0x15')]){delete _0x2a8ec4[_0x3deb('0x15')];}_0x4ae786[_0x3deb('0x16')](0x194)['send'](_0x2a8ec4);}else{if(_0x2a8ec4[_0x3deb('0x15')]){delete _0x2a8ec4[_0x3deb('0x15')];}_0x4ae786[_0x3deb('0x16')](0x1f4)['send'](_0x2a8ec4);}};}function checkError(){return function(_0x1e4cea){if(!_0x1e4cea){throw new RangeError(_0x3deb('0x17'));}return _0x1e4cea;};}function respondWithRpcPromise(_0x403c0b,_0x5fbec4){return new BPromise(function(_0x22ea80,_0x543014){var _0x35843b=amiClient;return _0x35843b[_0x3deb('0x18')](_0x403c0b,_0x5fbec4)[_0x3deb('0x19')](function(_0x428869){if(_0x428869[_0x3deb('0x1a')]){if(_0x428869[_0x3deb('0x1a')][_0x3deb('0x1b')]===0x1f4){return _0x543014(_0x428869[_0x3deb('0x1a')]['message']);}return _0x22ea80(_0x428869[_0x3deb('0x1a')][_0x3deb('0x1c')]);}else{_0x22ea80(_0x428869[_0x3deb('0x1d')]);}})[_0x3deb('0x1e')](function(_0x472a46){_0x543014(_0x472a46);});});}function getAgent(_0x4a5b3e){return db[_0x3deb('0x1f')][_0x3deb('0x20')]({'where':{'id':_0x4a5b3e,'role':_0x3deb('0x21')}})[_0x3deb('0x19')](checkError());}function getAgentCheckSession(_0xec30ee,_0x331065){return new BPromise(function(_0xff692b,_0x541c87){var _0x56b62c=respondWithRpcPromise(_0x3deb('0x22'));var _0x520f24=getAgent(_0xec30ee);Promise[_0x3deb('0x23')]([_0x56b62c,_0x520f24])[_0x3deb('0x19')](function(_0x2bd20f){var _0x492ca0=_0x2bd20f[0x0];var _0x460512=_0x2bd20f[0x1];var _0x55c960=_['filter'](_0x492ca0[_0x3deb('0x24')],function(_0x205c22){return _0x205c22[_0x3deb('0x25')]==_0x460512['id']&&_0x205c22[_0x3deb('0x26')]==_0x331065;});if(_0x55c960['length']==0x1){_0xff692b(_0x460512);}else{_0x541c87(new RangeError('sessionId\x20'+_0x331065+_0x3deb('0x27')));}});});}exports[_0x3deb('0x28')]=function(_0x543927,_0x5bcac3){logger[_0x3deb('0x12')](_0x3deb('0x29'),_0x543927[_0x3deb('0x2a')]);var _0x511143=originateValidation[_0x3deb('0x2b')](_0x543927['body']);if(_0x511143[_0x3deb('0x2c')]>0x0){return _0x5bcac3[_0x3deb('0x16')](0x190)[_0x3deb('0x2d')](_0x511143);}var _0x2e5995=_0x543927[_0x3deb('0x2a')][_0x3deb('0x2e')];var _0x189ec3=_0x543927[_0x3deb('0x2a')][_0x3deb('0x2f')];var _0x2e5b89=_0x543927['body'][_0x3deb('0x30')];var _0x1eac90=_0x543927[_0x3deb('0x2a')][_0x3deb('0x31')];return getAgent(_0x2e5995)[_0x3deb('0x19')](function(_0x345544){logger[_0x3deb('0x12')](_0x3deb('0x32'),_0x345544[_0x3deb('0x15')]);emit(util[_0x3deb('0x33')](_0x3deb('0x34'),_0x345544[_0x3deb('0x15')]),_0x3deb('0x35'),{'callNumber':_0x189ec3,'callerId':_0x2e5b89,'callbackUrl':_0x1eac90});return _0x5bcac3[_0x3deb('0x16')](0xc8)[_0x3deb('0x2d')]({'error':![],'message':_0x3deb('0x36')});})['catch'](handleError(_0x5bcac3));};exports['hangup']=function(_0x2ccfa8,_0x173696){logger[_0x3deb('0x12')]('hangup\x20fired:',_0x2ccfa8[_0x3deb('0x2a')]);var _0x5b99ca=hangupValidation[_0x3deb('0x2b')](_0x2ccfa8['body']);if(_0x5b99ca[_0x3deb('0x2c')]>0x0){return _0x173696['status'](0x190)[_0x3deb('0x2d')](_0x5b99ca);}var _0x3c2342=_0x2ccfa8[_0x3deb('0x2a')][_0x3deb('0x2e')];var _0x553069=_0x2ccfa8[_0x3deb('0x2a')]['sessionId'];return getAgent(_0x3c2342)[_0x3deb('0x19')](function(_0x30ed7c){logger[_0x3deb('0x12')](_0x3deb('0x32'),_0x30ed7c[_0x3deb('0x15')]);emit(util[_0x3deb('0x33')](_0x3deb('0x34'),_0x30ed7c[_0x3deb('0x15')]),'webbar:hangup',{'sessionId':_0x553069});return _0x173696[_0x3deb('0x16')](0xc8)['json']({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x173696));};exports[_0x3deb('0x37')]=function(_0x2a8aa2,_0x2e9cb1){logger[_0x3deb('0x12')](_0x3deb('0x38'),_0x2a8aa2[_0x3deb('0x2a')]);var _0x2e2c03=answerValidation['validate'](_0x2a8aa2['body']);if(_0x2e2c03[_0x3deb('0x2c')]>0x0){return _0x2e9cb1[_0x3deb('0x16')](0x190)[_0x3deb('0x2d')](_0x2e2c03);}var _0x1e8979=_0x2a8aa2[_0x3deb('0x2a')]['userId'];var _0x1fa3ca=_0x2a8aa2[_0x3deb('0x2a')][_0x3deb('0x26')];return getAgent(_0x1e8979)['then'](function(_0x20685c){logger[_0x3deb('0x12')](_0x3deb('0x32'),_0x20685c[_0x3deb('0x15')]);emit(util[_0x3deb('0x33')]('user:%s',_0x20685c[_0x3deb('0x15')]),_0x3deb('0x39'),{'sessionId':_0x1fa3ca});return _0x2e9cb1[_0x3deb('0x16')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0x3deb('0x1e')](handleError(_0x2e9cb1));};exports[_0x3deb('0x3a')]=function(_0x391504,_0xa68027){logger[_0x3deb('0x12')]('hold\x20fired:',_0x391504[_0x3deb('0x2a')]);var _0x318dac=holdValidation[_0x3deb('0x2b')](_0x391504[_0x3deb('0x2a')]);if(_0x318dac[_0x3deb('0x2c')]>0x0){return _0xa68027[_0x3deb('0x16')](0x190)[_0x3deb('0x2d')](_0x318dac);}var _0x384788=_0x391504[_0x3deb('0x2a')]['userId'];var _0x44c177=_0x391504[_0x3deb('0x2a')][_0x3deb('0x26')];return getAgent(_0x384788)[_0x3deb('0x19')](function(_0x448505){logger['info'](_0x3deb('0x32'),_0x448505[_0x3deb('0x15')]);emit(util['format']('user:%s',_0x448505['name']),_0x3deb('0x3b'),{'sessionId':_0x44c177});return _0xa68027[_0x3deb('0x16')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})[_0x3deb('0x1e')](handleError(_0xa68027));};exports[_0x3deb('0x3c')]=function(_0x8aabc0,_0x3b4688){logger['info'](_0x3deb('0x3d'),_0x8aabc0[_0x3deb('0x2a')]);var _0xc3f8d3=unholdValidation[_0x3deb('0x2b')](_0x8aabc0[_0x3deb('0x2a')]);if(_0xc3f8d3[_0x3deb('0x2c')]>0x0){return _0x3b4688[_0x3deb('0x16')](0x190)[_0x3deb('0x2d')](_0xc3f8d3);}var _0x5099ee=_0x8aabc0['body'][_0x3deb('0x2e')];var _0x375851=_0x8aabc0[_0x3deb('0x2a')][_0x3deb('0x26')];return getAgent(_0x5099ee)[_0x3deb('0x19')](function(_0x20e0f2){logger[_0x3deb('0x12')](_0x3deb('0x32'),_0x20e0f2[_0x3deb('0x15')]);emit(util[_0x3deb('0x33')](_0x3deb('0x34'),_0x20e0f2[_0x3deb('0x15')]),_0x3deb('0x3e'),{'sessionId':_0x375851});return _0x3b4688[_0x3deb('0x16')](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x3deb('0x1e')](handleError(_0x3b4688));};exports['calls']=function(_0x5e7ec8,_0x2007bd){logger[_0x3deb('0x12')](_0x3deb('0x3f'),_0x2007bd[_0x3deb('0x2a')]);var _0x59a3c0=callsValidation[_0x3deb('0x2b')](_0x5e7ec8[_0x3deb('0x2a')]);if(_0x59a3c0[_0x3deb('0x2c')]>0x0){return _0x2007bd[_0x3deb('0x16')](0x190)[_0x3deb('0x2d')](_0x59a3c0);}var _0x20b877=_0x5e7ec8[_0x3deb('0x2a')][_0x3deb('0x2e')];var _0x3f7a3b=respondWithRpcPromise(_0x3deb('0x22'));var _0x12ac44=getAgent(_0x20b877);return Promise[_0x3deb('0x23')]([_0x3f7a3b,_0x12ac44])[_0x3deb('0x19')](function(_0x3fc40e){var _0x2274b2=_0x3fc40e[0x0];var _0x44a950=_0x3fc40e[0x1];var _0x4b95c0=_[_0x3deb('0x40')](_0x2274b2[_0x3deb('0x24')],function(_0xf26b46){return _0xf26b46[_0x3deb('0x25')]==_0x44a950['id'];});return _0x2007bd[_0x3deb('0x16')](0xc8)['json']({'count':_0x4b95c0[_0x3deb('0x2c')],'rows':_0x4b95c0});})['catch'](handleError(_0x2007bd));};exports[_0x3deb('0x41')]=function(_0x43508c,_0xad0f7b){logger[_0x3deb('0x12')](_0x3deb('0x42'),_0x43508c[_0x3deb('0x2a')]);var _0x4efd88=conferenceValidation[_0x3deb('0x2b')](_0x43508c[_0x3deb('0x2a')]);if(_0x4efd88[_0x3deb('0x2c')]>0x0){return _0xad0f7b[_0x3deb('0x16')](0x190)[_0x3deb('0x2d')](_0x4efd88);}var _0x140cfc=_0x43508c[_0x3deb('0x2a')][_0x3deb('0x2e')];return getAgent(_0x140cfc)[_0x3deb('0x19')](function(_0x26db83){logger[_0x3deb('0x12')](_0x3deb('0x32'),_0x26db83['name']);emit(util['format'](_0x3deb('0x34'),_0x26db83[_0x3deb('0x15')]),_0x3deb('0x43'));return _0xad0f7b[_0x3deb('0x16')](0xc8)[_0x3deb('0x2d')]({'error':![],'message':_0x3deb('0x44')});})['catch'](handleError(_0xad0f7b));};exports[_0x3deb('0x45')]=function(_0x50575a,_0xc6c09f){logger[_0x3deb('0x12')](_0x3deb('0x46'),_0x50575a[_0x3deb('0x2a')]);var _0x82aab9=transferValidation[_0x3deb('0x2b')](_0x50575a['body']);if(_0x82aab9[_0x3deb('0x2c')]>0x0){return _0xc6c09f[_0x3deb('0x16')](0x190)[_0x3deb('0x2d')](_0x82aab9);}var _0x143693=_0x50575a[_0x3deb('0x2a')][_0x3deb('0x2e')];var _0x14ea25=_0x50575a['body'][_0x3deb('0x26')];var _0x354803=_0x50575a[_0x3deb('0x2a')][_0x3deb('0x47')];return getAgent(_0x143693)[_0x3deb('0x19')](function(_0x53af4b){logger[_0x3deb('0x12')](_0x3deb('0x32'),_0x53af4b[_0x3deb('0x15')]);emit(util[_0x3deb('0x33')](_0x3deb('0x34'),_0x53af4b[_0x3deb('0x15')]),_0x3deb('0x48'),{'sessionId':_0x14ea25,'transferNumber':_0x354803});return _0xc6c09f[_0x3deb('0x16')](0xc8)[_0x3deb('0x2d')]({'error':![],'message':_0x3deb('0x49')});})[_0x3deb('0x1e')](handleError(_0xc6c09f));};
\ No newline at end of file
diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js
index 00b89e3..a47bd5b 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 _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
+var _0xf9ba=['../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','post','create','addDisposition','/:id/applications','/:id/notify','notify','send','put','/:id','update','delete','destroy','removeDispositions','removeAgents','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x32ad33,_0xa276f4){var _0x1d21f9=function(_0x488871){while(--_0x488871){_0x32ad33['push'](_0x32ad33['shift']());}};_0x1d21f9(++_0xa276f4);}(_0xf9ba,0x135));var _0xaf9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf9ba[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xaf9b('0x0'));var path=require(_0xaf9b('0x1'));var timeout=require(_0xaf9b('0x2'));var express=require(_0xaf9b('0x3'));var router=express[_0xaf9b('0x4')]();var auth=require(_0xaf9b('0x5'));var interaction=require(_0xaf9b('0x6'));var config=require(_0xaf9b('0x7'));var controller=require(_0xaf9b('0x8'));router[_0xaf9b('0x9')]('/',auth[_0xaf9b('0xa')](),controller[_0xaf9b('0xb')]);router[_0xaf9b('0x9')](_0xaf9b('0xc'),auth[_0xaf9b('0xa')](),controller[_0xaf9b('0xd')]);router[_0xaf9b('0x9')]('/:id',auth[_0xaf9b('0xa')](),controller[_0xaf9b('0xe')]);router[_0xaf9b('0x9')](_0xaf9b('0xf'),auth[_0xaf9b('0xa')](),controller[_0xaf9b('0x10')]);router[_0xaf9b('0x9')](_0xaf9b('0x11'),auth[_0xaf9b('0xa')](),controller[_0xaf9b('0x12')]);router[_0xaf9b('0x9')](_0xaf9b('0x13'),auth[_0xaf9b('0xa')](),controller[_0xaf9b('0x14')]);router[_0xaf9b('0x9')]('/:id/applications',auth[_0xaf9b('0xa')](),controller['getApplications']);router[_0xaf9b('0x15')]('/',auth[_0xaf9b('0xa')](),controller[_0xaf9b('0x16')]);router['post'](_0xaf9b('0xf'),auth['isAuthenticated'](),controller[_0xaf9b('0x17')]);router[_0xaf9b('0x15')]('/:id/canned_answers',auth[_0xaf9b('0xa')](),controller['addAnswer']);router['post']('/:id/users',auth[_0xaf9b('0xa')](),controller['addAgents']);router[_0xaf9b('0x15')](_0xaf9b('0x18'),auth[_0xaf9b('0xa')](),controller['addApplications']);router['post'](_0xaf9b('0x19'),controller[_0xaf9b('0x1a')]);router[_0xaf9b('0x15')]('/:id/send',auth[_0xaf9b('0xa')](),controller[_0xaf9b('0x1b')]);router[_0xaf9b('0x1c')](_0xaf9b('0x1d'),auth['isAuthenticated'](),controller[_0xaf9b('0x1e')]);router[_0xaf9b('0x1f')](_0xaf9b('0x1d'),auth[_0xaf9b('0xa')](),controller[_0xaf9b('0x20')]);router[_0xaf9b('0x1f')](_0xaf9b('0xf'),auth[_0xaf9b('0xa')](),controller[_0xaf9b('0x21')]);router['delete']('/:id/canned_answers',auth[_0xaf9b('0xa')](),controller['removeAnswers']);router[_0xaf9b('0x1f')](_0xaf9b('0x13'),auth[_0xaf9b('0xa')](),controller[_0xaf9b('0x22')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js
index 5bb244d..f3862e6 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 _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
+var _0x1d5b=['randomstring','exports','STRING','name','ENUM','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','sequelize'];(function(_0x614ef4,_0x28a060){var _0x35e8e2=function(_0x55e81b){while(--_0x55e81b){_0x614ef4['push'](_0x614ef4['shift']());}};_0x35e8e2(++_0x28a060);}(_0x1d5b,0x125));var _0xb1d5=function(_0x5541e0,_0x1f7de2){_0x5541e0=_0x5541e0-0x0;var _0x392fa6=_0x1d5b[_0x5541e0];return _0x392fa6;};'use strict';var Sequelize=require(_0xb1d5('0x0'));var rs=require(_0xb1d5('0x1'));module[_0xb1d5('0x2')]={'name':{'type':Sequelize[_0xb1d5('0x3')],'unique':_0xb1d5('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xb1d5('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xb1d5('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xb1d5('0x3')]},'type':{'type':Sequelize[_0xb1d5('0x5')]('twilio')},'accountSid':{'type':Sequelize[_0xb1d5('0x3')]},'authToken':{'type':Sequelize[_0xb1d5('0x3')]},'notificationTemplate':{'type':Sequelize[_0xb1d5('0x6')],'defaultValue':function(){return _0xb1d5('0x7');}},'notificationSound':{'type':Sequelize[_0xb1d5('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xb1d5('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb1d5('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb1d5('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb1d5('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb1d5('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb1d5('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb1d5('0x9')],'comment':_0xb1d5('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb1d5('0xb'),'set':function(_0x46f6b1){if(!_0x46f6b1){this[_0xb1d5('0xc')](_0xb1d5('0xd'),null);}this[_0xb1d5('0xc')]('mandatoryDisposition',_0x46f6b1);}},'description':{'type':Sequelize[_0xb1d5('0x3')]}};
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js
index 2d3b043..98868ad 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 _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
+var _0xde2c=['update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','type','VIRTUAL','count','include','findAll','rows','catch','params','intersection','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','sort','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','omit','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','transaction','WhatsappApplication','priority','getApplications','notify','Applications','account','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','ListId','twilio','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','updatedAt','DESC','list','Contacts','contact','WhatsappInteraction','spread','interaction','created','autoclose','applications','push','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','stringify','Content-Type','text/xml','\x0a ','List','out','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappAccount.socket','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','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','code','error','message','info','result','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x454564,_0x2a5ea6){var _0x3bdfea=function(_0x265436){while(--_0x265436){_0x454564['push'](_0x454564['shift']());}};_0x3bdfea(++_0x2a5ea6);}(_0xde2c,0x7f));var _0xcde2=function(_0x3dea7d,_0x2cd4ea){_0x3dea7d=_0x3dea7d-0x0;var _0x53919a=_0xde2c[_0x3dea7d];return _0x53919a;};'use strict';var pdf=require(_0xcde2('0x0'));var emlformat=require(_0xcde2('0x1'));var rimraf=require(_0xcde2('0x2'));var zipdir=require(_0xcde2('0x3'));var jsonpatch=require(_0xcde2('0x4'));var rp=require(_0xcde2('0x5'));var moment=require(_0xcde2('0x6'));var BPromise=require(_0xcde2('0x7'));var Mustache=require('mustache');var util=require(_0xcde2('0x8'));var path=require(_0xcde2('0x9'));var sox=require(_0xcde2('0xa'));var csv=require(_0xcde2('0xb'));var ejs=require(_0xcde2('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcde2('0xd'));var crypto=require(_0xcde2('0xe'));var jsforce=require(_0xcde2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcde2('0x10'));var Papa=require(_0xcde2('0x11'));var Redis=require('ioredis');var authService=require(_0xcde2('0x12'));var qs=require(_0xcde2('0x13'));var as=require(_0xcde2('0x14'));var hardwareService=require(_0xcde2('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xcde2('0x16'));var config=require(_0xcde2('0x17'));var db=require(_0xcde2('0x18'))['db'];config[_0xcde2('0x19')]=_[_0xcde2('0x1a')](config[_0xcde2('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xcde2('0x1b'))(new Redis(config['redis']));require(_0xcde2('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xcde2('0x1d')][_0xcde2('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x417505,_0x19b54b,_0x11665c){if(_0x11665c){var _0x5312c7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5312c7[_0xcde2('0x1f')](_0x19b54b)){return _0x417505;}else{throw new db['Sequelize'][(_0xcde2('0x20'))](_0xcde2('0x21'));}}else{return _0x417505;}}function respondWithRpcPromise(_0xbade43,_0x1f1858,_0x5223f1,_0x4fd5aa){return new BPromise(function(_0x4fe586,_0x2b4468){var _0x582e84=_0x4fd5aa||client;return _0x582e84[_0xcde2('0x22')](_0xbade43,_0x5223f1)[_0xcde2('0x23')](function(_0x252372){logger['info'](_0xcde2('0x24'),_0x1f1858,_0xcde2('0x25'));logger[_0xcde2('0x26')](_0xcde2('0x27'),_0x1f1858,_0xcde2('0x25'),JSON['stringify'](_0x252372));if(_0x252372['error']){if(_0x252372['error'][_0xcde2('0x28')]===0x1f4){logger[_0xcde2('0x29')](_0xcde2('0x24'),_0x1f1858,_0x252372[_0xcde2('0x29')][_0xcde2('0x2a')]);return _0x2b4468(_0x252372['error'][_0xcde2('0x2a')]);}logger['error'](_0xcde2('0x24'),_0x1f1858,_0x252372[_0xcde2('0x29')][_0xcde2('0x2a')]);return _0x4fe586(_0x252372['error']['message']);}else{logger[_0xcde2('0x2b')](_0xcde2('0x24'),_0x1f1858,_0xcde2('0x25'));_0x4fe586(_0x252372[_0xcde2('0x2c')][_0xcde2('0x2a')]);}})['catch'](function(_0x2d1d17){logger[_0xcde2('0x29')](_0xcde2('0x24'),_0x1f1858,_0x2d1d17);_0x2b4468(_0x2d1d17);});});}function respondWithStatusCode(_0x513965,_0x2487eb){_0x2487eb=_0x2487eb||0xcc;return function(_0x348ca1){if(_0x348ca1){return _0x513965[_0xcde2('0x2d')](_0x2487eb);}return _0x513965[_0xcde2('0x2e')](_0x2487eb)[_0xcde2('0x2f')]();};}function respondWithResult(_0x5b2b7,_0x40b12c){_0x40b12c=_0x40b12c||0xc8;return function(_0x3e492f){if(_0x3e492f){return _0x5b2b7['status'](_0x40b12c)[_0xcde2('0x30')](_0x3e492f);}};}function respondWithFilteredResult(_0x4a0826,_0x141072){return function(_0xb87851){if(_0xb87851){var _0x43706c=_0xb87851['count'],_0x49cb58=_0x141072[_0xcde2('0x31')],_0xae46dc=_0x141072[_0xcde2('0x31')]+_0x141072[_0xcde2('0x32')],_0x28fedd;if(_0xae46dc>=_0x43706c){_0xae46dc=_0x43706c;_0x28fedd=0xc8;}else{_0x28fedd=0xce;}_0x4a0826[_0xcde2('0x2e')](_0x28fedd);return _0x4a0826[_0xcde2('0x33')](_0xcde2('0x34'),_0x49cb58+'-'+_0xae46dc+'/'+_0x43706c)[_0xcde2('0x30')](_0xb87851);}return null;};}function patchUpdates(_0x41fdac){return function(_0x5c08f0){try{jsonpatch[_0xcde2('0x35')](_0x5c08f0,_0x41fdac,!![]);}catch(_0x6fda22){return BPromise[_0xcde2('0x36')](_0x6fda22);}return _0x5c08f0[_0xcde2('0x37')]();};}function saveUpdates(_0x4e2c3a,_0x2ae8e0){return function(_0x42a21b){if(_0x42a21b){return _0x42a21b[_0xcde2('0x38')](_0x4e2c3a)[_0xcde2('0x23')](function(_0x498339){return _0x498339;});}return null;};}function removeEntity(_0x1b56cc,_0x452816){return function(_0x29e3e0){if(_0x29e3e0){return _0x29e3e0[_0xcde2('0x39')]()['then'](function(){var _0xb9c8d2=_0x29e3e0[_0xcde2('0x3a')]({'plain':!![]});var _0xbde4f4=_0xcde2('0x3b');return db[_0xcde2('0x3c')]['destroy']({'where':{'type':_0xbde4f4,'resourceId':_0xb9c8d2['id']}})[_0xcde2('0x23')](function(){return _0x29e3e0;});})[_0xcde2('0x23')](function(){_0x1b56cc[_0xcde2('0x2e')](0xcc)[_0xcde2('0x2f')]();});}};}function handleEntityNotFound(_0x4a64c1,_0x542246){return function(_0x1fc8a6){if(!_0x1fc8a6){_0x4a64c1[_0xcde2('0x2d')](0x194);}return _0x1fc8a6;};}function handleError(_0x40e1e2,_0x4463d1){_0x4463d1=_0x4463d1||0x1f4;return function(_0x10c494){logger[_0xcde2('0x29')](_0x10c494[_0xcde2('0x3d')]);if(_0x10c494[_0xcde2('0x3e')]){delete _0x10c494[_0xcde2('0x3e')];}_0x40e1e2['status'](_0x4463d1)[_0xcde2('0x3f')](_0x10c494);};}exports[_0xcde2('0x40')]=function(_0x30f843,_0x51a0a6){var _0x2a73df={'include':[{'model':db[_0xcde2('0x41')],'as':_0xcde2('0x42')}]},_0x47b6ee={},_0x5c0991={'count':0x0,'rows':[]};var _0x20dfad=_[_0xcde2('0x43')](db[_0xcde2('0x44')][_0xcde2('0x45')],function(_0x4cb808){return{'name':_0x4cb808['fieldName'],'type':_0x4cb808['type'][_0xcde2('0x46')]};});_0x47b6ee[_0xcde2('0x47')]=_[_0xcde2('0x43')](_0x20dfad,_0xcde2('0x3e'));_0x47b6ee[_0xcde2('0x48')]=_[_0xcde2('0x49')](_0x30f843[_0xcde2('0x48')]);_0x47b6ee['filters']=_['intersection'](_0x47b6ee[_0xcde2('0x47')],_0x47b6ee['query']);_0x2a73df[_0xcde2('0x4a')]=_['intersection'](_0x47b6ee[_0xcde2('0x47')],qs[_0xcde2('0x4b')](_0x30f843[_0xcde2('0x48')]['fields']));_0x2a73df[_0xcde2('0x4a')]=_0x2a73df['attributes'][_0xcde2('0x4c')]?_0x2a73df[_0xcde2('0x4a')]:_0x47b6ee[_0xcde2('0x47')];if(!_0x30f843[_0xcde2('0x48')][_0xcde2('0x4d')](_0xcde2('0x4e'))){_0x2a73df['limit']=qs['limit'](_0x30f843[_0xcde2('0x48')]['limit']);_0x2a73df['offset']=qs[_0xcde2('0x31')](_0x30f843['query'][_0xcde2('0x31')]);}_0x2a73df[_0xcde2('0x4f')]=qs['sort'](_0x30f843[_0xcde2('0x48')]['sort']);_0x2a73df['where']=qs[_0xcde2('0x50')](_[_0xcde2('0x51')](_0x30f843['query'],_0x47b6ee[_0xcde2('0x50')]),_0x20dfad);if(_0x30f843['query'][_0xcde2('0x52')]){_0x2a73df[_0xcde2('0x53')]=_[_0xcde2('0x54')](_0x2a73df[_0xcde2('0x53')],{'$or':_[_0xcde2('0x43')](_0x20dfad,function(_0x4b66d6){if(_0x4b66d6[_0xcde2('0x55')]!==_0xcde2('0x56')){var _0x40d14b={};_0x40d14b[_0x4b66d6[_0xcde2('0x3e')]]={'$like':'%'+_0x30f843['query']['filter']+'%'};return _0x40d14b;}})});}_0x2a73df=_[_0xcde2('0x54')]({},_0x2a73df,_0x30f843['options']);var _0x3c87b6={'where':_0x2a73df[_0xcde2('0x53')]};return db[_0xcde2('0x44')][_0xcde2('0x57')](_0x3c87b6)[_0xcde2('0x23')](function(_0x3b7862){_0x5c0991['count']=_0x3b7862;if(_0x30f843[_0xcde2('0x48')]['includeAll']){_0x2a73df[_0xcde2('0x58')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xcde2('0x59')](_0x2a73df);})[_0xcde2('0x23')](function(_0x3d10c8){_0x5c0991[_0xcde2('0x5a')]=_0x3d10c8;return _0x5c0991;})[_0xcde2('0x23')](respondWithFilteredResult(_0x51a0a6,_0x2a73df))[_0xcde2('0x5b')](handleError(_0x51a0a6,null));};exports['show']=function(_0x3adc5b,_0x5aa54f){var _0x138c58={'raw':![],'where':{'id':_0x3adc5b[_0xcde2('0x5c')]['id']},'include':[{'model':db[_0xcde2('0x41')],'as':_0xcde2('0x42')}]},_0x184005={};_0x184005[_0xcde2('0x47')]=_[_0xcde2('0x49')](db[_0xcde2('0x44')][_0xcde2('0x45')]);_0x184005[_0xcde2('0x48')]=_[_0xcde2('0x49')](_0x3adc5b[_0xcde2('0x48')]);_0x184005['filters']=_['intersection'](_0x184005['model'],_0x184005[_0xcde2('0x48')]);_0x138c58['attributes']=_[_0xcde2('0x5d')](_0x184005[_0xcde2('0x47')],qs[_0xcde2('0x4b')](_0x3adc5b['query'][_0xcde2('0x4b')]));_0x138c58['attributes']=_0x138c58[_0xcde2('0x4a')]['length']?_0x138c58[_0xcde2('0x4a')]:_0x184005[_0xcde2('0x47')];if(_0x3adc5b['query'][_0xcde2('0x5e')]){_0x138c58['include']=[{'all':!![]}];}_0x138c58=_['merge']({},_0x138c58,_0x3adc5b[_0xcde2('0x5f')]);return db[_0xcde2('0x44')][_0xcde2('0x60')](_0x138c58)[_0xcde2('0x23')](handleEntityNotFound(_0x5aa54f,null))[_0xcde2('0x23')](respondWithResult(_0x5aa54f,null))[_0xcde2('0x5b')](handleError(_0x5aa54f,null));};exports['create']=function(_0x47329f,_0x44b3fb){return db[_0xcde2('0x44')][_0xcde2('0x61')](_0x47329f[_0xcde2('0x62')],{})[_0xcde2('0x23')](function(_0x50892c){var _0x5775bb=_0x47329f[_0xcde2('0x63')][_0xcde2('0x3a')]({'plain':!![]});if(!_0x5775bb)throw new Error(_0xcde2('0x64'));if(_0x5775bb[_0xcde2('0x65')]==='user'){var _0x446765=_0x50892c[_0xcde2('0x3a')]({'plain':!![]});var _0x41e902=_0xcde2('0x3b');return db[_0xcde2('0x66')][_0xcde2('0x60')]({'where':{'name':_0x41e902,'userProfileId':_0x5775bb['userProfileId']},'raw':!![]})[_0xcde2('0x23')](function(_0x3b9e2d){if(_0x3b9e2d&&_0x3b9e2d['autoAssociation']===0x0){return db[_0xcde2('0x3c')][_0xcde2('0x61')]({'name':_0x446765[_0xcde2('0x3e')],'resourceId':_0x446765['id'],'type':_0x3b9e2d[_0xcde2('0x3e')],'sectionId':_0x3b9e2d['id']},{})[_0xcde2('0x23')](function(){return _0x50892c;});}else{return _0x50892c;}})[_0xcde2('0x5b')](function(_0x7e9fba){logger[_0xcde2('0x29')](_0xcde2('0x67'),_0x7e9fba);throw _0x7e9fba;});}return _0x50892c;})[_0xcde2('0x23')](respondWithResult(_0x44b3fb,0xc9))['catch'](handleError(_0x44b3fb,null));};exports[_0xcde2('0x38')]=function(_0x33d76a,_0x5eaeab){if(_0x33d76a[_0xcde2('0x62')]['id']){delete _0x33d76a[_0xcde2('0x62')]['id'];}return db[_0xcde2('0x44')]['find']({'where':{'id':_0x33d76a[_0xcde2('0x5c')]['id']},'include':[{'model':db[_0xcde2('0x41')],'as':_0xcde2('0x42')}]})[_0xcde2('0x23')](handleEntityNotFound(_0x5eaeab,null))[_0xcde2('0x23')](saveUpdates(_0x33d76a[_0xcde2('0x62')],null))[_0xcde2('0x23')](respondWithResult(_0x5eaeab,null))[_0xcde2('0x5b')](handleError(_0x5eaeab,null));};exports[_0xcde2('0x39')]=function(_0x34e72a,_0x3b0961){return db['WhatsappAccount']['find']({'where':{'id':_0x34e72a[_0xcde2('0x5c')]['id']}})[_0xcde2('0x23')](handleEntityNotFound(_0x3b0961,null))[_0xcde2('0x23')](removeEntity(_0x3b0961,null))['catch'](handleError(_0x3b0961,null));};exports['describe']=function(_0x5652a7,_0x1341d0){return db[_0xcde2('0x44')][_0xcde2('0x68')]()[_0xcde2('0x23')](respondWithResult(_0x1341d0,null))[_0xcde2('0x5b')](handleError(_0x1341d0,null));};exports[_0xcde2('0x69')]=function(_0x5d9964,_0x4ad98c,_0x165ec4){if(_0x5d9964[_0xcde2('0x62')]['id']){delete _0x5d9964[_0xcde2('0x62')]['id'];}return db[_0xcde2('0x44')][_0xcde2('0x60')]({'where':{'id':_0x5d9964[_0xcde2('0x5c')]['id']}})[_0xcde2('0x23')](handleEntityNotFound(_0x4ad98c,null))[_0xcde2('0x23')](function(_0x3f0b7c){if(_0x3f0b7c){_0x5d9964[_0xcde2('0x62')][_0xcde2('0x6a')]=_0x3f0b7c['id'];return db[_0xcde2('0x6b')][_0xcde2('0x61')](_0x5d9964[_0xcde2('0x62')]);}})[_0xcde2('0x23')](respondWithResult(_0x4ad98c,null))[_0xcde2('0x5b')](handleError(_0x4ad98c,null));};exports[_0xcde2('0x6c')]=function(_0x97db81,_0x278c00,_0x38d44b){var _0x5ee070={'raw':![],'where':{}};var _0x3b0fce={};var _0x162ebd={'count':0x0,'rows':[]};return db[_0xcde2('0x44')][_0xcde2('0x6d')]({'where':{'id':_0x97db81[_0xcde2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x278c00,null))[_0xcde2('0x23')](function(_0x4db99f){if(_0x4db99f){_0x3b0fce[_0xcde2('0x47')]=_[_0xcde2('0x49')](db[_0xcde2('0x6b')][_0xcde2('0x45')]);_0x3b0fce[_0xcde2('0x48')]=_[_0xcde2('0x49')](_0x97db81[_0xcde2('0x48')]);_0x3b0fce['filters']=_['intersection'](_0x3b0fce[_0xcde2('0x47')],_0x3b0fce['query']);_0x5ee070[_0xcde2('0x4a')]=_[_0xcde2('0x5d')](_0x3b0fce[_0xcde2('0x47')],qs[_0xcde2('0x4b')](_0x97db81[_0xcde2('0x48')][_0xcde2('0x4b')]));_0x5ee070[_0xcde2('0x4a')]=_0x5ee070['attributes'][_0xcde2('0x4c')]?_0x5ee070[_0xcde2('0x4a')]:_0x3b0fce[_0xcde2('0x47')];if(!_0x97db81[_0xcde2('0x48')]['hasOwnProperty'](_0xcde2('0x4e'))){_0x5ee070[_0xcde2('0x32')]=qs[_0xcde2('0x32')](_0x97db81[_0xcde2('0x48')][_0xcde2('0x32')]);_0x5ee070[_0xcde2('0x31')]=qs[_0xcde2('0x31')](_0x97db81[_0xcde2('0x48')][_0xcde2('0x31')]);}_0x5ee070[_0xcde2('0x4f')]=qs[_0xcde2('0x6e')](_0x97db81[_0xcde2('0x48')][_0xcde2('0x6e')]);_0x5ee070['where']=qs[_0xcde2('0x50')](_[_0xcde2('0x51')](_0x97db81[_0xcde2('0x48')],_0x3b0fce[_0xcde2('0x50')]));_0x5ee070[_0xcde2('0x53')][_0xcde2('0x6a')]=_0x4db99f['id'];if(_0x97db81[_0xcde2('0x48')][_0xcde2('0x52')]){_0x5ee070[_0xcde2('0x53')]=_[_0xcde2('0x54')](_0x5ee070[_0xcde2('0x53')],{'$or':_[_0xcde2('0x43')](_0x5ee070[_0xcde2('0x4a')],function(_0x2ff2f2){var _0x248e55={};_0x248e55[_0x2ff2f2]={'$like':'%'+_0x97db81[_0xcde2('0x48')]['filter']+'%'};return _0x248e55;})});}_0x5ee070=_['merge']({},_0x5ee070,_0x97db81[_0xcde2('0x5f')]);return db[_0xcde2('0x6b')][_0xcde2('0x57')]({'where':_0x5ee070[_0xcde2('0x53')]})['then'](function(_0x9afade){_0x162ebd['count']=_0x9afade;if(_0x97db81[_0xcde2('0x48')]['includeAll']){_0x5ee070[_0xcde2('0x58')]=[{'all':!![]}];}return db[_0xcde2('0x6b')]['findAll'](_0x5ee070);})[_0xcde2('0x23')](function(_0x3a6f1b){_0x162ebd[_0xcde2('0x5a')]=_0x3a6f1b;return _0x162ebd;});}})['then'](respondWithFilteredResult(_0x278c00,_0x5ee070))[_0xcde2('0x5b')](handleError(_0x278c00,null));};exports[_0xcde2('0x6f')]=function(_0x35db40,_0x39d97a,_0x4b7e5f){return db['WhatsappAccount'][_0xcde2('0x60')]({'where':{'id':_0x35db40[_0xcde2('0x5c')]['id']}})[_0xcde2('0x23')](handleEntityNotFound(_0x39d97a,null))[_0xcde2('0x23')](function(_0x335a54){if(_0x335a54){return _0x335a54[_0xcde2('0x6f')](_0x35db40['query'][_0xcde2('0x70')]);}})[_0xcde2('0x23')](respondWithStatusCode(_0x39d97a,null))[_0xcde2('0x5b')](handleError(_0x39d97a,null));};exports[_0xcde2('0x71')]=function(_0x24e5cf,_0x1a32c1,_0x113478){if(_0x24e5cf['body']['id']){delete _0x24e5cf[_0xcde2('0x62')]['id'];}return db[_0xcde2('0x44')]['find']({'where':{'id':_0x24e5cf[_0xcde2('0x5c')]['id']}})[_0xcde2('0x23')](handleEntityNotFound(_0x1a32c1,null))[_0xcde2('0x23')](function(_0x55c35f){if(_0x55c35f){_0x24e5cf[_0xcde2('0x62')][_0xcde2('0x6a')]=_0x55c35f['id'];return db['CannedAnswer']['create'](_0x24e5cf['body']);}})[_0xcde2('0x23')](respondWithResult(_0x1a32c1,null))[_0xcde2('0x5b')](handleError(_0x1a32c1,null));};exports['getAnswers']=function(_0x12b989,_0x5e5437,_0x4c753a){var _0x2bea8a={'raw':![],'where':{}};var _0x243504={};var _0x3e6111={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xcde2('0x6d')]({'where':{'id':_0x12b989[_0xcde2('0x5c')]['id']}})[_0xcde2('0x23')](handleEntityNotFound(_0x5e5437,null))[_0xcde2('0x23')](function(_0x372567){if(_0x372567){_0x243504[_0xcde2('0x47')]=_[_0xcde2('0x49')](db['CannedAnswer']['rawAttributes']);_0x243504[_0xcde2('0x48')]=_[_0xcde2('0x49')](_0x12b989[_0xcde2('0x48')]);_0x243504[_0xcde2('0x50')]=_[_0xcde2('0x5d')](_0x243504['model'],_0x243504[_0xcde2('0x48')]);_0x2bea8a['attributes']=_['intersection'](_0x243504[_0xcde2('0x47')],qs['fields'](_0x12b989['query'][_0xcde2('0x4b')]));_0x2bea8a[_0xcde2('0x4a')]=_0x2bea8a[_0xcde2('0x4a')][_0xcde2('0x4c')]?_0x2bea8a[_0xcde2('0x4a')]:_0x243504['model'];if(!_0x12b989[_0xcde2('0x48')]['hasOwnProperty'](_0xcde2('0x4e'))){_0x2bea8a[_0xcde2('0x32')]=qs[_0xcde2('0x32')](_0x12b989[_0xcde2('0x48')]['limit']);_0x2bea8a['offset']=qs['offset'](_0x12b989[_0xcde2('0x48')]['offset']);}_0x2bea8a['order']=qs[_0xcde2('0x6e')](_0x12b989[_0xcde2('0x48')][_0xcde2('0x6e')]);_0x2bea8a[_0xcde2('0x53')]=qs[_0xcde2('0x50')](_[_0xcde2('0x51')](_0x12b989[_0xcde2('0x48')],_0x243504['filters']));_0x2bea8a[_0xcde2('0x53')][_0xcde2('0x6a')]=_0x372567['id'];if(_0x12b989[_0xcde2('0x48')][_0xcde2('0x52')]){_0x2bea8a[_0xcde2('0x53')]=_[_0xcde2('0x54')](_0x2bea8a[_0xcde2('0x53')],{'$or':_['map'](_0x2bea8a[_0xcde2('0x4a')],function(_0x51bdb2){var _0x4ce362={};_0x4ce362[_0x51bdb2]={'$like':'%'+_0x12b989[_0xcde2('0x48')][_0xcde2('0x52')]+'%'};return _0x4ce362;})});}_0x2bea8a=_[_0xcde2('0x54')]({},_0x2bea8a,_0x12b989[_0xcde2('0x5f')]);return db[_0xcde2('0x72')][_0xcde2('0x57')]({'where':_0x2bea8a[_0xcde2('0x53')]})['then'](function(_0x13eaad){_0x3e6111[_0xcde2('0x57')]=_0x13eaad;if(_0x12b989[_0xcde2('0x48')]['includeAll']){_0x2bea8a[_0xcde2('0x58')]=[{'all':!![]}];}return db[_0xcde2('0x72')]['findAll'](_0x2bea8a);})['then'](function(_0x44268c){_0x3e6111[_0xcde2('0x5a')]=_0x44268c;return _0x3e6111;});}})[_0xcde2('0x23')](respondWithFilteredResult(_0x5e5437,_0x2bea8a))[_0xcde2('0x5b')](handleError(_0x5e5437,null));};exports[_0xcde2('0x73')]=function(_0x490e21,_0x5a78ad,_0x2c7414){return db['WhatsappAccount'][_0xcde2('0x60')]({'where':{'id':_0x490e21[_0xcde2('0x5c')]['id']}})[_0xcde2('0x23')](handleEntityNotFound(_0x5a78ad,null))[_0xcde2('0x23')](function(_0x9f9338){if(_0x9f9338){return _0x9f9338['removeAnswers'](_0x490e21[_0xcde2('0x48')][_0xcde2('0x70')]);}})[_0xcde2('0x23')](respondWithStatusCode(_0x5a78ad,null))['catch'](handleError(_0x5a78ad,null));};exports['addAgents']=function(_0x117fa4,_0x4dedce,_0x126ca6){return db[_0xcde2('0x44')][_0xcde2('0x60')]({'where':{'id':_0x117fa4[_0xcde2('0x5c')]['id']}})[_0xcde2('0x23')](handleEntityNotFound(_0x4dedce,null))[_0xcde2('0x23')](function(_0x427d7a){if(_0x427d7a){return _0x427d7a['addAgents'](_0x117fa4['body'][_0xcde2('0x70')],_[_0xcde2('0x74')](_0x117fa4[_0xcde2('0x62')],['ids','id'])||{})['spread'](function(_0x12293b){for(var _0x39143c=0x0;_0x39143c<_0x117fa4[_0xcde2('0x62')]['ids'][_0xcde2('0x4c')];_0x39143c+=0x1){socket[_0xcde2('0x75')]('userWhatsappAccount:save',{'UserId':_0x117fa4[_0xcde2('0x62')][_0xcde2('0x70')][_0x39143c],'WhatsappAccountId':_0x117fa4[_0xcde2('0x5c')]['id']});}return _0x12293b;});}})[_0xcde2('0x23')](respondWithResult(_0x4dedce,null))[_0xcde2('0x5b')](handleError(_0x4dedce,null));};exports[_0xcde2('0x76')]=function(_0xdd6253,_0x2a4f1b,_0x48c169){return db[_0xcde2('0x44')][_0xcde2('0x60')]({'where':{'id':_0xdd6253[_0xcde2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2a4f1b,null))[_0xcde2('0x23')](function(_0x29c1c1){if(_0x29c1c1){return _0x29c1c1[_0xcde2('0x76')](_0xdd6253[_0xcde2('0x48')]['ids'])[_0xcde2('0x23')](function(){if(_[_0xcde2('0x77')](_0xdd6253[_0xcde2('0x48')][_0xcde2('0x70')])){for(var _0x223a08=0x0;_0x223a08<_0xdd6253['query']['ids']['length'];_0x223a08+=0x1){socket[_0xcde2('0x75')](_0xcde2('0x78'),{'UserId':Number(_0xdd6253['query'][_0xcde2('0x70')][_0x223a08]),'WhatsappAccountId':Number(_0xdd6253[_0xcde2('0x5c')]['id'])});}}else{socket[_0xcde2('0x75')]('userWhatsappAccount:remove',{'UserId':Number(_0xdd6253[_0xcde2('0x48')][_0xcde2('0x70')]),'WhatsappAccountId':Number(_0xdd6253[_0xcde2('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a4f1b,null))[_0xcde2('0x5b')](handleError(_0x2a4f1b,null));};exports[_0xcde2('0x79')]=function(_0x19d948,_0x474e31,_0xec2942){var _0x40dfd0={};var _0x418733={};var _0xe2855f;var _0x3473c3;return db[_0xcde2('0x44')][_0xcde2('0x6d')]({'where':{'id':_0x19d948[_0xcde2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x474e31,null))[_0xcde2('0x23')](function(_0x571e05){if(_0x571e05){_0xe2855f=_0x571e05;_0x418733[_0xcde2('0x47')]=_['keys'](db[_0xcde2('0x7a')]['rawAttributes']);_0x418733['query']=_[_0xcde2('0x49')](_0x19d948[_0xcde2('0x48')]);_0x418733[_0xcde2('0x50')]=_[_0xcde2('0x5d')](_0x418733[_0xcde2('0x47')],_0x418733[_0xcde2('0x48')]);_0x40dfd0['attributes']=_[_0xcde2('0x5d')](_0x418733[_0xcde2('0x47')],qs[_0xcde2('0x4b')](_0x19d948[_0xcde2('0x48')][_0xcde2('0x4b')]));_0x40dfd0[_0xcde2('0x4a')]=_0x40dfd0[_0xcde2('0x4a')][_0xcde2('0x4c')]?_0x40dfd0[_0xcde2('0x4a')]:_0x418733[_0xcde2('0x47')];_0x40dfd0['order']=qs[_0xcde2('0x6e')](_0x19d948[_0xcde2('0x48')][_0xcde2('0x6e')]);_0x40dfd0[_0xcde2('0x53')]=qs[_0xcde2('0x50')](_[_0xcde2('0x51')](_0x19d948['query'],_0x418733[_0xcde2('0x50')]));if(_0x19d948[_0xcde2('0x48')][_0xcde2('0x52')]){_0x40dfd0[_0xcde2('0x53')]=_[_0xcde2('0x54')](_0x40dfd0[_0xcde2('0x53')],{'$or':_[_0xcde2('0x43')](_0x40dfd0[_0xcde2('0x4a')],function(_0x4ee3d6){var _0x5785bf={};_0x5785bf[_0x4ee3d6]={'$like':'%'+_0x19d948[_0xcde2('0x48')][_0xcde2('0x52')]+'%'};return _0x5785bf;})});}_0x40dfd0=_[_0xcde2('0x54')]({},_0x40dfd0,_0x19d948[_0xcde2('0x5f')]);return _0xe2855f[_0xcde2('0x79')](_0x40dfd0);}})[_0xcde2('0x23')](function(_0x425d36){if(_0x425d36){_0x3473c3=_0x425d36[_0xcde2('0x4c')];if(!_0x19d948[_0xcde2('0x48')][_0xcde2('0x4d')]('nolimit')){_0x40dfd0[_0xcde2('0x32')]=qs[_0xcde2('0x32')](_0x19d948[_0xcde2('0x48')][_0xcde2('0x32')]);_0x40dfd0[_0xcde2('0x31')]=qs[_0xcde2('0x31')](_0x19d948['query'][_0xcde2('0x31')]);}return _0xe2855f['getAgents'](_0x40dfd0);}})[_0xcde2('0x23')](function(_0x14c9cb){if(_0x14c9cb){return _0x14c9cb?{'count':_0x3473c3,'rows':_0x14c9cb}:null;}})[_0xcde2('0x23')](respondWithResult(_0x474e31,null))[_0xcde2('0x5b')](handleError(_0x474e31,null));};exports['addApplications']=function(_0x3f3654,_0x2c736c,_0x3ab370){return db[_0xcde2('0x44')][_0xcde2('0x6d')]({'where':{'id':_0x3f3654['params']['id']}})[_0xcde2('0x23')](handleEntityNotFound(_0x2c736c,null))[_0xcde2('0x23')](function(_0xd7106a){if(_0xd7106a){return db['sequelize'][_0xcde2('0x7b')](function(_0xd119e){return db[_0xcde2('0x7c')]['destroy']({'where':{'WhatsappAccountId':_0x3f3654['params']['id']},'transaction':_0xd119e})[_0xcde2('0x23')](function(_0x28e5c1){var _0xc6c213=_[_0xcde2('0x43')](_0x3f3654['body'],function(_0x2cd4f2){_0x2cd4f2['WhatsappAccountId']=_0x3f3654[_0xcde2('0x5c')]['id'];return _0x2cd4f2;});return db[_0xcde2('0x7c')]['bulkCreate'](_0xc6c213,{'transaction':_0xd119e});});})[_0xcde2('0x23')](function(){return db[_0xcde2('0x7c')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x3f3654[_0xcde2('0x5c')]['id']},'order':_0xcde2('0x7d')});});}})['then'](respondWithResult(_0x2c736c,null))['catch'](handleError(_0x2c736c,null));};exports['getApplications']=function(_0x4c2011,_0x139eb9,_0x2e2a78){var _0x4d432b={};var _0x5701b1={};var _0x3dae1c;var _0x274e80;return db[_0xcde2('0x44')][_0xcde2('0x6d')]({'where':{'id':_0x4c2011[_0xcde2('0x5c')]['id']}})[_0xcde2('0x23')](handleEntityNotFound(_0x139eb9,null))[_0xcde2('0x23')](function(_0x51a939){if(_0x51a939){_0x3dae1c=_0x51a939;_0x5701b1[_0xcde2('0x47')]=_[_0xcde2('0x49')](db[_0xcde2('0x7c')][_0xcde2('0x45')]);_0x5701b1[_0xcde2('0x48')]=_[_0xcde2('0x49')](_0x4c2011[_0xcde2('0x48')]);_0x5701b1[_0xcde2('0x50')]=_['intersection'](_0x5701b1['model'],_0x5701b1[_0xcde2('0x48')]);_0x4d432b[_0xcde2('0x4a')]=_[_0xcde2('0x5d')](_0x5701b1['model'],qs['fields'](_0x4c2011['query'][_0xcde2('0x4b')]));_0x4d432b[_0xcde2('0x4a')]=_0x4d432b[_0xcde2('0x4a')][_0xcde2('0x4c')]?_0x4d432b[_0xcde2('0x4a')]:_0x5701b1['model'];_0x4d432b[_0xcde2('0x4f')]=qs[_0xcde2('0x6e')](_0x4c2011[_0xcde2('0x48')][_0xcde2('0x6e')]);_0x4d432b[_0xcde2('0x53')]=qs[_0xcde2('0x50')](_['pick'](_0x4c2011[_0xcde2('0x48')],_0x5701b1['filters']));if(_0x4c2011[_0xcde2('0x48')]['filter']){_0x4d432b['where']=_['merge'](_0x4d432b[_0xcde2('0x53')],{'$or':_['map'](_0x4d432b['attributes'],function(_0x40b413){var _0x50c5c9={};_0x50c5c9[_0x40b413]={'$like':'%'+_0x4c2011[_0xcde2('0x48')][_0xcde2('0x52')]+'%'};return _0x50c5c9;})});}_0x4d432b=_[_0xcde2('0x54')]({},_0x4d432b,_0x4c2011[_0xcde2('0x5f')]);return _0x3dae1c[_0xcde2('0x7e')](_0x4d432b);}})[_0xcde2('0x23')](function(_0x13149d){if(_0x13149d){_0x274e80=_0x13149d[_0xcde2('0x4c')];if(!_0x4c2011['query']['hasOwnProperty'](_0xcde2('0x4e'))){_0x4d432b['limit']=qs['limit'](_0x4c2011[_0xcde2('0x48')][_0xcde2('0x32')]);_0x4d432b[_0xcde2('0x31')]=qs['offset'](_0x4c2011[_0xcde2('0x48')][_0xcde2('0x31')]);}return _0x3dae1c[_0xcde2('0x7e')](_0x4d432b);}})['then'](function(_0x14c44d){if(_0x14c44d){return _0x14c44d?{'count':_0x274e80,'rows':_0x14c44d}:null;}})[_0xcde2('0x23')](respondWithResult(_0x139eb9,null))['catch'](handleError(_0x139eb9,null));};exports[_0xcde2('0x7f')]=function(_0x1784cc,_0x4d3b17,_0x59a4f7){var _0x41148b={'channel':'whatsapp'};var _0x36d0c3=[];var _0x2921e6=[];var _0x36a33a={};return db['WhatsappAccount'][_0xcde2('0x60')]({'where':{'id':_0x1784cc['params']['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xcde2('0x80')}]})[_0xcde2('0x23')](handleEntityNotFound(_0x4d3b17,null))[_0xcde2('0x23')](function(_0x2bffff){_0x41148b[_0xcde2('0x81')]=_0x2bffff;_0x41148b['applications']=_['orderBy'](_0x2bffff[_0xcde2('0x80')],[_0xcde2('0x7d')],['asc']);if(_0x41148b['account'][_0xcde2('0x80')]){delete _0x41148b[_0xcde2('0x81')]['Applications'];}return db[_0xcde2('0x82')][_0xcde2('0x68')]();})[_0xcde2('0x23')](function(_0x28c661){if(!_0x28c661){throw new db[(_0xcde2('0x83'))][(_0xcde2('0x20'))](_0xcde2('0x84'));}_0x36d0c3=_[_0xcde2('0x85')](_[_0xcde2('0x49')](_0x28c661),[_0xcde2('0x86'),'updatedAt']);_0x2921e6=_[_0xcde2('0x85')](_[_0xcde2('0x49')](_0x28c661),[_0xcde2('0x86'),'updatedAt','CompanyId',_0xcde2('0x87')]);_0x41148b[_0xcde2('0x62')]={'mapKey':'mobile'};if(_0x41148b[_0xcde2('0x81')]['type']&&_0x41148b[_0xcde2('0x81')]['type']===_0xcde2('0x88')){_0x41148b[_0xcde2('0x62')][_0xcde2('0x89')]=_0x1784cc['body'][_0xcde2('0x8a')][_0xcde2('0x8b')](_0xcde2('0x8c'),'');_0x41148b[_0xcde2('0x62')][_0xcde2('0x62')]=_0x1784cc[_0xcde2('0x62')][_0xcde2('0x8d')];_0x41148b[_0xcde2('0x62')][_0xcde2('0x8e')]=_0x1784cc[_0xcde2('0x62')]['MessageSid'];}if(_0x41148b['body']['id']){delete _0x41148b[_0xcde2('0x62')]['id'];}if(_[_0xcde2('0x8f')](_0x41148b[_0xcde2('0x62')][_0xcde2('0x89')])){throw new db['Sequelize']['ValidationError'](_0xcde2('0x90'));}if(_['isNil'](_0x41148b[_0xcde2('0x62')]['body'])||_0x41148b[_0xcde2('0x62')][_0xcde2('0x62')]===''){throw new db['Sequelize'][(_0xcde2('0x20'))](_0xcde2('0x91'));}if(_[_0xcde2('0x8f')](_0x41148b[_0xcde2('0x62')][_0xcde2('0x92')])){throw new db[(_0xcde2('0x83'))][(_0xcde2('0x20'))](_0xcde2('0x93')+_0x2921e6);}if(!_[_0xcde2('0x94')](_0x2921e6,_0x41148b[_0xcde2('0x62')][_0xcde2('0x92')])){throw new db[(_0xcde2('0x83'))]['ValidationError'](_0xcde2('0x95')+_0x2921e6);}_0x36a33a[_0x41148b[_0xcde2('0x62')][_0xcde2('0x92')]]=_0x41148b[_0xcde2('0x62')]['from'];return db[_0xcde2('0x96')][_0xcde2('0x60')]({'where':{'id':_0x41148b[_0xcde2('0x81')][_0xcde2('0x87')]},'include':[{'model':db[_0xcde2('0x82')],'as':'Contacts','where':_0x36a33a,'limit':0x1,'order':[[_0xcde2('0x97'),_0xcde2('0x98')]]}]});})[_0xcde2('0x23')](handleEntityNotFound(_0x4d3b17,null))[_0xcde2('0x23')](function(_0x139d0e){if(_0x139d0e){_0x41148b[_0xcde2('0x99')]=_[_0xcde2('0x74')](_0x139d0e,['Contacts']);if(_0x139d0e['Contacts'][_0xcde2('0x4c')]){return _0x139d0e[_0xcde2('0x9a')][0x0];}var _0x42c6cf=_[_0xcde2('0x1a')](_0x41148b[_0xcde2('0x62')],{'firstName':_0x41148b[_0xcde2('0x62')]['from'],'ListId':_0x139d0e['id']});_0x42c6cf[_0x41148b[_0xcde2('0x62')][_0xcde2('0x92')]]=_0x41148b[_0xcde2('0x62')]['from'];return db[_0xcde2('0x82')]['create'](_0x42c6cf,{'fields':_0x36d0c3,'raw':!![]});}})[_0xcde2('0x23')](handleEntityNotFound(_0x4d3b17,null))['then'](function(_0x3337bd){if(_0x3337bd){_0x41148b[_0xcde2('0x9b')]=_0x3337bd;var _0x21fc21={'ContactId':_0x3337bd['id'],'phone':_0x41148b[_0xcde2('0x62')]['from'],'WhatsappAccountId':_0x1784cc[_0xcde2('0x5c')]['id']};var _0x5c0e33={'ContactId':_0x3337bd['id'],'WhatsappAccountId':_0x1784cc[_0xcde2('0x5c')]['id'],'closed':![]};return db[_0xcde2('0x9c')][_0xcde2('0x60')]({'where':_0x5c0e33})[_0xcde2('0x23')](function(_0x2e5274){if(_0x2e5274){return[_0x2e5274,![]];}return db[_0xcde2('0x9c')][_0xcde2('0x61')](_0x21fc21)[_0xcde2('0x23')](function(_0x5aeef6){return[_0x5aeef6,!![]];});});}})[_0xcde2('0x9d')](function(_0x1670dc,_0x566bd2){_0x41148b['interaction']=_0x1670dc[_0xcde2('0x3a')]({'plain':!![]});_0x41148b[_0xcde2('0x9e')][_0xcde2('0x9f')]=![];if(_0x566bd2){if(_0x41148b['account'][_0xcde2('0xa0')]){_0x41148b[_0xcde2('0xa1')][_0xcde2('0xa2')]({'id':0x0,'priority':_0x41148b[_0xcde2('0xa1')][_0xcde2('0x4c')]+0x1,'app':_0xcde2('0xa3'),'appdata':_0xcde2('0xa4'),'interval':_0xcde2('0xa5')});}_0x41148b[_0xcde2('0x9e')][_0xcde2('0x9f')]=!![];}return db[_0xcde2('0xa6')]['create']({'phone':_0x41148b[_0xcde2('0x62')]['from'],'messageId':_0x41148b[_0xcde2('0x62')]['messageId'],'body':_0x41148b['body'][_0xcde2('0x62')],'WhatsappAccountId':_0x1784cc[_0xcde2('0x5c')]['id'],'WhatsappInteractionId':_0x1670dc['id'],'direction':'in','ContactId':_0x1670dc[_0xcde2('0xa7')],'AttachmentId':_0x41148b[_0xcde2('0x62')][_0xcde2('0xa8')]});})[_0xcde2('0x23')](function(_0x50cacc){_0x41148b[_0xcde2('0x2a')]=_0x50cacc;if(_0x41148b['interaction']['UserId']){return db['User'][_0xcde2('0x60')]({'attributes':['id','name'],'where':{'id':_0x41148b[_0xcde2('0x9e')]['UserId']}})[_0xcde2('0x23')](function(_0x21778f){if(_0x21778f){_0x41148b[_0xcde2('0xa1')][_0xcde2('0xa9')]({'id':0x0,'priority':0x0,'app':_0xcde2('0xaa'),'appdata':_0x21778f[_0xcde2('0x3e')]+','+(_0x41148b[_0xcde2('0x81')][_0xcde2('0xab')]||0xa),'interval':_0xcde2('0xa5')});}return respondWithRpcPromise(_0xcde2('0xac'),_0xcde2('0xad'),_0x41148b);});}return respondWithRpcPromise(_0xcde2('0xac'),'startRouting',_0x41148b);})[_0xcde2('0x23')](function(_0x920f5a){if(_0x920f5a){var _0xf755cd=0xc8;var _0xafc45c='receiveMessage';logger['info'](_0xcde2('0x27'),_0xafc45c,_0xf755cd,_0xcde2('0xae'));logger[_0xcde2('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0xafc45c,_0xf755cd,_0xcde2('0xae'),JSON[_0xcde2('0xaf')](_0x920f5a));if(_0x41148b['account'][_0xcde2('0x55')]===_0xcde2('0x88')){return _0x4d3b17[_0xcde2('0x2e')](_0xf755cd)['set'](_0xcde2('0xb0'),_0xcde2('0xb1'))[_0xcde2('0x3f')](_0xcde2('0xb2'));}else{return _0x4d3b17[_0xcde2('0x2e')](_0xf755cd)['json'](_0x920f5a);}}})[_0xcde2('0x5b')](handleError(_0x4d3b17,null));};exports[_0xcde2('0x3f')]=function(_0xd91eb2,_0x56f0f6,_0x25be34){var _0x28a233,_0x1bc393,_0x40844c;if(_[_0xcde2('0x8f')](_0xd91eb2['body'][_0xcde2('0x62')])||_0xd91eb2[_0xcde2('0x62')]['body']===''){throw new db[(_0xcde2('0x83'))][(_0xcde2('0x20'))](_0xcde2('0x91'));}if(_[_0xcde2('0x8f')](_0xd91eb2['body']['to'])){throw new db[(_0xcde2('0x83'))][(_0xcde2('0x20'))]('to\x20is\x20mandatory');}_0x28a233=_0xd91eb2[_0xcde2('0x62')]['to'];return db[_0xcde2('0x44')]['find']({'where':{'id':_0xd91eb2['params']['id']},'include':[{'model':db[_0xcde2('0x96')],'as':_0xcde2('0xb3'),'include':[{'model':db[_0xcde2('0x82')],'as':'Contacts','where':{'mobile':_0x28a233},'limit':0x1,'order':[[_0xcde2('0x97'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x56f0f6,null))['then'](function(_0x444671){if(_0x444671&&_0x444671[_0xcde2('0xb3')]){_0x1bc393=_0x444671[_0xcde2('0x3a')]({'plain':!![]});if(_0x1bc393['List']&&_0x1bc393[_0xcde2('0xb3')][_0xcde2('0x9a')][_0xcde2('0x4c')]){return _0x1bc393[_0xcde2('0xb3')][_0xcde2('0x9a')][0x0];}return db[_0xcde2('0x82')][_0xcde2('0x61')](_[_0xcde2('0x1a')](_0xd91eb2[_0xcde2('0x62')],{'firstName':_0x28a233,'mobile':_0x28a233,'phone':_0x28a233,'ListId':_0x1bc393[_0xcde2('0x87')]}));}})['then'](handleEntityNotFound(_0x56f0f6,null))[_0xcde2('0x23')](function(_0x18adba){if(_0x18adba){_0x40844c=_0x18adba;return db[_0xcde2('0x9c')][_0xcde2('0x60')]({'where':{'ContactId':_0x40844c['id'],'closed':![],'WhatsappAccountId':_0x1bc393['id']}})[_0xcde2('0x23')](function(_0x90f088){if(_0x90f088){return[_0x90f088,![]];}return db[_0xcde2('0x9c')][_0xcde2('0x61')]({'UserId':_0xd91eb2[_0xcde2('0x63')]['id'],'ContactId':_0x40844c['id'],'WhatsappAccountId':_0x1bc393['id'],'phone':_0x28a233,'firstMsgDirection':_0xcde2('0xb4'),'Messages':[_[_0xcde2('0x54')](_0xd91eb2['body'],{'read':![],'body':_0xd91eb2[_0xcde2('0x62')][_0xcde2('0x62')],'phone':_0x28a233,'WhatsappAccountId':_0x1bc393['id'],'UserId':_0xd91eb2[_0xcde2('0x63')]['id'],'ContactId':_0x40844c['id']})]},{'include':[{'model':db[_0xcde2('0xa6')],'as':_0xcde2('0xb5')}]})[_0xcde2('0x23')](function(_0x529c1b){return[_0x529c1b,!![]];});});}})[_0xcde2('0x9d')](function(_0x45500d,_0x59cebd){if(_0x59cebd){return _0x45500d;}return db[_0xcde2('0xa6')][_0xcde2('0x61')](_[_0xcde2('0x54')](_0xd91eb2[_0xcde2('0x62')],{'read':![],'body':_0xd91eb2[_0xcde2('0x62')][_0xcde2('0x62')],'phone':_0x28a233,'WhatsappAccountId':_0x1bc393['id'],'WhatsappInteractionId':_0x45500d['id'],'UserId':_0xd91eb2[_0xcde2('0x63')]['id'],'ContactId':_0x40844c['id']}))[_0xcde2('0x23')](function(_0x2de3d3){_0x45500d[_0xcde2('0xb6')][_0xcde2('0xb5')]=[];_0x45500d[_0xcde2('0xb6')][_0xcde2('0xb5')][_0xcde2('0xa2')](_0x2de3d3[_0xcde2('0xb6')]);return _0x45500d;});})[_0xcde2('0x23')](respondWithResult(_0x56f0f6,null))[_0xcde2('0x5b')](handleError(_0x56f0f6,null));};
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js
index 315b3f1..14f6a76 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 _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
+var _0x3a6d=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a6d,0x143));var _0xd3a6=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x3a6d[_0x4b055c];return _0x4b62bb;};'use strict';var EventEmitter=require(_0xd3a6('0x0'));var WhatsappAccount=require(_0xd3a6('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xd3a6('0x2')](0x0);var events={'afterCreate':_0xd3a6('0x3'),'afterUpdate':_0xd3a6('0x4'),'afterDestroy':_0xd3a6('0x5')};function emitEvent(_0x3d37ff){return function(_0x585473,_0x1cb966,_0x27d641){WhatsappAccountEvents[_0xd3a6('0x6')](_0x3d37ff+':'+_0x585473['id'],_0x585473);WhatsappAccountEvents[_0xd3a6('0x6')](_0x3d37ff,_0x585473);_0x27d641(null);};}for(var e in events){if(events[_0xd3a6('0x7')](e)){var event=events[e];WhatsappAccount[_0xd3a6('0x8')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js
index 038a313..9e30cea 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 _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
+var _0x5d70=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util'];(function(_0x7faa88,_0x2c1749){var _0x36366d=function(_0x5164de){while(--_0x5164de){_0x7faa88['push'](_0x7faa88['shift']());}};_0x36366d(++_0x2c1749);}(_0x5d70,0x178));var _0x05d7=function(_0x55a2a5,_0x69abee){_0x55a2a5=_0x55a2a5-0x0;var _0x4c9817=_0x5d70[_0x55a2a5];return _0x4c9817;};'use strict';var _=require(_0x05d7('0x0'));var util=require(_0x05d7('0x1'));var logger=require('../../config/logger')(_0x05d7('0x2'));var moment=require(_0x05d7('0x3'));var BPromise=require(_0x05d7('0x4'));var rp=require(_0x05d7('0x5'));var fs=require('fs');var path=require(_0x05d7('0x6'));var rimraf=require(_0x05d7('0x7'));var config=require(_0x05d7('0x8'));var attributes=require(_0x05d7('0x9'));module[_0x05d7('0xa')]=function(_0xea36c9,_0x3dc15a){return _0xea36c9[_0x05d7('0xb')](_0x05d7('0xc'),attributes,{'tableName':_0x05d7('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 1ab4ab2..604a4cd 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 _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
+var _0x7e37=['then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','attributes','include','model','map','info','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','./whatsappAccount.socket','register','request'];(function(_0x4e733,_0x141980){var _0x3b37d3=function(_0x3eaa7d){while(--_0x3eaa7d){_0x4e733['push'](_0x4e733['shift']());}};_0x3b37d3(++_0x141980);}(_0x7e37,0xf3));var _0x77e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e37[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x77e3('0x0'));var util=require(_0x77e3('0x1'));var moment=require(_0x77e3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77e3('0x3'));var db=require(_0x77e3('0x4'))['db'];var utils=require(_0x77e3('0x5'));var logger=require(_0x77e3('0x6'))(_0x77e3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x77e3('0x8')][_0x77e3('0x9')]({'port':0x232a});config[_0x77e3('0xa')]=_[_0x77e3('0xb')](config[_0x77e3('0xa')],{'host':_0x77e3('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x77e3('0xa')]));require(_0x77e3('0xd'))[_0x77e3('0xe')](socket);function respondWithRpcPromise(_0x4921a6,_0x3b0237,_0x1881e4){return new BPromise(function(_0x376ebe,_0xa7f512){return client[_0x77e3('0xf')](_0x4921a6,_0x1881e4)[_0x77e3('0x10')](function(_0x44ee78){logger['info'](_0x77e3('0x11'),_0x3b0237,_0x77e3('0x12'));logger[_0x77e3('0x13')](_0x77e3('0x14'),_0x3b0237,_0x77e3('0x12'),JSON[_0x77e3('0x15')](_0x44ee78));if(_0x44ee78[_0x77e3('0x16')]){if(_0x44ee78[_0x77e3('0x16')][_0x77e3('0x17')]===0x1f4){logger[_0x77e3('0x16')](_0x77e3('0x11'),_0x3b0237,_0x44ee78['error']['message']);return _0xa7f512(_0x44ee78[_0x77e3('0x16')]['message']);}logger['error'](_0x77e3('0x11'),_0x3b0237,_0x44ee78[_0x77e3('0x16')][_0x77e3('0x18')]);return _0x376ebe(_0x44ee78[_0x77e3('0x16')]['message']);}else{logger['info'](_0x77e3('0x11'),_0x3b0237,_0x77e3('0x12'));_0x376ebe(_0x44ee78[_0x77e3('0x19')]['message']);}})[_0x77e3('0x1a')](function(_0x14545c){logger[_0x77e3('0x16')](_0x77e3('0x11'),_0x3b0237,_0x14545c);_0xa7f512(_0x14545c);});});}exports[_0x77e3('0x1b')]=function(_0x4311d1){var _0x3f3562=this;return new Promise(function(_0x3bce45,_0x10dcfb){return db[_0x77e3('0x1c')][_0x77e3('0x1d')]({'raw':_0x4311d1['options']?_0x4311d1[_0x77e3('0x1e')][_0x77e3('0x1f')]===undefined?!![]:![]:!![],'where':_0x4311d1[_0x77e3('0x1e')]?_0x4311d1[_0x77e3('0x1e')]['where']||null:null,'attributes':_0x4311d1['options']?_0x4311d1[_0x77e3('0x1e')][_0x77e3('0x20')]||null:null,'include':_0x4311d1[_0x77e3('0x1e')]?_0x4311d1[_0x77e3('0x1e')][_0x77e3('0x21')]?_['map'](_0x4311d1[_0x77e3('0x1e')][_0x77e3('0x21')],function(_0x2b4ed5){return{'model':db[_0x2b4ed5[_0x77e3('0x22')]],'as':_0x2b4ed5['as'],'attributes':_0x2b4ed5[_0x77e3('0x20')],'include':_0x2b4ed5[_0x77e3('0x21')]?_[_0x77e3('0x23')](_0x2b4ed5[_0x77e3('0x21')],function(_0x40df0d){return{'model':db[_0x40df0d[_0x77e3('0x22')]],'as':_0x40df0d['as'],'attributes':_0x40df0d[_0x77e3('0x20')],'include':_0x40df0d[_0x77e3('0x21')]?_[_0x77e3('0x23')](_0x40df0d[_0x77e3('0x21')],function(_0x12ea20){return{'model':db[_0x12ea20[_0x77e3('0x22')]],'as':_0x12ea20['as'],'attributes':_0x12ea20[_0x77e3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9b3d3f){logger[_0x77e3('0x24')](_0x77e3('0x1b'),_0x4311d1);logger['debug'](_0x77e3('0x1b'),_0x4311d1,JSON['stringify'](_0x9b3d3f));_0x3bce45(_0x9b3d3f);})[_0x77e3('0x1a')](function(_0x2be6e4){logger[_0x77e3('0x16')](_0x77e3('0x1b'),_0x2be6e4[_0x77e3('0x18')],_0x4311d1);_0x10dcfb(_0x3f3562[_0x77e3('0x16')](0x1f4,_0x2be6e4[_0x77e3('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js
index 5a08f65..009b078 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 _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
+var _0xf629=['remove','update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x995b86,_0x10fe93){var _0x93fae=function(_0x4316c5){while(--_0x4316c5){_0x995b86['push'](_0x995b86['shift']());}};_0x93fae(++_0x10fe93);}(_0xf629,0xc7));var _0x9f62=function(_0x30e225,_0x669769){_0x30e225=_0x30e225-0x0;var _0x489d21=_0xf629[_0x30e225];return _0x489d21;};'use strict';var WhatsappAccountEvents=require(_0x9f62('0x0'));var events=['save',_0x9f62('0x1'),_0x9f62('0x2')];function createListener(_0x12140d,_0x4cef49){return function(_0x125642){_0x4cef49[_0x9f62('0x3')](_0x12140d,_0x125642);};}function removeListener(_0x4320fd,_0x1b9786){return function(){WhatsappAccountEvents[_0x9f62('0x4')](_0x4320fd,_0x1b9786);};}exports[_0x9f62('0x5')]=function(_0xe87962){for(var _0x53f1c1=0x0,_0x1b36e0=events[_0x9f62('0x6')];_0x53f1c1<_0x1b36e0;_0x53f1c1++){var _0x3ff563=events[_0x53f1c1];var _0x3b059a=createListener(_0x9f62('0x7')+_0x3ff563,_0xe87962);WhatsappAccountEvents['on'](_0x3ff563,_0x3b059a);}};
\ No newline at end of file
diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js
index 2ea78fb..6f962bd 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 _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
+var _0xc125=['isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./whatsappApplication.controller','get'];(function(_0x15f430,_0x4e86ee){var _0x36dfa3=function(_0x5bed94){while(--_0x5bed94){_0x15f430['push'](_0x15f430['shift']());}};_0x36dfa3(++_0x4e86ee);}(_0xc125,0x195));var _0x5c12=function(_0x4e31d0,_0x3ca476){_0x4e31d0=_0x4e31d0-0x0;var _0x224e9b=_0xc125[_0x4e31d0];return _0x224e9b;};'use strict';var multer=require(_0x5c12('0x0'));var util=require(_0x5c12('0x1'));var path=require(_0x5c12('0x2'));var timeout=require(_0x5c12('0x3'));var express=require(_0x5c12('0x4'));var router=express[_0x5c12('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x5c12('0x6'));var config=require('../../config/environment');var controller=require(_0x5c12('0x7'));router[_0x5c12('0x8')]('/',auth[_0x5c12('0x9')](),controller[_0x5c12('0xa')]);router[_0x5c12('0x8')](_0x5c12('0xb'),auth[_0x5c12('0x9')](),controller[_0x5c12('0xc')]);router[_0x5c12('0xd')]('/',auth[_0x5c12('0x9')](),controller['create']);router['put']('/:id',auth[_0x5c12('0x9')](),controller[_0x5c12('0xe')]);router[_0x5c12('0xf')](_0x5c12('0xb'),auth[_0x5c12('0x9')](),controller[_0x5c12('0x10')]);module[_0x5c12('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js
index aa7f146..0f9fe38 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 _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
+var _0x8d57=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d57,0xaf));var _0x78d5=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x8d57[_0x29b609];return _0x54c952;};'use strict';var Sequelize=require('sequelize');module[_0x78d5('0x0')]={'priority':{'type':Sequelize[_0x78d5('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x78d5('0x2')],'allowNull':![],'defaultValue':_0x78d5('0x3')},'appdata':{'type':Sequelize[_0x78d5('0x4')]()},'description':{'type':Sequelize[_0x78d5('0x2')]},'interval':{'type':Sequelize[_0x78d5('0x2')],'defaultValue':_0x78d5('0x5')}};
\ No newline at end of file
diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js
index f1f1213..da2abba 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 _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
+var _0xb544=['../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','error','stack','name','send','WhatsappApplication','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','includeAll','include','findAll','catch','params','keys','options','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xb544,0xc4));var _0x4b54=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xb544[_0x36884e];return _0x1cc367;};'use strict';var pdf=require(_0x4b54('0x0'));var emlformat=require(_0x4b54('0x1'));var rimraf=require(_0x4b54('0x2'));var zipdir=require(_0x4b54('0x3'));var jsonpatch=require(_0x4b54('0x4'));var rp=require(_0x4b54('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4b54('0x6'));var util=require(_0x4b54('0x7'));var path=require(_0x4b54('0x8'));var sox=require(_0x4b54('0x9'));var csv=require(_0x4b54('0xa'));var ejs=require(_0x4b54('0xb'));var fs=require('fs');var _=require(_0x4b54('0xc'));var squel=require(_0x4b54('0xd'));var crypto=require(_0x4b54('0xe'));var jsforce=require(_0x4b54('0xf'));var deskjs=require(_0x4b54('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4b54('0x11'));var Redis=require('ioredis');var authService=require(_0x4b54('0x12'));var qs=require(_0x4b54('0x13'));var as=require(_0x4b54('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b54('0x15'))(_0x4b54('0x16'));var utils=require(_0x4b54('0x17'));var config=require('../../config/environment');var db=require(_0x4b54('0x18'))['db'];function respondWithStatusCode(_0x15198a,_0x5ce7e5){_0x5ce7e5=_0x5ce7e5||0xcc;return function(_0x1da139){if(_0x1da139){return _0x15198a[_0x4b54('0x19')](_0x5ce7e5);}return _0x15198a[_0x4b54('0x1a')](_0x5ce7e5)[_0x4b54('0x1b')]();};}function respondWithResult(_0x3ea995,_0x1d6393){_0x1d6393=_0x1d6393||0xc8;return function(_0x53cb27){if(_0x53cb27){return _0x3ea995[_0x4b54('0x1a')](_0x1d6393)[_0x4b54('0x1c')](_0x53cb27);}};}function respondWithFilteredResult(_0x49af64,_0x210033){return function(_0x1ad05d){if(_0x1ad05d){var _0x1e8dd8=_0x1ad05d[_0x4b54('0x1d')],_0x22fdfb=_0x210033[_0x4b54('0x1e')],_0x9c59fd=_0x210033[_0x4b54('0x1e')]+_0x210033[_0x4b54('0x1f')],_0x440f4a;if(_0x9c59fd>=_0x1e8dd8){_0x9c59fd=_0x1e8dd8;_0x440f4a=0xc8;}else{_0x440f4a=0xce;}_0x49af64[_0x4b54('0x1a')](_0x440f4a);return _0x49af64[_0x4b54('0x20')]('Content-Range',_0x22fdfb+'-'+_0x9c59fd+'/'+_0x1e8dd8)[_0x4b54('0x1c')](_0x1ad05d);}return null;};}function patchUpdates(_0x568c61){return function(_0x57191d){try{jsonpatch[_0x4b54('0x21')](_0x57191d,_0x568c61,!![]);}catch(_0x1923dc){return BPromise[_0x4b54('0x22')](_0x1923dc);}return _0x57191d[_0x4b54('0x23')]();};}function saveUpdates(_0x5476f0,_0x38a0d5){return function(_0x28b2e8){if(_0x28b2e8){return _0x28b2e8['update'](_0x5476f0)[_0x4b54('0x24')](function(_0x1237b1){return _0x1237b1;});}return null;};}function removeEntity(_0xc22567,_0x5a09e5){return function(_0x563d48){if(_0x563d48){return _0x563d48[_0x4b54('0x25')]()['then'](function(){_0xc22567['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31fdfa,_0xd30210){return function(_0x27012b){if(!_0x27012b){_0x31fdfa[_0x4b54('0x19')](0x194);}return _0x27012b;};}function handleError(_0x914944,_0x2118fb){_0x2118fb=_0x2118fb||0x1f4;return function(_0x50f5d3){logger[_0x4b54('0x26')](_0x50f5d3[_0x4b54('0x27')]);if(_0x50f5d3[_0x4b54('0x28')]){delete _0x50f5d3[_0x4b54('0x28')];}_0x914944[_0x4b54('0x1a')](_0x2118fb)[_0x4b54('0x29')](_0x50f5d3);};}exports['index']=function(_0x405caa,_0x5e4e7d){var _0x5dc1bc={},_0x9b67f6={},_0xa440df={'count':0x0,'rows':[]};var _0x390b6f=_['map'](db[_0x4b54('0x2a')][_0x4b54('0x2b')],function(_0x388d24){return{'name':_0x388d24['fieldName'],'type':_0x388d24[_0x4b54('0x2c')][_0x4b54('0x2d')]};});_0x9b67f6[_0x4b54('0x2e')]=_[_0x4b54('0x2f')](_0x390b6f,'name');_0x9b67f6[_0x4b54('0x30')]=_['keys'](_0x405caa[_0x4b54('0x30')]);_0x9b67f6[_0x4b54('0x31')]=_[_0x4b54('0x32')](_0x9b67f6[_0x4b54('0x2e')],_0x9b67f6[_0x4b54('0x30')]);_0x5dc1bc[_0x4b54('0x33')]=_[_0x4b54('0x32')](_0x9b67f6[_0x4b54('0x2e')],qs[_0x4b54('0x34')](_0x405caa[_0x4b54('0x30')][_0x4b54('0x34')]));_0x5dc1bc[_0x4b54('0x33')]=_0x5dc1bc[_0x4b54('0x33')][_0x4b54('0x35')]?_0x5dc1bc[_0x4b54('0x33')]:_0x9b67f6[_0x4b54('0x2e')];if(!_0x405caa[_0x4b54('0x30')][_0x4b54('0x36')](_0x4b54('0x37'))){_0x5dc1bc[_0x4b54('0x1f')]=qs['limit'](_0x405caa['query'][_0x4b54('0x1f')]);_0x5dc1bc['offset']=qs[_0x4b54('0x1e')](_0x405caa[_0x4b54('0x30')][_0x4b54('0x1e')]);}_0x5dc1bc[_0x4b54('0x38')]=qs[_0x4b54('0x39')](_0x405caa['query'][_0x4b54('0x39')]);_0x5dc1bc['where']=qs[_0x4b54('0x31')](_[_0x4b54('0x3a')](_0x405caa[_0x4b54('0x30')],_0x9b67f6['filters']),_0x390b6f);if(_0x405caa[_0x4b54('0x30')]['filter']){_0x5dc1bc[_0x4b54('0x3b')]=_[_0x4b54('0x3c')](_0x5dc1bc[_0x4b54('0x3b')],{'$or':_[_0x4b54('0x2f')](_0x390b6f,function(_0x2fc166){if(_0x2fc166[_0x4b54('0x2c')]!==_0x4b54('0x3d')){var _0x1a899a={};_0x1a899a[_0x2fc166[_0x4b54('0x28')]]={'$like':'%'+_0x405caa[_0x4b54('0x30')]['filter']+'%'};return _0x1a899a;}})});}_0x5dc1bc=_[_0x4b54('0x3c')]({},_0x5dc1bc,_0x405caa['options']);var _0x2927fc={'where':_0x5dc1bc[_0x4b54('0x3b')]};return db[_0x4b54('0x2a')]['count'](_0x2927fc)[_0x4b54('0x24')](function(_0x200154){_0xa440df[_0x4b54('0x1d')]=_0x200154;if(_0x405caa[_0x4b54('0x30')][_0x4b54('0x3e')]){_0x5dc1bc[_0x4b54('0x3f')]=[{'all':!![]}];}return db[_0x4b54('0x2a')][_0x4b54('0x40')](_0x5dc1bc);})[_0x4b54('0x24')](function(_0x1533d8){_0xa440df['rows']=_0x1533d8;return _0xa440df;})[_0x4b54('0x24')](respondWithFilteredResult(_0x5e4e7d,_0x5dc1bc))[_0x4b54('0x41')](handleError(_0x5e4e7d,null));};exports['show']=function(_0x29e927,_0x7ac083){var _0x498271={'raw':!![],'where':{'id':_0x29e927[_0x4b54('0x42')]['id']}},_0x66414e={};_0x66414e[_0x4b54('0x2e')]=_[_0x4b54('0x43')](db[_0x4b54('0x2a')][_0x4b54('0x2b')]);_0x66414e['query']=_[_0x4b54('0x43')](_0x29e927[_0x4b54('0x30')]);_0x66414e[_0x4b54('0x31')]=_[_0x4b54('0x32')](_0x66414e['model'],_0x66414e[_0x4b54('0x30')]);_0x498271[_0x4b54('0x33')]=_[_0x4b54('0x32')](_0x66414e[_0x4b54('0x2e')],qs['fields'](_0x29e927[_0x4b54('0x30')][_0x4b54('0x34')]));_0x498271[_0x4b54('0x33')]=_0x498271[_0x4b54('0x33')]['length']?_0x498271[_0x4b54('0x33')]:_0x66414e[_0x4b54('0x2e')];if(_0x29e927[_0x4b54('0x30')][_0x4b54('0x3e')]){_0x498271['include']=[{'all':!![]}];}_0x498271=_[_0x4b54('0x3c')]({},_0x498271,_0x29e927[_0x4b54('0x44')]);return db[_0x4b54('0x2a')][_0x4b54('0x45')](_0x498271)[_0x4b54('0x24')](handleEntityNotFound(_0x7ac083,null))[_0x4b54('0x24')](respondWithResult(_0x7ac083,null))[_0x4b54('0x41')](handleError(_0x7ac083,null));};exports[_0x4b54('0x46')]=function(_0xaa45ad,_0x3ef890){return db[_0x4b54('0x2a')][_0x4b54('0x46')](_0xaa45ad[_0x4b54('0x47')],{})[_0x4b54('0x24')](respondWithResult(_0x3ef890,0xc9))[_0x4b54('0x41')](handleError(_0x3ef890,null));};exports[_0x4b54('0x48')]=function(_0x1ffa2c,_0x23be0e){if(_0x1ffa2c[_0x4b54('0x47')]['id']){delete _0x1ffa2c[_0x4b54('0x47')]['id'];}return db[_0x4b54('0x2a')][_0x4b54('0x45')]({'where':{'id':_0x1ffa2c['params']['id']}})[_0x4b54('0x24')](handleEntityNotFound(_0x23be0e,null))[_0x4b54('0x24')](saveUpdates(_0x1ffa2c[_0x4b54('0x47')],null))[_0x4b54('0x24')](respondWithResult(_0x23be0e,null))[_0x4b54('0x41')](handleError(_0x23be0e,null));};exports['destroy']=function(_0x4690ad,_0x2182a8){return db[_0x4b54('0x2a')][_0x4b54('0x45')]({'where':{'id':_0x4690ad[_0x4b54('0x42')]['id']}})['then'](handleEntityNotFound(_0x2182a8,null))[_0x4b54('0x24')](removeEntity(_0x2182a8,null))['catch'](handleError(_0x2182a8,null));};
\ No newline at end of file
diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js
index cf7d19b..db480e0 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 _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
+var _0x2deb=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','whatsapp_applications','utf8mb4','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2deb,0xdb));var _0xb2de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2deb[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb2de('0x0'));var util=require(_0xb2de('0x1'));var logger=require(_0xb2de('0x2'))(_0xb2de('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb2de('0x4'));var fs=require('fs');var path=require(_0xb2de('0x5'));var rimraf=require(_0xb2de('0x6'));var config=require(_0xb2de('0x7'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x201fcc,_0x2ed8ec){return _0x201fcc[_0xb2de('0x8')]('WhatsappApplication',attributes,{'tableName':_0xb2de('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb2de('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js
index 393c8db..d8d2d7b 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 _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
+var _0x9a5a=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x135ee2,_0x3dca87){var _0x560132=function(_0x4fb1d4){while(--_0x4fb1d4){_0x135ee2['push'](_0x135ee2['shift']());}};_0x560132(++_0x3dca87);}(_0x9a5a,0x194));var _0xa9a5=function(_0x5cb939,_0x37fad3){_0x5cb939=_0x5cb939-0x0;var _0x394f18=_0x9a5a[_0x5cb939];return _0x394f18;};'use strict';var _=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var moment=require(_0xa9a5('0x2'));var BPromise=require(_0xa9a5('0x3'));var rs=require(_0xa9a5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9a5('0x5'))['db'];var utils=require(_0xa9a5('0x6'));var logger=require(_0xa9a5('0x7'))(_0xa9a5('0x8'));var config=require(_0xa9a5('0x9'));var jayson=require(_0xa9a5('0xa'));var client=jayson['client'][_0xa9a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37e93b,_0x20bbe8,_0x1eafa6){return new BPromise(function(_0x24e1bd,_0x5f2e83){return client['request'](_0x37e93b,_0x1eafa6)['then'](function(_0xc95120){logger[_0xa9a5('0xc')](_0xa9a5('0xd'),_0x20bbe8,_0xa9a5('0xe'));logger[_0xa9a5('0xf')](_0xa9a5('0x10'),_0x20bbe8,_0xa9a5('0xe'),JSON['stringify'](_0xc95120));if(_0xc95120['error']){if(_0xc95120['error'][_0xa9a5('0x11')]===0x1f4){logger[_0xa9a5('0x12')](_0xa9a5('0xd'),_0x20bbe8,_0xc95120[_0xa9a5('0x12')][_0xa9a5('0x13')]);return _0x5f2e83(_0xc95120['error'][_0xa9a5('0x13')]);}logger[_0xa9a5('0x12')](_0xa9a5('0xd'),_0x20bbe8,_0xc95120[_0xa9a5('0x12')][_0xa9a5('0x13')]);return _0x24e1bd(_0xc95120[_0xa9a5('0x12')]['message']);}else{logger[_0xa9a5('0xc')](_0xa9a5('0xd'),_0x20bbe8,_0xa9a5('0xe'));_0x24e1bd(_0xc95120[_0xa9a5('0x14')]['message']);}})[_0xa9a5('0x15')](function(_0x106cbf){logger[_0xa9a5('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x20bbe8,_0x106cbf);_0x5f2e83(_0x106cbf);});});}
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js
index 721675c..d778d23 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 _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
+var _0x0af7=['../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1101c6,_0x121cca){var _0x49b9ea=function(_0x132f14){while(--_0x132f14){_0x1101c6['push'](_0x1101c6['shift']());}};_0x49b9ea(++_0x121cca);}(_0x0af7,0x17b));var _0x70af=function(_0x33ca9d,_0x34ea92){_0x33ca9d=_0x33ca9d-0x0;var _0x1767e2=_0x0af7[_0x33ca9d];return _0x1767e2;};'use strict';var multer=require(_0x70af('0x0'));var util=require('util');var path=require(_0x70af('0x1'));var timeout=require(_0x70af('0x2'));var express=require(_0x70af('0x3'));var router=express[_0x70af('0x4')]();var auth=require(_0x70af('0x5'));var interaction=require(_0x70af('0x6'));var config=require('../../config/environment');var controller=require(_0x70af('0x7'));router[_0x70af('0x8')]('/',auth[_0x70af('0x9')](),controller[_0x70af('0xa')]);router['get'](_0x70af('0xb'),auth[_0x70af('0x9')](),controller[_0x70af('0xc')]);router['get'](_0x70af('0xd'),auth['isAuthenticated'](),controller[_0x70af('0xe')]);router[_0x70af('0x8')](_0x70af('0xf'),auth['isAuthenticated'](),controller[_0x70af('0x10')]);router[_0x70af('0x8')](_0x70af('0x11'),auth[_0x70af('0x9')](),controller[_0x70af('0x12')]);router[_0x70af('0x13')]('/',auth[_0x70af('0x9')](),controller[_0x70af('0x14')]);router[_0x70af('0x13')]('/:id/messages',auth[_0x70af('0x9')](),controller[_0x70af('0x15')]);router[_0x70af('0x13')]('/:id/tags',auth[_0x70af('0x9')](),interaction[_0x70af('0x16')](_0x70af('0x17'),_0x70af('0x18')),controller[_0x70af('0x19')]);router[_0x70af('0x1a')](_0x70af('0xd'),auth['isAuthenticated'](),interaction[_0x70af('0x16')](_0x70af('0x17'),_0x70af('0x1b')),controller[_0x70af('0x1c')]);router[_0x70af('0x1d')](_0x70af('0xd'),auth[_0x70af('0x9')](),interaction[_0x70af('0x16')](_0x70af('0x17'),_0x70af('0x1e')),controller[_0x70af('0x1f')]);router[_0x70af('0x1d')](_0x70af('0x20'),auth['isAuthenticated'](),controller[_0x70af('0x21')]);module[_0x70af('0x22')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js
index 3363d8b..957a90a 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 _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
+var _0x698d=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x5a611f,_0x12b98b){var _0x458388=function(_0x291ec9){while(--_0x291ec9){_0x5a611f['push'](_0x5a611f['shift']());}};_0x458388(++_0x12b98b);}(_0x698d,0x9f));var _0xd698=function(_0x340c51,_0x4c4fc1){_0x340c51=_0x340c51-0x0;var _0x4b265c=_0x698d[_0x340c51];return _0x4b265c;};'use strict';var Sequelize=require(_0xd698('0x0'));var moment=require(_0xd698('0x1'));module['exports']={'closed':{'type':Sequelize[_0xd698('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd698('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd698('0x4')]},'phone':{'type':Sequelize[_0xd698('0x4')]},'read1stAt':{'type':Sequelize[_0xd698('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xd698('0x5')]('in',_0xd698('0x6')),'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/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js
index d9a2bf2..4a05fa1 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 _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
+var _0xadb5=['field','from','tools_tags','u.id','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','value','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','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','find','UserId','buildExpression','start','body','keys','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','where','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','journey','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','catch','show','params','includeAll','include','merge','options','create','describe','addMessage','ids','getMessages','findOne','WhatsappMessage','hasOwnProperty','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','spread','findAll','color','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','Messages','secret','WhatsappAccount','Account','Owner','get','mkdirSync','40px','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','N.A.','closed','disposition','basename','createReadStream','createWriteStream','direction','out','System','renderFile','views','downloadInteraction.html','toFile','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','end','status','json','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','WhatsappInteraction','rawAttributes','type','key','query','intersection','model','attributes','fields','length','limit','order','sort','filters','pick','select'];(function(_0x49f37b,_0x5b6832){var _0x32b34c=function(_0x4c7bab){while(--_0x4c7bab){_0x49f37b['push'](_0x49f37b['shift']());}};_0x32b34c(++_0x5b6832);}(_0xadb5,0xad));var _0x5adb=function(_0x30351b,_0x129e0b){_0x30351b=_0x30351b-0x0;var _0x2b82f8=_0xadb5[_0x30351b];return _0x2b82f8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var db=require(_0x5adb('0x17'))['db'];config['redis']=_[_0x5adb('0x18')](config['redis'],{'host':_0x5adb('0x19'),'port':0x18eb});var socket=require(_0x5adb('0x1a'))(new Redis(config[_0x5adb('0x1b')]));require('./whatsappInteraction.socket')[_0x5adb('0x1c')](socket);function respondWithStatusCode(_0x34af2c,_0xf82f72){_0xf82f72=_0xf82f72||0xcc;return function(_0x5263ec){if(_0x5263ec){return _0x34af2c[_0x5adb('0x1d')](_0xf82f72);}return _0x34af2c['status'](_0xf82f72)[_0x5adb('0x1e')]();};}function respondWithResult(_0x42a482,_0x30614e){_0x30614e=_0x30614e||0xc8;return function(_0x304784){if(_0x304784){return _0x42a482[_0x5adb('0x1f')](_0x30614e)[_0x5adb('0x20')](_0x304784);}};}function respondWithFilteredResult(_0xa29dc,_0x42f4c6){return function(_0xb953a6){if(_0xb953a6){var _0x529b65=_0xb953a6['count'],_0x3fff62=_0x42f4c6[_0x5adb('0x21')],_0x5de028=_0x42f4c6['offset']+_0x42f4c6['limit'],_0x1d9e86;if(_0x5de028>=_0x529b65){_0x5de028=_0x529b65;_0x1d9e86=0xc8;}else{_0x1d9e86=0xce;}_0xa29dc[_0x5adb('0x1f')](_0x1d9e86);return _0xa29dc[_0x5adb('0x22')](_0x5adb('0x23'),_0x3fff62+'-'+_0x5de028+'/'+_0x529b65)[_0x5adb('0x20')](_0xb953a6);}return null;};}function patchUpdates(_0x99bc6c){return function(_0x5af69d){try{jsonpatch[_0x5adb('0x24')](_0x5af69d,_0x99bc6c,!![]);}catch(_0x5c296e){return BPromise['reject'](_0x5c296e);}return _0x5af69d[_0x5adb('0x25')]();};}function saveUpdates(_0x379b33,_0x1a38d3){return function(_0x1a8014){if(_0x1a8014){return _0x1a8014[_0x5adb('0x26')](_0x379b33)[_0x5adb('0x27')](function(_0xfd9bb9){return _0xfd9bb9;});}return null;};}function removeEntity(_0x4ca150,_0x4b1957){return function(_0x373cc3){if(_0x373cc3){return _0x373cc3[_0x5adb('0x28')]()[_0x5adb('0x27')](function(){_0x4ca150[_0x5adb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fee18,_0x2e1e63){return function(_0x5aed76){if(!_0x5aed76){_0x2fee18[_0x5adb('0x1d')](0x194);}return _0x5aed76;};}function handleError(_0x1ded9f,_0x1a0acd){_0x1a0acd=_0x1a0acd||0x1f4;return function(_0x55b40a){logger[_0x5adb('0x29')](_0x55b40a[_0x5adb('0x2a')]);if(_0x55b40a[_0x5adb('0x2b')]){delete _0x55b40a[_0x5adb('0x2b')];}_0x1ded9f[_0x5adb('0x1f')](_0x1a0acd)[_0x5adb('0x2c')](_0x55b40a);};}function getInteractionUsers(_0x4a5d46,_0x49992e){return new BPromise(function(_0x5d457e,_0x39bddd){try{if(_0x49992e[_0x4a5d46['id']]){_0x4a5d46[_0x5adb('0x2d')]=_[_0x5adb('0x2e')](_0x49992e[_0x4a5d46['id']],function(_0x512bab){return{'id':_0x512bab['id'],'fullname':_0x512bab[_0x5adb('0x2f')]};});}}catch(_0x4de310){_0x39bddd(_0x4de310);}_0x5d457e(_0x4a5d46);});}function getInteractionTags(_0x11ec2a,_0x34b793){return new BPromise(function(_0x372da1,_0x3b1fed){try{if(_0x11ec2a[_0x5adb('0x30')]){_0x11ec2a[_0x5adb('0x31')]=[];_0x11ec2a[_0x5adb('0x30')][_0x5adb('0x32')](',')[_0x5adb('0x33')](function(_0x260295){_0x11ec2a['Tags'][_0x5adb('0x34')](_0x34b793[_0x260295]);});}delete _0x11ec2a['TagIds'];}catch(_0x12424d){_0x3b1fed(_0x12424d);}_0x372da1(_0x11ec2a);});}function updateWhatsappInteraction(_0x20cde6,_0x5d1441,_0x226390){return new BPromise(function(_0xe389ca,_0x461a39){return getInteractionUsers(_0x20cde6,_0x226390)['then'](function(_0x173789){return getInteractionTags(_0x173789,_0x5d1441);})[_0x5adb('0x27')](function(_0x4b5887){_0xe389ca(_0x4b5887);})['catch'](function(_0x1ed9ea){_0x461a39(_0x1ed9ea);});});}exports['index']=function(_0x663ea0,_0x222568){var _0x3c2b07={},_0x2da912={},_0x9bdece={'count':0x0,'rows':[]};var _0x5ece39=_[_0x5adb('0x2e')](db[_0x5adb('0x35')][_0x5adb('0x36')],function(_0x54851b){return{'name':_0x54851b['fieldName'],'type':_0x54851b[_0x5adb('0x37')][_0x5adb('0x38')]};});_0x2da912['model']=_[_0x5adb('0x2e')](_0x5ece39,'name');_0x2da912[_0x5adb('0x39')]=_['keys'](_0x663ea0[_0x5adb('0x39')]);_0x2da912['filters']=_[_0x5adb('0x3a')](_0x2da912[_0x5adb('0x3b')],_0x2da912['query']);_0x3c2b07[_0x5adb('0x3c')]=_['intersection'](_0x2da912[_0x5adb('0x3b')],qs[_0x5adb('0x3d')](_0x663ea0[_0x5adb('0x39')]['fields']));_0x3c2b07[_0x5adb('0x3c')]=_0x3c2b07[_0x5adb('0x3c')][_0x5adb('0x3e')]?_0x3c2b07[_0x5adb('0x3c')]:_0x2da912[_0x5adb('0x3b')];if(!_0x663ea0['query']['hasOwnProperty']('nolimit')){_0x3c2b07['limit']=qs[_0x5adb('0x3f')](_0x663ea0[_0x5adb('0x39')][_0x5adb('0x3f')]);_0x3c2b07[_0x5adb('0x21')]=qs[_0x5adb('0x21')](_0x663ea0[_0x5adb('0x39')][_0x5adb('0x21')]);}_0x3c2b07[_0x5adb('0x40')]=qs['sort'](_0x663ea0['query'][_0x5adb('0x41')]);_0x3c2b07['where']=qs[_0x5adb('0x42')](_[_0x5adb('0x43')](_0x663ea0[_0x5adb('0x39')],_0x2da912[_0x5adb('0x42')]),_0x5ece39);var _0xdfecfd=[];var _0x522ee5=squel[_0x5adb('0x44')]()[_0x5adb('0x45')]('id')['field'](_0x5adb('0x2b'))[_0x5adb('0x45')]('color')[_0x5adb('0x46')](_0x5adb('0x47'));var _0x1d6bef=squel[_0x5adb('0x44')]()[_0x5adb('0x45')](_0x5adb('0x48'))[_0x5adb('0x45')]('u.fullname')['field'](_0x5adb('0x49'))[_0x5adb('0x46')](_0x5adb('0x4a'),'ui')[_0x5adb('0x4b')]('users','u','u.id\x20=\x20ui.UserId');var _0xaa32e4=squel[_0x5adb('0x44')]()[_0x5adb('0x46')](_0x5adb('0x4c'),'i')[_0x5adb('0x4b')]('cm_contacts','c',_0x5adb('0x4d'))[_0x5adb('0x4b')]('users','o',_0x5adb('0x4e'))[_0x5adb('0x4b')](_0x5adb('0x4f'),'a',_0x5adb('0x50'))[_0x5adb('0x4b')](_0x5adb('0x51'),'me',_0x5adb('0x52'))[_0x5adb('0x4b')]('whatsapp_interaction_has_tags','it',_0x5adb('0x53'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x3cd211=squel[_0x5adb('0x54')]();var _0x207a81=[];var _0x4ba0b5=squel[_0x5adb('0x54')]();var _0x5cbab5;if(_0x663ea0[_0x5adb('0x39')][_0x5adb('0x55')]){_0x5cbab5=as[_0x5adb('0x56')](_0x663ea0['query'][_0x5adb('0x55')]);var _0x560bac=_0x5cbab5[_0x5adb('0x57')];for(var _0x6dc067=0x0;_0x6dc067<_0x5cbab5['conditions'][_0x5adb('0x3e')];_0x6dc067++){var _0x1ab97b=_0x5cbab5[_0x5adb('0x58')][_0x6dc067];var _0x101008='i';var _0x372734=_['find'](_0x5ece39,[_0x5adb('0x2b'),_0x1ab97b[_0x5adb('0x45')]]);if(!_0x372734){switch(_0x1ab97b[_0x5adb('0x45')]){case _0x5adb('0x59'):if(_0x1ab97b['value']==0x1){_0xaa32e4[_0x5adb('0x5a')]('`'+_0x1ab97b[_0x5adb('0x45')]+_0x5adb('0x5b'));}else{_0xaa32e4['having']('`'+_0x1ab97b[_0x5adb('0x45')]+_0x5adb('0x5c'));}break;case _0x5adb('0x5d'):if(_0x1ab97b[_0x5adb('0x5e')]==='$substring'){if(_0x1ab97b[_0x5adb('0x5f')][_0x5adb('0x32')]('\x20')[_0x5adb('0x3e')]>0x1){_0x3cd211[_0x560bac](_0x5adb('0x60'),qs[_0x5adb('0x61')](_0x1ab97b['value']),null);}else{var _0x378938='%'+_0x1ab97b['value']+'%';_0x3cd211[_0x560bac](_0x5adb('0x62'),_0x378938,_0x378938,_0x378938);}}else{_0x372734=_['find'](_0x5ece39,[_0x5adb('0x2b'),_0x5adb('0x63')]);_0x1ab97b[_0x5adb('0x45')]=_0x5adb('0x63');_0x836b91=as['buildExpression'](_0x101008,_0x372734[_0x5adb('0x37')],_0x1ab97b);_0x3cd211[_0x560bac](_0x836b91[_0x5adb('0x64')],_0x836b91[_0x5adb('0x5f')]['start'],_0x836b91['value']['end']);}break;case _0x5adb('0x65'):var _0x31a1f9=_0x1ab97b[_0x5adb('0x5f')][_0x5adb('0x32')](',')[_0x5adb('0x2e')](function(_0xb06bee){return Number(_0xb06bee);});_0x31a1f9[_0x5adb('0x33')](function(_0x8d7810){_0x4ba0b5['or'](_0x5adb('0x66'),'%,'+_0x8d7810+',%');});_0x207a81=_[_0x5adb('0x67')](_0x207a81,_0x31a1f9);break;case _0x5adb('0x68'):if(_0x1ab97b[_0x5adb('0x5e')]===_0x5adb('0x69')){_0x3cd211[_0x560bac]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1ab97b['value']+'%',null);}else{_0x372734=_[_0x5adb('0x6a')](_0x5ece39,[_0x5adb('0x2b'),_0x5adb('0x6b')]);_0x1ab97b[_0x5adb('0x45')]='UserId';_0x836b91=as[_0x5adb('0x6c')](_0x101008,_0x372734[_0x5adb('0x37')],_0x1ab97b);_0x3cd211[_0x560bac](_0x836b91['text'],_0x836b91[_0x5adb('0x5f')][_0x5adb('0x6d')],_0x836b91[_0x5adb('0x5f')]['end']);}break;case _0x5adb('0x6e'):_0x836b91=as[_0x5adb('0x6c')]('me',null,_0x1ab97b);_0x3cd211[_0x560bac](_0x836b91[_0x5adb('0x64')],_0x836b91[_0x5adb('0x5f')][_0x5adb('0x6d')],_0x836b91[_0x5adb('0x5f')]['end']);break;}}else{var _0x836b91=as[_0x5adb('0x6c')](_0x101008,_0x372734[_0x5adb('0x37')],_0x1ab97b);_0x3cd211[_0x560bac](_0x836b91['text'],_0x836b91[_0x5adb('0x5f')][_0x5adb('0x6d')],_0x836b91[_0x5adb('0x5f')]['end']);}}}else{var _0x7287ac=_(_0x663ea0['query'])[_0x5adb('0x6f')]()[_0x5adb('0x2e')](function(_0x24e1ab){return _['some'](_0x5ece39,[_0x5adb('0x2b'),_0x24e1ab])?_0x24e1ab:undefined;})[_0x5adb('0x70')]()['value']();if(!_[_0x5adb('0x71')](_0x7287ac)){_0x7287ac[_0x5adb('0x33')](function(_0x248739){if(_0x248739===_0x5adb('0x72')){_0xaa32e4['where'](_0x5adb('0x73'),[][_0x5adb('0x74')](_0x663ea0[_0x5adb('0x39')][_0x248739]));}else if(_0x248739===_0x5adb('0x75')){var _0x5b7556=JSON['parse'](_0x663ea0[_0x5adb('0x39')][_0x248739])['$gte'];var _0x4d635f=JSON['parse'](_0x663ea0[_0x5adb('0x39')][_0x248739])[_0x5adb('0x76')];_0xaa32e4['where'](_0x5adb('0x77'),_0x5b7556,_0x4d635f);}else{if(_0x663ea0[_0x5adb('0x39')][_0x248739]===_0x5adb('0x78')){_0xaa32e4[_0x5adb('0x79')]('i.'+_0x248739+_0x5adb('0x7a'));}else{_0xaa32e4[_0x5adb('0x79')]('i.'+_0x248739+_0x5adb('0x7b'),_0x663ea0[_0x5adb('0x39')][_0x248739]);}}});}if(_0x663ea0['query']['read']){if(_0x663ea0['query'][_0x5adb('0x7c')]==0x1){_0xaa32e4[_0x5adb('0x5a')](_0x5adb('0x7d'));}else{_0xaa32e4[_0x5adb('0x5a')](_0x5adb('0x7e'));}}if(_0x663ea0[_0x5adb('0x39')][_0x5adb('0x7f')]){_0x207a81=_[_0x5adb('0x80')](_0x663ea0['query']['tag'])?_0x663ea0[_0x5adb('0x39')][_0x5adb('0x7f')]:new Array(_0x663ea0[_0x5adb('0x39')][_0x5adb('0x7f')]);_0x207a81[_0x5adb('0x33')](function(_0x335de5){_0x4ba0b5['or'](_0x5adb('0x66'),'%,'+_0x335de5+',%');});}if(_0x663ea0[_0x5adb('0x39')][_0x5adb('0x81')]){var _0x3b5ecf=_0x663ea0['query'][_0x5adb('0x81')][_0x5adb('0x82')]('\x5c','\x5c\x5c')[_0x5adb('0x82')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x5adb('0x83')](_0x3b5ecf)){_0x3cd211['or'](_0x5adb('0x84'),_0x3b5ecf+'%')['or']('i.phone\x20LIKE\x20?',_0x3b5ecf+'%');}else{_0x3cd211['or'](_0x5adb('0x85'),qs['getFullTextValue'](_0x3b5ecf))['or'](_0x5adb('0x86'),_0x3b5ecf+'%');}}}_0xaa32e4[_0x5adb('0x79')](_0x3cd211);_0xaa32e4['group'](_0x5adb('0x87'));var _0x1ceb72={'type':db[_0x5adb('0x88')][_0x5adb('0x89')][_0x5adb('0x8a')],'raw':!![]};var _0x10f54a=_0xaa32e4[_0x5adb('0x8b')]();_0x10f54a[_0x5adb('0x45')]('i.id');_0x10f54a[_0x5adb('0x45')](_0x5adb('0x8c'),_0x5adb('0x59'));if(_0x3c2b07['order']){_0x3c2b07['order'][_0x5adb('0x33')](function(_0x4fd8f7){_0xaa32e4[_0x5adb('0x40')]('i.'+_0x4fd8f7[0x0],_0x4fd8f7[0x1]===_0x5adb('0x8d')?![]:!![]);});}if(!_[_0x5adb('0x71')](_0x207a81)){_0xaa32e4['having'](_0x4ba0b5);_0x10f54a[_0x5adb('0x79')](_0x5adb('0x8e'),_0x207a81);}BPromise[_0x5adb('0x8f')]()[_0x5adb('0x27')](function(){if(!_0x5cbab5){if(_0x663ea0[_0x5adb('0x39')]['WhatsappAccountId']||_0x663ea0[_0x5adb('0x39')][_0x5adb('0x90')])return;_0x10f54a[_0x5adb('0x79')](_0x5adb('0x91'));_0xaa32e4['where'](_0x5adb('0x91'));return;}return _0x663ea0[_0x5adb('0x92')][_0x5adb('0x93')]({'attributes':['id'],'raw':!![]})[_0x5adb('0x27')](function(_0x15d4f1){if(_[_0x5adb('0x71')](_0x15d4f1)){_0x10f54a[_0x5adb('0x79')]('i.WhatsappAccountId\x20IS\x20NULL');_0xaa32e4[_0x5adb('0x79')](_0x5adb('0x94'));}else{_0x10f54a['where'](_0x5adb('0x73'),_[_0x5adb('0x2e')](_0x15d4f1,'id'));_0xaa32e4['where'](_0x5adb('0x73'),_['map'](_0x15d4f1,'id'));}});})[_0x5adb('0x27')](function(){db[_0x5adb('0x95')]['query'](_0x10f54a[_0x5adb('0x96')](),_0x1ceb72)['then'](function(_0x2f6415){_0x9bdece[_0x5adb('0x97')]=_0x2f6415[_0x5adb('0x3e')];if(_0x9bdece[_0x5adb('0x97')]===0x0)return[];return db[_0x5adb('0x95')]['query'](_0x522ee5[_0x5adb('0x96')](),_0x1ceb72)[_0x5adb('0x27')](function(_0x3f33c0){_0xdfecfd=_[_0x5adb('0x98')](_0x3f33c0,'id');_0x1ceb72=_['merge'](_0x1ceb72,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x663ea0[_0x5adb('0x39')][_0x5adb('0x3d')]){_0x3c2b07[_0x5adb('0x3c')][_0x5adb('0x33')](function(_0x277668){_0xaa32e4[_0x5adb('0x45')]('i.'+_0x277668);});}else{_0xaa32e4[_0x5adb('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5adb('0x59'));_0xaa32e4[_0x5adb('0x45')](_0x5adb('0x99'),_0x5adb('0x9a'));_0xaa32e4['field'](_0x5adb('0x9b'),_0x5adb('0x9c'));_0xaa32e4[_0x5adb('0x45')](_0x5adb('0x9d'));_0xaa32e4[_0x5adb('0x45')](_0x5adb('0x9e'),_0x5adb('0x9f'));_0xaa32e4[_0x5adb('0x45')](_0x5adb('0xa0'),'Contact.lastName');_0xaa32e4[_0x5adb('0x45')](_0x5adb('0xa1'),'Contact.email');_0xaa32e4[_0x5adb('0x45')](_0x5adb('0xa2'),_0x5adb('0xa3'));_0xaa32e4[_0x5adb('0x45')](_0x5adb('0xa4'),_0x5adb('0xa5'));_0xaa32e4[_0x5adb('0x45')](_0x5adb('0xa6'),'Contact.fax');_0xaa32e4[_0x5adb('0x45')](_0x5adb('0xa7'),'Owner.fullname');_0xaa32e4[_0x5adb('0x45')](_0x5adb('0xa8'),_0x5adb('0xa9'));_0xaa32e4['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5adb('0x30'));}if(_0x3c2b07[_0x5adb('0x3f')])_0xaa32e4[_0x5adb('0x3f')](_0x3c2b07['limit']);if(_0x3c2b07[_0x5adb('0x21')])_0xaa32e4[_0x5adb('0x21')](_0x3c2b07[_0x5adb('0x21')]);return db[_0x5adb('0x95')][_0x5adb('0x39')](_0xaa32e4[_0x5adb('0x96')](),_0x1ceb72);})[_0x5adb('0x27')](function(_0x463e84){_0x1d6bef[_0x5adb('0x79')](_0x5adb('0xaa'),_[_0x5adb('0x2e')](_0x463e84,'id'));return db[_0x5adb('0x95')]['query'](_0x1d6bef['toString'](),_0x1ceb72)[_0x5adb('0x27')](function(_0x44756a){var _0x5c4053=_[_0x5adb('0xab')](_0x44756a,_0x5adb('0xac'));var _0x38acde=[];_0x463e84[_0x5adb('0x33')](function(_0x13426e){_0x38acde[_0x5adb('0x34')](updateWhatsappInteraction(_0x13426e,_0xdfecfd,_0x5c4053));});return BPromise[_0x5adb('0xad')](_0x38acde);});});})[_0x5adb('0x27')](function(_0x42dddf){_0x9bdece['rows']=_0x42dddf;return _0x9bdece;})[_0x5adb('0x27')](respondWithFilteredResult(_0x222568,_0x3c2b07));})[_0x5adb('0xae')](handleError(_0x222568,null));};exports[_0x5adb('0xaf')]=function(_0x4f0261,_0x312a90){var _0x284f79={'raw':![],'where':{'id':_0x4f0261[_0x5adb('0xb0')]['id']}},_0x2b6e56={};_0x2b6e56[_0x5adb('0x3b')]=_[_0x5adb('0x6f')](db['WhatsappInteraction'][_0x5adb('0x36')]);_0x2b6e56[_0x5adb('0x39')]=_[_0x5adb('0x6f')](_0x4f0261[_0x5adb('0x39')]);_0x2b6e56[_0x5adb('0x42')]=_[_0x5adb('0x3a')](_0x2b6e56[_0x5adb('0x3b')],_0x2b6e56[_0x5adb('0x39')]);_0x284f79[_0x5adb('0x3c')]=_[_0x5adb('0x3a')](_0x2b6e56['model'],qs[_0x5adb('0x3d')](_0x4f0261['query'][_0x5adb('0x3d')]));_0x284f79[_0x5adb('0x3c')]=_0x284f79[_0x5adb('0x3c')][_0x5adb('0x3e')]?_0x284f79[_0x5adb('0x3c')]:_0x2b6e56['model'];if(_0x4f0261['query'][_0x5adb('0xb1')]){_0x284f79[_0x5adb('0xb2')]=[{'all':!![]}];}_0x284f79=_[_0x5adb('0xb3')]({},_0x284f79,_0x4f0261[_0x5adb('0xb4')]);return db[_0x5adb('0x35')][_0x5adb('0x6a')](_0x284f79)['then'](handleEntityNotFound(_0x312a90,null))['then'](respondWithResult(_0x312a90,null))[_0x5adb('0xae')](handleError(_0x312a90,null));};exports[_0x5adb('0xb5')]=function(_0x9d80fd,_0x4f5721){return db['WhatsappInteraction'][_0x5adb('0xb5')](_0x9d80fd['body'],{})[_0x5adb('0x27')](respondWithResult(_0x4f5721,0xc9))[_0x5adb('0xae')](handleError(_0x4f5721,null));};exports['update']=function(_0x498ecc,_0x43b91c){if(_0x498ecc['body']['id']){delete _0x498ecc['body']['id'];}return db[_0x5adb('0x35')][_0x5adb('0x6a')]({'where':{'id':_0x498ecc[_0x5adb('0xb0')]['id']}})[_0x5adb('0x27')](handleEntityNotFound(_0x43b91c,null))[_0x5adb('0x27')](saveUpdates(_0x498ecc[_0x5adb('0x6e')],null))[_0x5adb('0x27')](respondWithResult(_0x43b91c,null))[_0x5adb('0xae')](handleError(_0x43b91c,null));};exports[_0x5adb('0x28')]=function(_0x31b696,_0x44cf6a){return db[_0x5adb('0x35')][_0x5adb('0x6a')]({'where':{'id':_0x31b696['params']['id']}})[_0x5adb('0x27')](handleEntityNotFound(_0x44cf6a,null))['then'](removeEntity(_0x44cf6a,null))[_0x5adb('0xae')](handleError(_0x44cf6a,null));};exports[_0x5adb('0xb6')]=function(_0x280f30,_0xad6905){return db[_0x5adb('0x35')][_0x5adb('0xb6')]()[_0x5adb('0x27')](respondWithResult(_0xad6905,null))[_0x5adb('0xae')](handleError(_0xad6905,null));};exports[_0x5adb('0xb7')]=function(_0x36a8f0,_0x41fa3c,_0x18fc00){return db['WhatsappMessage'][_0x5adb('0x6a')]({'where':{'id':_0x36a8f0[_0x5adb('0xb0')]['id']}})[_0x5adb('0x27')](handleEntityNotFound(_0x41fa3c,null))[_0x5adb('0x27')](function(_0x1da6bc){if(_0x1da6bc){return _0x1da6bc[_0x5adb('0xb7')](_0x36a8f0[_0x5adb('0x6e')][_0x5adb('0xb8')],_['omit'](_0x36a8f0[_0x5adb('0x6e')],[_0x5adb('0xb8'),'id'])||{});}})[_0x5adb('0x27')](respondWithResult(_0x41fa3c,null))['catch'](handleError(_0x41fa3c,null));};exports[_0x5adb('0xb9')]=function(_0x4ae211,_0x74065,_0x50c3a3){var _0x54da7c={'raw':![],'where':{}};var _0x173ead={};var _0x3796b7={'count':0x0,'rows':[]};return db[_0x5adb('0x35')][_0x5adb('0xba')]({'where':{'id':_0x4ae211[_0x5adb('0xb0')]['id']}})[_0x5adb('0x27')](handleEntityNotFound(_0x74065,null))[_0x5adb('0x27')](function(_0xa1911a){if(_0xa1911a){_0x173ead[_0x5adb('0x3b')]=_[_0x5adb('0x6f')](db[_0x5adb('0xbb')][_0x5adb('0x36')]);_0x173ead['query']=_[_0x5adb('0x6f')](_0x4ae211['query']);_0x173ead[_0x5adb('0x42')]=_[_0x5adb('0x3a')](_0x173ead['model'],_0x173ead[_0x5adb('0x39')]);_0x54da7c[_0x5adb('0x3c')]=_['intersection'](_0x173ead['model'],qs[_0x5adb('0x3d')](_0x4ae211[_0x5adb('0x39')][_0x5adb('0x3d')]));_0x54da7c[_0x5adb('0x3c')]=_0x54da7c[_0x5adb('0x3c')][_0x5adb('0x3e')]?_0x54da7c['attributes']:_0x173ead[_0x5adb('0x3b')];if(!_0x4ae211[_0x5adb('0x39')][_0x5adb('0xbc')](_0x5adb('0xbd'))){_0x54da7c[_0x5adb('0x3f')]=qs['limit'](_0x4ae211['query'][_0x5adb('0x3f')]);_0x54da7c[_0x5adb('0x21')]=qs[_0x5adb('0x21')](_0x4ae211[_0x5adb('0x39')][_0x5adb('0x21')]);}_0x54da7c[_0x5adb('0x40')]=qs[_0x5adb('0x41')](_0x4ae211[_0x5adb('0x39')][_0x5adb('0x41')]);_0x54da7c['where']=qs[_0x5adb('0x42')](_[_0x5adb('0x43')](_0x4ae211['query'],_0x173ead['filters']));_0x54da7c['where'][_0x5adb('0xac')]=_0xa1911a['id'];if(_0x4ae211[_0x5adb('0x39')][_0x5adb('0x81')]){_0x54da7c['where']=_['merge'](_0x54da7c[_0x5adb('0x79')],{'$or':_[_0x5adb('0x2e')](_0x54da7c[_0x5adb('0x3c')],function(_0x3d2a5b){var _0x3b367f={};_0x3b367f[_0x3d2a5b]={'$like':'%'+_0x4ae211[_0x5adb('0x39')]['filter']+'%'};return _0x3b367f;})});}if(_0x4ae211['query'][_0x5adb('0xbe')]){var _0x5a9e55=_0x4ae211[_0x5adb('0x39')][_0x5adb('0xbe')]['split'](',');var _0x7151b8={};_0x7151b8[_0x5a9e55[0x0]]={'$gte':moment(_0x5a9e55[0x1])[_0x5adb('0xbf')](_0x5adb('0xc0'))};_0x54da7c[_0x5adb('0x79')]=_['merge'](_0x54da7c[_0x5adb('0x79')],_0x7151b8);}_0x54da7c=_[_0x5adb('0xb3')]({},_0x54da7c,_0x4ae211[_0x5adb('0xb4')]);return db[_0x5adb('0xbb')]['count']({'where':_0x54da7c[_0x5adb('0x79')]})['then'](function(_0x29cc2f){_0x3796b7[_0x5adb('0x97')]=_0x29cc2f;if(_0x4ae211[_0x5adb('0x39')][_0x5adb('0xb1')]){_0x54da7c[_0x5adb('0xb2')]=[{'all':!![]}];}return db[_0x5adb('0xbb')]['findAll'](_0x54da7c);})[_0x5adb('0x27')](function(_0x49e908){_0x3796b7[_0x5adb('0xc1')]=_0x49e908;return _0x3796b7;});}})[_0x5adb('0x27')](respondWithFilteredResult(_0x74065,_0x54da7c))['catch'](handleError(_0x74065,null));};exports[_0x5adb('0xc2')]=function(_0x52e44f,_0x5a517a,_0x4d50f7){return db[_0x5adb('0x35')]['find']({'where':{'id':_0x52e44f['params']['id']}})[_0x5adb('0x27')](handleEntityNotFound(_0x5a517a,null))[_0x5adb('0x27')](function(_0x325f86){if(_0x325f86){return _0x325f86[_0x5adb('0xc3')](_0x52e44f[_0x5adb('0x6e')][_0x5adb('0xb8')],_[_0x5adb('0xc4')](_0x52e44f['body'],[_0x5adb('0xb8'),'id'])||{})[_0x5adb('0xc5')](function(){return db['Tag'][_0x5adb('0xc6')]({'attributes':['id',_0x5adb('0x2b'),_0x5adb('0xc7')],'where':{'id':_0x52e44f[_0x5adb('0x6e')][_0x5adb('0xb8')]}});})[_0x5adb('0x27')](function(_0x3a88ab){socket[_0x5adb('0xc8')](_0x5adb('0xc9'),{'id':Number(_0x52e44f[_0x5adb('0xb0')]['id']),'tags':_0x3a88ab||[]});return{'id':Number(_0x52e44f[_0x5adb('0xb0')]['id']),'tags':_0x3a88ab||[]};});}})[_0x5adb('0x27')](respondWithResult(_0x5a517a,null))['catch'](handleError(_0x5a517a,null));};exports['removeTags']=function(_0x2376a6,_0x282c11,_0x35a718){return db[_0x5adb('0x35')]['find']({'where':{'id':_0x2376a6[_0x5adb('0xb0')]['id']}})[_0x5adb('0x27')](handleEntityNotFound(_0x282c11,null))[_0x5adb('0x27')](function(_0xb9ac38){if(_0xb9ac38){return _0xb9ac38[_0x5adb('0xca')](_0x2376a6['query']['ids']);}})[_0x5adb('0x27')](respondWithStatusCode(_0x282c11,null))['catch'](handleError(_0x282c11,null));};exports[_0x5adb('0xcb')]=function(_0x64fae1,_0x3ad256){var _0x2b4228=moment()[_0x5adb('0xcc')]()[_0x5adb('0x96')]();var _0x5e17ea=path[_0x5adb('0xcd')](config[_0x5adb('0xce')],_0x5adb('0xcf'),_0x5adb('0xd0'),_0x5adb('0xd1'));var _0xabc1ee=path[_0x5adb('0xcd')](config['root'],'server','files',_0x5adb('0xd2'));var _0x5ae730=path[_0x5adb('0xcd')](_0x5e17ea,_0x2b4228);var _0x5983ef=util['format'](_0x5adb('0xd3'),_0x64fae1[_0x5adb('0xb0')]['id'],_0x2b4228);var _0x5e74dc=path['join'](_0x5e17ea,_0x5983ef);var _0x3612c=[];_0x3612c[_0x5adb('0x34')]({'model':db[_0x5adb('0x68')],'as':'User','attributes':['id',_0x5adb('0x2f')],'raw':!![]});_0x3612c['push']({'model':db['CmContact'],'as':_0x5adb('0x5d'),'attributes':['id',_0x5adb('0xd4'),_0x5adb('0xd5')],'raw':!![]});if(_0x64fae1['query']['attachments']){_0x3612c[_0x5adb('0x34')]({'model':db[_0x5adb('0xd6')],'as':'Attachment','raw':!![]});}var _0x5366d4=[{'model':db[_0x5adb('0xbb')],'as':_0x5adb('0xd7'),'attributes':['id','body',_0x5adb('0x75'),'direction',_0x5adb('0xd8'),'read'],'include':_0x3612c}];_0x5366d4[_0x5adb('0x34')]({'model':db[_0x5adb('0xd9')],'as':_0x5adb('0xda'),'attributes':['id',_0x5adb('0x2b')]});_0x5366d4[_0x5adb('0x34')]({'model':db['User'],'as':_0x5adb('0xdb'),'attributes':['id',_0x5adb('0x2f')]});return db[_0x5adb('0x35')]['find']({'where':{'id':_0x64fae1[_0x5adb('0xb0')]['id']},'include':_0x5366d4})[_0x5adb('0x27')](handleEntityNotFound(_0x3ad256,null))[_0x5adb('0x27')](function(_0x45526a){if(_0x45526a){var _0x57607e=_0x45526a[_0x5adb('0xdc')]({'plain':!![]});fs[_0x5adb('0xdd')](_0x5ae730);var _0x3bbe7c={'format':'A4','border':'10px','header':{'height':_0x5adb('0xde'),'contents':{'first':'\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'}},'footer':{'height':_0x5adb('0xdf'),'contents':{'default':util[_0x5adb('0xbf')](_0x5adb('0xe0'),util[_0x5adb('0xbf')](_0x5adb('0xe1'),'Whatsapp',_0x57607e['id']),moment()['format']('YYYY-MM-DD')[_0x5adb('0x96')]())}}};var _0x4a1b54={'channel':'Whatsapp','account':_0x57607e[_0x5adb('0xda')][_0x5adb('0x2b')],'agent':_0x57607e[_0x5adb('0xdb')]?_0x57607e[_0x5adb('0xdb')][_0x5adb('0x2f')]:_0x5adb('0xe2'),'createdAt':moment(_0x57607e[_0x5adb('0x75')])[_0x5adb('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5adb('0x96')](),'closedAt':_0x57607e[_0x5adb('0xe3')]?moment(_0x57607e['closedAt'])[_0x5adb('0xbf')](_0x5adb('0xc0'))['toString']():'','disposition':_0x57607e[_0x5adb('0xe4')],'messages':_(_0x57607e['Messages'])[_0x5adb('0x81')]({'secret':![]})[_0x5adb('0x2e')](function(_0x3d782b){if(_0x3d782b[_0x5adb('0xd6')]){var _0x651279=path[_0x5adb('0xcd')](_0xabc1ee,_0x3d782b[_0x5adb('0xd6')][_0x5adb('0xe5')]);if(fs['existsSync'](_0x651279)){fs[_0x5adb('0xe6')](_0x651279)['pipe'](fs[_0x5adb('0xe7')](path['join'](_0x5ae730,_0x3d782b[_0x5adb('0xd6')]['basename'])));}}return{'date':moment(_0x3d782b[_0x5adb('0x75')])[_0x5adb('0xbf')](_0x5adb('0xc0'))[_0x5adb('0x96')](),'sender':_0x3d782b[_0x5adb('0xe8')]===_0x5adb('0xe9')?_0x3d782b[_0x5adb('0x68')]?_0x3d782b[_0x5adb('0x68')][_0x5adb('0x2f')]:_0x5adb('0xea'):_0x3d782b[_0x5adb('0x5d')][_0x5adb('0xd4')]+(_0x3d782b[_0x5adb('0x5d')]['lastName']?'\x20'+_0x3d782b[_0x5adb('0x5d')]['lastName']:''),'body':_0x3d782b[_0x5adb('0xd6')]?_0x3d782b[_0x5adb('0xd6')][_0x5adb('0xe5')]:_0x3d782b['body'],'direction':_0x3d782b['direction']==='out'?'A':'C','secret':_0x3d782b['secret'],'read':_0x3d782b[_0x5adb('0x7c')],'attachment':_0x3d782b[_0x5adb('0xd6')]};})[_0x5adb('0x5f')]()};return ejs[_0x5adb('0xeb')](path[_0x5adb('0xcd')](config[_0x5adb('0xce')],_0x5adb('0xcf'),_0x5adb('0xec'),_0x5adb('0xed')),{'interaction':_0x4a1b54})['then'](function(_0x39bf82){return new BPromise(function(_0x197b7f,_0x171fb9){pdf[_0x5adb('0xb5')](_0x39bf82,_0x3bbe7c)[_0x5adb('0xee')](path[_0x5adb('0xcd')](_0x5ae730,'transcript-'+_0x57607e['id']+'-'+_0x2b4228+'.pdf'),function(_0x4edb9e,_0x25f1f7){if(_0x4edb9e)return _0x171fb9(_0x4edb9e);_0x197b7f(_0x25f1f7);});});})[_0x5adb('0x27')](function(){return new BPromise(function(_0xb81dd2,_0x2b753d){zipdir(_0x5ae730,{'saveTo':_0x5e74dc},function(_0x27eb1e,_0x5eef55){if(_0x27eb1e)return _0x2b753d(_0x27eb1e);return _0xb81dd2(_0x5eef55);});})[_0x5adb('0x27')](function(){return new BPromise(function(_0x2cb713,_0x2034d7){rimraf(_0x5ae730,function(_0x3dd67b){if(_0x3dd67b)_0x2034d7(_0x3dd67b);return _0x2cb713();});});})[_0x5adb('0x27')](function(){return _0x3ad256[_0x5adb('0xcb')](_0x5e74dc,_0x5983ef,function(_0x38c24d){if(_0x38c24d){console[_0x5adb('0xef')](_0x5adb('0xf0'),_0x38c24d);}else{fs[_0x5adb('0xf1')](_0x5e74dc);}});});});}else{return _0x3ad256[_0x5adb('0x1d')](0xc8);}})[_0x5adb('0xae')](handleError(_0x3ad256,null));};
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js
index f0f514f..5216bf1 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 _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
+var _0x75da=['exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','emit','catch','hasOwnProperty'];(function(_0x47aa4b,_0x1dc3ea){var _0x2ae9bb=function(_0x3b3879){while(--_0x3b3879){_0x47aa4b['push'](_0x47aa4b['shift']());}};_0x2ae9bb(++_0x1dc3ea);}(_0x75da,0xd2));var _0xa75d=function(_0x8f15dd,_0x1b132c){_0x8f15dd=_0x8f15dd-0x0;var _0x6a2868=_0x75da[_0x8f15dd];return _0x6a2868;};'use strict';var EventEmitter=require(_0xa75d('0x0'));var WhatsappInteraction=require(_0xa75d('0x1'))['db'][_0xa75d('0x2')];var WhatsappMessage=require(_0xa75d('0x1'))['db'][_0xa75d('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xa75d('0x4')](0x0);var events={'afterCreate':_0xa75d('0x5'),'afterUpdate':_0xa75d('0x6'),'afterDestroy':_0xa75d('0x7')};function emitEvent(_0x4b4903){return function(_0x44af9a,_0x26fa14,_0xb9c32b){_0x44af9a[_0xa75d('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1b2860){_0x44af9a[_0xa75d('0x9')](_0xa75d('0xa'),_0x1b2860[_0xa75d('0xb')](function(_0x164f51){return{'id':_0x164f51['id']};}));return WhatsappMessage[_0xa75d('0xc')]({'where':{'WhatsappInteractionId':_0x44af9a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa75d('0xd')](function(_0x2a7951){_0x44af9a[_0xa75d('0x9')](_0xa75d('0xe'),_0x2a7951['length']);WhatsappInteractionEvents[_0xa75d('0xf')](_0x4b4903+':'+_0x44af9a['id'],_0x44af9a);WhatsappInteractionEvents[_0xa75d('0xf')](_0x4b4903,_0x44af9a);_0xb9c32b(null);})[_0xa75d('0x10')](_0xb9c32b(null));};}for(var e in events){if(events[_0xa75d('0x11')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xa75d('0x12')]=WhatsappInteractionEvents;
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js
index 1ca4b22..f0cc335 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(_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
+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(_0x557389,_0x92c7e1){var _0x43fc59=function(_0x15300c){while(--_0x15300c){_0x557389['push'](_0x557389['shift']());}};_0x43fc59(++_0x92c7e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 6b52aa6..afd2d94 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 _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
+var _0x604a=['request','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','attributes','then','catch','where','addTags','ids','body','AddTags','lodash','util','moment','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./whatsappInteraction.socket','register'];(function(_0xe2fd39,_0x436fb5){var _0x141872=function(_0x6ff74b){while(--_0x6ff74b){_0xe2fd39['push'](_0xe2fd39['shift']());}};_0x141872(++_0x436fb5);}(_0x604a,0x11a));var _0xa604=function(_0x5a3e4b,_0x5eaa8a){_0x5a3e4b=_0x5a3e4b-0x0;var _0x218910=_0x604a[_0x5a3e4b];return _0x218910;};'use strict';var _=require(_0xa604('0x0'));var util=require(_0xa604('0x1'));var moment=require(_0xa604('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa604('0x3'))['db'];var utils=require(_0xa604('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa604('0x5'));var jayson=require(_0xa604('0x6'));var client=jayson[_0xa604('0x7')][_0xa604('0x8')]({'port':0x232a});config['redis']=_[_0xa604('0x9')](config[_0xa604('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa604('0xb'))(new Redis(config[_0xa604('0xa')]));require(_0xa604('0xc'))[_0xa604('0xd')](socket);function respondWithRpcPromise(_0x168247,_0x1e9fe3,_0x8d508b){return new BPromise(function(_0x4081bd,_0x5b80cd){return client[_0xa604('0xe')](_0x168247,_0x8d508b)['then'](function(_0x453fbd){logger[_0xa604('0xf')](_0xa604('0x10'),_0x1e9fe3,'request\x20sent');logger[_0xa604('0x11')](_0xa604('0x12'),_0x1e9fe3,_0xa604('0x13'),JSON[_0xa604('0x14')](_0x453fbd));if(_0x453fbd[_0xa604('0x15')]){if(_0x453fbd[_0xa604('0x15')][_0xa604('0x16')]===0x1f4){logger['error'](_0xa604('0x10'),_0x1e9fe3,_0x453fbd['error'][_0xa604('0x17')]);return _0x5b80cd(_0x453fbd['error'][_0xa604('0x17')]);}logger[_0xa604('0x15')](_0xa604('0x10'),_0x1e9fe3,_0x453fbd[_0xa604('0x15')][_0xa604('0x17')]);return _0x4081bd(_0x453fbd['error'][_0xa604('0x17')]);}else{logger[_0xa604('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x1e9fe3,'request\x20sent');_0x4081bd(_0x453fbd['result'][_0xa604('0x17')]);}})['catch'](function(_0x5ec258){logger[_0xa604('0x15')](_0xa604('0x10'),_0x1e9fe3,_0x5ec258);_0x5b80cd(_0x5ec258);});});}exports[_0xa604('0x18')]=function(_0x5ea0df){var _0x33c47e=this;return new Promise(function(_0x37f26b,_0x2ba3da){return db[_0xa604('0x19')][_0xa604('0x1a')](_0x5ea0df['body'],{'raw':_0x5ea0df[_0xa604('0x1b')]?_0x5ea0df['options'][_0xa604('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ea0df[_0xa604('0x1b')]?_0x5ea0df[_0xa604('0x1b')]['where']||null:null,'attributes':_0x5ea0df[_0xa604('0x1b')]?_0x5ea0df['options'][_0xa604('0x1d')]||null:null,'limit':_0x5ea0df[_0xa604('0x1b')]?_0x5ea0df[_0xa604('0x1b')]['limit']||null:null})[_0xa604('0x1e')](function(_0x33df26){logger['info']('UpdateWhatsappInteraction',_0x5ea0df);logger[_0xa604('0x11')](_0xa604('0x18'),_0x5ea0df,JSON['stringify'](_0x33df26));_0x37f26b(_0x33df26);})[_0xa604('0x1f')](function(_0x5ae0dd){logger[_0xa604('0x15')]('UpdateWhatsappInteraction',_0x5ae0dd['message'],_0x5ea0df);_0x2ba3da(_0x33c47e['error'](0x1f4,_0x5ae0dd[_0xa604('0x17')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x1d5a28){return new Promise(function(_0x4731ea,_0x5b850e){return db[_0xa604('0x19')]['find']({'where':_0x1d5a28[_0xa604('0x1b')]?_0x1d5a28['options'][_0xa604('0x20')]||null:null})[_0xa604('0x1e')](function(_0xe070ff){if(_0xe070ff){return _0xe070ff[_0xa604('0x21')](_0x1d5a28['body'][_0xa604('0x22')],_['omit'](_0x1d5a28[_0xa604('0x23')],[_0xa604('0x22'),'id'])||{});}})['spread'](function(_0x286339){logger[_0xa604('0xf')]('AddTags',_0x1d5a28);logger[_0xa604('0x11')](_0xa604('0x24'),_0x1d5a28,JSON[_0xa604('0x14')](_0x286339));_0x4731ea(_0x286339);})['catch'](function(_0x37dbc0){logger[_0xa604('0x15')]('AddTags',_0x37dbc0[_0xa604('0x17')],_0x1d5a28);_0x5b850e(_this[_0xa604('0x15')](0x1f4,_0x37dbc0[_0xa604('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js
index b10d9cc..67e4fce 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 _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
+var _0x08cd=['update','emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x4f13a8,_0x28c4f2){var _0x3cba2f=function(_0x2ce466){while(--_0x2ce466){_0x4f13a8['push'](_0x4f13a8['shift']());}};_0x3cba2f(++_0x28c4f2);}(_0x08cd,0x126));var _0xd08c=function(_0x19ce3e,_0xf5efba){_0x19ce3e=_0x19ce3e-0x0;var _0x45a5ca=_0x08cd[_0x19ce3e];return _0x45a5ca;};'use strict';var WhatsappInteractionEvents=require(_0xd08c('0x0'));var events=[_0xd08c('0x1'),'remove',_0xd08c('0x2')];function createListener(_0x1714e5,_0x33aa79){return function(_0x5485ba){_0x33aa79[_0xd08c('0x3')](_0x1714e5,_0x5485ba);};}function removeListener(_0x404870,_0x562b53){return function(){WhatsappInteractionEvents[_0xd08c('0x4')](_0x404870,_0x562b53);};}exports[_0xd08c('0x5')]=function(_0x6fb4da){for(var _0x10bfd4=0x0,_0x2c205c=events[_0xd08c('0x6')];_0x10bfd4<_0x2c205c;_0x10bfd4++){var _0x4ded46=events[_0x10bfd4];var _0x40818a=createListener(_0xd08c('0x7')+_0x4ded46,_0x6fb4da);WhatsappInteractionEvents['on'](_0x4ded46,_0x40818a);}};
\ No newline at end of file
diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js
index f4197a5..b0c4547 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 _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
+var _0xa037=['index','/describe','describe','/:id','post','tracked','whatsapp','create','/:id/status','status','update','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated'];(function(_0x1334df,_0x15f6cf){var _0x240b99=function(_0x1d2f71){while(--_0x1d2f71){_0x1334df['push'](_0x1334df['shift']());}};_0x240b99(++_0x15f6cf);}(_0xa037,0xd6));var _0x7a03=function(_0x294f10,_0x594a67){_0x294f10=_0x294f10-0x0;var _0x12b23b=_0xa037[_0x294f10];return _0x12b23b;};'use strict';var multer=require(_0x7a03('0x0'));var util=require(_0x7a03('0x1'));var path=require(_0x7a03('0x2'));var timeout=require('connect-timeout');var express=require(_0x7a03('0x3'));var router=express[_0x7a03('0x4')]();var auth=require(_0x7a03('0x5'));var interaction=require(_0x7a03('0x6'));var config=require(_0x7a03('0x7'));var controller=require(_0x7a03('0x8'));router['get']('/',auth[_0x7a03('0x9')](),controller[_0x7a03('0xa')]);router['get'](_0x7a03('0xb'),auth[_0x7a03('0x9')](),controller[_0x7a03('0xc')]);router['get'](_0x7a03('0xd'),auth[_0x7a03('0x9')](),controller['show']);router[_0x7a03('0xe')]('/',auth['isAuthenticated'](),interaction[_0x7a03('0xf')](_0x7a03('0x10'),'whatsappmessage:create'),controller[_0x7a03('0x11')]);router[_0x7a03('0xe')](_0x7a03('0x12'),controller[_0x7a03('0x13')]);router['put'](_0x7a03('0xd'),auth[_0x7a03('0x9')](),controller[_0x7a03('0x14')]);router[_0x7a03('0x15')](_0x7a03('0x16'),auth[_0x7a03('0x9')](),controller[_0x7a03('0x17')]);router['put']('/:id/reject',auth[_0x7a03('0x9')](),controller[_0x7a03('0x18')]);router[_0x7a03('0x19')](_0x7a03('0xd'),auth[_0x7a03('0x9')](),controller[_0x7a03('0x1a')]);module[_0x7a03('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js
index 59787f0..46bb660 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 _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
+var _0xac55=['medium','ENUM','out','STRING','DATE','BOOLEAN','sequelize','exports','TEXT'];(function(_0x3eb630,_0x552586){var _0x1b840d=function(_0x2594a8){while(--_0x2594a8){_0x3eb630['push'](_0x3eb630['shift']());}};_0x1b840d(++_0x552586);}(_0xac55,0x1c8));var _0x5ac5=function(_0x387d8a,_0x31e565){_0x387d8a=_0x387d8a-0x0;var _0x45e09b=_0xac55[_0x387d8a];return _0x45e09b;};'use strict';var Sequelize=require(_0x5ac5('0x0'));module[_0x5ac5('0x1')]={'body':{'type':Sequelize[_0x5ac5('0x2')](_0x5ac5('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5ac5('0x4')]('in',_0x5ac5('0x5')),'defaultValue':_0x5ac5('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5ac5('0x6')](0xbe)},'phone':{'type':Sequelize[_0x5ac5('0x6')]},'readAt':{'type':Sequelize[_0x5ac5('0x7')]},'secret':{'type':Sequelize[_0x5ac5('0x8')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js
index 2e68eeb..3ec1cf9 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 _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
+var _0x102d=['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','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','end','status','json','count','offset','set','Content-Range','reject','save','update','destroy','sendStatus','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','attributes','fields','length','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','filters','create','body','catch','find','describe','whatsapp-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','whatsapp','agent','get','rejectMessage','interface','EventManager','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x102d,0x1f2));var _0xd102=function(_0x92fbde,_0x4ab681){_0x92fbde=_0x92fbde-0x0;var _0x5c791b=_0x102d[_0x92fbde];return _0x5c791b;};'use strict';var pdf=require(_0xd102('0x0'));var emlformat=require(_0xd102('0x1'));var rimraf=require(_0xd102('0x2'));var zipdir=require(_0xd102('0x3'));var jsonpatch=require(_0xd102('0x4'));var rp=require(_0xd102('0x5'));var moment=require(_0xd102('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xd102('0x7'));var util=require(_0xd102('0x8'));var path=require(_0xd102('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd102('0xa'));var fs=require('fs');var _=require(_0xd102('0xb'));var squel=require('squel');var crypto=require(_0xd102('0xc'));var jsforce=require(_0xd102('0xd'));var deskjs=require(_0xd102('0xe'));var toCsv=require(_0xd102('0xf'));var querystring=require(_0xd102('0x10'));var Papa=require('papaparse');var Redis=require(_0xd102('0x11'));var authService=require(_0xd102('0x12'));var qs=require(_0xd102('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd102('0x14'));var logger=require(_0xd102('0x15'))('api');var utils=require(_0xd102('0x16'));var config=require('../../config/environment');var db=require(_0xd102('0x17'))['db'];config[_0xd102('0x18')]=_[_0xd102('0x19')](config[_0xd102('0x18')],{'host':_0xd102('0x1a'),'port':0x18eb});var socket=require(_0xd102('0x1b'))(new Redis(config[_0xd102('0x18')]));require(_0xd102('0x1c'))[_0xd102('0x1d')](socket);var jayson=require(_0xd102('0x1e'));var client=jayson[_0xd102('0x1f')][_0xd102('0x20')]({'port':0x232c});var client9002=jayson[_0xd102('0x1f')][_0xd102('0x20')]({'port':0x232a});function checkPasswordPattern(_0x594cd2,_0x4c8658,_0x2fafc5){if(_0x2fafc5){var _0x3abaef=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3abaef['test'](_0x4c8658)){return _0x594cd2;}else{throw new db[(_0xd102('0x21'))][(_0xd102('0x22'))](_0xd102('0x23'));}}else{return _0x594cd2;}}function respondWithRpcPromise(_0x597dbe,_0xc98aff,_0x481b60,_0x48e2fd){return new BPromise(function(_0x25011a,_0xb05567){var _0x4f0da2=_0x48e2fd||client;return _0x4f0da2[_0xd102('0x24')](_0x597dbe,_0x481b60)[_0xd102('0x25')](function(_0x407ea5){logger[_0xd102('0x26')](_0xd102('0x27'),_0xc98aff,_0xd102('0x28'));logger[_0xd102('0x29')](_0xd102('0x2a'),_0xc98aff,_0xd102('0x28'),JSON['stringify'](_0x407ea5));if(_0x407ea5[_0xd102('0x2b')]){if(_0x407ea5[_0xd102('0x2b')]['code']===0x1f4){logger[_0xd102('0x2b')](_0xd102('0x27'),_0xc98aff,_0x407ea5[_0xd102('0x2b')][_0xd102('0x2c')]);return _0xb05567(_0x407ea5[_0xd102('0x2b')][_0xd102('0x2c')]);}logger[_0xd102('0x2b')](_0xd102('0x27'),_0xc98aff,_0x407ea5['error']['message']);return _0x25011a(_0x407ea5[_0xd102('0x2b')][_0xd102('0x2c')]);}else{logger[_0xd102('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0xc98aff,_0xd102('0x28'));_0x25011a(_0x407ea5['result'][_0xd102('0x2c')]);}})['catch'](function(_0xf683be){logger[_0xd102('0x2b')](_0xd102('0x27'),_0xc98aff,_0xf683be);_0xb05567(_0xf683be);});});}function respondWithStatusCode(_0x6f5929,_0x9314d2){_0x9314d2=_0x9314d2||0xcc;return function(_0x3f68a7){if(_0x3f68a7){return _0x6f5929['sendStatus'](_0x9314d2);}return _0x6f5929['status'](_0x9314d2)[_0xd102('0x2d')]();};}function respondWithResult(_0x3c92a6,_0x4b308c){_0x4b308c=_0x4b308c||0xc8;return function(_0x5657cd){if(_0x5657cd){return _0x3c92a6[_0xd102('0x2e')](_0x4b308c)[_0xd102('0x2f')](_0x5657cd);}};}function respondWithFilteredResult(_0x2f091d,_0x52bc88){return function(_0x2939f9){if(_0x2939f9){var _0xc21d31=_0x2939f9[_0xd102('0x30')],_0x575d8c=_0x52bc88[_0xd102('0x31')],_0x168174=_0x52bc88[_0xd102('0x31')]+_0x52bc88['limit'],_0x29ba69;if(_0x168174>=_0xc21d31){_0x168174=_0xc21d31;_0x29ba69=0xc8;}else{_0x29ba69=0xce;}_0x2f091d[_0xd102('0x2e')](_0x29ba69);return _0x2f091d[_0xd102('0x32')](_0xd102('0x33'),_0x575d8c+'-'+_0x168174+'/'+_0xc21d31)[_0xd102('0x2f')](_0x2939f9);}return null;};}function patchUpdates(_0x3b6aad){return function(_0x20dfb9){try{jsonpatch['apply'](_0x20dfb9,_0x3b6aad,!![]);}catch(_0x5b1252){return BPromise[_0xd102('0x34')](_0x5b1252);}return _0x20dfb9[_0xd102('0x35')]();};}function saveUpdates(_0x57ff47,_0x7a6422){return function(_0x31fa7a){if(_0x31fa7a){return _0x31fa7a[_0xd102('0x36')](_0x57ff47)[_0xd102('0x25')](function(_0x113018){return _0x113018;});}return null;};}function removeEntity(_0x499531,_0x400a70){return function(_0x1ba517){if(_0x1ba517){return _0x1ba517[_0xd102('0x37')]()['then'](function(){_0x499531[_0xd102('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57406e,_0x5170a0){return function(_0xb945ac){if(!_0xb945ac){_0x57406e[_0xd102('0x38')](0x194);}return _0xb945ac;};}function handleError(_0x22e6fc,_0x50f98d){_0x50f98d=_0x50f98d||0x1f4;return function(_0x52d75a){logger['error'](_0x52d75a['stack']);if(_0x52d75a['name']){delete _0x52d75a['name'];}_0x22e6fc[_0xd102('0x2e')](_0x50f98d)[_0xd102('0x39')](_0x52d75a);};}exports[_0xd102('0x3a')]=function(_0x5bb1ad,_0x13ce9e){var _0x383760={},_0x3aff1c={},_0x51af3f={'count':0x0,'rows':[]};var _0x5ef2c5=_[_0xd102('0x3b')](db[_0xd102('0x3c')][_0xd102('0x3d')],function(_0x12b2b0){return{'name':_0x12b2b0[_0xd102('0x3e')],'type':_0x12b2b0[_0xd102('0x3f')][_0xd102('0x40')]};});_0x3aff1c['model']=_[_0xd102('0x3b')](_0x5ef2c5,_0xd102('0x41'));_0x3aff1c[_0xd102('0x42')]=_[_0xd102('0x43')](_0x5bb1ad[_0xd102('0x42')]);_0x3aff1c['filters']=_[_0xd102('0x44')](_0x3aff1c[_0xd102('0x45')],_0x3aff1c[_0xd102('0x42')]);_0x383760[_0xd102('0x46')]=_[_0xd102('0x44')](_0x3aff1c[_0xd102('0x45')],qs['fields'](_0x5bb1ad[_0xd102('0x42')][_0xd102('0x47')]));_0x383760[_0xd102('0x46')]=_0x383760['attributes'][_0xd102('0x48')]?_0x383760['attributes']:_0x3aff1c[_0xd102('0x45')];if(!_0x5bb1ad['query']['hasOwnProperty']('nolimit')){_0x383760[_0xd102('0x49')]=qs[_0xd102('0x49')](_0x5bb1ad['query'][_0xd102('0x49')]);_0x383760['offset']=qs[_0xd102('0x31')](_0x5bb1ad[_0xd102('0x42')]['offset']);}_0x383760[_0xd102('0x4a')]=qs[_0xd102('0x4b')](_0x5bb1ad[_0xd102('0x42')][_0xd102('0x4b')]);_0x383760[_0xd102('0x4c')]=qs['filters'](_[_0xd102('0x4d')](_0x5bb1ad[_0xd102('0x42')],_0x3aff1c['filters']),_0x5ef2c5);if(_0x5bb1ad['query'][_0xd102('0x4e')]){_0x383760['where']=_[_0xd102('0x4f')](_0x383760[_0xd102('0x4c')],{'$or':_[_0xd102('0x3b')](_0x5ef2c5,function(_0x1b175f){if(_0x1b175f[_0xd102('0x3f')]!==_0xd102('0x50')){var _0x105c3c={};_0x105c3c[_0x1b175f[_0xd102('0x41')]]={'$like':'%'+_0x5bb1ad[_0xd102('0x42')]['filter']+'%'};return _0x105c3c;}})});}_0x383760=_[_0xd102('0x4f')]({},_0x383760,_0x5bb1ad[_0xd102('0x51')]);var _0x2c9c57={'where':_0x383760[_0xd102('0x4c')]};return db[_0xd102('0x3c')][_0xd102('0x30')](_0x2c9c57)[_0xd102('0x25')](function(_0x5d094c){_0x51af3f[_0xd102('0x30')]=_0x5d094c;if(_0x5bb1ad[_0xd102('0x42')][_0xd102('0x52')]){_0x383760[_0xd102('0x53')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xd102('0x54')](_0x383760);})['then'](function(_0x345fbf){_0x51af3f[_0xd102('0x55')]=_0x345fbf;return _0x51af3f;})[_0xd102('0x25')](respondWithFilteredResult(_0x13ce9e,_0x383760))['catch'](handleError(_0x13ce9e,null));};exports[_0xd102('0x56')]=function(_0x2cb781,_0x313d1f){var _0x162c3c={'raw':!![],'where':{'id':_0x2cb781[_0xd102('0x57')]['id']}},_0x2ac485={};_0x2ac485[_0xd102('0x45')]=_[_0xd102('0x43')](db[_0xd102('0x3c')][_0xd102('0x3d')]);_0x2ac485[_0xd102('0x42')]=_[_0xd102('0x43')](_0x2cb781[_0xd102('0x42')]);_0x2ac485[_0xd102('0x58')]=_[_0xd102('0x44')](_0x2ac485[_0xd102('0x45')],_0x2ac485[_0xd102('0x42')]);_0x162c3c[_0xd102('0x46')]=_[_0xd102('0x44')](_0x2ac485[_0xd102('0x45')],qs[_0xd102('0x47')](_0x2cb781[_0xd102('0x42')]['fields']));_0x162c3c[_0xd102('0x46')]=_0x162c3c[_0xd102('0x46')][_0xd102('0x48')]?_0x162c3c['attributes']:_0x2ac485[_0xd102('0x45')];if(_0x2cb781[_0xd102('0x42')][_0xd102('0x52')]){_0x162c3c[_0xd102('0x53')]=[{'all':!![]}];}_0x162c3c=_[_0xd102('0x4f')]({},_0x162c3c,_0x2cb781[_0xd102('0x51')]);return db['WhatsappMessage']['find'](_0x162c3c)[_0xd102('0x25')](handleEntityNotFound(_0x313d1f,null))['then'](respondWithResult(_0x313d1f,null))['catch'](handleError(_0x313d1f,null));};exports[_0xd102('0x59')]=function(_0x73530f,_0x3d1ef5){return db['WhatsappMessage'][_0xd102('0x59')](_0x73530f[_0xd102('0x5a')],{})['then'](respondWithResult(_0x3d1ef5,0xc9))[_0xd102('0x5b')](handleError(_0x3d1ef5,null));};exports[_0xd102('0x36')]=function(_0x25a931,_0xa0f495){if(_0x25a931[_0xd102('0x5a')]['id']){delete _0x25a931[_0xd102('0x5a')]['id'];}return db['WhatsappMessage'][_0xd102('0x5c')]({'where':{'id':_0x25a931[_0xd102('0x57')]['id']}})[_0xd102('0x25')](handleEntityNotFound(_0xa0f495,null))[_0xd102('0x25')](saveUpdates(_0x25a931['body'],null))[_0xd102('0x25')](respondWithResult(_0xa0f495,null))[_0xd102('0x5b')](handleError(_0xa0f495,null));};exports[_0xd102('0x37')]=function(_0x1db5c5,_0x2f9dd3){return db[_0xd102('0x3c')][_0xd102('0x5c')]({'where':{'id':_0x1db5c5[_0xd102('0x57')]['id']}})[_0xd102('0x25')](handleEntityNotFound(_0x2f9dd3,null))['then'](removeEntity(_0x2f9dd3,null))['catch'](handleError(_0x2f9dd3,null));};exports[_0xd102('0x5d')]=function(_0x3c61a7,_0x38d9a8){return db[_0xd102('0x3c')]['describe']()['then'](respondWithResult(_0x38d9a8,null))[_0xd102('0x5b')](handleError(_0x38d9a8,null));};var interaction_log=require(_0xd102('0x15'))(_0xd102('0x5e'));exports[_0xd102('0x5f')]=function(_0x53e982,_0x20e5f7,_0x2b47cd){var _0x38aa94={'channel':'whatsapp'};if(_0x53e982[_0xd102('0x5a')]['id']){delete _0x53e982[_0xd102('0x5a')]['id'];}_0x53e982[_0xd102('0x5a')][_0xd102('0x60')]=!![];_0x53e982[_0xd102('0x5a')][_0xd102('0x61')]=moment()[_0xd102('0x62')](_0xd102('0x63'));_0x53e982[_0xd102('0x5a')][_0xd102('0x64')]=_0x53e982[_0xd102('0x5a')][_0xd102('0x64')]||_0x53e982[_0xd102('0x65')]['id'];return db[_0xd102('0x3c')]['find']({'where':{'id':_0x53e982['params']['id'],'UserId':null},'include':[{'model':db[_0xd102('0x66')],'as':_0xd102('0x67')}]})[_0xd102('0x25')](handleEntityNotFound(_0x20e5f7,null))['then'](saveUpdates(_0x53e982[_0xd102('0x5a')],null))[_0xd102('0x25')](function(_0x3a34ae){if(_0x3a34ae){_0x38aa94['message']=_0x3a34ae['get']({'plain':!![]});return db[_0xd102('0x68')][_0xd102('0x5c')]({'where':{'id':_0x3a34ae[_0xd102('0x69')]}});}return null;})[_0xd102('0x25')](handleEntityNotFound(_0x20e5f7,null))[_0xd102('0x25')](function(_0x460de3){if(_0x460de3){return _0x460de3['update']({'UserId':_0x53e982[_0xd102('0x5a')][_0xd102('0x64')],'read1stAt':_[_0xd102('0x6a')](_0x460de3[_0xd102('0x6b')])?moment()['format'](_0xd102('0x63')):undefined});}return null;})['then'](function(_0xdc1555){if(_0xdc1555){_0x38aa94[_0xd102('0x6c')]=_0xdc1555['get']({'plain':!![]});interaction_log['info'](_0xd102('0x6d'),_0x53e982[_0xd102('0x65')]['id'],_0x53e982['user']['name'],_0x53e982['user']['role'],_0x38aa94['interaction']['id'],_0x53e982['body']?JSON[_0xd102('0x6e')](_0x53e982[_0xd102('0x5a')]):_0xd102('0x6f'));return respondWithRpcPromise(_0xd102('0x70'),_0xd102('0x71'),_0x38aa94);}return null;})[_0xd102('0x25')](function(_0x27e77d){if(_0x27e77d){if(_0x53e982[_0xd102('0x5a')][_0xd102('0x72')]){_0x38aa94[_0xd102('0x2c')]['interface']=util[_0xd102('0x62')](_0xd102('0x73'),_0x53e982[_0xd102('0x65')][_0xd102('0x41')]);_0x38aa94['message'][_0xd102('0x74')]=_0x38aa94[_0xd102('0x74')];_0x38aa94[_0xd102('0x2c')][_0xd102('0x75')]=_0xd102('0x5f');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x38aa94[_0xd102('0x2c')]},client9002)[_0xd102('0x25')](function(){return _0x38aa94;});}return _0x38aa94;}return null;})[_0xd102('0x25')](respondWithResult(_0x20e5f7,null))[_0xd102('0x5b')](handleError(_0x20e5f7,null));};var interaction_log=require(_0xd102('0x15'))(_0xd102('0x5e'));exports[_0xd102('0x34')]=function(_0x223cac,_0x236a08,_0xc9054d){var _0x65628b={'agent':{},'channel':_0xd102('0x76')};if(_0x223cac[_0xd102('0x5a')]['id']){delete _0x223cac[_0xd102('0x5a')]['id'];}_0x223cac['body']['UserId']=_0x223cac[_0xd102('0x5a')][_0xd102('0x64')]||_0x223cac[_0xd102('0x65')]['id'];_0x65628b[_0xd102('0x77')]['id']=_0x223cac[_0xd102('0x5a')][_0xd102('0x64')];return db[_0xd102('0x3c')]['find']({'where':{'id':_0x223cac[_0xd102('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x236a08,null))['then'](function(_0x272913){if(_0x272913){_0x65628b[_0xd102('0x2c')]=_0x272913[_0xd102('0x78')]({'plain':!![]});return db[_0xd102('0x68')][_0xd102('0x5c')]({'where':{'id':_0x272913[_0xd102('0x69')]}});}return null;})[_0xd102('0x25')](handleEntityNotFound(_0x236a08,null))[_0xd102('0x25')](function(_0x5a2470){if(_0x5a2470){_0x65628b['interaction']=_0x5a2470['get']({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x223cac[_0xd102('0x65')]['id'],_0x223cac[_0xd102('0x65')][_0xd102('0x41')],_0x223cac[_0xd102('0x65')]['role'],_0x65628b[_0xd102('0x6c')]['id'],_0x223cac[_0xd102('0x5a')]?JSON[_0xd102('0x6e')](_0x223cac[_0xd102('0x5a')]):_0xd102('0x6f'));return respondWithRpcPromise('RejectMessage',_0xd102('0x79'),_0x65628b);}return null;})[_0xd102('0x25')](function(_0x38b8cd){if(_0x38b8cd){_0x38b8cd['message'][_0xd102('0x7a')]=util[_0xd102('0x62')](_0xd102('0x73'),_0x223cac[_0xd102('0x65')]['name']);_0x38b8cd['message'][_0xd102('0x74')]=_0x65628b[_0xd102('0x74')];_0x38b8cd[_0xd102('0x2c')][_0xd102('0x75')]='reject';respondWithRpcPromise(_0xd102('0x7b'),_0xd102('0x7b'),{'event':_0xd102('0x7c'),'message':_0x38b8cd['message']},client9002);return _0x65628b;}return null;})['then'](respondWithResult(_0x236a08,null))[_0xd102('0x5b')](handleError(_0x236a08,null));};exports[_0xd102('0x2e')]=function(_0x171d46,_0x508ab2,_0x234111){if(_0x171d46['body']['id']){delete _0x171d46[_0xd102('0x5a')]['id'];}var _0x538541;return db[_0xd102('0x3c')][_0xd102('0x5c')]({'where':{'id':_0x171d46[_0xd102('0x57')]['id']}})['then'](handleEntityNotFound(_0x508ab2,null))['then'](function(_0x5efe35){if(_0x5efe35){_0x538541=_0x5efe35;return db[_0xd102('0x7d')]['find']({'where':{'id':_0x5efe35['WhatsappAccountId']}});}})[_0xd102('0x25')](handleEntityNotFound(_0x508ab2,null))['then'](function(_0x11f9bb){if(_0x11f9bb){logger['debug'](_0xd102('0x7e'),'status','received\x20delivery\x20report\x20from',_0x11f9bb[_0xd102('0x3f')],util[_0xd102('0x7f')](_0x171d46[_0xd102('0x5a')],{'showHidden':![],'depth':null}));switch(_0x11f9bb[_0xd102('0x3f')]){case _0xd102('0x80'):if(_0x171d46[_0xd102('0x5a')][_0xd102('0x81')]&&_0x171d46[_0xd102('0x5a')]['MessageSid']===_0x538541['messageId']&&_0x171d46[_0xd102('0x5a')][_0xd102('0x82')]&&_0x171d46[_0xd102('0x5a')][_0xd102('0x82')]===_0xd102('0x60')){return _0x538541[_0xd102('0x36')]({'read':!![]});}else{logger[_0xd102('0x2b')](_0xd102('0x83'),'status',_0xd102('0x80'),util['inspect'](_0x171d46[_0xd102('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x538541;}})['then'](respondWithResult(_0x508ab2,null))[_0xd102('0x5b')](handleError(_0x508ab2,null));};
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js
index c3d49ad..98d68e6 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 _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
+var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x16367c,_0x1b3975){var _0x35270d=function(_0x20d72f){while(--_0x20d72f){_0x16367c['push'](_0x16367c['shift']());}};_0x35270d(++_0x1b3975);}(_0x5f2f,0x73));var _0xf5f2=function(_0x553857,_0x4951cb){_0x553857=_0x553857-0x0;var _0x205ca1=_0x5f2f[_0x553857];return _0x205ca1;};'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 47a3b71..0f807d0 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 _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
+var _0x146c=['phone','remote','/status?token=','token','sid','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','create','whatsapp:'];(function(_0x5827b5,_0x5bce22){var _0x2ed4b5=function(_0x5aa8ad){while(--_0x5aa8ad){_0x5827b5['push'](_0x5827b5['shift']());}};_0x2ed4b5(++_0x5bce22);}(_0x146c,0x6a));var _0xc146=function(_0x1a4701,_0x179298){_0x1a4701=_0x1a4701-0x0;var _0x18fce0=_0x146c[_0x1a4701];return _0x18fce0;};'use strict';var _=require(_0xc146('0x0'));var util=require(_0xc146('0x1'));var logger=require(_0xc146('0x2'))(_0xc146('0x3'));var moment=require(_0xc146('0x4'));var BPromise=require('bluebird');var rp=require(_0xc146('0x5'));var fs=require('fs');var path=require(_0xc146('0x6'));var rimraf=require(_0xc146('0x7'));var config=require(_0xc146('0x8'));var attributes=require(_0xc146('0x9'));module['exports']=function(_0x112ca1,_0x23eb0){return _0x112ca1[_0xc146('0xa')](_0xc146('0xb'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xc146('0xc'),'fields':['messageId']},{'name':'fti_whatsapp_messages','fields':[_0xc146('0xd')],'type':_0xc146('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3208f9,_0x5668e8,_0x550d07){var _0x3ee14a=_0x112ca1[_0xc146('0xf')];var _0x6618e6=_0x3208f9[_0xc146('0x10')]({'plain':!![]});if(_0x6618e6['direction']['toLowerCase']()==='in'||_0x6618e6[_0xc146('0x11')][_0xc146('0x12')]()===_0xc146('0x13')&&!_0x6618e6[_0xc146('0x14')]&&!_['isNil'](_0x6618e6[_0xc146('0x15')])){_0x3ee14a[_0xc146('0x16')]['findOne']({'where':{'id':_0x6618e6[_0xc146('0x17')]}})[_0xc146('0x18')](function(_0x2a1e23){if(_0x2a1e23){_0x2a1e23[_0xc146('0x19')]({'lastMsgAt':_0x6618e6[_0xc146('0x1a')],'lastMsgDirection':_0x6618e6[_0xc146('0x11')][_0xc146('0x12')]()});}})[_0xc146('0x1b')](function(_0x52c58b){console[_0xc146('0x1c')](_0x52c58b);});}if(_0x6618e6[_0xc146('0x11')]===_0xc146('0x13')&&!_0x6618e6[_0xc146('0x14')]){var _0x526667;_0x3ee14a[_0xc146('0x1d')][_0xc146('0x1e')]({'where':{'id':_0x6618e6[_0xc146('0x1f')]},'raw':!![]})['then'](function(_0x268a61){_0x526667=_0x268a61;if(_0x526667&&_0x526667[_0xc146('0x20')]){switch(_0x526667[_0xc146('0x20')]){case _0xc146('0x21'):var _0x2ae2a8=require(_0xc146('0x21'));if(_0x526667[_0xc146('0x22')]&&_0x526667[_0xc146('0x23')]&&_0x526667['phone']){var _0x41c452=new _0x2ae2a8(_0x526667[_0xc146('0x22')],_0x526667[_0xc146('0x23')]);_0x41c452['messages'][_0xc146('0x24')]({'body':_0x6618e6['body'],'to':_0xc146('0x25')+_0x6618e6[_0xc146('0x26')],'from':_0xc146('0x25')+_0x526667[_0xc146('0x26')],'statusCallback':_0x526667[_0xc146('0x27')]+'/api/whatsapp/messages/'+_0x6618e6['id']+_0xc146('0x28')+_0x526667[_0xc146('0x29')]})[_0xc146('0x18')](function(_0x23e827){if(_0x23e827[_0xc146('0x2a')]){return _0x3208f9[_0xc146('0x19')]({'messageId':_0x23e827['sid']});}})[_0xc146('0x1b')](function(_0x4ff7d8){logger[_0xc146('0x1c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xc146('0x2b'),_0xc146('0x21'),util[_0xc146('0x2c')](_0x4ff7d8,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xc146('0x2b'),_0xc146('0x21'),_0xc146('0x2d'));}break;}}})['finally'](function(){_0x550d07();});}else{_0x550d07();}}},'charset':_0xc146('0x2e'),'collate':_0xc146('0x2f')});};
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js
index 2f92359..66fac0d 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 _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
+var _0xe9e6=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','CreateWhatsappMessage','create','body','options','raw','debug','stringify','lodash'];(function(_0xbeb8a,_0x291392){var _0x573257=function(_0x4f0138){while(--_0x4f0138){_0xbeb8a['push'](_0xbeb8a['shift']());}};_0x573257(++_0x291392);}(_0xe9e6,0x9a));var _0x6e9e=function(_0xefb4e,_0xe56689){_0xefb4e=_0xefb4e-0x0;var _0x36c78c=_0xe9e6[_0xefb4e];return _0x36c78c;};'use strict';var _=require(_0x6e9e('0x0'));var util=require(_0x6e9e('0x1'));var moment=require(_0x6e9e('0x2'));var BPromise=require(_0x6e9e('0x3'));var rs=require(_0x6e9e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6e9e('0x5'));var logger=require(_0x6e9e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6e9e('0x7'));var client=jayson[_0x6e9e('0x8')][_0x6e9e('0x9')]({'port':0x232a});config[_0x6e9e('0xa')]=_[_0x6e9e('0xb')](config[_0x6e9e('0xa')],{'host':_0x6e9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6e9e('0xa')]));require(_0x6e9e('0xd'))[_0x6e9e('0xe')](socket);function respondWithRpcPromise(_0x211c19,_0x2687eb,_0xbfd760){return new BPromise(function(_0x15c327,_0x51df6e){return client[_0x6e9e('0xf')](_0x211c19,_0xbfd760)[_0x6e9e('0x10')](function(_0x3d24a9){logger[_0x6e9e('0x11')](_0x6e9e('0x12'),_0x2687eb,'request\x20sent');logger['debug'](_0x6e9e('0x13'),_0x2687eb,_0x6e9e('0x14'),JSON['stringify'](_0x3d24a9));if(_0x3d24a9[_0x6e9e('0x15')]){if(_0x3d24a9[_0x6e9e('0x15')]['code']===0x1f4){logger[_0x6e9e('0x15')](_0x6e9e('0x12'),_0x2687eb,_0x3d24a9[_0x6e9e('0x15')][_0x6e9e('0x16')]);return _0x51df6e(_0x3d24a9[_0x6e9e('0x15')][_0x6e9e('0x16')]);}logger[_0x6e9e('0x15')](_0x6e9e('0x12'),_0x2687eb,_0x3d24a9[_0x6e9e('0x15')]['message']);return _0x15c327(_0x3d24a9[_0x6e9e('0x15')]['message']);}else{logger['info'](_0x6e9e('0x12'),_0x2687eb,'request\x20sent');_0x15c327(_0x3d24a9['result'][_0x6e9e('0x16')]);}})[_0x6e9e('0x17')](function(_0x2b0be6){logger[_0x6e9e('0x15')](_0x6e9e('0x12'),_0x2687eb,_0x2b0be6);_0x51df6e(_0x2b0be6);});});}exports[_0x6e9e('0x18')]=function(_0x22371c){var _0x2ab8f0=this;return new Promise(function(_0x342b61,_0x2e9e35){return db['WhatsappMessage'][_0x6e9e('0x19')](_0x22371c[_0x6e9e('0x1a')],{'raw':_0x22371c[_0x6e9e('0x1b')]?_0x22371c['options'][_0x6e9e('0x1c')]===undefined?!![]:![]:!![]})[_0x6e9e('0x10')](function(_0x287861){logger['info'](_0x6e9e('0x18'),_0x22371c);logger[_0x6e9e('0x1d')](_0x6e9e('0x18'),_0x22371c,JSON[_0x6e9e('0x1e')](_0x287861));_0x342b61(_0x287861);})['catch'](function(_0x5a84db){logger['error'](_0x6e9e('0x18'),_0x5a84db[_0x6e9e('0x16')],_0x22371c);_0x2e9e35(_0x2ab8f0['error'](0x1f4,_0x5a84db[_0x6e9e('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js
index 7002e83..448ac42 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 _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
+var _0x476f=['update','emit','register','length','whatsappMessage:','./whatsappMessage.events'];(function(_0x314e6e,_0x457122){var _0x4571b1=function(_0x3eed04){while(--_0x3eed04){_0x314e6e['push'](_0x314e6e['shift']());}};_0x4571b1(++_0x457122);}(_0x476f,0xf5));var _0xf476=function(_0xca9a19,_0x1d23c5){_0xca9a19=_0xca9a19-0x0;var _0x38f747=_0x476f[_0xca9a19];return _0x38f747;};'use strict';var WhatsappMessageEvents=require(_0xf476('0x0'));var events=['save','remove',_0xf476('0x1')];function createListener(_0x43e47f,_0x257d81){return function(_0x1bf2aa){_0x257d81[_0xf476('0x2')](_0x43e47f,_0x1bf2aa);};}function removeListener(_0x5855c3,_0x3bca05){return function(){WhatsappMessageEvents['removeListener'](_0x5855c3,_0x3bca05);};}exports[_0xf476('0x3')]=function(_0x32ac66){for(var _0x24bb3c=0x0,_0x4ea59c=events[_0xf476('0x4')];_0x24bb3c<_0x4ea59c;_0x24bb3c++){var _0x417a40=events[_0x24bb3c];var _0x593552=createListener(_0xf476('0x5')+_0x417a40,_0x32ac66);WhatsappMessageEvents['on'](_0x417a40,_0x593552);}};
\ No newline at end of file
diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js
index ae277ed..2ec07ad 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 _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
+var _0x976a=['index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','delete','destroy','exports','multer','path','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated'];(function(_0x57939d,_0x46ddbe){var _0xba66a1=function(_0x381754){while(--_0x381754){_0x57939d['push'](_0x57939d['shift']());}};_0xba66a1(++_0x46ddbe);}(_0x976a,0x1f1));var _0xa976=function(_0x49279c,_0x56da65){_0x49279c=_0x49279c-0x0;var _0x472c04=_0x976a[_0x49279c];return _0x472c04;};'use strict';var multer=require(_0xa976('0x0'));var util=require('util');var path=require(_0xa976('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xa976('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xa976('0x3'));var controller=require(_0xa976('0x4'));router[_0xa976('0x5')]('/',auth[_0xa976('0x6')](),controller[_0xa976('0x7')]);router['get'](_0xa976('0x8'),auth[_0xa976('0x6')](),controller[_0xa976('0x9')]);router[_0xa976('0x5')](_0xa976('0xa'),auth['isAuthenticated'](),controller[_0xa976('0xb')]);router[_0xa976('0x5')](_0xa976('0xc'),auth['isAuthenticated'](),controller[_0xa976('0xd')]);router['get'](_0xa976('0xe'),auth[_0xa976('0x6')](),controller[_0xa976('0xf')]);router[_0xa976('0x5')](_0xa976('0x10'),auth[_0xa976('0x6')](),controller[_0xa976('0x11')]);router[_0xa976('0x12')]('/',auth[_0xa976('0x6')](),controller[_0xa976('0x13')]);router['post'](_0xa976('0xe'),auth[_0xa976('0x6')](),controller[_0xa976('0x14')]);router['post'](_0xa976('0x10'),auth[_0xa976('0x6')](),controller['addAgents']);router['put'](_0xa976('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xa976('0x15')](_0xa976('0xa'),auth[_0xa976('0x6')](),controller[_0xa976('0x16')]);router['delete'](_0xa976('0xe'),auth[_0xa976('0x6')](),controller['removeTeams']);router[_0xa976('0x15')](_0xa976('0x10'),auth[_0xa976('0x6')](),controller['removeAgents']);module[_0xa976('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js
index 12ae006..8006b7d 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 _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
+var _0x5007=['sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x4072e9,_0x4a0528){var _0x48a322=function(_0x1aa217){while(--_0x1aa217){_0x4072e9['push'](_0x4072e9['shift']());}};_0x48a322(++_0x4a0528);}(_0x5007,0x1d0));var _0x7500=function(_0xe4a57e,_0x204fce){_0xe4a57e=_0xe4a57e-0x0;var _0x47ba3e=_0x5007[_0xe4a57e];return _0x47ba3e;};'use strict';var Sequelize=require(_0x7500('0x0'));module['exports']={'name':{'type':Sequelize[_0x7500('0x1')],'unique':_0x7500('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x7500('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7500('0x4')](_0x7500('0x5'),_0x7500('0x6'),_0x7500('0x7'))},'description':{'type':Sequelize[_0x7500('0x1')]}};
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js
index a2e7f11..a7855f8 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 _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
+var _0x2242=['agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','get','error','stack','name','send','index','map','WhatsappQueue','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','WhatsappQueues','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getMembers','WhatsappQueueId','UserWhatsappQueue','User','findAndCountAll','UserId'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x2242,0x1d6));var _0x2224=function(_0x2499ee,_0x1e62fc){_0x2499ee=_0x2499ee-0x0;var _0x9b487b=_0x2242[_0x2499ee];return _0x9b487b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2224('0x0'));var jsonpatch=require(_0x2224('0x1'));var rp=require(_0x2224('0x2'));var moment=require(_0x2224('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2224('0x4'));var util=require('util');var path=require(_0x2224('0x5'));var sox=require(_0x2224('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2224('0x7'));var squel=require(_0x2224('0x8'));var crypto=require(_0x2224('0x9'));var jsforce=require(_0x2224('0xa'));var deskjs=require(_0x2224('0xb'));var toCsv=require(_0x2224('0xc'));var querystring=require(_0x2224('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2224('0xe'));var qs=require(_0x2224('0xf'));var as=require(_0x2224('0x10'));var hardwareService=require(_0x2224('0x11'));var logger=require(_0x2224('0x12'))(_0x2224('0x13'));var utils=require(_0x2224('0x14'));var config=require(_0x2224('0x15'));var db=require(_0x2224('0x16'))['db'];config[_0x2224('0x17')]=_[_0x2224('0x18')](config[_0x2224('0x17')],{'host':_0x2224('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2224('0x17')]));require(_0x2224('0x1a'))[_0x2224('0x1b')](socket);function respondWithStatusCode(_0x65d001,_0x524999){_0x524999=_0x524999||0xcc;return function(_0x45cf91){if(_0x45cf91){return _0x65d001[_0x2224('0x1c')](_0x524999);}return _0x65d001[_0x2224('0x1d')](_0x524999)[_0x2224('0x1e')]();};}function respondWithResult(_0x5b8c6e,_0x57314c){_0x57314c=_0x57314c||0xc8;return function(_0x1d4c17){if(_0x1d4c17){return _0x5b8c6e[_0x2224('0x1d')](_0x57314c)[_0x2224('0x1f')](_0x1d4c17);}};}function respondWithFilteredResult(_0x30ca32,_0x5e72d1){return function(_0x587625){if(_0x587625){var _0x25ea60=_0x587625[_0x2224('0x20')],_0x3497c7=_0x5e72d1['offset'],_0x38acce=_0x5e72d1[_0x2224('0x21')]+_0x5e72d1[_0x2224('0x22')],_0x216f06;if(_0x38acce>=_0x25ea60){_0x38acce=_0x25ea60;_0x216f06=0xc8;}else{_0x216f06=0xce;}_0x30ca32[_0x2224('0x1d')](_0x216f06);return _0x30ca32[_0x2224('0x23')](_0x2224('0x24'),_0x3497c7+'-'+_0x38acce+'/'+_0x25ea60)[_0x2224('0x1f')](_0x587625);}return null;};}function patchUpdates(_0x99dd80){return function(_0x46fffc){try{jsonpatch['apply'](_0x46fffc,_0x99dd80,!![]);}catch(_0x432d8b){return BPromise[_0x2224('0x25')](_0x432d8b);}return _0x46fffc[_0x2224('0x26')]();};}function saveUpdates(_0x1d3c77,_0x3148a4){return function(_0xb67fc7){if(_0xb67fc7){return _0xb67fc7[_0x2224('0x27')](_0x1d3c77)[_0x2224('0x28')](function(_0x2539f7){return _0x2539f7;});}return null;};}function removeEntity(_0x2b9b7f,_0x359c5a){return function(_0x50f007){if(_0x50f007){return _0x50f007['destroy']()[_0x2224('0x28')](function(){var _0x5019b6=_0x50f007[_0x2224('0x29')]({'plain':!![]});var _0x2e2375='WhatsappQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x2e2375,'resourceId':_0x5019b6['id']}})[_0x2224('0x28')](function(){return _0x50f007;});})[_0x2224('0x28')](function(){_0x2b9b7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bab89,_0x50b846){return function(_0x338652){if(!_0x338652){_0x3bab89['sendStatus'](0x194);}return _0x338652;};}function handleError(_0x30c9fc,_0x511419){_0x511419=_0x511419||0x1f4;return function(_0x5432a6){logger[_0x2224('0x2a')](_0x5432a6[_0x2224('0x2b')]);if(_0x5432a6[_0x2224('0x2c')]){delete _0x5432a6[_0x2224('0x2c')];}_0x30c9fc[_0x2224('0x1d')](_0x511419)[_0x2224('0x2d')](_0x5432a6);};}exports[_0x2224('0x2e')]=function(_0x3ca3d8,_0x566cdf){var _0x3f4306={},_0x5d3904={},_0x170a3b={'count':0x0,'rows':[]};var _0x583a66=_[_0x2224('0x2f')](db[_0x2224('0x30')]['rawAttributes'],function(_0xe65f42){return{'name':_0xe65f42[_0x2224('0x31')],'type':_0xe65f42[_0x2224('0x32')][_0x2224('0x33')]};});_0x5d3904[_0x2224('0x34')]=_[_0x2224('0x2f')](_0x583a66,_0x2224('0x2c'));_0x5d3904[_0x2224('0x35')]=_[_0x2224('0x36')](_0x3ca3d8[_0x2224('0x35')]);_0x5d3904['filters']=_[_0x2224('0x37')](_0x5d3904['model'],_0x5d3904[_0x2224('0x35')]);_0x3f4306[_0x2224('0x38')]=_['intersection'](_0x5d3904[_0x2224('0x34')],qs['fields'](_0x3ca3d8['query'][_0x2224('0x39')]));_0x3f4306[_0x2224('0x38')]=_0x3f4306['attributes'][_0x2224('0x3a')]?_0x3f4306[_0x2224('0x38')]:_0x5d3904[_0x2224('0x34')];if(!_0x3ca3d8[_0x2224('0x35')][_0x2224('0x3b')](_0x2224('0x3c'))){_0x3f4306[_0x2224('0x22')]=qs[_0x2224('0x22')](_0x3ca3d8[_0x2224('0x35')]['limit']);_0x3f4306[_0x2224('0x21')]=qs[_0x2224('0x21')](_0x3ca3d8[_0x2224('0x35')][_0x2224('0x21')]);}_0x3f4306[_0x2224('0x3d')]=qs['sort'](_0x3ca3d8[_0x2224('0x35')][_0x2224('0x3e')]);_0x3f4306[_0x2224('0x3f')]=qs[_0x2224('0x40')](_['pick'](_0x3ca3d8[_0x2224('0x35')],_0x5d3904[_0x2224('0x40')]),_0x583a66);if(_0x3ca3d8[_0x2224('0x35')][_0x2224('0x41')]){_0x3f4306['where']=_[_0x2224('0x42')](_0x3f4306[_0x2224('0x3f')],{'$or':_[_0x2224('0x2f')](_0x583a66,function(_0x493f99){if(_0x493f99[_0x2224('0x32')]!==_0x2224('0x43')){var _0xc9242a={};_0xc9242a[_0x493f99['name']]={'$like':'%'+_0x3ca3d8[_0x2224('0x35')][_0x2224('0x41')]+'%'};return _0xc9242a;}})});}_0x3f4306=_[_0x2224('0x42')]({},_0x3f4306,_0x3ca3d8[_0x2224('0x44')]);var _0x2a8cda={'where':_0x3f4306['where']};return db['WhatsappQueue'][_0x2224('0x20')](_0x2a8cda)[_0x2224('0x28')](function(_0x5af508){_0x170a3b[_0x2224('0x20')]=_0x5af508;if(_0x3ca3d8['query']['includeAll']){_0x3f4306[_0x2224('0x45')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x2224('0x46')](_0x3f4306);})[_0x2224('0x28')](function(_0x25102f){_0x170a3b[_0x2224('0x47')]=_0x25102f;return _0x170a3b;})[_0x2224('0x28')](respondWithFilteredResult(_0x566cdf,_0x3f4306))['catch'](handleError(_0x566cdf,null));};exports[_0x2224('0x48')]=function(_0x10194d,_0x1f93c1){var _0x5064bf={'raw':!![],'where':{'id':_0x10194d[_0x2224('0x49')]['id']}},_0x412046={};_0x412046[_0x2224('0x34')]=_[_0x2224('0x36')](db[_0x2224('0x30')][_0x2224('0x4a')]);_0x412046[_0x2224('0x35')]=_[_0x2224('0x36')](_0x10194d[_0x2224('0x35')]);_0x412046[_0x2224('0x40')]=_[_0x2224('0x37')](_0x412046['model'],_0x412046['query']);_0x5064bf[_0x2224('0x38')]=_[_0x2224('0x37')](_0x412046[_0x2224('0x34')],qs[_0x2224('0x39')](_0x10194d[_0x2224('0x35')][_0x2224('0x39')]));_0x5064bf['attributes']=_0x5064bf[_0x2224('0x38')][_0x2224('0x3a')]?_0x5064bf[_0x2224('0x38')]:_0x412046[_0x2224('0x34')];if(_0x10194d['query'][_0x2224('0x4b')]){_0x5064bf[_0x2224('0x45')]=[{'all':!![]}];}_0x5064bf=_[_0x2224('0x42')]({},_0x5064bf,_0x10194d[_0x2224('0x44')]);return db['WhatsappQueue'][_0x2224('0x4c')](_0x5064bf)['then'](handleEntityNotFound(_0x1f93c1,null))[_0x2224('0x28')](respondWithResult(_0x1f93c1,null))[_0x2224('0x4d')](handleError(_0x1f93c1,null));};exports[_0x2224('0x4e')]=function(_0x2f3366,_0x29c764){return db[_0x2224('0x30')][_0x2224('0x4e')](_0x2f3366[_0x2224('0x4f')],{})[_0x2224('0x28')](function(_0x46e1d5){var _0x187bf8=_0x2f3366[_0x2224('0x50')][_0x2224('0x29')]({'plain':!![]});if(!_0x187bf8)throw new Error(_0x2224('0x51'));if(_0x187bf8['role']===_0x2224('0x50')){var _0x1c68c0=_0x46e1d5[_0x2224('0x29')]({'plain':!![]});var _0x30b47a=_0x2224('0x52');return db[_0x2224('0x53')][_0x2224('0x4c')]({'where':{'name':_0x30b47a,'userProfileId':_0x187bf8[_0x2224('0x54')]},'raw':!![]})[_0x2224('0x28')](function(_0x58854f){if(_0x58854f&&_0x58854f['autoAssociation']===0x0){return db[_0x2224('0x55')][_0x2224('0x4e')]({'name':_0x1c68c0[_0x2224('0x2c')],'resourceId':_0x1c68c0['id'],'type':_0x58854f[_0x2224('0x2c')],'sectionId':_0x58854f['id']},{})[_0x2224('0x28')](function(){return _0x46e1d5;});}else{return _0x46e1d5;}})[_0x2224('0x4d')](function(_0x3e2da8){logger[_0x2224('0x2a')](_0x2224('0x56'),_0x3e2da8);throw _0x3e2da8;});}return _0x46e1d5;})[_0x2224('0x28')](respondWithResult(_0x29c764,0xc9))[_0x2224('0x4d')](handleError(_0x29c764,null));};exports[_0x2224('0x27')]=function(_0x16b7dd,_0x2827de){if(_0x16b7dd[_0x2224('0x4f')]['id']){delete _0x16b7dd[_0x2224('0x4f')]['id'];}return db[_0x2224('0x30')][_0x2224('0x4c')]({'where':{'id':_0x16b7dd[_0x2224('0x49')]['id']}})['then'](handleEntityNotFound(_0x2827de,null))[_0x2224('0x28')](saveUpdates(_0x16b7dd[_0x2224('0x4f')],null))[_0x2224('0x28')](respondWithResult(_0x2827de,null))[_0x2224('0x4d')](handleError(_0x2827de,null));};exports[_0x2224('0x57')]=function(_0x4425ba,_0x803e77){return db[_0x2224('0x30')][_0x2224('0x4c')]({'where':{'id':_0x4425ba['params']['id']}})[_0x2224('0x28')](handleEntityNotFound(_0x803e77,null))[_0x2224('0x28')](removeEntity(_0x803e77,null))[_0x2224('0x4d')](handleError(_0x803e77,null));};exports['describe']=function(_0x17b062,_0x329f4b){return db[_0x2224('0x30')]['describe']()['then'](respondWithResult(_0x329f4b,null))[_0x2224('0x4d')](handleError(_0x329f4b,null));};exports[_0x2224('0x58')]=function(_0x160392,_0x35c754,_0x47895b){var _0x9a072b={'raw':!![],'where':{}},_0x256f87={},_0x189426;return db['WhatsappQueue']['findOne']({'where':{'id':_0x160392['params']['id']}})['then'](handleEntityNotFound(_0x35c754,null))[_0x2224('0x28')](function(_0x4ce84a){if(_0x4ce84a){_0x189426=_0x4ce84a[_0x2224('0x29')]({'plain':!![]});_0x256f87[_0x2224('0x34')]=_[_0x2224('0x36')](db['UserWhatsappQueue'][_0x2224('0x4a')]);_0x256f87[_0x2224('0x35')]=_[_0x2224('0x36')](_0x160392[_0x2224('0x35')]);_0x256f87[_0x2224('0x40')]=_['intersection'](_0x256f87['model'],_0x256f87[_0x2224('0x35')]);_0x9a072b[_0x2224('0x38')]=_[_0x2224('0x37')](_0x256f87[_0x2224('0x34')],qs[_0x2224('0x39')](_0x160392['query'][_0x2224('0x39')]));_0x9a072b[_0x2224('0x38')]=_0x9a072b[_0x2224('0x38')]['length']?_0x9a072b[_0x2224('0x38')]:_0x256f87[_0x2224('0x34')];if(!_0x160392[_0x2224('0x35')][_0x2224('0x3b')]('nolimit')){_0x9a072b['limit']=qs[_0x2224('0x22')](_0x160392[_0x2224('0x35')]['limit']);_0x9a072b[_0x2224('0x21')]=qs[_0x2224('0x21')](_0x160392['query'][_0x2224('0x21')]);}_0x9a072b[_0x2224('0x3d')]=qs[_0x2224('0x3e')](_0x160392['query'][_0x2224('0x3e')]);_0x9a072b[_0x2224('0x3f')]=qs[_0x2224('0x40')](_['pick'](_0x160392['query'],_0x256f87[_0x2224('0x40')]));_0x9a072b[_0x2224('0x3f')][_0x2224('0x59')]=_0x4ce84a['id'];if(_0x160392['query']['filter']){_0x9a072b[_0x2224('0x3f')]=_[_0x2224('0x42')](_0x9a072b['where'],{'$or':_[_0x2224('0x2f')](_0x9a072b[_0x2224('0x38')],function(_0x257c27){var _0x2c602a={};_0x2c602a[_0x257c27]={'$like':'%'+_0x160392[_0x2224('0x35')][_0x2224('0x41')]+'%'};return _0x2c602a;})});}_0x9a072b=_[_0x2224('0x42')]({},_0x9a072b,_0x160392[_0x2224('0x44')]);return db[_0x2224('0x5a')][_0x2224('0x46')](_0x9a072b);}})[_0x2224('0x28')](function(_0xe4fe73){if(_0xe4fe73){return db[_0x2224('0x5b')][_0x2224('0x5c')]({'where':{'id':_[_0x2224('0x2f')](_0xe4fe73,_0x2224('0x5d')),'role':_0x2224('0x5e')},'attributes':['id','name',_0x2224('0x5f'),_0x2224('0x60'),_0x2224('0x61')]});}})['then'](function(_0x31e147){if(_0x31e147){return{'count':_0x31e147[_0x2224('0x20')],'rows':_[_0x2224('0x2f')](_0x31e147['rows'],function(_0x5231f4){return{'membername':_0x5231f4[_0x2224('0x2c')],'UserId':_0x5231f4['id'],'queue_name':_0x189426['name'],'WhatsappQueueId':_0x189426['id'],'interface':util[_0x2224('0x62')](_0x2224('0x63'),_0x2224('0x64'),_0x5231f4[_0x2224('0x2c')]),'penalty':0x0,'paused':_0x5231f4['whatsappPause'],'createdAt':_0x5231f4[_0x2224('0x61')],'updatedAt':_0x5231f4[_0x2224('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2224('0x28')](respondWithFilteredResult(_0x35c754,_0x9a072b))[_0x2224('0x4d')](handleError(_0x35c754,null));};exports['getTeams']=function(_0x51809b,_0x5a2543,_0x5e1cb7){var _0x536b78={};var _0x21415d={};var _0x5cec34;var _0x5de9bb;return db[_0x2224('0x30')]['findOne']({'where':{'id':_0x51809b[_0x2224('0x49')]['id']}})[_0x2224('0x28')](handleEntityNotFound(_0x5a2543,null))[_0x2224('0x28')](function(_0x5b60a0){if(_0x5b60a0){_0x5cec34=_0x5b60a0;_0x21415d['model']=_[_0x2224('0x36')](db[_0x2224('0x65')][_0x2224('0x4a')]);_0x21415d[_0x2224('0x35')]=_[_0x2224('0x36')](_0x51809b[_0x2224('0x35')]);_0x21415d['filters']=_['intersection'](_0x21415d[_0x2224('0x34')],_0x21415d[_0x2224('0x35')]);_0x536b78[_0x2224('0x38')]=_['intersection'](_0x21415d['model'],qs[_0x2224('0x39')](_0x51809b[_0x2224('0x35')][_0x2224('0x39')]));_0x536b78[_0x2224('0x38')]=_0x536b78['attributes']['length']?_0x536b78[_0x2224('0x38')]:_0x21415d[_0x2224('0x34')];_0x536b78[_0x2224('0x3d')]=qs[_0x2224('0x3e')](_0x51809b[_0x2224('0x35')][_0x2224('0x3e')]);_0x536b78[_0x2224('0x3f')]=qs[_0x2224('0x40')](_['pick'](_0x51809b['query'],_0x21415d[_0x2224('0x40')]));if(_0x51809b[_0x2224('0x35')][_0x2224('0x41')]){_0x536b78[_0x2224('0x3f')]=_[_0x2224('0x42')](_0x536b78[_0x2224('0x3f')],{'$or':_[_0x2224('0x2f')](_0x536b78[_0x2224('0x38')],function(_0x1c5b42){var _0x5ad440={};_0x5ad440[_0x1c5b42]={'$like':'%'+_0x51809b['query'][_0x2224('0x41')]+'%'};return _0x5ad440;})});}_0x536b78=_[_0x2224('0x42')]({},_0x536b78,_0x51809b[_0x2224('0x44')]);return _0x5cec34[_0x2224('0x66')](_0x536b78);}})[_0x2224('0x28')](function(_0x2e7e9d){if(_0x2e7e9d){_0x5de9bb=_0x2e7e9d[_0x2224('0x3a')];if(!_0x51809b['query'][_0x2224('0x3b')](_0x2224('0x3c'))){_0x536b78[_0x2224('0x22')]=qs['limit'](_0x51809b['query'][_0x2224('0x22')]);_0x536b78['offset']=qs[_0x2224('0x21')](_0x51809b[_0x2224('0x35')]['offset']);}return _0x5cec34[_0x2224('0x66')](_0x536b78);}})[_0x2224('0x28')](function(_0x5f337f){if(_0x5f337f){return _0x5f337f?{'count':_0x5de9bb,'rows':_0x5f337f}:null;}})[_0x2224('0x28')](respondWithResult(_0x5a2543,null))[_0x2224('0x4d')](handleError(_0x5a2543,null));};exports[_0x2224('0x67')]=function(_0x3cafdc,_0x2e0d6e,_0x35be23){var _0x14d734=_0x3cafdc[_0x2224('0x4f')][_0x2224('0x68')];return db['Team']['findAll']({'where':{'id':_0x14d734},'attributes':['id'],'include':[{'model':db[_0x2224('0x5b')],'as':_0x2224('0x69'),'attributes':['id','name',_0x2224('0x6a'),_0x2224('0x6b'),_0x2224('0x6c')],'raw':!![]}]})[_0x2224('0x28')](function(_0x3f8253){if(_0x3f8253){var _0x418841=_[_0x2224('0x6d')](_0x3f8253,function(_0x1675a2){var _0x4886de=_0x1675a2[_0x2224('0x29')]({'plain':!![]});return _0x4886de[_0x2224('0x69')];});return db['WhatsappQueue'][_0x2224('0x4c')]({'where':{'id':_0x3cafdc['params']['id']}})[_0x2224('0x28')](function(_0x2ec2b3){return db['sequelize'][_0x2224('0x6e')](function(_0x561671){return _0x2ec2b3[_0x2224('0x67')](_0x14d734,{'transaction':_0x561671})[_0x2224('0x28')](function(){return BPromise[_0x2224('0x6f')](_0x418841,function(_0x32d74d){return db['UserWhatsappQueue'][_0x2224('0x70')]({'where':{'UserId':_0x32d74d['id'],'WhatsappQueueId':_0x3cafdc['params']['id']},'transaction':_0x561671});});})[_0x2224('0x28')](function(){_0x418841['forEach'](function(_0x192192){socket[_0x2224('0x71')](_0x2224('0x72'),{'UserId':_0x192192['id'],'WhatsappQueueId':_0x2ec2b3['id']});});});});});}})[_0x2224('0x28')](respondWithStatusCode(_0x2e0d6e,null))[_0x2224('0x4d')](handleError(_0x2e0d6e,null));};exports[_0x2224('0x73')]=function(_0x36591f,_0x9220d6,_0x196769){return db[_0x2224('0x65')][_0x2224('0x46')]({'where':{'id':_0x36591f[_0x2224('0x35')][_0x2224('0x68')]},'attributes':['id'],'include':[{'model':db[_0x2224('0x5b')],'as':_0x2224('0x69'),'attributes':['id'],'raw':!![]}]})[_0x2224('0x28')](handleEntityNotFound(_0x9220d6,null))[_0x2224('0x28')](function(_0x94af93){var _0x37ad57=_['map'](_0x94af93,'id');var _0x53462a=[];var _0x3fa3be=[];var _0x2d0ff5=squel['select']();_0x2d0ff5[_0x2224('0x74')](_0x2224('0x75'))['from']('team_has_whatsapp_queues','tq')[_0x2224('0x76')](_0x2224('0x77'),'ut',_0x2224('0x78'))[_0x2224('0x3f')](_0x2224('0x79'),_0x36591f[_0x2224('0x49')]['id']);for(var _0x2ceb94=0x0;_0x2ceb94<_0x94af93[_0x2224('0x3a')];_0x2ceb94+=0x1){let _0x17f9ce=_0x94af93[_0x2ceb94];for(var _0xa6c469=0x0;_0xa6c469<_0x17f9ce[_0x2224('0x69')][_0x2224('0x3a')];_0xa6c469+=0x1){let _0x387754=_0x17f9ce[_0x2224('0x69')][_0xa6c469];var _0x3c4a7e=_0x2d0ff5[_0x2224('0x7a')]();_0x3c4a7e['where']('ut.UserId\x20=\x20?',_0x387754['id']);_0x3fa3be[_0x2224('0x7b')](db['sequelize'][_0x2224('0x35')](_0x3c4a7e['toString'](),{'type':db[_0x2224('0x7c')][_0x2224('0x7d')][_0x2224('0x7e')]})[_0x2224('0x28')](function(_0x343493){if(_0x343493['length']===0x1){return _0x387754['id'];}else{var _0x44cddc=_[_0x2224('0x7f')](_[_0x2224('0x2f')](_0x343493,_0x2224('0x80')),function(_0x2d77b5){return _['includes'](_0x37ad57,_0x2d77b5);});if(_0x44cddc){return _0x387754['id'];}}}));}}return BPromise[_0x2224('0x81')](_0x3fa3be)[_0x2224('0x28')](function(_0x34c2ac){_0x53462a=_(_0x53462a)[_0x2224('0x82')](_0x34c2ac)[_0x2224('0x83')]()[_0x2224('0x84')]();return db[_0x2224('0x30')]['find']({'where':{'id':_0x36591f[_0x2224('0x49')]['id']}})['then'](function(_0x20620f){return db[_0x2224('0x7c')][_0x2224('0x6e')](function(_0x2111af){return _0x20620f[_0x2224('0x73')](_0x36591f[_0x2224('0x35')][_0x2224('0x68')],{'transaction':_0x2111af})['then'](function(){if(!_[_0x2224('0x85')](_0x53462a)){return _0x20620f[_0x2224('0x86')](_0x53462a,{'transaction':_0x2111af});}})['then'](function(){_0x53462a[_0x2224('0x87')](function(_0x372e3c){socket[_0x2224('0x71')](_0x2224('0x88'),{'UserId':_0x372e3c,'WhatsappQueueId':_0x20620f['id']});});});});});});})[_0x2224('0x28')](respondWithStatusCode(_0x9220d6,null))[_0x2224('0x4d')](handleError(_0x9220d6,null));};exports[_0x2224('0x89')]=function(_0x5c6663,_0x510bda,_0x3f1d27){return db[_0x2224('0x30')][_0x2224('0x4c')]({'where':{'id':_0x5c6663['params']['id']}})[_0x2224('0x28')](handleEntityNotFound(_0x510bda,null))[_0x2224('0x28')](function(_0x4db073){if(_0x4db073){return _0x4db073[_0x2224('0x89')](_0x5c6663[_0x2224('0x4f')][_0x2224('0x68')],_['omit'](_0x5c6663['body'],[_0x2224('0x68'),'id'])||{})[_0x2224('0x8a')](function(_0x341e2d){for(var _0x405822=0x0;_0x405822<_0x5c6663[_0x2224('0x4f')][_0x2224('0x68')]['length'];_0x405822+=0x1){socket['emit']('userWhatsappQueue:save',{'UserId':_0x5c6663[_0x2224('0x4f')]['ids'][_0x405822],'WhatsappQueueId':_0x5c6663[_0x2224('0x49')]['id']});}return _0x341e2d;});}})[_0x2224('0x28')](respondWithResult(_0x510bda,null))[_0x2224('0x4d')](handleError(_0x510bda,null));};exports[_0x2224('0x86')]=function(_0x1b568b,_0x3ce7c4,_0x40d12c){return db['WhatsappQueue'][_0x2224('0x4c')]({'where':{'id':_0x1b568b[_0x2224('0x49')]['id']}})[_0x2224('0x28')](handleEntityNotFound(_0x3ce7c4,null))['then'](function(_0x552d2e){if(_0x552d2e){return _0x552d2e['removeAgents'](_0x1b568b['query']['ids'])[_0x2224('0x28')](function(){if(_[_0x2224('0x8b')](_0x1b568b['query'][_0x2224('0x68')])){for(var _0x48f05c=0x0;_0x48f05c<_0x1b568b[_0x2224('0x35')][_0x2224('0x68')][_0x2224('0x3a')];_0x48f05c+=0x1){socket[_0x2224('0x71')](_0x2224('0x88'),{'UserId':Number(_0x1b568b['query'][_0x2224('0x68')][_0x48f05c]),'WhatsappQueueId':Number(_0x1b568b[_0x2224('0x49')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x1b568b[_0x2224('0x35')][_0x2224('0x68')]),'WhatsappQueueId':Number(_0x1b568b[_0x2224('0x49')]['id'])});}});}})[_0x2224('0x28')](respondWithStatusCode(_0x3ce7c4,null))['catch'](handleError(_0x3ce7c4,null));};exports[_0x2224('0x8c')]=function(_0x57d3df,_0xaa11ca,_0x752951){var _0x25d10b={};var _0x2d32b5={};var _0x1d36d7;var _0x4bcdcf;return db[_0x2224('0x30')]['findOne']({'where':{'id':_0x57d3df[_0x2224('0x49')]['id']}})[_0x2224('0x28')](handleEntityNotFound(_0xaa11ca,null))[_0x2224('0x28')](function(_0x50432d){if(_0x50432d){_0x1d36d7=_0x50432d;_0x2d32b5[_0x2224('0x34')]=_[_0x2224('0x36')](db[_0x2224('0x5b')][_0x2224('0x4a')]);_0x2d32b5[_0x2224('0x35')]=_[_0x2224('0x36')](_0x57d3df[_0x2224('0x35')]);_0x2d32b5[_0x2224('0x40')]=_['intersection'](_0x2d32b5['model'],_0x2d32b5[_0x2224('0x35')]);_0x25d10b[_0x2224('0x38')]=_['intersection'](_0x2d32b5[_0x2224('0x34')],qs[_0x2224('0x39')](_0x57d3df[_0x2224('0x35')]['fields']));_0x25d10b[_0x2224('0x38')]=_0x25d10b['attributes'][_0x2224('0x3a')]?_0x25d10b[_0x2224('0x38')]:_0x2d32b5['model'];_0x25d10b[_0x2224('0x3d')]=qs['sort'](_0x57d3df['query']['sort']);_0x25d10b[_0x2224('0x3f')]=qs[_0x2224('0x40')](_['pick'](_0x57d3df[_0x2224('0x35')],_0x2d32b5[_0x2224('0x40')]));if(_0x57d3df[_0x2224('0x35')][_0x2224('0x41')]){_0x25d10b[_0x2224('0x3f')]=_['merge'](_0x25d10b[_0x2224('0x3f')],{'$or':_['map'](_0x25d10b[_0x2224('0x38')],function(_0xf146e2){var _0x2c7430={};_0x2c7430[_0xf146e2]={'$like':'%'+_0x57d3df[_0x2224('0x35')][_0x2224('0x41')]+'%'};return _0x2c7430;})});}_0x25d10b=_[_0x2224('0x42')]({},_0x25d10b,_0x57d3df[_0x2224('0x44')]);return _0x1d36d7[_0x2224('0x8c')](_0x25d10b);}})[_0x2224('0x28')](function(_0x2d7d01){if(_0x2d7d01){_0x4bcdcf=_0x2d7d01[_0x2224('0x3a')];if(!_0x57d3df['query']['hasOwnProperty'](_0x2224('0x3c'))){_0x25d10b[_0x2224('0x22')]=qs[_0x2224('0x22')](_0x57d3df['query']['limit']);_0x25d10b['offset']=qs[_0x2224('0x21')](_0x57d3df['query'][_0x2224('0x21')]);}return _0x1d36d7['getAgents'](_0x25d10b);}})['then'](function(_0x4ca4b3){if(_0x4ca4b3){return _0x4ca4b3?{'count':_0x4bcdcf,'rows':_0x4ca4b3}:null;}})[_0x2224('0x28')](respondWithResult(_0xaa11ca,null))['catch'](handleError(_0xaa11ca,null));};
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js
index 29cacc9..98bd188 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 _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
+var _0x836b=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save'];(function(_0x104c7b,_0x789096){var _0x937283=function(_0x54e392){while(--_0x54e392){_0x104c7b['push'](_0x104c7b['shift']());}};_0x937283(++_0x789096);}(_0x836b,0xc1));var _0xb836=function(_0x29ec4c,_0x531369){_0x29ec4c=_0x29ec4c-0x0;var _0x53f08c=_0x836b[_0x29ec4c];return _0x53f08c;};'use strict';var EventEmitter=require(_0xb836('0x0'));var WhatsappQueue=require(_0xb836('0x1'))['db'][_0xb836('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xb836('0x3')](0x0);var events={'afterCreate':_0xb836('0x4'),'afterUpdate':_0xb836('0x5'),'afterDestroy':_0xb836('0x6')};function emitEvent(_0xd23ad8){return function(_0xa5acd7,_0x584a1b,_0x21d19){WhatsappQueueEvents[_0xb836('0x7')](_0xd23ad8+':'+_0xa5acd7['id'],_0xa5acd7);WhatsappQueueEvents[_0xb836('0x7')](_0xd23ad8,_0xa5acd7);_0x21d19(null);};}for(var e in events){if(events[_0xb836('0x8')](e)){var event=events[e];WhatsappQueue[_0xb836('0x9')](e,emitEvent(event));}}module[_0xb836('0xa')]=WhatsappQueueEvents;
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js
index 2549052..4cd3323 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 _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
+var _0x8658=['request-promise','path','rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0x53b6c5,_0x36a685){var _0x3d1b0a=function(_0x10052b){while(--_0x10052b){_0x53b6c5['push'](_0x53b6c5['shift']());}};_0x3d1b0a(++_0x36a685);}(_0x8658,0xe5));var _0x8865=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x8658[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x8865('0x0'));var util=require(_0x8865('0x1'));var logger=require(_0x8865('0x2'))(_0x8865('0x3'));var moment=require('moment');var BPromise=require(_0x8865('0x4'));var rp=require(_0x8865('0x5'));var fs=require('fs');var path=require(_0x8865('0x6'));var rimraf=require(_0x8865('0x7'));var config=require('../../config/environment');var attributes=require(_0x8865('0x8'));module[_0x8865('0x9')]=function(_0x1c198d,_0x42e993){return _0x1c198d[_0x8865('0xa')](_0x8865('0xb'),attributes,{'tableName':_0x8865('0xc'),'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 221396a..ecbf181 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 _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
+var _0x0d0a=['debug','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','raw','options','where','attributes','limit','include','model','map','ShowWhatsappQueue','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x324f7a,_0x5b3aac){var _0x3100b5=function(_0x3e49b5){while(--_0x3e49b5){_0x324f7a['push'](_0x324f7a['shift']());}};_0x3100b5(++_0x5b3aac);}(_0x0d0a,0x1ae));var _0xa0d0=function(_0x3a0d5d,_0x389560){_0x3a0d5d=_0x3a0d5d-0x0;var _0x2fff6c=_0x0d0a[_0x3a0d5d];return _0x2fff6c;};'use strict';var _=require(_0xa0d0('0x0'));var util=require('util');var moment=require(_0xa0d0('0x1'));var BPromise=require(_0xa0d0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa0d0('0x3'));var db=require(_0xa0d0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0d0('0x5'))(_0xa0d0('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0d0('0x7'));var client=jayson[_0xa0d0('0x8')][_0xa0d0('0x9')]({'port':0x232a});config[_0xa0d0('0xa')]=_[_0xa0d0('0xb')](config['redis'],{'host':_0xa0d0('0xc'),'port':0x18eb});var socket=require(_0xa0d0('0xd'))(new Redis(config[_0xa0d0('0xa')]));require(_0xa0d0('0xe'))[_0xa0d0('0xf')](socket);function respondWithRpcPromise(_0x326665,_0x5655d3,_0x4d6e64){return new BPromise(function(_0x41c321,_0x18f589){return client[_0xa0d0('0x10')](_0x326665,_0x4d6e64)[_0xa0d0('0x11')](function(_0x193a11){logger[_0xa0d0('0x12')](_0xa0d0('0x13'),_0x5655d3,_0xa0d0('0x14'));logger[_0xa0d0('0x15')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x5655d3,'request\x20sent',JSON[_0xa0d0('0x16')](_0x193a11));if(_0x193a11[_0xa0d0('0x17')]){if(_0x193a11[_0xa0d0('0x17')][_0xa0d0('0x18')]===0x1f4){logger[_0xa0d0('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x5655d3,_0x193a11[_0xa0d0('0x17')][_0xa0d0('0x19')]);return _0x18f589(_0x193a11[_0xa0d0('0x17')][_0xa0d0('0x19')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x5655d3,_0x193a11[_0xa0d0('0x17')][_0xa0d0('0x19')]);return _0x41c321(_0x193a11[_0xa0d0('0x17')][_0xa0d0('0x19')]);}else{logger['info'](_0xa0d0('0x13'),_0x5655d3,_0xa0d0('0x14'));_0x41c321(_0x193a11[_0xa0d0('0x1a')][_0xa0d0('0x19')]);}})[_0xa0d0('0x1b')](function(_0x37100b){logger['error'](_0xa0d0('0x13'),_0x5655d3,_0x37100b);_0x18f589(_0x37100b);});});}exports[_0xa0d0('0x1c')]=function(_0x1ef717){var _0x59a641=this;return new Promise(function(_0x9aec1d,_0x4bbbdb){return db[_0xa0d0('0x1d')][_0xa0d0('0x1e')]({'raw':_0x1ef717['options']?_0x1ef717['options'][_0xa0d0('0x1f')]===undefined?!![]:![]:!![],'where':_0x1ef717[_0xa0d0('0x20')]?_0x1ef717['options'][_0xa0d0('0x21')]||null:null,'attributes':_0x1ef717[_0xa0d0('0x20')]?_0x1ef717[_0xa0d0('0x20')][_0xa0d0('0x22')]||null:null,'limit':_0x1ef717[_0xa0d0('0x20')]?_0x1ef717[_0xa0d0('0x20')][_0xa0d0('0x23')]||null:null,'include':_0x1ef717[_0xa0d0('0x20')]?_0x1ef717[_0xa0d0('0x20')][_0xa0d0('0x24')]?_['map'](_0x1ef717['options'][_0xa0d0('0x24')],function(_0x1bb88d){return{'model':db[_0x1bb88d[_0xa0d0('0x25')]],'as':_0x1bb88d['as'],'attributes':_0x1bb88d[_0xa0d0('0x22')],'include':_0x1bb88d[_0xa0d0('0x24')]?_['map'](_0x1bb88d[_0xa0d0('0x24')],function(_0x490f42){return{'model':db[_0x490f42[_0xa0d0('0x25')]],'as':_0x490f42['as'],'attributes':_0x490f42[_0xa0d0('0x22')],'include':_0x490f42['include']?_[_0xa0d0('0x26')](_0x490f42[_0xa0d0('0x24')],function(_0x102fed){return{'model':db[_0x102fed[_0xa0d0('0x25')]],'as':_0x102fed['as'],'attributes':_0x102fed[_0xa0d0('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x309467){logger[_0xa0d0('0x12')](_0xa0d0('0x1c'),_0x1ef717);logger['debug'](_0xa0d0('0x1c'),_0x1ef717,JSON[_0xa0d0('0x16')](_0x309467));_0x9aec1d(_0x309467);})[_0xa0d0('0x1b')](function(_0x52f68d){logger['error'](_0xa0d0('0x1c'),_0x52f68d[_0xa0d0('0x19')],_0x1ef717);_0x4bbbdb(_0x59a641[_0xa0d0('0x17')](0x1f4,_0x52f68d[_0xa0d0('0x19')]));});});};exports[_0xa0d0('0x27')]=function(_0x23c91a){var _0x4071a5=this;return new Promise(function(_0x5e21ae,_0x2c2a19){return db[_0xa0d0('0x1d')][_0xa0d0('0x28')]({'raw':_0x23c91a[_0xa0d0('0x20')]?_0x23c91a[_0xa0d0('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x23c91a[_0xa0d0('0x20')]?_0x23c91a[_0xa0d0('0x20')]['where']||null:null,'attributes':_0x23c91a[_0xa0d0('0x20')]?_0x23c91a[_0xa0d0('0x20')]['attributes']||null:null,'include':_0x23c91a['options']?_0x23c91a[_0xa0d0('0x20')][_0xa0d0('0x24')]?_[_0xa0d0('0x26')](_0x23c91a[_0xa0d0('0x20')]['include'],function(_0x5203c0){return{'model':db[_0x5203c0[_0xa0d0('0x25')]],'as':_0x5203c0['as'],'attributes':_0x5203c0[_0xa0d0('0x22')],'include':_0x5203c0[_0xa0d0('0x24')]?_[_0xa0d0('0x26')](_0x5203c0[_0xa0d0('0x24')],function(_0x2f1e22){return{'model':db[_0x2f1e22[_0xa0d0('0x25')]],'as':_0x2f1e22['as'],'attributes':_0x2f1e22[_0xa0d0('0x22')],'include':_0x2f1e22[_0xa0d0('0x24')]?_[_0xa0d0('0x26')](_0x2f1e22[_0xa0d0('0x24')],function(_0x462dfa){return{'model':db[_0x462dfa[_0xa0d0('0x25')]],'as':_0x462dfa['as'],'attributes':_0x462dfa[_0xa0d0('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa0d0('0x11')](function(_0x43890a){logger[_0xa0d0('0x12')]('ShowWhatsappQueue',_0x23c91a);logger['debug'](_0xa0d0('0x27'),_0x23c91a,JSON[_0xa0d0('0x16')](_0x43890a));_0x5e21ae(_0x43890a);})[_0xa0d0('0x1b')](function(_0x3db50f){logger[_0xa0d0('0x17')](_0xa0d0('0x27'),_0x3db50f[_0xa0d0('0x19')],_0x23c91a);_0x2c2a19(_0x4071a5[_0xa0d0('0x17')](0x1f4,_0x3db50f[_0xa0d0('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js
index 502eeb4..770b5cd 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 _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
+var _0x03a6=['save','remove','update','emit','removeListener','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x26e8a6,_0x5eee2b){var _0xb23ba6=function(_0x45cea5){while(--_0x45cea5){_0x26e8a6['push'](_0x26e8a6['shift']());}};_0xb23ba6(++_0x5eee2b);}(_0x03a6,0x1af));var _0x603a=function(_0x5ece75,_0x286fad){_0x5ece75=_0x5ece75-0x0;var _0x430b6f=_0x03a6[_0x5ece75];return _0x430b6f;};'use strict';var WhatsappQueueEvents=require(_0x603a('0x0'));var events=[_0x603a('0x1'),_0x603a('0x2'),_0x603a('0x3')];function createListener(_0x335884,_0x3eb86d){return function(_0x5569e8){_0x3eb86d[_0x603a('0x4')](_0x335884,_0x5569e8);};}function removeListener(_0x4921da,_0x30bec5){return function(){WhatsappQueueEvents[_0x603a('0x5')](_0x4921da,_0x30bec5);};}exports['register']=function(_0x57f841){for(var _0x297d3d=0x0,_0x32674e=events[_0x603a('0x6')];_0x297d3d<_0x32674e;_0x297d3d++){var _0x19aacf=events[_0x297d3d];var _0x3fb550=createListener(_0x603a('0x7')+_0x19aacf,_0x57f841);WhatsappQueueEvents['on'](_0x19aacf,_0x3fb550);}};
\ No newline at end of file
diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js
index abaf840..8bfe471 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 _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
+var _0x8ac5=['get','/describe','describe','/:id','show','post','create','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index'];(function(_0x37a2af,_0xc3a752){var _0x484899=function(_0x66d054){while(--_0x66d054){_0x37a2af['push'](_0x37a2af['shift']());}};_0x484899(++_0xc3a752);}(_0x8ac5,0x105));var _0x58ac=function(_0x487cbd,_0x235f86){_0x487cbd=_0x487cbd-0x0;var _0x42f5d7=_0x8ac5[_0x487cbd];return _0x42f5d7;};'use strict';var multer=require(_0x58ac('0x0'));var util=require(_0x58ac('0x1'));var path=require(_0x58ac('0x2'));var timeout=require(_0x58ac('0x3'));var express=require(_0x58ac('0x4'));var router=express[_0x58ac('0x5')]();var auth=require(_0x58ac('0x6'));var interaction=require(_0x58ac('0x7'));var config=require(_0x58ac('0x8'));var controller=require(_0x58ac('0x9'));router['get']('/',auth[_0x58ac('0xa')](),controller[_0x58ac('0xb')]);router[_0x58ac('0xc')](_0x58ac('0xd'),auth[_0x58ac('0xa')](),controller[_0x58ac('0xe')]);router[_0x58ac('0xc')](_0x58ac('0xf'),auth[_0x58ac('0xa')](),controller[_0x58ac('0x10')]);router[_0x58ac('0x11')]('/',auth[_0x58ac('0xa')](),controller[_0x58ac('0x12')]);router['put'](_0x58ac('0xf'),auth[_0x58ac('0xa')](),controller['update']);router['delete'](_0x58ac('0xf'),auth[_0x58ac('0xa')](),controller[_0x58ac('0x13')]);module[_0x58ac('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js
index fb8b962..c4eb7e0 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 _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
+var _0x7217=['sequelize','STRING','DATE'];(function(_0x575385,_0x6a7ec){var _0x3fafda=function(_0x45b25b){while(--_0x45b25b){_0x575385['push'](_0x575385['shift']());}};_0x3fafda(++_0x6a7ec);}(_0x7217,0x19e));var _0x7721=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x7217[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x7721('0x1')]},'joinAt':{'type':Sequelize[_0x7721('0x2')]},'leaveAt':{'type':Sequelize[_0x7721('0x2')]},'acceptAt':{'type':Sequelize[_0x7721('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js
index 8c50643..448a2ae 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 _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
+var _0x046b=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','count','offset','limit','Content-Range','json','save','update','then','destroy','error','stack','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0xf24f30,_0x77205b){var _0x364bea=function(_0x562a10){while(--_0x562a10){_0xf24f30['push'](_0xf24f30['shift']());}};_0x364bea(++_0x77205b);}(_0x046b,0x1ba));var _0xb046=function(_0x272e71,_0x3aeff4){_0x272e71=_0x272e71-0x0;var _0x2f1ff3=_0x046b[_0x272e71];return _0x2f1ff3;};'use strict';var pdf=require(_0xb046('0x0'));var emlformat=require(_0xb046('0x1'));var rimraf=require(_0xb046('0x2'));var zipdir=require(_0xb046('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb046('0x4'));var moment=require(_0xb046('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb046('0x6'));var util=require(_0xb046('0x7'));var path=require(_0xb046('0x8'));var sox=require(_0xb046('0x9'));var csv=require(_0xb046('0xa'));var ejs=require(_0xb046('0xb'));var fs=require('fs');var _=require(_0xb046('0xc'));var squel=require(_0xb046('0xd'));var crypto=require(_0xb046('0xe'));var jsforce=require(_0xb046('0xf'));var deskjs=require(_0xb046('0x10'));var toCsv=require(_0xb046('0xa'));var querystring=require(_0xb046('0x11'));var Papa=require('papaparse');var Redis=require(_0xb046('0x12'));var authService=require(_0xb046('0x13'));var qs=require(_0xb046('0x14'));var as=require(_0xb046('0x15'));var hardwareService=require(_0xb046('0x16'));var logger=require('../../config/logger')(_0xb046('0x17'));var utils=require(_0xb046('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dfff1,_0x9fda4b){_0x9fda4b=_0x9fda4b||0xcc;return function(_0x2ff4f3){if(_0x2ff4f3){return _0x3dfff1[_0xb046('0x19')](_0x9fda4b);}return _0x3dfff1[_0xb046('0x1a')](_0x9fda4b)[_0xb046('0x1b')]();};}function respondWithResult(_0x3246b2,_0x1d97b0){_0x1d97b0=_0x1d97b0||0xc8;return function(_0x36e91f){if(_0x36e91f){return _0x3246b2[_0xb046('0x1a')](_0x1d97b0)['json'](_0x36e91f);}};}function respondWithFilteredResult(_0x2688bb,_0x3a8109){return function(_0x4fd90c){if(_0x4fd90c){var _0x2b0d1e=_0x4fd90c[_0xb046('0x1c')],_0x5e54c6=_0x3a8109[_0xb046('0x1d')],_0x3880da=_0x3a8109[_0xb046('0x1d')]+_0x3a8109[_0xb046('0x1e')],_0xe9da83;if(_0x3880da>=_0x2b0d1e){_0x3880da=_0x2b0d1e;_0xe9da83=0xc8;}else{_0xe9da83=0xce;}_0x2688bb['status'](_0xe9da83);return _0x2688bb['set'](_0xb046('0x1f'),_0x5e54c6+'-'+_0x3880da+'/'+_0x2b0d1e)[_0xb046('0x20')](_0x4fd90c);}return null;};}function patchUpdates(_0x37ca7b){return function(_0x4cd3c1){try{jsonpatch['apply'](_0x4cd3c1,_0x37ca7b,!![]);}catch(_0x1d617c){return BPromise['reject'](_0x1d617c);}return _0x4cd3c1[_0xb046('0x21')]();};}function saveUpdates(_0x49781d,_0x9456ce){return function(_0x3e9a1f){if(_0x3e9a1f){return _0x3e9a1f[_0xb046('0x22')](_0x49781d)[_0xb046('0x23')](function(_0x48768c){return _0x48768c;});}return null;};}function removeEntity(_0x57adaa,_0x505294){return function(_0x2dbdde){if(_0x2dbdde){return _0x2dbdde[_0xb046('0x24')]()[_0xb046('0x23')](function(){_0x57adaa[_0xb046('0x1a')](0xcc)[_0xb046('0x1b')]();});}};}function handleEntityNotFound(_0x433526,_0x51c65d){return function(_0x2750f8){if(!_0x2750f8){_0x433526['sendStatus'](0x194);}return _0x2750f8;};}function handleError(_0x52984a,_0x41841e){_0x41841e=_0x41841e||0x1f4;return function(_0x377ada){logger[_0xb046('0x25')](_0x377ada[_0xb046('0x26')]);if(_0x377ada[_0xb046('0x27')]){delete _0x377ada[_0xb046('0x27')];}_0x52984a[_0xb046('0x1a')](_0x41841e)[_0xb046('0x28')](_0x377ada);};}exports['index']=function(_0x5820f7,_0x1f8522){var _0x4e35d0={},_0x2ff57c={},_0xf57ee2={'count':0x0,'rows':[]};var _0x114f08=_[_0xb046('0x29')](db[_0xb046('0x2a')][_0xb046('0x2b')],function(_0x180f77){return{'name':_0x180f77[_0xb046('0x2c')],'type':_0x180f77[_0xb046('0x2d')][_0xb046('0x2e')]};});_0x2ff57c[_0xb046('0x2f')]=_[_0xb046('0x29')](_0x114f08,_0xb046('0x27'));_0x2ff57c['query']=_[_0xb046('0x30')](_0x5820f7['query']);_0x2ff57c[_0xb046('0x31')]=_[_0xb046('0x32')](_0x2ff57c[_0xb046('0x2f')],_0x2ff57c[_0xb046('0x33')]);_0x4e35d0[_0xb046('0x34')]=_['intersection'](_0x2ff57c['model'],qs[_0xb046('0x35')](_0x5820f7[_0xb046('0x33')][_0xb046('0x35')]));_0x4e35d0[_0xb046('0x34')]=_0x4e35d0['attributes'][_0xb046('0x36')]?_0x4e35d0[_0xb046('0x34')]:_0x2ff57c[_0xb046('0x2f')];if(!_0x5820f7['query'][_0xb046('0x37')](_0xb046('0x38'))){_0x4e35d0[_0xb046('0x1e')]=qs[_0xb046('0x1e')](_0x5820f7[_0xb046('0x33')][_0xb046('0x1e')]);_0x4e35d0['offset']=qs['offset'](_0x5820f7[_0xb046('0x33')][_0xb046('0x1d')]);}_0x4e35d0[_0xb046('0x39')]=qs[_0xb046('0x3a')](_0x5820f7[_0xb046('0x33')]['sort']);_0x4e35d0[_0xb046('0x3b')]=qs['filters'](_[_0xb046('0x3c')](_0x5820f7[_0xb046('0x33')],_0x2ff57c[_0xb046('0x31')]),_0x114f08);if(_0x5820f7[_0xb046('0x33')][_0xb046('0x3d')]){_0x4e35d0[_0xb046('0x3b')]=_[_0xb046('0x3e')](_0x4e35d0[_0xb046('0x3b')],{'$or':_['map'](_0x114f08,function(_0x33b89d){if(_0x33b89d[_0xb046('0x2d')]!==_0xb046('0x3f')){var _0x520210={};_0x520210[_0x33b89d['name']]={'$like':'%'+_0x5820f7['query']['filter']+'%'};return _0x520210;}})});}_0x4e35d0=_[_0xb046('0x3e')]({},_0x4e35d0,_0x5820f7[_0xb046('0x40')]);var _0x4c3329={'where':_0x4e35d0[_0xb046('0x3b')]};return db[_0xb046('0x2a')][_0xb046('0x1c')](_0x4c3329)[_0xb046('0x23')](function(_0x4efbf1){_0xf57ee2[_0xb046('0x1c')]=_0x4efbf1;if(_0x5820f7['query'][_0xb046('0x41')]){_0x4e35d0[_0xb046('0x42')]=[{'all':!![]}];}return db[_0xb046('0x2a')][_0xb046('0x43')](_0x4e35d0);})[_0xb046('0x23')](function(_0x45b738){_0xf57ee2[_0xb046('0x44')]=_0x45b738;return _0xf57ee2;})[_0xb046('0x23')](respondWithFilteredResult(_0x1f8522,_0x4e35d0))[_0xb046('0x45')](handleError(_0x1f8522,null));};exports[_0xb046('0x46')]=function(_0x445d9f,_0x8a54a0){var _0x88825={'raw':!![],'where':{'id':_0x445d9f['params']['id']}},_0x475828={};_0x475828[_0xb046('0x2f')]=_[_0xb046('0x30')](db[_0xb046('0x2a')][_0xb046('0x2b')]);_0x475828[_0xb046('0x33')]=_[_0xb046('0x30')](_0x445d9f['query']);_0x475828['filters']=_[_0xb046('0x32')](_0x475828[_0xb046('0x2f')],_0x475828[_0xb046('0x33')]);_0x88825[_0xb046('0x34')]=_[_0xb046('0x32')](_0x475828[_0xb046('0x2f')],qs[_0xb046('0x35')](_0x445d9f['query'][_0xb046('0x35')]));_0x88825[_0xb046('0x34')]=_0x88825['attributes'][_0xb046('0x36')]?_0x88825[_0xb046('0x34')]:_0x475828['model'];if(_0x445d9f[_0xb046('0x33')]['includeAll']){_0x88825[_0xb046('0x42')]=[{'all':!![]}];}_0x88825=_[_0xb046('0x3e')]({},_0x88825,_0x445d9f[_0xb046('0x40')]);return db['WhatsappQueueReport'][_0xb046('0x47')](_0x88825)[_0xb046('0x23')](handleEntityNotFound(_0x8a54a0,null))[_0xb046('0x23')](respondWithResult(_0x8a54a0,null))[_0xb046('0x45')](handleError(_0x8a54a0,null));};exports[_0xb046('0x48')]=function(_0x507e58,_0x5e71d7){return db['WhatsappQueueReport'][_0xb046('0x48')](_0x507e58[_0xb046('0x49')],{})[_0xb046('0x23')](respondWithResult(_0x5e71d7,0xc9))[_0xb046('0x45')](handleError(_0x5e71d7,null));};exports[_0xb046('0x22')]=function(_0xdea490,_0x485898){if(_0xdea490[_0xb046('0x49')]['id']){delete _0xdea490[_0xb046('0x49')]['id'];}return db[_0xb046('0x2a')][_0xb046('0x47')]({'where':{'id':_0xdea490[_0xb046('0x4a')]['id']}})[_0xb046('0x23')](handleEntityNotFound(_0x485898,null))[_0xb046('0x23')](saveUpdates(_0xdea490[_0xb046('0x49')],null))['then'](respondWithResult(_0x485898,null))[_0xb046('0x45')](handleError(_0x485898,null));};exports[_0xb046('0x24')]=function(_0x45fd46,_0x1a4a36){return db[_0xb046('0x2a')]['find']({'where':{'id':_0x45fd46[_0xb046('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1a4a36,null))[_0xb046('0x23')](removeEntity(_0x1a4a36,null))[_0xb046('0x45')](handleError(_0x1a4a36,null));};exports[_0xb046('0x4b')]=function(_0x33d1c2,_0x51654b){return db[_0xb046('0x2a')][_0xb046('0x4b')]()[_0xb046('0x23')](respondWithResult(_0x51654b,null))['catch'](handleError(_0x51654b,null));};
\ No newline at end of file
diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js
index 7394287..68149f7 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 _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
+var _0x8f5b=['WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x8f5b,0x129));var _0xb8f5=function(_0x37768b,_0xedcc5a){_0x37768b=_0x37768b-0x0;var _0x1f3c43=_0x8f5b[_0x37768b];return _0x1f3c43;};'use strict';var _=require(_0xb8f5('0x0'));var util=require(_0xb8f5('0x1'));var logger=require(_0xb8f5('0x2'))(_0xb8f5('0x3'));var moment=require(_0xb8f5('0x4'));var BPromise=require('bluebird');var rp=require(_0xb8f5('0x5'));var fs=require('fs');var path=require(_0xb8f5('0x6'));var rimraf=require(_0xb8f5('0x7'));var config=require(_0xb8f5('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0xb8f5('0x9')]=function(_0x5b7d29,_0x18bfe8){return _0x5b7d29[_0xb8f5('0xa')](_0xb8f5('0xb'),attributes,{'tableName':_0xb8f5('0xc'),'paranoid':![],'indexes':[{'name':_0xb8f5('0xd'),'fields':[_0xb8f5('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js
index 81ad932..57cc133 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 _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
+var _0xa7d8=['catch','CreateWhatsappQueueReport','options','raw','UpdateWhatsappQueueReport','WhatsappQueueReport','update','where','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xa7d8,0x94));var _0x8a7d=function(_0x2d1755,_0x15724a){_0x2d1755=_0x2d1755-0x0;var _0x479df7=_0xa7d8[_0x2d1755];return _0x479df7;};'use strict';var _=require(_0x8a7d('0x0'));var util=require('util');var moment=require(_0x8a7d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8a7d('0x2'));var fs=require('fs');var Redis=require(_0x8a7d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a7d('0x4'));var logger=require(_0x8a7d('0x5'))(_0x8a7d('0x6'));var config=require(_0x8a7d('0x7'));var jayson=require(_0x8a7d('0x8'));var client=jayson[_0x8a7d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3821fb,_0x391cbf,_0x500943){return new BPromise(function(_0x1f4767,_0x5f5d25){return client[_0x8a7d('0xa')](_0x3821fb,_0x500943)[_0x8a7d('0xb')](function(_0x367687){logger[_0x8a7d('0xc')](_0x8a7d('0xd'),_0x391cbf,'request\x20sent');logger[_0x8a7d('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x391cbf,_0x8a7d('0xf'),JSON[_0x8a7d('0x10')](_0x367687));if(_0x367687[_0x8a7d('0x11')]){if(_0x367687[_0x8a7d('0x11')]['code']===0x1f4){logger[_0x8a7d('0x11')](_0x8a7d('0xd'),_0x391cbf,_0x367687[_0x8a7d('0x11')][_0x8a7d('0x12')]);return _0x5f5d25(_0x367687['error'][_0x8a7d('0x12')]);}logger[_0x8a7d('0x11')](_0x8a7d('0xd'),_0x391cbf,_0x367687[_0x8a7d('0x11')][_0x8a7d('0x12')]);return _0x1f4767(_0x367687[_0x8a7d('0x11')][_0x8a7d('0x12')]);}else{logger[_0x8a7d('0xc')](_0x8a7d('0xd'),_0x391cbf,_0x8a7d('0xf'));_0x1f4767(_0x367687[_0x8a7d('0x13')][_0x8a7d('0x12')]);}})[_0x8a7d('0x14')](function(_0x4cd0ca){logger[_0x8a7d('0x11')](_0x8a7d('0xd'),_0x391cbf,_0x4cd0ca);_0x5f5d25(_0x4cd0ca);});});}exports[_0x8a7d('0x15')]=function(_0x1d44a4){var _0x20d3f6=this;return new Promise(function(_0x4ec7f2,_0x22bf3a){return db['WhatsappQueueReport']['create'](_0x1d44a4['body'],{'raw':_0x1d44a4[_0x8a7d('0x16')]?_0x1d44a4[_0x8a7d('0x16')][_0x8a7d('0x17')]===undefined?!![]:![]:!![]})[_0x8a7d('0xb')](function(_0x1333e5){logger[_0x8a7d('0xc')](_0x8a7d('0x15'),_0x1d44a4);logger[_0x8a7d('0xe')](_0x8a7d('0x15'),_0x1d44a4,JSON[_0x8a7d('0x10')](_0x1333e5));_0x4ec7f2(_0x1333e5);})[_0x8a7d('0x14')](function(_0x34d247){logger[_0x8a7d('0x11')]('CreateWhatsappQueueReport',_0x34d247[_0x8a7d('0x12')],_0x1d44a4);_0x22bf3a(_0x20d3f6['error'](0x1f4,_0x34d247[_0x8a7d('0x12')]));});});};exports[_0x8a7d('0x18')]=function(_0x12707b){var _0x213d4d=this;return new Promise(function(_0x5d4233,_0x16eeba){return db[_0x8a7d('0x19')][_0x8a7d('0x1a')](_0x12707b['body'],{'raw':_0x12707b[_0x8a7d('0x16')]?_0x12707b[_0x8a7d('0x16')][_0x8a7d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12707b[_0x8a7d('0x16')]?_0x12707b[_0x8a7d('0x16')][_0x8a7d('0x1b')]||null:null,'attributes':_0x12707b[_0x8a7d('0x16')]?_0x12707b[_0x8a7d('0x16')]['attributes']||null:null,'limit':_0x12707b[_0x8a7d('0x16')]?_0x12707b[_0x8a7d('0x16')]['limit']||null:null})['then'](function(_0x54dbbf){logger[_0x8a7d('0xc')](_0x8a7d('0x18'),_0x12707b);logger[_0x8a7d('0xe')]('UpdateWhatsappQueueReport',_0x12707b,JSON[_0x8a7d('0x10')](_0x54dbbf));_0x5d4233(_0x54dbbf);})['catch'](function(_0x24b211){logger[_0x8a7d('0x11')]('UpdateWhatsappQueueReport',_0x24b211[_0x8a7d('0x12')],_0x12707b);_0x16eeba(_0x213d4d[_0x8a7d('0x11')](0x1f4,_0x24b211[_0x8a7d('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js
index 5885949..aad7be5 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 _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
+var _0xf271=['show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x32746e,_0x32d5c3){var _0x585821=function(_0x2543ce){while(--_0x2543ce){_0x32746e['push'](_0x32746e['shift']());}};_0x585821(++_0x32d5c3);}(_0xf271,0x10b));var _0x1f27=function(_0x480193,_0x3e1ce7){_0x480193=_0x480193-0x0;var _0x3eb05f=_0xf271[_0x480193];return _0x3eb05f;};'use strict';var multer=require(_0x1f27('0x0'));var util=require('util');var path=require(_0x1f27('0x1'));var timeout=require(_0x1f27('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x1f27('0x3'));var interaction=require(_0x1f27('0x4'));var config=require(_0x1f27('0x5'));var controller=require(_0x1f27('0x6'));router[_0x1f27('0x7')]('/',auth[_0x1f27('0x8')](),controller[_0x1f27('0x9')]);router[_0x1f27('0x7')](_0x1f27('0xa'),auth[_0x1f27('0x8')](),controller[_0x1f27('0xb')]);router[_0x1f27('0x7')](_0x1f27('0xc'),auth[_0x1f27('0x8')](),controller[_0x1f27('0xd')]);router[_0x1f27('0xe')]('/',auth[_0x1f27('0x8')](),controller[_0x1f27('0xf')]);router[_0x1f27('0x10')]('/:id',auth[_0x1f27('0x8')](),controller['update']);router[_0x1f27('0x11')](_0x1f27('0xc'),auth[_0x1f27('0x8')](),controller[_0x1f27('0x12')]);module[_0x1f27('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js
index 4857fe5..be8c8ef 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(_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
+var _0xb10b=['ENUM','account','queue','DATE','sequelize','STRING'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d7686,_0x5d11b1){_0x5d7686=_0x5d7686-0x0;var _0x408ab4=_0xb10b[_0x5d7686];return _0x408ab4;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xbb10('0x2')](_0xbb10('0x3'),'agent',_0xbb10('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xbb10('0x5')]}};
\ No newline at end of file
diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js
index a20eeec..17940fe 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 _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
+var _0x70da=['lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','WhatsappTransferReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','filter','includeAll','include','findAll','rows','show','rawAttributes','length','options','find','catch','body','describe','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x1fbafd,_0x1ba0a5){var _0x2ccceb=function(_0x1b71cf){while(--_0x1b71cf){_0x1fbafd['push'](_0x1fbafd['shift']());}};_0x2ccceb(++_0x1ba0a5);}(_0x70da,0x1a5));var _0xa70d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x70da[_0x59ee6f];return _0x4c0979;};'use strict';var pdf=require(_0xa70d('0x0'));var emlformat=require(_0xa70d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa70d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa70d('0x3'));var moment=require('moment');var BPromise=require(_0xa70d('0x4'));var Mustache=require(_0xa70d('0x5'));var util=require(_0xa70d('0x6'));var path=require(_0xa70d('0x7'));var sox=require(_0xa70d('0x8'));var csv=require(_0xa70d('0x9'));var ejs=require(_0xa70d('0xa'));var fs=require('fs');var _=require(_0xa70d('0xb'));var squel=require('squel');var crypto=require(_0xa70d('0xc'));var jsforce=require(_0xa70d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa70d('0x9'));var querystring=require(_0xa70d('0xe'));var Papa=require(_0xa70d('0xf'));var Redis=require(_0xa70d('0x10'));var authService=require(_0xa70d('0x11'));var qs=require(_0xa70d('0x12'));var as=require(_0xa70d('0x13'));var hardwareService=require(_0xa70d('0x14'));var logger=require(_0xa70d('0x15'))(_0xa70d('0x16'));var utils=require(_0xa70d('0x17'));var config=require(_0xa70d('0x18'));var db=require(_0xa70d('0x19'))['db'];function respondWithStatusCode(_0x398539,_0x1aad9d){_0x1aad9d=_0x1aad9d||0xcc;return function(_0x2ebe7f){if(_0x2ebe7f){return _0x398539['sendStatus'](_0x1aad9d);}return _0x398539[_0xa70d('0x1a')](_0x1aad9d)[_0xa70d('0x1b')]();};}function respondWithResult(_0x1128c1,_0x38032a){_0x38032a=_0x38032a||0xc8;return function(_0x510e93){if(_0x510e93){return _0x1128c1[_0xa70d('0x1a')](_0x38032a)['json'](_0x510e93);}};}function respondWithFilteredResult(_0x397060,_0x388a3d){return function(_0x29f865){if(_0x29f865){var _0x75a1f1=_0x29f865[_0xa70d('0x1c')],_0x384c17=_0x388a3d['offset'],_0x56dde5=_0x388a3d[_0xa70d('0x1d')]+_0x388a3d[_0xa70d('0x1e')],_0xf939e1;if(_0x56dde5>=_0x75a1f1){_0x56dde5=_0x75a1f1;_0xf939e1=0xc8;}else{_0xf939e1=0xce;}_0x397060['status'](_0xf939e1);return _0x397060['set'](_0xa70d('0x1f'),_0x384c17+'-'+_0x56dde5+'/'+_0x75a1f1)['json'](_0x29f865);}return null;};}function patchUpdates(_0x10888d){return function(_0x5b0e87){try{jsonpatch[_0xa70d('0x20')](_0x5b0e87,_0x10888d,!![]);}catch(_0x310403){return BPromise[_0xa70d('0x21')](_0x310403);}return _0x5b0e87[_0xa70d('0x22')]();};}function saveUpdates(_0x4a83c5,_0x48b5ce){return function(_0x6ce211){if(_0x6ce211){return _0x6ce211[_0xa70d('0x23')](_0x4a83c5)[_0xa70d('0x24')](function(_0x163c60){return _0x163c60;});}return null;};}function removeEntity(_0x410e3b,_0x3f04cd){return function(_0x421f5c){if(_0x421f5c){return _0x421f5c[_0xa70d('0x25')]()[_0xa70d('0x24')](function(){_0x410e3b[_0xa70d('0x1a')](0xcc)[_0xa70d('0x1b')]();});}};}function handleEntityNotFound(_0x16a6b9,_0x295787){return function(_0x51e14d){if(!_0x51e14d){_0x16a6b9[_0xa70d('0x26')](0x194);}return _0x51e14d;};}function handleError(_0x202851,_0x5af1b1){_0x5af1b1=_0x5af1b1||0x1f4;return function(_0x4cdf1f){logger['error'](_0x4cdf1f[_0xa70d('0x27')]);if(_0x4cdf1f[_0xa70d('0x28')]){delete _0x4cdf1f[_0xa70d('0x28')];}_0x202851[_0xa70d('0x1a')](_0x5af1b1)[_0xa70d('0x29')](_0x4cdf1f);};}exports['index']=function(_0x326743,_0x2450e5){var _0x7916ca={},_0x7efb3a={},_0x129576={'count':0x0,'rows':[]};var _0x193954=_['map'](db[_0xa70d('0x2a')]['rawAttributes'],function(_0x4960c1){return{'name':_0x4960c1[_0xa70d('0x2b')],'type':_0x4960c1[_0xa70d('0x2c')][_0xa70d('0x2d')]};});_0x7efb3a[_0xa70d('0x2e')]=_[_0xa70d('0x2f')](_0x193954,'name');_0x7efb3a[_0xa70d('0x30')]=_[_0xa70d('0x31')](_0x326743[_0xa70d('0x30')]);_0x7efb3a[_0xa70d('0x32')]=_[_0xa70d('0x33')](_0x7efb3a[_0xa70d('0x2e')],_0x7efb3a['query']);_0x7916ca[_0xa70d('0x34')]=_['intersection'](_0x7efb3a[_0xa70d('0x2e')],qs['fields'](_0x326743['query'][_0xa70d('0x35')]));_0x7916ca[_0xa70d('0x34')]=_0x7916ca[_0xa70d('0x34')]['length']?_0x7916ca[_0xa70d('0x34')]:_0x7efb3a[_0xa70d('0x2e')];if(!_0x326743['query'][_0xa70d('0x36')]('nolimit')){_0x7916ca[_0xa70d('0x1e')]=qs[_0xa70d('0x1e')](_0x326743[_0xa70d('0x30')][_0xa70d('0x1e')]);_0x7916ca['offset']=qs[_0xa70d('0x1d')](_0x326743[_0xa70d('0x30')][_0xa70d('0x1d')]);}_0x7916ca['order']=qs['sort'](_0x326743[_0xa70d('0x30')][_0xa70d('0x37')]);_0x7916ca[_0xa70d('0x38')]=qs['filters'](_[_0xa70d('0x39')](_0x326743[_0xa70d('0x30')],_0x7efb3a['filters']),_0x193954);if(_0x326743[_0xa70d('0x30')]['filter']){_0x7916ca[_0xa70d('0x38')]=_[_0xa70d('0x3a')](_0x7916ca['where'],{'$or':_[_0xa70d('0x2f')](_0x193954,function(_0x3df75d){if(_0x3df75d['type']!=='VIRTUAL'){var _0x4751e5={};_0x4751e5[_0x3df75d['name']]={'$like':'%'+_0x326743[_0xa70d('0x30')][_0xa70d('0x3b')]+'%'};return _0x4751e5;}})});}_0x7916ca=_[_0xa70d('0x3a')]({},_0x7916ca,_0x326743['options']);var _0x437ebf={'where':_0x7916ca[_0xa70d('0x38')]};return db[_0xa70d('0x2a')][_0xa70d('0x1c')](_0x437ebf)['then'](function(_0x1278d7){_0x129576[_0xa70d('0x1c')]=_0x1278d7;if(_0x326743[_0xa70d('0x30')][_0xa70d('0x3c')]){_0x7916ca[_0xa70d('0x3d')]=[{'all':!![]}];}return db[_0xa70d('0x2a')][_0xa70d('0x3e')](_0x7916ca);})[_0xa70d('0x24')](function(_0x332b14){_0x129576[_0xa70d('0x3f')]=_0x332b14;return _0x129576;})[_0xa70d('0x24')](respondWithFilteredResult(_0x2450e5,_0x7916ca))['catch'](handleError(_0x2450e5,null));};exports[_0xa70d('0x40')]=function(_0x1d0395,_0x29242a){var _0x24a635={'raw':!![],'where':{'id':_0x1d0395['params']['id']}},_0x347ed9={};_0x347ed9[_0xa70d('0x2e')]=_[_0xa70d('0x31')](db['WhatsappTransferReport'][_0xa70d('0x41')]);_0x347ed9[_0xa70d('0x30')]=_[_0xa70d('0x31')](_0x1d0395[_0xa70d('0x30')]);_0x347ed9[_0xa70d('0x32')]=_['intersection'](_0x347ed9[_0xa70d('0x2e')],_0x347ed9[_0xa70d('0x30')]);_0x24a635[_0xa70d('0x34')]=_[_0xa70d('0x33')](_0x347ed9[_0xa70d('0x2e')],qs[_0xa70d('0x35')](_0x1d0395['query']['fields']));_0x24a635[_0xa70d('0x34')]=_0x24a635[_0xa70d('0x34')][_0xa70d('0x42')]?_0x24a635['attributes']:_0x347ed9[_0xa70d('0x2e')];if(_0x1d0395['query']['includeAll']){_0x24a635[_0xa70d('0x3d')]=[{'all':!![]}];}_0x24a635=_[_0xa70d('0x3a')]({},_0x24a635,_0x1d0395[_0xa70d('0x43')]);return db[_0xa70d('0x2a')][_0xa70d('0x44')](_0x24a635)[_0xa70d('0x24')](handleEntityNotFound(_0x29242a,null))[_0xa70d('0x24')](respondWithResult(_0x29242a,null))[_0xa70d('0x45')](handleError(_0x29242a,null));};exports['create']=function(_0x2d7137,_0x48fde5){return db[_0xa70d('0x2a')]['create'](_0x2d7137['body'],{})[_0xa70d('0x24')](respondWithResult(_0x48fde5,0xc9))[_0xa70d('0x45')](handleError(_0x48fde5,null));};exports['update']=function(_0x32f960,_0x53323d){if(_0x32f960[_0xa70d('0x46')]['id']){delete _0x32f960[_0xa70d('0x46')]['id'];}return db[_0xa70d('0x2a')][_0xa70d('0x44')]({'where':{'id':_0x32f960['params']['id']}})[_0xa70d('0x24')](handleEntityNotFound(_0x53323d,null))[_0xa70d('0x24')](saveUpdates(_0x32f960[_0xa70d('0x46')],null))[_0xa70d('0x24')](respondWithResult(_0x53323d,null))['catch'](handleError(_0x53323d,null));};exports[_0xa70d('0x25')]=function(_0x504476,_0x2c6158){return db[_0xa70d('0x2a')][_0xa70d('0x44')]({'where':{'id':_0x504476['params']['id']}})[_0xa70d('0x24')](handleEntityNotFound(_0x2c6158,null))[_0xa70d('0x24')](removeEntity(_0x2c6158,null))[_0xa70d('0x45')](handleError(_0x2c6158,null));};exports['describe']=function(_0x2c04a9,_0x413ae6){return db[_0xa70d('0x2a')][_0xa70d('0x47')]()[_0xa70d('0x24')](respondWithResult(_0x413ae6,null))[_0xa70d('0x45')](handleError(_0x413ae6,null));};
\ No newline at end of file
diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js
index 22cd12a..9dcf81e 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 _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
+var _0x7b54=['./whatsappTransferReport.attributes','exports','WhatsappTransferReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x981700,_0x34e289){var _0x2319eb=function(_0x1e63b5){while(--_0x1e63b5){_0x981700['push'](_0x981700['shift']());}};_0x2319eb(++_0x34e289);}(_0x7b54,0x1cb));var _0x47b5=function(_0x983dc2,_0x5cca11){_0x983dc2=_0x983dc2-0x0;var _0x4b0315=_0x7b54[_0x983dc2];return _0x4b0315;};'use strict';var _=require('lodash');var util=require(_0x47b5('0x0'));var logger=require(_0x47b5('0x1'))(_0x47b5('0x2'));var moment=require(_0x47b5('0x3'));var BPromise=require(_0x47b5('0x4'));var rp=require(_0x47b5('0x5'));var fs=require('fs');var path=require(_0x47b5('0x6'));var rimraf=require(_0x47b5('0x7'));var config=require(_0x47b5('0x8'));var attributes=require(_0x47b5('0x9'));module[_0x47b5('0xa')]=function(_0x70477f,_0x39cd3d){return _0x70477f['define'](_0x47b5('0xb'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x47b5('0xc'),'fields':[_0x47b5('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js
index ff30aa8..8aaef6d 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(_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
+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(_0x12abfd,_0x8d19b9){var _0x1c6d24=function(_0x503373){while(--_0x503373){_0x12abfd['push'](_0x12abfd['shift']());}};_0x1c6d24(++_0x8d19b9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 fccec37..65ba516 100644
--- a/server/app.js
+++ b/server/app.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-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
+var _0xc6a0=['join','status','None','seedDB','default','catch','error','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','./config/pm2/config','./config/schedule','sync','then','listen','info','start','Online\x20apps:','map','online','name'];(function(_0x5d6814,_0x1dfdc5){var _0x271a00=function(_0xf9c87c){while(--_0xf9c87c){_0x5d6814['push'](_0x5d6814['shift']());}};_0x271a00(++_0x1dfdc5);}(_0xc6a0,0x1d0));var _0x0c6a=function(_0x1af902,_0x222f11){_0x1af902=_0x1af902-0x0;var _0x4dd69d=_0xc6a0[_0x1af902];return _0x4dd69d;};'use strict';var _=require(_0x0c6a('0x0'));var mysqldb=require(_0x0c6a('0x1'));var rpc=require(_0x0c6a('0x2'));var config=require(_0x0c6a('0x3'));var logger=require(_0x0c6a('0x4'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0x0c6a('0x5'));var schedule=require(_0x0c6a('0x6'));var chat=require('./config/schedule/chat');var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db']['sequelize'][_0x0c6a('0x7')]()[_0x0c6a('0x8')](function(){return rpc[_0x0c6a('0x9')]();})[_0x0c6a('0x8')](function(_0x409240){logger[_0x0c6a('0xa')](_0x409240);return chat[_0x0c6a('0xb')]();})[_0x0c6a('0x8')](function(){return schedule[_0x0c6a('0xb')]();})[_0x0c6a('0x8')](function(){return transcribe['start']();})[_0x0c6a('0x8')](function(_0x3b54de){logger[_0x0c6a('0xa')](_0x3b54de);return pm2[_0x0c6a('0xb')](pm2Config);})[_0x0c6a('0x8')](function(_0x4cdf8e){logger[_0x0c6a('0xa')](_0x0c6a('0xc'),_[_0x0c6a('0xd')](_['filter'](_0x4cdf8e,{'status':_0x0c6a('0xe')}),_0x0c6a('0xf'))[_0x0c6a('0x10')]());logger['info']('Offline\x20apps:',_[_0x0c6a('0xd')](_['filter'](_0x4cdf8e,function(_0x23cf26){return _0x23cf26[_0x0c6a('0x11')]!==_0x0c6a('0xe');}),'name')[_0x0c6a('0x10')]()||_0x0c6a('0x12'));config[_0x0c6a('0x13')]&&require('./config/seedDB')[_0x0c6a('0x14')]();require('./config/license')[_0x0c6a('0x14')]();})[_0x0c6a('0x15')](function(_0x17be07){logger[_0x0c6a('0x16')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x17be07);process[_0x0c6a('0x17')](0x1);});}main();
\ No newline at end of file
diff --git a/server/components/auth/service.js b/server/components/auth/service.js
index 33c9f42..a197830 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 _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
+var _0xeb92=['regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','secret','payload','verify','toString','now','../../config/environment','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','secrets','session','role','fullname','name','internal','email','md5secret','chatPause','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','params','closed','disposition','then','unmanaged','json','Unmanaged.','Forbidden.','catch','use','authorization','startsWith','headers','Basic','User','find','pass','status','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','isEqual','apiKeyNonce','nonce','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','../../config/license/util','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','apiKeyIat'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xeb92,0xc3));var _0x2eb9=function(_0xbb3c7b,_0x5749da){_0xbb3c7b=_0xbb3c7b-0x0;var _0x140f19=_0xeb92[_0xbb3c7b];return _0x140f19;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x2eb9('0x0'));var hardwareConf=require('../../config/license/hardware');var _=require('lodash');var jwt=require(_0x2eb9('0x1'));var expressJwt=require('express-jwt');var compose=require(_0x2eb9('0x2'));var basicAuth=require(_0x2eb9('0x3'));var crypto=require(_0x2eb9('0x4'));var BPromise=require(_0x2eb9('0x5'));var validateJwt=expressJwt({'secret':config[_0x2eb9('0x6')][_0x2eb9('0x7')]});var userAttributes=['id',_0x2eb9('0x8'),_0x2eb9('0x9'),_0x2eb9('0xa'),_0x2eb9('0xb'),_0x2eb9('0xc'),'userpic','permissions',_0x2eb9('0xd'),'voicePause',_0x2eb9('0xe'),_0x2eb9('0xf'),'faxPause',_0x2eb9('0x10'),_0x2eb9('0x11'),_0x2eb9('0x12'),_0x2eb9('0x13'),_0x2eb9('0x14'),_0x2eb9('0x15'),_0x2eb9('0x16'),_0x2eb9('0x17'),_0x2eb9('0x18'),'alias',_0x2eb9('0x19'),'phoneBarAutoAnswerDelay',_0x2eb9('0x1a'),_0x2eb9('0x1b'),_0x2eb9('0x1c'),_0x2eb9('0x1d'),'phoneBarExpires',_0x2eb9('0x1e'),_0x2eb9('0x1f'),_0x2eb9('0x20'),_0x2eb9('0x21'),_0x2eb9('0x22'),_0x2eb9('0x23')];exports[_0x2eb9('0x24')]=function(){return this[_0x2eb9('0x25')](!![])['use'](function(_0x34994a,_0x17f99f,_0x5c8a06){if(_0x34994a[_0x2eb9('0x26')]){_0x5c8a06();}else{return db[_0x2eb9('0x27')][_0x2eb9('0x28')]({'where':{'id':_0x34994a[_0x2eb9('0x29')]['id']},'attributes':['id',_0x2eb9('0x2a'),_0x2eb9('0x2b')],'raw':!![]})[_0x2eb9('0x2c')](function(_0x33f5f8){if(_0x33f5f8&&_0x33f5f8[_0x2eb9('0x2a')]){return _0x17f99f['status'](_0x33f5f8['disposition']===_0x2eb9('0x2d')?0x195:0x193)[_0x2eb9('0x2e')]({'message':_0x33f5f8[_0x2eb9('0x2b')]===_0x2eb9('0x2d')?_0x2eb9('0x2f'):_0x2eb9('0x30')});}else{_0x5c8a06();}})[_0x2eb9('0x31')](function(_0x1c2f51){_0x5c8a06(_0x1c2f51);});}});};exports['isAuthenticated']=function isAuthenticated(_0x108c1c){return compose()[_0x2eb9('0x32')](function(_0x3cd5de,_0xfacf6a,_0x31cf9a){if(_0x3cd5de['headers'][_0x2eb9('0x33')]){if(_[_0x2eb9('0x34')](_0x3cd5de[_0x2eb9('0x35')][_0x2eb9('0x33')],_0x2eb9('0x36'))){var _0x40796d=basicAuth(_0x3cd5de);db[_0x2eb9('0x37')][_0x2eb9('0x38')]({'where':{'name':_0x40796d[_0x2eb9('0xa')]}})[_0x2eb9('0x2c')](function(_0x2c1e66){if(!_0x2c1e66||!_0x2c1e66['authenticate'](_0x40796d[_0x2eb9('0x39')])){return _0xfacf6a[_0x2eb9('0x3a')](0x191)['json']({'message':_0x2eb9('0x3b')});}_0x3cd5de[_0x2eb9('0x26')]={'id':_0x2c1e66['id']};_0x31cf9a();})[_0x2eb9('0x31')](function(_0x431f16){_0x31cf9a(_0x431f16);});}else if(_[_0x2eb9('0x34')](_0x3cd5de[_0x2eb9('0x35')][_0x2eb9('0x33')],_0x2eb9('0x3c'))){validateJwt(_0x3cd5de,_0xfacf6a,_0x31cf9a);}else{if(_0x108c1c){_0x31cf9a();}else{return _0xfacf6a[_0x2eb9('0x3a')](0x193)[_0x2eb9('0x2e')]({'message':_0x2eb9('0x3d')});}}}else if(_0x3cd5de[_0x2eb9('0x3e')][_0x2eb9('0x3f')]){try{var _0x5de545={'audience':hardwareConf[_0x2eb9('0x40')](),'issuer':hardwareConf[_0x2eb9('0x40')]()};verifyJwt(_0x3cd5de[_0x2eb9('0x3e')][_0x2eb9('0x3f')],_0x5de545)[_0x2eb9('0x2c')](function(_0x1846ac){return db['User']['find']({'where':{'id':_0x1846ac[_0x2eb9('0x41')]}})[_0x2eb9('0x2c')](function(_0x36fb0a){if(!_0x36fb0a||!_[_0x2eb9('0x42')](_0x36fb0a[_0x2eb9('0x43')],_0x1846ac[_0x2eb9('0x44')])){return _0xfacf6a[_0x2eb9('0x3a')](0x191)[_0x2eb9('0x2e')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0x3cd5de[_0x2eb9('0x26')]={'id':_0x36fb0a['id']};_0x31cf9a();});})['catch'](function(){return _0xfacf6a[_0x2eb9('0x3a')](0x191)[_0x2eb9('0x2e')]({'message':_0x2eb9('0x45')});});}catch(_0x4cd9a0){_0x31cf9a(_0x4cd9a0);}}else if(_0x108c1c){_0x31cf9a();}else{return _0xfacf6a['status'](0x193)[_0x2eb9('0x2e')]({'message':_0x2eb9('0x3d')});}})['use'](function(_0x3d0419,_0x10d6a8,_0x189766){if(_0x3d0419[_0x2eb9('0x26')]){db[_0x2eb9('0x37')][_0x2eb9('0x38')]({'where':{'id':_0x3d0419['user']['id']},'attributes':userAttributes})[_0x2eb9('0x2c')](function(_0x11bdc4){if(!_0x11bdc4){return _0x10d6a8['status'](0x194)[_0x2eb9('0x2e')]({'message':_0x2eb9('0x46')});}_0x3d0419[_0x2eb9('0x26')]=_0x11bdc4;_0x189766();})[_0x2eb9('0x31')](function(_0x23e581){_0x189766(_0x23e581);});}else if(_0x108c1c){_0x189766();}else{return _0x10d6a8[_0x2eb9('0x3a')](0x194)[_0x2eb9('0x2e')]({'message':_0x2eb9('0x47')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x2eb9('0x32')](function(_0x2c4b10,_0x466a8d,_0x5c779d){return require(_0x2eb9('0x48'))['getLicense']()[_0x2eb9('0x2c')](function(_0x3e7e86){if(_0x3e7e86['update']){_0x5c779d();}else{return _0x466a8d['status'](0x193)[_0x2eb9('0x2e')]({'message':'Forbidden'});}})[_0x2eb9('0x31')](function(_0xf727de){_0x5c779d(_0xf727de);});});};exports['isMiddleware']=function(_0x5c45f2,_0x5d8aaa,_0x209c4c){_0x5c45f2[_0x2eb9('0x49')]=!![];return _0x209c4c();};exports[_0x2eb9('0x4a')]=function signToken(_0x351dad){return signJwt(_0x351dad);};exports[_0x2eb9('0x4b')]=function(_0xa3be0e,_0x11c4d0){if(!_0xa3be0e[_0x2eb9('0x26')]){return _0x11c4d0['status'](0x194)['json']({'message':_0x2eb9('0x4c')});}var _0x322c9e={'payload':{'id':_0xa3be0e[_0x2eb9('0x26')]['id'],'role':_0xa3be0e[_0x2eb9('0x26')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x322c9e)['then'](function(_0x3fb458){_0x11c4d0[_0x2eb9('0x4d')](_0x2eb9('0x4e'),_0x3fb458);_0x11c4d0[_0x2eb9('0x4f')](_0x2eb9('0x50'));})['catch'](function(_0xd49bcf){return _0x11c4d0['status'](0x1f4)[_0x2eb9('0x51')](_0xd49bcf);});};exports[_0x2eb9('0x52')]=function(_0x235f05){if(_['isNil'](_0x235f05[_0x2eb9('0x43')])||_['isNil'](_0x235f05['apiKeyIat'])){return null;}else{return createJwt(_0x235f05);}};exports['generateApiKey']=function(_0x376da1){_0x376da1[_0x2eb9('0x43')]=generateNonce();_0x376da1[_0x2eb9('0x53')]=generateIssuedAt();return createJwt(_0x376da1);};exports[_0x2eb9('0x54')]=function(_0x52dccd,_0x3e306d){var _0x10ba05=_0x52dccd['query'][_0x2eb9('0x3f')];if(_0x10ba05){var _0x329b97={'nonce':_0x3e306d[_0x2eb9('0x43')],'iat':_0x3e306d[_0x2eb9('0x53')],'audience':hardwareConf[_0x2eb9('0x40')](),'issuer':hardwareConf[_0x2eb9('0x40')]()};return verifyJwt(_0x10ba05,_0x329b97)[_0x2eb9('0x2c')](function(){return generateApiKey(_0x3e306d);});}else{throw{'message':_0x2eb9('0x55')};}};function signJwt(_0x5b2f26){var _0x115e52=BPromise[_0x2eb9('0x56')](jwt[_0x2eb9('0x57')],{'context':jwt});var _0x4c71f4=_0x5b2f26[_0x2eb9('0x58')]||config[_0x2eb9('0x6')]['session'];return new BPromise(function(_0x13eb7a,_0x54b3e2){_0x115e52(_0x5b2f26[_0x2eb9('0x59')],_0x4c71f4,_0x5b2f26['options'])['then'](function(_0x379dd1){_0x13eb7a(_0x379dd1);})[_0x2eb9('0x31')](function(_0x20fafa){_0x54b3e2(_0x20fafa);});});}function verifyJwt(_0x2d762a,_0x687b23,_0x41e375){var _0x46d341=BPromise[_0x2eb9('0x56')](jwt[_0x2eb9('0x5a')],{'context':jwt});var _0x55cd4b=_0x41e375||config[_0x2eb9('0x6')][_0x2eb9('0x7')];return new BPromise(function(_0xb03ce8,_0x135af8){_0x46d341(_0x2d762a,_0x55cd4b,_0x687b23)['then'](function(_0x3e4b86){_0xb03ce8(_0x3e4b86);})['catch'](function(_0x11250c){_0x135af8(_0x11250c);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x2eb9('0x5b')]('hex');}function generateIssuedAt(){return Math['floor'](Date[_0x2eb9('0x5c')]()/0x3e8)[_0x2eb9('0x5b')]();}function createJwt(_0x14348f){var _0x44258b={'payload':{'iat':_0x14348f[_0x2eb9('0x53')],'nonce':_0x14348f[_0x2eb9('0x43')]},'options':{'algorithm':'HS512','subject':_0x14348f['id'][_0x2eb9('0x5b')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x44258b)['then'](function(_0x552851){return{'iat':_0x14348f['apiKeyIat'],'nonce':_0x14348f['apiKeyNonce'],'token':_0x552851};});}
\ No newline at end of file
diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js
index bff6641..4d5c9c5 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 _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
+var _0x0713=['aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','binary','write','end','final','close','decryptFile','createDecipher','update','unlink'];(function(_0x10d973,_0x4c60dc){var _0x26a88a=function(_0x3ea918){while(--_0x3ea918){_0x10d973['push'](_0x10d973['shift']());}};_0x26a88a(++_0x4c60dc);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x3071('0x0')};function combineOptions(_0x2afa91){var _0x27405a={};for(var _0x305d85 in defaultOptions){if(defaultOptions[_0x3071('0x1')](_0x305d85)){_0x27405a[_0x305d85]=defaultOptions[_0x305d85];}}if(_0x2afa91){for(var _0x52b5fb in _0x2afa91){if(_0x2afa91[_0x3071('0x1')](_0x52b5fb)){_0x27405a[_0x52b5fb]=_0x2afa91[_0x52b5fb];}}}return _0x27405a;}exports[_0x3071('0x2')]=function(_0x33a70c,_0x3137c8,_0xabd7b6,_0x41cf76){return new BPromise(function(_0x1d3dd6,_0x2f1e87){_0x41cf76=combineOptions(_0x41cf76);var _0xbd737f=new Buffer(_0xabd7b6);var _0x22274c=fs[_0x3071('0x3')](_0x33a70c);var _0x2fce7a=fs[_0x3071('0x4')](_0x3137c8);var _0x4a36ec=crypto[_0x3071('0x5')](_0x41cf76[_0x3071('0x6')],_0xbd737f);_0x22274c['on'](_0x3071('0x7'),function(_0xff9a29){var _0x1ce844=new Buffer(_0x4a36ec['update'](_0xff9a29),_0x3071('0x8'));_0x2fce7a[_0x3071('0x9')](_0x1ce844);});_0x22274c['on'](_0x3071('0xa'),function(){try{var _0x3ed4a0=new Buffer(_0x4a36ec[_0x3071('0xb')]('binary'),'binary');_0x2fce7a[_0x3071('0x9')](_0x3ed4a0);_0x2fce7a['end']();_0x2fce7a['on'](_0x3071('0xc'),function(){return _0x1d3dd6(_0x3137c8);});}catch(_0x44fbae){fs['unlink'](_0x3137c8);return _0x2f1e87(_0x44fbae);}});});};exports[_0x3071('0xd')]=function(_0x4e1219,_0x2fc15d,_0x45c93b,_0x1271d0){return new BPromise(function(_0x1f14e1,_0x1caa5d){_0x1271d0=combineOptions(_0x1271d0);var _0x2a6a4b=new Buffer(_0x45c93b);var _0x157a47=fs[_0x3071('0x3')](_0x4e1219);var _0x21aad3=fs[_0x3071('0x4')](_0x2fc15d);var _0x5f3c22=crypto[_0x3071('0xe')](_0x1271d0[_0x3071('0x6')],_0x2a6a4b);_0x157a47['on'](_0x3071('0x7'),function(_0x108a83){var _0x3acf0e=new Buffer(_0x5f3c22[_0x3071('0xf')](_0x108a83),_0x3071('0x8'));_0x21aad3[_0x3071('0x9')](_0x3acf0e);});_0x157a47['on']('end',function(){try{var _0x359e66=new Buffer(_0x5f3c22[_0x3071('0xb')](_0x3071('0x8')),'binary');_0x21aad3[_0x3071('0x9')](_0x359e66);_0x21aad3['end']();_0x21aad3['on'](_0x3071('0xc'),function(){return _0x1f14e1(_0x2fc15d);});}catch(_0x43128c){fs[_0x3071('0x10')](_0x2fc15d);return _0x1caa5d(_0x43128c);}});});};
\ No newline at end of file
diff --git a/server/components/export/csv.js b/server/components/export/csv.js
index 635259c..f292e5c 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 _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
+var _0xedd9=['path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','push','dirname','basename','existsSync','mkdirSync','join','each','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','csv','inspect','Failed'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xedd9,0xfc));var _0x9edd=function(_0x5a63d9,_0x1dfe31){_0x5a63d9=_0x5a63d9-0x0;var _0x3428b3=_0xedd9[_0x5a63d9];return _0x3428b3;};'use strict';var util=require('util');var path=require(_0x9edd('0x0'));var _=require(_0x9edd('0x1'));var csv=require(_0x9edd('0x2'));var fs=require('fs');var BPromise=require(_0x9edd('0x3'));var zipdir=require(_0x9edd('0x4'));var rimraf=require(_0x9edd('0x5'));var db=require(_0x9edd('0x6'))['db'];var dbH=require(_0x9edd('0x6'))['dbH'];var logger=require(_0x9edd('0x7'))(_0x9edd('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x9edd('0x9')][0x2]);var QUERY=process[_0x9edd('0x9')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0xf0b2d8,_0x571af9){var _0x172522={'status':_0xf0b2d8};var _0x190185={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x571af9){_0x172522[_0x9edd('0xa')]=_0x571af9;}return db[_0x9edd('0xb')]['update'](_0x172522,_0x190185);}function main(){var _0x494a24=0x1388;var _0x5d2f90;logger[_0x9edd('0xc')](util[_0x9edd('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9edd('0xe')));return db[_0x9edd('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9edd('0x10'),_0x9edd('0x11')]})[_0x9edd('0x12')](function(_0xfd544a){if(_0xfd544a){_0x5d2f90=_0xfd544a;_0x494a24=_0x5d2f90[_0x9edd('0x11')]||0x1388;}})[_0x9edd('0x12')](function(){return dbH[_0x9edd('0x13')][_0x9edd('0x14')](util['format'](_0x9edd('0x15'),QUERY),{'type':dbH[_0x9edd('0x13')][_0x9edd('0x16')][_0x9edd('0x17')]});})[_0x9edd('0x12')](function(_0x338f3c){if(!_0x338f3c[0x0][_0x9edd('0x18')]){return analyticExtractedReport(_0x9edd('0x19'));}var _0x4ea60f=[];var _0x5f5bf4=0x0;var _0x448996=!![];if(_0x338f3c&&_0x338f3c[_0x9edd('0x1a')]){var _0x5acf65=_0x338f3c[0x0][_0x9edd('0x18')]%(_0x5f5bf4+_0x494a24);if(_0x5d2f90[_0x9edd('0x10')]){for(;_0x448996;_0x5f5bf4+=_0x494a24,_0x5acf65=_0x338f3c[0x0][_0x9edd('0x18')]%(_0x5f5bf4+_0x494a24)){if(_0x5acf65==0x0||_0x5acf65==_0x338f3c[0x0]['num']){_0x448996=![];}_0x4ea60f[_0x9edd('0x1b')](dbH['sequelize'][_0x9edd('0x14')](util[_0x9edd('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x494a24,_0x5f5bf4),{'type':dbH['sequelize'][_0x9edd('0x16')]['SELECT']}));}}else{_0x4ea60f[_0x9edd('0x1b')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x9edd('0x13')][_0x9edd('0x16')]['SELECT']}));}}var _0x5823bc=path[_0x9edd('0x1c')](PATH);var _0x186186=path[_0x9edd('0x1d')](PATH,'.csv');var _0x3741c8=_0x5d2f90[_0x9edd('0x10')]&&_0x4ea60f[_0x9edd('0x1a')]>0x1;var _0x2ca65f=[];if(!fs[_0x9edd('0x1e')](path['join'](_0x5823bc,_0x186186))&&_0x3741c8){fs[_0x9edd('0x1f')](path[_0x9edd('0x20')](_0x5823bc,_0x186186));}return BPromise[_0x9edd('0x21')](_0x4ea60f,function(_0x2f9f86){_0x2ca65f[_0x9edd('0x1b')](_0x2f9f86);})['then'](function(){for(var _0x4b3d1b=0x0;_0x4b3d1b<_0x2ca65f[_0x9edd('0x1a')];_0x4b3d1b+=0x1){var _0xfeca7b;var _0x8d67aa=_0x2ca65f[_0x4b3d1b];if(_0x3741c8){_0xfeca7b=path[_0x9edd('0x20')](_0x5823bc,_0x186186,util[_0x9edd('0xd')]('%s%d.%s',_0x186186,_0x4b3d1b,'csv'));}else{_0xfeca7b=path[_0x9edd('0x20')](_0x5823bc,util[_0x9edd('0xd')](_0x9edd('0x22'),_0x186186,'csv'));}fs[_0x9edd('0x23')](_0xfeca7b,csv(_0x8d67aa));}})[_0x9edd('0x12')](function(){if(_0x3741c8){zipdir(path[_0x9edd('0x20')](_0x5823bc,_0x186186),{'saveTo':path[_0x9edd('0x20')](_0x5823bc,util['format'](_0x9edd('0x22'),_0x186186,_0x9edd('0x24')))},function(_0xbe87e1,_0x12c1bc){});rimraf(path[_0x9edd('0x20')](_0x5823bc,_0x186186),function(){});}})[_0x9edd('0x12')](function(){logger[_0x9edd('0xc')](util[_0x9edd('0xd')](_0x9edd('0x25'),EXTRACTED_REPORT_ID,_0x9edd('0xe')));return analyticExtractedReport(_0x9edd('0x26'),_0x3741c8?util[_0x9edd('0xd')](_0x9edd('0x22'),_0x186186,_0x3741c8?_0x9edd('0x24'):_0x9edd('0x27')):null);});})['catch'](function(_0x1453d2){logger[_0x9edd('0xc')](util[_0x9edd('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9edd('0xe')),util[_0x9edd('0x28')](_0x1453d2,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x9edd('0x29'));});}main();
\ No newline at end of file
diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js
index dc38f95..742454b 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 _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
+var _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x16bc1f,_0x11a31c){var _0x29e4f0=function(_0x4c52f9){while(--_0x4c52f9){_0x16bc1f['push'](_0x16bc1f['shift']());}};_0x29e4f0(++_0x11a31c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var util=require('util');var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x0d8b('0x2'));var zipdir=require(_0x0d8b('0x3'));var rimraf=require(_0x0d8b('0x4'));var db=require(_0x0d8b('0x5'))['db'];var dbH=require(_0x0d8b('0x5'))['dbH'];var logger=require('../../config/logger')(_0x0d8b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0d8b('0x7')][0x2]);var QUERY=process[_0x0d8b('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0d8b('0x7')][0x5];var FORMAT=_0x0d8b('0x8');var _extractedReport;function analyticExtractedReport(_0x58e4e2,_0x129310){var _0x348e65={'status':_0x58e4e2};var _0x3b027f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x129310){_0x348e65[_0x0d8b('0x9')]=_0x129310;}return db[_0x0d8b('0xa')][_0x0d8b('0xb')](_0x348e65,_0x3b027f);}function getHeader(_0x2c5e9e){var _0x28f87c=[];for(var _0x48fa16 in _0x2c5e9e){if(_0x2c5e9e[_0x0d8b('0xc')](_0x48fa16)){_0x28f87c['push']({'text':_0x48fa16,'style':_0x0d8b('0xd')});}}return _0x28f87c;}function extractReport(_0xc574a3){var _0x340cc4=0x1388;var _0x92cdd8;if(!_0xc574a3[0x0][_0x0d8b('0xe')]){return analyticExtractedReport(_0x0d8b('0xf'));}var _0x15dd0f=[];var _0x31a8cc=0x0;var _0x1d4bbc=!![];var _0x2ce75e=path[_0x0d8b('0x10')](PATH);var _0xe65334=path[_0x0d8b('0x11')](PATH,_0x0d8b('0x12'));var _0x4f6f21=![];var _0x23eb7b=[];return db[_0x0d8b('0x13')][_0x0d8b('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0d8b('0x15'),_0x0d8b('0x16')]})['then'](function(_0x106a01){if(_0x106a01){_0x92cdd8=_0x106a01;_0x340cc4=_0x92cdd8[_0x0d8b('0x16')]||0x3e8;}})[_0x0d8b('0x17')](function(){if(_0xc574a3&&_0xc574a3[_0x0d8b('0x18')]){var _0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4);if(_0x92cdd8[_0x0d8b('0x15')]){for(;_0x1d4bbc;_0x31a8cc+=_0x340cc4,_0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4)){if(_0x333674==0x0||_0x333674==_0xc574a3[0x0]['num']){_0x1d4bbc=![];}_0x15dd0f[_0x0d8b('0x19')](dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')](_0x0d8b('0x1d'),QUERY,_0x340cc4,_0x31a8cc),{'type':dbH[_0x0d8b('0x1a')][_0x0d8b('0x1e')][_0x0d8b('0x1f')]}));}}else{_0x15dd0f['push'](dbH['sequelize'][_0x0d8b('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}_0x4f6f21=_0x92cdd8[_0x0d8b('0x15')]&&_0x15dd0f[_0x0d8b('0x18')]>0x1;if(!fs[_0x0d8b('0x20')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334))&&_0x4f6f21){fs[_0x0d8b('0x22')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334));}return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4562cb){_0x23eb7b[_0x0d8b('0x19')](_0x4562cb);});})['then'](function(){return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4463ee,_0x5363e3){var _0xe1ef20;var _0x4a0ae4=util[_0x0d8b('0x1c')](_0x0d8b('0x24'),NAME,_extractedReport[_0x0d8b('0x25')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0d8b('0x26')])[_0x0d8b('0x1c')](FORMAT));var _0x4c05ee={'pageSize':'A4','pageOrientation':_0x0d8b('0x27'),'content':[{'text':_0x4a0ae4,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0d8b('0x28')}}};var _0x4b59e5={'headerRows':0x1,'body':[]};_0x4b59e5[_0x0d8b('0x29')]['push'](getHeader(_0x4463ee[0x0]));var _0x2ab00d;for(var _0x546bf6=0x0;_0x546bf6<_0x4463ee[_0x0d8b('0x18')];_0x546bf6+=0x1){_0x2ab00d=[];for(var _0x544735 in _0x4463ee[_0x546bf6]){if(_0x4463ee[_0x546bf6][_0x0d8b('0xc')](_0x544735)){_0x2ab00d[_0x0d8b('0x19')](_0x4463ee[_0x546bf6][_0x544735]?_[_0x0d8b('0x2a')](_0x4463ee[_0x546bf6][_0x544735]):'');}}_0x4b59e5['body']['push'](_0x2ab00d);}_0x4c05ee['content'][_0x0d8b('0x19')]({'table':_0x4b59e5});return new BPromise(function(_0x5515d2,_0x3cdf3c){var _0x54f6f3=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x0d8b('0x2b'),'italics':__dirname+_0x0d8b('0x2c'),'bolditalics':__dirname+_0x0d8b('0x2d')}});var _0xdeee5d=_0x54f6f3[_0x0d8b('0x2e')](_0x4c05ee);if(_0x4f6f21){_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334,util[_0x0d8b('0x1c')](_0x0d8b('0x2f'),_0xe65334,_0x5363e3,'pdf'));}else{_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')]('%s.%s',_0xe65334,_0x0d8b('0x30')));}var _0x23f7f6=_0xdeee5d[_0x0d8b('0x31')](fs['createWriteStream'](_0xe1ef20));_0x23f7f6['on'](_0x0d8b('0x32'),function(){_0x5515d2();});_0x23f7f6['on'](_0x0d8b('0x33'),function(_0x206157){console[_0x0d8b('0x34')](_0x0d8b('0x35'),_0x206157);_0x3cdf3c(_0x206157);});_0xdeee5d['end']();});});})[_0x0d8b('0x17')](function(){if(_0x4f6f21){return new BPromise(function(_0x1649fc,_0x5ad0fe){zipdir(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),{'saveTo':path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x0d8b('0x37')))},function(_0x519088){if(_0x519088){_0x5ad0fe(_0x519088);}else{_0x1649fc();}});});}})['then'](function(){if(_0x4f6f21){rimraf(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),function(){});}})['then'](function(){logger['info'](util[_0x0d8b('0x1c')](_0x0d8b('0x38'),EXTRACTED_REPORT_ID,_0x0d8b('0x39')));return analyticExtractedReport(_0x0d8b('0x3a'),_0x4f6f21?util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x4f6f21?'zip':_0x0d8b('0x30')):null);});}function main(){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x3c'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')));return db[_0x0d8b('0xa')][_0x0d8b('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1d06b6){_extractedReport=_0x1d06b6;return dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0d8b('0x1a')]['QueryTypes'][_0x0d8b('0x1f')]});})[_0x0d8b('0x17')](extractReport)[_0x0d8b('0x3f')](function(_0x26ac10){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x40'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')),util[_0x0d8b('0x41')](_0x26ac10,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0d8b('0x42'));});}main();
\ No newline at end of file
diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js
index 46314ed..2576cd4 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 _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
+var _0x3a98=['json2xls','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','split','length','num','push','sequelize','dirname','basename','.xlsx','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','util','path','lodash'];(function(_0x5455aa,_0x43f969){var _0x683e42=function(_0x174bae){while(--_0x174bae){_0x5455aa['push'](_0x5455aa['shift']());}};_0x683e42(++_0x43f969);}(_0x3a98,0x84));var _0x83a9=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0x3a98[_0x37b7b6];return _0x10c4c3;};'use strict';var util=require(_0x83a9('0x0'));var path=require(_0x83a9('0x1'));var _=require(_0x83a9('0x2'));var fs=require('fs');var json2xls=require(_0x83a9('0x3'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x83a9('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x83a9('0x5'))[_0x83a9('0x6')];var logger=require(_0x83a9('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x83a9('0x8')][0x2]);var QUERY=process[_0x83a9('0x8')][0x3];var PATH=process[_0x83a9('0x8')][0x4];function analyticExtractedReport(_0x37268e,_0x1eeb84){var _0x814235={'status':_0x37268e};var _0x198987={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1eeb84){_0x814235[_0x83a9('0x9')]=_0x1eeb84;}return db[_0x83a9('0xa')]['update'](_0x814235,_0x198987);}function main(){var _0x2f7eaa=0x1388;var _0x118919;logger['info'](util[_0x83a9('0xb')](_0x83a9('0xc'),EXTRACTED_REPORT_ID,_0x83a9('0xd')));return db[_0x83a9('0xe')][_0x83a9('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x83a9('0x10')]})[_0x83a9('0x11')](function(_0x26ffa0){if(_0x26ffa0){_0x118919=_0x26ffa0;_0x2f7eaa=_0x118919[_0x83a9('0x10')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x83a9('0x12')](util[_0x83a9('0xb')](_0x83a9('0x13'),QUERY),{'type':dbH['sequelize'][_0x83a9('0x14')][_0x83a9('0x15')]});})[_0x83a9('0x11')](function(_0xf7870){if(!_0xf7870[0x0]['num']){return analyticExtractedReport(_0x83a9('0x16'));}var _0x1c9361=[];var _0x3a7ef6=0x0;var _0x50da15=!![];if(_0x118919[_0x83a9('0x17')]){if(_0xf7870&&_0xf7870[_0x83a9('0x18')]){var _0x23d5ca=_0xf7870[0x0]['num']%(_0x3a7ef6+_0x2f7eaa);for(;_0x50da15;_0x3a7ef6+=_0x2f7eaa,_0x23d5ca=_0xf7870[0x0][_0x83a9('0x19')]%(_0x3a7ef6+_0x2f7eaa)){if(_0x23d5ca==0x0||_0x23d5ca==_0xf7870[0x0][_0x83a9('0x19')]){_0x50da15=![];}_0x1c9361[_0x83a9('0x1a')](dbH[_0x83a9('0x1b')][_0x83a9('0x12')](util[_0x83a9('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2f7eaa,_0x3a7ef6),{'type':dbH['sequelize'][_0x83a9('0x14')][_0x83a9('0x15')]}));}}}else{_0x1c9361[_0x83a9('0x1a')](dbH['sequelize'][_0x83a9('0x12')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x83a9('0x15')]}));}var _0x3a161e=path[_0x83a9('0x1c')](PATH);var _0x205b9f=path[_0x83a9('0x1d')](PATH,_0x83a9('0x1e'));var _0x11bd18=_0x118919[_0x83a9('0x17')]&&_0x1c9361[_0x83a9('0x18')]>0x1;var _0x1a0366=[];if(!fs['existsSync'](path[_0x83a9('0x1f')](_0x3a161e,_0x205b9f))&&_0x11bd18){fs[_0x83a9('0x20')](path[_0x83a9('0x1f')](_0x3a161e,_0x205b9f));}return BPromise[_0x83a9('0x21')](_0x1c9361,function(_0x1a680d){_0x1a0366[_0x83a9('0x1a')](_0x1a680d);})[_0x83a9('0x11')](function(){for(var _0x4cf2d3=0x0;_0x4cf2d3<_0x1a0366[_0x83a9('0x18')];_0x4cf2d3+=0x1){var _0x443bae;var _0x195c1d=_0x1a0366[_0x4cf2d3];if(_0x11bd18){_0x443bae=path[_0x83a9('0x1f')](_0x3a161e,_0x205b9f,util[_0x83a9('0xb')](_0x83a9('0x22'),_0x205b9f,_0x4cf2d3,_0x83a9('0x23')));}else{_0x443bae=path[_0x83a9('0x1f')](_0x3a161e,util[_0x83a9('0xb')](_0x83a9('0x24'),_0x205b9f,'xlsx'));}fs[_0x83a9('0x25')](_0x443bae,json2xls(_0x195c1d),'binary');}})[_0x83a9('0x11')](function(){if(_0x11bd18){zipdir(path['join'](_0x3a161e,_0x205b9f),{'saveTo':path[_0x83a9('0x1f')](_0x3a161e,util[_0x83a9('0xb')](_0x83a9('0x24'),_0x205b9f,_0x83a9('0x26')))},function(_0x51edd2,_0x363914){});rimraf(path[_0x83a9('0x1f')](_0x3a161e,_0x205b9f),function(){});}})['then'](function(){logger[_0x83a9('0x27')](util[_0x83a9('0xb')](_0x83a9('0x28'),EXTRACTED_REPORT_ID,_0x83a9('0xd')));return analyticExtractedReport(_0x83a9('0x29'),_0x11bd18?util[_0x83a9('0xb')](_0x83a9('0x24'),_0x205b9f,_0x11bd18?_0x83a9('0x26'):_0x83a9('0x23')):null);});})[_0x83a9('0x2a')](function(_0x542e1c){logger[_0x83a9('0x27')](util[_0x83a9('0xb')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x83a9('0xd')),util[_0x83a9('0x2b')](_0x542e1c,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x83a9('0x2c'));});}main();
\ No newline at end of file
diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js
index efd8bf1..c77a85b 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 _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
+var _0x4559=['Set','format','CDR(type)=%s','context','VoiceExtensionId','outbound','extension','extensions','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','util','models','findAll','then','VoiceExtension','IntervalId','uniq','map','exten','filter','playback','hasOwnProperty','priority','push','type'];(function(_0x381aca,_0x3784a1){var _0x17b285=function(_0x5c6b08){while(--_0x5c6b08){_0x381aca['push'](_0x381aca['shift']());}};_0x17b285(++_0x3784a1);}(_0x4559,0x18f));var _0x9455=function(_0x53e0f9,_0x2c84f0){_0x53e0f9=_0x53e0f9-0x0;var _0x46afe5=_0x4559[_0x53e0f9];return _0x46afe5;};'use strict';var _=require('lodash');var util=require(_0x9455('0x0'));function rewrite(_0x51930f,_0x2b7693){var _0x23d5da=this;return _0x51930f[_0x9455('0x1')]['Interval'][_0x9455('0x2')]({'raw':!![]})[_0x9455('0x3')](function(_0x591b2d){_0x23d5da['intervals']=_0x591b2d;return _0x51930f[_0x9455('0x1')][_0x9455('0x4')][_0x9455('0x2')]({'where':{'IntervalId':_0x2b7693[_0x9455('0x5')]},'raw':!![]});})['then'](function(_0x596ee9){return _0x51930f[_0x9455('0x1')][_0x9455('0x4')][_0x9455('0x2')]({'where':{'exten':{'$in':_[_0x9455('0x6')](_[_0x9455('0x7')](_0x596ee9,_0x9455('0x8')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x9455('0x3')](function(_0x3e60d1){var _0x5e6b9d=_['filter'](_0x3e60d1,{'priority':'1'});var _0x3f15ad=_[_0x9455('0x9')](_0x3e60d1,{'isApp':0x1});var _0x5c38f8=_['groupBy'](_0x3f15ad,_0x9455('0x8'));var _0x4619f1=['queue',_0x9455('0xa')];var _0xee7d87=[];var _0x4bcdce=[];for(var _0x1d2967 in _0x5c38f8){if(_0x5c38f8[_0x9455('0xb')](_0x1d2967)){_0x23d5da[_0x9455('0xc')]=0x2;_0x23d5da['extensions']=[];_0x23d5da['extension']=_['find'](_0x5e6b9d,{'exten':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x8')]});_0x23d5da['extensions'][_0x9455('0xd')]({'type':_0x5c38f8[_0x1d2967][0x0][_0x9455('0xe')],'app':_0x9455('0xf'),'appdata':util[_0x9455('0x10')](_0x9455('0x11'),_0x5c38f8[_0x1d2967][0x0][_0x9455('0xe')]),'context':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x12')],'exten':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x8')],'priority':_0x23d5da[_0x9455('0xc')]++,'VoiceExtensionId':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x13')]});if(_0x5c38f8[_0x1d2967][0x0][_0x9455('0xe')]===_0x9455('0x14')){if(_0x23d5da[_0x9455('0x15')]){_0x23d5da[_0x9455('0x16')][_0x9455('0xd')]({'type':_0x5c38f8[_0x1d2967][0x0]['type'],'app':_0x9455('0xf'),'appdata':_0x9455('0x17')+(_0x23d5da['extension'][_0x9455('0x18')]?'${EXTEN:'+_0x23d5da[_0x9455('0x15')][_0x9455('0x18')]+'}':_0x9455('0x19')),'context':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x12')],'exten':_0x5c38f8[_0x1d2967][0x0]['exten'],'priority':_0x23d5da[_0x9455('0xc')]++,'VoiceExtensionId':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x13')]});}_0x23d5da[_0x9455('0x16')][_0x9455('0xd')]({'type':_0x5c38f8[_0x1d2967][0x0][_0x9455('0xe')],'app':_0x9455('0xf'),'appdata':_0x9455('0x1a')+_0x5c38f8[_0x1d2967][0x0][_0x9455('0x13')],'context':_0x5c38f8[_0x1d2967][0x0]['context'],'exten':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x8')],'priority':_0x23d5da[_0x9455('0xc')]++,'VoiceExtensionId':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x13')]});var _0x44f4d9=_0x23d5da['priority']++;_0x23d5da[_0x9455('0x16')][_0x9455('0xd')]({'type':_0x5c38f8[_0x1d2967][0x0][_0x9455('0xe')],'app':_0x9455('0x1b'),'appdata':_0x9455('0x1c')+(_0x44f4d9+0x2)+'):Goto('+(_0x44f4d9+0x1)+')','context':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x12')],'exten':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x8')],'priority':_0x44f4d9,'VoiceExtensionId':_0x5c38f8[_0x1d2967][0x0]['VoiceExtensionId']});if(_0x23d5da['extension']){_0x23d5da[_0x9455('0x16')][_0x9455('0xd')]({'type':_0x5c38f8[_0x1d2967][0x0][_0x9455('0xe')],'app':_0x9455('0xf'),'appdata':_0x23d5da[_0x9455('0x15')]['cutdigits']?_0x9455('0x1d')+_0x23d5da[_0x9455('0x15')][_0x9455('0x18')]+'}':'CDR(prefix)=noprefix','context':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x12')],'exten':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x8')],'priority':_0x23d5da[_0x9455('0xc')]++,'VoiceExtensionId':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x13')]});}_0x23d5da[_0x9455('0x16')][_0x9455('0xd')]({'type':_0x5c38f8[_0x1d2967][0x0]['type'],'app':_0x9455('0xf'),'appdata':_0x9455('0x1e')+_0x5c38f8[_0x1d2967][0x0][_0x9455('0x13')],'context':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x12')],'exten':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x8')],'priority':_0x23d5da['priority']++,'VoiceExtensionId':_0x5c38f8[_0x1d2967][0x0]['VoiceExtensionId']});if(_0x23d5da[_0x9455('0x15')]&&_0x23d5da[_0x9455('0x15')]['hasOwnProperty']('recordingFormat')&&_0x23d5da[_0x9455('0x15')][_0x9455('0x1f')]!==_0x9455('0x20')){_0x23d5da[_0x9455('0x16')][_0x9455('0xd')]({'type':_0x5c38f8[_0x1d2967][0x0][_0x9455('0xe')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x12')],'exten':_0x5c38f8[_0x1d2967][0x0]['exten'],'priority':_0x23d5da['priority']++,'VoiceExtensionId':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x13')]});_0x23d5da['extensions'][_0x9455('0xd')]({'type':_0x5c38f8[_0x1d2967][0x0][_0x9455('0xe')],'app':_0x9455('0xf'),'appdata':_0x9455('0x21')+_0x23d5da[_0x9455('0x15')][_0x9455('0x1f')]||_0x9455('0x22'),'context':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x12')],'exten':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x8')],'priority':_0x23d5da[_0x9455('0xc')]++,'VoiceExtensionId':_0x5c38f8[_0x1d2967][0x0]['VoiceExtensionId']});}}_0x23d5da[_0x9455('0x16')][_0x9455('0xd')]({'type':_0x5c38f8[_0x1d2967][0x0][_0x9455('0xe')],'app':_0x9455('0xf'),'appdata':_0x9455('0x23'),'context':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x12')],'exten':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x8')],'priority':_0x23d5da[_0x9455('0xc')]++,'VoiceExtensionId':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x13')]});_0x23d5da[_0x9455('0x16')][_0x9455('0xd')]({'type':_0x5c38f8[_0x1d2967][0x0][_0x9455('0xe')],'app':_0x9455('0xf'),'appdata':_0x9455('0x24'),'context':_0x5c38f8[_0x1d2967][0x0]['context'],'exten':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x8')],'priority':_0x23d5da[_0x9455('0xc')]++,'VoiceExtensionId':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x13')]});_0x23d5da[_0x9455('0x16')]['push']({'type':_0x5c38f8[_0x1d2967][0x0]['type'],'app':_0x9455('0xf'),'appdata':_0x9455('0x25'),'context':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x12')],'exten':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x8')],'priority':_0x23d5da[_0x9455('0xc')]++,'VoiceExtensionId':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x13')]});for(var _0x528186=0x0,_0x3df362=0x0;_0x528186<_0x5c38f8[_0x1d2967][_0x9455('0x26')];_0x528186+=0x1,_0x3df362=0x0){var _0x4bea4c=_0x5c38f8[_0x1d2967][_0x528186];if(_0x4bea4c[_0x9455('0xe')]){_0x4bea4c[_0x9455('0xe')]=_0x4bea4c[_0x9455('0xe')][_0x9455('0x27')]();}var _0x41e22c=[];var _0x1d24f5=[];delete _0x4bea4c['id'];delete _0x4bea4c[_0x9455('0x28')];delete _0x4bea4c[_0x9455('0x29')];var _0x21f016=_0x4bea4c[_0x9455('0x2a')]!==_0x9455('0x2b')?[_0x4bea4c[_0x9455('0x2a')]]:_0x4bea4c['IntervalId']?_[_0x9455('0x7')](_[_0x9455('0x9')](_0x23d5da[_0x9455('0x2c')],{'IntervalId':_0x4bea4c[_0x9455('0x5')]}),_0x9455('0x2a')):[];if(_0x4bea4c[_0x9455('0xb')](_0x9455('0x2d'))){if(_0x4bea4c['tag']&&_0x4bea4c[_0x9455('0x2d')]!=='--'){_0x41e22c[_0x9455('0xd')]({'type':_0x4bea4c[_0x9455('0xe')],'app':_0x9455('0xf'),'appdata':_0x9455('0x2e')+_0x4bea4c['tag'],'context':_0x4bea4c[_0x9455('0x12')],'exten':_0x4bea4c[_0x9455('0x8')],'priority':_0x21f016['length']+_0x23d5da[_0x9455('0xc')]+_0x3df362++,'VoiceExtensionId':_0x4bea4c[_0x9455('0x13')]});}}if(_0x4bea4c[_0x9455('0xe')]===_0x9455('0x14')&&_0x4bea4c[_0x9455('0xb')](_0x9455('0x2f'))){if(_0x4bea4c[_0x9455('0x2f')]){_0x41e22c['push']({'type':_0x4bea4c[_0x9455('0xe')],'app':_0x9455('0x1b'),'appdata':_0x9455('0x30')+_0x4bea4c[_0x9455('0x2f')]+')','context':_0x4bea4c['context'],'exten':_0x4bea4c['exten'],'priority':_0x21f016[_0x9455('0x26')]+_0x23d5da[_0x9455('0xc')]+_0x3df362++,'VoiceExtensionId':_0x4bea4c[_0x9455('0x13')]});}else{_0x41e22c[_0x9455('0xd')]({'type':_0x4bea4c['type'],'app':_0x9455('0x1b'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x4bea4c['context'],'exten':_0x4bea4c['exten'],'priority':_0x21f016[_0x9455('0x26')]+_0x23d5da[_0x9455('0xc')]+_0x3df362++,'VoiceExtensionId':_0x4bea4c['VoiceExtensionId']});}}if(_0x4bea4c[_0x9455('0xb')](_0x9455('0x31'))){if(_0x4619f1[_0x9455('0x32')](_0x4bea4c[_0x9455('0x33')][_0x9455('0x27')]())>=0x0&&_0x4bea4c['appType']!==_0x9455('0x34')){if(_0x4bea4c[_0x9455('0x31')]){_0x41e22c['push']({'type':_0x4bea4c[_0x9455('0xe')],'app':_0x9455('0x1b'),'appdata':_0x9455('0x35'),'context':_0x4bea4c[_0x9455('0x12')],'exten':_0x4bea4c[_0x9455('0x8')],'priority':_0x21f016[_0x9455('0x26')]+_0x23d5da['priority']+_0x3df362++,'VoiceExtensionId':_0x4bea4c[_0x9455('0x13')]});_0x41e22c['push']({'type':_0x4bea4c['type'],'app':_0x9455('0xf'),'appdata':_0x9455('0x36'),'context':_0x4bea4c[_0x9455('0x12')],'exten':_0x4bea4c[_0x9455('0x8')],'priority':_0x21f016['length']+_0x23d5da[_0x9455('0xc')]+_0x3df362++,'VoiceExtensionId':_0x4bea4c['VoiceExtensionId']});}else{_0x41e22c['push']({'type':_0x4bea4c['type'],'app':_0x9455('0x1b'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x4bea4c['context'],'exten':_0x4bea4c[_0x9455('0x8')],'priority':_0x21f016[_0x9455('0x26')]+_0x23d5da[_0x9455('0xc')]+_0x3df362++,'VoiceExtensionId':_0x4bea4c[_0x9455('0x13')]});_0x41e22c[_0x9455('0xd')]({'type':_0x4bea4c[_0x9455('0xe')],'app':'Set','appdata':_0x9455('0x37'),'context':_0x4bea4c[_0x9455('0x12')],'exten':_0x4bea4c[_0x9455('0x8')],'priority':_0x21f016[_0x9455('0x26')]+_0x23d5da[_0x9455('0xc')]+_0x3df362++,'VoiceExtensionId':_0x4bea4c[_0x9455('0x13')]});}}}for(var _0x2a34f3=0x0;_0x2a34f3<_0x21f016[_0x9455('0x26')];_0x2a34f3+=0x1){var _0x31404c=_0x23d5da[_0x9455('0xc')]+_0x21f016[_0x9455('0x26')];var _0x552b7d=_0x2a34f3===_0x21f016['length']-0x1?_0x23d5da[_0x9455('0xc')]+_0x41e22c[_0x9455('0x26')]+_0x1d24f5[_0x9455('0x26')]+0x2:_0x23d5da['priority']+_0x2a34f3+0x1;_0x41e22c[_0x9455('0x38')](_0x2a34f3,0x0,{'type':_0x4bea4c[_0x9455('0xe')],'app':_0x9455('0x39'),'appdata':_0x21f016[_0x2a34f3]+'?'+_0x4bea4c[_0x9455('0x12')]+_0x9455('0x3a')+_0x31404c+':'+_0x4bea4c[_0x9455('0x12')]+_0x9455('0x3a')+_0x552b7d,'exten':_0x4bea4c['exten'],'context':_0x4bea4c['context'],'priority':_0x23d5da[_0x9455('0xc')]+_0x2a34f3,'VoiceExtensionId':_0x5c38f8[_0x1d2967][0x0]['VoiceExtensionId']});}_0x4bea4c[_0x9455('0xc')]=_0x41e22c[_0x9455('0x26')]?_[_0x9455('0x3b')](_0x41e22c)[_0x9455('0xc')]+0x1:_0x23d5da[_0x9455('0xc')];_0x23d5da[_0x9455('0xc')]=(_0x1d24f5['length']?_[_0x9455('0x3b')](_0x1d24f5)[_0x9455('0xc')]:_0x4bea4c[_0x9455('0xc')])+0x1;_0x23d5da[_0x9455('0x16')]=_[_0x9455('0x3c')](_0x23d5da[_0x9455('0x16')],_0x41e22c,[_0x4bea4c],_0x1d24f5);}_0x23d5da[_0x9455('0x16')][_0x9455('0xd')]({'type':_0x5c38f8[_0x1d2967][0x0]['type'],'app':_0x9455('0x3d'),'exten':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x8')],'context':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x12')],'priority':_0x23d5da[_0x9455('0xc')],'VoiceExtensionId':_0x5c38f8[_0x1d2967][0x0][_0x9455('0x13')]});_0xee7d87[_0x9455('0xd')](_0x5c38f8[_0x1d2967][0x0][_0x9455('0x13')]);_0x4bcdce=_[_0x9455('0x3c')](_0x4bcdce,_0x23d5da[_0x9455('0x16')]);}}return _0x51930f[_0x9455('0x3e')](function(_0x588c16){return _0x51930f['models'][_0x9455('0x4')][_0x9455('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0xee7d87}},'transaction':_0x588c16})[_0x9455('0x3')](function(_0x5f5173){return _0x51930f['models'][_0x9455('0x4')][_0x9455('0x40')](_[_0x9455('0x41')](_0x4bcdce,'priority'),{'transaction':_0x588c16});});});})[_0x9455('0x42')](function(_0x56a4bb){console[_0x9455('0x43')](_0x56a4bb);});}exports[_0x9455('0x44')]=rewrite;
\ No newline at end of file
diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js
index 10750c1..fd60aac 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 _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
+var _0xd8b0=['find','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','message','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','ListId','toString','NOW()','from','cm_contacts','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ListId\x20=\x20?','id\x20IN\x20?','insert','deletedAt\x20IS\x20NULL','str','cm_hopper_black','VoiceQueue','outbound','Lists','get','dialCheckDuplicateType','always','sequelize','VoiceQueueId','onlyIfOpen','query','all','CmList','Campaign','findAll','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','hasOwnProperty','data','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','email','CompanyId','length'];(function(_0x49b632,_0x4157bc){var _0x481b93=function(_0x4fc3f8){while(--_0x4fc3f8){_0x49b632['push'](_0x49b632['shift']());}};_0x481b93(++_0x4157bc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var socket=require(_0x0d8b('0x9'))(new Redis(config['redis']));require(_0x0d8b('0xa'))[_0x0d8b('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x0d8b('0xc')][0x2]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x2]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0xf'));}var FILEPATH=process[_0x0d8b('0xc')][0x2];if(!process[_0x0d8b('0xc')][0x3]||process[_0x0d8b('0xc')][0x3]==='undefined'||process[_0x0d8b('0xc')][0x3]==='null'||!process[_0x0d8b('0xc')][0x4]||process[_0x0d8b('0xc')][0x4]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x4]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x10'));}var FIELDS=_[_0x0d8b('0x11')](process[_0x0d8b('0xc')][0x3][_0x0d8b('0x12')](','),process[_0x0d8b('0xc')][0x4][_0x0d8b('0x12')](','));if(!process[_0x0d8b('0xc')][0x5]||process[_0x0d8b('0xc')][0x5]===_0x0d8b('0xd')||process['argv'][0x5]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x13'));}var LISTID=process[_0x0d8b('0xc')][0x5];var COMPANYID=process[_0x0d8b('0xc')][0x6]&&process[_0x0d8b('0xc')][0x6]!=='undefined'&&process[_0x0d8b('0xc')][0x6]!==_0x0d8b('0xe')?process[_0x0d8b('0xc')][0x6]:null;var DUPLICATES=process[_0x0d8b('0xc')][0x7]&&process[_0x0d8b('0xc')][0x7]!==_0x0d8b('0xd')&&process[_0x0d8b('0xc')][0x7]!==_0x0d8b('0xe')?process['argv'][0x7]:null;if(!process[_0x0d8b('0xc')][0x8]||process[_0x0d8b('0xc')][0x8]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x8]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x14'));}var SOCKET_TIMESTAMP=process[_0x0d8b('0xc')][0x8];}catch(_0x352c17){logger['error'](_0x352c17);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(_0x4f0a1a,_0x33fb87,_0x54a9a7,_0x56c729){var _0x5527d8={'message':_0x33fb87};_0x5527d8[_0x4f0a1a]=!![];if(_0x54a9a7){_0x5527d8[_0x0d8b('0x15')]=_0x54a9a7;}if(_0x56c729){_0x5527d8[_0x0d8b('0x16')]=_0x56c729;}return _0x5527d8;}function isEmail(_0x214778){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))*$/[_0x0d8b('0x17')](_0x214778);}function checkRow(_0x221071,_0x2c64e2,_0x30980c){return new BPromise(function(_0x4562cb,_0x27b695){if(_['isNil'](_0x221071)){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),_0x0d8b('0x19'),null,_0x30980c));}if(_0x221071['errors']&&_0x221071[_0x0d8b('0x1a')]['length']){var _0x3dd149=_[_0x0d8b('0x1b')](_0x221071[_0x0d8b('0x1a')],'message')['join'](';');return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),_0x3dd149,null,_0x30980c));}var _0x3ef745={};for(var _0x4c05ee in FIELDS){if(FIELDS[_0x0d8b('0x1c')](_0x4c05ee)&&FIELDS[_0x4c05ee]){_0x3ef745[_0x4c05ee]=_0x221071['data'][0x0][FIELDS[_0x4c05ee]]||_0x221071[_0x0d8b('0x1d')][0x0]['\ufeff'+FIELDS[_0x4c05ee]];}}if(!_0x3ef745['firstName']){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'firstName\x20not\x20specified!',null,_0x30980c));}if(!_0x3ef745[_0x0d8b('0x1e')]){return _0x27b695(handleCheckRowError('error',_0x0d8b('0x1f'),null,_0x30980c));}if(_0x3ef745['birthDate']){var _0x3c8887=moment(_0x3ef745[_0x0d8b('0x20')],_0x0d8b('0x21'));if(!_0x3c8887['isValid']()){return _0x27b695(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x30980c));}}if(_0x3ef745[_0x0d8b('0x22')]){if(!isEmail(_0x3ef745['email'])){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'email\x20format\x20is\x20not\x20valid!',null,_0x30980c));}}_0x3ef745['ListId']=LISTID;_0x3ef745[_0x0d8b('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0d8b('0x24')]&&_0x2c64e2){var _0x109c14={};for(var _0xdeee5d=0x0,_0x183220=DUPLICATES[_0x0d8b('0x24')];_0xdeee5d<_0x183220;_0xdeee5d+=0x1){_0x109c14[DUPLICATES[_0xdeee5d]]=_0x3ef745[DUPLICATES[_0xdeee5d]];}var _0x4a99d3=_[_0x0d8b('0x25')](_0x2c64e2,_0x109c14);if(_0x4a99d3){return _0x27b695(handleCheckRowError('duplicate',_0x0d8b('0x26'),_0x4a99d3,_0x30980c));}}return db[_0x0d8b('0x27')]['create'](_0x3ef745,{'raw':!![],'hooks':![],'fields':_[_0x0d8b('0x28')](_0x3ef745)})[_0x0d8b('0x29')](function(_0x18a905){if(DUPLICATES&&DUPLICATES['length']&&_0x2c64e2){_0x2c64e2[_0x0d8b('0x2a')](_[_0x0d8b('0x2b')](_0x3ef745,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x18a905['id'];return _0x4562cb();})[_0x0d8b('0x2c')](function(_0x31ceba){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'Error\x20while\x20creating\x20contact:\x20'+(_0x31ceba[_0x0d8b('0x2d')]||JSON[_0x0d8b('0x2e')](_0x31ceba)),null,_0x30980c));});});}function checkHopper(){function _0x5ad0fe(){return function(_0x1180ac){logger[_0x0d8b('0x18')](_0x0d8b('0x2f'),_0x0d8b('0x30'),util[_0x0d8b('0x31')](_0x1180ac,{'showHidden':![],'depth':null}));};}var _0x519088=function(_0x497a71,_0x41b4f9){var _0x5c2c04=squel['insert']()[_0x0d8b('0x32')](_0x0d8b('0x33'))[_0x0d8b('0x34')]([_0x0d8b('0x1e'),_0x0d8b('0x35'),_0x0d8b('0x36'),'ListId',_0x41b4f9,_0x0d8b('0x37'),_0x0d8b('0x38')],squel[_0x0d8b('0x39')]()[_0x0d8b('0x3a')](_0x0d8b('0x1e'),_0x0d8b('0x1e'))[_0x0d8b('0x3a')]('NOW()',_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID['toString'](),_0x0d8b('0x3b'))['field'](_0x497a71['id'][_0x0d8b('0x3c')](),_0x41b4f9)[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID['toString']())['where'](_0x0d8b('0x41'))[_0x0d8b('0x40')](_0x0d8b('0x42'),squel['select']()['field'](_0x0d8b('0x1e'))[_0x0d8b('0x3e')](_0x0d8b('0x33'))['where'](_0x41b4f9+_0x0d8b('0x43'),_0x497a71['id'][_0x0d8b('0x3c')]())))['toString']();return _0x5c2c04;};var _0x4d7bb0=function(_0x372740,_0x495870){var _0x1e22e5=squel['insert']()['into'](_0x0d8b('0x33'))[_0x0d8b('0x34')](['phone','scheduledAt','ContactId','ListId',_0x495870,_0x0d8b('0x37'),_0x0d8b('0x38')],squel[_0x0d8b('0x39')]()['field'](_0x0d8b('0x1e'),_0x0d8b('0x1e'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))[_0x0d8b('0x3a')](_0x372740['id'][_0x0d8b('0x3c')](),_0x495870)[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')]('cm_contacts')[_0x0d8b('0x40')]('deletedAt\x20IS\x20NULL')['where'](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel['str'](hopperContacts))[_0x0d8b('0x40')](_0x0d8b('0x41'))[_0x0d8b('0x40')](_0x0d8b('0x42'),squel[_0x0d8b('0x39')]()['field']('calleridnum')['from']('cm_hopper_final')[_0x0d8b('0x40')](_0x495870+_0x0d8b('0x43'),_0x372740['id']['toString']()))['where'](_0x0d8b('0x42'),squel[_0x0d8b('0x39')]()['field']('phone')[_0x0d8b('0x3e')](_0x0d8b('0x33'))[_0x0d8b('0x40')](_0x495870+_0x0d8b('0x43'),_0x372740['id'][_0x0d8b('0x3c')]())))['toString']();return _0x1e22e5;};function _0x2de903(_0x2afe34,_0x5481fc){var _0x580580=squel[_0x0d8b('0x46')]()[_0x0d8b('0x32')]('cm_hopper')['fromQuery']([_0x0d8b('0x1e'),_0x0d8b('0x35'),_0x0d8b('0x36'),_0x0d8b('0x3b'),_0x5481fc,'createdAt',_0x0d8b('0x38')],squel['select']()['field'](_0x0d8b('0x1e'),_0x0d8b('0x1e'))['field']('NOW()',_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))[_0x0d8b('0x3a')](_0x2afe34['id'][_0x0d8b('0x3c')](),_0x5481fc)['field'](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')](_0x0d8b('0x47'))['where'](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel[_0x0d8b('0x48')](hopperContacts))['where'](_0x0d8b('0x41')))[_0x0d8b('0x3c')]();return _0x580580;}function _0x181d49(_0x17a87f,_0x1d6cd4){var _0x59ada2=squel['insert']()[_0x0d8b('0x32')](_0x0d8b('0x49'))[_0x0d8b('0x34')]([_0x0d8b('0x1e'),'ContactId',_0x0d8b('0x3b'),_0x1d6cd4,_0x0d8b('0x37'),_0x0d8b('0x38')],squel['select']()[_0x0d8b('0x3a')]('phone',_0x0d8b('0x1e'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))['field'](_0x17a87f['id'][_0x0d8b('0x3c')](),_0x1d6cd4)['field'](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),'updatedAt')[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')](_0x0d8b('0x47'))[_0x0d8b('0x40')](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel[_0x0d8b('0x48')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0d8b('0x3c')]();return _0x59ada2;}return db[_0x0d8b('0x4a')]['findAll']({'where':{'type':_0x0d8b('0x4b')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x0d8b('0x4c'),'where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x4f4b4d){var _0x587128=[];if(_0x4f4b4d){var _0x1900e3;for(var _0x1c007b=0x0,_0x70e4b2;_0x1c007b<_0x4f4b4d[_0x0d8b('0x24')];_0x1c007b+=0x1){_0x70e4b2=_0x4f4b4d[_0x1c007b][_0x0d8b('0x4d')]({'plain':!![]});switch(_0x70e4b2[_0x0d8b('0x4e')]){case _0x0d8b('0x4f'):_0x587128['push'](db[_0x0d8b('0x50')]['query'](_0x4d7bb0(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;case _0x0d8b('0x52'):_0x587128['push'](db[_0x0d8b('0x50')]['query'](_0x519088(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;default:_0x587128[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x2de903(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}}return _0x587128;})[_0x0d8b('0x54')]()['then'](function(){return db[_0x0d8b('0x4a')]['findAll']({'where':{'type':_0x0d8b('0x4b')},'attributes':['id'],'include':[{'model':db[_0x0d8b('0x55')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x56e03c){var _0x10c318=[];if(_0x56e03c){var _0x445a00;for(var _0x24f75=0x0,_0x259ac9;_0x24f75<_0x56e03c[_0x0d8b('0x24')];_0x24f75+=0x1){_0x259ac9=_0x56e03c[_0x24f75][_0x0d8b('0x4d')]({'plain':!![]});_0x10c318[_0x0d8b('0x2a')](db[_0x0d8b('0x50')]['query'](_0x181d49(_0x259ac9,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})['catch'](_0x5ad0fe()));}}return _0x10c318;})[_0x0d8b('0x54')]();})[_0x0d8b('0x29')](function(){return db[_0x0d8b('0x56')][_0x0d8b('0x57')]({'attributes':['id',_0x0d8b('0x4e')],'include':[{'model':db[_0x0d8b('0x55')],'as':_0x0d8b('0x4c'),'where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x466082){var _0x5007c0=[];if(_0x466082){for(var _0xe35028=0x0,_0x16df83;_0xe35028<_0x466082['length'];_0xe35028+=0x1){_0x16df83=_0x466082[_0xe35028][_0x0d8b('0x4d')]({'plain':!![]});switch(_0x16df83[_0x0d8b('0x4e')]){case _0x0d8b('0x4f'):_0x5007c0['push'](db['sequelize'][_0x0d8b('0x53')](_0x4d7bb0(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})['catch'](_0x5ad0fe()));break;case'onlyIfOpen':_0x5007c0[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x519088(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;default:_0x5007c0[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x2de903(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}}return _0x5007c0;})[_0x0d8b('0x54')]();})['then'](function(){return db[_0x0d8b('0x56')][_0x0d8b('0x57')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x1dad9f){var _0x3573b4=[];if(_0x1dad9f){for(var _0x14b1b8=0x0,_0x23e2e0;_0x14b1b8<_0x1dad9f[_0x0d8b('0x24')];_0x14b1b8+=0x1){_0x23e2e0=_0x1dad9f[_0x14b1b8]['get']({'plain':!![]});_0x3573b4['push'](db['sequelize'][_0x0d8b('0x53')](_0x181d49(_0x23e2e0,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}return _0x3573b4;})[_0x0d8b('0x54')]();})[_0x0d8b('0x2c')](function(_0x5ef461){logger[_0x0d8b('0x18')](_0x0d8b('0x59'),'generalCheckHopper',_0x5ef461[_0x0d8b('0x2d')]);});}var processPromises=function(_0x57e3c2){return BPromise[_0x0d8b('0x54')](promises)[_0x0d8b('0x29')](function(_0x9dfa5a){})[_0x0d8b('0x2c')](function(_0x10c7ab){logger[_0x0d8b('0x18')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x2e')](_0x10c7ab));})[_0x0d8b('0x5b')](function(){socket[_0x0d8b('0x5c')](_0x0d8b('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x57e3c2){return _0x57e3c2[_0x0d8b('0x5e')]();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x0d8b('0x29')](function(){socket[_0x0d8b('0x5c')](_0x0d8b('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0d8b('0x5f')](FILEPATH);}catch(_0xf91ecd){logger[_0x0d8b('0x18')](_0x0d8b('0x60'),JSON['stringify'](_0xf91ecd));}finally{process[_0x0d8b('0x61')](0x0);}});};process['on']('SIGINT',function(){logger[_0x0d8b('0x62')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0x0d8b('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0d8b('0x12')](',');return db[_0x0d8b('0x27')][_0x0d8b('0x57')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x0d8b('0x29')](function(_0x2eece2){var _0x3c7b9b=fs[_0x0d8b('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0d8b('0x64')](_0x3c7b9b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x20a8b6,_0x3a6014){total+=0x1;var _0x180539=total;promises['push'](checkRow(_0x20a8b6,_0x2eece2,_0x180539)[_0x0d8b('0x29')](function(){success+=0x1;})[_0x0d8b('0x2c')](function(_0x8be77c){if(_0x8be77c['error']){errors+=0x1;delete _0x8be77c['error'];}else if(_0x8be77c[_0x0d8b('0x65')]){duplicates+=0x1;delete _0x8be77c[_0x0d8b('0x65')];}rows[_0x0d8b('0x2a')](_0x8be77c);}));if(total%0xc8===0x0){_0x3a6014[_0x0d8b('0x66')]();return processPromises(_0x3a6014);}},'complete':function(){return processPromises()[_0x0d8b('0x29')](function(){logger[_0x0d8b('0x62')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x1a96ce,_0x3d6267){logger[_0x0d8b('0x62')](_0x0d8b('0x67'),JSON[_0x0d8b('0x2e')](_0x1a96ce));endCsv();}});})['catch'](function(_0x4dbcfc){logger[_0x0d8b('0x18')](_0x0d8b('0x68'),JSON[_0x0d8b('0x2e')](_0x4dbcfc));});}main();
\ No newline at end of file
diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js
index e51d2c6..ea46b46 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(_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
+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(_0x524be8,_0x17d4a8){var _0x462bc6=function(_0x36e483){while(--_0x36e483){_0x524be8['push'](_0x524be8['shift']());}};_0x462bc6(++_0x17d4a8);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 9e3a11a..90cabb1 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 _0xa561=['binding\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','bluebird','squel','ioredis','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','then','catch','message','all','split','filter','findOne','CmContactHasItem','updated','create','PHONE','inserted','CmContact','CmHopper','phone','cm_contacts.phone','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','updatedAt','priority','UserId','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_contacts.createdAt','cm_contacts.updatedAt','insert','cm_hopper_black','fromQuery','ContactId','ListId','createdAt','fields','cm_contacts','cm_contacts.createdAt\x20=\x20?','\x20=\x20?','toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','group','info','error','query','main','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','header','parse','createReadStream','data','errors','find','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','SystemRow','appendFileSync','rows','emit','Abort\x20parser','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','each','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','finish','contact:import:','unlink','exit','complete','argv','arguments\x20\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_0x4066eb[_0x03a5('0x68')]===_0x193248);if(_[_0x03a5('0x1a')](_0x2550fc)){if(_0x1cabce[_0x03a5('0x70')](_0x193248)){if(_0x2f269d['data'][_0x2726e1][_0x1cabce[_0x193248]]){var _0x464223=_[_0x03a5('0x71')](_0x2f269d[_0x03a5('0x6d')][_0x2726e1][_0x1cabce[_0x193248]][_0x03a5('0x72')](/"/g,'\x27'));switch(_0x193248){case _0x03a5('0x33'):var _0x5b0f2b=moment(_0x464223,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x5b0f2b['isValid']()){_0x4e8cd5[_0x03a5('0x1d')]('\x22'+_0x464223+'\x22');}else{_0x5aef2d['push'](_0x03a5('0x73'));}break;case _0x03a5('0x37'):var _0x701468=parseInt(_0x464223);_0x464223=_[_0x03a5('0x74')](_0x701468)||_0x701468<0x0||_0x701468>0x4?_0x1c59b0?0x3:0x2:_0x701468;_0x4e8cd5[_0x03a5('0x1d')]('\x22'+_0x464223+'\x22');break;case _0x03a5('0x75'):var _0x32d00d=parseInt(_0x464223);if(_[_0x03a5('0x76')](_0x32d00d)&&_[_0x03a5('0x77')](_0xf983bb,_0x32d00d)){_0x4e8cd5[_0x03a5('0x1d')]('\x22'+_0x32d00d+'\x22');}else{_0x5aef2d[_0x03a5('0x1d')](_0x03a5('0x78'));}break;case _0x03a5('0x79'):if(isEmail(_0x464223)){_0x4e8cd5[_0x03a5('0x1d')]('\x22'+_0x464223+'\x22');}else{_0x5aef2d[_0x03a5('0x1d')](_0x03a5('0x7a'));}break;case'dateOfBirth':var _0x2a2371=moment(_0x464223,'YYYY-MM-DD',!![]);if(_0x2a2371[_0x03a5('0x7b')]()){_0x4e8cd5[_0x03a5('0x1d')]('\x22'+_0x464223+'\x22');}else{_0x5aef2d[_0x03a5('0x1d')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x4e8cd5[_0x03a5('0x1d')]('\x22'+_0x464223+'\x22');}}else{switch(_0x193248){case _0x03a5('0x7c'):case _0x03a5('0x1b'):_0x5aef2d[_0x03a5('0x1d')](_0x193248+_0x03a5('0x7d'));break;default:_0x4e8cd5['push']('\x22\x22');}}}}else{var _0x3d4a62='';for(var _0x4433d1=0x0;_0x4433d1<_0x1cabce[_0x193248][_0x03a5('0x19')];_0x4433d1++){var _0x464223=_[_0x03a5('0x71')](_0x2f269d['data'][_0x2726e1][_0x1cabce[_0x193248][_0x4433d1]][_0x03a5('0x72')](/"/g,'\x27'));if(_0x3d4a62=='')_0x3d4a62=_0x464223;else _0x3d4a62+='|'+_0x464223;}_0x599089[_0x03a5('0x1d')](_0x2550fc['id']+':'+_0x3d4a62);}}if(hasAdditionalPhones){_0x4e8cd5[_0x03a5('0x1d')]('\x22'+_0x599089[_0x03a5('0x14')](';')+'\x22');}if(_0x5aef2d[_0x03a5('0x19')]){handleError(_0x2f269d['data'][_0x2726e1],{'code':_0x03a5('0x7e'),'message':_0x5aef2d[_0x03a5('0x14')]()});}else{fs['appendFileSync'](_0x42a683,_0x4e8cd5[_0x03a5('0x14')]()+'\x0a');}_0x4e8cd5=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0x03a5('0x7f')+_0x460193,stats);stats[_0x03a5('0x5e')]=[];}}if(stopped){logger[_0x03a5('0x5b')](_0x03a5('0x80'));_0x450559['abort']();}}catch(_0x2a52a8){handleError(_0x2f269d[_0x03a5('0x6d')][_0x2726e1],{'code':_0x03a5('0x81'),'message':_0x2a52a8[_0x03a5('0x21')]});logger[_0x03a5('0x5d')](_0x03a5('0x82'),_0x2a52a8[_0x03a5('0x21')]);}},'complete':function(){try{var _0x380ee4=[];var _0x57859f=tempTableName;_0x380ee4[_0x03a5('0x1d')](_0x03a5('0x83')+_0x57859f+_0x03a5('0x84'));logger['info'](_0x03a5('0x85'),contactItemTypes[_0x03a5('0x19')]);var _0x22bc84=util['format']('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',_0x42a683,_0x57859f,_0x5dbc73,_0x2c20dd[_0x03a5('0x45')],_0x2c20dd[_0x03a5('0x54')]||null,NOW,NOW);if(_[_0x03a5('0x1a')](_0x1cabce['scheduledat'])){_0x22bc84+=_0x03a5('0x86');}_0x380ee4[_0x03a5('0x1d')](_0x22bc84);BPromise[_0x03a5('0x87')](_0x380ee4,handleQuery)[_0x03a5('0x1f')](function(_0x36db15){BPromise[_0x03a5('0x1e')]([handleAdditionalPhones()])['then'](function(){_0x380ee4=[];for(var _0x2ba6b9=0x0;_0x2ba6b9\x20\x20');}var _0x4ab5d0=path['join'](config['root'],_0x03a5('0x93'),process[_0x03a5('0x92')][0x2]);if(!fs[_0x03a5('0x94')](_0x4ab5d0)){throw new Error(_0x03a5('0x95'));}var _0xb55d7b={};try{_0xb55d7b=JSON[_0x03a5('0x6b')](process[_0x03a5('0x92')][0x3]);if(!_0xb55d7b[_0x03a5('0x96')]){throw new Error(_0x03a5('0x97'));}var _0x5e9ddf=0x0;if(_0xb55d7b['binding'][_0x03a5('0x75')]){_0x5e9ddf=0x1;}if(!_0xb55d7b['ListId']){throw new Error(_0x03a5('0x98'));}}catch(_0x157baf){throw new Error(_0x03a5('0x99'));}var _0x13a90e=[];try{_0x13a90e=_['map'](JSON[_0x03a5('0x6b')](process[_0x03a5('0x92')][0x4]),'id');}catch(_0xcbaf1b){logger[_0x03a5('0x5b')](_0x03a5('0x9a'));}main(_0x4ab5d0,_0xb55d7b,_0x13a90e,_0x5e9ddf);}validate();process['on']('SIGINT',handleStop);process['on'](_0x03a5('0x9b'),handleUncaughtException);
\ No newline at end of file
diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js
index e6cd4d6..c2cc5d2 100644
--- a/server/components/integrations/configuration.js
+++ b/server/components/integrations/configuration.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xea28=['push','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','holdtime','talktime','Called\x20Number','starttime','answertime','Duration','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xea28,0x13a));var _0x8ea2=function(_0x553b74,_0x314ec1){_0x553b74=_0x553b74-0x0;var _0x191e77=_0xea28[_0x553b74];return _0x191e77;};'use strict';exports[_0x8ea2('0x0')]=function(_0x2e031a,_0x389e8f){var _0x26155f=[{'type':_0x8ea2('0x1'),'content':_0x8ea2('0x2'),'variableName':null}];switch(_0x2e031a[_0x8ea2('0x3')]()){case _0x8ea2('0x4'):switch(_0x389e8f['toLowerCase']()){case _0x8ea2('0x5'):_0x26155f[_0x8ea2('0x6')]({'type':_0x8ea2('0x7'),'content':'','variableName':'queue'});_0x26155f[_0x8ea2('0x6')]({'type':_0x8ea2('0x7'),'content':'','variableName':_0x8ea2('0x8')});break;case _0x8ea2('0x9'):_0x26155f[_0x8ea2('0x6')]({'type':_0x8ea2('0x1'),'content':_0x8ea2('0xa'),'variableName':null});_0x26155f[_0x8ea2('0x6')]({'type':_0x8ea2('0x7'),'content':'','variableName':_0x8ea2('0xb')});break;}}return _0x26155f;};exports[_0x8ea2('0xc')]=function(_0x21ae3d,_0x500b82){var _0x4da3b1=[];switch(_0x21ae3d[_0x8ea2('0x3')]()){case _0x8ea2('0x4'):switch(_0x500b82[_0x8ea2('0x3')]()){case'inbound':_0x4da3b1=[{'type':_0x8ea2('0x1'),'content':_0x8ea2('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0xf'),'keyType':_0x8ea2('0x7'),'variableName':'calleridnum'},{'type':_0x8ea2('0xe'),'content':'','key':'Caller\x20Name','keyType':'variable','variableName':_0x8ea2('0x10')},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x11'),'keyType':_0x8ea2('0x7'),'variableName':_0x8ea2('0x12')},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x13'),'keyType':_0x8ea2('0x7'),'variableName':_0x8ea2('0x14')},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x15'),'keyType':_0x8ea2('0x7'),'variableName':_0x8ea2('0x16')},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x17'),'keyType':_0x8ea2('0x7'),'variableName':_0x8ea2('0x18')},{'type':_0x8ea2('0x1'),'content':_0x8ea2('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x1a'),'keyType':_0x8ea2('0x7'),'variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0x8ea2('0x1b'),'keyType':_0x8ea2('0x7'),'variableName':_0x8ea2('0xb')},{'type':'string','content':_0x8ea2('0x1c'),'key':null,'keyType':null,'variableName':null},{'type':_0x8ea2('0xe'),'content':'','key':'Agent\x20Ring','keyType':_0x8ea2('0x7'),'variableName':_0x8ea2('0x18')},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x1d'),'keyType':_0x8ea2('0x7'),'variableName':_0x8ea2('0x1e')},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x1f'),'keyType':_0x8ea2('0x7'),'variableName':'agentcompleteAt'},{'type':_0x8ea2('0xe'),'content':'','key':'Hold\x20Time','keyType':_0x8ea2('0x7'),'variableName':_0x8ea2('0x20')},{'type':_0x8ea2('0xe'),'content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0x8ea2('0x21')}];break;case'outbound':_0x4da3b1=[{'type':_0x8ea2('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x22'),'keyType':_0x8ea2('0x7'),'keyContent':'','variableName':_0x8ea2('0xb')},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0x8ea2('0x7'),'keyContent':'','variableName':'membername'},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x15'),'keyType':_0x8ea2('0x7'),'keyContent':'','variableName':_0x8ea2('0x16')},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x17'),'keyType':_0x8ea2('0x7'),'keyContent':'','variableName':_0x8ea2('0x23')},{'type':_0x8ea2('0x1'),'content':_0x8ea2('0x1c')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':_0x8ea2('0x7'),'keyContent':'','variableName':_0x8ea2('0x24')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0x8ea2('0x7'),'keyContent':'','variableName':'endtime'},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x25'),'keyType':'variable','keyContent':'','variableName':_0x8ea2('0x26')},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x27'),'keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x4da3b1;};
\ No newline at end of file
+var _0x9e6b=['Agent\x20Number','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','Member\x20Name','membername','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','endtime','Duration','billableseconds','getSubjects','toLowerCase','voice','inbound','variable','queue','push','calleridnum','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','string','Agent\x20Name','destcalleridname'];(function(_0x4b9ce2,_0x77d78d){var _0xf08df4=function(_0xcc90fd){while(--_0xcc90fd){_0x4b9ce2['push'](_0x4b9ce2['shift']());}};_0xf08df4(++_0x77d78d);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9e6b[_0x4b055c];return _0x4b62bb;};'use strict';exports[_0xb9e6('0x0')]=function(_0x1951a0,_0x5373ce){var _0x3c06fe=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x1951a0[_0xb9e6('0x1')]()){case _0xb9e6('0x2'):switch(_0x5373ce[_0xb9e6('0x1')]()){case _0xb9e6('0x3'):_0x3c06fe['push']({'type':_0xb9e6('0x4'),'content':'','variableName':_0xb9e6('0x5')});_0x3c06fe[_0xb9e6('0x6')]({'type':'variable','content':'','variableName':_0xb9e6('0x7')});break;case'outbound':_0x3c06fe['push']({'type':'string','content':_0xb9e6('0x8'),'variableName':null});_0x3c06fe['push']({'type':_0xb9e6('0x4'),'content':'','variableName':_0xb9e6('0x9')});break;}}return _0x3c06fe;};exports[_0xb9e6('0xa')]=function(_0x3e18bf,_0x40d57b){var _0x43e8c8=[];switch(_0x3e18bf[_0xb9e6('0x1')]()){case _0xb9e6('0x2'):switch(_0x40d57b[_0xb9e6('0x1')]()){case _0xb9e6('0x3'):_0x43e8c8=[{'type':'string','content':_0xb9e6('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xb9e6('0xc'),'content':'','key':_0xb9e6('0xd'),'keyType':_0xb9e6('0x4'),'variableName':'calleridnum'},{'type':_0xb9e6('0xc'),'content':'','key':_0xb9e6('0xe'),'keyType':'variable','variableName':'calleridname'},{'type':_0xb9e6('0xc'),'content':'','key':_0xb9e6('0xf'),'keyType':_0xb9e6('0x4'),'variableName':_0xb9e6('0x10')},{'type':'keyValue','content':'','key':_0xb9e6('0x11'),'keyType':_0xb9e6('0x4'),'variableName':_0xb9e6('0x5')},{'type':_0xb9e6('0xc'),'content':'','key':_0xb9e6('0x12'),'keyType':_0xb9e6('0x4'),'variableName':_0xb9e6('0x13')},{'type':_0xb9e6('0xc'),'content':'','key':_0xb9e6('0x14'),'keyType':_0xb9e6('0x4'),'variableName':'agentcalledAt'},{'type':_0xb9e6('0x15'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xb9e6('0xc'),'content':'','key':_0xb9e6('0x16'),'keyType':_0xb9e6('0x4'),'variableName':_0xb9e6('0x17')},{'type':'keyValue','content':'','key':_0xb9e6('0x18'),'keyType':_0xb9e6('0x4'),'variableName':_0xb9e6('0x9')},{'type':_0xb9e6('0x15'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Ring','keyType':_0xb9e6('0x4'),'variableName':_0xb9e6('0x19')},{'type':'keyValue','content':'','key':_0xb9e6('0x1a'),'keyType':'variable','variableName':_0xb9e6('0x1b')},{'type':_0xb9e6('0xc'),'content':'','key':_0xb9e6('0x1c'),'keyType':_0xb9e6('0x4'),'variableName':_0xb9e6('0x1d')},{'type':'keyValue','content':'','key':_0xb9e6('0x1e'),'keyType':_0xb9e6('0x4'),'variableName':_0xb9e6('0x1f')},{'type':_0xb9e6('0xc'),'content':'','key':_0xb9e6('0x20'),'keyType':'variable','variableName':_0xb9e6('0x21')}];break;case _0xb9e6('0x22'):_0x43e8c8=[{'type':_0xb9e6('0x15'),'content':_0xb9e6('0xb'),'variableName':null},{'type':'keyValue','content':'','key':_0xb9e6('0x23'),'keyType':_0xb9e6('0x4'),'keyContent':'','variableName':_0xb9e6('0x9')},{'type':_0xb9e6('0xc'),'content':'','key':_0xb9e6('0x24'),'keyType':_0xb9e6('0x4'),'keyContent':'','variableName':_0xb9e6('0x25')},{'type':_0xb9e6('0xc'),'content':'','key':'UniqueId','keyType':_0xb9e6('0x4'),'keyContent':'','variableName':_0xb9e6('0x13')},{'type':'keyValue','content':'','key':_0xb9e6('0x14'),'keyType':_0xb9e6('0x4'),'keyContent':'','variableName':'starttime'},{'type':_0xb9e6('0x15'),'content':_0xb9e6('0x26')},{'type':_0xb9e6('0xc'),'content':'','key':_0xb9e6('0x27'),'keyType':_0xb9e6('0x4'),'keyContent':'','variableName':_0xb9e6('0x28')},{'type':_0xb9e6('0xc'),'content':'','key':'Complete\x20Time','keyType':_0xb9e6('0x4'),'keyContent':'','variableName':_0xb9e6('0x29')},{'type':'keyValue','content':'','key':_0xb9e6('0x2a'),'keyType':_0xb9e6('0x4'),'keyContent':'','variableName':'duration'},{'type':_0xb9e6('0xc'),'content':'','key':'Billable\x20Time','keyType':_0xb9e6('0x4'),'keyContent':'','variableName':_0xb9e6('0x2b')}];break;}}return _0x43e8c8;};
\ No newline at end of file
diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js
index cf794e5..4ef3d76 100644
--- a/server/components/interaction/service.js
+++ b/server/components/interaction/service.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb079=['upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','catch','error','tracked','query','body','omit','phone','fax','mobile','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions'];(function(_0x59525e,_0x5de429){var _0x7036b1=function(_0x1bedda){while(--_0x1bedda){_0x59525e['push'](_0x59525e['shift']());}};_0x7036b1(++_0x5de429);}(_0xb079,0x1c9));var _0x9b07=function(_0x30b4f5,_0x33819c){_0x30b4f5=_0x30b4f5-0x0;var _0x10f788=_0xb079[_0x30b4f5];return _0x10f788;};'use strict';var _=require('lodash');var db=require(_0x9b07('0x0'))['db'];var loggers={'openchannel':require(_0x9b07('0x1'))(_0x9b07('0x2')),'mail':require(_0x9b07('0x1'))(_0x9b07('0x3')),'fax':require(_0x9b07('0x1'))(_0x9b07('0x4')),'sms':require(_0x9b07('0x1'))(_0x9b07('0x5')),'chat':require(_0x9b07('0x1'))(_0x9b07('0x6')),'whatsapp':require('../../config/logger')(_0x9b07('0x7'))};function getInteractionId(_0x2be1ef,_0x54d030,_0x17a4bc){if(_0x2be1ef&&_0x2be1ef[_['upperFirst'](_0x17a4bc)+'InteractionId']){return _0x2be1ef[_[_0x9b07('0x8')](_0x17a4bc)+_0x9b07('0x9')];}else if(_0x2be1ef&&_0x2be1ef['id']){return _0x2be1ef['id'];}else if(_0x54d030&&_0x54d030['id']){return _0x54d030['id'];}else{return _0x9b07('0xa');}}function log(_0x36e641,_0x5e01dc,_0x42ed3b,_0x1a88fe,_0x1453ca,_0x19405a){loggers[_0x1453ca[_0x9b07('0xb')]()][_0x36e641](_0x9b07('0xc'),_0x19405a[_0x9b07('0xd')](),_0x5e01dc?_0x5e01dc['id']:null,_0x5e01dc?_0x5e01dc[_0x9b07('0xe')]:null,_0x5e01dc?_0x5e01dc[_0x9b07('0xf')]:null,getInteractionId(_0x42ed3b,_0x1a88fe,_0x1453ca),_0x42ed3b?JSON[_0x9b07('0x10')](_0x42ed3b):_0x9b07('0x11'));}function updateUser(_0x28af25,_0x177cdd,_0x59d6b7,_0x5eacb7,_0x14d026){db[_[_0x9b07('0x8')](_0x5eacb7)+_0x9b07('0x12')][_0x9b07('0x13')]({'where':{'id':getInteractionId(_0x177cdd,_0x59d6b7,_0x5eacb7)}})[_0x9b07('0x14')](function(_0x558049){if(_0x558049){return _0x558049[_0x9b07('0x15')]({'UserId':_0x28af25?_0x28af25['id']:null});}})[_0x9b07('0x14')](function(_0x18eda4){if(_0x18eda4){log('info',_0x28af25,_0x177cdd,_0x59d6b7,_0x5eacb7,_0x14d026);}})[_0x9b07('0x16')](function(){log(_0x9b07('0x17'),_0x28af25,_0x177cdd,_0x59d6b7,_0x5eacb7,_0x14d026);});}exports[_0x9b07('0x18')]=function(_0x130668,_0x38f77c){return function(_0x131dd2,_0x1dfbf1,_0x220bd3){var _0x4cae3d=_0x131dd2['user'];var _0xf8027e={};var _0x5e1766=_0x131dd2[_0x9b07('0x19')];if(_0xf8027e){_0xf8027e=_['clone'](_0x131dd2[_0x9b07('0x1a')]);_0xf8027e=_[_0x9b07('0x1b')](_0xf8027e,[_0x9b07('0x1a'),'html',_0x9b07('0x1c'),_0x9b07('0x1d'),_0x9b07('0x1e')]);}updateUser(_0x4cae3d,_0xf8027e,_0x5e1766,_0x130668,_0x38f77c);_0x220bd3(null);};};
\ No newline at end of file
+var _0x6b8f=['stringify','Interaction','then','update','info','catch','user','query','body','html','phone','mobile','../../mysqldb','openchannel-interactions','../../config/logger','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','unknown','toUpperCase','name','role'];(function(_0x3d6926,_0xb46556){var _0x1675cd=function(_0x1b9557){while(--_0x1b9557){_0x3d6926['push'](_0x3d6926['shift']());}};_0x1675cd(++_0xb46556);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x3ae646,_0x47dc4a){_0x3ae646=_0x3ae646-0x0;var _0x7f8e35=_0x6b8f[_0x3ae646];return _0x7f8e35;};'use strict';var _=require('lodash');var db=require(_0xf6b8('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xf6b8('0x1')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0xf6b8('0x2'))(_0xf6b8('0x3')),'sms':require('../../config/logger')(_0xf6b8('0x4')),'chat':require(_0xf6b8('0x2'))(_0xf6b8('0x5')),'whatsapp':require('../../config/logger')(_0xf6b8('0x6'))};function getInteractionId(_0x79c66d,_0x446336,_0x3c3430){if(_0x79c66d&&_0x79c66d[_['upperFirst'](_0x3c3430)+'InteractionId']){return _0x79c66d[_[_0xf6b8('0x7')](_0x3c3430)+'InteractionId'];}else if(_0x79c66d&&_0x79c66d['id']){return _0x79c66d['id'];}else if(_0x446336&&_0x446336['id']){return _0x446336['id'];}else{return _0xf6b8('0x8');}}function log(_0x7ac5fd,_0x16a799,_0x3e6712,_0x21734d,_0x162938,_0x55dad4){loggers[_0x162938['toLowerCase']()][_0x7ac5fd]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x55dad4[_0xf6b8('0x9')](),_0x16a799?_0x16a799['id']:null,_0x16a799?_0x16a799[_0xf6b8('0xa')]:null,_0x16a799?_0x16a799[_0xf6b8('0xb')]:null,getInteractionId(_0x3e6712,_0x21734d,_0x162938),_0x3e6712?JSON[_0xf6b8('0xc')](_0x3e6712):'null');}function updateUser(_0x4e5235,_0x748e77,_0x3899a9,_0x5104d3,_0xfcecc9){db[_[_0xf6b8('0x7')](_0x5104d3)+_0xf6b8('0xd')]['findOne']({'where':{'id':getInteractionId(_0x748e77,_0x3899a9,_0x5104d3)}})[_0xf6b8('0xe')](function(_0x53d744){if(_0x53d744){return _0x53d744[_0xf6b8('0xf')]({'UserId':_0x4e5235?_0x4e5235['id']:null});}})[_0xf6b8('0xe')](function(_0x2e1748){if(_0x2e1748){log(_0xf6b8('0x10'),_0x4e5235,_0x748e77,_0x3899a9,_0x5104d3,_0xfcecc9);}})[_0xf6b8('0x11')](function(){log('error',_0x4e5235,_0x748e77,_0x3899a9,_0x5104d3,_0xfcecc9);});}exports['tracked']=function(_0x3bb9ae,_0x56508b){return function(_0x3cf63c,_0x206a84,_0x4a93a8){var _0x58cd71=_0x3cf63c[_0xf6b8('0x12')];var _0x2e2b29={};var _0x3081db=_0x3cf63c[_0xf6b8('0x13')];if(_0x2e2b29){_0x2e2b29=_['clone'](_0x3cf63c['body']);_0x2e2b29=_['omit'](_0x2e2b29,[_0xf6b8('0x14'),_0xf6b8('0x15'),_0xf6b8('0x16'),'fax',_0xf6b8('0x17')]);}updateUser(_0x58cd71,_0x2e2b29,_0x3081db,_0x3bb9ae,_0x56508b);_0x4a93a8(null);};};
\ No newline at end of file
diff --git a/server/components/license/service.js b/server/components/license/service.js
index 041ae5e..415d8d1 100644
--- a/server/components/license/service.js
+++ b/server/components/license/service.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-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
+var _0x037c=['createDecipher','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','json','users','User','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split'];(function(_0x40b8c4,_0x19b74f){var _0x15391f=function(_0x270009){while(--_0x270009){_0x40b8c4['push'](_0x40b8c4['shift']());}};_0x15391f(++_0x19b74f);}(_0x037c,0x95));var _0xc037=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x037c[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0xc037('0x0'));var util=require(_0xc037('0x1'));var compose=require('composable-middleware');var db=require(_0xc037('0x2'))['db'];var config=require(_0xc037('0x3'));function getValueFromLicense(_0x4c55b5,_0x478fe){if(_0x4c55b5&&_0x478fe){if(_0x478fe[_0xc037('0x4')]&&_0x478fe['license']){var _0x28eeef=_0x478fe[_0xc037('0x4')];var _0x2e8966=_0x478fe[_0xc037('0x5')];var _0x2091f6=_0x28eeef['split']('-')[0x4];var _0x89d84=_0x28eeef[_0xc037('0x6')]('-')[0x0];var _0x6f7729=crypto[_0xc037('0x7')]('aes-256-ctr',util[_0xc037('0x8')](_0xc037('0x9'),_0x2091f6,_0x28eeef,_0x89d84));var _0x2ddcd6=_0x6f7729[_0xc037('0xa')](_0x2e8966,_0xc037('0xb'),_0xc037('0xc'));_0x2ddcd6+=_0x6f7729[_0xc037('0xd')]('utf8');var _0xe7b7e9=JSON[_0xc037('0xe')](_0x2ddcd6);return _0xe7b7e9[_0xc037('0xf')](_0x4c55b5)?_0xe7b7e9[_0x4c55b5]:null;}}return null;}function isLimit(_0x4317bf,_0x157208,_0x5d9090,_0x4c00ee){var _0x20dc32=_0x157208;return compose()[_0xc037('0x10')](function(_0x43ef33,_0x29b36b,_0x53d11f){return db[_0xc037('0x11')][_0xc037('0x12')]({'where':{'id':0x1},'raw':!![]})[_0xc037('0x13')](function(_0x1e07d6){var _0x5d6b4d=getValueFromLicense(_0x4317bf,_0x1e07d6);return _0x5d6b4d?_0x5d6b4d:_0x20dc32;})[_0xc037('0x13')](function(_0x5eb855){_0x20dc32=_0x5eb855;return _0x5d9090[_0xc037('0x14')](_0x4c00ee);})['then'](function(_0x10c85d){if(_0x10c85d>=_0x20dc32){return _0x29b36b['status'](0x193)[_0xc037('0x15')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x4317bf)});}_0x53d11f();})['catch'](function(_0x4bfffc){_0x53d11f(_0x4bfffc);});});}function isUserLimit(){return isLimit(_0xc037('0x16'),0x1,db[_0xc037('0x17')],{'where':{'$or':[{'role':'admin'},{'role':_0xc037('0x18')}]}});}exports[_0xc037('0x19')]=isUserLimit;
\ No newline at end of file
diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js
index 81b2a4a..adee58f 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 _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
+var _0xafd8=['days','format','castTo','CAST(','field','\x20AS\x20','text','$notIn','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','$ne','$startsWith','$endsWith','$lt','<\x20?','>\x20?','$lte','$gte','>=\x20?','$substring','start','shift','pop','utcOffset','minutes','seconds','moment','parseSearch','sqlOperator','startsWith','and','replace','[$and]','split','match','forEach','filter','indexOf','conditions','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','add'];(function(_0x3784ab,_0x4a422e){var _0x3df9c7=function(_0x5e890d){while(--_0x5e890d){_0x3784ab['push'](_0x3784ab['shift']());}};_0x3df9c7(++_0x4a422e);}(_0xafd8,0x116));var _0x8afd=function(_0x22b2be,_0x4b164c){_0x22b2be=_0x22b2be-0x0;var _0x213c31=_0xafd8[_0x22b2be];return _0x213c31;};'use strict';var _=require('lodash');var moment=require(_0x8afd('0x0'));exports[_0x8afd('0x1')]=function(_0x31bdfc){var _0x181f21={'conditions':[]};_0x181f21[_0x8afd('0x2')]=_[_0x8afd('0x3')](_0x31bdfc,'[$or]')?'or':_0x8afd('0x4');var _0x44c354=_0x31bdfc[_0x8afd('0x5')](_0x8afd('0x6'),'')[_0x8afd('0x5')]('[$or]','')[_0x8afd('0x7')]('||');for(var _0x4e23db=0x0;_0x4e23db<_0x44c354['length'];_0x4e23db++){var _0x4cb66e=_0x44c354[_0x4e23db][_0x8afd('0x7')](':=');var _0x56c39d=_0x4cb66e[0x0];var _0x313c5f=_0x4cb66e['slice'](0x1);_0x313c5f['forEach'](function(_0x49fcc3){var _0x7fae69=_0x49fcc3[_0x8afd('0x7')]('[')['shift']();var _0x21000e=_0x49fcc3[_0x8afd('0x8')](/\[(.*?)\]/g);_0x21000e[_0x8afd('0x9')](function(_0x120acf){var _0x36e50c=_0x120acf[_0x8afd('0x7')]('[')[_0x8afd('0xa')](function(_0x3ec191){return _0x3ec191[_0x8afd('0xb')](']')>-0x1;})['map'](function(_0xabd642){return _0xabd642[_0x8afd('0x7')](']')[0x0];})[0x0];_0x181f21[_0x8afd('0xc')]['push']({'field':_0x56c39d,'operator':_0x7fae69,'value':_0x36e50c});});});}return _0x181f21;};exports[_0x8afd('0xd')]=function(_0x18303c,_0x2ea287,_0x2e11c5){var _0x4b8c35={};if(_0x2ea287===_0x8afd('0xe')){if(_0x2e11c5[_0x8afd('0xf')]===_0x8afd('0x10')){_0x2e11c5['operator']=_0x8afd('0x11');_0x2e11c5['value']+=','+_0x2e11c5[_0x8afd('0x12')];}else if(_[_0x8afd('0x13')]([_0x8afd('0x14'),'$lte'],_0x2e11c5[_0x8afd('0xf')])){_0x2e11c5['value']=moment(_0x2e11c5['value'])[_0x8afd('0x15')](0x1,_0x8afd('0x16'))[_0x8afd('0x17')]('YYYY-MM-DD');}}if(_0x2e11c5['castTo']){_0x2ea287=_0x2e11c5[_0x8afd('0x18')];_0x4b8c35['text']=_0x8afd('0x19')+_0x18303c+'.'+_0x2e11c5[_0x8afd('0x1a')]+_0x8afd('0x1b')+_0x2e11c5[_0x8afd('0x18')]+')\x20'+parseOperator(_0x2e11c5['operator']);}else{_0x4b8c35[_0x8afd('0x1c')]=_0x18303c+'.'+_0x2e11c5[_0x8afd('0x1a')]+'\x20'+parseOperator(_0x2e11c5[_0x8afd('0xf')]);}if(_['includes'](['$ne',_0x8afd('0x1d')],_0x2e11c5['operator']))_0x4b8c35[_0x8afd('0x1c')]='('+_0x4b8c35[_0x8afd('0x1c')]+_0x8afd('0x1e')+_0x18303c+'.'+_0x2e11c5[_0x8afd('0x1a')]+'\x20IS\x20NULL)';_0x4b8c35[_0x8afd('0x12')]=parseValue(_0x2ea287,_0x2e11c5[_0x8afd('0xf')],_0x2e11c5[_0x8afd('0x12')]);return _0x4b8c35;};function parseOperator(_0x10a052){var _0x1371c9;switch(_0x10a052){case _0x8afd('0x1f'):_0x1371c9=_0x8afd('0x20');break;case _0x8afd('0x1d'):_0x1371c9=_0x8afd('0x21');break;case'$eq':_0x1371c9='=\x20?';break;case _0x8afd('0x22'):_0x1371c9='<>\x20?';break;case'$substring':case _0x8afd('0x23'):case _0x8afd('0x24'):_0x1371c9='LIKE\x20?';break;case _0x8afd('0x25'):_0x1371c9=_0x8afd('0x26');break;case'$gt':_0x1371c9=_0x8afd('0x27');break;case _0x8afd('0x28'):_0x1371c9='<=\x20?';break;case _0x8afd('0x29'):_0x1371c9=_0x8afd('0x2a');break;case _0x8afd('0x11'):_0x1371c9='BETWEEN\x20?\x20AND\x20?';break;}return _0x1371c9;}function parseValue(_0x2ec4c8,_0x52bb62,_0x3997d8){var _0x54f544={'start':undefined,'end':undefined};switch(_0x52bb62){case'$in':case _0x8afd('0x1d'):_0x54f544['start']=_0x3997d8[_0x8afd('0x7')](',');break;case _0x8afd('0x2b'):_0x54f544[_0x8afd('0x2c')]='%'+_0x3997d8+'%';break;case'$startsWith':_0x54f544[_0x8afd('0x2c')]=_0x3997d8+'%';break;case _0x8afd('0x24'):_0x54f544[_0x8afd('0x2c')]='%'+_0x3997d8;break;case'$between':var _0x2690e9=_0x3997d8[_0x8afd('0x7')](',');var _0x3997d8=_0x2690e9[_0x8afd('0x2d')]();var _0x568f89=_0x2690e9[_0x8afd('0x2e')]();if(_0x2ec4c8===_0x8afd('0xe')){_0x3997d8=moment(_0x3997d8)[_0x8afd('0x2f')](0x0,!![])[_0x8afd('0x17')]();_0x568f89=moment(_0x568f89)[_0x8afd('0x2f')](0x0,!![])[_0x8afd('0x15')](0x17,'hours')[_0x8afd('0x15')](0x3b,_0x8afd('0x30'))[_0x8afd('0x15')](0x3b,_0x8afd('0x31'))[_0x8afd('0x17')]();}_0x54f544={'start':_0x3997d8,'end':_0x568f89};break;default:_0x54f544[_0x8afd('0x2c')]=_0x3997d8;break;}return _0x54f544;}
\ No newline at end of file
diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js
index 306356e..ce040c7 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 _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
+var _0x8c0c=['push','toString','join','lodash','sequelize','moment','fields','split','filters','isEmpty','forOwn','find','isPlainObject','parse','$gte','format','utc','YYYY-MM-DD','subtract','isArray','map','priority','unsigned','substr','DESC','cast','ASC','omit','isString','length','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue'];(function(_0x13c254,_0x5d5241){var _0xe928da=function(_0x178d50){while(--_0x178d50){_0x13c254['push'](_0x13c254['shift']());}};_0xe928da(++_0x5d5241);}(_0x8c0c,0x11b));var _0xc8c0=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8c0c[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xc8c0('0x0'));var sequelize=require(_0xc8c0('0x1'));var moment=require(_0xc8c0('0x2'));var LIMIT_VALUE=0xfa;exports[_0xc8c0('0x3')]=function(_0x45f7ea){var _0x429f94=null;if(_0x45f7ea){_0x429f94=_0x45f7ea[_0xc8c0('0x4')](',');}return _0x429f94;};exports[_0xc8c0('0x5')]=function(_0x334f52,_0x313416){var _0x5aeccb={};if(!_[_0xc8c0('0x6')](_0x334f52)){_[_0xc8c0('0x7')](_0x334f52,function(_0x3f117e,_0x3eebae){try{if(_0x313416){var _0x73954c=_[_0xc8c0('0x8')](_0x313416,{'name':_0x3eebae})||{};if(_0x73954c['type']==='DATE'&&_[_0xc8c0('0x9')](_0x3f117e)){var _0x233485=JSON[_0xc8c0('0xa')](_0x3f117e);var _0x2d24d3={'$gte':moment(moment(_0x233485[_0xc8c0('0xb')])[_0xc8c0('0xc')]('YYYY-MM-DD'))[_0xc8c0('0xd')]()[_0xc8c0('0xc')](),'$lte':moment(moment(_0x233485['$lte'])[_0xc8c0('0xc')](_0xc8c0('0xe')))['utc']()[_0xc8c0('0xf')](0x1,'s')[_0xc8c0('0xc')]()};_0x5aeccb[_0x3eebae]=_0x2d24d3;}else{_0x5aeccb[_0x3eebae]=_[_0xc8c0('0x10')](_0x3f117e)?_0x3f117e:JSON['parse'](_0x3f117e);}}else{_0x5aeccb[_0x3eebae]=_[_0xc8c0('0x10')](_0x3f117e)?_0x3f117e:JSON[_0xc8c0('0xa')](_0x3f117e);}}catch(_0x478a01){_0x5aeccb[_0x3eebae]=_0x3f117e['split'](',');}});}return _0x5aeccb;};exports['limit']=function(_0x359fa3){_0x359fa3=parseInt(_0x359fa3,0xa);if(!_0x359fa3||_0x359fa3<0x0){_0x359fa3=LIMIT_VALUE;}return _0x359fa3;};exports['offset']=function(_0x3428f4){_0x3428f4=parseInt(_0x3428f4,0xa);if(!_0x3428f4||_0x3428f4<0x0){_0x3428f4=0x0;}return _0x3428f4;};exports['sort']=function(_0x1d6d51){var _0x328d34,_0x388441=null;if(_0x1d6d51){_0x328d34=_0x1d6d51[_0xc8c0('0x4')](',');_0x388441=_[_0xc8c0('0x11')](_0x328d34,function(_0x4da80d){if(_0x4da80d['indexOf']('-')===0x0){return[_0x4da80d===_0xc8c0('0x12')?sequelize['cast'](sequelize['col']('priority'),_0xc8c0('0x13')):_0x4da80d[_0xc8c0('0x14')](0x1),_0xc8c0('0x15')];}else{return[_0x4da80d===_0xc8c0('0x12')?sequelize[_0xc8c0('0x16')](sequelize['col'](_0xc8c0('0x12')),_0xc8c0('0x13')):_0x4da80d,_0xc8c0('0x17')];}});}return _0x388441;};exports[_0xc8c0('0x18')]=function(_0x59dadf,_0x1ef88c){if(_[_0xc8c0('0x6')](_0x59dadf)){return _0x59dadf;}if(_[_0xc8c0('0x10')](_0x59dadf)){for(var _0x4253b4=0x0;_0x4253b4<_0x59dadf['length'];_0x4253b4+=0x1){_0x59dadf[_0x4253b4]=this['omit'](_0x59dadf[_0x4253b4],_0x1ef88c);}return _0x59dadf;}if(!_['isObject'](_0x59dadf)){return _0x59dadf;}if(_[_0xc8c0('0x19')](_0x1ef88c)){_0x1ef88c=[_0x1ef88c];}if(!_[_0xc8c0('0x10')](_0x1ef88c)){return _0x59dadf;}for(var _0x5bf378=0x0;_0x5bf378<_0x1ef88c[_0xc8c0('0x1a')];_0x5bf378+=0x1){_['unset'](_0x59dadf,_0x1ef88c[_0x5bf378]);}for(var _0x4b66ae in _0x59dadf){if(_0x59dadf[_0xc8c0('0x1b')](_0x4b66ae)){_0x59dadf[_0x4b66ae]=this[_0xc8c0('0x18')](_0x59dadf[_0x4b66ae],_0x1ef88c);}}return _0x59dadf;};exports[_0xc8c0('0x1c')]=function(_0x3f3272){return _0x3f3272[_0xc8c0('0x1d')](RegExp('^[0-9]*$'))?!![]:![];};exports[_0xc8c0('0x1e')]=function(_0x1e4473){return _0x1e4473[_0xc8c0('0x1d')](/^\S+@\S+$/)?!![]:![];};exports[_0xc8c0('0x1f')]=function(_0x1cedfd){var _0x1d01b0=[];_0x1cedfd[_0xc8c0('0x4')]('\x20')['forEach'](function(_0x389501){_0x1d01b0[_0xc8c0('0x20')]('+'+_0x389501[_0xc8c0('0x21')]()+'*');});return _0x1d01b0[_0xc8c0('0x22')]('\x20');};
\ No newline at end of file
diff --git a/server/config/express.js b/server/config/express.js
index 4e8dc69..a28cbd8 100644
--- a/server/config/express.js
+++ b/server/config/express.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-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
+var _0x6a0c=['/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','initialize','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','./environment','default','production','appPath','join','root','public','development','test','set','client','use','json\x20replacer','toISOString','split','get','views'];(function(_0x43579b,_0x5d6da0){var _0x3073c8=function(_0x28a5a6){while(--_0x28a5a6){_0x43579b['push'](_0x43579b['shift']());}};_0x3073c8(++_0x5d6da0);}(_0x6a0c,0xb8));var _0xc6a0=function(_0x49bb93,_0x1321d5){_0x49bb93=_0x49bb93-0x0;var _0x3eb625=_0x6a0c[_0x49bb93];return _0x3eb625;};'use strict';var express=require('express');var favicon=require(_0xc6a0('0x0'));var bodyParser=require(_0xc6a0('0x1'));var methodOverride=require(_0xc6a0('0x2'));var cookieParser=require(_0xc6a0('0x3'));var errorHandler=require(_0xc6a0('0x4'));var path=require(_0xc6a0('0x5'));var passport=require(_0xc6a0('0x6'));var cors=require(_0xc6a0('0x7'));var moment=require(_0xc6a0('0x8'));var config=require(_0xc6a0('0x9'));var db=require('../mysqldb')['db'];exports[_0xc6a0('0xa')]=function(_0x5056b3){var _0x568ee6=_0x5056b3['get']('env');if(_0x568ee6===_0xc6a0('0xb')){_0x5056b3['set'](_0xc6a0('0xc'),path[_0xc6a0('0xd')](config[_0xc6a0('0xe')],_0xc6a0('0xf')));}if(_0x568ee6===_0xc6a0('0x10')||_0x568ee6===_0xc6a0('0x11')){_0x5056b3[_0xc6a0('0x12')](_0xc6a0('0xc'),path[_0xc6a0('0xd')](config[_0xc6a0('0xe')],_0xc6a0('0x13')));_0x5056b3[_0xc6a0('0x14')](errorHandler());}_0x5056b3['set'](_0xc6a0('0x15'),function(_0x1252c4,_0x3183bb){if(this[_0x1252c4]instanceof Date){_0x3183bb=this[_0x1252c4][_0xc6a0('0x16')]()[_0xc6a0('0x17')]('.')[0x0]+'Z';}return _0x3183bb;});_0x5056b3[_0xc6a0('0x14')](express['static'](_0x5056b3[_0xc6a0('0x18')](_0xc6a0('0xc'))));_0x5056b3['set'](_0xc6a0('0x19'),config['root']+_0xc6a0('0x1a'));_0x5056b3[_0xc6a0('0x1b')](_0xc6a0('0x1c'),require(_0xc6a0('0x1d'))[_0xc6a0('0x1e')]);_0x5056b3['set'](_0xc6a0('0x1f'),_0xc6a0('0x1c'));_0x5056b3['use'](bodyParser[_0xc6a0('0x20')]({'limit':_0xc6a0('0x21'),'extended':!![]}));_0x5056b3['use'](bodyParser['json']({'limit':'50mb'}));_0x5056b3[_0xc6a0('0x14')](cors());_0x5056b3['use'](methodOverride());_0x5056b3[_0xc6a0('0x14')](cookieParser());_0x5056b3[_0xc6a0('0x14')](passport[_0xc6a0('0x22')]());};
\ No newline at end of file
diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js
index 509db02..1ef995e 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 _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
+var _0x4fd7=['crypto','bimedia-machine-uuid','child_process','networkInterfaces','orderBy','filter','family','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','createHash','md5','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','update','digest','substring','lodash'];(function(_0x595f1f,_0x53676e){var _0x515ca2=function(_0x250957){while(--_0x250957){_0x595f1f['push'](_0x595f1f['shift']());}};_0x515ca2(++_0x53676e);}(_0x4fd7,0xe6));var _0x74fd=function(_0x517756,_0x2efb52){_0x517756=_0x517756-0x0;var _0x13a912=_0x4fd7[_0x517756];return _0x13a912;};'use strict';var _=require(_0x74fd('0x0'));var os=require('os');var crypto=require(_0x74fd('0x1'));var machine=require(_0x74fd('0x2'));var exec=require(_0x74fd('0x3'))['execSync'];function getInterfaces(){var _0x4fba38=[];var _0xfa6318=os[_0x74fd('0x4')]();var _0x59e3f1=_[_0x74fd('0x5')](_['keys'](_0xfa6318));for(var _0xae1ea5=0x0;_0xae1ea5<_0x59e3f1['length'];_0xae1ea5++){var _0x1959e1=_0xfa6318[_0x59e3f1[_0xae1ea5]][_0x74fd('0x6')](function(_0x566a59){return _0x566a59[_0x74fd('0x7')]===_0x74fd('0x8')&&_0x566a59['internal']===![];});_0x4fba38=_0x4fba38[_0x74fd('0x9')](_0x1959e1);}return _0x4fba38;}function getFirstInterface(){var _0x2e20c2=_[_0x74fd('0xa')](getInterfaces());return{'macAddress':_0x2e20c2&&_0x2e20c2[_0x74fd('0xb')]?_0x2e20c2[_0x74fd('0xb')]:_0x74fd('0xc'),'ipAddress':_0x2e20c2&&_0x2e20c2[_0x74fd('0xd')]?_0x2e20c2[_0x74fd('0xd')]:_0x74fd('0xe')};}exports[_0x74fd('0xf')]=getFirstInterface;function getCPUhash(){var _0x321921=_[_0x74fd('0x5')](os[_0x74fd('0x10')]()[_0x74fd('0x11')](function(_0x3fd552){return _0x3fd552[_0x74fd('0x12')];}))['join'](':');return crypto[_0x74fd('0x13')](_0x74fd('0x14'))['update'](_0x321921)['digest'](_0x74fd('0x15'));}exports[_0x74fd('0x16')]=function(){switch(os[_0x74fd('0x17')]()){case _0x74fd('0x18'):return exec(_0x74fd('0x19'),{'encoding':_0x74fd('0x1a')})[_0x74fd('0x1b')]('\x0d\x0a','');default:var _0x127353=getFirstInterface();var _0x57a832=getCPUhash();var _0x4301a7=_0x57a832+'|'+os[_0x74fd('0x1c')]()+'|'+_0x127353['macAddress']+'|'+_0x127353[_0x74fd('0x1d')];var _0x2a166b=crypto['createHash'](_0x74fd('0x14'))[_0x74fd('0x1e')](_0x4301a7)[_0x74fd('0x1f')](_0x74fd('0x15'));return _0x2a166b[_0x74fd('0x20')](0x0,0x8)+'-'+_0x2a166b[_0x74fd('0x20')](0x8,0xc)+'-'+_0x2a166b[_0x74fd('0x20')](0xc,0x10)+'-'+_0x2a166b[_0x74fd('0x20')](0x10,0x14)+'-'+_0x2a166b[_0x74fd('0x20')](0x14);}};
\ No newline at end of file
diff --git a/server/config/license/index.js b/server/config/license/index.js
index 5119bdc..224cd79 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 _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
+var _0x0d91=['../../mysqldb','./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','createCipher','aes-256-ctr','session','update','utf8','base64','final','createDecipher','secrets','User','findOne','email','|reason|','|machineUuid|','|name|','fullname','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','info','data2','data1','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','catch','error','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','util','crypto','moment','request-promise','pkginfo','version'];(function(_0x9bcc0b,_0x120f6c){var _0x195399=function(_0x5be8b9){while(--_0x5be8b9){_0x9bcc0b['push'](_0x9bcc0b['shift']());}};_0x195399(++_0x120f6c);}(_0x0d91,0x76));var _0x10d9=function(_0x166310,_0x49c9f4){_0x166310=_0x166310-0x0;var _0xd24eb8=_0x0d91[_0x166310];return _0xd24eb8;};'use strict';var util=require(_0x10d9('0x0'));var crypto=require(_0x10d9('0x1'));var moment=require(_0x10d9('0x2'));var rp=require(_0x10d9('0x3'));var BPromise=require('bluebird');var pkginfo=require(_0x10d9('0x4'))(module,_0x10d9('0x5'));var db=require(_0x10d9('0x6'))['db'];var config=require('../environment');var hardware=require(_0x10d9('0x7'));var logger=require(_0x10d9('0x8'))(_0x10d9('0x9'));var jira=require('../../api/jira/jira.controller');var HOST=_0x10d9('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x3a49ab){return new BPromise(function(_0x946fc7,_0x26b6cf){var _0x2558bb=util[_0x10d9('0xb')](_0x10d9('0xc'),HOST,_0x3a49ab,module[_0x10d9('0xd')][_0x10d9('0x5')]);if(oldToken){_0x2558bb=util[_0x10d9('0xb')](_0x10d9('0xe'),HOST,_0x3a49ab,module[_0x10d9('0xd')][_0x10d9('0x5')],oldToken);}var _0x2332c7={'uri':_0x2558bb,'method':_0x10d9('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x2332c7)[_0x10d9('0x10')](function(_0x273a4c){_0x946fc7(_0x273a4c);})['catch'](function(_0x2e327c){_0x26b6cf(_0x2e327c);});});}function encryptDate(_0x23f582){var _0x12a2b4=crypto[_0x10d9('0x11')](_0x10d9('0x12'),config['secrets'][_0x10d9('0x13')]);var _0x5b3be6=_0x12a2b4[_0x10d9('0x14')](_0x23f582,_0x10d9('0x15'),_0x10d9('0x16'));_0x5b3be6+=_0x12a2b4[_0x10d9('0x17')](_0x10d9('0x16'));return _0x5b3be6;}function decryptDate(_0x198778){var _0x211df6=crypto[_0x10d9('0x18')](_0x10d9('0x12'),config[_0x10d9('0x19')]['session']);var _0x5658b5=_0x211df6[_0x10d9('0x14')](_0x198778,_0x10d9('0x16'),_0x10d9('0x15'));_0x5658b5+=_0x211df6[_0x10d9('0x17')]('utf8');return _0x5658b5;}function sendJiraAlert(_0x3f5819,_0x206045,_0x1cff55){var _0x8441a5='||FIELD||VALUE||\x0a';return db[_0x10d9('0x1a')][_0x10d9('0x1b')]({'where':{'role':'admin'},'attributes':['fullname',_0x10d9('0x1c')],'raw':!![]})['then'](function(_0x11be56){ADMIN=_0x11be56;_0x8441a5+=_0x10d9('0x1d')+_0x1cff55+'|\x0a';_0x8441a5+='|uuid|'+_0x3f5819+'|\x0a';_0x8441a5+=_0x10d9('0x1e')+_0x206045+'|\x0a';_0x8441a5+=_0x10d9('0x1f')+ADMIN[_0x10d9('0x20')]+'|\x0a';_0x8441a5+=_0x10d9('0x21')+ADMIN[_0x10d9('0x1c')]+'|\x0a';return _0x8441a5;})[_0x10d9('0x10')](function(_0x26ff84){var _0x3a2e97=hardware[_0x10d9('0x22')]()[_0x10d9('0x23')];return jira[_0x10d9('0x24')]({'key':_0x10d9('0x25'),'summary':_0x10d9('0x26'),'description':_0x26ff84,'issuetype':_0x10d9('0x27'),'oldToken':_0x3f5819,'newToken':_0x206045,'email':ADMIN[_0x10d9('0x1c')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x3a2e97});});}function manageLicense(_0x14c4ec,_0x295489){var _0xce87ca=_0x295489[_0x10d9('0x28')]({'plain':!![]});httpRequest(_0x14c4ec)['then'](function(_0x3ba01f){if(oldToken){oldToken=undefined;}if(_0x3ba01f[_0x10d9('0x29')]){if(!_0xce87ca[_0x10d9('0x9')]&&_0xce87ca[_0x10d9('0x9')]!=_0x3ba01f[_0x10d9('0x9')]||_0xce87ca[_0x10d9('0x9')]&&_0xce87ca['data2']){logger[_0x10d9('0x2a')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0xce87ca[_0x10d9('0x9')]&&!_0xce87ca[_0x10d9('0x2b')]&&_0xce87ca[_0x10d9('0x9')]!=_0x3ba01f[_0x10d9('0x9')]){logger[_0x10d9('0x2a')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0xce87ca['license']&&!_0xce87ca[_0x10d9('0x2b')]&&_0xce87ca[_0x10d9('0x9')]==_0x3ba01f['license']){return _0x295489;}return _0x295489['update']({'data1':_0x14c4ec,'data2':null,'license':_0x3ba01f[_0x10d9('0x9')]});}else{if(_0x3ba01f[_0x10d9('0x9')]||_0xce87ca[_0x10d9('0x9')]){if(!_0xce87ca['data2']){if(_0xce87ca[_0x10d9('0x2c')]==_0x14c4ec){GRAY_PERIOD_REASON='Disabled';logger[_0x10d9('0x2a')](_0x10d9('0x2d'));}else{GRAY_PERIOD_REASON='Changed';oldToken=_0xce87ca['data1'];logger[_0x10d9('0x2a')](_0x10d9('0x2e'),_0xce87ca['data1'],_0x14c4ec);}sendJiraAlert(_0xce87ca[_0x10d9('0x2c')],_0x3ba01f[_0x10d9('0x2f')],GRAY_PERIOD_REASON);logger['info'](_0x10d9('0x30'),GRAY_PERIOD_REASON[_0x10d9('0x31')](),moment()[_0x10d9('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x295489[_0x10d9('0x14')]({'data2':encryptDate(moment()[_0x10d9('0xb')](_0x10d9('0x32')))});}else{if(moment()['diff'](decryptDate(_0xce87ca[_0x10d9('0x2b')]),_0x10d9('0x33'))>DAYS){logger['info'](_0x10d9('0x34'),moment()[_0x10d9('0xb')](_0x10d9('0x32')));return _0x295489[_0x10d9('0x14')]({'data1':_0x14c4ec,'data2':null,'license':null});}}}else{if(_0xce87ca[_0x10d9('0x2c')]!=_0x14c4ec){logger[_0x10d9('0x2a')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0xce87ca['data1'],_0x14c4ec);return _0x295489['update']({'data1':_0x14c4ec,'data2':null,'license':null});}}}return _0x295489;})[_0x10d9('0x10')](function(_0x3d4ee8){_0x295489=_0x3d4ee8;})[_0x10d9('0x35')](function(_0x3bc4ab){logger[_0x10d9('0x36')](_0x3bc4ab['message']);})[_0x10d9('0x37')](function(){setTimeout(function(){manageLicense(hardware[_0x10d9('0x38')](),_0x295489);},TIME);});}function defaultLicense(){var _0x24e998=hardware[_0x10d9('0x38')]();if(_0x24e998){return db['License'][_0x10d9('0x39')]({'where':{'id':0x1},'defaults':{'data1':_0x24e998}})[_0x10d9('0x3a')](function(_0xdd2c0d,_0x36a13f){logger[_0x10d9('0x2a')](_0x10d9('0x3b'),_0x24e998);manageLicense(_0x24e998,_0xdd2c0d);})['catch'](function(_0x1eebad){logger[_0x10d9('0x36')](_0x1eebad[_0x10d9('0x3c')]);});}}exports[_0x10d9('0x3d')]=defaultLicense;
\ No newline at end of file
diff --git a/server/config/license/util.js b/server/config/license/util.js
index 2c5ffd1..fc3c629 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 _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
+var _0x37a7=['../../mysqldb','license','isEmpty','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','days','grayReason','changed','2027-01-01T00:00:00.000Z','Breaking\x20license','message','getLicense','License','find','defaults','then','checkLicense','crypto','util','../environment'];(function(_0x1f4dd9,_0x4f3ab4){var _0x31eb65=function(_0x1a47d2){while(--_0x1a47d2){_0x1f4dd9['push'](_0x1f4dd9['shift']());}};_0x31eb65(++_0x4f3ab4);}(_0x37a7,0x6f));var _0x737a=function(_0x3f8e8c,_0x30ecbb){_0x3f8e8c=_0x3f8e8c-0x0;var _0x4ff56b=_0x37a7[_0x3f8e8c];return _0x4ff56b;};'use strict';var crypto=require(_0x737a('0x0'));var util=require(_0x737a('0x1'));var _=require('lodash');var moment=require('moment');var hardware=require('./hardware');var config=require(_0x737a('0x2'));var db=require(_0x737a('0x3'))['db'];function checkLicense(_0x53a261,_0x524516){if(_0x53a261){try{var _0x4af128=_0x524516||_0x53a261[_0x737a('0x4')];if(_[_0x737a('0x5')](_0x4af128)){throw new Error(_0x737a('0x6'));}var _0x11109c=_0x53a261[_0x737a('0x7')];var _0x5cc52c=_0x53a261[_0x737a('0x8')];var _0x249898=_0x11109c[_0x737a('0x9')]('-')[0x4];var _0x29c3e5=_0x11109c['split']('-')[0x0];var _0x303f55=crypto[_0x737a('0xa')]('aes-256-ctr',util[_0x737a('0xb')](_0x737a('0xc'),_0x249898,_0x11109c,_0x29c3e5));var _0x27a721=_0x303f55[_0x737a('0xd')](_0x4af128,_0x737a('0xe'),_0x737a('0xf'));_0x27a721+=_0x303f55[_0x737a('0x10')]('utf8');var _0x6b6a2=JSON[_0x737a('0x11')](_0x27a721);_0x6b6a2[_0x737a('0x12')]=![];_0x6b6a2[_0x737a('0x13')]=_0x11109c;_0x6b6a2[_0x737a('0x14')]=hardware[_0x737a('0x15')]();if(_0x5cc52c){var _0x1210f3=crypto[_0x737a('0xa')]('aes-256-ctr',config[_0x737a('0x16')][_0x737a('0x17')]);var _0x5ac00d=_0x1210f3['update'](_0x5cc52c,_0x737a('0xe'),_0x737a('0xf'));_0x5ac00d+=_0x1210f3[_0x737a('0x10')](_0x737a('0xf'));_0x6b6a2[_0x737a('0x18')]=_0x5ac00d;_0x6b6a2[_0x737a('0x19')]=moment(_0x5ac00d)['add'](0x7,_0x737a('0x1a'))['format']();_0x6b6a2[_0x737a('0x1b')]=_0x6b6a2[_0x737a('0x13')]!=_0x6b6a2['machineUuid']?_0x737a('0x1c'):'disabled';}return _0x6b6a2;}catch(_0x4bf188){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x737a('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x737a('0x1e'),'uuid':_0x53a261['data1'],'machineUuid':hardware[_0x737a('0x15')](),'message':_0x4bf188[_0x737a('0x1f')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x737a('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0x53a261[_0x737a('0x7')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports[_0x737a('0x20')]=function(_0x5423ba){return db[_0x737a('0x21')][_0x737a('0x22')](_[_0x737a('0x23')](_0x5423ba,{'raw':!![],'where':{'id':0x1}}))[_0x737a('0x24')](function(_0x2926bd){return checkLicense(_0x2926bd,null);});};exports[_0x737a('0x25')]=checkLicense;
\ No newline at end of file
diff --git a/server/config/local.env.js b/server/config/local.env.js
index a3ad523..8782725 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 _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
+var _0x6ced=['secret','exports','http://localhost:9000','app-id'];(function(_0x2a31e5,_0x45e1be){var _0x1e0291=function(_0x3b8807){while(--_0x3b8807){_0x2a31e5['push'](_0x2a31e5['shift']());}};_0x1e0291(++_0x45e1be);}(_0x6ced,0x6d));var _0xd6ce=function(_0x13b747,_0x1916cd){_0x13b747=_0x13b747-0x0;var _0x6c5ca5=_0x6ced[_0x13b747];return _0x6c5ca5;};'use strict';module[_0xd6ce('0x0')]={'DOMAIN':_0xd6ce('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xd6ce('0x2'),'GOOGLE_SECRET':_0xd6ce('0x3'),'DEBUG':''};
\ No newline at end of file
diff --git a/server/config/logger.js b/server/config/logger.js
index df310d2..61e01e5 100644
--- a/server/config/logger.js
+++ b/server/config/logger.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-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
+var _0xe21f=['util','INFO','join','/var','log','xcally','format','%s-%s.log','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','message','exports','Logger','transports','File','%s-%s','error','info','debugLevel','winston'];(function(_0x29af7c,_0x587ff9){var _0x5518df=function(_0xe40acf){while(--_0xe40acf){_0x29af7c['push'](_0x29af7c['shift']());}};_0x5518df(++_0x587ff9);}(_0xe21f,0xef));var _0xfe21=function(_0x100a96,_0x2d1bab){_0x100a96=_0x100a96-0x0;var _0x501c30=_0xe21f[_0x100a96];return _0x501c30;};'use strict';var moment=require('moment');var winston=require(_0xfe21('0x0'));var util=require(_0xfe21('0x1'));var path=require('path');var debugLevel=_0xfe21('0x2');function filename(_0x4f240e,_0x533309){return path[_0xfe21('0x3')](_0xfe21('0x4'),_0xfe21('0x5'),_0xfe21('0x6'),util[_0xfe21('0x7')](_0xfe21('0x8'),_0x4f240e,_0x533309));}function formatter(_0x5432bc,_0x448c3d){return util[_0xfe21('0x7')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xfe21('0x7')](_0xfe21('0x9')),_0x448c3d['level'][_0xfe21('0xa')](),_0x5432bc,_0x448c3d[_0xfe21('0xb')]);}module[_0xfe21('0xc')]=function(_0x3fd1df){return new winston[(_0xfe21('0xd'))]({'transports':[new winston[(_0xfe21('0xe'))][(_0xfe21('0xf'))]({'name':util[_0xfe21('0x7')](_0xfe21('0x10'),_0x3fd1df,_0xfe21('0x11')),'filename':filename(_0x3fd1df,_0xfe21('0x11')),'level':_0xfe21('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5e162d){return formatter(_0x3fd1df,_0x5e162d);}}),new winston[(_0xfe21('0xe'))][(_0xfe21('0xf'))]({'name':util['format'](_0xfe21('0x10'),_0x3fd1df,_0xfe21('0x12')),'filename':filename(_0x3fd1df,_0xfe21('0x12')),'level':_0xfe21('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x30e807){return formatter(_0x3fd1df,_0x30e807);}}),new winston['transports']['Console']({'level':process['env'][_0xfe21('0x13')]||debugLevel,'json':![],'formatter':function(_0x4381dc){return formatter(_0x3fd1df,_0x4381dc);}})]});};
\ No newline at end of file
diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js
index b020889..be9fbfd 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 _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
+var _0x5813=['../../services/email/index.js','routing','../../services/xdr/index.js','exports','express','join','ami','agi','../../services/agi/index.js'];(function(_0x272a46,_0x12b300){var _0x2bfd12=function(_0x4a3d5f){while(--_0x4a3d5f){_0x272a46['push'](_0x272a46['shift']());}};_0x2bfd12(++_0x12b300);}(_0x5813,0x17e));var _0x3581=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5813[_0x321bb2];return _0x9c12ed;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x3581('0x0'),'script':path[_0x3581('0x1')](__dirname,'../../services/express/index.js')},{'name':_0x3581('0x2'),'script':path[_0x3581('0x1')](__dirname,'../../services/ami/index.js')},{'name':_0x3581('0x3'),'script':path[_0x3581('0x1')](__dirname,_0x3581('0x4'))},{'name':'email','script':path['join'](__dirname,_0x3581('0x5'))},{'name':_0x3581('0x6'),'script':path['join'](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path[_0x3581('0x1')](__dirname,_0x3581('0x7'))}]};module[_0x3581('0x8')]=config;
\ No newline at end of file
diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js
index ee6bf00..58f5d48 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 _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
+var _0xafa5=['connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','bluebird','./config','connect'];(function(_0x284acc,_0x5d1917){var _0xbc724d=function(_0x3ac571){while(--_0x3ac571){_0x284acc['push'](_0x284acc['shift']());}};_0xbc724d(++_0x5d1917);}(_0xafa5,0x1af));var _0x5afa=function(_0x2b79e3,_0x1aec9c){_0x2b79e3=_0x2b79e3-0x0;var _0x3d9d86=_0xafa5[_0x2b79e3];return _0x3d9d86;};'use strict';var pm2=require('pm2');var BPromise=require(_0x5afa('0x0'));var config=require(_0x5afa('0x1'));function connect(){return new BPromise(function(_0x2ee5d6,_0x2deb15){return pm2[_0x5afa('0x2')](function(_0x5e59cf){if(_0x5e59cf){return _0x2deb15(_0x5e59cf);}return _0x2ee5d6(_0x5afa('0x3'));});});};exports[_0x5afa('0x4')]=function(_0xac7ca5){return connect()[_0x5afa('0x5')](function(){return new BPromise(function(_0x8dbbe0,_0x58998c){return pm2[_0x5afa('0x4')](_0xac7ca5,function(_0x43488f,_0x129da7){if(_0x43488f){return _0x58998c(_0x43488f);}pm2[_0x5afa('0x6')]();return _0x8dbbe0(_0x129da7);});});});};exports[_0x5afa('0x7')]=function(_0x3154d5){return connect()[_0x5afa('0x5')](function(){return new BPromise(function(_0x2e9ae4,_0x2bfaff){return pm2['stop'](_0x3154d5,function(_0x503e78,_0x22cc13){if(_0x503e78){return _0x2bfaff(_0x503e78);}pm2[_0x5afa('0x6')]();return _0x2e9ae4(_0x22cc13);});});});};exports[_0x5afa('0x8')]=function(_0x295807){return connect()[_0x5afa('0x5')](function(){return new BPromise(function(_0x3128a2,_0x825e64){return pm2[_0x5afa('0x8')](_0x295807,function(_0x57fd0f,_0x408d92){if(_0x57fd0f){return _0x825e64(_0x57fd0f);}pm2[_0x5afa('0x6')]();return _0x3128a2(_0x408d92);});});});};exports[_0x5afa('0x9')]=function(){return connect()[_0x5afa('0x5')](function(){return new BPromise(function(_0x142b61,_0x31ab67){return pm2['list'](function(_0x1674eb,_0x41b7a1){if(_0x1674eb){return _0x31ab67(_0x1674eb);}pm2[_0x5afa('0x6')]();return _0x142b61(_0x41b7a1);});});});};exports[_0x5afa('0xa')]=function(_0xfcb0a2){return connect()[_0x5afa('0x5')](function(){return new BPromise(function(_0x2fc20b,_0x47ba31){return pm2[_0x5afa('0xa')](_0xfcb0a2,function(_0x105c16,_0x5d57e6){if(_0x105c16){return _0x47ba31(_0x105c16);}pm2[_0x5afa('0x6')]();return _0x2fc20b(_0x5d57e6);});});});};exports[_0x5afa('0xb')]=function(_0x292b57){return connect()[_0x5afa('0x5')](function(){return new BPromise(function(_0xe51af9,_0xaef03b){return pm2[_0x5afa('0xb')](_0x292b57,function(_0x56e9b6,_0x276787){if(_0x56e9b6){return _0xaef03b(_0x56e9b6);}pm2[_0x5afa('0x6')]();return _0xe51af9(_0x276787);});});});};exports[_0x5afa('0xc')]=function(){return connect()[_0x5afa('0x5')](function(){return new BPromise(function(_0x24302a,_0xff5b77){return pm2[_0x5afa('0xc')](function(_0x13c38b){if(_0x13c38b){return _0xff5b77(_0x13c38b);}return _0x24302a(_0x5afa('0xd'));});});});};
\ No newline at end of file
diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js
index 1229528..aca1048 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 _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
+var _0xd0ea=['findAll','subtract','minutes','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','catch','error','start','lodash','moment','../../mysqldb','../../config/environment','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction'];(function(_0x1a37b2,_0x584b3b){var _0x130c75=function(_0x268407){while(--_0x268407){_0x1a37b2['push'](_0x1a37b2['shift']());}};_0x130c75(++_0x584b3b);}(_0xd0ea,0x1d4));var _0xad0e=function(_0x2b0074,_0x42d50b){_0x2b0074=_0x2b0074-0x0;var _0x25b012=_0xd0ea[_0x2b0074];return _0x25b012;};'use strict';var _=require(_0xad0e('0x0'));var moment=require(_0xad0e('0x1'));var Redis=require('ioredis');var db=require(_0xad0e('0x2'))['db'];var config=require(_0xad0e('0x3'));config[_0xad0e('0x4')]=_['defaults'](config[_0xad0e('0x4')],{'host':_0xad0e('0x5'),'port':0x18eb});var io=require(_0xad0e('0x6'))(new Redis(config[_0xad0e('0x4')]));function closeInteractions(){var _0x5a15fc=0x0;var _0xc7a6d4=[];return db[_0xad0e('0x7')][_0xad0e('0x8')]({'raw':!![],'attributes':['id',_0xad0e('0x9')],'where':{'id':0x1}})[_0xad0e('0xa')](function(_0x101c74){_0x5a15fc=_0x101c74[_0xad0e('0x9')];if(_0x5a15fc){return db[_0xad0e('0xb')][_0xad0e('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xad0e('0xd')](_0x101c74[_0xad0e('0x9')],_0xad0e('0xe'))}}});}else{return[];}})[_0xad0e('0xa')](function(_0x4f5415){_0xc7a6d4=_0x4f5415;if(_0x5a15fc){return db[_0xad0e('0xb')]['update']({'closeReason':_0xad0e('0xf'),'disposition':_0xad0e('0x10'),'closed':!![],'closedAt':moment()[_0xad0e('0x11')](_0xad0e('0x12'))},{'where':{'id':_['map'](_0xc7a6d4||[],'id')}});}})[_0xad0e('0xa')](function(_0x19983d){for(var _0x31bebc=0x0;_0x31bebc<_0xc7a6d4['length'];_0x31bebc++){io[_0xad0e('0x13')](_0xad0e('0x14'),{'id':_0xc7a6d4[_0x31bebc]['id'],'closed':!![]});}})[_0xad0e('0x15')](function(_0x454c05){console[_0xad0e('0x16')](_0x454c05);});}exports[_0xad0e('0x17')]=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 ba1b537..1e4c35e 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 _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
+var _0xb962=['update\x20cron','run','start','util','lodash','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','Smtp','host','port','secure','auth','user','pass','name','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','existsSync','status','attachments','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','message','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','Schedule','keys','jobs','toString','keyBy','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','add','add\x20cron','stop\x20cron','active','update'];(function(_0x492e9a,_0x32b6ff){var _0x2dde77=function(_0x1bc688){while(--_0x1bc688){_0x492e9a['push'](_0x492e9a['shift']());}};_0x2dde77(++_0x32b6ff);}(_0xb962,0x108));var _0x2b96=function(_0x5633ea,_0x104154){_0x5633ea=_0x5633ea-0x0;var _0x55b7b2=_0xb962[_0x5633ea];return _0x55b7b2;};'use strict';var fs=require('fs');var util=require(_0x2b96('0x0'));var path=require('path');var _=require(_0x2b96('0x1'));var moment=require(_0x2b96('0x2'));var CronJobManager=require(_0x2b96('0x3'));var jayson=require(_0x2b96('0x4'));var BPromise=require(_0x2b96('0x5'));var logger=require('../logger')(_0x2b96('0x6'));var db=require(_0x2b96('0x7'))['db'];var analyticCustomReportController=require(_0x2b96('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x2b96('0x9')][_0x2b96('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2c06c7,_0x5336c9){return function(){logger[_0x2b96('0xb')](_0x2b96('0xc'),_0x2c06c7[_0x2b96('0xd')]);var _0x2390a2=!![];var _0x4028e3={'tls':{'rejectUnauthorized':![]}};if(_0x2c06c7[_0x2b96('0xe')]['Smtp']['service']){_0x4028e3[_0x2b96('0xf')]=_0x2c06c7['MailAccount'][_0x2b96('0x10')]['service'];}else{_0x4028e3[_0x2b96('0x11')]=_0x2c06c7['MailAccount']['Smtp'][_0x2b96('0x11')];_0x4028e3[_0x2b96('0x12')]=_0x2c06c7['MailAccount']['Smtp']['port'];_0x4028e3['secure']=_0x2c06c7[_0x2b96('0xe')][_0x2b96('0x10')][_0x2b96('0x13')];}if(_0x2c06c7[_0x2b96('0xe')]['Smtp']['authentication']){_0x4028e3[_0x2b96('0x14')]={'user':_0x2c06c7[_0x2b96('0xe')][_0x2b96('0x10')][_0x2b96('0x15')],'pass':_0x2c06c7['MailAccount']['Smtp'][_0x2b96('0x16')]};}var _0x4ceeac={'account':_0x4028e3,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2c06c7[_0x2b96('0xe')][_0x2b96('0x17')],_0x2c06c7[_0x2b96('0xe')][_0x2b96('0xd')]||_0x2c06c7['MailAccount'][_0x2b96('0x10')][_0x2b96('0x15')]),'to':_0x2c06c7[_0x2b96('0xd')],'cc':_0x2c06c7['cc'],'bcc':_0x2c06c7[_0x2b96('0x18')],'subject':util[_0x2b96('0x19')](_0x2b96('0x1a'),_0x5336c9[_0x2b96('0x17')],_0x2c06c7[_0x2b96('0x1b')],_0x2c06c7[_0x2b96('0x1c')])}};var _0x5d3570=path[_0x2b96('0x1d')](__dirname,_0x2b96('0x1e'));var _0x4f15c1=_0x5336c9[_0x2b96('0x1f')];var _0x470755=util[_0x2b96('0x19')](_0x2b96('0x20'),path[_0x2b96('0x21')](_0x5336c9[_0x2b96('0x1f')],path[_0x2b96('0x22')](_0x5336c9['savename'])),'zip');var _0x5dd0ff=path[_0x2b96('0x1d')](_0x5d3570,_0x4f15c1);var _0x2e9f73=path[_0x2b96('0x1d')](_0x5d3570,_0x470755);if(fs[_0x2b96('0x23')](_0x5dd0ff)){_0x5336c9[_0x2b96('0x24')]='Sent';_0x4ceeac['message'][_0x2b96('0x25')]=[{'filename':_0x4f15c1,'path':_0x5dd0ff}];_0x4ceeac['message'][_0x2b96('0x26')]=util['format'](_0x2b96('0x27'),JSON[_0x2b96('0x28')](_0x5336c9,null,0x2));}else if(fs['existsSync'](_0x2e9f73)){_0x5336c9[_0x2b96('0x24')]='Sent';_0x4ceeac[_0x2b96('0x29')]['attachments']=[{'filename':_0x470755,'path':_0x2e9f73}];}else{_0x4ceeac['message'][_0x2b96('0x26')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x2c06c7[_0x2b96('0x2a')]){_0x2390a2=![];logger[_0x2b96('0xb')](_0x2b96('0x2b'));}}if(_0x2390a2){return client['request'](_0x2b96('0x2c'),_0x4ceeac)[_0x2b96('0x2d')](function(_0x42f3a8){if(_0x42f3a8[_0x2b96('0x2e')]){return logger[_0x2b96('0x2e')](_0x2b96('0x2f'),JSON['stringify'](_0x42f3a8));}return logger['info'](_0x2b96('0x30'));})[_0x2b96('0x31')](function(_0x5753cf){return logger['error'](_0x2b96('0x2f'),JSON[_0x2b96('0x28')](_0x5753cf));});}};}function handleError(){return function(_0x1635bc){return logger['error'](JSON[_0x2b96('0x28')](_0x1635bc));};}function handleResult(_0x5a19c8){return function(_0x2d4864){logger[_0x2b96('0xb')](_0x2b96('0x32'),JSON[_0x2b96('0x28')](_0x2d4864));if(_0x5a19c8[_0x2b96('0xe')]&&_0x5a19c8[_0x2b96('0xe')][_0x2b96('0x10')]&&!_[_0x2b96('0x33')](_0x5a19c8[_0x2b96('0xd')])){setTimeout(handleSendEmail(_0x5a19c8,_0x2d4864),0x3c*0x3e8);}};}function handleJob(_0x34adfa){return function(){try{if(_['isNil'](_0x34adfa['subtractNumber'])){return logger[_0x2b96('0xb')](_0x2b96('0x34'));}if(_[_0x2b96('0x33')](_0x34adfa[_0x2b96('0x1c')])){return logger[_0x2b96('0xb')]('subtractUnit\x20null\x20or\x20undefined');}var _0x2ee12e={'startDate':moment()['subtract'](_0x34adfa[_0x2b96('0x1b')],_0x34adfa['subtractUnit'])[_0x2b96('0x19')](_0x2b96('0x35')),'endDate':moment()[_0x2b96('0x19')](_0x2b96('0x35')),'type':'scheduled','output':_0x34adfa[_0x2b96('0x36')],'name':_0x34adfa[_0x2b96('0x17')]};if(!_[_0x2b96('0x33')](_0x34adfa[_0x2b96('0x37')])){logger[_0x2b96('0xb')]('exec\x20defaul\x20report\x20id:%s',_0x34adfa[_0x2b96('0x37')]);return analyticDefaultReportController[_0x2b96('0x38')]({'id':_0x34adfa[_0x2b96('0x37')]},_0x2ee12e)['then'](handleResult(_0x34adfa))['catch'](handleError());}if(!_['isNil'](_0x34adfa[_0x2b96('0x39')])){logger[_0x2b96('0xb')]('exec\x20custom\x20report\x20id:%s',_0x34adfa[_0x2b96('0x39')]);return analyticCustomReportController[_0x2b96('0x38')]({'id':_0x34adfa[_0x2b96('0x39')]},_0x2ee12e)[_0x2b96('0x2d')](handleResult(_0x34adfa))[_0x2b96('0x31')](handleError());}}catch(_0x424ca4){logger[_0x2b96('0x2e')](JSON[_0x2b96('0x28')](_0x424ca4));}return logger['info'](_0x2b96('0x3a'));};}function getJobs(_0x57d00a){var _0x5cb73d={};if(_0x57d00a){_0x5cb73d['id']=_0x57d00a;}return db[_0x2b96('0x3b')]['findAll']({'where':_0x5cb73d,'include':[{'model':db['MailAccount'],'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':_0x2b96('0x10')}]}]})[_0x2b96('0x2d')](function(_0x41790e){var _0x392b9c=_[_0x2b96('0x3c')](manager[_0x2b96('0x3d')]);var _0x392768=_['map'](_0x41790e,function(_0x5cb19f){return _0x5cb19f['id'][_0x2b96('0x3e')]();});var _0x4dc882=_[_0x2b96('0x3f')](_0x41790e,function(_0x304b40){return _0x304b40['id']['toString']();});var _0x99ac55=_0x57d00a?_0x392768:_[_0x2b96('0x40')](_0x392768,_0x392b9c);var _0x448143=_['intersection'](_0x392768,_0x392b9c);var _0x3a7c7b=_['difference'](_0x392b9c,_0x392768);var _0x307b13;var _0x3642c5;for(_0x307b13=0x0;_0x307b13<_0x3a7c7b[_0x2b96('0x41')]&&!_0x57d00a;_0x307b13+=0x1){_0x3642c5=_0x3a7c7b[_0x307b13][_0x2b96('0x3e')]();if(manager[_0x2b96('0x42')](_0x3642c5)){manager[_0x2b96('0x43')](_0x3642c5);manager[_0x2b96('0x44')](_0x3642c5);logger[_0x2b96('0xb')](_0x2b96('0x45'),_0x3642c5);}}logger[_0x2b96('0xb')](_0x2b96('0x46'),JSON[_0x2b96('0x28')](_0x99ac55));for(_0x307b13=0x0;_0x307b13<_0x99ac55[_0x2b96('0x41')];_0x307b13+=0x1){_0x3642c5=_0x99ac55[_0x307b13][_0x2b96('0x3e')]();logger[_0x2b96('0xb')](_0x2b96('0x47'),_0x3642c5);if(_0x57d00a){logger['info'](_0x2b96('0x48'),_0x57d00a);logger[_0x2b96('0xb')](JSON['stringify'](_0x4dc882[_0x3642c5]));BPromise[_0x2b96('0x49')]()[_0x2b96('0x2d')](handleJob(_0x4dc882[_0x3642c5]));logger[_0x2b96('0xb')](_0x2b96('0x4a'),_0x4dc882[_0x3642c5][_0x2b96('0x17')],_0x4dc882[_0x3642c5][_0x2b96('0x4b')]);}else if(_0x4dc882[_0x3642c5][_0x2b96('0x4b')]&&_0x4dc882[_0x3642c5]['active']&&moment()[_0x2b96('0x4c')](_0x4dc882[_0x3642c5][_0x2b96('0x4d')],_0x4dc882[_0x3642c5][_0x2b96('0x4e')])){manager[_0x2b96('0x4f')](_0x3642c5,_0x4dc882[_0x3642c5][_0x2b96('0x4b')],handleJob(_0x4dc882[_0x3642c5]));manager['start'](_0x3642c5);logger[_0x2b96('0xb')](_0x2b96('0x50'),_0x4dc882[_0x3642c5]['name'],_0x4dc882[_0x3642c5][_0x2b96('0x4b')]);}else if(manager[_0x2b96('0x42')](_0x3642c5)){manager['stop'](_0x3642c5);manager[_0x2b96('0x44')](_0x3642c5);logger['info'](_0x2b96('0x51'),_0x4dc882[_0x3642c5][_0x2b96('0x17')],_0x4dc882[_0x3642c5][_0x2b96('0x4b')]);}}for(_0x307b13=0x0,_0x3642c5;_0x307b13<_0x448143[_0x2b96('0x41')]&&!_0x57d00a;_0x307b13+=0x1){_0x3642c5=_0x448143[_0x307b13][_0x2b96('0x3e')]();if(manager[_0x2b96('0x42')](_0x3642c5)){if(_0x4dc882[_0x3642c5][_0x2b96('0x4b')]&&_0x4dc882[_0x3642c5][_0x2b96('0x52')]&&moment()['isBetween'](_0x4dc882[_0x3642c5]['startAt'],_0x4dc882[_0x3642c5]['endAt'])){manager[_0x2b96('0x53')](_0x3642c5,_0x4dc882[_0x3642c5][_0x2b96('0x4b')],handleJob(_0x4dc882[_0x3642c5]));logger[_0x2b96('0xb')](_0x2b96('0x54'),_0x4dc882[_0x3642c5][_0x2b96('0x17')],_0x4dc882[_0x3642c5][_0x2b96('0x4b')]);}else{manager['stop'](_0x3642c5);manager[_0x2b96('0x44')](_0x3642c5);logger[_0x2b96('0xb')](_0x2b96('0x51'),_0x4dc882[_0x3642c5]['name'],_0x4dc882[_0x3642c5]['cron']);}}}})[_0x2b96('0x31')](function(_0x565728){logger[_0x2b96('0x2e')](JSON[_0x2b96('0x28')](_0x565728));});}exports[_0x2b96('0x55')]=function(_0x29548e){return getJobs(_0x29548e);};exports[_0x2b96('0x56')]=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 d698af8..a52ccf5 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 _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
+var _0x7532=['length','transcript','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Sequelize','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','bucket','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','all','start','lodash','aws-sdk','request-promise','util','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','format','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','fileText','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts'];(function(_0x1bba91,_0x3bce8e){var _0x10c192=function(_0x4ed5e7){while(--_0x4ed5e7){_0x1bba91['push'](_0x1bba91['shift']());}};_0x10c192(++_0x3bce8e);}(_0x7532,0x193));var _0x2753=function(_0x3b9570,_0x4ead31){_0x3b9570=_0x3b9570-0x0;var _0x28acdd=_0x7532[_0x3b9570];return _0x28acdd;};var _=require(_0x2753('0x0'));var AWS=require(_0x2753('0x1'));var rp=require(_0x2753('0x2'));var util=require(_0x2753('0x3'));var BPromise=require(_0x2753('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x2753('0x5'))(_0x2753('0x6'));function getTranscriptionJob(_0x3fc40d,_0xd14f4e,_0x361c24,_0x4ef7f3){return new Promise(function(_0xc326c2,_0x334292){var _0xc347c1=new AWS[(_0x2753('0x7'))]({'accessKeyId':_0xd14f4e,'secretAccessKey':_0x3fc40d,'region':_0x361c24});_0xc347c1[_0x2753('0x8')]({'TranscriptionJobName':_0x4ef7f3},function(_0x3f8b60,_0x3eb83f){if(_0x3f8b60){return _0x334292(_0x3f8b60);}else{return _0xc326c2(_0x3eb83f);}});});}function sentiment(_0xf5f0e8,_0x441fb1,_0x1b26b8,_0xe51720,_0x40cdcc){return new Promise(function(_0x3ba957,_0x90af0d){var _0x139cfe=new AWS[(_0x2753('0x9'))]({'accessKeyId':_0x441fb1,'secretAccessKey':_0xf5f0e8,'region':_0x1b26b8});_0x139cfe[_0x2753('0xa')]({'Text':_0xe51720,'LanguageCode':_0x40cdcc['substring'](0x0,0x2)},function(_0x45cdf0,_0x15acd6){if(_0x45cdf0){return _0x90af0d(_0x45cdf0);}else{return _0x3ba957(_0x15acd6);}});});}function checkTranscribeJob(_0x5aedbe,_0x197764,_0x4e2da2){var _0x4c3221;return new BPromise(function(_0x4aff1c,_0x51f71d){logger[_0x2753('0xb')](util[_0x2753('0xc')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x5aedbe['id'],_0x5aedbe[_0x2753('0xd')]));return getTranscriptionJob(_0x4e2da2[_0x2753('0xe')],_0x4e2da2[_0x2753('0xf')],_0x197764[_0x2753('0x10')],_0x5aedbe[_0x2753('0xd')])[_0x2753('0x11')](function(_0x3bc016){logger[_0x2753('0xb')](util[_0x2753('0xc')](_0x2753('0x12'),_0x5aedbe['id'],_0x5aedbe[_0x2753('0xd')],_0x3bc016['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x5aedbe[_0x2753('0x13')]){switch(_0x3bc016[_0x2753('0x14')][_0x2753('0x15')]){case _0x2753('0x16'):var _0x4ee863={'transcribeStatus':_0x3bc016[_0x2753('0x14')][_0x2753('0x15')],'fileUri':_0x3bc016[_0x2753('0x14')][_0x2753('0x17')][_0x2753('0x18')]};logger['info'](util[_0x2753('0xc')](_0x2753('0x19'),_0x5aedbe['id']));return rp({'uri':_0x3bc016[_0x2753('0x14')][_0x2753('0x17')][_0x2753('0x18')],'json':!![]})[_0x2753('0x11')](function(_0x160aec){logger['info'](util[_0x2753('0xc')](_0x2753('0x1a'),_0x5aedbe['id']));if(_0x160aec&&_0x160aec[_0x2753('0x1b')]&&_0x160aec['results'][_0x2753('0x1c')]&&_0x160aec['results'][_0x2753('0x1c')]['length']){_0x4ee863[_0x2753('0x13')]='';for(var _0x39fc54=0x0;_0x39fc54<_0x160aec[_0x2753('0x1b')][_0x2753('0x1c')][_0x2753('0x1d')];_0x39fc54++){_0x4ee863[_0x2753('0x13')]+=_0x160aec[_0x2753('0x1b')][_0x2753('0x1c')][_0x39fc54][_0x2753('0x1e')]+'';}}return _0x5aedbe['update'](_0x4ee863);})[_0x2753('0x11')](function(){logger[_0x2753('0xb')](util[_0x2753('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5aedbe['id']));if(!_0x5aedbe[_0x2753('0x1f')]){throw new db['Sequelize']['ValidationError'](_0x2753('0x20'));}if(!_0x197764[_0x2753('0x21')]||!_0x197764['sentimentAccountId']||!_0x197764[_0x2753('0x22')]||!_0x197764[_0x2753('0x23')]||!_0x197764['bucket']){throw new db['Sequelize'][(_0x2753('0x24'))](_0x2753('0x25'));}if(!_0x4ee863[_0x2753('0x13')]){throw new Error(_0x2753('0x26'));}if(_0x197764[_0x2753('0x27')]===_0x4e2da2['id']){return _0x4e2da2;}else{return db[_0x2753('0x28')][_0x2753('0x29')]({'where':{'id':_settings[_0x2753('0x27')]}});}})[_0x2753('0x11')](function(_0x27e372){if(!_0x27e372){throw new db[(_0x2753('0x2a'))][(_0x2753('0x24'))](_0x2753('0x2b'));}if(!_0x27e372[_0x2753('0xe')]||!_0x27e372[_0x2753('0xf')]){throw new db[(_0x2753('0x2a'))][(_0x2753('0x24'))](_0x2753('0x2c'));}_0x4c3221=_0x27e372;logger[_0x2753('0xb')](util[_0x2753('0xc')](_0x2753('0x2d'),_0x5aedbe['id']));return sentiment(_0x4c3221['data1'],_0x4c3221['data2'],_0x197764[_0x2753('0x22')],_0x4ee863[_0x2753('0x13')],_0x197764[_0x2753('0x23')]);})[_0x2753('0x11')](function(_0x505878){logger['info'](util[_0x2753('0xc')](_0x2753('0x2e'),_0x5aedbe['id']));return _0x5aedbe[_0x2753('0x2f')]({'sentiment':_0x505878[_0x2753('0x30')],'sPositive':_0x505878[_0x2753('0x31')][_0x2753('0x32')],'sNegative':_0x505878[_0x2753('0x31')][_0x2753('0x33')],'sMixed':_0x505878[_0x2753('0x31')][_0x2753('0x34')],'sNeutral':_0x505878[_0x2753('0x31')][_0x2753('0x35')]});})['then'](function(){logger[_0x2753('0xb')](util['format'](_0x2753('0x36'),_0x5aedbe['id']));_0x4aff1c();});case _0x2753('0x37'):return _0x5aedbe['update']({'transcribeStatus':_0x2753('0x37'),'failureReason':_0x3bc016[_0x2753('0x14')]['FailureReason']})[_0x2753('0x11')](function(){logger[_0x2753('0xb')](util[_0x2753('0xc')](_0x2753('0x36'),_0x5aedbe['id']));_0x4aff1c();});default:logger[_0x2753('0xb')](util[_0x2753('0xc')](_0x2753('0x38'),_0x5aedbe['id']));break;}}else{return BPromise['resolve']()[_0x2753('0x11')](function(){if(!_0x5aedbe[_0x2753('0x1f')]){throw new db[(_0x2753('0x2a'))][(_0x2753('0x24'))](_0x2753('0x20'));}if(!_0x197764[_0x2753('0x21')]||!_0x197764['sentimentAccountId']||!_0x197764[_0x2753('0x22')]||!_0x197764[_0x2753('0x23')]||!_0x197764[_0x2753('0x39')]){throw new db['Sequelize'][(_0x2753('0x24'))](_0x2753('0x25'));}if(!_0x5aedbe['fileText']){throw new Error(_0x2753('0x26'));}if(_0x197764[_0x2753('0x27')]===_0x4e2da2['id']){return _0x4e2da2;}else{return db[_0x2753('0x28')][_0x2753('0x29')]({'where':{'id':_settings[_0x2753('0x27')]}});}})[_0x2753('0x11')](function(_0x1bc3ef){if(!_0x1bc3ef){throw new db[(_0x2753('0x2a'))][(_0x2753('0x24'))](_0x2753('0x2b'));}if(!_0x1bc3ef[_0x2753('0xe')]||!_0x1bc3ef[_0x2753('0xf')]){throw new db[(_0x2753('0x2a'))][(_0x2753('0x24'))](_0x2753('0x2c'));}_0x4c3221=_0x1bc3ef;logger[_0x2753('0xb')](util[_0x2753('0xc')](_0x2753('0x2d'),_0x5aedbe['id']));return sentiment(_0x4c3221[_0x2753('0xe')],_0x4c3221[_0x2753('0xf')],_0x197764[_0x2753('0x22')],_0x5aedbe[_0x2753('0x13')],_0x197764[_0x2753('0x23')]);})[_0x2753('0x11')](function(_0x1e6c5d){logger[_0x2753('0xb')](util[_0x2753('0xc')](_0x2753('0x2e'),_0x5aedbe['id']));return _0x5aedbe[_0x2753('0x2f')]({'sentiment':_0x1e6c5d[_0x2753('0x30')],'sPositive':_0x1e6c5d[_0x2753('0x31')][_0x2753('0x32')],'sNegative':_0x1e6c5d[_0x2753('0x31')]['Negative'],'sMixed':_0x1e6c5d[_0x2753('0x31')][_0x2753('0x34')],'sNeutral':_0x1e6c5d[_0x2753('0x31')][_0x2753('0x35')],'transcribeStatus':'COMPLETED'});})['then'](function(){logger[_0x2753('0xb')](util[_0x2753('0xc')](_0x2753('0x36'),_0x5aedbe['id']));_0x4aff1c();});}})[_0x2753('0x3a')](function(_0x4ee5a5){if(_0x4ee5a5){if(!_0x4ee5a5[_0x2753('0x3b')]||_0x4ee5a5[_0x2753('0x3b')]!==_0x2753('0x3c')){logger[_0x2753('0x3d')](util[_0x2753('0xc')](_0x2753('0x3e'),_0x5aedbe['id']),util['inspect'](_0x4ee5a5,{'showHidden':![],'depth':null}));}}_0x4aff1c();});});}function checkTranscribe(){var _0x5da1f3;var _0x336791;var _0x15ab21;return db[_0x2753('0x3f')][_0x2753('0x40')]({'where':{'transcribeStatus':_0x2753('0x41')}})[_0x2753('0x11')](function(_0x500008){if(!_0x500008||!_0x500008[_0x2753('0x1d')]){throw new db[(_0x2753('0x2a'))][(_0x2753('0x24'))]('No\x20transcribe\x20job\x20to\x20check');}_0x5da1f3=_0x500008;return db['Setting'][_0x2753('0x29')]({'where':{'id':0x1}});})[_0x2753('0x11')](function(_0xbdd82d){if(!_0xbdd82d){throw new db[(_0x2753('0x2a'))][(_0x2753('0x24'))](_0x2753('0x42'));}_0x336791=_0xbdd82d;if(!_0x336791[_0x2753('0x6')]||!_0x336791[_0x2753('0x43')]||!_0x336791[_0x2753('0x10')]||!_0x336791[_0x2753('0x23')]||!_0x336791['bucket']){throw new db[(_0x2753('0x2a'))]['ValidationError'](_0x2753('0x44'));}return db[_0x2753('0x28')][_0x2753('0x29')]({'where':{'id':_0x336791[_0x2753('0x43')]}});})[_0x2753('0x11')](function(_0x13cfa3){if(!_0x13cfa3){throw new db[(_0x2753('0x2a'))][(_0x2753('0x24'))](_0x2753('0x2b'));}if(!_0x13cfa3[_0x2753('0xe')]||!_0x13cfa3[_0x2753('0xf')]){throw new db[(_0x2753('0x2a'))][(_0x2753('0x24'))](_0x2753('0x2c'));}_0x15ab21=_0x13cfa3;var _0x599ab1=[];_0x5da1f3['forEach'](function(_0x3f7676){_0x599ab1[_0x2753('0x45')](checkTranscribeJob(_0x3f7676,_0x336791,_0x15ab21));});return BPromise[_0x2753('0x46')](_0x599ab1);})[_0x2753('0x3a')](function(_0x1428d6){if(_0x1428d6){if(!_0x1428d6[_0x2753('0x3b')]||_0x1428d6['name']!==_0x2753('0x3c')){logger[_0x2753('0x3d')](util['inspect'](_0x1428d6,{'showHidden':![],'depth':null}));}}});}exports[_0x2753('0x47')]=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 bdf1c6a..2d2570b 100644
--- a/server/config/seedContact.js
+++ b/server/config/seedContact.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-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
+var _0xefc0=['CmHopper','bulkCreate','finished\x20populating','hopper1','contacts2','hopper2','catch','util','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','then','log'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xefc0,0x139));var _0x0efc=function(_0x16dce4,_0x533b15){_0x16dce4=_0x16dce4-0x0;var _0x11f549=_0xefc0[_0x16dce4];return _0x11f549;};'use strict';var util=require(_0x0efc('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x0efc('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x0efc('0x2')+i,'phone':0xf879fb460+i,'email':_0x0efc('0x3')+i+_0x0efc('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x0efc('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x0efc('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0efc('0x5')](),'updatedAt':Date[_0x0efc('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x0efc('0x1')]({'id':i,'firstName':_0x0efc('0x6')+i,'lastName':_0x0efc('0x2')+i,'phone':0xf879fb460+i,'email':_0x0efc('0x3')+i+_0x0efc('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x0efc('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x0efc('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0efc('0x5')](),'updatedAt':Date['now']()});}db[_0x0efc('0x7')][_0x0efc('0x8')]({'where':{}})[_0x0efc('0x9')](function(){return db['CmContact']['bulkCreate'](contacts);})[_0x0efc('0x9')](function(){console[_0x0efc('0xa')]('finished\x20populating','contacts1');return db[_0x0efc('0xb')]['destroy']({'where':{}});})['then'](function(){return db[_0x0efc('0xb')][_0x0efc('0xc')](hopper);})[_0x0efc('0x9')](function(){console[_0x0efc('0xa')](_0x0efc('0xd'),_0x0efc('0xe'));return db[_0x0efc('0x7')][_0x0efc('0xc')](contacts2);})[_0x0efc('0x9')](function(){console['log'](_0x0efc('0xd'),_0x0efc('0xf'));return db[_0x0efc('0xb')][_0x0efc('0xc')](hopper2);})[_0x0efc('0x9')](function(){console[_0x0efc('0xa')](_0x0efc('0xd'),_0x0efc('0x10'));})[_0x0efc('0x11')](function(_0x58ad98){console['log'](_0x58ad98);});
\ No newline at end of file
diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js
index 7e42905..5982b62 100644
--- a/server/config/seedUsers.js
+++ b/server/config/seedUsers.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-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
+var _0x1dc4=['format','%s%s','agent','%s%s@xcally.com','friend','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','push'];(function(_0x3be951,_0x9d9eed){var _0x53e527=function(_0x483a9f){while(--_0x483a9f){_0x3be951['push'](_0x3be951['shift']());}};_0x53e527(++_0x9d9eed);}(_0x1dc4,0x186));var _0x41dc=function(_0x12c137,_0x170b68){_0x12c137=_0x12c137-0x0;var _0x2a06ad=_0x1dc4[_0x12c137];return _0x2a06ad;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x41dc('0x0')]({'name':util[_0x41dc('0x1')](_0x41dc('0x2'),'agent',i),'fullname':util[_0x41dc('0x1')](_0x41dc('0x2'),_0x41dc('0x3'),i),'email':util['format'](_0x41dc('0x4'),'agent',i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0x41dc('0x5'),'transport':['udp','ws',_0x41dc('0x6')],'disallow':[_0x41dc('0x7')],'allow':[_0x41dc('0x8')],'defaultuser':util['format'](_0x41dc('0x2'),_0x41dc('0x3'),i),'encryption':'yes','avpf':_0x41dc('0x9'),'force_avp':_0x41dc('0x9'),'icesupport':_0x41dc('0x9'),'dtlsenable':_0x41dc('0x9'),'dtlsverify':'no','dtlscertfile':_0x41dc('0xa'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x41dc('0xb'),'callerid':util['format'](_0x41dc('0xc'),util[_0x41dc('0x1')](_0x41dc('0x2'),_0x41dc('0x3'),i),0xfa0+i)});}db['User'][_0x41dc('0xd')](users)[_0x41dc('0xe')](function(){console[_0x41dc('0xf')](_0x41dc('0x10'));})['catch'](function(_0x15da32){console[_0x41dc('0xf')](_0x15da32);});
\ No newline at end of file
diff --git a/server/config/socketio.js b/server/config/socketio.js
index 901bcd4..db10d60 100644
--- a/server/config/socketio.js
+++ b/server/config/socketio.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-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
+var _0x6ca4=['fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','user:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','SmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','setMaxListeners','remoteAddress','request','remotePort','connectedAt','SocketIO\x20','nsp','address','DISCONNECTED','lodash','util','bluebird','../mysqldb','Agents','User','role','agent','name','telephone','ivr','findOne','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','then','map','where','Campaign','type','format','%s:queue:%s','query','find','handshake','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','userProfileId','ChatQueue','FaxQueues','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','length','chat'];(function(_0x28b9b5,_0x520aaf){var _0xd7b59b=function(_0x22de68){while(--_0x22de68){_0x28b9b5['push'](_0x28b9b5['shift']());}};_0xd7b59b(++_0x520aaf);}(_0x6ca4,0x86));var _0x46ca=function(_0x5a7900,_0x3561d2){_0x5a7900=_0x5a7900-0x0;var _0x511116=_0x6ca4[_0x5a7900];return _0x511116;};'use strict';var _=require(_0x46ca('0x0'));var util=require(_0x46ca('0x1'));var BPromise=require(_0x46ca('0x2'));var db=require(_0x46ca('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x46ca('0x4'),'model':db[_0x46ca('0x5')],'attributes':['id','name',_0x46ca('0x6')],'raw':!![],'where':{'role':_0x46ca('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x46ca('0x8')],'where':{'role':_0x46ca('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x46ca('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x46ca('0x8'),'type'],'where':{'type':_0x46ca('0xa')}};function getAssociatedResources(_0x67c67a,_0x2e9bf5,_0x2b77b5){return db['UserProfileSection'][_0x46ca('0xb')]({'where':{'name':_0x67c67a,'userProfileId':_0x2e9bf5},'raw':!![]})['then'](function(_0x31a35a){if(_0x31a35a){if(_0x31a35a[_0x46ca('0xc')]){switch(_0x67c67a){case _0x46ca('0xd'):case _0x46ca('0xe'):case'FaxQueues':case _0x46ca('0xf'):case _0x46ca('0x10'):case _0x46ca('0x11'):case _0x46ca('0x12'):return db[_0x2b77b5][_0x46ca('0x13')](queryQueues);case _0x46ca('0x14'):return db[_0x2b77b5]['findAll'](queryTelephones);case _0x46ca('0x15'):return db[_0x2b77b5][_0x46ca('0x13')](queryTrunks);case _0x46ca('0x16'):return db[_0x2b77b5][_0x46ca('0x13')](queryCampaigns);}}else{return db[_0x46ca('0x17')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x31a35a['id']},'raw':!![]})[_0x46ca('0x18')](function(_0x43b59a){if(_0x43b59a){var _0xbfadfd={'where':{'id':_[_0x46ca('0x19')](_0x43b59a,'resourceId')},'raw':!![]};switch(_0x2b77b5){case _0x46ca('0x5'):_0xbfadfd[_0x46ca('0x1a')][_0x46ca('0x6')]=_0x46ca('0x9');break;case _0x46ca('0x1b'):_0xbfadfd[_0x46ca('0x1a')][_0x46ca('0x1c')]=_0x46ca('0xa');break;}return db[_0x2b77b5][_0x46ca('0x13')](_0xbfadfd);}else{return[];}});}}else{return[];}})['then'](function(_0x213f96){return _0x213f96;});}function joinOrLeaveQueues(_0x54f4d3,_0x554b67,_0x47e155,_0x2212d0){_0x54f4d3[_0x554b67](util[_0x46ca('0x1d')](_0x46ca('0x1e'),_0x47e155,_0x2212d0[_0x46ca('0x8')]));if(_0x2212d0[_0x46ca('0x4')]){for(var _0x1e1e58=0x0;_0x1e1e58<_0x2212d0[_0x46ca('0x4')]['length'];_0x1e1e58+=0x1){_0x54f4d3[_0x554b67](util[_0x46ca('0x1d')]('user:%s',_0x2212d0[_0x46ca('0x4')][_0x1e1e58][_0x46ca('0x8')]));}}}function joinOrLeave(_0x16a24e,_0x2bc29c,_0x4b0eb7){var _0x15bc50;if(_0x16a24e['handshake'][_0x46ca('0x1f')]['id']){db['User'][_0x46ca('0x20')]({'attributes':['id','name',_0x46ca('0x6'),'userProfileId'],'where':{'id':_0x16a24e[_0x46ca('0x21')][_0x46ca('0x1f')]['id']},'include':[{'model':db[_0x46ca('0x22')],'as':_0x46ca('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x46ca('0x24')],'as':_0x46ca('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x46ca('0x26')],'as':_0x46ca('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x46ca('0x28')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x46ca('0x29')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x493873){if(_0x493873){_0x15bc50=_0x493873;_0x16a24e[_0x2bc29c](util[_0x46ca('0x1d')]('user:%s',_0x493873['name']));var _0x39dab1=[];switch(_0x493873[_0x46ca('0x6')]){case _0x46ca('0x2a'):_0x16a24e[_0x2bc29c](_0x46ca('0x2b'));_0x16a24e[_0x2bc29c](_0x46ca('0x2c'));if(queryQueues[_0x46ca('0x2d')](_0x46ca('0x2e'))){delete queryQueues['include'];}_0x39dab1[_0x46ca('0x2f')](db[_0x46ca('0x30')][_0x46ca('0x13')](queryQueues));_0x39dab1[_0x46ca('0x2f')](db['ChatQueue'][_0x46ca('0x13')](queryQueues));_0x39dab1[_0x46ca('0x2f')](db[_0x46ca('0x31')][_0x46ca('0x13')](queryQueues));_0x39dab1[_0x46ca('0x2f')](db[_0x46ca('0x32')][_0x46ca('0x13')](queryQueues));_0x39dab1[_0x46ca('0x2f')](db[_0x46ca('0x33')][_0x46ca('0x13')](queryQueues));_0x39dab1[_0x46ca('0x2f')](db[_0x46ca('0x34')][_0x46ca('0x13')](queryQueues));_0x39dab1[_0x46ca('0x2f')](db[_0x46ca('0x35')]['findAll'](queryQueues));_0x39dab1[_0x46ca('0x2f')](db[_0x46ca('0x5')][_0x46ca('0x13')](queryTelephones));_0x39dab1[_0x46ca('0x2f')](db['Trunk'][_0x46ca('0x13')](queryTrunks));_0x39dab1[_0x46ca('0x2f')](db[_0x46ca('0x1b')][_0x46ca('0x13')](queryCampaigns));_0x39dab1[_0x46ca('0x2f')](db[_0x46ca('0x5')][_0x46ca('0x13')](queryAgents));break;case'user':_0x16a24e[_0x2bc29c]('voice:inbound');_0x16a24e[_0x2bc29c](_0x46ca('0x2c'));_0x39dab1[_0x46ca('0x2f')](getAssociatedResources(_0x46ca('0xd'),_0x493873['userProfileId'],_0x46ca('0x30')));_0x39dab1[_0x46ca('0x2f')](getAssociatedResources(_0x46ca('0xe'),_0x493873[_0x46ca('0x36')],_0x46ca('0x37')));_0x39dab1['push'](getAssociatedResources(_0x46ca('0x38'),_0x493873['userProfileId'],_0x46ca('0x31')));_0x39dab1[_0x46ca('0x2f')](getAssociatedResources('SmsQueues',_0x493873[_0x46ca('0x36')],_0x46ca('0x32')));_0x39dab1[_0x46ca('0x2f')](getAssociatedResources(_0x46ca('0x10'),_0x493873[_0x46ca('0x36')],'MailQueue'));_0x39dab1['push'](getAssociatedResources('OpenchannelQueues',_0x493873['userProfileId'],'OpenchannelQueue'));_0x39dab1['push'](getAssociatedResources(_0x46ca('0x12'),_0x493873[_0x46ca('0x36')],_0x46ca('0x35')));_0x39dab1[_0x46ca('0x2f')](getAssociatedResources(_0x46ca('0x14'),_0x493873[_0x46ca('0x36')],_0x46ca('0x5')));_0x39dab1['push'](getAssociatedResources('Trunks',_0x493873[_0x46ca('0x36')],_0x46ca('0x39')));_0x39dab1['push'](getAssociatedResources(_0x46ca('0x16'),_0x493873['userProfileId'],'Campaign'));_0x39dab1[_0x46ca('0x2f')](db[_0x46ca('0x5')]['findAll'](queryAgents));break;case'agent':_0x16a24e[_0x2bc29c](_0x46ca('0x2b'));_0x16a24e[_0x2bc29c](_0x46ca('0x2c'));_0x39dab1[_0x46ca('0x2f')](_0x493873[_0x46ca('0x3a')]({'attributes':['id',_0x46ca('0x8')]}));_0x39dab1[_0x46ca('0x2f')](_0x493873[_0x46ca('0x3b')]({'attributes':['id',_0x46ca('0x8')]}));_0x39dab1[_0x46ca('0x2f')](_0x493873[_0x46ca('0x3c')]({'attributes':['id',_0x46ca('0x8')]}));_0x39dab1['push'](_0x493873[_0x46ca('0x3d')]({'attributes':['id','name']}));_0x39dab1[_0x46ca('0x2f')](_0x493873[_0x46ca('0x3e')]({'attributes':['id',_0x46ca('0x8')]}));_0x39dab1['push'](_0x493873[_0x46ca('0x3f')]({'attributes':['id',_0x46ca('0x8')]}));_0x39dab1[_0x46ca('0x2f')](_0x493873['getWhatsappQueues']({'attributes':['id',_0x46ca('0x8')]}));break;}return BPromise['all'](_0x39dab1);}})['then'](function(_0x47df07){if(_0x47df07&&_0x47df07[_0x46ca('0x40')]){for(var _0x2d407e=0x0;_0x2d407e<_0x47df07[_0x46ca('0x40')];_0x2d407e+=0x1){for(var _0x3111a4=0x0;_0x3111a4<_0x47df07[_0x2d407e][_0x46ca('0x40')];_0x3111a4+=0x1){switch(_0x2d407e){case 0x0:joinOrLeaveQueues(_0x16a24e,_0x2bc29c,'voice',_0x47df07[_0x2d407e][_0x3111a4]);break;case 0x1:joinOrLeaveQueues(_0x16a24e,_0x2bc29c,_0x46ca('0x41'),_0x47df07[_0x2d407e][_0x3111a4]);break;case 0x2:joinOrLeaveQueues(_0x16a24e,_0x2bc29c,_0x46ca('0x42'),_0x47df07[_0x2d407e][_0x3111a4]);break;case 0x3:joinOrLeaveQueues(_0x16a24e,_0x2bc29c,_0x46ca('0x43'),_0x47df07[_0x2d407e][_0x3111a4]);break;case 0x4:joinOrLeaveQueues(_0x16a24e,_0x2bc29c,_0x46ca('0x44'),_0x47df07[_0x2d407e][_0x3111a4]);break;case 0x5:joinOrLeaveQueues(_0x16a24e,_0x2bc29c,_0x46ca('0x45'),_0x47df07[_0x2d407e][_0x3111a4]);break;case 0x6:joinOrLeaveQueues(_0x16a24e,_0x2bc29c,_0x46ca('0x46'),_0x47df07[_0x2d407e][_0x3111a4]);break;case 0x7:_0x16a24e[_0x2bc29c](util[_0x46ca('0x1d')](_0x46ca('0x47'),_0x47df07[_0x2d407e][_0x3111a4]['name']));break;case 0x8:_0x16a24e[_0x2bc29c](util[_0x46ca('0x1d')](_0x46ca('0x48'),_0x47df07[_0x2d407e][_0x3111a4]['name']));break;case 0x9:_0x16a24e[_0x2bc29c](util[_0x46ca('0x1d')](_0x46ca('0x49'),_0x47df07[_0x2d407e][_0x3111a4][_0x46ca('0x1c')],_0x47df07[_0x2d407e][_0x3111a4]['name']));break;case 0xa:_0x16a24e[_0x2bc29c](util['format'](_0x46ca('0x4a'),_0x47df07[_0x2d407e][_0x3111a4][_0x46ca('0x8')]));break;}}}}})[_0x46ca('0x18')](function(){if(_0x2bc29c===_0x46ca('0x4b')){var _0x2d2a8d=_['map'](_0x15bc50['ChatInteractions'],'id');return _0x15bc50[_0x46ca('0x4c')](_0x2d2a8d)['then'](function(){for(var _0x30d5ed=0x0;_0x30d5ed<_0x2d2a8d[_0x46ca('0x40')];_0x30d5ed+=0x1){_0x4b0eb7[_0x46ca('0x4d')](_0x46ca('0x4e'),{'ChatInteractionId':Number(_0x2d2a8d[_0x30d5ed]),'UserId':Number(_0x15bc50['id'])});}});}})[_0x46ca('0x18')](function(){if(_0x2bc29c===_0x46ca('0x4b')){var _0x7ce27c=_['map'](_0x15bc50[_0x46ca('0x25')],'id');return _0x15bc50['removeMailInteractions'](_0x7ce27c)[_0x46ca('0x18')](function(){for(var _0x432ce4=0x0;_0x432ce4<_0x7ce27c[_0x46ca('0x40')];_0x432ce4+=0x1){_0x4b0eb7[_0x46ca('0x4d')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x7ce27c[_0x432ce4]),'UserId':Number(_0x15bc50['id'])});}});}})[_0x46ca('0x18')](function(){if(_0x2bc29c===_0x46ca('0x4b')){var _0x506f0f=_[_0x46ca('0x19')](_0x15bc50[_0x46ca('0x27')],'id');return _0x15bc50['removeFaxInteractions'](_0x506f0f)['then'](function(){for(var _0x26d30b=0x0;_0x26d30b<_0x506f0f[_0x46ca('0x40')];_0x26d30b+=0x1){_0x4b0eb7[_0x46ca('0x4d')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x506f0f[_0x26d30b]),'UserId':Number(_0x15bc50['id'])});}});}})['then'](function(){if(_0x2bc29c==='leave'){var _0x2b5daf=_[_0x46ca('0x19')](_0x15bc50[_0x46ca('0x4f')],'id');return _0x15bc50['removeSmsInteractions'](_0x2b5daf)[_0x46ca('0x18')](function(){for(var _0x753311=0x0;_0x753311<_0x2b5daf['length'];_0x753311+=0x1){_0x4b0eb7[_0x46ca('0x4d')](_0x46ca('0x50'),{'SmsInteractionId':Number(_0x2b5daf[_0x753311]),'UserId':Number(_0x15bc50['id'])});}});}})['then'](function(){if(_0x2bc29c===_0x46ca('0x4b')){var _0x176faa=_[_0x46ca('0x19')](_0x15bc50[_0x46ca('0x51')],'id');return _0x15bc50[_0x46ca('0x52')](_0x176faa)[_0x46ca('0x18')](function(){for(var _0x2609cb=0x0;_0x2609cb<_0x176faa['length'];_0x2609cb+=0x1){_0x4b0eb7[_0x46ca('0x4d')](_0x46ca('0x53'),{'OpenchannelInteractionId':Number(_0x176faa[_0x2609cb]),'UserId':Number(_0x15bc50['id'])});}});}})[_0x46ca('0x18')](function(){if(_0x2bc29c===_0x46ca('0x4b')){var _0x5b3a0c=_[_0x46ca('0x19')](_0x15bc50[_0x46ca('0x54')],'id');return _0x15bc50[_0x46ca('0x55')](_0x5b3a0c)[_0x46ca('0x18')](function(){for(var _0x5929b9=0x0;_0x5929b9<_0x5b3a0c[_0x46ca('0x40')];_0x5929b9+=0x1){_0x4b0eb7[_0x46ca('0x4d')](_0x46ca('0x56'),{'WhatsappInteractionId':Number(_0x5b3a0c[_0x5929b9]),'UserId':Number(_0x15bc50['id'])});}});}})[_0x46ca('0x57')](function(_0x4ab733){_0x16a24e[_0x46ca('0x58')](_0x4ab733);});}}function onDisconnect(_0xe6d14c,_0x5166fd){joinOrLeave(_0xe6d14c,_0x46ca('0x4b'),_0x5166fd);}function onConnect(_0x171e02){joinOrLeave(_0x171e02,_0x46ca('0x59'));}exports['default']=function(_0x1a05f5){_0x1a05f5['on'](_0x46ca('0x5a'),function(_0x28c9cd){_0x28c9cd[_0x46ca('0x5b')](0x0);_0x28c9cd['address']=_0x28c9cd['request'][_0x46ca('0x5a')][_0x46ca('0x5c')]+':'+_0x28c9cd[_0x46ca('0x5d')][_0x46ca('0x5a')][_0x46ca('0x5e')];_0x28c9cd[_0x46ca('0x5f')]=new Date();_0x28c9cd[_0x46ca('0x58')]=function(_0x8d8a3e){console[_0x46ca('0x58')](_0x46ca('0x60')+_0x28c9cd[_0x46ca('0x61')][_0x46ca('0x8')]+'['+_0x28c9cd[_0x46ca('0x62')]+']',_0x8d8a3e);};_0x28c9cd['on']('disconnect',function(){onDisconnect(_0x28c9cd,_0x1a05f5);_0x28c9cd['log'](_0x46ca('0x63'));});onConnect(_0x28c9cd);_0x28c9cd[_0x46ca('0x58')]('CONNECTED');});};
\ No newline at end of file
diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js
index 018b788..feb0fa6 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 _0x7ba1=['default','length','hasOwnProperty','model','callback','toLowerCase','util','jayson/promise','../logger','client','Chat','ChatInteraction','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','afterCreate','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','then','info','Trigger,\x20%s','EventManager','error','catch','get','channel','event','UserId','User','find','name','format','incomingmessage','outgoingmessage','opened','changed','closed','interface'];(function(_0x32df86,_0x2810f9){var _0x12f8ce=function(_0x4fe1ee){while(--_0x4fe1ee){_0x32df86['push'](_0x32df86['shift']());}};_0x12f8ce(++_0x2810f9);}(_0x7ba1,0x10a));var _0x17ba=function(_0xe8ea96,_0x19030d){_0xe8ea96=_0xe8ea96-0x0;var _0x44e664=_0x7ba1[_0xe8ea96];return _0x44e664;};'use strict';var util=require(_0x17ba('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x17ba('0x1'));var logger=require(_0x17ba('0x2'))('triggers');var client=jayson[_0x17ba('0x3')]['http']({'port':0x232a});var triggers=[{'channel':_0x17ba('0x4'),'model':_0x17ba('0x5'),'event':'afterCreate','condition':_0x17ba('0x6'),'callback':afterCreate},{'channel':_0x17ba('0x4'),'model':_0x17ba('0x5'),'event':_0x17ba('0x7'),'condition':_0x17ba('0x8'),'callback':afterUpdate},{'channel':_0x17ba('0x4'),'model':_0x17ba('0x9'),'event':'afterCreate','condition':_0x17ba('0xa'),'callback':afterCreateMessage},{'channel':_0x17ba('0xb'),'model':_0x17ba('0xc'),'event':_0x17ba('0xd'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x17ba('0xb'),'model':_0x17ba('0xc'),'event':'afterUpdate','condition':_0x17ba('0x8'),'callback':afterUpdate},{'channel':_0x17ba('0xb'),'model':_0x17ba('0xe'),'event':_0x17ba('0xd'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x17ba('0xf'),'model':'WhatsappInteraction','event':_0x17ba('0xd'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x17ba('0xf'),'model':_0x17ba('0x10'),'event':_0x17ba('0x7'),'condition':_0x17ba('0x8'),'callback':afterUpdate},{'channel':_0x17ba('0xf'),'model':_0x17ba('0x11'),'event':_0x17ba('0xd'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x17ba('0x12'),'model':'FaxInteraction','event':_0x17ba('0xd'),'condition':_0x17ba('0x6'),'callback':afterCreate},{'channel':_0x17ba('0x12'),'model':'FaxInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x17ba('0x12'),'model':'FaxMessage','event':_0x17ba('0xd'),'condition':_0x17ba('0xa'),'callback':afterCreateMessage},{'channel':_0x17ba('0x13'),'model':_0x17ba('0x14'),'event':_0x17ba('0xd'),'condition':_0x17ba('0x6'),'callback':afterCreate},{'channel':_0x17ba('0x13'),'model':'MailInteraction','event':'afterUpdate','condition':_0x17ba('0x8'),'callback':afterUpdate},{'channel':_0x17ba('0x13'),'model':_0x17ba('0x15'),'event':_0x17ba('0xd'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x17ba('0x16'),'model':'OpenchannelInteraction','event':_0x17ba('0xd'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x17ba('0x16'),'model':_0x17ba('0x17'),'event':_0x17ba('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0x17ba('0x18'),'event':_0x17ba('0xd'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x3c4ace){return client[_0x17ba('0x19')]('EventManager',_0x3c4ace)[_0x17ba('0x1a')](function(_0x40fe52){logger[_0x17ba('0x1b')](_0x17ba('0x1c'),_0x17ba('0x1d'),_0x40fe52);if(_0x40fe52[_0x17ba('0x1e')]){if(_0x40fe52[_0x17ba('0x1e')]['code']===0x1f4){logger[_0x17ba('0x1e')](_0x17ba('0x1c'),_0x17ba('0x1d'),_0x40fe52[_0x17ba('0x1e')]);}}})[_0x17ba('0x1f')](function(_0x31ba04){logger[_0x17ba('0x1e')]('Trigger,\x20%s',_0x17ba('0x1d'),_0x31ba04);});}function afterCreateMessage(_0x46d5e2,_0x142e93){return function(_0x2cb34c,_0x143571){_0x2cb34c=_0x2cb34c[_0x17ba('0x20')]({'plain':!![]});_0x2cb34c[_0x17ba('0x21')]=_0x46d5e2;_0x2cb34c[_0x17ba('0x22')]=_0x2cb34c['direction'];if(_0x2cb34c[_0x17ba('0x23')]){return db[_0x17ba('0x24')][_0x17ba('0x25')]({'where':{'id':_0x2cb34c[_0x17ba('0x23')]},'attributes':['id',_0x17ba('0x26')],'raw':!![]})[_0x17ba('0x1a')](function(_0x19f849){_0x2cb34c['interface']=util[_0x17ba('0x27')]('SIP/%s',_0x19f849['name']);_0x2cb34c[_0x17ba('0x21')]=_0x46d5e2;return request({'event':_0x17ba('0x28'),'message':_0x2cb34c});})[_0x17ba('0x1f')](function(_0x1dc272){console[_0x17ba('0x1e')](_0x1dc272);});}else{return request({'event':_0x17ba('0x29'),'message':_0x2cb34c});}};}function afterCreate(_0x4e6130,_0x55296e){return function(_0x458096,_0x220a54){_0x458096=_0x458096[_0x17ba('0x20')]({'plain':!![]});_0x458096[_0x17ba('0x21')]=_0x4e6130;_0x458096[_0x17ba('0x22')]=_0x17ba('0x2a');return request({'event':_0x55296e,'message':_0x458096});};}function afterUpdate(_0x1e4792,_0x49ebf1){return function(_0x38b90b,_0x16615a){if(_0x38b90b[_0x17ba('0x2b')]('closed')&&_0x38b90b[_0x17ba('0x2c')]){_0x38b90b=_0x38b90b[_0x17ba('0x20')]({'plain':!![]});_0x38b90b[_0x17ba('0x21')]=_0x1e4792;_0x38b90b[_0x17ba('0x22')]='closed';if(_0x38b90b['UserId']){return db[_0x17ba('0x24')][_0x17ba('0x25')]({'where':{'id':_0x38b90b[_0x17ba('0x23')]},'attributes':['id',_0x17ba('0x26')],'raw':!![]})[_0x17ba('0x1a')](function(_0x3cfaee){_0x38b90b[_0x17ba('0x2d')]=util['format']('SIP/%s',_0x3cfaee[_0x17ba('0x26')]);return request({'event':_0x49ebf1,'message':_0x38b90b});})[_0x17ba('0x1f')](function(_0x497ef1){console[_0x17ba('0x1e')](_0x497ef1);});}else{return request({'event':_0x49ebf1,'message':_0x38b90b});}}};}exports[_0x17ba('0x2e')]=function(){for(var _0x5baf5b=0x0;_0x5baf5b=_0x2a7478['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x182a23(_0x2e475d);})[_0x45c3('0x14')](function(_0x3c1e82){_0x36b2d6(_0x3c1e82);});});};
\ No newline at end of file
+var _0x1d55=['catch','lodash','bluebird','../mysqldb','./license/util','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','updateAttributes','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached'];(function(_0x45c73e,_0x4bcf8a){var _0xc60f32=function(_0x33e942){while(--_0x33e942){_0x45c73e['push'](_0x45c73e['shift']());}};_0xc60f32(++_0x4bcf8a);}(_0x1d55,0xb9));var _0x51d5=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x1d55[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0x51d5('0x0'));var BPromise=require(_0x51d5('0x1'));var db=require(_0x51d5('0x2'))['db'];var util=require(_0x51d5('0x3'));var channels=['voice','mail','chat',_0x51d5('0x4'),_0x51d5('0x5'),_0x51d5('0x6'),_0x51d5('0x7')];exports[_0x51d5('0x8')]=function(){return channels;};exports[_0x51d5('0x9')]=function(_0x364609){_0x364609=_0x364609[_0x51d5('0xa')]();return _[_0x51d5('0xb')](channels,_0x364609);};exports[_0x51d5('0xc')]=function(_0x561448,_0x36d1eb,_0x10c8aa,_0x309c96){var _0x18dc8d={'loginAttempts':_0x36d1eb,'blocked':_0x10c8aa};if(!_[_0x51d5('0xd')](_0x309c96)){_0x18dc8d['blockedAt']=_0x309c96;}return _0x561448[_0x51d5('0xe')](_0x18dc8d);};exports['getLicense']=function(_0x3fb8b8){return new BPromise(function(_0x3ccd7c,_0x53cd53){var _0x5e8b31=0x0;if(_0x3fb8b8[_0x51d5('0xf')]!==_0x51d5('0x10')){_0x3ccd7c(_0x3fb8b8);}db[_0x51d5('0x11')][_0x51d5('0x12')]({'where':{'role':_0x51d5('0x10'),'online':!![],'id':{'$ne':_0x3fb8b8['id']}}})[_0x51d5('0x13')](function(_0xf10554){_0x5e8b31=_0xf10554;return util['getLicense']();})['then'](function(_0x4c990d){if(_0x4c990d&&_0x4c990d[_0x51d5('0x14')]&&_0x5e8b31>=_0x4c990d[_0x51d5('0x14')]){throw Error(_0x51d5('0x15'));}_0x3ccd7c(_0x3fb8b8);})[_0x51d5('0x16')](function(_0x54b72e){_0x53cd53(_0x54b72e);});});};
\ No newline at end of file
diff --git a/server/errors/index.js b/server/errors/index.js
index 8a70ae9..8634041 100644
--- a/server/errors/index.js
+++ b/server/errors/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-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
+var _0xc27f=['status','json','send','exports','404'];(function(_0x2d95aa,_0x221a87){var _0x11611c=function(_0x47d917){while(--_0x47d917){_0x2d95aa['push'](_0x2d95aa['shift']());}};_0x11611c(++_0x221a87);}(_0xc27f,0xe9));var _0xfc27=function(_0x29d1f0,_0x2f8428){_0x29d1f0=_0x29d1f0-0x0;var _0x3c439e=_0xc27f[_0x29d1f0];return _0x3c439e;};'use strict';module[_0xfc27('0x0')][0x194]=function pageNotFound(_0xc34d56,_0xf34805){var _0x3c75e6=_0xfc27('0x1');var _0x2ee104=0x194;var _0x5f3005={'status':_0x2ee104};_0xf34805[_0xfc27('0x2')](_0x5f3005['status']);_0xf34805['render'](_0x3c75e6,{},function(_0x308de0,_0x12b3ab){if(_0x308de0){return _0xf34805[_0xfc27('0x2')](_0x5f3005['status'])[_0xfc27('0x3')](_0x5f3005);}_0xf34805[_0xfc27('0x4')](_0x12b3ab);});};
\ No newline at end of file
diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js
index 2df3d3f..87db36e 100644
--- a/server/mysqldb/index.js
+++ b/server/mysqldb/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-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
+var _0xa751=['../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../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','../api/squareRecording/squareRecording.model','../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','../api/plugin/plugin.model','MailTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','Notification','../api/notification/notification.model','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','hasOne','cascade','hasMany','UserId','UserVoiceQueueRt','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','Notifications','SenderId','belongsToMany','ChatGroup','Groups','chat_group_has_users','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','OpenchannelInteraction','user_has_openchannel_interactions','VoiceQueues','MailQueues','ChatQueue','ChatQueues','UserChatQueue','SmsQueues','WhatsappQueues','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','CmHopperHistory','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceCallReport','VoiceAgentReport','AgentReports','ContactId','MailAccountId','Imap','MailServerOut','Smtp','Disposition','CannedAnswer','List','ListId','TemplateId','Agents','user_has_mail_accounts','UserMailQueue','team_has_mail_queues','MailInteractionId','Account','Contact','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','Interaction','restrict','TagId','MailQueueReport','Dashboard','DashboardItem','Items','FaxAccountId','FaxApplication','fax_interaction_has_tags','FaxInteractionId','team_has_fax_queues','Dispositions','SmsAccountId','Answers','Interactions','SmsMessage','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','AttachmentId','team_has_openchannel_queues','ChatWebsiteId','OpenchannelQueueReport','Agent','Queue','ChatQueueId','chat_interaction_has_tags','ChatOfflineMessage','team_has_chat_queues','ChatInternalMessage','ChatGroupId','Website','Contacts','CompanyId','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','AutomationAllId','OneAny','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','Schedule','DefaultReportId','CustomReportId','VoiceMusicOnHold','Mohs','openchannel_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','AnalyticDefaultReport','AnalyticMetric','MetricId','Configurations','Subjects','SubjectId','Descriptions','AccountId','DescriptionId','Field','FieldId','VariableId','SugarcrmAccount','Subject','Description','DeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskConfiguration','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerField','Dynamics365Account','FreshsalesConfiguration','FromId','SessionId','SmsQueueReport','ProjectId','team_has_voice_queues','FaxQueues','OpenchannelQueues','team_has_whatsapp_queues','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','ToSmsQueueId','CustomFields','HopperHistory','voice_queues_has_cm_lists','userProfileId','UserProfileSection','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','user_has_whatsapp_interactions','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','path','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','xcall','username','password','sequelizeHistory','database','options','User','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../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/disposition/disposition.model','Condition'];(function(_0x129f2f,_0x15dc9c){var _0x3132ac=function(_0x3e6b2f){while(--_0x3e6b2f){_0x129f2f['push'](_0x129f2f['shift']());}};_0x3132ac(++_0x15dc9c);}(_0xa751,0x175));var _0x1a75=function(_0x5829a1,_0x31ebdd){_0x5829a1=_0x5829a1-0x0;var _0x58bf54=_0xa751[_0x5829a1];return _0x58bf54;};'use strict';var path=require(_0x1a75('0x0'));var config=require(_0x1a75('0x1'));var Sequelize=require(_0x1a75('0x2'));var _=require(_0x1a75('0x3'));var jstz=require('jstz');var timezone=jstz[_0x1a75('0x4')]();config['sequelize']=_[_0x1a75('0x5')](config[_0x1a75('0x2')],{'database':_0x1a75('0x6'),'username':'xcall','password':_0x1a75('0x7'),'options':{'host':_0x1a75('0x8'),'port':0xcea,'dialect':_0x1a75('0x9'),'dialectOptions':{'charset':_0x1a75('0xa')},'logging':![],'timezone':timezone[_0x1a75('0xb')](),'define':{'charset':_0x1a75('0xc'),'collate':_0x1a75('0xd')}}});config['sequelizeHistory']=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0x1a75('0x6'),'username':_0x1a75('0xe'),'password':_0x1a75('0x7'),'options':{'host':_0x1a75('0x8'),'port':0xcea,'dialect':_0x1a75('0x9'),'dialectOptions':{'charset':_0x1a75('0xa')},'logging':![],'timezone':timezone[_0x1a75('0xb')](),'define':{'charset':_0x1a75('0xc'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x1a75('0x2')][_0x1a75('0xf')],config[_0x1a75('0x2')][_0x1a75('0x10')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1a75('0x11')][_0x1a75('0x12')],config['sequelizeHistory'][_0x1a75('0xf')],config[_0x1a75('0x11')]['password'],config[_0x1a75('0x11')][_0x1a75('0x13')])};db[_0x1a75('0x14')]=db['sequelize']['import']('../api/user/user.model');db[_0x1a75('0x15')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x17'));db[_0x1a75('0x18')]=db[_0x1a75('0x2')]['import'](_0x1a75('0x19'));db['VoiceExtension']=db['sequelize'][_0x1a75('0x16')](_0x1a75('0x1a'));db['VoiceMusicOnHold']=db[_0x1a75('0x2')]['import'](_0x1a75('0x1b'));db[_0x1a75('0x1c')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x1d'));db[_0x1a75('0x1e')]=db['sequelize'][_0x1a75('0x16')]('../api/voiceRecording/voiceRecording.model');db[_0x1a75('0x1f')]=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/screenRecording/screenRecording.model');db[_0x1a75('0x20')]=db['sequelize'][_0x1a75('0x16')](_0x1a75('0x21'));db[_0x1a75('0x22')]=db['sequelize'][_0x1a75('0x16')](_0x1a75('0x23'));db['VoiceCallReport']=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/voiceCallReport/voiceCallReport.model');db[_0x1a75('0x24')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x25'));db['VoiceAgentReport']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x26'));db[_0x1a75('0x27')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x28'));db[_0x1a75('0x29')]=db['sequelize']['import'](_0x1a75('0x2a'));db[_0x1a75('0x2b')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x2c'));db[_0x1a75('0x2d')]=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db['sequelize'][_0x1a75('0x16')](_0x1a75('0x2e'));db[_0x1a75('0x2f')]=db[_0x1a75('0x2')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db['UserChatQueue']=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0x1a75('0x2')]['import'](_0x1a75('0x30'));db[_0x1a75('0x31')]=db[_0x1a75('0x2')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0x1a75('0x32')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x33'));db[_0x1a75('0x34')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x35'));db[_0x1a75('0x36')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x37'));db[_0x1a75('0x38')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x39'));db['MailServerOut']=db[_0x1a75('0x2')]['import']('../api/mailServerOut/mailServerOut.model');db[_0x1a75('0x3a')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x3b'));db[_0x1a75('0x3c')]=db['sequelize'][_0x1a75('0x16')](_0x1a75('0x3d'));db[_0x1a75('0x3e')]=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/mailSubstatus/mailSubstatus.model');db[_0x1a75('0x3f')]=db['sequelize'][_0x1a75('0x16')](_0x1a75('0x40'));db[_0x1a75('0x41')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x42'));db[_0x1a75('0x43')]=db['sequelize']['import'](_0x1a75('0x44'));db['MailQueueReport']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x45'));db['Dashboard']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x46'));db['DashboardItem']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x47'));db[_0x1a75('0x48')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x49'));db['FaxApplication']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x4a'));db[_0x1a75('0x4b')]=db[_0x1a75('0x2')]['import'](_0x1a75('0x4c'));db[_0x1a75('0x4d')]=db['sequelize'][_0x1a75('0x16')]('../api/faxMessage/faxMessage.model');db[_0x1a75('0x4e')]=db['sequelize'][_0x1a75('0x16')](_0x1a75('0x4f'));db[_0x1a75('0x50')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x51'));db[_0x1a75('0x52')]=db['sequelize'][_0x1a75('0x16')]('../api/smsAccount/smsAccount.model');db[_0x1a75('0x53')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x54'));db[_0x1a75('0x55')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x56'));db['SmsMessage']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x57'));db[_0x1a75('0x58')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x59'));db[_0x1a75('0x5a')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x5b'));db[_0x1a75('0x5c')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x5d'));db['OpenchannelInteraction']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x5e'));db[_0x1a75('0x5f')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x60'));db[_0x1a75('0x61')]=db['sequelize'][_0x1a75('0x16')]('../api/openchannelQueue/openchannelQueue.model');db[_0x1a75('0x62')]=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db['sequelize'][_0x1a75('0x16')](_0x1a75('0x63'));db[_0x1a75('0x64')]=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/chatApplication/chatApplication.model');db[_0x1a75('0x65')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x66'));db[_0x1a75('0x67')]=db[_0x1a75('0x2')]['import']('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x68'));db['ChatQueue']=db['sequelize'][_0x1a75('0x16')](_0x1a75('0x69'));db['ChatGroup']=db[_0x1a75('0x2')]['import']('../api/chatGroup/chatGroup.model');db[_0x1a75('0x6a')]=db[_0x1a75('0x2')]['import'](_0x1a75('0x6b'));db[_0x1a75('0x6c')]=db['sequelize'][_0x1a75('0x16')](_0x1a75('0x6d'));db[_0x1a75('0x6e')]=db['sequelize'][_0x1a75('0x16')]('../api/cmContact/cmContact.model');db[_0x1a75('0x6f')]=db[_0x1a75('0x2')]['import'](_0x1a75('0x70'));db[_0x1a75('0x71')]=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x1a75('0x72')]=db[_0x1a75('0x2')]['import'](_0x1a75('0x73'));db['CmHopperHistory']=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x1a75('0x74')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x75'));db[_0x1a75('0x76')]=db[_0x1a75('0x2')]['import'](_0x1a75('0x77'));db[_0x1a75('0x78')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x79'));db[_0x1a75('0x7a')]=db[_0x1a75('0x2')]['import'](_0x1a75('0x7b'));db['CannedAnswer']=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db['sequelize'][_0x1a75('0x16')](_0x1a75('0x7c'));db[_0x1a75('0x7d')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x7e'));db[_0x1a75('0x7f')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x80'));db['Pause']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x81'));db[_0x1a75('0x82')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x83'));db[_0x1a75('0x84')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x85'));db['Schedule']=db['sequelize']['import']('../api/schedule/schedule.model');db[_0x1a75('0x86')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x87'));db[_0x1a75('0x88')]=db[_0x1a75('0x2')]['import'](_0x1a75('0x89'));db[_0x1a75('0x8a')]=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/template/template.model');db[_0x1a75('0x8b')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x8c'));db[_0x1a75('0x8d')]=db[_0x1a75('0x2')]['import'](_0x1a75('0x8e'));db[_0x1a75('0x8f')]=db['sequelize'][_0x1a75('0x16')](_0x1a75('0x90'));db['IntegrationReport']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x91'));db[_0x1a75('0x92')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x93'));db['AnalyticDefaultReport']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x94'));db[_0x1a75('0x95')]=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db['sequelize'][_0x1a75('0x16')]('../api/analyticMetric/analyticMetric.model');db[_0x1a75('0x96')]=db['sequelize'][_0x1a75('0x16')](_0x1a75('0x97'));db[_0x1a75('0x98')]=db[_0x1a75('0x2')]['import'](_0x1a75('0x99'));db[_0x1a75('0x9a')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x9b'));db[_0x1a75('0x9c')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x9d'));db[_0x1a75('0x9e')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x9f'));db['SugarcrmAccount']=db[_0x1a75('0x2')]['import'](_0x1a75('0xa0'));db[_0x1a75('0xa1')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xa2'));db[_0x1a75('0xa3')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xa4'));db[_0x1a75('0xa5')]=db['sequelize'][_0x1a75('0x16')](_0x1a75('0xa6'));db['DeskConfiguration']=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x1a75('0xa7')]=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/intDeskField/intDeskField.model');db[_0x1a75('0xa8')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xa9'));db[_0x1a75('0xaa')]=db[_0x1a75('0x2')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x1a75('0xab')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xac'));db[_0x1a75('0xad')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xae'));db[_0x1a75('0xaf')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xb0'));db[_0x1a75('0xb1')]=db[_0x1a75('0x2')]['import'](_0x1a75('0xb2'));db[_0x1a75('0xb3')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xb4'));db['FreshdeskConfiguration']=db['sequelize']['import'](_0x1a75('0xb5'));db['FreshdeskField']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xb6'));db['VtigerAccount']=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x1a75('0xb7')]=db['sequelize'][_0x1a75('0x16')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xb8'));db[_0x1a75('0xb9')]=db[_0x1a75('0x2')]['import'](_0x1a75('0xba'));db[_0x1a75('0xbb')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xbc'));db[_0x1a75('0xbd')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xbe'));db['Dynamics365Account']=db['sequelize']['import'](_0x1a75('0xbf'));db[_0x1a75('0xc0')]=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x1a75('0xc1')]=db[_0x1a75('0x2')]['import'](_0x1a75('0xc2'));db[_0x1a75('0xc3')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xc4'));db['FreshsalesConfiguration']=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x1a75('0xc5')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xc6'));db[_0x1a75('0x8f')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x90'));db[_0x1a75('0xc7')]=db['sequelize'][_0x1a75('0x16')](_0x1a75('0xc8'));db[_0x1a75('0xc9')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xca'));db['ChatInternalMessage']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xcb'));db[_0x1a75('0xcc')]=db['sequelize'][_0x1a75('0x16')](_0x1a75('0xcd'));db[_0x1a75('0xce')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xcf'));db[_0x1a75('0xd0')]=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xd1'));db[_0x1a75('0xd2')]=db['sequelize'][_0x1a75('0x16')](_0x1a75('0xd3'));db[_0x1a75('0xd4')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xd5'));db[_0x1a75('0xd6')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xd7'));db[_0x1a75('0xd8')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xd9'));db[_0x1a75('0xda')]=db['sequelize']['import'](_0x1a75('0xdb'));db[_0x1a75('0xdc')]=db['sequelize'][_0x1a75('0x16')](_0x1a75('0xdd'));db['SquareRecording']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xde'));db['SquareMessage']=db[_0x1a75('0x2')]['import'](_0x1a75('0xdf'));db[_0x1a75('0xe0')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xe1'));db[_0x1a75('0xe2')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xe3'));db[_0x1a75('0xe4')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xe5'));db[_0x1a75('0xe6')]=db[_0x1a75('0x2')]['import'](_0x1a75('0xe7'));db[_0x1a75('0xe8')]=db[_0x1a75('0x2')]['import']('../api/attachment/attachment.model');db['Plugin']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xe9'));db[_0x1a75('0xea')]=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xeb'));db[_0x1a75('0xec')]=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/faxTransferReport/faxTransferReport.model');db['OpenchannelTransferReport']=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db['sequelize'][_0x1a75('0x16')](_0x1a75('0xed'));db['CmList']=db['sequelize'][_0x1a75('0x16')](_0x1a75('0xee'));db[_0x1a75('0xef')]=db['sequelize'][_0x1a75('0x16')]('../api/voicePrefix/voicePrefix.model');db[_0x1a75('0xf0')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xf1'));db['UserProfileSection']=db['sequelize'][_0x1a75('0x16')](_0x1a75('0xf2'));db[_0x1a75('0xf3')]=db['sequelize'][_0x1a75('0x16')](_0x1a75('0xf4'));db[_0x1a75('0xf5')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xf6'));db[_0x1a75('0xf7')]=db['sequelize']['import']('../api/whatsappAccount/whatsappAccount.model');db[_0x1a75('0xf8')]=db[_0x1a75('0x2')]['import'](_0x1a75('0xf9'));db[_0x1a75('0xfa')]=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x1a75('0xfb')]=db['sequelize'][_0x1a75('0x16')](_0x1a75('0xfc'));db['WhatsappQueueReport']=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0xfd'));db[_0x1a75('0xfe')]=db[_0x1a75('0x2')][_0x1a75('0x16')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x1a75('0xff')]=db['sequelize'][_0x1a75('0x16')](_0x1a75('0x100'));db[_0x1a75('0x101')]=db[_0x1a75('0x2')][_0x1a75('0x16')](_0x1a75('0x102'));db[_0x1a75('0x14')][_0x1a75('0x103')](db['VoiceMail'],{'as':_0x1a75('0x20'),'onDelete':_0x1a75('0x104'),'foreignKey':'UserId'});db[_0x1a75('0x14')][_0x1a75('0x105')](db['VoiceRecording'],{'as':'Recordings','foreignKey':_0x1a75('0x106')});db[_0x1a75('0x14')][_0x1a75('0x105')](db[_0x1a75('0x107')],{'as':_0x1a75('0x108'),'foreignKey':_0x1a75('0x106')});db[_0x1a75('0x14')]['hasMany'](db[_0x1a75('0x109')],{'as':_0x1a75('0x10a'),'onDelete':'cascade','hooks':!![]});db[_0x1a75('0x14')]['hasMany'](db['CmHopperFinal'],{'as':_0x1a75('0x10b'),'foreignKey':_0x1a75('0x106')});db[_0x1a75('0x14')][_0x1a75('0x105')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x1a75('0x106')});db[_0x1a75('0x14')][_0x1a75('0x105')](db[_0x1a75('0x74')],{'as':_0x1a75('0x74'),'foreignKey':_0x1a75('0x106')});db[_0x1a75('0x14')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x1a75('0x10c'),'foreignKey':_0x1a75('0x106')});db[_0x1a75('0x14')][_0x1a75('0x105')](db[_0x1a75('0x65')],{'as':_0x1a75('0x10d'),'foreignKey':_0x1a75('0x106')});db[_0x1a75('0x14')][_0x1a75('0x105')](db[_0x1a75('0x55')],{'as':_0x1a75('0x10e'),'foreignKey':_0x1a75('0x106')});db[_0x1a75('0x14')]['hasMany'](db['FaxInteraction'],{'as':_0x1a75('0x10f'),'foreignKey':_0x1a75('0x106')});db[_0x1a75('0x14')][_0x1a75('0x105')](db[_0x1a75('0x3f')],{'as':_0x1a75('0x110'),'foreignKey':_0x1a75('0x106')});db[_0x1a75('0x14')]['hasMany'](db[_0x1a75('0xfa')],{'as':_0x1a75('0x111'),'foreignKey':_0x1a75('0x106')});db['User'][_0x1a75('0x105')](db[_0x1a75('0xf5')],{'as':_0x1a75('0x112'),'foreignKey':_0x1a75('0x113')});db['User']['belongsTo'](db['UserProfile'],{'as':_0x1a75('0xf0'),'foreignKey':'userProfileId'});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0x115')],{'as':_0x1a75('0x116'),'through':_0x1a75('0x117')});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0x6e')],{'as':'Contacts','through':_0x1a75('0x118')});db[_0x1a75('0x14')]['belongsToMany'](db[_0x1a75('0x119')],{'as':_0x1a75('0x11a'),'through':_0x1a75('0x11b')});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0xe0')],{'through':_0x1a75('0x11c')});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0x3f')],{'as':_0x1a75('0x110'),'through':_0x1a75('0x11d')});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0x65')],{'as':_0x1a75('0x10d'),'through':_0x1a75('0x11e')});db['User'][_0x1a75('0x114')](db['FaxInteraction'],{'as':_0x1a75('0x10f'),'through':'user_has_fax_interactions'});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0x55')],{'as':_0x1a75('0x10e'),'through':'user_has_sms_interactions'});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0x11f')],{'as':_0x1a75('0x10c'),'through':_0x1a75('0x120')});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0xfa')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0x1a75('0x14')][_0x1a75('0x114')](db['VoiceQueue'],{'as':_0x1a75('0x121'),'through':_0x1a75('0x2f'),'required':![]});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0x3c')],{'as':_0x1a75('0x122'),'through':'UserMailQueue','required':![]});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0x123')],{'as':_0x1a75('0x124'),'through':_0x1a75('0x125'),'required':![],'hooks':!![]});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0x4e')],{'as':'FaxQueues','through':_0x1a75('0x31'),'required':![]});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0x58')],{'as':_0x1a75('0x126'),'through':'UserSmsQueue','required':![]});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0x61')],{'as':'OpenchannelQueues','through':_0x1a75('0x34'),'required':![]});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0xff')],{'as':_0x1a75('0x127'),'through':_0x1a75('0x36'),'required':![]});db[_0x1a75('0x14')]['belongsToMany'](db['CmList'],{'through':'cm_user_has_lists'});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0xef')],{'as':'VoicePrefixes','through':_0x1a75('0x128'),'required':![]});db['User'][_0x1a75('0x114')](db[_0x1a75('0x62')],{'as':_0x1a75('0x129'),'through':_0x1a75('0x12a')});db['User'][_0x1a75('0x114')](db['FaxAccount'],{'as':_0x1a75('0x12b'),'through':'user_has_fax_accounts'});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0x3a')],{'as':_0x1a75('0x12c'),'through':'user_has_mail_accounts'});db[_0x1a75('0x14')]['belongsToMany'](db[_0x1a75('0x5a')],{'as':'OpenchannelAccounts','through':_0x1a75('0x12d')});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0x52')],{'as':_0x1a75('0x12e'),'through':_0x1a75('0x12f')});db[_0x1a75('0x14')][_0x1a75('0x114')](db[_0x1a75('0xf7')],{'as':_0x1a75('0x130'),'through':_0x1a75('0x131')});db['User'][_0x1a75('0x114')](db[_0x1a75('0xdc')],{'as':_0x1a75('0x132'),'through':_0x1a75('0x133')});db['VoiceChanSpy'][_0x1a75('0x105')](db[_0x1a75('0x109')],{'as':_0x1a75('0x134'),'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x135')});db[_0x1a75('0x18')]['hasMany'](db['VoiceExtension'],{'onDelete':_0x1a75('0x104')});db[_0x1a75('0x109')][_0x1a75('0x105')](db[_0x1a75('0x109')],{'as':_0x1a75('0x136'),'onDelete':'cascade'});db['VoiceMusicOnHold']['belongsToMany'](db[_0x1a75('0x86')],{'as':_0x1a75('0x137'),'through':_0x1a75('0x138')});db[_0x1a75('0x1c')][_0x1a75('0x105')](db['UserVoiceQueueRt'],{'as':_0x1a75('0x139'),'foreignKey':_0x1a75('0x13a')});db['VoiceQueue']['hasMany'](db[_0x1a75('0x6f')],{'as':_0x1a75('0x13b'),'foreignKey':'VoiceQueueId'});db[_0x1a75('0x1c')][_0x1a75('0x105')](db[_0x1a75('0x72')],{'as':_0x1a75('0x10b'),'foreignKey':_0x1a75('0x13a')});db['VoiceQueue']['hasMany'](db[_0x1a75('0x13c')],{'as':_0x1a75('0x13d'),'foreignKey':'VoiceQueueId'});db[_0x1a75('0x1c')][_0x1a75('0x105')](db['ReportAgentPreview'],{'as':_0x1a75('0x74'),'foreignKey':_0x1a75('0x13a')});db[_0x1a75('0x1c')][_0x1a75('0x105')](db[_0x1a75('0x71')],{'as':_0x1a75('0x13e'),'foreignKey':'VoiceQueueId'});db[_0x1a75('0x1c')][_0x1a75('0x105')](db[_0x1a75('0xd0')],{'as':_0x1a75('0x13f'),'foreignKey':_0x1a75('0x13a')});db[_0x1a75('0x1c')][_0x1a75('0x140')](db['Trunk'],{'as':_0x1a75('0x2b'),'foreignKey':_0x1a75('0x141')});db['VoiceQueue'][_0x1a75('0x140')](db[_0x1a75('0x2b')],{'as':_0x1a75('0x142'),'foreignKey':'TrunkBackupId'});db[_0x1a75('0x1c')][_0x1a75('0x140')](db[_0x1a75('0x7f')],{'as':_0x1a75('0x7f'),'foreignKey':_0x1a75('0x143')});db[_0x1a75('0x1c')][_0x1a75('0x140')](db[_0x1a75('0x144')],{'as':_0x1a75('0x145'),'foreignKey':_0x1a75('0x146')});db[_0x1a75('0x1c')][_0x1a75('0x114')](db[_0x1a75('0x119')],{'as':_0x1a75('0x11a'),'through':'voice_queues_has_cm_lists'});db[_0x1a75('0x1c')]['belongsToMany'](db[_0x1a75('0x14')],{'as':'Agents','through':'UserVoiceQueue'});db['VoiceQueue'][_0x1a75('0x114')](db[_0x1a75('0xe0')],{'as':_0x1a75('0x147'),'through':'team_has_voice_queues'});db[_0x1a75('0x1c')]['belongsToMany'](db[_0x1a75('0x119')],{'as':_0x1a75('0x148'),'through':_0x1a75('0x149')});db[_0x1a75('0x1e')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'as':_0x1a75('0x14'),'foreignKey':_0x1a75('0x106')});db[_0x1a75('0x1f')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'as':_0x1a75('0x14'),'foreignKey':_0x1a75('0x106')});db['VoiceMail'][_0x1a75('0x105')](db[_0x1a75('0x22')],{'as':_0x1a75('0x14a'),'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x14b'),'sourceKey':_0x1a75('0x14c')});db['VoiceMailMessage'][_0x1a75('0x140')](db[_0x1a75('0x20')],{'foreignKey':'mailboxuser','targetKey':_0x1a75('0x14c')});db['VoiceCallReport'][_0x1a75('0x105')](db['VoiceQueueReport'],{'as':_0x1a75('0x14d'),'foreignKey':_0x1a75('0x14e'),'constraints':![]});db[_0x1a75('0x14f')]['hasMany'](db[_0x1a75('0x150')],{'as':_0x1a75('0x151'),'foreignKey':_0x1a75('0x14e'),'constraints':![]});db['VoiceCallReport'][_0x1a75('0x140')](db[_0x1a75('0x14')],{'as':_0x1a75('0x14'),'foreignKey':'UserId'});db[_0x1a75('0x14f')][_0x1a75('0x140')](db[_0x1a75('0x6e')],{'as':'Contact','foreignKey':_0x1a75('0x152')});db[_0x1a75('0x38')]['belongsTo'](db[_0x1a75('0x3a')],{'as':_0x1a75('0x3a'),'foreignKey':'MailAccountId'});db['MailServerOut']['belongsTo'](db[_0x1a75('0x3a')],{'as':_0x1a75('0x3a'),'foreignKey':_0x1a75('0x153')});db['MailAccount'][_0x1a75('0x103')](db['MailServerIn'],{'as':_0x1a75('0x154'),'onDelete':_0x1a75('0x104')});db[_0x1a75('0x3a')]['hasOne'](db[_0x1a75('0x155')],{'as':_0x1a75('0x156'),'onDelete':_0x1a75('0x104')});db['MailAccount']['hasMany'](db[_0x1a75('0x157')],{'as':'Dispositions','foreignKey':'MailAccountId'});db['MailAccount'][_0x1a75('0x105')](db[_0x1a75('0x158')],{'as':'Answers','foreignKey':_0x1a75('0x153')});db['MailAccount'][_0x1a75('0x105')](db[_0x1a75('0x41')],{'as':'Messages','foreignKey':_0x1a75('0x153')});db[_0x1a75('0x3a')][_0x1a75('0x105')](db[_0x1a75('0x3f')],{'as':'Interactions'});db[_0x1a75('0x3a')]['hasMany'](db['MailApplication'],{'as':_0x1a75('0x136')});db[_0x1a75('0x3a')][_0x1a75('0x140')](db[_0x1a75('0x119')],{'as':_0x1a75('0x159'),'foreignKey':_0x1a75('0x15a')});db[_0x1a75('0x3a')][_0x1a75('0x140')](db[_0x1a75('0x8a')],{'as':_0x1a75('0x8a'),'foreignKey':_0x1a75('0x15b')});db[_0x1a75('0x3a')][_0x1a75('0x140')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x1a75('0x146')});db[_0x1a75('0x3a')]['belongsToMany'](db[_0x1a75('0x14')],{'as':_0x1a75('0x15c'),'through':_0x1a75('0x15d')});db['MailQueue'][_0x1a75('0x114')](db['User'],{'as':_0x1a75('0x15c'),'through':_0x1a75('0x15e')});db[_0x1a75('0x3c')]['belongsToMany'](db[_0x1a75('0xe0')],{'through':_0x1a75('0x15f'),'as':_0x1a75('0x147')});db['MailInteraction'][_0x1a75('0x105')](db[_0x1a75('0x41')],{'as':'Messages','onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x160')});db[_0x1a75('0x3f')]['belongsTo'](db[_0x1a75('0x3a')],{'as':_0x1a75('0x161'),'foreignKey':_0x1a75('0x153')});db['MailInteraction'][_0x1a75('0x140')](db['CmContact'],{'as':_0x1a75('0x162'),'foreignKey':_0x1a75('0x152')});db[_0x1a75('0x3f')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'as':_0x1a75('0x163'),'foreignKey':_0x1a75('0x106')});db[_0x1a75('0x3f')][_0x1a75('0x114')](db[_0x1a75('0x88')],{'through':'mail_interaction_has_tags','as':_0x1a75('0x164')});db['MailInteraction'][_0x1a75('0x114')](db[_0x1a75('0x88')],{'through':_0x1a75('0x165'),'as':_0x1a75('0x166')});db[_0x1a75('0x3f')]['belongsToMany'](db[_0x1a75('0x14')],{'as':_0x1a75('0x167'),'through':_0x1a75('0x11d'),'foreignKey':'MailInteractionId'});db[_0x1a75('0x41')][_0x1a75('0x105')](db[_0x1a75('0xe8')],{'as':'Attachments','onDelete':_0x1a75('0x104')});db['MailMessage'][_0x1a75('0x140')](db['User'],{'as':_0x1a75('0x14')});db[_0x1a75('0x41')][_0x1a75('0x140')](db['CmContact'],{'onDelete':_0x1a75('0x104'),'as':'Contact'});db[_0x1a75('0x41')][_0x1a75('0x140')](db[_0x1a75('0x3f')],{'as':_0x1a75('0x168'),'foreignKey':_0x1a75('0x160')});db['MailMessage'][_0x1a75('0x140')](db[_0x1a75('0x3a')],{'as':_0x1a75('0x161'),'foreignKey':_0x1a75('0x153')});db[_0x1a75('0x43')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'onDelete':_0x1a75('0x169')});db['MailApplication'][_0x1a75('0x140')](db[_0x1a75('0x3c')],{'onDelete':_0x1a75('0x169')});db[_0x1a75('0x43')][_0x1a75('0x140')](db[_0x1a75('0x3a')],{'onDelete':_0x1a75('0x169')});db[_0x1a75('0x43')]['belongsTo'](db[_0x1a75('0x7f')],{'onDelete':'restrict','foreignKey':_0x1a75('0x143')});db['MailApplication'][_0x1a75('0x140')](db['Tag'],{'onDelete':_0x1a75('0x169'),'foreignKey':_0x1a75('0x16a')});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x1a75('0x16b')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x1a75('0x15a')});db[_0x1a75('0x16b')]['belongsTo'](db[_0x1a75('0x6e')],{'as':'Contact','foreignKey':_0x1a75('0x152')});db[_0x1a75('0x16b')][_0x1a75('0x140')](db[_0x1a75('0x3f')],{});db[_0x1a75('0x16b')][_0x1a75('0x140')](db['MailMessage'],{});db['MailQueueReport'][_0x1a75('0x140')](db[_0x1a75('0x14')],{});db['MailQueueReport'][_0x1a75('0x140')](db[_0x1a75('0x3c')],{});db[_0x1a75('0x16c')][_0x1a75('0x105')](db[_0x1a75('0x16d')],{'as':_0x1a75('0x16e'),'onDelete':_0x1a75('0x104')});db[_0x1a75('0x48')][_0x1a75('0x105')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x1a75('0x16f')});db[_0x1a75('0x48')]['hasMany'](db[_0x1a75('0x158')],{'as':'Answers','foreignKey':'FaxAccountId'});db[_0x1a75('0x48')][_0x1a75('0x105')](db[_0x1a75('0x4b')],{'as':'Interactions'});db[_0x1a75('0x48')][_0x1a75('0x105')](db[_0x1a75('0x170')],{'as':_0x1a75('0x136')});db[_0x1a75('0x48')][_0x1a75('0x105')](db[_0x1a75('0x109')],{'as':'Exntensions','onDelete':'cascade'});db[_0x1a75('0x48')]['hasMany'](db['FaxMessage'],{'as':_0x1a75('0x14a')});db[_0x1a75('0x48')][_0x1a75('0x140')](db[_0x1a75('0x2b')],{'as':'Trunk'});db[_0x1a75('0x48')][_0x1a75('0x140')](db[_0x1a75('0x119')],{'as':'List','foreignKey':_0x1a75('0x15a')});db[_0x1a75('0x48')][_0x1a75('0x140')](db['Pause'],{'as':_0x1a75('0x145'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1a75('0x48')][_0x1a75('0x114')](db['User'],{'as':_0x1a75('0x15c'),'through':'user_has_fax_accounts'});db[_0x1a75('0x170')][_0x1a75('0x140')](db['User'],{'onDelete':'restrict'});db[_0x1a75('0x170')][_0x1a75('0x140')](db[_0x1a75('0x4e')],{'onDelete':_0x1a75('0x169')});db[_0x1a75('0x170')][_0x1a75('0x140')](db[_0x1a75('0x48')],{'onDelete':_0x1a75('0x169')});db['FaxApplication'][_0x1a75('0x140')](db['Tag'],{'onDelete':_0x1a75('0x169'),'foreignKey':_0x1a75('0x16a')});db[_0x1a75('0x4b')][_0x1a75('0x105')](db['FaxMessage'],{'as':_0x1a75('0x14a'),'onDelete':_0x1a75('0x104'),'foreignKey':'FaxInteractionId'});db[_0x1a75('0x4b')][_0x1a75('0x140')](db[_0x1a75('0x48')],{'as':_0x1a75('0x161'),'foreignKey':_0x1a75('0x16f')});db['FaxInteraction']['belongsTo'](db[_0x1a75('0x6e')],{'as':_0x1a75('0x162'),'foreignKey':_0x1a75('0x152')});db[_0x1a75('0x4b')]['belongsTo'](db['User'],{'as':_0x1a75('0x163'),'foreignKey':'UserId'});db[_0x1a75('0x4b')][_0x1a75('0x114')](db['Tag'],{'through':_0x1a75('0x171'),'as':_0x1a75('0x164')});db['FaxInteraction'][_0x1a75('0x114')](db[_0x1a75('0x88')],{'through':_0x1a75('0x171'),'as':_0x1a75('0x166')});db[_0x1a75('0x4b')]['belongsToMany'](db[_0x1a75('0x14')],{'as':'Users','through':'user_has_fax_interactions','foreignKey':_0x1a75('0x172')});db[_0x1a75('0x4d')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'onDelete':_0x1a75('0x104'),'as':_0x1a75('0x14')});db['FaxMessage'][_0x1a75('0x140')](db[_0x1a75('0x4b')],{'as':_0x1a75('0x168'),'foreignKey':_0x1a75('0x172')});db[_0x1a75('0x4d')]['belongsTo'](db[_0x1a75('0x6e')],{'onDelete':_0x1a75('0x104'),'as':_0x1a75('0x162')});db[_0x1a75('0x4d')]['belongsTo'](db[_0x1a75('0xe8')],{'as':_0x1a75('0xe8'),'foreignKey':'AttachmentId'});db[_0x1a75('0x4d')][_0x1a75('0x140')](db[_0x1a75('0x48')],{'as':'Account','foreignKey':_0x1a75('0x16f')});db[_0x1a75('0x4e')]['belongsToMany'](db['User'],{'as':_0x1a75('0x15c'),'through':'UserFaxQueue'});db[_0x1a75('0x4e')][_0x1a75('0x114')](db[_0x1a75('0xe0')],{'through':_0x1a75('0x173'),'as':_0x1a75('0x147')});db[_0x1a75('0x50')][_0x1a75('0x140')](db[_0x1a75('0x48')],{});db[_0x1a75('0x50')]['belongsTo'](db[_0x1a75('0x119')],{'as':_0x1a75('0x159'),'foreignKey':'ListId'});db[_0x1a75('0x50')][_0x1a75('0x140')](db[_0x1a75('0x6e')],{'as':'Contact','foreignKey':'ContactId'});db[_0x1a75('0x50')]['belongsTo'](db[_0x1a75('0x4b')],{});db[_0x1a75('0x50')][_0x1a75('0x140')](db['FaxMessage'],{});db[_0x1a75('0x50')][_0x1a75('0x140')](db[_0x1a75('0x14')],{});db[_0x1a75('0x50')][_0x1a75('0x140')](db[_0x1a75('0x4e')],{});db[_0x1a75('0x52')][_0x1a75('0x105')](db[_0x1a75('0x157')],{'as':_0x1a75('0x174'),'foreignKey':_0x1a75('0x175')});db[_0x1a75('0x52')][_0x1a75('0x105')](db[_0x1a75('0x158')],{'as':_0x1a75('0x176'),'foreignKey':_0x1a75('0x175')});db[_0x1a75('0x52')]['hasMany'](db['SmsMessage'],{'as':_0x1a75('0x14a'),'foreignKey':'SmsAccountId'});db[_0x1a75('0x52')]['hasMany'](db['SmsInteraction'],{'as':_0x1a75('0x177')});db[_0x1a75('0x52')][_0x1a75('0x105')](db[_0x1a75('0x53')],{'as':'Applications'});db[_0x1a75('0x52')][_0x1a75('0x140')](db[_0x1a75('0x119')],{'as':'List','foreignKey':_0x1a75('0x15a')});db[_0x1a75('0x52')][_0x1a75('0x140')](db[_0x1a75('0x144')],{'as':'mandatoryDispositionPause','foreignKey':_0x1a75('0x146')});db[_0x1a75('0x52')][_0x1a75('0x114')](db['User'],{'as':'Agents','through':_0x1a75('0x12f')});db[_0x1a75('0x53')][_0x1a75('0x140')](db['User'],{'onDelete':_0x1a75('0x169')});db[_0x1a75('0x53')][_0x1a75('0x140')](db[_0x1a75('0x58')],{'onDelete':_0x1a75('0x169')});db[_0x1a75('0x53')]['belongsTo'](db[_0x1a75('0x52')],{'onDelete':_0x1a75('0x169')});db[_0x1a75('0x53')][_0x1a75('0x140')](db['Interval'],{'onDelete':_0x1a75('0x169'),'foreignKey':_0x1a75('0x143')});db[_0x1a75('0x53')][_0x1a75('0x140')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x1a75('0x16a')});db[_0x1a75('0x55')][_0x1a75('0x105')](db[_0x1a75('0x178')],{'as':'Messages','onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x179')});db[_0x1a75('0x55')][_0x1a75('0x140')](db[_0x1a75('0x52')],{'as':_0x1a75('0x161'),'foreignKey':_0x1a75('0x175')});db[_0x1a75('0x55')][_0x1a75('0x140')](db[_0x1a75('0x6e')],{'as':_0x1a75('0x162'),'foreignKey':_0x1a75('0x152')});db[_0x1a75('0x55')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'as':_0x1a75('0x163'),'foreignKey':_0x1a75('0x106')});db[_0x1a75('0x55')]['belongsToMany'](db[_0x1a75('0x88')],{'through':_0x1a75('0x17a'),'as':'Tags'});db['SmsInteraction'][_0x1a75('0x114')](db[_0x1a75('0x88')],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db[_0x1a75('0x55')][_0x1a75('0x114')](db['User'],{'as':'Users','through':'user_has_sms_interactions','foreignKey':_0x1a75('0x179')});db[_0x1a75('0x178')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'as':_0x1a75('0x14')});db[_0x1a75('0x178')][_0x1a75('0x140')](db[_0x1a75('0x6e')],{'onDelete':_0x1a75('0x104'),'as':'Contact'});db['SmsMessage']['belongsTo'](db[_0x1a75('0x55')],{'onDelete':'cascade','as':_0x1a75('0x168'),'foreignKey':_0x1a75('0x179')});db[_0x1a75('0x178')][_0x1a75('0x140')](db['SmsAccount'],{'as':'Account','foreignKey':_0x1a75('0x175')});db['SmsQueue'][_0x1a75('0x114')](db[_0x1a75('0x14')],{'as':'Agents','through':_0x1a75('0x32'),'foreignKey':_0x1a75('0x17b')});db[_0x1a75('0x58')][_0x1a75('0x114')](db[_0x1a75('0xe0')],{'through':'team_has_sms_queues','as':_0x1a75('0x147')});db[_0x1a75('0x5a')][_0x1a75('0x105')](db['Disposition'],{'as':_0x1a75('0x174'),'foreignKey':'OpenchannelAccountId'});db[_0x1a75('0x5a')][_0x1a75('0x105')](db[_0x1a75('0x158')],{'as':_0x1a75('0x176'),'foreignKey':_0x1a75('0x17c')});db['OpenchannelAccount']['hasMany'](db[_0x1a75('0x11f')],{'as':_0x1a75('0x177'),'foreignKey':_0x1a75('0x17c')});db[_0x1a75('0x5a')][_0x1a75('0x105')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0x1a75('0x17c')});db[_0x1a75('0x5a')][_0x1a75('0x105')](db[_0x1a75('0x5c')],{'as':_0x1a75('0x136'),'foreignKey':_0x1a75('0x17c')});db[_0x1a75('0x5a')]['belongsTo'](db[_0x1a75('0x119')],{'as':_0x1a75('0x159'),'foreignKey':_0x1a75('0x15a')});db[_0x1a75('0x5a')]['belongsTo'](db[_0x1a75('0x144')],{'as':'mandatoryDispositionPause','foreignKey':_0x1a75('0x146')});db['OpenchannelAccount']['belongsToMany'](db[_0x1a75('0x14')],{'as':'Agents','through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0x1a75('0x140')](db[_0x1a75('0x14')],{'onDelete':_0x1a75('0x169')});db['OpenchannelApplication'][_0x1a75('0x140')](db[_0x1a75('0x61')],{'onDelete':_0x1a75('0x169'),'foreignKey':_0x1a75('0x17d')});db[_0x1a75('0x5c')][_0x1a75('0x140')](db[_0x1a75('0x5a')],{'onDelete':_0x1a75('0x169'),'foreignKey':'OpenchannelAccountId'});db[_0x1a75('0x5c')][_0x1a75('0x140')](db['Interval'],{'onDelete':_0x1a75('0x169'),'foreignKey':_0x1a75('0x143')});db[_0x1a75('0x5c')][_0x1a75('0x140')](db[_0x1a75('0x88')],{'onDelete':_0x1a75('0x169'),'foreignKey':'TagId'});db[_0x1a75('0x11f')]['hasMany'](db['OpenchannelMessage'],{'as':'Messages','onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x17e')});db[_0x1a75('0x11f')][_0x1a75('0x140')](db[_0x1a75('0x5a')],{'as':_0x1a75('0x161'),'foreignKey':_0x1a75('0x17c')});db[_0x1a75('0x11f')][_0x1a75('0x140')](db[_0x1a75('0x6e')],{'as':_0x1a75('0x162'),'foreignKey':'ContactId'});db[_0x1a75('0x11f')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'as':_0x1a75('0x163'),'foreignKey':_0x1a75('0x106')});db[_0x1a75('0x11f')][_0x1a75('0x114')](db[_0x1a75('0x88')],{'through':'openchannel_interaction_has_tags','as':_0x1a75('0x164')});db[_0x1a75('0x11f')][_0x1a75('0x114')](db[_0x1a75('0x88')],{'through':'openchannel_interaction_has_tags','as':_0x1a75('0x166')});db[_0x1a75('0x11f')][_0x1a75('0x114')](db['User'],{'as':_0x1a75('0x167'),'through':_0x1a75('0x120'),'foreignKey':_0x1a75('0x17e')});db['OpenchannelMessage']['belongsTo'](db['User'],{'onDelete':_0x1a75('0x104'),'as':_0x1a75('0x14')});db['OpenchannelMessage'][_0x1a75('0x140')](db[_0x1a75('0x6e')],{'onDelete':_0x1a75('0x104'),'as':_0x1a75('0x162')});db['OpenchannelMessage'][_0x1a75('0x140')](db[_0x1a75('0x11f')],{'onDelete':_0x1a75('0x104'),'as':'Interaction','foreignKey':'OpenchannelInteractionId'});db[_0x1a75('0x5f')][_0x1a75('0x140')](db[_0x1a75('0xe8')],{'as':'Attachment','foreignKey':_0x1a75('0x17f')});db['OpenchannelMessage'][_0x1a75('0x140')](db[_0x1a75('0x5a')],{'as':_0x1a75('0x161'),'foreignKey':_0x1a75('0x17c')});db[_0x1a75('0x61')][_0x1a75('0x114')](db[_0x1a75('0x14')],{'as':_0x1a75('0x15c'),'through':_0x1a75('0x34'),'foreignKey':_0x1a75('0x17d')});db[_0x1a75('0x61')][_0x1a75('0x114')](db[_0x1a75('0xe0')],{'through':_0x1a75('0x180'),'as':_0x1a75('0x147')});db[_0x1a75('0x62')]['hasMany'](db[_0x1a75('0x157')],{'as':'Dispositions','foreignKey':_0x1a75('0x181')});db['ChatWebsite']['hasMany'](db['CannedAnswer'],{'as':_0x1a75('0x176'),'foreignKey':_0x1a75('0x181')});db[_0x1a75('0x62')][_0x1a75('0x105')](db[_0x1a75('0x6a')],{'as':'ProactiveActions'});db[_0x1a75('0x62')][_0x1a75('0x105')](db[_0x1a75('0x65')],{'as':_0x1a75('0x177')});db[_0x1a75('0x62')]['hasMany'](db[_0x1a75('0x64')],{'as':'Applications'});db[_0x1a75('0x62')][_0x1a75('0x105')](db[_0x1a75('0x67')],{'as':_0x1a75('0x14a')});db[_0x1a75('0x62')][_0x1a75('0x140')](db[_0x1a75('0x119')],{'as':_0x1a75('0x159'),'foreignKey':_0x1a75('0x15a')});db[_0x1a75('0x62')]['belongsTo'](db[_0x1a75('0x7f')],{'as':_0x1a75('0x7f'),'foreignKey':_0x1a75('0x143')});db[_0x1a75('0x62')]['belongsTo'](db[_0x1a75('0x144')],{'as':'mandatoryDispositionPause','foreignKey':_0x1a75('0x146')});db[_0x1a75('0x62')][_0x1a75('0x114')](db[_0x1a75('0x14')],{'as':_0x1a75('0x15c'),'through':_0x1a75('0x12a')});db['OpenchannelQueueReport'][_0x1a75('0x140')](db[_0x1a75('0x5a')],{});db[_0x1a75('0x182')][_0x1a75('0x140')](db['CmList'],{'as':'List','foreignKey':_0x1a75('0x15a')});db[_0x1a75('0x182')][_0x1a75('0x140')](db['CmContact'],{'as':_0x1a75('0x162'),'foreignKey':_0x1a75('0x152')});db[_0x1a75('0x182')][_0x1a75('0x140')](db['OpenchannelInteraction'],{});db[_0x1a75('0x182')][_0x1a75('0x140')](db[_0x1a75('0x5f')],{});db['OpenchannelQueueReport']['belongsTo'](db['User'],{});db[_0x1a75('0x182')]['belongsTo'](db[_0x1a75('0x61')],{});db[_0x1a75('0x64')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'as':_0x1a75('0x183'),'foreignKey':_0x1a75('0x106'),'onDelete':'restrict'});db['ChatApplication'][_0x1a75('0x140')](db[_0x1a75('0x123')],{'as':_0x1a75('0x184'),'foreignKey':_0x1a75('0x185'),'onDelete':_0x1a75('0x169')});db[_0x1a75('0x64')][_0x1a75('0x140')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x1a75('0x181'),'onDelete':_0x1a75('0x169')});db[_0x1a75('0x64')]['belongsTo'](db[_0x1a75('0x88')],{'onDelete':'restrict','foreignKey':_0x1a75('0x16a')});db['ChatInteraction'][_0x1a75('0x105')](db[_0x1a75('0x67')],{'as':_0x1a75('0x14a'),'onDelete':_0x1a75('0x104'),'foreignKey':'ChatInteractionId'});db[_0x1a75('0x65')][_0x1a75('0x140')](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x1a75('0x65')][_0x1a75('0x140')](db[_0x1a75('0x6e')],{'as':'Contact','foreignKey':_0x1a75('0x152')});db[_0x1a75('0x65')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'as':_0x1a75('0x163'),'foreignKey':_0x1a75('0x106')});db[_0x1a75('0x65')][_0x1a75('0x114')](db['Tag'],{'through':_0x1a75('0x186'),'as':_0x1a75('0x164')});db[_0x1a75('0x65')][_0x1a75('0x114')](db[_0x1a75('0x88')],{'through':'chat_interaction_has_tags','as':_0x1a75('0x166')});db[_0x1a75('0x65')][_0x1a75('0x114')](db[_0x1a75('0x14')],{'as':_0x1a75('0x167'),'through':_0x1a75('0x11e'),'foreignKey':'ChatInteractionId'});db[_0x1a75('0x67')][_0x1a75('0x140')](db['User'],{'onDelete':_0x1a75('0x104'),'as':'User'});db[_0x1a75('0x67')][_0x1a75('0x140')](db['CmContact'],{'onDelete':_0x1a75('0x104'),'as':_0x1a75('0x162'),'foreignKey':_0x1a75('0x152')});db[_0x1a75('0x67')][_0x1a75('0x140')](db[_0x1a75('0x65')],{'onDelete':_0x1a75('0x104'),'as':'Interaction','foreignKey':'ChatInteractionId'});db[_0x1a75('0x67')][_0x1a75('0x140')](db['Attachment'],{'as':_0x1a75('0xe8'),'foreignKey':_0x1a75('0x17f')});db[_0x1a75('0x67')]['belongsTo'](db[_0x1a75('0x62')],{'as':'Account','foreignKey':_0x1a75('0x181')});db[_0x1a75('0x187')][_0x1a75('0x140')](db[_0x1a75('0x6e')],{'onDelete':'cascade','as':_0x1a75('0x162'),'foreignKey':'ContactId'});db[_0x1a75('0x187')]['belongsTo'](db[_0x1a75('0x62')],{'as':_0x1a75('0x161'),'foreignKey':_0x1a75('0x181')});db[_0x1a75('0x123')]['belongsToMany'](db[_0x1a75('0x14')],{'as':_0x1a75('0x15c'),'through':_0x1a75('0x125'),'hooks':!![]});db['ChatQueue']['belongsToMany'](db[_0x1a75('0xe0')],{'through':_0x1a75('0x188'),'as':'Teams'});db[_0x1a75('0x115')][_0x1a75('0x105')](db[_0x1a75('0x189')],{'as':_0x1a75('0x14a'),'foreignKey':_0x1a75('0x18a'),'onDelete':'cascade'});db[_0x1a75('0x115')][_0x1a75('0x114')](db[_0x1a75('0x14')],{'as':_0x1a75('0x139'),'through':_0x1a75('0x117')});db[_0x1a75('0x6a')]['belongsTo'](db[_0x1a75('0x62')],{'as':_0x1a75('0x18b'),'foreignKey':_0x1a75('0x181')});db[_0x1a75('0x6c')][_0x1a75('0x105')](db['CmContact'],{'as':_0x1a75('0x18c'),'foreignKey':'CompanyId'});db['CmContact'][_0x1a75('0x105')](db['CmHopper'],{'as':'Hoppers','foreignKey':'ContactId'});db[_0x1a75('0x6e')][_0x1a75('0x105')](db[_0x1a75('0x72')],{'as':_0x1a75('0x10b'),'foreignKey':'ContactId'});db['CmContact']['hasMany'](db['CmHopperHistory'],{'as':_0x1a75('0x13d'),'foreignKey':_0x1a75('0x152')});db[_0x1a75('0x6e')][_0x1a75('0x105')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x1a75('0x152')});db[_0x1a75('0x6e')][_0x1a75('0x105')](db[_0x1a75('0xd0')],{'as':_0x1a75('0x13f'),'foreignKey':_0x1a75('0x152')});db[_0x1a75('0x6e')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x1a75('0x10c'),'foreignKey':_0x1a75('0x152'),'onDelete':_0x1a75('0x169')});db[_0x1a75('0x6e')]['hasMany'](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x1a75('0x152'),'onDelete':_0x1a75('0x169')});db[_0x1a75('0x6e')]['hasMany'](db[_0x1a75('0x55')],{'as':_0x1a75('0x10e'),'foreignKey':_0x1a75('0x152'),'onDelete':_0x1a75('0x169')});db[_0x1a75('0x6e')][_0x1a75('0x105')](db[_0x1a75('0x4b')],{'as':_0x1a75('0x10f'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x1a75('0x6e')][_0x1a75('0x105')](db[_0x1a75('0x3f')],{'as':_0x1a75('0x110'),'foreignKey':'ContactId','onDelete':_0x1a75('0x169')});db[_0x1a75('0x6e')][_0x1a75('0x140')](db[_0x1a75('0x6c')],{'as':'Company','foreignKey':_0x1a75('0x18d')});db[_0x1a75('0x6e')][_0x1a75('0x140')](db[_0x1a75('0x119')],{'as':_0x1a75('0x159'),'foreignKey':_0x1a75('0x15a'),'onDelete':_0x1a75('0x104')});db[_0x1a75('0x6e')]['belongsToMany'](db[_0x1a75('0x14')],{'as':_0x1a75('0x167'),'through':'cm_user_has_contacts'});db[_0x1a75('0x6e')][_0x1a75('0x114')](db['Tag'],{'as':_0x1a75('0x164'),'through':_0x1a75('0x18e')});db['CmContact'][_0x1a75('0x114')](db[_0x1a75('0x88')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0x1a75('0x6f')][_0x1a75('0x140')](db[_0x1a75('0x6e')],{'as':'Contact','foreignKey':'ContactId','onDelete':'cascade'});db[_0x1a75('0x6f')][_0x1a75('0x140')](db['CmList'],{'as':_0x1a75('0x159'),'foreignKey':_0x1a75('0x15a'),'onDelete':_0x1a75('0x104')});db['CmHopper'][_0x1a75('0x140')](db[_0x1a75('0x14')],{'as':_0x1a75('0x183'),'foreignKey':'UserId'});db['CmHopper'][_0x1a75('0x140')](db[_0x1a75('0x1c')],{'as':_0x1a75('0x184'),'foreignKey':_0x1a75('0x13a'),'onDelete':_0x1a75('0x104')});db[_0x1a75('0x6f')]['belongsTo'](db[_0x1a75('0xe4')],{'as':_0x1a75('0xe4'),'foreignKey':_0x1a75('0x18f'),'onDelete':_0x1a75('0x104')});db['CmHopper'][_0x1a75('0x140')](db['User'],{'as':_0x1a75('0x163'),'foreignKey':_0x1a75('0x190')});db[_0x1a75('0x71')][_0x1a75('0x140')](db['CmContact'],{'as':_0x1a75('0x162'),'foreignKey':'ContactId','onDelete':_0x1a75('0x104')});db[_0x1a75('0x71')][_0x1a75('0x140')](db[_0x1a75('0x119')],{'as':_0x1a75('0x159'),'foreignKey':_0x1a75('0x15a'),'onDelete':_0x1a75('0x104')});db[_0x1a75('0x71')][_0x1a75('0x140')](db['VoiceQueue'],{'as':_0x1a75('0x184'),'foreignKey':_0x1a75('0x13a'),'onDelete':_0x1a75('0x104')});db[_0x1a75('0x71')][_0x1a75('0x140')](db[_0x1a75('0xe4')],{'as':_0x1a75('0xe4'),'foreignKey':_0x1a75('0x18f'),'onDelete':_0x1a75('0x104')});db[_0x1a75('0x7a')][_0x1a75('0x105')](db[_0x1a75('0x7d')],{'as':{'plural':_0x1a75('0x191'),'singular':_0x1a75('0x192')},'foreignKey':_0x1a75('0x193'),'onDelete':_0x1a75('0x104'),'hooks':!![]});db['Automation'][_0x1a75('0x105')](db[_0x1a75('0x7d')],{'as':{'plural':'Any','singular':_0x1a75('0x194')},'foreignKey':'AutomationAnyId','onDelete':_0x1a75('0x104'),'hooks':!![]});db[_0x1a75('0x7a')][_0x1a75('0x105')](db[_0x1a75('0x78')],{'as':_0x1a75('0x195'),'foreignKey':_0x1a75('0x196'),'onDelete':_0x1a75('0x104'),'hooks':!![]});db['Interval'][_0x1a75('0x105')](db[_0x1a75('0x7f')],{'as':_0x1a75('0x197'),'foreignKey':'IntervalId','onDelete':_0x1a75('0x104'),'hooks':!![],'required':![]});db[_0x1a75('0x7f')][_0x1a75('0x105')](db[_0x1a75('0x109')],{'as':_0x1a75('0x10a'),'foreignKey':_0x1a75('0x143'),'onDelete':_0x1a75('0x169')});db[_0x1a75('0x7f')][_0x1a75('0x105')](db[_0x1a75('0x43')],{'as':_0x1a75('0x198'),'foreignKey':_0x1a75('0x143')});db['Interval'][_0x1a75('0x105')](db[_0x1a75('0x64')],{'as':_0x1a75('0x199'),'foreignKey':_0x1a75('0x143')});db[_0x1a75('0x7f')][_0x1a75('0x105')](db['FaxApplication'],{'as':_0x1a75('0x19a'),'foreignKey':'IntervalId'});db['Interval'][_0x1a75('0x105')](db[_0x1a75('0x53')],{'as':'SmsApplications','foreignKey':'IntervalId'});db[_0x1a75('0x19b')][_0x1a75('0x140')](db[_0x1a75('0x3a')],{});db['Schedule'][_0x1a75('0x140')](db['AnalyticDefaultReport'],{'foreignKey':_0x1a75('0x19c')});db[_0x1a75('0x19b')][_0x1a75('0x140')](db['AnalyticCustomReport'],{'foreignKey':_0x1a75('0x19d')});db[_0x1a75('0x86')][_0x1a75('0x114')](db[_0x1a75('0x19e')],{'as':_0x1a75('0x19f'),'through':_0x1a75('0x138'),'onDelete':_0x1a75('0x169')});db[_0x1a75('0x88')][_0x1a75('0x114')](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0x1a75('0x88')][_0x1a75('0x114')](db[_0x1a75('0x65')],{'through':_0x1a75('0x186')});db['Tag']['belongsToMany'](db[_0x1a75('0x3f')],{'through':'mail_interaction_has_tags'});db[_0x1a75('0x88')][_0x1a75('0x114')](db['SmsInteraction'],{'through':_0x1a75('0x17a')});db[_0x1a75('0x88')][_0x1a75('0x114')](db[_0x1a75('0x4b')],{'through':_0x1a75('0x171')});db['Tag'][_0x1a75('0x114')](db[_0x1a75('0x11f')],{'through':_0x1a75('0x1a0')});db[_0x1a75('0x88')][_0x1a75('0x114')](db[_0x1a75('0xfa')],{'through':'whatsapp_interaction_has_tags'});db[_0x1a75('0x8b')]['hasMany'](db[_0x1a75('0x7d')],{'as':{'plural':_0x1a75('0x1a1'),'singular':_0x1a75('0x1a2')},'foreignKey':_0x1a75('0x1a3'),'onDelete':_0x1a75('0x104'),'hooks':!![]});db[_0x1a75('0x8b')][_0x1a75('0x105')](db[_0x1a75('0x7d')],{'as':{'plural':_0x1a75('0x1a4'),'singular':_0x1a75('0x1a5')},'foreignKey':_0x1a75('0x1a6'),'onDelete':_0x1a75('0x104'),'hooks':!![]});db['Trigger']['hasMany'](db[_0x1a75('0x78')],{'as':_0x1a75('0x195'),'foreignKey':_0x1a75('0x1a7'),'onDelete':_0x1a75('0x104'),'hooks':!![]});db['AnalyticCustomReport'][_0x1a75('0x105')](db[_0x1a75('0x96')],{'as':_0x1a75('0x1a8'),'onDelete':'cascade','foreignKey':_0x1a75('0x19d'),'hooks':!![]});db[_0x1a75('0x1a9')][_0x1a75('0x105')](db['AnalyticFieldReport'],{'as':_0x1a75('0x1a8'),'onDelete':_0x1a75('0x104'),'foreignKey':'DefaultReportId'});db[_0x1a75('0x1aa')][_0x1a75('0x105')](db[_0x1a75('0x96')],{'as':_0x1a75('0x1a8'),'onDelete':'cascade','foreignKey':_0x1a75('0x1ab')});db['AnalyticFieldReport'][_0x1a75('0x140')](db[_0x1a75('0x1aa')],{'foreignKey':'MetricId'});db[_0x1a75('0x9a')]['hasMany'](db[_0x1a75('0x9c')],{'as':_0x1a75('0x1ac'),'onDelete':_0x1a75('0x104'),'foreignKey':'AccountId'});db[_0x1a75('0x9c')]['hasMany'](db[_0x1a75('0x9e')],{'as':_0x1a75('0x1ad'),'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1ae')});db['SalesforceConfiguration']['hasMany'](db[_0x1a75('0x9e')],{'as':_0x1a75('0x1af'),'onDelete':_0x1a75('0x104'),'foreignKey':'DescriptionId'});db[_0x1a75('0x9c')][_0x1a75('0x105')](db['SalesforceField'],{'as':_0x1a75('0x1a8'),'onDelete':_0x1a75('0x104'),'foreignKey':'FieldId'});db[_0x1a75('0x9c')][_0x1a75('0x140')](db[_0x1a75('0x9a')],{'as':_0x1a75('0x161'),'foreignKey':_0x1a75('0x1b0')});db['SalesforceField']['hasMany'](db[_0x1a75('0x9e')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x1a75('0x9e')]['hasMany'](db[_0x1a75('0x9e')],{'as':'Description','foreignKey':_0x1a75('0x1b1')});db['SalesforceField'][_0x1a75('0x105')](db[_0x1a75('0x9e')],{'as':_0x1a75('0x1b2'),'foreignKey':_0x1a75('0x1b3')});db['SalesforceField'][_0x1a75('0x140')](db[_0x1a75('0x8d')],{'as':_0x1a75('0x8d'),'foreignKey':_0x1a75('0x1b4')});db[_0x1a75('0x1b5')][_0x1a75('0x105')](db[_0x1a75('0xa1')],{'as':_0x1a75('0x1ac'),'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1b0')});db[_0x1a75('0xa1')][_0x1a75('0x105')](db[_0x1a75('0xa3')],{'as':_0x1a75('0x1ad'),'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1ae')});db['SugarcrmConfiguration'][_0x1a75('0x105')](db[_0x1a75('0xa3')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x1a75('0x1b1')});db['SugarcrmConfiguration'][_0x1a75('0x105')](db[_0x1a75('0xa3')],{'as':_0x1a75('0x1a8'),'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1b3')});db['SugarcrmConfiguration'][_0x1a75('0x140')](db['SugarcrmAccount'],{'as':_0x1a75('0x161'),'foreignKey':'AccountId'});db[_0x1a75('0xa3')]['hasMany'](db[_0x1a75('0xa3')],{'as':_0x1a75('0x1b6'),'foreignKey':_0x1a75('0x1ae')});db[_0x1a75('0xa3')][_0x1a75('0x105')](db[_0x1a75('0xa3')],{'as':_0x1a75('0x1b7'),'foreignKey':'DescriptionId'});db[_0x1a75('0xa3')]['hasMany'](db[_0x1a75('0xa3')],{'as':_0x1a75('0x1b2'),'foreignKey':_0x1a75('0x1b3')});db[_0x1a75('0xa3')]['belongsTo'](db[_0x1a75('0x8d')],{'as':'Variable','foreignKey':_0x1a75('0x1b4')});db[_0x1a75('0xa5')][_0x1a75('0x105')](db[_0x1a75('0x1b8')],{'as':_0x1a75('0x1ac'),'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1b0')});db[_0x1a75('0x1b8')][_0x1a75('0x105')](db[_0x1a75('0xa7')],{'as':_0x1a75('0x1ad'),'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1ae')});db[_0x1a75('0x1b8')][_0x1a75('0x105')](db[_0x1a75('0xa7')],{'as':_0x1a75('0x1af'),'onDelete':'cascade','foreignKey':_0x1a75('0x1b1')});db[_0x1a75('0x1b8')][_0x1a75('0x105')](db[_0x1a75('0xa7')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x1a75('0x1b3')});db['DeskConfiguration'][_0x1a75('0x140')](db['DeskAccount'],{'as':_0x1a75('0x161'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0x1a75('0x114')](db[_0x1a75('0x88')],{'through':'int_desk_configuration_has_tags'});db[_0x1a75('0xa7')][_0x1a75('0x105')](db[_0x1a75('0xa7')],{'as':_0x1a75('0x1b6'),'foreignKey':_0x1a75('0x1ae')});db[_0x1a75('0xa7')][_0x1a75('0x105')](db[_0x1a75('0xa7')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x1a75('0xa7')][_0x1a75('0x105')](db[_0x1a75('0xa7')],{'as':_0x1a75('0x1b2'),'foreignKey':'FieldId'});db[_0x1a75('0xa7')][_0x1a75('0x140')](db[_0x1a75('0x8d')],{'as':_0x1a75('0x8d'),'foreignKey':_0x1a75('0x1b4')});db[_0x1a75('0xa8')]['hasMany'](db[_0x1a75('0xaa')],{'as':_0x1a75('0x1ac'),'onDelete':_0x1a75('0x104'),'foreignKey':'AccountId'});db[_0x1a75('0xaa')][_0x1a75('0x105')](db['ZohoField'],{'as':_0x1a75('0x1ad'),'onDelete':'cascade','foreignKey':_0x1a75('0x1ae')});db[_0x1a75('0xaa')]['hasMany'](db[_0x1a75('0xab')],{'as':_0x1a75('0x1af'),'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1b1')});db[_0x1a75('0xaa')][_0x1a75('0x105')](db['ZohoField'],{'as':'Fields','onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1b3')});db[_0x1a75('0xaa')][_0x1a75('0x140')](db[_0x1a75('0xa8')],{'as':_0x1a75('0x161'),'foreignKey':_0x1a75('0x1b0')});db[_0x1a75('0xab')][_0x1a75('0x105')](db['ZohoField'],{'as':_0x1a75('0x1b6'),'foreignKey':_0x1a75('0x1ae')});db[_0x1a75('0xab')]['hasMany'](db[_0x1a75('0xab')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x1a75('0xab')][_0x1a75('0x105')](db[_0x1a75('0xab')],{'as':'Field','foreignKey':'FieldId'});db[_0x1a75('0xab')][_0x1a75('0x140')](db[_0x1a75('0x8d')],{'as':_0x1a75('0x8d'),'foreignKey':_0x1a75('0x1b4')});db[_0x1a75('0xad')][_0x1a75('0x105')](db[_0x1a75('0xaf')],{'as':_0x1a75('0x1ac'),'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1b0')});db[_0x1a75('0xaf')]['hasMany'](db[_0x1a75('0xb1')],{'as':_0x1a75('0x1ad'),'foreignKey':_0x1a75('0x1ae')});db[_0x1a75('0xaf')][_0x1a75('0x105')](db[_0x1a75('0xb1')],{'as':_0x1a75('0x1af'),'foreignKey':_0x1a75('0x1b1')});db[_0x1a75('0xaf')]['hasMany'](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db['ZendeskConfiguration'][_0x1a75('0x140')](db['ZendeskAccount'],{'as':_0x1a75('0x161'),'foreignKey':_0x1a75('0x1b0')});db['ZendeskConfiguration'][_0x1a75('0x114')](db['Tag'],{'through':_0x1a75('0x1b9')});db[_0x1a75('0xb1')][_0x1a75('0x105')](db['ZendeskField'],{'as':_0x1a75('0x1b6'),'foreignKey':_0x1a75('0x1ae')});db[_0x1a75('0xb1')][_0x1a75('0x105')](db[_0x1a75('0xb1')],{'as':'Description','foreignKey':_0x1a75('0x1b1')});db[_0x1a75('0xb1')]['hasMany'](db['ZendeskField'],{'as':'Field','foreignKey':_0x1a75('0x1b3')});db[_0x1a75('0xb1')][_0x1a75('0x140')](db[_0x1a75('0x8d')],{'as':_0x1a75('0x8d'),'foreignKey':_0x1a75('0x1b4')});db['FreshdeskAccount'][_0x1a75('0x105')](db['FreshdeskConfiguration'],{'as':_0x1a75('0x1ac'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x1a75('0x1ba')]['hasMany'](db[_0x1a75('0x1bb')],{'as':'Subjects','onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1ae')});db[_0x1a75('0x1ba')][_0x1a75('0x105')](db[_0x1a75('0x1bb')],{'as':_0x1a75('0x1af'),'onDelete':_0x1a75('0x104'),'foreignKey':'DescriptionId'});db[_0x1a75('0x1ba')][_0x1a75('0x105')](db[_0x1a75('0x1bb')],{'as':_0x1a75('0x1a8'),'onDelete':'cascade','foreignKey':_0x1a75('0x1b3')});db[_0x1a75('0x1ba')]['belongsTo'](db[_0x1a75('0xb3')],{'as':'Account','foreignKey':'AccountId'});db[_0x1a75('0x1ba')]['belongsToMany'](db[_0x1a75('0x88')],{'through':_0x1a75('0x1bc')});db[_0x1a75('0x1bb')][_0x1a75('0x105')](db['FreshdeskField'],{'as':_0x1a75('0x1b6'),'foreignKey':_0x1a75('0x1ae')});db['FreshdeskField'][_0x1a75('0x105')](db[_0x1a75('0x1bb')],{'as':_0x1a75('0x1b7'),'foreignKey':_0x1a75('0x1b1')});db[_0x1a75('0x1bb')][_0x1a75('0x105')](db['FreshdeskField'],{'as':'Field','foreignKey':_0x1a75('0x1b3')});db[_0x1a75('0x1bb')][_0x1a75('0x140')](db[_0x1a75('0x8d')],{'as':_0x1a75('0x8d'),'foreignKey':'VariableId'});db[_0x1a75('0x1bd')]['hasMany'](db[_0x1a75('0xb7')],{'as':_0x1a75('0x1ac'),'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1b0')});db['VtigerConfiguration']['hasMany'](db[_0x1a75('0x1be')],{'as':'Subjects','foreignKey':_0x1a75('0x1ae')});db['VtigerConfiguration']['hasMany'](db[_0x1a75('0x1be')],{'as':_0x1a75('0x1af'),'foreignKey':'DescriptionId'});db[_0x1a75('0xb7')][_0x1a75('0x105')](db[_0x1a75('0x1be')],{'as':_0x1a75('0x1a8'),'foreignKey':_0x1a75('0x1b3')});db[_0x1a75('0xb7')]['belongsTo'](db['VtigerAccount'],{'as':_0x1a75('0x161'),'foreignKey':'AccountId'});db[_0x1a75('0x1be')][_0x1a75('0x105')](db[_0x1a75('0x1be')],{'as':_0x1a75('0x1b6'),'foreignKey':_0x1a75('0x1ae')});db[_0x1a75('0x1be')][_0x1a75('0x105')](db['VtigerField'],{'as':_0x1a75('0x1b7'),'foreignKey':'DescriptionId'});db[_0x1a75('0x1be')][_0x1a75('0x105')](db[_0x1a75('0x1be')],{'as':_0x1a75('0x1b2'),'foreignKey':_0x1a75('0x1b3')});db[_0x1a75('0x1be')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x1a75('0xb9')]['hasMany'](db[_0x1a75('0xbb')],{'as':_0x1a75('0x1ac'),'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1b0')});db[_0x1a75('0xbb')]['hasMany'](db[_0x1a75('0xbd')],{'as':_0x1a75('0x1ad'),'foreignKey':_0x1a75('0x1ae')});db['ServicenowConfiguration'][_0x1a75('0x105')](db['ServicenowField'],{'as':_0x1a75('0x1af'),'foreignKey':_0x1a75('0x1b1')});db[_0x1a75('0xbb')][_0x1a75('0x105')](db[_0x1a75('0xbd')],{'as':'Fields','foreignKey':_0x1a75('0x1b3')});db[_0x1a75('0xbb')][_0x1a75('0x140')](db[_0x1a75('0xb9')],{'as':'Account','foreignKey':'AccountId'});db[_0x1a75('0xbd')][_0x1a75('0x105')](db[_0x1a75('0xbd')],{'as':_0x1a75('0x1b6'),'foreignKey':_0x1a75('0x1ae')});db[_0x1a75('0xbd')][_0x1a75('0x105')](db[_0x1a75('0xbd')],{'as':_0x1a75('0x1b7'),'foreignKey':_0x1a75('0x1b1')});db[_0x1a75('0xbd')][_0x1a75('0x105')](db[_0x1a75('0xbd')],{'as':_0x1a75('0x1b2'),'foreignKey':'FieldId'});db[_0x1a75('0xbd')]['belongsTo'](db[_0x1a75('0x8d')],{'as':_0x1a75('0x8d'),'foreignKey':_0x1a75('0x1b4')});db[_0x1a75('0x1bf')][_0x1a75('0x105')](db[_0x1a75('0xc0')],{'as':_0x1a75('0x1ac'),'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1b0')});db['Dynamics365Configuration'][_0x1a75('0x105')](db[_0x1a75('0xc1')],{'as':_0x1a75('0x1ad'),'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1ae')});db[_0x1a75('0xc0')]['hasMany'](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0x1a75('0x104'),'foreignKey':'DescriptionId'});db[_0x1a75('0xc0')][_0x1a75('0x105')](db[_0x1a75('0xc1')],{'as':_0x1a75('0x1a8'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x1a75('0xc0')]['belongsTo'](db[_0x1a75('0x1bf')],{'as':'Account','foreignKey':'AccountId'});db[_0x1a75('0xc1')]['hasMany'](db['Dynamics365Field'],{'as':_0x1a75('0x1b6'),'foreignKey':_0x1a75('0x1ae')});db['Dynamics365Field'][_0x1a75('0x105')](db[_0x1a75('0xc1')],{'as':_0x1a75('0x1b7'),'foreignKey':_0x1a75('0x1b1')});db[_0x1a75('0xc1')][_0x1a75('0x105')](db[_0x1a75('0xc1')],{'as':_0x1a75('0x1b2'),'foreignKey':_0x1a75('0x1b3')});db['Dynamics365Field'][_0x1a75('0x140')](db[_0x1a75('0x8d')],{'as':_0x1a75('0x8d'),'foreignKey':_0x1a75('0x1b4')});db['FreshsalesAccount'][_0x1a75('0x105')](db[_0x1a75('0x1c0')],{'as':_0x1a75('0x1ac'),'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1b0')});db[_0x1a75('0x1c0')]['hasMany'](db[_0x1a75('0xc5')],{'as':'Subjects','foreignKey':_0x1a75('0x1ae')});db[_0x1a75('0x1c0')]['hasMany'](db[_0x1a75('0xc5')],{'as':_0x1a75('0x1af'),'foreignKey':_0x1a75('0x1b1')});db['FreshsalesConfiguration'][_0x1a75('0x105')](db['FreshsalesField'],{'as':_0x1a75('0x1a8'),'foreignKey':_0x1a75('0x1b3')});db[_0x1a75('0x1c0')]['belongsTo'](db[_0x1a75('0xc3')],{'as':_0x1a75('0x161'),'foreignKey':'AccountId'});db['FreshsalesField'][_0x1a75('0x105')](db[_0x1a75('0xc5')],{'as':'Subject','foreignKey':_0x1a75('0x1ae')});db[_0x1a75('0xc5')][_0x1a75('0x105')](db['FreshsalesField'],{'as':_0x1a75('0x1b7'),'foreignKey':_0x1a75('0x1b1')});db[_0x1a75('0xc5')][_0x1a75('0x105')](db[_0x1a75('0xc5')],{'as':_0x1a75('0x1b2'),'foreignKey':_0x1a75('0x1b3')});db[_0x1a75('0xc5')][_0x1a75('0x140')](db[_0x1a75('0x8d')],{'as':'Variable','foreignKey':'VariableId'});db[_0x1a75('0xc9')]['belongsTo'](db[_0x1a75('0x62')],{});db[_0x1a75('0xc9')][_0x1a75('0x140')](db[_0x1a75('0x119')],{'as':_0x1a75('0x159'),'foreignKey':_0x1a75('0x15a')});db[_0x1a75('0xc9')][_0x1a75('0x140')](db[_0x1a75('0x6e')],{'as':_0x1a75('0x162'),'foreignKey':'ContactId'});db[_0x1a75('0xc9')][_0x1a75('0x140')](db['ChatInteraction'],{});db[_0x1a75('0xc9')][_0x1a75('0x140')](db[_0x1a75('0x67')],{});db[_0x1a75('0xc9')][_0x1a75('0x140')](db[_0x1a75('0x14')],{});db[_0x1a75('0xc9')][_0x1a75('0x140')](db[_0x1a75('0x123')],{});db[_0x1a75('0x189')][_0x1a75('0x140')](db['User'],{'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1c1')});db[_0x1a75('0x189')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'onDelete':_0x1a75('0x104'),'foreignKey':'ToId'});db[_0x1a75('0xd0')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x1a75('0x1c2'),'onDelete':_0x1a75('0x104')});db[_0x1a75('0xd0')][_0x1a75('0x105')](db[_0x1a75('0xcc')],{'foreignKey':_0x1a75('0x1c2'),'onDelete':_0x1a75('0x104')});db['SmsQueueReport'][_0x1a75('0x140')](db[_0x1a75('0x52')],{});db['SmsQueueReport'][_0x1a75('0x140')](db[_0x1a75('0x119')],{'as':_0x1a75('0x159'),'foreignKey':_0x1a75('0x15a')});db[_0x1a75('0x1c3')][_0x1a75('0x140')](db[_0x1a75('0x6e')],{'as':_0x1a75('0x162'),'foreignKey':'ContactId'});db[_0x1a75('0x1c3')][_0x1a75('0x140')](db[_0x1a75('0x55')],{});db['SmsQueueReport'][_0x1a75('0x140')](db[_0x1a75('0x178')],{});db[_0x1a75('0x1c3')][_0x1a75('0x140')](db[_0x1a75('0x14')],{});db[_0x1a75('0x1c3')][_0x1a75('0x140')](db[_0x1a75('0x58')],{});db[_0x1a75('0xd6')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x1a75('0x105')](db[_0x1a75('0xce')],{'foreignKey':'ProjectId'});db['JscriptyProject']['hasMany'](db[_0x1a75('0xcc')],{'foreignKey':_0x1a75('0x1c4')});db[_0x1a75('0xdc')][_0x1a75('0x114')](db['User'],{'as':_0x1a75('0x167'),'through':_0x1a75('0x133')});db['Team']['belongsToMany'](db[_0x1a75('0x14')],{'as':_0x1a75('0x15c'),'through':_0x1a75('0x11c')});db[_0x1a75('0xe0')][_0x1a75('0x114')](db[_0x1a75('0x1c')],{'through':_0x1a75('0x1c5'),'as':_0x1a75('0x121')});db[_0x1a75('0xe0')][_0x1a75('0x114')](db[_0x1a75('0x3c')],{'through':_0x1a75('0x15f'),'as':_0x1a75('0x122')});db[_0x1a75('0xe0')][_0x1a75('0x114')](db['ChatQueue'],{'through':_0x1a75('0x188'),'as':_0x1a75('0x124')});db[_0x1a75('0xe0')][_0x1a75('0x114')](db['FaxQueue'],{'through':_0x1a75('0x173'),'as':_0x1a75('0x1c6')});db['Team'][_0x1a75('0x114')](db[_0x1a75('0x58')],{'through':'team_has_sms_queues','as':_0x1a75('0x126')});db[_0x1a75('0xe0')][_0x1a75('0x114')](db[_0x1a75('0x61')],{'through':_0x1a75('0x180'),'as':_0x1a75('0x1c7')});db['Team'][_0x1a75('0x114')](db[_0x1a75('0xff')],{'through':_0x1a75('0x1c8'),'as':_0x1a75('0x127')});db[_0x1a75('0xe4')][_0x1a75('0x105')](db[_0x1a75('0x6f')],{'as':_0x1a75('0x13b'),'foreignKey':_0x1a75('0x18f')});db[_0x1a75('0xe4')][_0x1a75('0x105')](db[_0x1a75('0x72')],{'as':_0x1a75('0x10b'),'foreignKey':_0x1a75('0x18f')});db[_0x1a75('0xe4')][_0x1a75('0x105')](db[_0x1a75('0x13c')],{'as':_0x1a75('0x13d'),'foreignKey':_0x1a75('0x18f')});db[_0x1a75('0xe4')][_0x1a75('0x105')](db[_0x1a75('0x71')],{'as':_0x1a75('0x13e'),'foreignKey':_0x1a75('0x18f')});db[_0x1a75('0xe4')]['belongsTo'](db[_0x1a75('0x2b')],{'as':_0x1a75('0x2b'),'foreignKey':'TrunkId'});db[_0x1a75('0xe4')][_0x1a75('0x140')](db[_0x1a75('0x2b')],{'as':_0x1a75('0x142'),'foreignKey':_0x1a75('0x1c9')});db[_0x1a75('0xe4')]['belongsTo'](db[_0x1a75('0x7f')],{'as':_0x1a75('0x7f'),'foreignKey':'IntervalId'});db['Campaign'][_0x1a75('0x140')](db[_0x1a75('0xdc')],{'as':'SquareProject','foreignKey':_0x1a75('0x1ca')});db[_0x1a75('0xe4')][_0x1a75('0x114')](db[_0x1a75('0x119')],{'as':'Lists','through':_0x1a75('0x1cb')});db[_0x1a75('0xe4')][_0x1a75('0x114')](db[_0x1a75('0x119')],{'as':'BlackLists','through':_0x1a75('0x1cc')});db['MailTransferReport']['belongsTo'](db[_0x1a75('0x41')],{});db[_0x1a75('0xea')]['belongsTo'](db['MailInteraction'],{});db[_0x1a75('0xea')][_0x1a75('0x140')](db[_0x1a75('0x3a')],{'foreignKey':_0x1a75('0x1cd'),'as':_0x1a75('0x1ce')});db['MailTransferReport'][_0x1a75('0x140')](db[_0x1a75('0x14')],{'foreignKey':_0x1a75('0x1cf'),'as':_0x1a75('0x1d0')});db['MailTransferReport'][_0x1a75('0x140')](db[_0x1a75('0x14')],{'foreignKey':_0x1a75('0x1d1'),'as':_0x1a75('0x1d2')});db[_0x1a75('0xea')][_0x1a75('0x140')](db['MailQueue'],{'foreignKey':_0x1a75('0x1d3'),'as':_0x1a75('0x1d4')});db[_0x1a75('0xea')][_0x1a75('0x140')](db[_0x1a75('0x3a')],{'foreignKey':_0x1a75('0x1d5'),'as':_0x1a75('0x1d6')});db[_0x1a75('0x1d7')]['belongsTo'](db[_0x1a75('0x67')],{});db[_0x1a75('0x1d7')][_0x1a75('0x140')](db[_0x1a75('0x65')],{});db[_0x1a75('0x1d7')][_0x1a75('0x140')](db[_0x1a75('0x62')],{'foreignKey':_0x1a75('0x1d8'),'as':_0x1a75('0x1ce')});db[_0x1a75('0x1d7')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'foreignKey':_0x1a75('0x1cf'),'as':'FromAgent'});db['ChatTransferReport'][_0x1a75('0x140')](db[_0x1a75('0x14')],{'foreignKey':_0x1a75('0x1d1'),'as':_0x1a75('0x1d2')});db[_0x1a75('0x1d7')][_0x1a75('0x140')](db['ChatQueue'],{'foreignKey':_0x1a75('0x1d9'),'as':_0x1a75('0x1d4')});db[_0x1a75('0x1d7')][_0x1a75('0x140')](db['ChatWebsite'],{'foreignKey':_0x1a75('0x1da'),'as':'ToAccount'});db[_0x1a75('0xec')][_0x1a75('0x140')](db[_0x1a75('0x4d')],{});db[_0x1a75('0xec')][_0x1a75('0x140')](db['FaxInteraction'],{});db[_0x1a75('0xec')][_0x1a75('0x140')](db[_0x1a75('0x48')],{'foreignKey':_0x1a75('0x1db'),'as':_0x1a75('0x1ce')});db[_0x1a75('0xec')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'foreignKey':'FromUserId','as':_0x1a75('0x1d0')});db[_0x1a75('0xec')][_0x1a75('0x140')](db['User'],{'foreignKey':_0x1a75('0x1d1'),'as':'ToAgent'});db[_0x1a75('0xec')][_0x1a75('0x140')](db[_0x1a75('0x4e')],{'foreignKey':_0x1a75('0x1dc'),'as':_0x1a75('0x1d4')});db['FaxTransferReport'][_0x1a75('0x140')](db[_0x1a75('0x48')],{'foreignKey':_0x1a75('0x1dd'),'as':_0x1a75('0x1d6')});db['OpenchannelTransferReport']['belongsTo'](db[_0x1a75('0x5f')],{});db[_0x1a75('0x1de')][_0x1a75('0x140')](db[_0x1a75('0x11f')],{});db['OpenchannelTransferReport'][_0x1a75('0x140')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x1a75('0x1ce')});db[_0x1a75('0x1de')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'foreignKey':'FromUserId','as':_0x1a75('0x1d0')});db[_0x1a75('0x1de')][_0x1a75('0x140')](db['User'],{'foreignKey':_0x1a75('0x1d1'),'as':'ToAgent'});db[_0x1a75('0x1de')][_0x1a75('0x140')](db[_0x1a75('0x61')],{'foreignKey':_0x1a75('0x1df'),'as':_0x1a75('0x1d4')});db[_0x1a75('0x1de')][_0x1a75('0x140')](db[_0x1a75('0x5a')],{'foreignKey':_0x1a75('0x1e0'),'as':'ToAccount'});db[_0x1a75('0x1e1')][_0x1a75('0x140')](db[_0x1a75('0x178')],{});db[_0x1a75('0x1e1')][_0x1a75('0x140')](db['SmsInteraction'],{});db[_0x1a75('0x1e1')]['belongsTo'](db[_0x1a75('0x52')],{'foreignKey':'FromSmsAccountId','as':_0x1a75('0x1ce')});db[_0x1a75('0x1e1')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'foreignKey':_0x1a75('0x1cf'),'as':_0x1a75('0x1d0')});db[_0x1a75('0x1e1')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'foreignKey':_0x1a75('0x1d1'),'as':'ToAgent'});db[_0x1a75('0x1e1')][_0x1a75('0x140')](db[_0x1a75('0x58')],{'foreignKey':_0x1a75('0x1e2'),'as':_0x1a75('0x1d4')});db[_0x1a75('0x1e1')][_0x1a75('0x140')](db[_0x1a75('0x52')],{'foreignKey':'ToSmsAccountId','as':_0x1a75('0x1d6')});db[_0x1a75('0x119')]['hasMany'](db[_0x1a75('0x157')],{'as':_0x1a75('0x174'),'foreignKey':_0x1a75('0x15a')});db[_0x1a75('0x119')][_0x1a75('0x105')](db[_0x1a75('0x76')],{'as':_0x1a75('0x1e3'),'foreignKey':_0x1a75('0x15a')});db[_0x1a75('0x119')][_0x1a75('0x105')](db['CmContact'],{'as':_0x1a75('0x18c'),'onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x15a')});db['CmList'][_0x1a75('0x105')](db[_0x1a75('0x72')],{'as':'HopperFinals','foreignKey':_0x1a75('0x15a')});db[_0x1a75('0x119')]['hasMany'](db[_0x1a75('0x13c')],{'as':_0x1a75('0x1e4'),'foreignKey':_0x1a75('0x15a')});db[_0x1a75('0x119')]['hasMany'](db['ReportAgentPreview'],{'as':_0x1a75('0x74'),'foreignKey':'ListId'});db[_0x1a75('0x119')][_0x1a75('0x114')](db[_0x1a75('0x1c')],{'as':'Queues','through':_0x1a75('0x1e5')});db[_0x1a75('0x119')]['belongsToMany'](db[_0x1a75('0x14')],{'as':'Agents','through':'cm_user_has_lists'});db[_0x1a75('0xef')][_0x1a75('0x105')](db[_0x1a75('0x109')],{'as':'Extensions','onDelete':_0x1a75('0x104')});db[_0x1a75('0xef')]['belongsToMany'](db[_0x1a75('0x14')],{'as':_0x1a75('0x15c'),'through':_0x1a75('0x128')});db['UserProfile']['hasMany'](db[_0x1a75('0x14')],{'as':'Users','foreignKey':_0x1a75('0x1e6')});db[_0x1a75('0xf0')][_0x1a75('0x105')](db[_0x1a75('0x1e7')],{'as':'UserProfileSections','foreignKey':_0x1a75('0x1e6'),'onDelete':_0x1a75('0x104')});db[_0x1a75('0x1e7')][_0x1a75('0x105')](db[_0x1a75('0xf3')],{'as':_0x1a75('0x1e8'),'foreignKey':_0x1a75('0x1e9'),'onDelete':'cascade'});db[_0x1a75('0xf7')][_0x1a75('0x105')](db[_0x1a75('0x157')],{'as':_0x1a75('0x174'),'foreignKey':_0x1a75('0x1ea')});db[_0x1a75('0xf7')][_0x1a75('0x105')](db['CannedAnswer'],{'as':_0x1a75('0x176'),'foreignKey':_0x1a75('0x1ea')});db[_0x1a75('0xf7')][_0x1a75('0x105')](db[_0x1a75('0xfb')],{'as':_0x1a75('0x14a'),'foreignKey':_0x1a75('0x1ea')});db[_0x1a75('0xf7')]['hasMany'](db['WhatsappInteraction'],{'as':'Interactions'});db['WhatsappAccount'][_0x1a75('0x105')](db[_0x1a75('0xf8')],{'as':_0x1a75('0x136')});db['WhatsappAccount'][_0x1a75('0x140')](db['CmList'],{'as':_0x1a75('0x159'),'foreignKey':_0x1a75('0x15a')});db[_0x1a75('0xf7')][_0x1a75('0x140')](db[_0x1a75('0x144')],{'as':'mandatoryDispositionPause','foreignKey':_0x1a75('0x146')});db[_0x1a75('0xf7')][_0x1a75('0x114')](db[_0x1a75('0x14')],{'as':_0x1a75('0x15c'),'through':_0x1a75('0x131')});db[_0x1a75('0xf8')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'onDelete':_0x1a75('0x169')});db['WhatsappApplication']['belongsTo'](db['WhatsappQueue'],{'onDelete':_0x1a75('0x169')});db[_0x1a75('0xf8')]['belongsTo'](db[_0x1a75('0xf7')],{'onDelete':_0x1a75('0x169')});db['WhatsappApplication'][_0x1a75('0x140')](db[_0x1a75('0x7f')],{'onDelete':_0x1a75('0x169'),'foreignKey':_0x1a75('0x143')});db[_0x1a75('0xf8')]['belongsTo'](db[_0x1a75('0x88')],{'onDelete':_0x1a75('0x169'),'foreignKey':_0x1a75('0x16a')});db[_0x1a75('0xfa')][_0x1a75('0x105')](db[_0x1a75('0xfb')],{'as':'Messages','onDelete':_0x1a75('0x104'),'foreignKey':_0x1a75('0x1eb')});db['WhatsappInteraction']['belongsTo'](db[_0x1a75('0xf7')],{'as':_0x1a75('0x161'),'foreignKey':_0x1a75('0x1ea')});db[_0x1a75('0xfa')][_0x1a75('0x140')](db[_0x1a75('0x6e')],{'as':_0x1a75('0x162'),'foreignKey':'ContactId'});db[_0x1a75('0xfa')][_0x1a75('0x140')](db[_0x1a75('0x14')],{'as':'Owner','foreignKey':_0x1a75('0x106')});db[_0x1a75('0xfa')][_0x1a75('0x114')](db['Tag'],{'through':_0x1a75('0x1ec'),'as':_0x1a75('0x164')});db[_0x1a75('0xfa')][_0x1a75('0x114')](db[_0x1a75('0x88')],{'through':'whatsapp_interaction_has_tags','as':_0x1a75('0x166')});db[_0x1a75('0xfa')]['belongsToMany'](db['User'],{'as':'Users','through':_0x1a75('0x1ed'),'foreignKey':_0x1a75('0x1eb')});db[_0x1a75('0xfb')][_0x1a75('0x140')](db['User'],{'as':_0x1a75('0x14')});db[_0x1a75('0xfb')][_0x1a75('0x140')](db[_0x1a75('0x6e')],{'onDelete':_0x1a75('0x104'),'as':_0x1a75('0x162')});db[_0x1a75('0xfb')]['belongsTo'](db[_0x1a75('0xfa')],{'onDelete':_0x1a75('0x104'),'as':'Interaction','foreignKey':_0x1a75('0x1eb')});db[_0x1a75('0xfb')]['belongsTo'](db[_0x1a75('0xf7')],{'as':_0x1a75('0x161'),'foreignKey':_0x1a75('0x1ea')});db[_0x1a75('0x1ee')]['belongsTo'](db[_0x1a75('0xf7')],{});db['WhatsappQueueReport'][_0x1a75('0x140')](db[_0x1a75('0x119')],{'as':_0x1a75('0x159'),'foreignKey':_0x1a75('0x15a')});db[_0x1a75('0x1ee')][_0x1a75('0x140')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x1a75('0x1ee')][_0x1a75('0x140')](db[_0x1a75('0xfa')],{});db[_0x1a75('0x1ee')][_0x1a75('0x140')](db[_0x1a75('0xff')],{});db[_0x1a75('0x1ee')]['belongsTo'](db[_0x1a75('0xfb')],{});db[_0x1a75('0x1ee')][_0x1a75('0x140')](db[_0x1a75('0x14')],{});db['WhatsappTransferReport']['belongsTo'](db[_0x1a75('0xfb')],{});db[_0x1a75('0xfe')][_0x1a75('0x140')](db['WhatsappInteraction'],{});db[_0x1a75('0xfe')][_0x1a75('0x140')](db[_0x1a75('0xf7')],{'foreignKey':_0x1a75('0x1ef'),'as':_0x1a75('0x1ce')});db[_0x1a75('0xfe')][_0x1a75('0x140')](db[_0x1a75('0xf7')],{'foreignKey':_0x1a75('0x1f0'),'as':_0x1a75('0x1d6')});db[_0x1a75('0xfe')][_0x1a75('0x140')](db[_0x1a75('0xff')],{'foreignKey':_0x1a75('0x1f1'),'as':_0x1a75('0x1d4')});db[_0x1a75('0xfe')][_0x1a75('0x140')](db['User'],{'foreignKey':_0x1a75('0x1cf'),'as':_0x1a75('0x1d0')});db[_0x1a75('0xfe')][_0x1a75('0x140')](db['User'],{'foreignKey':'ToUserId','as':_0x1a75('0x1d2')});db[_0x1a75('0xff')][_0x1a75('0x114')](db[_0x1a75('0x14')],{'as':_0x1a75('0x15c'),'through':'UserWhatsappQueue','foreignKey':_0x1a75('0x1f2')});db[_0x1a75('0xff')][_0x1a75('0x114')](db[_0x1a75('0xe0')],{'through':_0x1a75('0x1c8'),'as':_0x1a75('0x147')});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
diff --git a/server/routes.js b/server/routes.js
index bf4eff0..ee9fbea 100644
--- a/server/routes.js
+++ b/server/routes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-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
+var _0x9251=['./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxQueue','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/pause','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticExtractedReport','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/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','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/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/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/notifications','./api/notification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/apidoc','join','/www','root','/demo','static','snippet','1.0.16','/plugins','route','get','sendFile','appPath','/index.html','express-winston','util','./errors','./config/environment','./config/logger','api','auth','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','x-forwarded-for','headers','connection','remoteAddress','url','statusCode','responseTime','user','name','role','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)','format','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports'];(function(_0x289891,_0x49a0fa){var _0x31cf2e=function(_0x8cebce){while(--_0x8cebce){_0x289891['push'](_0x289891['shift']());}};_0x31cf2e(++_0x49a0fa);}(_0x9251,0xe0));var _0x1925=function(_0x1385dc,_0x2c7fd7){_0x1385dc=_0x1385dc-0x0;var _0x2f6469=_0x9251[_0x1385dc];return _0x2f6469;};'use strict';var path=require('path');var express=require('express');var ewinston=require(_0x1925('0x0'));var util=require(_0x1925('0x1'));var errors=require(_0x1925('0x2'));var config=require(_0x1925('0x3'));var logger=require(_0x1925('0x4'))(_0x1925('0x5'));var authLogger=require('./config/logger')(_0x1925('0x6'));exports['default']=function(_0x48cc49){_0x48cc49[_0x1925('0x7')](ewinston[_0x1925('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x520800,_0x426db5){return util['format'](_0x1925('0x9'),_0x520800[_0x1925('0xa')],_0x520800['headers'][_0x1925('0xb')]?_0x520800[_0x1925('0xc')][_0x1925('0xb')]:_0x520800[_0x1925('0xd')][_0x1925('0xe')]||_0x520800['ip'],_0x520800[_0x1925('0xf')],_0x426db5[_0x1925('0x10')],_0x426db5[_0x1925('0x11')],_0x520800[_0x1925('0x12')]?_0x520800['user']['id']:null,_0x520800[_0x1925('0x12')]?_0x520800[_0x1925('0x12')][_0x1925('0x13')]:null,_0x520800[_0x1925('0x12')]?_0x520800[_0x1925('0x12')][_0x1925('0x14')]:null);}}));_0x48cc49['use'](ewinston[_0x1925('0x8')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x1ef889,_0x2df930){var _0x39a99c='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x1ef889[_0x1925('0x15')]&&_0x1ef889[_0x1925('0x15')][_0x1925('0x16')]&&_0x1ef889[_0x1925('0x15')][_0x1925('0x17')]){_0x39a99c=_0x1925('0x18');}return util[_0x1925('0x19')](_0x39a99c,_0x1ef889['method'],_0x1ef889[_0x1925('0xc')][_0x1925('0xb')]?_0x1ef889['headers'][_0x1925('0xb')]:_0x1ef889['connection'][_0x1925('0xe')]||_0x1ef889['ip'],_0x1ef889[_0x1925('0xf')],_0x2df930['statusCode'],_0x2df930[_0x1925('0x11')],_0x1ef889[_0x1925('0x12')]?_0x1ef889['user']['id']:null,_0x1ef889[_0x1925('0x12')]?_0x1ef889[_0x1925('0x12')]['name']:null,_0x1ef889[_0x1925('0x12')]?_0x1ef889['user'][_0x1925('0x14')]:null,_0x1ef889['body']&&_0x1ef889[_0x1925('0x15')][_0x1925('0x16')]?_0x1ef889[_0x1925('0x15')][_0x1925('0x16')]:_0x1925('0x1a'),_0x1ef889['body']&&_0x1ef889[_0x1925('0x15')]['agent_id']?_0x1ef889[_0x1925('0x15')][_0x1925('0x17')]:'',_0x1ef889['body']&&_0x1ef889[_0x1925('0x15')]['agent_name']?_0x1ef889['body'][_0x1925('0x1b')]:'');},'ignoreRoute':function(_0x3a2a4b){var _0x18d416=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x18d416[_0x1925('0x1c')](_0x3a2a4b[_0x1925('0xf')]);}}));_0x48cc49['use'](_0x1925('0x1d'),require(_0x1925('0x1e')));_0x48cc49[_0x1925('0x7')](_0x1925('0x1f'),require(_0x1925('0x20')));_0x48cc49[_0x1925('0x7')]('/api/voice/contexts',require(_0x1925('0x21')));_0x48cc49[_0x1925('0x7')](_0x1925('0x22'),require(_0x1925('0x23')));_0x48cc49['use']('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x48cc49[_0x1925('0x7')](_0x1925('0x24'),require(_0x1925('0x25')));_0x48cc49[_0x1925('0x7')]('/api/voice/recordings',require(_0x1925('0x26')));_0x48cc49[_0x1925('0x7')](_0x1925('0x27'),require(_0x1925('0x28')));_0x48cc49[_0x1925('0x7')]('/api/voice/mails',require(_0x1925('0x29')));_0x48cc49[_0x1925('0x7')](_0x1925('0x2a'),require(_0x1925('0x2b')));_0x48cc49[_0x1925('0x7')]('/api/voice/calls/reports',require(_0x1925('0x2c')));_0x48cc49[_0x1925('0x7')](_0x1925('0x2d'),require('./api/voiceDialReport'));_0x48cc49['use'](_0x1925('0x2e'),require('./api/voiceAgentReport'));_0x48cc49[_0x1925('0x7')](_0x1925('0x2f'),require(_0x1925('0x30')));_0x48cc49[_0x1925('0x7')](_0x1925('0x31'),require(_0x1925('0x32')));_0x48cc49[_0x1925('0x7')](_0x1925('0x33'),require(_0x1925('0x34')));_0x48cc49[_0x1925('0x7')](_0x1925('0x35'),require(_0x1925('0x36')));_0x48cc49[_0x1925('0x7')]('/api/mail/out_servers',require(_0x1925('0x37')));_0x48cc49[_0x1925('0x7')](_0x1925('0x38'),require(_0x1925('0x39')));_0x48cc49[_0x1925('0x7')](_0x1925('0x3a'),require('./api/mailQueue'));_0x48cc49[_0x1925('0x7')](_0x1925('0x3b'),require(_0x1925('0x3c')));_0x48cc49['use']('/api/mail/interactions',require(_0x1925('0x3d')));_0x48cc49[_0x1925('0x7')](_0x1925('0x3e'),require(_0x1925('0x3f')));_0x48cc49[_0x1925('0x7')]('/api/mail/applications',require(_0x1925('0x40')));_0x48cc49['use'](_0x1925('0x41'),require(_0x1925('0x42')));_0x48cc49[_0x1925('0x7')](_0x1925('0x43'),require(_0x1925('0x44')));_0x48cc49[_0x1925('0x7')](_0x1925('0x45'),require(_0x1925('0x46')));_0x48cc49['use']('/api/fax/accounts',require(_0x1925('0x47')));_0x48cc49[_0x1925('0x7')](_0x1925('0x48'),require(_0x1925('0x49')));_0x48cc49['use'](_0x1925('0x4a'),require('./api/faxInteraction'));_0x48cc49['use'](_0x1925('0x4b'),require('./api/faxMessage'));_0x48cc49[_0x1925('0x7')]('/api/fax/queues',require(_0x1925('0x4c')));_0x48cc49['use']('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x48cc49[_0x1925('0x7')]('/api/sms/accounts',require('./api/smsAccount'));_0x48cc49[_0x1925('0x7')](_0x1925('0x4d'),require(_0x1925('0x4e')));_0x48cc49[_0x1925('0x7')](_0x1925('0x4f'),require(_0x1925('0x50')));_0x48cc49['use'](_0x1925('0x51'),require(_0x1925('0x52')));_0x48cc49[_0x1925('0x7')]('/api/sms/queues',require('./api/smsQueue'));_0x48cc49[_0x1925('0x7')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x48cc49[_0x1925('0x7')]('/api/openchannel/applications',require(_0x1925('0x53')));_0x48cc49[_0x1925('0x7')](_0x1925('0x54'),require(_0x1925('0x55')));_0x48cc49[_0x1925('0x7')](_0x1925('0x56'),require(_0x1925('0x57')));_0x48cc49[_0x1925('0x7')](_0x1925('0x58'),require('./api/openchannelQueue'));_0x48cc49[_0x1925('0x7')](_0x1925('0x59'),require('./api/chatWebsite'));_0x48cc49[_0x1925('0x7')](_0x1925('0x5a'),require(_0x1925('0x5b')));_0x48cc49[_0x1925('0x7')](_0x1925('0x5c'),require('./api/chatApplication'));_0x48cc49[_0x1925('0x7')]('/api/chat/interactions',require(_0x1925('0x5d')));_0x48cc49[_0x1925('0x7')](_0x1925('0x5e'),require(_0x1925('0x5f')));_0x48cc49[_0x1925('0x7')]('/api/chat/offline_messages',require(_0x1925('0x60')));_0x48cc49[_0x1925('0x7')](_0x1925('0x61'),require(_0x1925('0x62')));_0x48cc49['use'](_0x1925('0x63'),require(_0x1925('0x64')));_0x48cc49[_0x1925('0x7')]('/api/chat/proactive_actions',require(_0x1925('0x65')));_0x48cc49['use'](_0x1925('0x66'),require('./api/cmCompany'));_0x48cc49[_0x1925('0x7')](_0x1925('0x67'),require('./api/cmContact'));_0x48cc49[_0x1925('0x7')](_0x1925('0x68'),require(_0x1925('0x69')));_0x48cc49['use']('/api/cm/hopper_black',require(_0x1925('0x6a')));_0x48cc49[_0x1925('0x7')](_0x1925('0x6b'),require('./api/cmHopperFinal'));_0x48cc49[_0x1925('0x7')](_0x1925('0x6c'),require(_0x1925('0x6d')));_0x48cc49[_0x1925('0x7')](_0x1925('0x6e'),require(_0x1925('0x6f')));_0x48cc49[_0x1925('0x7')](_0x1925('0x70'),require(_0x1925('0x71')));_0x48cc49['use']('/api/automations',require('./api/automation'));_0x48cc49[_0x1925('0x7')](_0x1925('0x72'),require(_0x1925('0x73')));_0x48cc49[_0x1925('0x7')](_0x1925('0x74'),require(_0x1925('0x75')));_0x48cc49[_0x1925('0x7')](_0x1925('0x76'),require(_0x1925('0x77')));_0x48cc49[_0x1925('0x7')](_0x1925('0x78'),require('./api/interval'));_0x48cc49[_0x1925('0x7')]('/api/pauses',require(_0x1925('0x79')));_0x48cc49[_0x1925('0x7')]('/api/cdr',require('./api/cdr'));_0x48cc49[_0x1925('0x7')](_0x1925('0x7a'),require(_0x1925('0x7b')));_0x48cc49[_0x1925('0x7')](_0x1925('0x7c'),require(_0x1925('0x7d')));_0x48cc49['use'](_0x1925('0x7e'),require(_0x1925('0x7f')));_0x48cc49[_0x1925('0x7')](_0x1925('0x80'),require('./api/tag'));_0x48cc49[_0x1925('0x7')](_0x1925('0x81'),require('./api/template'));_0x48cc49[_0x1925('0x7')]('/api/triggers',require(_0x1925('0x82')));_0x48cc49[_0x1925('0x7')](_0x1925('0x83'),require(_0x1925('0x84')));_0x48cc49['use']('/api/integrations',require(_0x1925('0x85')));_0x48cc49[_0x1925('0x7')](_0x1925('0x86'),require(_0x1925('0x87')));_0x48cc49[_0x1925('0x7')](_0x1925('0x88'),require('./api/analyticCustomReport'));_0x48cc49['use'](_0x1925('0x89'),require('./api/analyticDefaultReport'));_0x48cc49['use']('/api/analytics/extracted_reports',require(_0x1925('0x8a')));_0x48cc49[_0x1925('0x7')]('/api/analytics/metrics',require('./api/analyticMetric'));_0x48cc49[_0x1925('0x7')](_0x1925('0x8b'),require(_0x1925('0x8c')));_0x48cc49[_0x1925('0x7')](_0x1925('0x8d'),require(_0x1925('0x8e')));_0x48cc49[_0x1925('0x7')]('/api/integrations/salesforce/accounts',require(_0x1925('0x8f')));_0x48cc49[_0x1925('0x7')]('/api/integrations/salesforce/configurations',require(_0x1925('0x90')));_0x48cc49['use'](_0x1925('0x91'),require(_0x1925('0x92')));_0x48cc49['use'](_0x1925('0x93'),require(_0x1925('0x94')));_0x48cc49['use'](_0x1925('0x95'),require('./api/intSugarcrmConfiguration'));_0x48cc49[_0x1925('0x7')](_0x1925('0x96'),require(_0x1925('0x97')));_0x48cc49['use']('/api/integrations/desk/accounts',require(_0x1925('0x98')));_0x48cc49['use'](_0x1925('0x99'),require(_0x1925('0x9a')));_0x48cc49['use']('/api/integrations/desk/fields',require(_0x1925('0x9b')));_0x48cc49[_0x1925('0x7')]('/api/integrations/zoho/accounts',require(_0x1925('0x9c')));_0x48cc49[_0x1925('0x7')](_0x1925('0x9d'),require('./api/intZohoConfiguration'));_0x48cc49[_0x1925('0x7')](_0x1925('0x9e'),require('./api/intZohoField'));_0x48cc49[_0x1925('0x7')]('/api/integrations/zendesk/accounts',require(_0x1925('0x9f')));_0x48cc49[_0x1925('0x7')](_0x1925('0xa0'),require(_0x1925('0xa1')));_0x48cc49[_0x1925('0x7')](_0x1925('0xa2'),require(_0x1925('0xa3')));_0x48cc49[_0x1925('0x7')](_0x1925('0xa4'),require(_0x1925('0xa5')));_0x48cc49[_0x1925('0x7')](_0x1925('0xa6'),require(_0x1925('0xa7')));_0x48cc49['use'](_0x1925('0xa8'),require(_0x1925('0xa9')));_0x48cc49[_0x1925('0x7')](_0x1925('0xaa'),require(_0x1925('0xab')));_0x48cc49[_0x1925('0x7')](_0x1925('0xac'),require('./api/intVtigerConfiguration'));_0x48cc49['use']('/api/integrations/vtiger/fields',require(_0x1925('0xad')));_0x48cc49[_0x1925('0x7')]('/api/integrations/servicenow/accounts',require(_0x1925('0xae')));_0x48cc49[_0x1925('0x7')](_0x1925('0xaf'),require('./api/intServicenowConfiguration'));_0x48cc49[_0x1925('0x7')](_0x1925('0xb0'),require(_0x1925('0xb1')));_0x48cc49[_0x1925('0x7')](_0x1925('0xb2'),require(_0x1925('0xb3')));_0x48cc49[_0x1925('0x7')](_0x1925('0xb4'),require('./api/intDynamics365Configuration'));_0x48cc49[_0x1925('0x7')](_0x1925('0xb5'),require(_0x1925('0xb6')));_0x48cc49['use'](_0x1925('0xb7'),require(_0x1925('0xb8')));_0x48cc49[_0x1925('0x7')](_0x1925('0xb9'),require('./api/intFreshsalesConfiguration'));_0x48cc49['use']('/api/integrations/freshsales/fields',require(_0x1925('0xba')));_0x48cc49['use'](_0x1925('0xbb'),require(_0x1925('0xbc')));_0x48cc49['use'](_0x1925('0xbd'),require(_0x1925('0xbe')));_0x48cc49[_0x1925('0x7')]('/api/chat/internal/messages',require(_0x1925('0xbf')));_0x48cc49[_0x1925('0x7')](_0x1925('0xc0'),require(_0x1925('0xc1')));_0x48cc49['use'](_0x1925('0xc2'),require(_0x1925('0xc3')));_0x48cc49[_0x1925('0x7')](_0x1925('0xc4'),require(_0x1925('0xc5')));_0x48cc49[_0x1925('0x7')](_0x1925('0xc6'),require(_0x1925('0xc7')));_0x48cc49[_0x1925('0x7')](_0x1925('0xc8'),require(_0x1925('0xc9')));_0x48cc49[_0x1925('0x7')](_0x1925('0xca'),require(_0x1925('0xcb')));_0x48cc49['use'](_0x1925('0xcc'),require(_0x1925('0xcd')));_0x48cc49['use'](_0x1925('0xce'),require(_0x1925('0xcf')));_0x48cc49[_0x1925('0x7')]('/api/square/odbc',require('./api/squareOdbc'));_0x48cc49[_0x1925('0x7')]('/api/square/projects',require(_0x1925('0xd0')));_0x48cc49['use']('/api/square/recordings',require(_0x1925('0xd1')));_0x48cc49[_0x1925('0x7')](_0x1925('0xd2'),require(_0x1925('0xd3')));_0x48cc49[_0x1925('0x7')](_0x1925('0xd4'),require(_0x1925('0xd5')));_0x48cc49[_0x1925('0x7')](_0x1925('0xd6'),require(_0x1925('0xd7')));_0x48cc49[_0x1925('0x7')](_0x1925('0xd8'),require(_0x1925('0xd9')));_0x48cc49[_0x1925('0x7')](_0x1925('0xda'),require(_0x1925('0xdb')));_0x48cc49['use']('/api/attachments',require('./api/attachment'));_0x48cc49['use'](_0x1925('0xdc'),require(_0x1925('0xdd')));_0x48cc49[_0x1925('0x7')](_0x1925('0xde'),require(_0x1925('0xdf')));_0x48cc49['use'](_0x1925('0xe0'),require(_0x1925('0xe1')));_0x48cc49[_0x1925('0x7')](_0x1925('0xe2'),require(_0x1925('0xe3')));_0x48cc49[_0x1925('0x7')](_0x1925('0xe4'),require('./api/openchannelTransferReport'));_0x48cc49[_0x1925('0x7')](_0x1925('0xe5'),require(_0x1925('0xe6')));_0x48cc49[_0x1925('0x7')](_0x1925('0xe7'),require(_0x1925('0xe8')));_0x48cc49[_0x1925('0x7')]('/api/voice/prefixes',require('./api/voicePrefix'));_0x48cc49['use']('/api/userProfiles',require(_0x1925('0xe9')));_0x48cc49[_0x1925('0x7')](_0x1925('0xea'),require(_0x1925('0xeb')));_0x48cc49['use']('/api/userProfile/resources',require(_0x1925('0xec')));_0x48cc49[_0x1925('0x7')](_0x1925('0xed'),require(_0x1925('0xee')));_0x48cc49[_0x1925('0x7')](_0x1925('0xef'),require(_0x1925('0xf0')));_0x48cc49[_0x1925('0x7')]('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x48cc49[_0x1925('0x7')](_0x1925('0xf1'),require(_0x1925('0xf2')));_0x48cc49[_0x1925('0x7')]('/api/whatsapp/messages',require(_0x1925('0xf3')));_0x48cc49['use'](_0x1925('0xf4'),require(_0x1925('0xf5')));_0x48cc49[_0x1925('0x7')](_0x1925('0xf6'),require('./api/whatsappTransferReport'));_0x48cc49[_0x1925('0x7')](_0x1925('0xf7'),require(_0x1925('0xf8')));_0x48cc49[_0x1925('0x7')](_0x1925('0xf9'),require(_0x1925('0xfa')));_0x48cc49[_0x1925('0x7')]('/api/auth/local',require(_0x1925('0xfb')));_0x48cc49[_0x1925('0x7')](_0x1925('0xfc'),require(_0x1925('0xfd')));_0x48cc49[_0x1925('0x7')](_0x1925('0xfe'),require(_0x1925('0xff')));_0x48cc49[_0x1925('0x7')](_0x1925('0x100'),require('./api/rpc'));_0x48cc49[_0x1925('0x7')](_0x1925('0x101'),require(_0x1925('0x102')));_0x48cc49['use'](_0x1925('0x103'),require(_0x1925('0x104')));_0x48cc49[_0x1925('0x7')](_0x1925('0x105'),require('./api/pm2'));_0x48cc49[_0x1925('0x7')](_0x1925('0x106'),require(_0x1925('0x107')));_0x48cc49[_0x1925('0x7')](_0x1925('0x108'),express['static'](path[_0x1925('0x109')](config['root'],_0x1925('0x108'))));_0x48cc49['use'](_0x1925('0x10a'),express['static'](path[_0x1925('0x109')](config[_0x1925('0x10b')],_0x1925('0x10a'))));_0x48cc49[_0x1925('0x7')](_0x1925('0x10c'),express[_0x1925('0x10d')](path[_0x1925('0x109')](config[_0x1925('0x10b')],_0x1925('0x10c'))));_0x48cc49[_0x1925('0x7')]('/snippet',express[_0x1925('0x10d')](path[_0x1925('0x109')](config[_0x1925('0x10b')],_0x1925('0x10e'),_0x1925('0x10f'))));_0x48cc49[_0x1925('0x7')](_0x1925('0x110'),express[_0x1925('0x10d')](path[_0x1925('0x109')](config[_0x1925('0x10b')],'/server/files/plugins')));_0x48cc49[_0x1925('0x111')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x1925('0x112')](errors[0x194]);_0x48cc49[_0x1925('0x111')]('/*')[_0x1925('0x112')](function(_0x24b698,_0x1c4d96){_0x1c4d96[_0x1925('0x113')](path['resolve'](_0x48cc49['get'](_0x1925('0x114'))+_0x1925('0x115')));});};
\ No newline at end of file
diff --git a/server/rpc/index.js b/server/rpc/index.js
index 90bde7b..5b4945a 100644
--- a/server/rpc/index.js
+++ b/server/rpc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-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
+var _0x804b=['../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/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/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','http','rpc','port','localhost','error','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','../config/environment','listen','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.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/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.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'];(function(_0x21ce2b,_0x5d7e90){var _0x1ac2be=function(_0x4219c6){while(--_0x4219c6){_0x21ce2b['push'](_0x21ce2b['shift']());}};_0x1ac2be(++_0x5d7e90);}(_0x804b,0x12f));var _0xb804=function(_0x54d28f,_0x55165c){_0x54d28f=_0x54d28f-0x0;var _0x5c0a99=_0x804b[_0x54d28f];return _0x5c0a99;};'use strict';var jayson=require(_0xb804('0x0'));var BPromise=require(_0xb804('0x1'));var _=require('lodash');var config=require(_0xb804('0x2'));exports[_0xb804('0x3')]=function(){return new BPromise(function(_0x842fe1,_0x448198){var _0x6c9554={};_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x4')));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x5')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x7')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require('../api/voiceRecording/voiceRecording.rpc'));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x8')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x6c9554=_['merge'](_0x6c9554,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x9')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0xa')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0xb')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0xc')));_0x6c9554=_['merge'](_0x6c9554,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0xd')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0xe')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0xf')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x10')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x11')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x12')));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x13')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x14')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x15')));_0x6c9554=_['merge'](_0x6c9554,require('../api/faxInteraction/faxInteraction.rpc'));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x16')));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x17')));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x18')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require('../api/smsAccount/smsAccount.rpc'));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x19')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x1a')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x1b')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x6c9554=_['merge'](_0x6c9554,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x1c')));_0x6c9554=_['merge'](_0x6c9554,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x1d')));_0x6c9554=_['merge'](_0x6c9554,require('../api/chatInteraction/chatInteraction.rpc'));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x1e')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x1f')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x20')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x21')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x22')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x23')));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x24')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x25')));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x26')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x27')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require('../api/sound/sound.rpc'));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x28')));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x29')));_0x6c9554=_['merge'](_0x6c9554,require('../api/variable/variable.rpc'));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x2a')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x2b')));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x2c')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x2d')));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x2e')));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x2f')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x30')));_0x6c9554=_['merge'](_0x6c9554,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x31')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x32')));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x33')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x34')));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x35')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x36')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x37')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x38')));_0x6c9554=_['merge'](_0x6c9554,require(_0xb804('0x39')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x3a')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x3b')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x3c')));_0x6c9554=_[_0xb804('0x6')](_0x6c9554,require(_0xb804('0x3d')));_0x6c9554=_['merge'](_0x6c9554,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x4ce418=jayson['server'](_0x6c9554)[_0xb804('0x3e')]();var _0x355088=config[_0xb804('0x3f')][_0xb804('0x40')]||config[_0xb804('0x40')]+0x1;var _0x573648=config[_0xb804('0x3f')]['ip']||_0xb804('0x41');_0x4ce418['on'](_0xb804('0x42'),function(_0x22683f){return _0x448198(_0x22683f);});_0x4ce418[_0xb804('0x3')](_0x355088,_0x573648,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x573648,_0x355088);require('../config/triggers')[_0xb804('0x43')]();return _0x842fe1(_0xb804('0x44')+_0x573648+':'+_0x355088);});});};
\ No newline at end of file
diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js
index b61b77b..604eb92 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 _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
+var _0xbf07=['toLowerCase','hangup','substring','520-Invalid','search','function','no\x20code','result=','indexOf','substr','startsWith','split','length','E_AGI_SOCKET_ERROR','code','close','emit','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','command=','write','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','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','setContext','log','recordFile','streamFile','agi','AGI','wait','WAIT','error','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','events','call','setEncoding','utf8','setTimeout','headers'];(function(_0x4dddad,_0x42dfdf){var _0xc0a464=function(_0x37b2a9){while(--_0x37b2a9){_0x4dddad['push'](_0x4dddad['shift']());}};_0xc0a464(++_0x42dfdf);}(_0xbf07,0x1b5));var _0x7bf0=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xbf07[_0x8c43de];return _0xa6591b;};'use strict';var util=require(_0x7bf0('0x0'));var _=require('lodash');var EventEmitter=require(_0x7bf0('0x1'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x56ddca){var _0x456676=this,_0x3b5442=new AGIReply(),_0x440a7d=![],_0x5ad204={};EventEmitter[_0x7bf0('0x2')](_0x456676);_0x56ddca[_0x7bf0('0x3')](_0x7bf0('0x4'));_0x56ddca[_0x7bf0('0x5')](0x8*0x3c*0x3c*0x3e8);_0x3b5442[_0x7bf0('0x3')](_0x7bf0('0x4'));_0x3b5442['on'](_0x7bf0('0x6'),function(_0x3a2f8a){for(var _0x2dadb2 in _0x3a2f8a){_0x456676[_0x2dadb2]=_0x3a2f8a[_0x2dadb2];}_0x456676['emit']('ready');});_0x3b5442['on']('line',function(_0x387ca1){if(_0x387ca1[_0x7bf0('0x7')]()=='hangup'){_0x456676['emit'](_0x7bf0('0x8'));return;}if(_0x387ca1[_0x7bf0('0x9')](0x0,0xb)==_0x7bf0('0xa')){_0x440a7d=!![];}if(_0x440a7d){_0x5ad204['rx']+=_0x387ca1+'\x0a';if(_0x387ca1[_0x7bf0('0xb')]('520\x20End\x20of\x20proper')!=-0x1){_0x440a7d=![];}}else{_0x5ad204['rx']=_0x387ca1;}if(_0x440a7d){return;}if(typeof _0x5ad204['cb']==_0x7bf0('0xc')){var _0x3b7d62=_0x5ad204['rx'][_0x7bf0('0x9')](0x0,0x3),_0x3c5a48=null,_0x1beebd=null;_0x3b7d62=parseInt(_0x3b7d62);if(isNaN(_0x3b7d62)){_0x5ad204['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x7bf0('0xd')});return;}if(_0x3b7d62!=0xc8){_0x5ad204['cb'](null,{'code':_0x3b7d62,'result':-0x1,'extra':'KO'});return;}_0x3c5a48=_0x5ad204['rx'][_0x7bf0('0x9')](0x4)['replace'](_0x7bf0('0xe'),'');if(_0x3c5a48[_0x7bf0('0xf')]('\x20')!=-0x1){_0x3c5a48=_0x3c5a48[_0x7bf0('0x10')](0x0,_0x3c5a48[_0x7bf0('0xf')]('\x20'));}if(_[_0x7bf0('0x11')](_0x3c5a48,'-1')){_0x3c5a48=parseInt(_0x3c5a48);}_0x1beebd=_0x5ad204['rx'][_0x7bf0('0x12')]('\x20');if(_0x1beebd[_0x7bf0('0x13')]==0x3){_0x1beebd=_0x1beebd[0x2]['substring'](0x1,_0x1beebd[0x2][_0x7bf0('0x13')]-0x1);}else if(_0x1beebd[_0x7bf0('0x13')]>0x3){var _0x1827b4=/\((.+)\)/;var _0x208f23=_0x5ad204['rx']['match'](_0x1827b4);if(_0x208f23){_0x1beebd=_0x208f23[0x1];}else{_0x1beebd=null;}}else{_0x1beebd=null;}_0x5ad204['cb'](null,{'code':_0x3b7d62,'result':_0x3c5a48,'extra':_0x1beebd});}});_0x56ddca['on']('error',function(_0x2b1c95){_0x456676['emit']('error',new AGIError(_0x7bf0('0x14'),_0x2b1c95[_0x7bf0('0x15')]));});_0x56ddca['on'](_0x7bf0('0x16'),function(){_0x456676[_0x7bf0('0x17')](_0x7bf0('0x16'),new AGIError(_0x7bf0('0x18')));});_0x56ddca['on'](_0x7bf0('0x19'),function(){_0x456676[_0x7bf0('0x17')]('timeout',new AGIError(_0x7bf0('0x1a')));_0x56ddca[_0x7bf0('0x1b')]();});_0x56ddca['pipe'](_0x3b5442);this[_0x7bf0('0x1c')]=function(_0x1faf3b,_0x2a0ebf){console['log'](_0x7bf0('0x1d'),_0x1faf3b);var _0x1faf3b=_0x1faf3b||'',_0x2a0ebf=typeof _0x2a0ebf==_0x7bf0('0xc')?_0x2a0ebf:new Function();_0x5ad204={'tx':_0x1faf3b,'rx':'','cb':_0x2a0ebf};_0x56ddca[_0x7bf0('0x1e')](_0x1faf3b+'\x0a');},this[_0x7bf0('0x16')]=function(){_0x56ddca[_0x7bf0('0x1b')]();};}util[_0x7bf0('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x7bf0('0x20')][_0x7bf0('0x21')]=function(_0x6f88c6){return this[_0x7bf0('0x1c')][_0x7bf0('0x22')](this,_0x6f88c6);};AGIChannel['prototype'][_0x7bf0('0x23')]=function(){return this[_0x7bf0('0x21')](_0x7bf0('0x24'));};AGIChannel['prototype'][_0x7bf0('0x25')]=function(_0x2460c2,_0x14dc41,_0x136771){_0x2460c2=_0x2460c2===undefined?_0x7bf0('0x26'):_0x2460c2;_0x14dc41=_0x14dc41===undefined?'5':_0x14dc41;_0x136771=_0x136771===undefined?'1':_0x136771;return this[_0x7bf0('0x21')](util[_0x7bf0('0x27')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x2460c2,_0x14dc41*0x3e8,_0x136771));};AGIChannel[_0x7bf0('0x20')][_0x7bf0('0x28')]=function(_0x568be0){_0x568be0=_0x568be0||_0x7bf0('0x29');return this[_0x7bf0('0x21')](util[_0x7bf0('0x27')](_0x7bf0('0x2a'),_0x568be0));};AGIChannel[_0x7bf0('0x20')][_0x7bf0('0x2b')]=function(_0x17f448,_0x2ac33d){if(_[_0x7bf0('0x2c')](_0x2ac33d)){return this[_0x7bf0('0x21')](util[_0x7bf0('0x27')](_0x7bf0('0x2d'),_0x17f448,_0x2ac33d[_0x7bf0('0x2e')](',')));}return this[_0x7bf0('0x21')](util[_0x7bf0('0x27')]('EXEC\x20%s\x20%s',_0x17f448,_0x2ac33d));};AGIChannel[_0x7bf0('0x20')]['setContext']=function(_0x37978b){return this[_0x7bf0('0x21')](util['format']('SET\x20CONTEXT\x20%s',_0x37978b));};AGIChannel[_0x7bf0('0x20')][_0x7bf0('0x2f')]=function(_0x52858f){return this['sendRequest'](util[_0x7bf0('0x27')](_0x7bf0('0x30'),_0x52858f));};AGIChannel['prototype'][_0x7bf0('0x31')]=function(_0x2b3b87){return this['sendRequest'](util[_0x7bf0('0x27')](_0x7bf0('0x32'),_0x2b3b87));};AGIChannel[_0x7bf0('0x20')][_0x7bf0('0x8')]=function(){return this[_0x7bf0('0x21')](_0x7bf0('0x33'));};AGIChannel[_0x7bf0('0x20')][_0x7bf0('0x34')]=function(_0x5c976a,_0x2cab73){var _0x54f5af=_[_0x7bf0('0x35')](_0x2cab73)||_['isNumber'](_0x2cab73)?_0x2cab73[_0x7bf0('0x36')]():_0x2cab73;return this[_0x7bf0('0x21')](util[_0x7bf0('0x27')](_0x7bf0('0x37'),_0x5c976a,_0x54f5af?_0x54f5af[_0x7bf0('0x36')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x7bf0('0x20')][_0x7bf0('0x38')]=function(_0x488b13,_0xd8b39e){return this[_0x7bf0('0x21')](util[_0x7bf0('0x27')](_0x7bf0('0x39'),_0x488b13,_0xd8b39e));};AGIChannel['prototype'][_0x7bf0('0x3a')]=function(_0x1ff2f9,_0x48e49d){return this[_0x7bf0('0x21')](util[_0x7bf0('0x27')](_0x7bf0('0x3b'),_0x1ff2f9,_0x48e49d));};AGIChannel['prototype'][_0x7bf0('0x3c')]=function(_0x1012c8,_0x138453){return this['sendRequest'](util['format'](_0x7bf0('0x3d'),_0x1012c8,_0x138453));};AGIChannel[_0x7bf0('0x20')][_0x7bf0('0x3e')]=function(_0xb355a2,_0x545b40,_0x19e1bd){_0x545b40=_0x545b40||this['extension'];_0x19e1bd=_0x19e1bd||0x1;this[_0x7bf0('0x3f')](_0xb355a2);this['setExtension'](_0x545b40);this['setPriority'](_0x19e1bd);return this['noop'](util['format']('GOTO\x20%s\x20%s\x20%s',_0xb355a2,_0x545b40,_0x19e1bd));};AGIChannel['prototype']['getVariable']=function(_0x4f27f0){console[_0x7bf0('0x40')]('getvariable',_0x4f27f0);return this[_0x7bf0('0x21')](util[_0x7bf0('0x27')]('GET\x20VARIABLE\x20\x22%s\x22',_0x4f27f0));};AGIChannel['prototype'][_0x7bf0('0x41')]=function(_0x21fbac,_0x54c885,_0xfe09df,_0x3b3d98,_0x559516,_0x4910af){_0x54c885=_0x54c885||'wav';_0xfe09df=_0xfe09df||'';_0x3b3d98=_0x3b3d98===undefined?-0x1:_0x3b3d98==='-1'?-0x1:_0x3b3d98*0x3e8;_0x559516=_0x559516===undefined?'':'s='+_0x559516;_0x4910af=_0x4910af?'BEEP':'';return this['sendRequest'](util[_0x7bf0('0x27')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x21fbac,_0x54c885,_0xfe09df,_0x3b3d98,_0x4910af,_0x559516));};AGIChannel[_0x7bf0('0x20')][_0x7bf0('0x42')]=function(_0x24144d,_0x7500f7){_0x7500f7=_0x7500f7||'';return this[_0x7bf0('0x21')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x24144d,_0x7500f7));};AGIChannel[_0x7bf0('0x20')][_0x7bf0('0x43')]=function(_0x435add){return this[_0x7bf0('0x2b')](_0x7bf0('0x44'),_0x435add);};AGIChannel[_0x7bf0('0x20')][_0x7bf0('0x45')]=function(_0x52b38b){return this[_0x7bf0('0x2b')](_0x7bf0('0x46'),_0x52b38b);};AGIChannel[_0x7bf0('0x20')][_0x7bf0('0x47')]=function(_0x16da2b,_0x2ee557){this[_0x7bf0('0x28')](util[_0x7bf0('0x27')](_0x7bf0('0x48'),_0x16da2b['id'],_0x16da2b['label'],_0x2ee557));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x7bf0('0x49')]=AGIChannel;
\ No newline at end of file
diff --git a/server/services/agi/error.js b/server/services/agi/error.js
index 4817993..0ab8347 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 _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
+var _0x238f=['E_AGI_UNDEFINED','push','apply','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0x238f,0x1d4));var _0xf238=function(_0x2d267c,_0x4185d1){_0x2d267c=_0x2d267c-0x0;var _0x5394bc=_0x238f[_0x2d267c];return _0x5394bc;};'use strict';var util=require(_0xf238('0x0'));var error={'E_AGI_UNDEFINED':_0xf238('0x1'),'E_AGI_ARGUMENT_PORT':_0xf238('0x2'),'E_AGI_SERVER_ERROR':_0xf238('0x3'),'E_AGI_SERVER_CLOSE':_0xf238('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xf238('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xf238('0x6'),'E_AGI_SOCKET_ERROR':_0xf238('0x7'),'E_AGI_SOCKET_CLOSE':_0xf238('0x8'),'E_AGI_SOCKET_TIMEOUT':_0xf238('0x9'),'E_AGI_COMMAND_EMPTY':_0xf238('0xa'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xf238('0xb')};function AGIError(_0x47ff7b){var _0x47ff7b=_0x47ff7b||null,_0x5334d4=_0x5334d4||[],_0xbf4b15=0x1,_0x167c84='';if(!error[_0x47ff7b]){_0x47ff7b=_0xf238('0xc');}_0x5334d4['push'](error[_0x47ff7b]);while(arguments[_0xbf4b15]){_0x5334d4[_0xf238('0xd')](arguments[_0xbf4b15]);_0xbf4b15++;}_0x167c84=util['format'][_0xf238('0xe')](util,_0x5334d4);this['message']=_0x167c84;this['name']=_0x47ff7b;}module[_0xf238('0xf')]=AGIError;
\ No newline at end of file
diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js
index c91e9a6..eceb229 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 _0x7d25=['includes','condition\x20not\x20found','exports','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','prototype','addEdge','numberOfEdges','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','condition','length','agicommand','target','invalid','default\x20on\x20switch\x20not\x20found'];(function(_0x2115bd,_0x2d6047){var _0x3d36cd=function(_0x5c4ca3){while(--_0x5c4ca3){_0x2115bd['push'](_0x2115bd['shift']());}};_0x3d36cd(++_0x2d6047);}(_0x7d25,0x8a));var _0x57d2=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x7d25[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require('lodash');var logger=require(_0x57d2('0x0'))(_0x57d2('0x1'));var verticesWithRetry=[_0x57d2('0x2'),_0x57d2('0x3'),_0x57d2('0x4')];var Graph=function(){this[_0x57d2('0x5')]={};this[_0x57d2('0x6')]={};this['numberOfEdges']=0x0;};Graph['prototype']['addVertex']=function(_0x5dea84){this[_0x57d2('0x5')][_0x5dea84['id']]=_0x5dea84;this['edges'][_0x5dea84['id']]=[];};Graph[_0x57d2('0x7')][_0x57d2('0x8')]=function(_0x147194,_0x59ae87,_0x49e3e5){this[_0x57d2('0x6')][_0x147194]['push']({'target':_0x59ae87,'condition':_0x49e3e5});this[_0x57d2('0x9')]+=0x1;};Graph[_0x57d2('0x7')][_0x57d2('0xa')]=function(){return _['size'](this[_0x57d2('0x5')]);};Graph[_0x57d2('0x7')][_0x57d2('0xb')]=function(){return this[_0x57d2('0x9')];};Graph[_0x57d2('0x7')][_0x57d2('0xc')]=function(_0xe8357c){return this[_0x57d2('0x5')][_0xe8357c];};Graph[_0x57d2('0x7')][_0x57d2('0xd')]=function(_0x28428b,_0x3181ad){if(!this[_0x57d2('0x5')][_0x28428b]){return logger[_0x57d2('0xe')](_0x57d2('0xf'));}var _0x4086f3=_0x3181ad(this['vertices'][_0x28428b]);if(!_0x4086f3){return logger['info'](_0x57d2('0x10'));}if(this[_0x57d2('0x6')][_0x28428b]['length']===0x0){return logger[_0x57d2('0xe')](_0x57d2('0x11'));}for(var _0x4bb8f7=0x0,_0x3e12c6=[],_0x4986ad=![];_0x4bb8f7\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
+var _0x7fce=['then','createSquareReport','catch','inspect','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','sync','production','SQUAREROOT','start','stringify','YYYY-MM-DD\x20HH:mm:ss','omit','LOOP\x20through\x20graph','traverseBFS','clear','VERTEX','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','vresponse','response','result','isUndefined','toString','agicommand\x20not\x20found','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[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','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','connection','xml2json','lodash','syncho','moment','../../config/logger','../../config/license/util','./rpc','./vertices','defaults','agi','127.0.0.1','nextTick','error','log','port','info','format','name','message','[ERROR]\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','length','source','target','addEdge','value'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fce,0xdc));var _0xe7fc=function(_0x1eb5b7,_0x4f7be1){_0x1eb5b7=_0x1eb5b7-0x0;var _0x460761=_0x7fce[_0x1eb5b7];return _0x460761;};'use strict';var parser=require(_0xe7fc('0x0'));var _=require(_0xe7fc('0x1'));var syncho=require(_0xe7fc('0x2'));var util=require('util');var moment=require(_0xe7fc('0x3'));var config=require('../../config/environment');var logger=require(_0xe7fc('0x4'))('agi');var utilLicense=require(_0xe7fc('0x5'));var rpc=require(_0xe7fc('0x6'));var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require(_0xe7fc('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0xe7fc('0x8')](config[_0xe7fc('0x9')],{'ip':_0xe7fc('0xa'),'port':0x11dd});function connectionHandler(_0x19eeef){process[_0xe7fc('0xb')](function(){syncho(function(){try{setChannelVariables(_0x19eeef);agiHandler(_0x19eeef);}catch(_0x525bfd){logger[_0xe7fc('0xc')](_0x525bfd['stack']);}});});}function listeningHandler(){console[_0xe7fc('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xe7fc('0x9')][_0xe7fc('0xe')]);logger[_0xe7fc('0xf')](util[_0xe7fc('0x10')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xe7fc('0x9')]['ip'],config[_0xe7fc('0x9')]['port']));}function errorHandler(_0x4b8500){if(_0x4b8500&&_0x4b8500[_0xe7fc('0x11')]&&_0x4b8500['message']){logger[_0xe7fc('0xc')](util['format']('[%s]\x20%s',_0x4b8500[_0xe7fc('0x11')],_0x4b8500[_0xe7fc('0x12')]));}else{logger[_0xe7fc('0xc')](util[_0xe7fc('0x10')](_0xe7fc('0x13'),_0x4b8500['stack']));}}function closeHandler(){logger[_0xe7fc('0xf')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xe7fc('0x14')],this[_0xe7fc('0x15')],this[_0xe7fc('0x16')],this[_0xe7fc('0x17')],this['uniqueid']));try{createSquareReport(this);}catch(_0x552429){logger['error'](_0x552429['stack']);}}function timeoutHandler(){logger['info'](util['format'](_0xe7fc('0x18'),this['arg_1'],this[_0xe7fc('0x15')],this[_0xe7fc('0x16')],this[_0xe7fc('0x17')],this[_0xe7fc('0x19')]));}function hangupHandler(){logger[_0xe7fc('0xf')](util[_0xe7fc('0x10')](_0xe7fc('0x1a'),this[_0xe7fc('0x14')],this['calleridname'],this[_0xe7fc('0x16')],this[_0xe7fc('0x17')],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x35bb53){return parser[_0xe7fc('0x1b')](_0x35bb53,{'object':!![]})[_0xe7fc('0x1c')][_0xe7fc('0x1d')];}function addVertex(_0x26977a,_0x11c5a3,_0x3f850f){_0x11c5a3[_0xe7fc('0x1e')]=_0x3f850f;if(_0x11c5a3[_0xe7fc('0x1f')](_0xe7fc('0x20'))){_0x11c5a3[_0xe7fc('0x21')]=parseInt(_0x11c5a3[_0xe7fc('0x20')],0xa);}_0x26977a[_0xe7fc('0x22')](_['omit'](_0x11c5a3,_0xe7fc('0x23')));}function initGraph(_0x158d6e,_0x416464){var _0x3be1fd=new Graph();for(var _0x2249ed in _0x158d6e){if(_0x158d6e[_0xe7fc('0x1f')](_0x2249ed)){if(_['isArray'](_0x158d6e[_0x2249ed])){for(var _0x1a82e8=0x0;_0x1a82e8<_0x158d6e[_0x2249ed][_0xe7fc('0x24')];_0x1a82e8+=0x1){addVertex(_0x3be1fd,_0x158d6e[_0x2249ed][_0x1a82e8],_0x2249ed);}}else{addVertex(_0x3be1fd,_0x158d6e[_0x2249ed],_0x2249ed);}}}for(var _0x3966ac=0x0;_0x3966ac<_0x416464[_0xe7fc('0x24')];_0x3966ac+=0x1){if(_0x416464[_0x3966ac][_0xe7fc('0x25')]&&_0x416464[_0x3966ac][_0xe7fc('0x26')]){_0x3be1fd[_0xe7fc('0x27')](_0x416464[_0x3966ac]['source'],_0x416464[_0x3966ac][_0xe7fc('0x26')],_0x416464[_0x3966ac][_0xe7fc('0x28')]);}}return _0x3be1fd;}function getSquareProject(_0x512518,_0x37ab14){rpc['getSquareProject'](_0x512518)[_0xe7fc('0x29')](function(_0x27255a){_0x37ab14(null,_0x27255a);})['catch'](function(_0x2b3830){_0x37ab14(null,_0x2b3830);});}function createSquareReport(_0x4fe326,_0x245965){rpc[_0xe7fc('0x2a')](_0x4fe326)[_0xe7fc('0x29')](function(_0x48389c){if(_0x245965){_0x245965(null,_0x48389c);}})[_0xe7fc('0x2b')](function(_0x4e780c){if(_0x245965){_0x245965(null,_0x4e780c);}});}function setChannelVariables(_0x214f9c){for(var _0x24dc00 in _0x214f9c){if(_0x214f9c['hasOwnProperty'](_0x24dc00)){if(_0x24dc00['indexOf']('agi_')===0x0){_0x214f9c[_0x24dc00['substring'](0x4)]=_0x214f9c[_0x24dc00];delete _0x214f9c[_0x24dc00];}}}}function getLogFromObject(_0x419d3f){return util[_0xe7fc('0x2c')](_0x419d3f,{'showHidden':![],'depth':null});}function agiHandler(_0x3ce757){var _0x27d8e2,_0x406782,_0x412abb,_0x31f060,_0x2339da;logger[_0xe7fc('0x2d')](_0xe7fc('0x2e'),JSON['stringify'](_0x3ce757,null,0x2));logger[_0xe7fc('0xf')](util[_0xe7fc('0x10')](_0xe7fc('0x2f'),_0x3ce757[_0xe7fc('0x14')],_0x3ce757[_0xe7fc('0x15')],_0x3ce757['callerid'],_0x3ce757[_0xe7fc('0x17')],_0x3ce757[_0xe7fc('0x19')]));_0x3ce757['on'](_0xe7fc('0xc'),errorHandler);_0x3ce757['on'](_0xe7fc('0x30'),closeHandler);_0x3ce757['on'](_0xe7fc('0x31'),timeoutHandler);_0x3ce757[_0xe7fc('0x32')]=![];_0x3ce757['on'](_0xe7fc('0x33'),hangupHandler);var _0x41045d=getSquareProject[_0xe7fc('0x34')](null,_0x3ce757[_0xe7fc('0x14')]);if(_0x41045d){if(_0x41045d[_0xe7fc('0x35')]){_0x27d8e2=getRoot(_0x41045d[_0xe7fc('0x35')]);console['log'](_0xe7fc('0x36'),_0x27d8e2);if(_0x27d8e2&&_0x27d8e2[_0xe7fc('0x37')]){logger[_0xe7fc('0x2d')](_0xe7fc('0x1d'),JSON[_0xe7fc('0x38')](_0x27d8e2,null,0x2));_0x3ce757['joinAt']=moment()[_0xe7fc('0x10')](_0xe7fc('0x39'));_0x406782=initGraph(_[_0xe7fc('0x3a')](_0x27d8e2,_0xe7fc('0x23')),_0x27d8e2[_0xe7fc('0x23')]);_0x412abb=new Vertices(_0x3ce757,rpc,mailRpc);console[_0xe7fc('0xd')]('vertices',_0x412abb);logger['info'](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3ce757['arg_1'],_0x3ce757[_0xe7fc('0x15')],_0x3ce757[_0xe7fc('0x16')],_0x3ce757['dnid'],_0x3ce757[_0xe7fc('0x19')]));console['log'](_0xe7fc('0x3b'));_0x406782[_0xe7fc('0x3c')](_0x27d8e2[_0xe7fc('0x37')]['id'],function(_0x233180){try{_0x233180=_0x412abb[_0xe7fc('0x3d')](_0x233180);logger[_0xe7fc('0x2d')]('vertex',JSON[_0xe7fc('0x38')](_0x233180,null,0x2));console['log'](_0xe7fc('0x3e'),_0x233180);if(_0x233180[_0xe7fc('0x1e')]==='gotoc'){logger[_0xe7fc('0xf')](_0xe7fc('0x3f'));_0x3ce757[_0xe7fc('0x40')]=_0x233180[_0xe7fc('0x40')]||_0x3ce757[_0xe7fc('0x40')];_0x3ce757[_0xe7fc('0x41')]=_0x233180[_0xe7fc('0x41')];_0x3ce757[_0xe7fc('0x42')]=_0x233180[_0xe7fc('0x42')]?_0x233180[_0xe7fc('0x42')]-0x1:0x1;return null;}else if(_0x233180&&_0x412abb[_0x233180[_0xe7fc('0x1e')]]){_0x2339da=_0x412abb[_0x233180[_0xe7fc('0x1e')]](_0x233180);console[_0xe7fc('0xd')](_0xe7fc('0x43'),_0x2339da);logger[_0xe7fc('0xf')](_0xe7fc('0x44'),JSON[_0xe7fc('0x38')](_0x2339da,null,0x2));if(_0x2339da&&_0x2339da['code']===AGI_CODE_SUCCESS&&_0x2339da[_0xe7fc('0x45')]!==AGI_RESULT_ERROR&&!_0x3ce757[_0xe7fc('0x32')]){logger[_0xe7fc('0x2d')]('response',getLogFromObject(_0x2339da));return _[_0xe7fc('0x46')](_0x2339da[_0xe7fc('0x45')])?null:_0x2339da[_0xe7fc('0x45')][_0xe7fc('0x47')]();}else{logger[_0xe7fc('0xc')]('response',getLogFromObject(_0x2339da));return null;}}else{logger['error'](_0xe7fc('0x48'));return null;}}catch(_0x3e9a67){logger[_0xe7fc('0xc')](_0x3e9a67[_0xe7fc('0x49')]);return null;}});if(_0x27d8e2[_0xe7fc('0x4a')]){logger['info'](util[_0xe7fc('0x10')](_0xe7fc('0x4b'),_0x3ce757[_0xe7fc('0x14')],_0x3ce757[_0xe7fc('0x15')],_0x3ce757[_0xe7fc('0x16')],_0x3ce757[_0xe7fc('0x17')],_0x3ce757[_0xe7fc('0x19')]));_0x406782[_0xe7fc('0x3c')](_0x27d8e2[_0xe7fc('0x4a')]['id'],function(_0x45edbf){try{_0x45edbf=_0x412abb['clear'](_0x45edbf);logger[_0xe7fc('0x2d')]('vertex',JSON[_0xe7fc('0x38')](_0x45edbf,null,0x2));if(_0x45edbf&&_0x412abb[_0x45edbf[_0xe7fc('0x1e')]]){_0x2339da=_0x412abb[_0x45edbf[_0xe7fc('0x1e')]](_0x45edbf);if(_0x2339da){logger[_0xe7fc('0x2d')](_0xe7fc('0x44'),getLogFromObject(_0x2339da));return _[_0xe7fc('0x46')](_0x2339da[_0xe7fc('0x45')])?null:_0x2339da[_0xe7fc('0x45')][_0xe7fc('0x47')]();}else{logger['error'](_0xe7fc('0x44'),getLogFromObject(_0x2339da));return null;}}else{logger[_0xe7fc('0xc')](_0xe7fc('0x48'));return null;}}catch(_0x2e7748){logger[_0xe7fc('0xc')](_0x2e7748[_0xe7fc('0x49')]);return null;}});}logger['info'](util[_0xe7fc('0x10')](_0xe7fc('0x4c'),_0x3ce757[_0xe7fc('0x14')],_0x3ce757[_0xe7fc('0x15')],_0x3ce757[_0xe7fc('0x16')],_0x3ce757[_0xe7fc('0x17')],_0x3ce757['uniqueid']));logger['info'](util[_0xe7fc('0x10')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x3ce757['context'],_0x3ce757[_0xe7fc('0x41')],parseInt(_0x3ce757[_0xe7fc('0x42')],0xa)+0x1));_0x3ce757[_0xe7fc('0x4d')](_0x3ce757[_0xe7fc('0x40')],_0x3ce757[_0xe7fc('0x41')],parseInt(_0x3ce757[_0xe7fc('0x42')],0xa)+0x1);_0x3ce757[_0xe7fc('0x30')]();}}else{logger[_0xe7fc('0xc')](util[_0xe7fc('0x10')](_0xe7fc('0x4e'),_0x3ce757[_0xe7fc('0x14')]));_0x3ce757['continueAt'](_0x3ce757[_0xe7fc('0x40')],_0x3ce757['extension'],parseInt(_0x3ce757[_0xe7fc('0x42')],0xa)+0x1);_0x3ce757[_0xe7fc('0x30')]();}}else{logger[_0xe7fc('0xc')](util[_0xe7fc('0x10')](_0xe7fc('0x4f'),_0x3ce757[_0xe7fc('0x14')]));_0x3ce757[_0xe7fc('0x4d')](_0x3ce757[_0xe7fc('0x40')],_0x3ce757['extension'],parseInt(_0x3ce757[_0xe7fc('0x42')],0xa)+0x1);_0x3ce757[_0xe7fc('0x30')]();}}function main(){var _0x568db4;return utilLicense[_0xe7fc('0x50')]()[_0xe7fc('0x29')](function(_0xc24f66){if(_0xc24f66){if(_0xc24f66[_0xe7fc('0x51')]){if(_0xc24f66[_0xe7fc('0x52')]&&_0xc24f66['callysquare']>0x0){logger[_0xe7fc('0xf')](util[_0xe7fc('0x10')](_0xe7fc('0x53'),_0xc24f66[_0xe7fc('0x52')]));_0x568db4=_0xc24f66['callysquare'];}else{logger[_0xe7fc('0xf')](_0xe7fc('0x54'));}}else{logger[_0xe7fc('0xf')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x568db4=-0x1;}}})['catch'](function(_0x323c66){logger[_0xe7fc('0xc')](_0xe7fc('0x55'),_0x323c66[_0xe7fc('0x49')]);})[_0xe7fc('0x4a')](function(){var _0xb35f53=require('./server')(config[_0xe7fc('0x9')][_0xe7fc('0xe')],config[_0xe7fc('0x9')]['ip'],_0x568db4);_0xb35f53['on'](_0xe7fc('0xc'),errorHandler);_0xb35f53['on']('listening',listeningHandler);_0xb35f53['on'](_0xe7fc('0x56'),connectionHandler);_0xb35f53['on']('close',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 6b05826..95958a9 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 _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
+var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x2fdf79,_0x32e753){var _0xea58da=function(_0x1a60cd){while(--_0x1a60cd){_0x2fdf79['push'](_0x2fdf79['shift']());}};_0xea58da(++_0x32e753);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});};
\ No newline at end of file
diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js
index 33a7ea8..262c83f 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 _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
+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(_0x594e1d,_0x4432fe){var _0x427b34=function(_0x21324d){while(--_0x21324d){_0x594e1d['push'](_0x594e1d['shift']());}};_0x427b34(++_0x4432fe);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3cfe5a,_0x1f3594){_0x3cfe5a=_0x3cfe5a-0x0;var _0x3c731e=_0x5f2f[_0x3cfe5a];return _0x3c731e;};'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 880c954..dce5834 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 _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
+var _0x57e5=['name','email','getSquareProjectById','ShowVoiceQueue','ShowVariable','dsn','getUserById','ShowUser','getContactByPhone','log','rpcreq','getTrunkById','ShowTrunk','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','phone','ListId','then','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','moment','lodash','jayson/promise','client','error','catch','getSquareProject','ShowSquareProject','production','ShowMailAccount','Smtp'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x57e5,0x8e));var _0x557e=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x57e5[_0x465028];return _0xb783d4;};'use strict';var BPromise=require('bluebird');var moment=require(_0x557e('0x0'));var _=require(_0x557e('0x1'));var util=require('util');var jayson=require(_0x557e('0x2'));var client=jayson[_0x557e('0x3')]['http']({'port':0x2329});function request(_0x2429f9,_0x30bbc7){return new BPromise(function(_0x1b93a3,_0x37aeb4){return client['request'](_0x2429f9,_0x30bbc7)['then'](function(_0x127ae9){if(_0x127ae9['error']){return _0x37aeb4(_0x127ae9[_0x557e('0x4')]['message']);}else{return _0x1b93a3(_0x127ae9['result']);}})[_0x557e('0x5')](function(_0x4369e4){return _0x37aeb4(_0x4369e4);});});}exports[_0x557e('0x6')]=function(_0x109ec8){return request(_0x557e('0x7'),{'options':{'raw':![],'where':{'name':_0x109ec8},'attributes':[_0x557e('0x8')]}});};exports['getMailAccountById']=function(_0x4a71ea){return request(_0x557e('0x9'),{'options':{'raw':![],'where':{'id':_0x4a71ea},'include':[{'model':'MailServerOut','as':_0x557e('0xa')}],'attributes':['id',_0x557e('0xb'),_0x557e('0xc')]}});};exports[_0x557e('0xd')]=function(_0x177df0){return request('ShowSquareProject',{'options':{'where':{'id':_0x177df0},'attributes':[_0x557e('0xb')]}});};exports['getVoiceQueueById']=function(_0x21770b){return request(_0x557e('0xe'),{'options':{'where':{'id':_0x21770b},'attributes':[_0x557e('0xb')]}});};exports['getVariableById']=function(_0x199f5f){return request(_0x557e('0xf'),{'options':{'where':{'id':_0x199f5f},'attributes':[_0x557e('0xb')]}});};exports['getSquareOdbcById']=function(_0x2aa742){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x2aa742},'attributes':[_0x557e('0x10')]}});};exports[_0x557e('0x11')]=function(_0x2d24fd){return request(_0x557e('0x12'),{'options':{'where':{'id':_0x2d24fd},'attributes':[_0x557e('0xb')]}});};exports[_0x557e('0x13')]=function(_0x8a10c9){console[_0x557e('0x14')](_0x557e('0x15'),_0x8a10c9);return request('GetContactByPhone',{'options':{'where':{'phone':_0x8a10c9['phone']},'attributes':['id']}});};exports[_0x557e('0x16')]=function(_0x4e6a33){return request(_0x557e('0x17'),{'options':{'where':{'id':_0x4e6a33},'attributes':[_0x557e('0xb')]}});};exports['getSoundById']=function(_0x1aac5b){return request('ShowSound',{'options':{'where':{'id':_0x1aac5b},'attributes':[_0x557e('0x18')]}});};exports[_0x557e('0x19')]=function(_0x3df14d){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x3df14d},'include':[{'model':_0x557e('0x1a'),'as':_0x557e('0x1b')}]}});};exports[_0x557e('0x1c')]=function(_0x48ba52){return request('ShowSmsAccount',{'options':{'where':{'id':_0x48ba52},'attributes':['id',_0x557e('0xb')]}});};exports[_0x557e('0x1d')]=function(_0x23c498){return request(_0x557e('0x1e'),{'body':_0x23c498});};exports['createSquareDetailsReport']=function(_0x496f5c){return request('CreateSquareDetailsReport',{'body':_0x496f5c});};exports['createSquareReport']=function(_0x2218ca){return request('CreateSquareReport',{'body':_['merge'](_0x2218ca,{'project_name':_0x2218ca[_0x557e('0x1f')],'prev_project_name':_0x2218ca['arg_2']||'','is_subproject':_0x2218ca[_0x557e('0x20')]?!![]:![],'leaveAt':moment()[_0x557e('0x21')](_0x557e('0x22'))})});};exports['createSquareRecording']=function(_0x3129a0){return request(_0x557e('0x23'),{'body':_0x3129a0});};exports[_0x557e('0x24')]=function(_0x15a38f){return request(_0x557e('0x25'),{'body':_0x15a38f});};exports[_0x557e('0x26')]=function(_0x589f07){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x589f07[_0x557e('0x27')],'ListId':_0x589f07[_0x557e('0x28')]}}})[_0x557e('0x29')](function(_0x27e793){if(_0x27e793){return _0x27e793;}return request('CreateCmContact',{'body':_0x589f07});});};exports[_0x557e('0x2a')]=function(_0x4e7b98){return request(_0x557e('0x2b'),{'options':{'where':{'id':_0x4e7b98},'attributes':[_0x557e('0xb')]}});};exports[_0x557e('0x2c')]=function(_0x1d78ce,_0x27c166){return request(_0x557e('0x2d'),{'body':{'interface':_0x27c166},'options':{'where':_0x1d78ce}});};exports[_0x557e('0x2e')]=function(_0x270423,_0x205a8f,_0x581633){return request(_0x557e('0x2f'),{'body':{'type':_0x205a8f,'uniqueid':_0x581633},'options':{'where':_0x270423}});};exports[_0x557e('0x30')]=function(_0x1a93b4){return request('UnpauseUser',{'body':{},'options':{'where':_0x1a93b4}});};exports[_0x557e('0x31')]=function(_0x525861){return request(_0x557e('0x32'),{'body':{},'options':{'where':_0x525861}});};
\ 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 ae7f57a..3754e50 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 _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
+var _0x5db8=['exports','./polly','./lex'];(function(_0x246018,_0x116a00){var _0x40bc7d=function(_0x4ed867){while(--_0x4ed867){_0x246018['push'](_0x246018['shift']());}};_0x40bc7d(++_0x116a00);}(_0x5db8,0xbb));var _0x85db=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0x5db8[_0x3cae69];return _0x3128eb;};var polly=require(_0x85db('0x0'));var lex=require(_0x85db('0x1'));module[_0x85db('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 c7d568a..ade9301 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 _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
+var _0x0cfa=['exports','./lib/api'];(function(_0x26d731,_0x1f08f9){var _0x4d71bd=function(_0x20c146){while(--_0x20c146){_0x26d731['push'](_0x26d731['shift']());}};_0x4d71bd(++_0x1f08f9);}(_0x0cfa,0x18f));var _0xa0cf=function(_0x4d3aa1,_0x54bb3c){_0x4d3aa1=_0x4d3aa1-0x0;var _0x495b44=_0x0cfa[_0x4d3aa1];return _0x495b44;};'use strict';var lex=require(_0xa0cf('0x0'));module[_0xa0cf('0x1')]=function(_0x336e19,_0x166ba2,_0x4d6a1c,_0x525629,_0x4d8758,_0x37c4e1){return lex(_0x336e19,_0x166ba2,_0x4d6a1c,_0x525629,_0x4d8758,_0x37c4e1);};
\ 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 12954ee..a655c43 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 _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
+var _0xf5b2=['hasOwnProperty','slot_','exports','$LATEST','aws-sdk','postText','slots'];(function(_0x1082b1,_0x53db01){var _0x4f425f=function(_0x741f06){while(--_0x741f06){_0x1082b1['push'](_0x1082b1['shift']());}};_0x4f425f(++_0x53db01);}(_0xf5b2,0x146));var _0x2f5b=function(_0x4a0e68,_0x45c08c){_0x4a0e68=_0x4a0e68-0x0;var _0x4fb274=_0xf5b2[_0x4a0e68];return _0x4fb274;};'use strict';var BPromise=require('bluebird');var AWS=require(_0x2f5b('0x0'));function lexResult(_0x142b39,_0x4c81a6){return new BPromise(function(_0x239aa3,_0x50cb11){_0x142b39[_0x2f5b('0x1')](_0x4c81a6,function(_0x5bfae4,_0x38d7a8){if(_0x5bfae4){_0x50cb11(_0x5bfae4);}if(_0x38d7a8['slots']){for(const _0x1c4de4 in _0x38d7a8[_0x2f5b('0x2')]){if(_0x38d7a8[_0x2f5b('0x2')][_0x2f5b('0x3')](_0x1c4de4)){var _0x53422a=_0x38d7a8['slots'][_0x1c4de4];_0x38d7a8[_0x2f5b('0x4')+_0x1c4de4]=_0x53422a;}}}_0x239aa3(_0x38d7a8);});});}module[_0x2f5b('0x5')]=function(_0x88e9ad,_0x280298,_0x28ed71,_0x368584,_0x40a585,_0x1dd522){var _0x1e1354=new AWS['LexRuntime']({'accessKeyId':_0x280298,'secretAccessKey':_0x28ed71,'region':_0x368584});var _0x93341e={'botAlias':_0x2f5b('0x6'),'botName':_0x1dd522,'inputText':_0x40a585,'userId':_0x88e9ad};return lexResult(_0x1e1354,_0x93341e);};
\ 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 86322dc..9b3f0b7 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 _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
+var _0xbfae=['./lib/api','exports'];(function(_0x23991c,_0x307ed1){var _0x21fcde=function(_0xcf53aa){while(--_0xcf53aa){_0x23991c['push'](_0x23991c['shift']());}};_0x21fcde(++_0x307ed1);}(_0xbfae,0xc0));var _0xebfa=function(_0x3c61a8,_0x287fb7){_0x3c61a8=_0x3c61a8-0x0;var _0xa348c=_0xbfae[_0x3c61a8];return _0xa348c;};'use strict';var polly=require(_0xebfa('0x0'));module[_0xebfa('0x1')]=function(_0x2affb0,_0x189848,_0x26df31,_0x2fb8e5,_0x41d34c,_0x4ee48c,_0x6022bc){return polly(_0x2affb0,_0x189848,_0x26df31,_0x2fb8e5,_0x41d34c,_0x4ee48c,_0x6022bc);};
\ 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 f63a4f7..c588e4b 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 _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
+var _0x7cbd=['writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path','aws-sdk','synthesizeSpeech'];(function(_0x4e1267,_0x1dd001){var _0x6ccaab=function(_0x53d429){while(--_0x53d429){_0x4e1267['push'](_0x4e1267['shift']());}};_0x6ccaab(++_0x1dd001);}(_0x7cbd,0x9f));var _0xd7cb=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0x7cbd[_0x295314];return _0x584b0c;};'use strict';var fs=require('fs');var path=require(_0xd7cb('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0xd7cb('0x1'));function pollyResult(_0x29be5d,_0x1d403b,_0x2615a6){return new BPromise(function(_0x4a64d8,_0x3fcd56){_0x29be5d[_0xd7cb('0x2')](_0x1d403b,function(_0x38ec02,_0x1aa46e){if(_0x38ec02){_0x3fcd56(_0x38ec02);}else if(_0x1aa46e){if(_0x1aa46e['AudioStream']instanceof Buffer){fs[_0xd7cb('0x3')](_0x2615a6,_0x1aa46e[_0xd7cb('0x4')],function(_0x500be6){if(_0x500be6){_0x3fcd56(_0x500be6);}else{_0x4a64d8();}});}else{_0x3fcd56(new Error(_0xd7cb('0x5')));}}else{_0x3fcd56(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xd7cb('0x6')]=function(_0x42e0ca,_0x2630ee,_0x468a97,_0xee2fe1,_0x551d25,_0x42474c,_0x766336){var _0x1284e1=new AWS[(_0xd7cb('0x7'))]({'accessKeyId':_0x42e0ca,'secretAccessKey':_0x2630ee,'region':_0x468a97});var _0x436159={'Text':_0x551d25,'TextType':_0x42474c||'text','OutputFormat':_0xd7cb('0x8'),'VoiceId':_0xee2fe1};return pollyResult(_0x1284e1,_0x436159,_0x766336);};
\ 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 d057beb..db12264 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 _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
+var _0x1eb4=['exports'];(function(_0x500e9a,_0x1719e4){var _0x512c5a=function(_0xa5ef57){while(--_0xa5ef57){_0x500e9a['push'](_0x500e9a['shift']());}};_0x512c5a(++_0x1719e4);}(_0x1eb4,0x1d5));var _0x41eb=function(_0x2179eb,_0x5ad3b6){_0x2179eb=_0x2179eb-0x0;var _0x39e0be=_0x1eb4[_0x2179eb];return _0x39e0be;};'use strict';var asr=require('./lib/api');module[_0x41eb('0x0')]=function(_0xf1b009,_0x161ffb,_0x4280f2,_0x5ac147){return asr(_0xf1b009,_0x161ffb,_0x4280f2);};
\ 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 7711a19..95398f8 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 _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
+var _0x0008=['https://speech.googleapis.com','exports','string','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','length','lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird'];(function(_0x22cc4,_0x1178d6){var _0x267a6a=function(_0x11250f){while(--_0x11250f){_0x22cc4['push'](_0x22cc4['shift']());}};_0x267a6a(++_0x1178d6);}(_0x0008,0x1ed));var _0x8000=function(_0x3f2855,_0x220576){_0x3f2855=_0x3f2855-0x0;var _0x20c16f=_0x0008[_0x3f2855];return _0x20c16f;};'use strict';var url=require(_0x8000('0x0'));var BPromise=require(_0x8000('0x1'));var fs=require('fs');var host=_0x8000('0x2');module[_0x8000('0x3')]=function(_0x1983dc,_0x3a506c,_0x295e34){return new BPromise(function(_0x450823,_0x4a0dfc){var _0xc660ea;if(typeof _0x1983dc!==_0x8000('0x4')||_0x1983dc['length']===0x0){return _0x4a0dfc(_0x8000('0x5'));}if(typeof _0x3a506c!==_0x8000('0x4')||_0x3a506c['length']===0x0){return _0x4a0dfc(_0x8000('0x6'));}if(typeof _0x295e34!==_0x8000('0x7')&&(typeof _0x295e34!==_0x8000('0x4')||_0x295e34[_0x8000('0x8')]===0x0)){return _0x4a0dfc(_0x8000('0x9'));}try{_0xc660ea=fs['readFileSync'](_0x1983dc)[_0x8000('0xa')](_0x8000('0xb'));}catch(_0x2f1a25){return _0x4a0dfc(_0x2f1a25);}return _0x450823({'method':_0x8000('0xc'),'uri':host+_0x8000('0xd')+_0x3a506c,'body':{'config':{'encoding':_0x8000('0xe'),'sampleRateHertz':'8000','languageCode':_0x295e34},'audio':{'content':_0xc660ea}},'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 b26e603..e396477 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 _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
+var _0x2dd8=['exports','./asr'];(function(_0x149e3d,_0xd7a07){var _0x3c4caf=function(_0x4507bc){while(--_0x4507bc){_0x149e3d['push'](_0x149e3d['shift']());}};_0x3c4caf(++_0xd7a07);}(_0x2dd8,0x143));var _0x82dd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2dd8[_0x19e35c];return _0x3e1fe8;};var asr=require(_0x82dd('0x0'));module[_0x82dd('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 17d5905..39d682d 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 _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
+var _0x83d9=['model=%s','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','url','parse','bluebird','randomstring','request-promise','querystring','apiai-promise','./google','./aws','./tilde','./sestek','agi','https://api.ispeech.org/api/rest','protocol','https:','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','close','unlink','error','download\x20error','pipe','end','WHAT_EVER','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','then','777','split','?key=','ssml','input','voice','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','chmodSync','googleTTS','asr','uri','results','transcript','alternatives','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','stringify','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR'];(function(_0x2ef12d,_0x103abb){var _0x9d49ce=function(_0x3cf8b8){while(--_0x3cf8b8){_0x2ef12d['push'](_0x2ef12d['shift']());}};_0x9d49ce(++_0x103abb);}(_0x83d9,0xd2));var _0x983d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x83d9[_0x432682];return _0x463d05;};'use strict';var fs=require('fs');var path=require(_0x983d('0x0'));var http=require('http');var https=require('https');var urlParse=require(_0x983d('0x1'))[_0x983d('0x2')];var BPromise=require(_0x983d('0x3'));var rs=require(_0x983d('0x4'));var sox=require('sox');var rp=require(_0x983d('0x5'));var util=require('util');var querystring=require(_0x983d('0x6'));var tts=require('google-tts-api');var apiai=require(_0x983d('0x7'));var md5=require('md5');var google=require(_0x983d('0x8'));var aws=require(_0x983d('0x9'));var tilde=require(_0x983d('0xa'));var sestek=require(_0x983d('0xb'));var logger=require('../../../config/logger')(_0x983d('0xc'));var ISPEECH_API=_0x983d('0xd');function downloadFile(_0x301fd9,_0xc5c277){return new BPromise(function(_0x221bc9,_0x511768){var _0x512ccc=urlParse(_0x301fd9);var _0x235897=_0x512ccc[_0x983d('0xe')]===_0x983d('0xf')?https:http;var _0xc92ee={'host':_0x512ccc['host'],'path':_0x512ccc['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x235897[_0x983d('0x10')](_0xc92ee,function(_0x378610){if(_0x378610[_0x983d('0x11')]!==0xc8){logger['error'](_0x983d('0x12')+_0x301fd9+_0x983d('0x13')+_0x378610[_0x983d('0x11')]+'\x20('+_0x378610[_0x983d('0x14')]+')');_0x511768(new Error('request\x20to\x20'+_0x301fd9+'\x20failed,\x20status\x20code\x20=\x20'+_0x378610[_0x983d('0x11')]+'\x20('+_0x378610[_0x983d('0x14')]+')'));return;}var _0x3fd2ca=fs[_0x983d('0x15')](_0xc5c277);_0x3fd2ca['on'](_0x983d('0x16'),function(){logger[_0x983d('0x17')]('finish\x20download\x20file');_0x3fd2ca[_0x983d('0x18')](_0x221bc9);});_0x3fd2ca['on']('error',function(_0x4d5e63){fs[_0x983d('0x19')](_0xc5c277);logger[_0x983d('0x1a')](_0x983d('0x1b'),_0x4d5e63);_0x511768(_0x4d5e63);});_0x378610[_0x983d('0x1c')](_0x3fd2ca);})['on'](_0x983d('0x1a'),function(_0x9ba32e){logger[_0x983d('0x1a')](_0x9ba32e);_0x511768(_0x9ba32e);})[_0x983d('0x1d')]();});}function uploadFile(_0x19e97a){return new BPromise(function(_0x36b6fa,_0x3c4268){var _0x56d2d7=urlParse(_0x19e97a);var _0x13dcea=_0x56d2d7[_0x983d('0xe')]===_0x983d('0xf')?https:http;var _0x46a32f={'host':_0x56d2d7['host'],'path':_0x56d2d7[_0x983d('0x0')],'headers':{'user-agent':_0x983d('0x1e')}};_0x13dcea[_0x983d('0x10')](_0x46a32f,function(_0x461878){if(_0x461878['statusCode']!==0xc8){_0x3c4268(new Error(_0x983d('0x12')+_0x19e97a+_0x983d('0x13')+_0x461878[_0x983d('0x11')]+'\x20('+_0x461878['statusMessage']+')'));return;}var _0x535853='';_0x461878['on'](_0x983d('0x1f'),function(_0x585d9a){_0x535853+=_0x585d9a;});_0x461878['on'](_0x983d('0x1d'),function(){_0x36b6fa(_0x535853);});})['on'](_0x983d('0x1a'),function(_0x1ceab5){_0x3c4268(_0x1ceab5);})['end']();});}function convertFile(_0x4092ab,_0x9fd4df){return new BPromise(function(_0x4d4a65,_0x48dd36){var _0x12ebe2=sox[_0x983d('0x20')](_0x4092ab,_0x9fd4df,{'sampleRate':0x1f40,'format':_0x983d('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x12ebe2['on'](_0x983d('0x1a'),function(_0x57004e){logger[_0x983d('0x1a')](_0x983d('0x22'),_0x57004e);_0x48dd36(_0x57004e);});_0x12ebe2['on'](_0x983d('0x1d'),function(){logger['info'](_0x983d('0x23'));_0x4d4a65();});_0x12ebe2[_0x983d('0x24')]();});}function base64Decode(_0x596e6c,_0xc3ab2b){var _0x2ebf2a=path[_0x983d('0x25')](__dirname,_0x983d('0x26'),rs[_0x983d('0x27')](0x4)+_0x983d('0x28'));fs['writeFileSync'](_0x2ebf2a,_0x596e6c,'base64');return convertFile(_0x2ebf2a,_0xc3ab2b)[_0x983d('0x29')](function(){try{fs[_0x983d('0x19')](_0x2ebf2a);fs['chmodSync'](_0xc3ab2b,_0x983d('0x2a'));}catch(_0x57bbdc){logger[_0x983d('0x1a')](_0x57bbdc);}return _0xc3ab2b[_0x983d('0x2b')]('.')[0x0];});}function base64Encode(_0x4fb9d1){var _0x5ed9dd=fs['readFileSync'](_0x4fb9d1);return new Buffer(_0x5ed9dd)['toString']('base64');}exports['googleCloudTTS']=function(_0x510023,_0x5eb47f,_0x4ea294,_0x38f4d9,_0x50ff63,_0x188696){var _0x32e7e4,_0x1d98eb;var _0x382a8b='https://texttospeech.googleapis.com/v1/';var _0x37e8ec=_0x983d('0x2c')+_0x510023;var _0x250ceb={};if(_0x5eb47f===_0x983d('0x2d')){_0x250ceb[_0x983d('0x2e')]={'ssml':_0x4ea294};}else{_0x250ceb[_0x983d('0x2e')]={'text':_0x4ea294};};_0x250ceb[_0x983d('0x2f')]={'languageCode':_0x38f4d9,'ssmlGender':_0x50ff63};_0x250ceb['audioConfig']={'audioEncoding':_0x983d('0x30'),'sampleRateHertz':0x1f40};var _0x47bcc0={'url':_0x382a8b+_0x983d('0x31')+_0x37e8ec,'method':_0x983d('0x32'),'json':!![],'body':_0x250ceb};return rp(_0x47bcc0)[_0x983d('0x29')](function(_0x513f22){return new BPromise(function(_0x370ffe,_0x1ed1a1){_0x32e7e4=path['resolve'](__dirname,_0x983d('0x26'),rs['generate'](0x4)+_0x983d('0x33'));var _0x41a16d=Buffer[_0x983d('0x34')](_0x513f22[_0x983d('0x35')],'base64');return fs[_0x983d('0x36')](_0x32e7e4,_0x41a16d,function(_0x6b3f81){_0x1ed1a1(_0x6b3f81);},function(_0x5ba17a){fs[_0x983d('0x37')](_0x32e7e4,_0x983d('0x2a'));_0x370ffe(_0x5ba17a);});});})[_0x983d('0x29')](function(_0x200517){_0x1d98eb=path['resolve'](__dirname,_0x983d('0x26'),rs[_0x983d('0x27')](0x4)+'.wav');return convertFile(_0x32e7e4,_0x1d98eb);})[_0x983d('0x29')](function(){try{fs['unlink'](_0x32e7e4);fs[_0x983d('0x37')](_0x1d98eb,_0x983d('0x2a'));}catch(_0x250f10){logger[_0x983d('0x1a')](_0x250f10);}logger[_0x983d('0x17')]('googleCloudTTS\x20path',_0x1d98eb[_0x983d('0x2b')]('.')[0x0]);return _0x1d98eb[_0x983d('0x2b')]('.')[0x0];});};exports[_0x983d('0x38')]=function(_0x3d1367,_0x3d36ab){var _0x1ae2af,_0xf5e277;return tts(_0x3d1367,_0x3d36ab||'en',0x1)['then'](function(_0x145007){logger['info'](_0x145007);_0x1ae2af=path['resolve'](__dirname,_0x983d('0x26'),rs[_0x983d('0x27')](0x4)+_0x983d('0x33'));return downloadFile(_0x145007,_0x1ae2af);})[_0x983d('0x29')](function(){_0xf5e277=path[_0x983d('0x25')](__dirname,'tmp',rs[_0x983d('0x27')](0x4)+_0x983d('0x28'));return convertFile(_0x1ae2af,_0xf5e277);})[_0x983d('0x29')](function(){try{fs[_0x983d('0x19')](_0x1ae2af);fs[_0x983d('0x37')](_0xf5e277,_0x983d('0x2a'));}catch(_0x400cba){logger['error'](_0x400cba);}logger[_0x983d('0x17')]('goggleTTS\x20path',_0xf5e277[_0x983d('0x2b')]('.')[0x0]);return _0xf5e277['split']('.')[0x0];});};exports['googleASR']=function(_0x373db4,_0x382837,_0x182ba0){return google[_0x983d('0x39')](_0x373db4,_0x382837,_0x182ba0)[_0x983d('0x29')](function(_0x4f10cc){logger[_0x983d('0x17')](_0x4f10cc[_0x983d('0x3a')]);return rp(_0x4f10cc);})[_0x983d('0x29')](function(_0x4d7fe6){var _0x4c1db5='';var _0x2af552=0x0;try{fs[_0x983d('0x19')](_0x373db4);}catch(_0x5919eb){logger[_0x983d('0x1a')](_0x5919eb);}if(_0x4d7fe6&&_0x4d7fe6[_0x983d('0x3b')]){_0x4c1db5=_0x4d7fe6['results']['map'](function(_0x12ecf7){return _0x12ecf7&&_0x12ecf7['alternatives'][0x0]&&_0x12ecf7['alternatives'][0x0][_0x983d('0x3c')]?_0x12ecf7[_0x983d('0x3d')][0x0]['transcript']:'';})[_0x983d('0x3e')]('\x0a');_0x2af552=_0x4d7fe6['results'][_0x983d('0x3f')](function(_0x1e5bdf){return _0x1e5bdf&&_0x1e5bdf['alternatives'][0x0]&&_0x1e5bdf[_0x983d('0x3d')][0x0][_0x983d('0x40')]?_0x1e5bdf[_0x983d('0x3d')][0x0]['confidence']:0x0;})[_0x983d('0x3e')]('\x0a');}logger[_0x983d('0x17')](_0x983d('0x41'),_0x4c1db5);logger[_0x983d('0x17')](_0x983d('0x42'),_0x2af552);return{'transcript':_0x4c1db5,'confidence':_0x2af552};})[_0x983d('0x43')](function(_0x41af96){logger['error'](_0x983d('0x44'),_0x41af96[_0x983d('0x11')],_0x41af96['name'],_0x41af96[_0x983d('0x45')]);});};exports[_0x983d('0x46')]=function(_0xbc1a92,_0x56c25b,_0x5554a2,_0x52a7bf){var _0x55d264=apiai(_0x56c25b,{'language':_0x52a7bf||'en'});return _0x55d264['textRequest'](_0x5554a2,{'sessionId':md5(_0xbc1a92)})[_0x983d('0x29')](function(_0x5e390c){logger[_0x983d('0x17')](JSON[_0x983d('0x47')](_0x5e390c));return{'source':_0x5e390c['result']['source'],'resolvedQuery':_0x5e390c[_0x983d('0x48')][_0x983d('0x49')],'action':_0x5e390c[_0x983d('0x48')][_0x983d('0x4a')],'actionIncomplete':_0x5e390c[_0x983d('0x48')][_0x983d('0x4b')],'speech':_0x5e390c['result'][_0x983d('0x4c')][_0x983d('0x4d')],'score':_0x5e390c[_0x983d('0x48')][_0x983d('0x4e')],'statusCode':_0x5e390c['status'][_0x983d('0x4f')],'endConversation':_0x5e390c['result']['metadata']['endConversation']||![],'isFallbackIntent':_0x5e390c[_0x983d('0x48')][_0x983d('0x50')]['isFallbackIntent']};});};exports[_0x983d('0x51')]=function(_0x490b37,_0x55cca1,_0x4343ac,_0x24b037){return tilde['asr'](_0x490b37,_0x55cca1,_0x4343ac,_0x24b037)[_0x983d('0x29')](function(_0x4f0227){try{fs[_0x983d('0x19')](_0x490b37);}catch(_0x1bc7fd){logger[_0x983d('0x1a')](_0x1bc7fd);}logger[_0x983d('0x17')](_0x983d('0x52'),_0x4f0227[_0x983d('0x3c')]);logger[_0x983d('0x17')](_0x983d('0x53'),_0x4f0227[_0x983d('0x40')]);return _0x4f0227;});};exports[_0x983d('0x54')]=function(_0x504f9b,_0x1af534,_0x119153,_0x17b53e,_0x538945,_0x4e5cf5){var _0x4c2fb0=path[_0x983d('0x25')](__dirname,_0x983d('0x26'),rs[_0x983d('0x27')](0x4)+_0x983d('0x33'));var _0x3d8a89;return aws['polly'](_0x504f9b,_0x1af534,_0x119153,_0x17b53e,_0x538945,_0x4e5cf5,_0x4c2fb0)[_0x983d('0x29')](function(){_0x3d8a89=path[_0x983d('0x25')](__dirname,_0x983d('0x26'),rs['generate'](0x4)+_0x983d('0x28'));return convertFile(_0x4c2fb0,_0x3d8a89);})[_0x983d('0x29')](function(){try{fs[_0x983d('0x19')](_0x4c2fb0);fs[_0x983d('0x37')](_0x3d8a89,'777');}catch(_0x516277){logger[_0x983d('0x1a')](_0x516277);}return _0x3d8a89[_0x983d('0x2b')]('.')[0x0];});};exports['awsLex']=function(_0x24020a,_0x5185bd,_0x458d83,_0x3b19a8,_0x3bdac7,_0x1c2d09){return aws[_0x983d('0x55')](_0x24020a,_0x5185bd,_0x458d83,_0x3b19a8,_0x3bdac7,_0x1c2d09)[_0x983d('0x29')](function(_0x54b0d4){logger[_0x983d('0x17')](JSON[_0x983d('0x47')](_0x54b0d4));return _0x54b0d4;});};exports[_0x983d('0x56')]=function(_0x54cc91,_0x248003,_0x5ea1fe,_0x213967){var _0x3236df=util[_0x983d('0x57')](_0x983d('0x58'),ISPEECH_API,_0x54cc91,encodeURIComponent(_0x248003),_0x5ea1fe,_0x213967);var _0x22b63a=path[_0x983d('0x25')](__dirname,_0x983d('0x26'),rs[_0x983d('0x27')](0x4)+_0x983d('0x33'));var _0x2c93fe;return downloadFile(_0x3236df,_0x22b63a)[_0x983d('0x29')](function(){_0x2c93fe=path['resolve'](__dirname,_0x983d('0x26'),rs[_0x983d('0x27')](0x4)+_0x983d('0x28'));return convertFile(_0x22b63a,_0x2c93fe);})['then'](function(){try{fs['unlink'](_0x22b63a);fs[_0x983d('0x37')](_0x2c93fe,_0x983d('0x2a'));}catch(_0x5e5c14){logger['error'](_0x5e5c14);}return _0x2c93fe[_0x983d('0x2b')]('.')[0x0];});};exports[_0x983d('0x59')]=function(_0x4efcb8,_0x4ee7a9,_0x43826a,_0x247b4c){var _0x4f709c=util[_0x983d('0x57')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x4ee7a9,_0x43826a,base64Encode(_0x4efcb8),_0x247b4c?util[_0x983d('0x57')](_0x983d('0x5a'),encodeURIComponent(_0x247b4c)):'freeform=3');return uploadFile(_0x4f709c)[_0x983d('0x29')](function(_0x599cf9){return querystring[_0x983d('0x2')](_0x599cf9);});};exports['sestekNDA']=function(_0x1f497c,_0x40a30d){return sestek[_0x983d('0x5b')](_0x1f497c,_0x40a30d)[_0x983d('0x29')](function(_0x55500e){logger[_0x983d('0x17')](JSON[_0x983d('0x47')](_0x55500e));var _0x59810a={'speech':_0x55500e[_0x983d('0x5c')],'action':_0x55500e[_0x983d('0x5d')]?_0x55500e[_0x983d('0x5d')][_0x983d('0x5e')]:undefined,'actiondata':_0x55500e[_0x983d('0x5d')]?_0x55500e[_0x983d('0x5d')][_0x983d('0x5f')]:undefined};if(_0x55500e[_0x983d('0x5d')]&&_0x55500e['channelData'][_0x983d('0x60')]){return base64Decode(_0x55500e[_0x983d('0x5d')][_0x983d('0x60')][_0x983d('0x61')],path[_0x983d('0x25')](__dirname,_0x983d('0x26'),rs[_0x983d('0x27')](0x4)+'.wav'))[_0x983d('0x29')](function(_0x177149){_0x59810a[_0x983d('0x62')]=_0x177149;return _0x59810a;});}return _0x59810a;});};exports[_0x983d('0x63')]=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 1dff2a0..9b2f055 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 _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
+var _0xc4ab=['./nda'];(function(_0x3b8f2e,_0x5a99a8){var _0x1433d5=function(_0x5e0353){while(--_0x5e0353){_0x3b8f2e['push'](_0x3b8f2e['shift']());}};_0x1433d5(++_0x5a99a8);}(_0xc4ab,0xe8));var _0xbc4a=function(_0x17dd62,_0x40e5e4){_0x17dd62=_0x17dd62-0x0;var _0x42a9ea=_0xc4ab[_0x17dd62];return _0x42a9ea;};var nda=require(_0xbc4a('0x0'));module['exports']={'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 9599d9f..6c45459 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 _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
+var _0x6b9c=['agi','exports','/token','username','password','then','POST','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','extension','text','access_token','project','channelData','ndagenerate_audio','audio/wav','custom_action','body','CustomAction','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x6b9c,0x133));var _0xc6b9=function(_0x4c2636,_0x103c16){_0x4c2636=_0x4c2636-0x0;var _0x24bd0f=_0x6b9c[_0x4c2636];return _0x24bd0f;};'use strict';var rp=require(_0xc6b9('0x0'));var url=require(_0xc6b9('0x1'));var logger=require(_0xc6b9('0x2'))(_0xc6b9('0x3'));module[_0xc6b9('0x4')]=function(_0x55d850,_0x24b2fa){var _0x55e591={'method':'POST','uri':url['resolve'](_0x24b2fa['ndauth_url'],_0xc6b9('0x5')),'form':{'grant_type':'password','username':_0x24b2fa[_0xc6b9('0x6')],'password':_0x24b2fa[_0xc6b9('0x7')]},'json':!![]};return rp(_0x55e591)[_0xc6b9('0x8')](function(_0x276fd4){var _0x549e32={'method':_0xc6b9('0x9'),'uri':url[_0xc6b9('0xa')](_0x24b2fa[_0xc6b9('0xb')],_0xc6b9('0xc')),'body':{'type':_0x24b2fa[_0xc6b9('0xd')]||_0xc6b9('0xe'),'channelId':_0xc6b9('0xf'),'conversation':{'id':_0x55d850['uniqueid']},'from':{'id':_0x55d850[_0xc6b9('0x10')],'name':_0x55d850[_0xc6b9('0x11')]},'recipient':{'id':_0x55d850['dnid'],'name':_0x55d850[_0xc6b9('0x12')]},'text':_0x24b2fa[_0xc6b9('0x13')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x276fd4[_0xc6b9('0x14')]},'json':!![]};if(_0x24b2fa[_0xc6b9('0x15')]){_0x549e32['body'][_0xc6b9('0x16')]['ProjectName']=_0x24b2fa[_0xc6b9('0x15')];}if(_0x24b2fa[_0xc6b9('0x17')]=='1'){_0x549e32['body']['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xc6b9('0x18')};}if(_0x24b2fa[_0xc6b9('0x19')]){_0x549e32[_0xc6b9('0x1a')]['channelData'][_0xc6b9('0x1b')]=_0x24b2fa[_0xc6b9('0x19')];if(_0x24b2fa[_0xc6b9('0x1c')]){_0x549e32[_0xc6b9('0x1a')][_0xc6b9('0x16')][_0xc6b9('0x1d')]=_0x24b2fa[_0xc6b9('0x1c')];}}logger[_0xc6b9('0x1e')](JSON['stringify'](_0x549e32));return rp(_0x549e32);});};
\ 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 7ccfb81..07bc142 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 _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
+var _0xa1d7=['exports','./lib/api'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0xa1d7,0x1c9));var _0x7a1d=function(_0x297c55,_0x34fa75){_0x297c55=_0x297c55-0x0;var _0x120389=_0xa1d7[_0x297c55];return _0x120389;};'use strict';var asr=require(_0x7a1d('0x0'));module[_0x7a1d('0x1')]=function(_0x82a555,_0x2da41b,_0x415aef,_0x974d55){return asr(_0x82a555,_0x2da41b,_0x415aef,_0x974d55);};
\ 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 93750aa..fa194ad 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 _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
+var _0x5c99=['Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','stringify','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','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(_0x3878bd,_0x51e3e5){var _0x359e60=function(_0xe70276){while(--_0xe70276){_0x3878bd['push'](_0x3878bd['shift']());}};_0x359e60(++_0x51e3e5);}(_0x5c99,0xb1));var _0x95c9=function(_0x13dd37,_0x1a62d7){_0x13dd37=_0x13dd37-0x0;var _0x4018ef=_0x5c99[_0x13dd37];return _0x4018ef;};'use strict';var BPromise=require(_0x95c9('0x0'));var _=require(_0x95c9('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x95c9('0x2'));var crypto=require(_0x95c9('0x3'));var logger=require(_0x95c9('0x4'))(_0x95c9('0x5'));module[_0x95c9('0x6')]=function(_0x151526,_0x450f8d,_0x1f8022,_0x4417d7){return new BPromise(function(_0x285950,_0x5772ae){logger['info'](_0x95c9('0x7'),_0x4417d7||_0x95c9('0x8'));var _0x35c26a=new WebSocket(_0x4417d7||_0x95c9('0x8'),{'perMessageDeflate':![]});var _0x489f95='';var _0x3e18ad='0';var _0x5cb811='1';var _0x3c91dd='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x586475(_0x2ad34c){var _0x219fc0=crypto[_0x95c9('0x9')](_0x95c9('0xa'));_0x219fc0[_0x95c9('0xb')](_0x2ad34c);return _0x219fc0[_0x95c9('0xc')](_0x95c9('0xd'));}function _0x339009(){try{logger[_0x95c9('0xe')](_0x95c9('0xf'));var _0x18c29b=moment()[_0x95c9('0x10')]();var _0xb6822a=_0x586475(_0x18c29b+_0x450f8d+_0x1f8022);_0x35c26a['send'](JSON[_0x95c9('0x11')]({'appID':_0x450f8d,'timestamp':_0x18c29b,'appKey':_0xb6822a}));var _0x18a11d=fs['createReadStream'](_0x151526);_0x18a11d['on'](_0x95c9('0x12'),function(_0x46e956){_0x35c26a[_0x95c9('0x13')](_0x46e956);});_0x18a11d['on'](_0x95c9('0x14'),function(){_0x35c26a[_0x95c9('0x13')](_0x95c9('0x15'));});}catch(_0x3e4a0a){logger[_0x95c9('0x16')](_0x95c9('0x17'),JSON[_0x95c9('0x11')](_0x3e4a0a));_0x35c26a[_0x95c9('0x18')]();}}function _0x52f47f(_0x540b06){try{if(_0x540b06){var _0x11882a=JSON[_0x95c9('0x19')](_0x540b06);switch(_0x11882a[_0x95c9('0x1a')]){case 0x0:if(_0x11882a[_0x95c9('0x1b')]){if(_0x11882a['result']['final']){logger[_0x95c9('0xe')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x11882a[_0x95c9('0x1b')][_0x95c9('0x1c')]));_0x489f95=_0x11882a[_0x95c9('0x1b')][_0x95c9('0x1c')][0x0][_0x95c9('0x1d')];_0x3e18ad=_0x11882a[_0x95c9('0x1b')][_0x95c9('0x1c')][0x0][_0x95c9('0x1e')];_0x5cb811='0';_0x3c91dd=_0x95c9('0x1f');_0x35c26a[_0x95c9('0x18')]();}}break;case 0x1:logger[_0x95c9('0xe')](_0x95c9('0x20'));_0x5cb811='1';_0x3c91dd=_0x95c9('0x20');break;case 0x2:logger['info'](_0x95c9('0x21'));_0x5cb811='2';_0x3c91dd=_0x95c9('0x21');break;case 0x9:logger[_0x95c9('0xe')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x5cb811='9';_0x3c91dd='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x95c9('0xe')]('Authentication\x20failed.');_0x5cb811='10';_0x3c91dd=_0x95c9('0x22');break;case 0xb:logger['info'](_0x95c9('0x23'));_0x5cb811='11';_0x3c91dd=_0x95c9('0x23');}}}catch(_0x41f87c){logger[_0x95c9('0x16')](_0x95c9('0x24'),JSON[_0x95c9('0x11')](_0x41f87c));_0x35c26a[_0x95c9('0x18')]();}}function _0x412a08(){logger['info'](_0x95c9('0x25'));_0x285950({'transcript':_0x489f95,'confidence':_0x3e18ad,'status':_0x5cb811,'status_message':_0x3c91dd});}function _0x1a5db8(_0x151635){logger[_0x95c9('0x16')](_0x95c9('0x26'));if(!_[_0x95c9('0x27')](_0x151635)){logger['error'](_[_0x95c9('0x28')](_0x151635)?JSON[_0x95c9('0x11')](_0x151635):_0x151635);}}_0x35c26a['on'](_0x95c9('0x29'),_0x339009);_0x35c26a['on'](_0x95c9('0x2a'),_0x52f47f);_0x35c26a['on'](_0x95c9('0x14'),_0x412a08);_0x35c26a['on'](_0x95c9('0x16'),_0x1a5db8);});};
\ 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 2b03165..45093e2 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 _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
+var _0x1943=['./asr','exports'];(function(_0x1e4392,_0x5b2de3){var _0x3b4819=function(_0x4814d6){while(--_0x4814d6){_0x1e4392['push'](_0x1e4392['shift']());}};_0x3b4819(++_0x5b2de3);}(_0x1943,0x124));var _0x3194=function(_0x898275,_0x108173){_0x898275=_0x898275-0x0;var _0x2610ce=_0x1943[_0x898275];return _0x2610ce;};var asr=require(_0x3194('0x0'));module[_0x3194('0x1')]={'asr':asr};
\ No newline at end of file
diff --git a/server/services/agi/server.js b/server/services/agi/server.js
index 0b1358b..0abe7f3 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 _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
+var _0x32ff=['error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','connection','code','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','emit'];(function(_0x78bee0,_0x497ec6){var _0x3543de=function(_0x10a470){while(--_0x10a470){_0x78bee0['push'](_0x78bee0['shift']());}};_0x3543de(++_0x497ec6);}(_0x32ff,0xc7));var _0xf32f=function(_0x89cad4,_0x285549){_0x89cad4=_0x89cad4-0x0;var _0x5b0f84=_0x32ff[_0x89cad4];return _0x5b0f84;};'use strict';var util=require(_0xf32f('0x0'));var net=require(_0xf32f('0x1'));var EventEmitter=require(_0xf32f('0x2'))[_0xf32f('0x3')];var AGIError=require(_0xf32f('0x4'));var AGIChannel=require(_0xf32f('0x5'));var AGIServer=function(_0x2af467,_0x3ee77b,_0x1f96f0){var _0x397240=this,_0x2af467=_0x2af467||0x11dd,_0x3ee77b=_0x3ee77b||_0xf32f('0x6'),_0x2a209f=null,_0x5e5080=0x0;EventEmitter['call'](_0x397240);function _0x40f495(){if(!_0x2af467){_0x397240[_0xf32f('0x7')](_0xf32f('0x8'),new AGIError(_0xf32f('0x9')));return![];}_0x2a209f=net[_0xf32f('0xa')]();_0x2a209f[_0xf32f('0xb')](_0x2af467,_0x3ee77b);_0x2a209f['on'](_0xf32f('0xc'),function(){_0x397240[_0xf32f('0x7')]('listening');});_0x2a209f['on']('connection',function(_0x41e023){_0x2a209f['getConnections'](function(_0x5491ba,_0x1449a4){if(_0x5491ba){_0x397240[_0xf32f('0x7')](_0xf32f('0x8'),new AGIError(_0xf32f('0xd'),_0x5491ba));}else if(_0x1f96f0&&_0x1f96f0<0x0){_0x397240[_0xf32f('0x7')](_0xf32f('0x8'),new AGIError(_0xf32f('0xe')));_0x41e023[_0xf32f('0xf')]();}else if(_0x1f96f0&&_0x1f96f0>0x0&&_0x1f96f0<_0x1449a4){_0x5e5080+=0x1;_0x397240[_0xf32f('0x7')]('error',new AGIError(_0xf32f('0x10'),_0x5e5080));_0x41e023[_0xf32f('0xf')]();}else{var _0x174efc=new AGIChannel(_0x41e023);_0x174efc['on']('ready',function(){_0x397240[_0xf32f('0x7')](_0xf32f('0x11'),_0x174efc);});}});});_0x2a209f['on'](_0xf32f('0x8'),function(_0x160ba1){_0x397240[_0xf32f('0x7')](_0xf32f('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x160ba1[_0xf32f('0x12')]));});_0x2a209f['on']('close',function(){_0x397240[_0xf32f('0x7')]('close',new AGIError(_0xf32f('0x13')));});}process[_0xf32f('0x14')](function(){_0x40f495();});};util[_0xf32f('0x15')](AGIServer,EventEmitter);module[_0xf32f('0x16')]=function(_0x494442,_0x45be10,_0x181d12){return new AGIServer(_0x494442,_0x45be10,_0x181d12);};
\ No newline at end of file
diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js
index 8421e0f..eeb36fb 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 _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
+var _0xa1e8=['map','Intervals','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','dnid','log','in\x20createcmcontact\x20callback','isEmpty','isNil','callback_','random','lastName','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','has','dialTimezone','VALUE\x20TZ','CALLERID(dialTimezone)','phone','RES1','dialtimezone','timezones','utcOffset','scheduledat\x20before','add','minutes','insertContact','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','googleTTS','url','method','timeout','number','includes','POST','toUpperCase','body','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','stringify','render','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','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_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','format','%s.%s','replaceall\x20init','split','nextbracket','replaceAll','getVariable','extra','replaceall\x20end','info','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','result','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','enter\x20in\x20callbackblock','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','before\x20createcmcontact','createCmContact','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','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','grammar','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','setVariable','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','createSquareMessage','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','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','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','first','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','bot','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','beep','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','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','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','output','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','QUEUE','gosub','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','sayDigits','digits','escape_digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','\x22%s\x22\x20<%s>','Smtp','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','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','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','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','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','Enter\x20in\x20SYSTEM\x20(%s)\x20block','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','VOICEMAIL','mailbox','vswitch','join','exports','path','lodash','shelljs','odbc','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','rpc','mailRpc','getVariableById','then','name','prototype','getVoiceQueue','getVoiceQueueById','catch','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval'];(function(_0x3f9aeb,_0x231e27){var _0x1772b4=function(_0x54bd7e){while(--_0x54bd7e){_0x3f9aeb['push'](_0x3f9aeb['shift']());}};_0x1772b4(++_0x231e27);}(_0xa1e8,0x1af));var _0x8a1e=function(_0x327e41,_0x25dfe4){_0x327e41=_0x327e41-0x0;var _0x12e822=_0xa1e8[_0x327e41];return _0x12e822;};'use strict';var fs=require('fs');var path=require(_0x8a1e('0x0'));var util=require('util');var _=require(_0x8a1e('0x1'));var sh=require(_0x8a1e('0x2'));var odbc=require(_0x8a1e('0x3'))();var rs=require('randomstring');var moment=require(_0x8a1e('0x4'));var Mustache=require('mustache');var rp=require(_0x8a1e('0x5'));var logger=require(_0x8a1e('0x6'))(_0x8a1e('0x7'));var config=require(_0x8a1e('0x8'));var shared=require('../../config/environment/shared');var scripts=require(_0x8a1e('0x9'));var FILES_PATH=_0x8a1e('0xa');var recursiveMapAttributes=[_0x8a1e('0xb'),_0x8a1e('0xc')];var verticesWithRetry=['menu',_0x8a1e('0xd'),_0x8a1e('0xe')];var AGIVertices=function(_0x22d916,_0x537de3,_0x31afa4){this['channel']=_0x22d916;this[_0x8a1e('0xf')]=_0x537de3;this[_0x8a1e('0x10')]=_0x31afa4;};AGIVertices['prototype']['getVariable']=function(_0x2a700b,_0x46cddc){this[_0x8a1e('0xf')][_0x8a1e('0x11')](_0x2a700b)[_0x8a1e('0x12')](function(_0x8aebf4){_0x46cddc(null,_0x8aebf4?_0x8aebf4[_0x8a1e('0x13')]:![]);})['catch'](function(_0x25d23d){_0x46cddc(_0x25d23d);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x15')]=function(_0x50f242,_0x39eeec){this[_0x8a1e('0xf')][_0x8a1e('0x16')](_0x50f242)['then'](function(_0x3b3c83){_0x39eeec(null,_0x3b3c83?_0x3b3c83[_0x8a1e('0x13')]:![]);})[_0x8a1e('0x17')](function(_0x4a31d0){_0x39eeec(_0x4a31d0);});};AGIVertices['prototype']['getSquareProject']=function(_0x3d7dc0,_0x2fcc32){this['rpc'][_0x8a1e('0x18')](_0x3d7dc0)[_0x8a1e('0x12')](function(_0x7af78d){_0x2fcc32(null,_0x7af78d?_0x7af78d[_0x8a1e('0x13')]:![]);})[_0x8a1e('0x17')](function(_0x13670e){_0x2fcc32(_0x13670e);});};AGIVertices['prototype'][_0x8a1e('0x19')]=function(_0xa87f47,_0x574c88){this[_0x8a1e('0xf')][_0x8a1e('0x1a')](_0xa87f47)[_0x8a1e('0x12')](function(_0x27c3cd){_0x574c88(null,_0x27c3cd?_0x27c3cd['dsn']:![]);})['catch'](function(_0x1a241c){_0x574c88(_0x1a241c);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x1b')]=function(_0x1f5c7b,_0x6adaed){this[_0x8a1e('0xf')][_0x8a1e('0x1c')](_0x1f5c7b)[_0x8a1e('0x12')](function(_0x399361){_0x6adaed(null,_0x399361?_0x399361[_0x8a1e('0x13')]:![]);})[_0x8a1e('0x17')](function(_0x48b39a){_0x6adaed(_0x48b39a);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x1d')]=function(_0x2c7584,_0x59de36){this[_0x8a1e('0xf')][_0x8a1e('0x1e')](_0x2c7584)[_0x8a1e('0x12')](function(_0x79849d){_0x59de36(null,_0x79849d?_0x79849d['name']:![]);})[_0x8a1e('0x17')](function(_0x1d8929){_0x59de36(_0x1d8929);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x1f')]=function(_0x4107f5,_0x3c2636){var _0x4c7f91=this;this[_0x8a1e('0xf')][_0x8a1e('0x20')](_0x4107f5)[_0x8a1e('0x12')](function(_0x2ec304){_0x3c2636(null,_0x2ec304?_0x4c7f91[_0x8a1e('0x21')](_0x2ec304['save_name']):![]);})['catch'](function(_0x2d1c86){_0x3c2636(_0x2d1c86);});};AGIVertices[_0x8a1e('0x14')]['getMailAccount']=function(_0xf39c6d,_0x1e8b4c){this[_0x8a1e('0xf')][_0x8a1e('0x22')](_0xf39c6d)[_0x8a1e('0x12')](function(_0xc2048b){_0x1e8b4c(null,_0xc2048b?_0xc2048b:![]);})[_0x8a1e('0x17')](function(_0x5d08e0){_0x1e8b4c(_0x5d08e0);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x23')]=function(_0x4ae021,_0x5c9b14,_0x4fcd0e){this['mailRpc'][_0x8a1e('0x23')](_0x4ae021,_0x5c9b14)[_0x8a1e('0x12')](function(){_0x4fcd0e(null);})[_0x8a1e('0x17')](function(_0x4ee496){_0x4fcd0e(_0x4ee496);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x24')]=function(_0x1859b1,_0x5e4dcc){this['rpc']['getIntervalById'](_0x1859b1)[_0x8a1e('0x12')](function(_0x5f4d59){if(_0x5f4d59){if(_0x5f4d59[_0x8a1e('0x25')]){_0x5e4dcc(null,[_0x5f4d59[_0x8a1e('0x26')]]);}else{_0x5e4dcc(null,_[_0x8a1e('0x27')](_0x5f4d59[_0x8a1e('0x28')],_0x8a1e('0x26')));}}else{_0x5e4dcc(null,![]);}})[_0x8a1e('0x17')](function(_0x2d6788){_0x5e4dcc(_0x2d6788);});};AGIVertices['prototype'][_0x8a1e('0x21')]=function(_0x8bb1d6){return util['format'](_0x8a1e('0x29'),FILES_PATH,_0x8bb1d6);};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x2a')]=function(_0x2fd3a1,_0x12d915,_0x238e26){odbc['open'](_0x2fd3a1,function(_0x4f5a3f){if(_0x4f5a3f){logger[_0x8a1e('0x2b')](_0x8a1e('0x2c'),_0x4f5a3f);_0x238e26(_0x4f5a3f);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0x8a1e('0x2d')](_0x12d915,function(_0x412eb9,_0x58edb7){if(_0x412eb9){logger['info']('Error\x20executing\x20query\x20%s',_0x12d915);_0x238e26(_0x412eb9);}else{logger['info'](_0x8a1e('0x2e'),_0x12d915);odbc[_0x8a1e('0x2f')](function(_0x2f885c){if(_0x2f885c){logger[_0x8a1e('0x2b')](_0x8a1e('0x30'),_0x2f885c);}_0x238e26(null,_0x58edb7);});}});}});};AGIVertices['prototype'][_0x8a1e('0x31')]=function(_0x420162,_0x3ae5ba){this[_0x8a1e('0xf')][_0x8a1e('0x32')](_0x420162)[_0x8a1e('0x12')](function(_0x41a261){_0x3ae5ba(null,_0x41a261?_0x41a261:![]);})[_0x8a1e('0x17')](function(_0x1961f6){_0x3ae5ba(_0x1961f6);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x33')]=function(_0x348efb,_0x40a71f){this[_0x8a1e('0xf')]['createSmsMessage'](_0x348efb)[_0x8a1e('0x12')](function(_0x369595){_0x40a71f(null,_0x369595);})['catch'](function(_0x6bea04){_0x40a71f(_0x6bea04);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x34')]=function(_0x110de2,_0x58dcdf,_0xac2158){this[_0x8a1e('0xf')]['createSquareDetailsReport']({'uniqueid':this[_0x8a1e('0x35')][_0x8a1e('0x36')],'node':_0x110de2['label'],'application':_0x110de2[_0x8a1e('0x37')],'data':_0x58dcdf||null,'project_name':this[_0x8a1e('0x35')][_0x8a1e('0x38')],'callerid':this[_0x8a1e('0x35')][_0x8a1e('0x39')]})[_0x8a1e('0x12')](function(_0x11ed8d){if(_0xac2158){_0xac2158(null,_0x11ed8d);}})[_0x8a1e('0x17')](function(_0x11f7a6){if(_0xac2158){_0xac2158(_0x11f7a6);}});};AGIVertices[_0x8a1e('0x14')]['createSquareRecording']=function(_0x462798,_0x4b540d,_0x530276,_0x43fe87){this[_0x8a1e('0xf')][_0x8a1e('0x3a')]({'uniqueid':this[_0x8a1e('0x35')]['uniqueid'],'callerid':this['channel']['callerid'],'calleridname':this[_0x8a1e('0x35')][_0x8a1e('0x3b')],'context':this[_0x8a1e('0x35')][_0x8a1e('0x3c')],'extension':this[_0x8a1e('0x35')][_0x8a1e('0x3d')],'priority':this['channel'][_0x8a1e('0x3e')],'accountcode':this[_0x8a1e('0x35')]['accountcode'],'dnid':this[_0x8a1e('0x35')][_0x8a1e('0x3f')],'projectName':this['channel']['arg_1'],'saveName':_0x4b540d,'filename':_0x462798['file']||_0x4b540d,'savePath':_0x530276})[_0x8a1e('0x12')](function(_0x4a060d){_0x43fe87(null,_0x4a060d);})[_0x8a1e('0x17')](function(_0x2dc4b3){_0x43fe87(_0x2dc4b3);});};AGIVertices['prototype']['createSquareMessage']=function(_0x443c9a,_0x107d69,_0x4243b6){this[_0x8a1e('0xf')]['createSquareMessage']({'uniqueid':this[_0x8a1e('0x35')][_0x8a1e('0x36')],'body':_0x443c9a,'direction':_0x107d69})[_0x8a1e('0x12')](function(_0x2343de){if(_0x4243b6){_0x4243b6(null,_0x2343de);}})[_0x8a1e('0x17')](function(_0x2f149e){if(_0x4243b6){_0x4243b6(_0x2f149e);}});};AGIVertices[_0x8a1e('0x14')]['createCmContact']=function(_0x9487b1,_0x328c8c){console[_0x8a1e('0x40')]('in\x20createcmcontact',_0x9487b1);console['log'](_0x8a1e('0x41'),_0x328c8c);var _0x4c0fa2=0x0;var _0x3e5acf={'firstName':_[_0x8a1e('0x42')](_0x9487b1[_0x8a1e('0x13')])||_[_0x8a1e('0x43')](_0x9487b1[_0x8a1e('0x13')])?_0x8a1e('0x44')+Math[_0x8a1e('0x45')]():_0x9487b1[_0x8a1e('0x13')],'lastName':_[_0x8a1e('0x42')](_0x9487b1[_0x8a1e('0x46')])||_[_0x8a1e('0x43')](_0x9487b1['lastName'])?null:_0x9487b1[_0x8a1e('0x46')],'phone':_0x9487b1['phone'],'ListId':_0x9487b1[_0x8a1e('0x47')],'scheduledat':_0x9487b1['scheduledAt'],'callbackUniqueid':this[_0x8a1e('0x35')][_0x8a1e('0x36')],'tags':_0x8a1e('0x48'),'description':_0x8a1e('0x49')+_0x9487b1[_0x8a1e('0x4a')][_0x8a1e('0x4b')](),'priority':_0x9487b1[_0x8a1e('0x4c')]};if(_[_0x8a1e('0x4d')](_0x9487b1,_0x8a1e('0x4e'))){if(!_[_0x8a1e('0x43')](_0x9487b1[_0x8a1e('0x4e')])){var _0x11780c=_0x9487b1[_0x8a1e('0x4e')];console[_0x8a1e('0x40')](_0x8a1e('0x4f'),_0x11780c);if(_0x9487b1[_0x8a1e('0x4e')]==_0x8a1e('0x50')){this[_0x8a1e('0xf')]['getContactByPhone']({'phone':_0x9487b1[_0x8a1e('0x51')]})['then'](function(_0x4dd7e2){console[_0x8a1e('0x40')](_0x8a1e('0x52'),_0x4dd7e2);var _0x5d51b0=_0x4dd7e2[_0x8a1e('0x4e')];console['log'](_0x8a1e('0x53'),_0x5d51b0);if(!_['isNil'](_0x5d51b0)){var _0x57b0f6=shared[_0x8a1e('0x54')][_0x5d51b0];console[_0x8a1e('0x40')]('tz',_0x57b0f6);if(!_['isNil'](_0x57b0f6)){var _0x2a4344=-0x1*_0x57b0f6[_0x8a1e('0x55')];console[_0x8a1e('0x40')]('minutestoadd',_0x2a4344);console[_0x8a1e('0x40')](_0x8a1e('0x56'),_0x3e5acf[_0x8a1e('0x4a')]);_0x3e5acf['scheduledAt']=moment(_0x9487b1['scheduledAt'])[_0x8a1e('0x57')](_0x2a4344,_0x8a1e('0x58'));console[_0x8a1e('0x40')]('scheduledat\x20after',_0x3e5acf[_0x8a1e('0x4a')]);this[_0x8a1e('0xf')]['insertContact'](_0x3e5acf,_0x9487b1,_0x328c8c)[_0x8a1e('0x12')](function(_0x1079c2){_0x328c8c(null,_0x1079c2);})['catch'](function(_0x3f875e){_0x328c8c(_0x3f875e);});}else{this[_0x8a1e('0xf')][_0x8a1e('0x59')](_0x3e5acf,_0x9487b1,_0x328c8c)['then'](function(_0x3e34fb){_0x328c8c(null,_0x3e34fb);})[_0x8a1e('0x17')](function(_0x980d6e){_0x328c8c(_0x980d6e);});}}else{this[_0x8a1e('0xf')][_0x8a1e('0x59')](_0x3e5acf,_0x9487b1,_0x328c8c)[_0x8a1e('0x12')](function(_0x5defc2){_0x328c8c(null,_0x5defc2);})['catch'](function(_0x1d96ad){_0x328c8c(_0x1d96ad);});}});}else{var _0x4c0fa2=shared[_0x8a1e('0x54')][_0x11780c];if(!_[_0x8a1e('0x43')](_0x4c0fa2)){var _0x44f6b1=-0x1*_0x4c0fa2[_0x8a1e('0x55')];_0x3e5acf[_0x8a1e('0x4a')]=moment(_0x9487b1[_0x8a1e('0x4a')])[_0x8a1e('0x57')](_0x44f6b1,'minutes');this[_0x8a1e('0xf')][_0x8a1e('0x59')](_0x3e5acf,_0x9487b1,_0x328c8c)[_0x8a1e('0x12')](function(_0x1d1bee){_0x328c8c(null,_0x1d1bee);})[_0x8a1e('0x17')](function(_0x24ea06){_0x328c8c(_0x24ea06);});}else{this[_0x8a1e('0xf')][_0x8a1e('0x59')](_0x3e5acf,_0x9487b1,_0x328c8c)[_0x8a1e('0x12')](function(_0x36b948){_0x328c8c(null,_0x36b948);})[_0x8a1e('0x17')](function(_0x4cb3ea){_0x328c8c(_0x4cb3ea);});}}}else{this[_0x8a1e('0xf')][_0x8a1e('0x59')](_0x3e5acf,_0x9487b1,_0x328c8c)[_0x8a1e('0x12')](function(_0x48fbe3){_0x328c8c(null,_0x48fbe3);})[_0x8a1e('0x17')](function(_0x3ce23c){_0x328c8c(_0x3ce23c);});}}else{this[_0x8a1e('0xf')][_0x8a1e('0x59')](_0x3e5acf,_0x9487b1,_0x328c8c)[_0x8a1e('0x12')](function(_0x320c38){_0x328c8c(null,_0x320c38);})['catch'](function(_0x5dd94d){_0x328c8c(_0x5dd94d);});}};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x59')]=function(_0x102200,_0x2ffb83,_0x420d1e){this[_0x8a1e('0xf')]['createCmContact'](_0x102200)[_0x8a1e('0x12')](function(_0x1891dc){_0x420d1e(null,_0x1891dc);})[_0x8a1e('0x17')](function(_0x446b71){_0x420d1e(_0x446b71);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x5a')]=function(_0x4bf6e1,_0x45c686){this['rpc'][_0x8a1e('0x5b')](_0x4bf6e1)[_0x8a1e('0x12')](function(_0x4b13e8){_0x45c686(null,_0x4b13e8?_0x4b13e8['name']:![]);})[_0x8a1e('0x17')](function(_0x147ec5){_0x45c686(_0x147ec5);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x5c')]=function(_0x509230,_0x3cc727,_0x277604){var _0x38b9f5={'role':_0x8a1e('0x5d')};_0x38b9f5[_0x509230]=this[_0x8a1e('0x35')][_0x8a1e('0x39')];this[_0x8a1e('0xf')][_0x8a1e('0x5c')](_0x38b9f5,_0x3cc727,this['channel'][_0x8a1e('0x36')])[_0x8a1e('0x12')](function(_0x382966){_0x277604(null,_[_0x8a1e('0x43')](_0x382966)?![]:!![]);})['catch'](function(_0x55e3f0){logger[_0x8a1e('0x2b')](_0x55e3f0);_0x277604(null,![]);});};AGIVertices['prototype'][_0x8a1e('0x5e')]=function(_0x4b7ee5,_0x903f1d){var _0x54d7b1={'role':'agent'};_0x54d7b1[_0x4b7ee5]=this[_0x8a1e('0x35')][_0x8a1e('0x39')];this[_0x8a1e('0xf')][_0x8a1e('0x5e')](_0x54d7b1)[_0x8a1e('0x12')](function(_0x2ccf1d){_0x903f1d(null,_[_0x8a1e('0x43')](_0x2ccf1d)?![]:!![]);})[_0x8a1e('0x17')](function(_0x1e0ae2){logger[_0x8a1e('0x2b')](_0x1e0ae2);_0x903f1d(null,![]);});};AGIVertices[_0x8a1e('0x14')]['agentLogout']=function(_0x3ba6a7,_0x14cb79){var _0x4fe4ee={'role':_0x8a1e('0x5d')};_0x4fe4ee[_0x3ba6a7]=this[_0x8a1e('0x35')][_0x8a1e('0x39')];this['rpc'][_0x8a1e('0x5f')](_0x4fe4ee)[_0x8a1e('0x12')](function(_0x2578f4){_0x14cb79(null,_[_0x8a1e('0x43')](_0x2578f4)?![]:!![]);})['catch'](function(_0x131948){logger[_0x8a1e('0x2b')](_0x131948);_0x14cb79(null,![]);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x60')]=function(_0x5bfefe,_0x588e1b){var _0x42c57e={'role':_0x8a1e('0x5d')};_0x42c57e[_0x5bfefe]=this[_0x8a1e('0x35')][_0x8a1e('0x39')];var _0x4d6840=_0x5bfefe!=_0x8a1e('0x61')?util['format'](_0x8a1e('0x62'),_0x8a1e('0x63'),this[_0x8a1e('0x35')][_0x8a1e('0x39')]):undefined;this[_0x8a1e('0xf')][_0x8a1e('0x60')](_0x42c57e,_0x4d6840)[_0x8a1e('0x12')](function(_0x1e95e6){_0x588e1b(null,_[_0x8a1e('0x43')](_0x1e95e6)?![]:!![]);})[_0x8a1e('0x17')](function(_0xcbc51){logger[_0x8a1e('0x2b')](_0xcbc51);_0x588e1b(null,![]);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x64')]=function(_0x520d39,_0x47391d){sh['exec'](_[_0x8a1e('0x65')](_0x520d39),function(_0x362339,_0xf08db2){var _0xea0160=_0xf08db2[_0x8a1e('0x66')](/(\r\n|\n|\r)/gm,'');_0x47391d(null,_0xea0160);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x67')]=function(_0x2b9ec3,_0x437731){scripts['googleCloudTTS'](_0x2b9ec3[_0x8a1e('0x68')],_0x2b9ec3[_0x8a1e('0x69')]||'text',_0x2b9ec3[_0x8a1e('0x6a')],_0x2b9ec3[_0x8a1e('0x6b')]||_0x8a1e('0x6c'),_0x2b9ec3[_0x8a1e('0x6d')]||'MALE',_0x2b9ec3[_0x8a1e('0x6e')]||'MP3')[_0x8a1e('0x12')](function(_0x3a3c06){_0x437731(null,_0x3a3c06);})[_0x8a1e('0x17')](function(_0x198fa2){_0x437731(_0x198fa2);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x6f')]=function(_0x5d911f,_0x469f99){scripts[_0x8a1e('0x6f')](_0x5d911f[_0x8a1e('0x6a')],_0x5d911f['google_tts_language']||'en',0x1)[_0x8a1e('0x12')](function(_0x3bbcbc){_0x469f99(null,_0x3bbcbc);})[_0x8a1e('0x17')](function(_0x46a3db){_0x469f99(_0x46a3db);});};AGIVertices[_0x8a1e('0x14')]['restAPI']=function(_0x2a5603,_0x59ca37){var _0x42e0b4={'uri':_0x2a5603[_0x8a1e('0x70')],'method':_0x2a5603[_0x8a1e('0x71')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2a5603[_0x8a1e('0x72')])===_0x8a1e('0x73')&&parseInt(_0x2a5603[_0x8a1e('0x72')])>=0x1?parseInt(_0x2a5603[_0x8a1e('0x72')])*0x3e8:0x5*0x3e8};if(_[_0x8a1e('0x74')]([_0x8a1e('0x75'),'PUT'],_0x42e0b4[_0x8a1e('0x71')][_0x8a1e('0x76')]())){try{_0x42e0b4[_0x8a1e('0x77')]=_0x2a5603[_0x8a1e('0xc')]?JSON[_0x8a1e('0x78')](_0x2a5603[_0x8a1e('0xc')]):{};}catch(_0x5d85b6){logger[_0x8a1e('0x2b')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5d85b6);}}try{_0x42e0b4[_0x8a1e('0x79')]=_0x2a5603['rawHeaders']?JSON[_0x8a1e('0x78')](_0x2a5603[_0x8a1e('0xb')]):{};}catch(_0x2856e0){logger[_0x8a1e('0x2b')](_0x8a1e('0x7a'),_0x2856e0);}if(_0x2a5603[_0x8a1e('0x7b')]){try{var _0x385022=require(_0x2a5603[_0x8a1e('0x7b')])['sync'](this,_0x42e0b4);_0x42e0b4[_0x8a1e('0x7c')]=Mustache['render'](_0x2a5603[_0x8a1e('0x70')],_0x385022,{},['$$','$$']);if(_0x42e0b4[_0x8a1e('0x79')]){_0x42e0b4[_0x8a1e('0x79')]=JSON[_0x8a1e('0x78')](Mustache['render'](JSON[_0x8a1e('0x7d')](_0x42e0b4[_0x8a1e('0x79')]),_0x385022,{},['$$','$$']));}if(_0x42e0b4[_0x8a1e('0x77')]){_0x42e0b4[_0x8a1e('0x77')]=JSON[_0x8a1e('0x78')](Mustache[_0x8a1e('0x7e')](JSON[_0x8a1e('0x7d')](_0x42e0b4['body']),_0x385022,{},['$$','$$']));}}catch(_0x52ea91){logger[_0x8a1e('0x2b')](_0x8a1e('0x7f'),_0x52ea91);}}rp(_0x42e0b4)['then'](function(_0x22c6b3){var _0x3e77e5={'statusCode':_0x22c6b3[_0x8a1e('0x80')]||0xc8,'statusMessage':_0x22c6b3['statusMessage']||'OK','headers':_0x22c6b3[_0x8a1e('0x79')]||{},'body':_0x22c6b3[_0x8a1e('0x77')]||{}};_0x59ca37(null,_0x3e77e5);})[_0x8a1e('0x17')](function(_0x61adb2){var _0x4522b3={'statusCode':_0x61adb2[_0x8a1e('0x80')]||0x1f4,'statusMessage':_0x61adb2[_0x8a1e('0x81')]||_0x8a1e('0x82'),'headers':_0x61adb2[_0x8a1e('0x83')][_0x8a1e('0x79')]||{},'body':_0x61adb2['options'][_0x8a1e('0x77')]||{}};_0x59ca37(null,_0x4522b3);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x84')]=function(_0x2d0132,_0x1bfa45){scripts[_0x8a1e('0x84')](this[_0x8a1e('0x35')]['uniqueid'],_0x2d0132[_0x8a1e('0x85')],_0x2d0132[_0x8a1e('0x6a')],_0x2d0132[_0x8a1e('0x86')]||'en')['then'](function(_0x2e5634){_0x1bfa45(null,_0x2e5634);})[_0x8a1e('0x17')](function(_0x17c5ac){_0x1bfa45(_0x17c5ac);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x87')]=function(_0x534ba7,_0x2c641d){scripts[_0x8a1e('0x87')](this['channel'],_0x534ba7)[_0x8a1e('0x12')](function(_0x3dc47e){_0x2c641d(null,_0x3dc47e);})[_0x8a1e('0x17')](function(_0x26a0fd){_0x2c641d(_0x26a0fd);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x88')]=function(_0xbe59ff,_0x226d21){scripts['ispeechTTS'](_0xbe59ff[_0x8a1e('0x85')],_0xbe59ff[_0x8a1e('0x6a')],_0xbe59ff[_0x8a1e('0x89')]||_0x8a1e('0x6c'),_0xbe59ff[_0x8a1e('0x8a')])[_0x8a1e('0x12')](function(_0x4fe85c){_0x226d21(null,_0x4fe85c);})['catch'](function(_0x176ee9){_0x226d21(_0x176ee9);});};AGIVertices['prototype'][_0x8a1e('0x8b')]=function(_0xf53b26,_0x505e9d,_0x2b85c7){scripts[_0x8a1e('0x8b')](_0x505e9d,_0xf53b26['key'],_0xf53b26[_0x8a1e('0x8c')]||'en-US',this[_0x8a1e('0x8d')](_0xf53b26[_0x8a1e('0x8e')])?_0xf53b26[_0x8a1e('0x8e')]:undefined)[_0x8a1e('0x12')](function(_0x194e37){_0x2b85c7(null,_0x194e37);})[_0x8a1e('0x17')](function(_0x48d3c1){_0x2b85c7(_0x48d3c1);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x8f')]=function(_0x3a9856,_0x21d1a1){scripts[_0x8a1e('0x8f')](_0x3a9856['aws_access_key_id'],_0x3a9856[_0x8a1e('0x90')],_0x3a9856[_0x8a1e('0x91')],_0x3a9856['aws_polly_voice']||_0x8a1e('0x92'),_0x3a9856['text'],_0x3a9856[_0x8a1e('0x93')]||_0x8a1e('0x6a'))['then'](function(_0x4e51f9){_0x21d1a1(null,_0x4e51f9);})['catch'](function(_0x473292){_0x21d1a1(_0x473292);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x94')]=function(_0x48ca92,_0x8693b0){scripts[_0x8a1e('0x94')](this['channel'][_0x8a1e('0x36')],_0x48ca92[_0x8a1e('0x95')],_0x48ca92[_0x8a1e('0x90')],_0x48ca92[_0x8a1e('0x96')],_0x48ca92[_0x8a1e('0x6a')],_0x48ca92['aws_bot_name'])[_0x8a1e('0x12')](function(_0x14777f){_0x8693b0(null,_0x14777f);})['catch'](function(_0x2e2f4a){_0x8693b0(_0x2e2f4a);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x97')]=function(_0x1bd51a,_0x28fc4a,_0x358478){scripts[_0x8a1e('0x97')](_0x28fc4a,_0x1bd51a[_0x8a1e('0x85')],_0x1bd51a[_0x8a1e('0x98')]||_0x8a1e('0x6c'))['then'](function(_0x29b923){_0x358478(null,_0x29b923);})[_0x8a1e('0x17')](function(_0x540306){_0x358478(_0x540306);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x99')]=function(_0x28677e,_0x556ca2,_0x4bb5f9){scripts[_0x8a1e('0x99')](_0x556ca2,_0x28677e[_0x8a1e('0x9a')],_0x28677e[_0x8a1e('0x9b')],_0x28677e['uri'])[_0x8a1e('0x12')](function(_0x3215f3){_0x4bb5f9(null,_0x3215f3);})[_0x8a1e('0x17')](function(_0x5ed1d6){_0x4bb5f9(_0x5ed1d6);});};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x9c')]=function(_0xdb34f0){var _0x4232d1=_['includes'](verticesWithRetry,_0xdb34f0[_0x8a1e('0x37')])?_0xdb34f0:_[_0x8a1e('0x9d')](_0xdb34f0);for(var _0x45d159 in _0x4232d1){if(_0x4232d1[_0x8a1e('0x9e')](_0x45d159)){if(_0x4232d1[_0x45d159]&&_[_0x8a1e('0x9f')](_0x4232d1[_0x45d159])){if(_[_0x8a1e('0x74')](recursiveMapAttributes,_0x45d159)){_0x4232d1[_0x45d159]=this[_0x8a1e('0xa0')](_0x4232d1[_0x45d159]);}else{_0x4232d1[_0x45d159]=this[_0x8a1e('0xa1')](_0x4232d1[_0x45d159]);}}}}return _0x4232d1;};AGIVertices['prototype'][_0x8a1e('0xa2')]=function(_0x137f65){for(var _0x28ff66 in _0x137f65){if(_0x137f65[_0x8a1e('0x9e')](_0x28ff66)){if(_[_0x8a1e('0xa3')](_0x137f65[_0x28ff66])){this[_0x8a1e('0xa2')](_0x137f65[_0x28ff66]);}else if(_[_0x8a1e('0xa4')](_0x137f65[_0x28ff66])){for(var _0x48a246=0x0;_0x48a246<_0x137f65[_0x28ff66][_0x8a1e('0xa5')];_0x48a246++){this[_0x8a1e('0xa2')](_0x137f65[_0x28ff66][_0x48a246]);}}else if(_[_0x8a1e('0x9f')](_0x137f65[_0x28ff66])){_0x137f65[_0x28ff66]=this[_0x8a1e('0xa1')](_0x137f65[_0x28ff66]);}}}};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0xa6')]=function(_0x2bf15c,_0x4059dc){for(var _0x592014 in _0x2bf15c){if(_0x2bf15c['hasOwnProperty'](_0x592014)){if(_['isPlainObject'](_0x2bf15c[_0x592014])){if(!_[_0x8a1e('0x42')](_0x2bf15c[_0x592014])){this[_0x8a1e('0xa6')](_0x2bf15c[_0x592014],util[_0x8a1e('0xa7')](_0x8a1e('0xa8'),_0x4059dc,_0x592014));}}else if(_[_0x8a1e('0xa4')](_0x2bf15c[_0x592014])){for(var _0x168041=0x0;_0x168041<_0x2bf15c[_0x592014][_0x8a1e('0xa5')];_0x168041++){this['saveRestApiResult'](_0x2bf15c[_0x592014][_0x168041],util[_0x8a1e('0xa7')]('%s.%s',_0x4059dc,_0x592014+'['+_0x168041+']'));}}else{if(!_[_0x8a1e('0x43')](_0x2bf15c[_0x592014])){this[_0x8a1e('0x35')]['setVariable'](util[_0x8a1e('0xa7')]('%s.%s',_0x4059dc,_0x592014),_0x2bf15c[_0x592014]);}}}}};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0xa0')]=function(_0x598adf){try{var _0x338a57=JSON[_0x8a1e('0x78')](_0x598adf);this['recursiveNodeIndex'](_0x338a57);return JSON[_0x8a1e('0x7d')](_0x338a57);}catch(_0x51adad){return this[_0x8a1e('0xa1')](_0x598adf);}};AGIVertices[_0x8a1e('0x14')]['replaceAllVariables']=function(_0x4bef08){console[_0x8a1e('0x40')](_0x8a1e('0xa9'),_0x4bef08);var _0x2bd5f9=_0x4bef08['split']('{');for(var _0x5b52f5=0x1;_0x5b52f5<_0x2bd5f9[_0x8a1e('0xa5')];_0x5b52f5+=0x1){var _0x30dda2=_0x2bd5f9[_0x5b52f5][_0x8a1e('0xaa')]('}');console[_0x8a1e('0x40')](_0x8a1e('0xab'),_0x30dda2);if(_0x30dda2[_0x8a1e('0xa5')]>0x1){_0x4bef08=_0x4bef08[_0x8a1e('0xac')]('{'+_0x30dda2[0x0]+'}',this[_0x8a1e('0x35')][_0x8a1e('0xad')](_0x30dda2[0x0])[_0x8a1e('0xae')]||_0x30dda2[0x0]);}}if(_0x2bd5f9[_0x8a1e('0xa5')]===0x1){return _0x4bef08[_0x8a1e('0x4b')]();}console[_0x8a1e('0x40')](_0x8a1e('0xaf'),_0x4bef08);return this['replaceAllVariables'](_0x4bef08);};AGIVertices[_0x8a1e('0x14')]['getAndSetVariable']=function(_0x32f3ec,_0x5f1929){var _0x8ec72c=this['channel'][_0x8a1e('0xad')](_0x32f3ec);if(_0x8ec72c['result']===-0x1){return _0x8ec72c;}logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0xb1'),_0x5f1929,_0x8ec72c[_0x8a1e('0xae')]));return this[_0x8a1e('0x35')]['setVariable'](_0x5f1929,_0x8ec72c[_0x8a1e('0xae')]);};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x8d')]=function(_0x363067){return _0x363067&&_0x363067!=='0'&&_0x363067!=='-1'&&_0x363067!=='';};AGIVertices['prototype'][_0x8a1e('0xb2')]=function(_0x4af948){this[_0x8a1e('0x34')][_0x8a1e('0xb3')](this,_0x4af948,'-');_0x4af948[_0x8a1e('0xb4')]=_0x4af948[_0x8a1e('0xb2')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x2ae0bd){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0xb5'),_0x2ae0bd[_0x8a1e('0xb6')]));if(!this['isConfigured'](_0x2ae0bd[_0x8a1e('0x6a')])){return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](_0x8a1e('0xb8'));}var _0x367e61='\x22'+_0x2ae0bd[_0x8a1e('0x6a')]+'\x22';if(this[_0x8a1e('0x8d')](_0x2ae0bd[_0x8a1e('0x83')])){_0x367e61+=','+_0x2ae0bd['options'];}var _0x4d038c=this['channel'][_0x8a1e('0xb9')](_0x8a1e('0xba'),_0x367e61);if(_0x4d038c['result']===-0x1){return _0x4d038c;}return this[_0x8a1e('0x35')]['noop'](util['format'](_0x8a1e('0xbb'),_0x367e61));};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0xbc')]=function(_0x168555){logger['info'](util[_0x8a1e('0xa7')](_0x8a1e('0xbd'),_0x168555[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x168555['grammar'])){return this[_0x8a1e('0x35')][_0x8a1e('0xb7')]('no\x20grammar\x20configured');}var _0x1e46a8=_0x168555['grammar'];if(this[_0x8a1e('0x8d')](_0x168555[_0x8a1e('0x83')])){_0x1e46a8+=','+_0x168555[_0x8a1e('0x83')];}var _0x5d981c=this[_0x8a1e('0x35')][_0x8a1e('0xb9')](_0x8a1e('0xbe'),_0x1e46a8);if(_0x5d981c['result']===-0x1){return _0x5d981c;}var _0x37e8a2=this['getAndSetVariable'](_0x8a1e('0xbf'),_0x8a1e('0xc0'));if(_0x37e8a2['result']===-0x1){return _0x37e8a2;}var _0x7ba111=this[_0x8a1e('0xc1')](_0x8a1e('0xc2'),'MRCP_RECOG_TRANSCRIPT');if(_0x7ba111[_0x8a1e('0xc3')]===-0x1){return _0x7ba111;}var _0x19b4f8=this['getAndSetVariable'](_0x8a1e('0xc4'),_0x8a1e('0xc5'));if(_0x19b4f8[_0x8a1e('0xc3')]===-0x1){return _0x19b4f8;}return this['channel'][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0xc6'),_0x1e46a8));};AGIVertices[_0x8a1e('0x14')]['agi']=function(_0xd96287){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0xc7'),_0xd96287[_0x8a1e('0xb6')]));return this[_0x8a1e('0x35')][_0x8a1e('0x7')]([_0xd96287[_0x8a1e('0xc8')],_0xd96287['args']]);};AGIVertices['prototype'][_0x8a1e('0xc9')]=function(_0xa9b102){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0xca'),_0xa9b102[_0x8a1e('0xb6')]));if(this['isConfigured'](_0xa9b102['timeout'])){logger[_0x8a1e('0xb0')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0xa9b102['timeout']));var _0x4ff3fa=this['channel']['wait'](_0xa9b102[_0x8a1e('0x72')]);if(_0x4ff3fa['result']===-0x1){return _0x4ff3fa;}}return this[_0x8a1e('0x35')]['answer']();};AGIVertices[_0x8a1e('0x14')]['callback']=function(_0x1cc89e){console[_0x8a1e('0x40')](_0x8a1e('0xcb'),_0x1cc89e);logger[_0x8a1e('0xb0')](util['format'](_0x8a1e('0xcc'),_0x1cc89e[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x1cc89e[_0x8a1e('0x47')])){return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x1cc89e,_0x8a1e('0xcd'));}_0x1cc89e[_0x8a1e('0x4a')]=moment();if(this[_0x8a1e('0x8d')](_0x1cc89e['delay'])){_0x1cc89e[_0x8a1e('0x4a')]=moment()[_0x8a1e('0x57')](_0x1cc89e[_0x8a1e('0xce')],_0x8a1e('0x58'));}if(!this[_0x8a1e('0x8d')](_0x1cc89e[_0x8a1e('0x4c')])){_0x1cc89e[_0x8a1e('0x4c')]=0x2;}console[_0x8a1e('0x40')](_0x8a1e('0xcf'),_0x1cc89e);this[_0x8a1e('0xd0')]['sync'](this,_0x1cc89e);return this[_0x8a1e('0x35')]['noop'](util[_0x8a1e('0xa7')](_0x8a1e('0xd1'),_0x1cc89e[_0x8a1e('0x51')],_0x1cc89e[_0x8a1e('0x47')],_0x1cc89e[_0x8a1e('0x4a')]));};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0xd2')]=function(_0x215806){logger[_0x8a1e('0xb0')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x215806[_0x8a1e('0xb6')]));var _0x5cedfb=this[_0x8a1e('0x35')][_0x8a1e('0xb9')](_0x215806[_0x8a1e('0xd3')],_0x215806[_0x8a1e('0x83')]);if(_0x5cedfb[_0x8a1e('0xc3')]===-0x1){return _0x5cedfb;}return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0xd4'),_0x215806[_0x8a1e('0xd3')],_0x215806[_0x8a1e('0x83')]));};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0xd5')]=function(_0x259419){logger['info'](util[_0x8a1e('0xa7')](_0x8a1e('0xd6'),_0x259419[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x259419['text'])){return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](_0x8a1e('0xb8'));}var _0x4bc9cb='\x22'+_0x259419[_0x8a1e('0x6a')]+'\x22';if(this[_0x8a1e('0x8d')](_0x259419[_0x8a1e('0x83')])){_0x4bc9cb+=','+_0x259419[_0x8a1e('0x83')];}var _0xd80318=this[_0x8a1e('0x35')][_0x8a1e('0xb9')]('MRCPSynth',_0x4bc9cb);if(_0xd80318[_0x8a1e('0xc3')]===-0x1){return _0xd80318;}return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0xbb'),_0x4bc9cb));};AGIVertices['prototype'][_0x8a1e('0xd7')]=function(_0x51f9e4){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0xd8'),_0x51f9e4['label']));if(!this[_0x8a1e('0x8d')](_0x51f9e4[_0x8a1e('0x6a')])){return this[_0x8a1e('0x35')][_0x8a1e('0xb7')]('no\x20text\x20configured');}var _0x40173d='\x22'+_0x51f9e4[_0x8a1e('0x6a')]+'\x22';if(this['isConfigured'](_0x51f9e4['options'])){_0x40173d+=','+_0x51f9e4[_0x8a1e('0x83')];}var _0x332d67=this[_0x8a1e('0x35')][_0x8a1e('0xb9')]('MRCPSynth',_0x40173d);if(_0x332d67[_0x8a1e('0xc3')]===-0x1){return _0x332d67;}return this['channel'][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0xbb'),_0x40173d));};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0xd9')]=function(_0x1a1761){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0xda'),_0x1a1761[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x1a1761[_0x8a1e('0xdb')])){return this['channel'][_0x8a1e('0xb7')]('no\x20grammar\x20configured');}var _0xc200d2=_0x1a1761[_0x8a1e('0xdb')];if(this[_0x8a1e('0x8d')](_0x1a1761[_0x8a1e('0x83')])){_0xc200d2+=','+_0x1a1761[_0x8a1e('0x83')];}var _0x2a54be=this[_0x8a1e('0x35')][_0x8a1e('0xb9')]('MRCPRecog',_0xc200d2);if(_0x2a54be[_0x8a1e('0xc3')]===-0x1){return _0x2a54be;}var _0x165fd7=this[_0x8a1e('0xc1')]('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x165fd7[_0x8a1e('0xc3')]===-0x1){return _0x165fd7;}var _0x1d686e=this[_0x8a1e('0xc1')](_0x8a1e('0xc2'),_0x8a1e('0xdc'));if(_0x1d686e['result']===-0x1){return _0x1d686e;}var _0x3f8254=this[_0x8a1e('0xc1')]('RECOG_INSTANCE()',_0x8a1e('0xdd'));if(_0x3f8254[_0x8a1e('0xc3')]===-0x1){return _0x3f8254;}return this[_0x8a1e('0x35')]['noop'](util[_0x8a1e('0xa7')]('Executed\x20command\x20MRCPRecog\x20%s',_0xc200d2));};AGIVertices[_0x8a1e('0x14')]['sestekasr']=function(_0x15e16a){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x15e16a[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x15e16a[_0x8a1e('0xdb')])){return this[_0x8a1e('0x35')][_0x8a1e('0xb7')]('no\x20grammar\x20configured');}var _0x2b6d6a=_0x15e16a['grammar'];if(this['isConfigured'](_0x15e16a[_0x8a1e('0x83')])){_0x2b6d6a+=','+_0x15e16a[_0x8a1e('0x83')];}var _0x3c7b13=this[_0x8a1e('0x35')][_0x8a1e('0xb9')](_0x8a1e('0xbe'),_0x2b6d6a);if(_0x3c7b13[_0x8a1e('0xc3')]===-0x1){return _0x3c7b13;}var _0x40dd63=this[_0x8a1e('0xc1')](_0x8a1e('0xbf'),_0x8a1e('0xde'));if(_0x40dd63[_0x8a1e('0xc3')]===-0x1){return _0x40dd63;}var _0x244378=this[_0x8a1e('0xc1')](_0x8a1e('0xc2'),_0x8a1e('0xdf'));if(_0x244378['result']===-0x1){return _0x244378;}var _0x15c00c=this[_0x8a1e('0xc1')](_0x8a1e('0xc4'),'SESTEK_ASR_INSTANCE');if(_0x15c00c[_0x8a1e('0xc3')]===-0x1){return _0x15c00c;}return this[_0x8a1e('0x35')]['noop'](util[_0x8a1e('0xa7')](_0x8a1e('0xc6'),_0x2b6d6a));};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0xe0')]=function(_0x550947){logger[_0x8a1e('0xb0')](util['format'](_0x8a1e('0xe1'),_0x550947[_0x8a1e('0xb6')]));if(!this['isConfigured'](_0x550947['odbc_id'])){return this['channel'][_0x8a1e('0x2b')](_0x550947,_0x8a1e('0xe2'));}var _0x57743e=this[_0x8a1e('0x19')]['sync'](this,_0x550947[_0x8a1e('0xe3')]);if(!_0x57743e){return this['channel'][_0x8a1e('0x2b')](_0x550947,'no\x20odbc\x20database\x20found');}if(!this[_0x8a1e('0x8d')](_0x550947[_0x8a1e('0x2d')])){return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x550947,_0x8a1e('0xe4'));}var _0x4a76fe=_0x550947[_0x8a1e('0x2d')][_0x8a1e('0x66')](/(\r\n|\n|\r)/gm,'\x20');this[_0x8a1e('0x35')]['noop'](util[_0x8a1e('0xa7')](_0x8a1e('0xe5'),_0x4a76fe));var _0x48c74d=this[_0x8a1e('0x2a')][_0x8a1e('0xb3')](this,_0x57743e,_0x4a76fe);this[_0x8a1e('0x34')][_0x8a1e('0xb3')](this,_0x550947,_0x4a76fe);if(!this['isConfigured'](_0x550947[_0x8a1e('0xe6')])){return this[_0x8a1e('0x35')]['noop'](_0x8a1e('0xe7'));}var _0x2120a9=this[_0x8a1e('0xad')][_0x8a1e('0xb3')](this,_0x550947['variable_id']);if(!_0x2120a9){return this[_0x8a1e('0x35')]['error'](_0x550947,_0x8a1e('0xe8'));}var _0x15a37a=this;_0x48c74d[_0x8a1e('0xe9')](function(_0x3cda44,_0x1dea50){Object[_0x8a1e('0xea')](_0x3cda44)[_0x8a1e('0xe9')](function(_0x32b9ad){_0x15a37a['channel'][_0x8a1e('0xeb')](util['format'](_0x8a1e('0xec'),_0x2120a9,_0x1dea50,_0x32b9ad),_0x3cda44[_0x32b9ad]);});});this[_0x8a1e('0x35')][_0x8a1e('0xeb')](util[_0x8a1e('0xa7')](_0x8a1e('0xed'),_0x2120a9),_0x48c74d[_0x8a1e('0xa5')]);return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')]('variable\x20%s\x20set',_0x2120a9));};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0xee')]=function(_0x4bd152){logger[_0x8a1e('0xef')](util[_0x8a1e('0xa7')](_0x8a1e('0xf0'),_0x4bd152[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x4bd152[_0x8a1e('0xf1')])){return this['channel']['error'](_0x4bd152,'no\x20user\x20selected');}var _0x3cae3d=this[_0x8a1e('0x1b')][_0x8a1e('0xb3')](this,_0x4bd152[_0x8a1e('0xf1')]);if(!_0x3cae3d){return this[_0x8a1e('0x35')]['error'](_0x4bd152,_0x8a1e('0xf2'));}var _0x66d008=this[_0x8a1e('0x35')]['exec'](_0x8a1e('0xf3'),[util[_0x8a1e('0xa7')](_0x8a1e('0xf4'),_0x3cae3d),_0x4bd152[_0x8a1e('0x72')],_0x4bd152[_0x8a1e('0xf5')],_0x4bd152[_0x8a1e('0x70')]]);if(_0x66d008['result']===-0x1){return _0x66d008;}return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0xf6'),_0x8a1e('0xf3')));};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0xf7')]=function(_0x1cbfe0){logger['info'](util['format'](_0x8a1e('0xf8'),_0x1cbfe0[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x1cbfe0[_0x8a1e('0x85')])){return this[_0x8a1e('0x35')][_0x8a1e('0xb7')]('no\x20key\x20configured');}if(!this[_0x8a1e('0x8d')](_0x1cbfe0['text'])){return this[_0x8a1e('0x35')][_0x8a1e('0xb7')]('no\x20text\x20configured');}this[_0x8a1e('0x35')]['bot']=!![];this[_0x8a1e('0x34')](_0x1cbfe0);this[_0x8a1e('0xf9')](_0x1cbfe0[_0x8a1e('0x6a')],'in');this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0xfa'),_0x1cbfe0[_0x8a1e('0x6a')]));var _0x5864b4=this['googleDialogflow']['sync'](this,_0x1cbfe0);if(_0x5864b4){for(var _0x1f4056 in _0x5864b4){if(_0x5864b4[_0x8a1e('0x9e')](_0x1f4056)){this[_0x8a1e('0x35')][_0x8a1e('0xeb')](util[_0x8a1e('0xa7')](_0x8a1e('0xfb'),_0x1f4056[_0x8a1e('0x76')]()),_0x5864b4[_0x1f4056]);}}this[_0x8a1e('0xf9')](_0x5864b4[_0x8a1e('0xfc')],_0x8a1e('0xfd'));return this['channel'][_0x8a1e('0xb7')](util['format'](_0x8a1e('0xfe'),_0x5864b4[_0x8a1e('0xfc')]));}return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x1cbfe0,_0x8a1e('0xff'));};AGIVertices['prototype']['sesteknda']=function(_0x16a555){logger[_0x8a1e('0xb0')](util['format'](_0x8a1e('0x100'),_0x16a555[_0x8a1e('0xb6')]));if(!this['isConfigured'](_0x16a555[_0x8a1e('0x101')])){return this[_0x8a1e('0x35')][_0x8a1e('0xb7')]('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0x16a555['username'])){return this['channel'][_0x8a1e('0xb7')](_0x8a1e('0x102'));}if(!this['isConfigured'](_0x16a555[_0x8a1e('0x103')])){return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](_0x8a1e('0x104'));}if(!this[_0x8a1e('0x8d')](_0x16a555[_0x8a1e('0x105')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x8a1e('0x35')]['bot']=!![];this[_0x8a1e('0x34')](_0x16a555);this[_0x8a1e('0xf9')](_0x16a555['text'],'in');this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0x106'),_0x16a555[_0x8a1e('0x6a')]));var _0x52a761=this[_0x8a1e('0x87')][_0x8a1e('0xb3')](this,_0x16a555);if(_0x52a761){for(var _0xd88407 in _0x52a761){if(_0x52a761[_0x8a1e('0x9e')](_0xd88407)){this[_0x8a1e('0x35')]['setVariable'](util[_0x8a1e('0xa7')](_0x8a1e('0x107'),_0xd88407[_0x8a1e('0x76')]()),_0x52a761[_0xd88407]);}}this['createSquareMessage'](_0x52a761[_0x8a1e('0xfc')],'out');if(_0x52a761['audiofile']){this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x52a761[_0x8a1e('0x108')]));var _0x3f31ba=this[_0x8a1e('0x35')][_0x8a1e('0x109')](_0x52a761[_0x8a1e('0x108')]);try{fs[_0x8a1e('0x10a')](_0x52a761['audiofile']+'.wav');}catch(_0x180795){logger['error'](_0x180795);}return _0x3f31ba;}else{return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0x10b'),_0x52a761[_0x8a1e('0xfc')]));}}return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x16a555,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x8a1e('0x10c')]=function(_0x1a2416){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x10d'),_0x1a2416['label']));return this['channel'][_0x8a1e('0xb7')](_0x8a1e('0x10c'));};AGIVertices['prototype'][_0x8a1e('0x10e')]=function(_0x5d20e1){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x10f'),_0x5d20e1['label']));var _0x37ed69='';if(_0x5d20e1[_0x8a1e('0x110')]){if(!this[_0x8a1e('0x8d')](_0x5d20e1[_0x8a1e('0x110')])){return this['channel'][_0x8a1e('0x2b')](_0x5d20e1,_0x8a1e('0x111'));}else{var _0x3a6816=parseInt(_0x5d20e1[_0x8a1e('0x110')],0xa);if(isNaN(_0x3a6816)){_0x37ed69=_0x5d20e1['trunk_id'];}else{_0x37ed69=this[_0x8a1e('0x1d')][_0x8a1e('0xb3')](this,_0x5d20e1['trunk_id']);if(!_0x37ed69){return this['channel'][_0x8a1e('0x2b')](_0x5d20e1,_0x8a1e('0x112'));}}}}else if(_0x5d20e1[_0x8a1e('0x113')]){_0x37ed69=_0x5d20e1[_0x8a1e('0x113')];}else{return this[_0x8a1e('0x35')]['error'](_0x5d20e1,_0x8a1e('0x111'));}var _0x497a27=this[_0x8a1e('0x35')][_0x8a1e('0xb9')](_0x8a1e('0xf3'),[util[_0x8a1e('0xa7')](_0x8a1e('0x114'),_0x37ed69,_0x5d20e1[_0x8a1e('0x51')]),_0x5d20e1[_0x8a1e('0x72')],_0x5d20e1[_0x8a1e('0xf5')],_0x5d20e1[_0x8a1e('0x70')]]);if(_0x497a27[_0x8a1e('0xc3')]===-0x1){return _0x497a27;}return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util['format']('Executed\x20command\x20%s',_0x8a1e('0xf3')));};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x115')]=function(_0x3854c3){logger[_0x8a1e('0xb0')](util['format'](_0x8a1e('0x116'),_0x3854c3[_0x8a1e('0xb6')]));return this[_0x8a1e('0x35')]['noop'](_0x8a1e('0x115'));};AGIVertices[_0x8a1e('0x14')]['getdigits']=function(_0x42efd8){logger['info'](util[_0x8a1e('0xa7')](_0x8a1e('0x117'),_0x42efd8['label']));if(_0x42efd8[_0x8a1e('0xb4')]===0x0){return this[_0x8a1e('0xb2')](_0x42efd8);}_0x42efd8[_0x8a1e('0xb4')]-=0x1;if(!this[_0x8a1e('0x8d')](_0x42efd8[_0x8a1e('0x118')])){return this['channel'][_0x8a1e('0x2b')](_0x42efd8,_0x8a1e('0x119'));}var _0x8992da=this[_0x8a1e('0x1f')]['sync'](this,_0x42efd8['file_id']);if(!_0x8992da){return this['channel']['error'](_0x42efd8,'no\x20file\x20audio\x20found');}if(!this[_0x8a1e('0x8d')](_0x42efd8[_0x8a1e('0xe6')])){return this[_0x8a1e('0x35')]['error'](_0x8a1e('0xe7'));}var _0x3e3335=this[_0x8a1e('0x35')][_0x8a1e('0x11a')](_0x8992da,_0x42efd8[_0x8a1e('0x11b')],_0x42efd8[_0x8a1e('0x11c')]);var _0x3d343c=_0x3e3335['result']?_0x3e3335[_0x8a1e('0xc3')][_0x8a1e('0x4b')]():'';logger[_0x8a1e('0xb0')](_0x8a1e('0x11d'),JSON[_0x8a1e('0x7d')](_0x3e3335));if(_0x3e3335['result']===-0x1){this[_0x8a1e('0x34')][_0x8a1e('0xb3')](this,_0x42efd8,_0x3d343c);return _0x3e3335;}else if(_0x3e3335[_0x8a1e('0xae')]==='timeout'){_0x3e3335['result']=_0x3d343c['length']>=parseInt(_0x42efd8[_0x8a1e('0x11e')])?'x':'i';}else{_0x3e3335['result']=_0x3d343c[_0x8a1e('0xa5')]>=parseInt(_0x42efd8['mindigit'])&&_0x3d343c[_0x8a1e('0xa5')]<=parseInt(_0x42efd8['maxdigit'])?'x':'i';}var _0x280664=this['getVariable'][_0x8a1e('0xb3')](this,_0x42efd8[_0x8a1e('0xe6')]);if(!_0x280664){return this['channel'][_0x8a1e('0x2b')](_0x42efd8,_0x8a1e('0xe8'));}this[_0x8a1e('0x35')][_0x8a1e('0xeb')](_0x280664,_0x3d343c);if(this[_0x8a1e('0x8d')](_0x42efd8[_0x8a1e('0x11f')])){var _0x59dd74=parseInt(_0x42efd8['hiddendigitsnum'],0xa);var _0x54ba5e=rs[_0x8a1e('0x120')]({'charset':'*','length':_0x59dd74});var _0x97dbe2=_0x3d343c[_0x8a1e('0xa5')];if(_0x97dbe2>0x0){if(_0x97dbe2>_0x59dd74){this['createSquareDetailsReport'][_0x8a1e('0xb3')](this,_0x42efd8,_0x42efd8['hiddendigitspos']===_0x8a1e('0x121')?_0x54ba5e+_0x3d343c['substr'](_0x59dd74):_0x3d343c['substr'](0x0,_0x97dbe2-_0x59dd74)+_0x54ba5e);}else{this[_0x8a1e('0x34')][_0x8a1e('0xb3')](this,_0x42efd8,rs['generate']({'charset':'*','length':_0x97dbe2}));}}else{this[_0x8a1e('0x34')]['sync'](this,_0x42efd8,'');}}else{this[_0x8a1e('0x34')]['sync'](this,_0x42efd8,_0x3d343c);}return _0x3e3335;};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0xe')]=function(_0x2609d1){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x122'),_0x2609d1[_0x8a1e('0xb6')]));return this[_0x8a1e('0xd')](_0x2609d1);};AGIVertices[_0x8a1e('0x14')]['goal']=function(_0x283fb8){logger['info'](util[_0x8a1e('0xa7')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x283fb8['label']));this['createSquareDetailsReport'][_0x8a1e('0xb3')](this,_0x283fb8,_0x283fb8[_0x8a1e('0x123')]);return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util['format'](_0x8a1e('0x124'),_0x283fb8['goalname']));};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x125')]=function(_0x237f19){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x126'),_0x237f19[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x237f19['aws_access_key_id'])||!this[_0x8a1e('0x8d')](_0x237f19[_0x8a1e('0x90')])){return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](_0x8a1e('0x127'));}if(!this['isConfigured'](_0x237f19['text'])){return this[_0x8a1e('0x35')]['noop'](_0x8a1e('0xb8'));}this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')]('Trying\x20aws\x20Polly\x20%s',_0x237f19[_0x8a1e('0x6a')]));var _0x5c344b=this[_0x8a1e('0x8f')][_0x8a1e('0xb3')](this,_0x237f19);if(_0x5c344b){this[_0x8a1e('0x35')]['noop'](util[_0x8a1e('0xa7')](_0x8a1e('0x128'),_0x5c344b));var _0x1476c8=this[_0x8a1e('0x35')][_0x8a1e('0x109')](_0x5c344b);try{fs[_0x8a1e('0x10a')](_0x5c344b+_0x8a1e('0x129'));}catch(_0x2c5a78){logger['error'](_0x2c5a78);}return _0x1476c8;}return this['channel'][_0x8a1e('0x2b')](_0x237f19,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x8a1e('0x12a')]=function(_0x2ebc56){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x12b'),_0x2ebc56['label']));if(!this[_0x8a1e('0x8d')](_0x2ebc56[_0x8a1e('0x95')])||!this[_0x8a1e('0x8d')](_0x2ebc56[_0x8a1e('0x90')])){return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](_0x8a1e('0x127'));}if(!this[_0x8a1e('0x8d')](_0x2ebc56[_0x8a1e('0x12c')])){return this[_0x8a1e('0x35')]['noop'](_0x8a1e('0x12d'));}if(!this[_0x8a1e('0x8d')](_0x2ebc56[_0x8a1e('0x6a')])){return this['channel']['noop'](_0x8a1e('0xb8'));}this[_0x8a1e('0x35')][_0x8a1e('0x12e')]=!![];this[_0x8a1e('0x34')](_0x2ebc56);this[_0x8a1e('0xf9')](_0x2ebc56[_0x8a1e('0x6a')],'in');this['channel'][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0x12f'),_0x2ebc56[_0x8a1e('0x6a')]));var _0x49b61a=this['awsLex']['sync'](this,_0x2ebc56);if(_0x49b61a){for(var _0x39da7a in _0x49b61a){if(_0x49b61a[_0x8a1e('0x9e')](_0x39da7a)&&_[_0x8a1e('0x9f')](_0x49b61a[_0x39da7a])){this[_0x8a1e('0x35')][_0x8a1e('0xeb')](util[_0x8a1e('0xa7')](_0x8a1e('0x130'),_0x39da7a['toUpperCase']()),_0x49b61a[_0x39da7a]);}}if(_[_0x8a1e('0x43')](_0x49b61a[_0x8a1e('0x81')])){return this[_0x8a1e('0x35')]['noop'](_0x8a1e('0x131'));}else{this[_0x8a1e('0xf9')](_0x49b61a[_0x8a1e('0x81')],'out');return this[_0x8a1e('0x35')]['noop'](util[_0x8a1e('0xa7')](_0x8a1e('0x132'),_0x49b61a[_0x8a1e('0x81')]));}}return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x2ebc56,_0x8a1e('0x133'));};AGIVertices[_0x8a1e('0x14')]['googleasr']=function(_0x56e918){logger[_0x8a1e('0xb0')](util['format'](_0x8a1e('0x134'),_0x56e918[_0x8a1e('0xb6')],_0x56e918[_0x8a1e('0x72')]));if(!this[_0x8a1e('0x8d')](_0x56e918[_0x8a1e('0x85')])){return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](_0x8a1e('0x135'));}var _0x26121e=_0x8a1e('0x136');var _0x1cd708=util[_0x8a1e('0xa7')]('%s/recordings/%s',FILES_PATH,rs[_0x8a1e('0x120')](0x4));var _0x47ef58=util['format']('%s.%s',_0x1cd708,_0x26121e);var _0xeb67e3=!![];if(_0x56e918['beep']==='NOBEEP'){_0xeb67e3=![];}var _0x55caef=this[_0x8a1e('0x35')][_0x8a1e('0x137')](_0x1cd708,_0x26121e,_0x56e918[_0x8a1e('0x138')],_0x56e918[_0x8a1e('0x72')],undefined,_0xeb67e3);if(_0x55caef['result']!==-0x1){this['channel']['noop'](util['format']('google\x20%s\x20file\x20created',_0x47ef58));var _0x23cef1=this[_0x8a1e('0x97')][_0x8a1e('0xb3')](this,_0x56e918,_0x47ef58);if(_0x23cef1){for(var _0x1ec4ba in _0x23cef1){if(_0x23cef1[_0x8a1e('0x9e')](_0x1ec4ba)){this['channel'][_0x8a1e('0xeb')](util[_0x8a1e('0xa7')](_0x8a1e('0x139'),_0x1ec4ba['toUpperCase']()),_0x23cef1[_0x1ec4ba]);}}return this[_0x8a1e('0x35')]['noop'](util[_0x8a1e('0xa7')](_0x8a1e('0x13a'),JSON[_0x8a1e('0x7d')](_0x23cef1)));}}return _0x55caef;};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x13b')]=function(_0x27fefd){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x27fefd[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x27fefd['appid'])){return this['channel'][_0x8a1e('0xb7')](_0x8a1e('0x13c'));}if(!this[_0x8a1e('0x8d')](_0x27fefd[_0x8a1e('0x9b')])){return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](_0x8a1e('0x13d'));}var _0x67a0a=_0x8a1e('0x136');var _0x711c4a=util[_0x8a1e('0xa7')](_0x8a1e('0x13e'),FILES_PATH,rs['generate'](0x4));var _0x263a46=util[_0x8a1e('0xa7')](_0x8a1e('0xa8'),_0x711c4a,_0x67a0a);var _0x4828ff=!![];if(_0x27fefd[_0x8a1e('0x13f')]===_0x8a1e('0x140')){_0x4828ff=![];}var _0x512a6e=this['channel']['recordFile'](_0x711c4a,_0x67a0a,_0x27fefd[_0x8a1e('0x138')],_0x27fefd[_0x8a1e('0x72')],undefined,_0x4828ff);if(_0x512a6e[_0x8a1e('0xc3')]!==-0x1){this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0x141'),_0x263a46));var _0x5794bc=this[_0x8a1e('0x99')]['sync'](this,_0x27fefd,_0x263a46);if(_0x5794bc){for(var _0x378b09 in _0x5794bc){if(_0x5794bc[_0x8a1e('0x9e')](_0x378b09)){this[_0x8a1e('0x35')][_0x8a1e('0xeb')](util['format'](_0x8a1e('0x142'),_0x378b09[_0x8a1e('0x76')]()),_0x5794bc[_0x378b09]);}}return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0x143'),JSON[_0x8a1e('0x7d')](_0x5794bc)));}}return _0x512a6e;};AGIVertices['prototype'][_0x8a1e('0x144')]=function(_0x5b3faa){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x5b3faa[_0x8a1e('0xb6')]));return this[_0x8a1e('0x35')][_0x8a1e('0x145')](_0x5b3faa['context'],_0x5b3faa['extension'],_0x5b3faa[_0x8a1e('0x3e')]);};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x146')]=function(_0x2c5752){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x147'),_0x2c5752[_0x8a1e('0xb6')]));if(!this['isConfigured'](_0x2c5752[_0x8a1e('0x148')])){return this[_0x8a1e('0x35')]['error'](_0x2c5752,_0x8a1e('0x149'));}try{var _0x2928d7=eval(_0x2c5752[_0x8a1e('0x148')])?_0x8a1e('0x14a'):_0x8a1e('0x14b');this['channel'][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')]('EVAL\x20CONDITION\x20%s\x20%s',_0x2c5752[_0x8a1e('0x148')],_0x2928d7));return{'code':0xc8,'result':_0x2928d7};}catch(_0xa734ab){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x14c')]=function(_0x27724b){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x14d'),_0x27724b['label']));if(!this[_0x8a1e('0x8d')](_0x27724b[_0x8a1e('0x14e')])){return this['channel'][_0x8a1e('0x2b')](_0x27724b,_0x8a1e('0x14f'));}var _0x2b39b1=this['getIntervals'][_0x8a1e('0xb3')](this,_0x27724b[_0x8a1e('0x14e')]);if(!_0x2b39b1){return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x27724b,_0x8a1e('0x150'));}for(var _0x57f721=0x0;_0x57f721<_0x2b39b1['length'];_0x57f721+=0x1){var _0x2b3893=this[_0x8a1e('0x35')][_0x8a1e('0xad')](util['format'](_0x8a1e('0x151'),_0x2b39b1[_0x57f721]));if(_0x2b3893[_0x8a1e('0xc3')]===-0x1){return _0x2b3893;}logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')]('IFTIME\x20%s\x20%s',_0x2b39b1[_0x57f721],_0x2b3893[_0x8a1e('0xae')]));if(_0x2b3893['extra']===_0x8a1e('0x14a')){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x152'),_0x2b39b1[_0x57f721],_0x8a1e('0x14a')));this['channel'][_0x8a1e('0xb7')](util['format'](_0x8a1e('0x152'),_0x2b39b1[_0x57f721],'true'));return{'code':0xc8,'result':_0x8a1e('0x14a')};}else{logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x152'),_0x2b39b1[_0x57f721],_0x8a1e('0x14b')));this['channel'][_0x8a1e('0xb7')](util['format'](_0x8a1e('0x152'),_0x2b39b1[_0x57f721],_0x8a1e('0x14b')));}}return{'code':0xc8,'result':_0x8a1e('0x14b')};};AGIVertices['prototype'][_0x8a1e('0x153')]=function(_0x1aad20){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x1aad20[_0x8a1e('0xb6')]));return this['channel'][_0x8a1e('0x153')]();};AGIVertices[_0x8a1e('0x14')]['ispeechasr']=function(_0x2cc44a){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x154'),_0x2cc44a[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x2cc44a[_0x8a1e('0x85')])){return this['channel'][_0x8a1e('0xb7')](_0x8a1e('0x135'));}var _0x56b406=_0x8a1e('0x136');var _0x321979=util[_0x8a1e('0xa7')](_0x8a1e('0x13e'),FILES_PATH,rs[_0x8a1e('0x120')](0x4));var _0x1c53ac=util[_0x8a1e('0xa7')](_0x8a1e('0xa8'),_0x321979,_0x56b406);var _0x20f73a=!![];if(_0x2cc44a['beep']===_0x8a1e('0x140')){_0x20f73a=![];}var _0xf03a30=this['channel'][_0x8a1e('0x137')](_0x321979,_0x56b406,_0x2cc44a[_0x8a1e('0x138')],_0x2cc44a[_0x8a1e('0x72')],undefined,_0x20f73a);if(_0xf03a30['result']!==-0x1){this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util['format'](_0x8a1e('0x155'),_0x1c53ac));var _0x67f7de=this[_0x8a1e('0x8b')][_0x8a1e('0xb3')](this,_0x2cc44a,_0x1c53ac);if(_0x67f7de){for(var _0x5a4af4 in _0x67f7de){if(_0x67f7de[_0x8a1e('0x9e')](_0x5a4af4)){this[_0x8a1e('0x35')][_0x8a1e('0xeb')](util['format'](_0x8a1e('0x156'),_0x5a4af4[_0x8a1e('0x76')]()),_0x67f7de[_0x5a4af4]);}}return this['channel'][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0x157'),JSON[_0x8a1e('0x7d')](_0x67f7de)));}}return _0xf03a30;};AGIVertices['prototype']['ispeechtts']=function(_0xa3ef29){logger[_0x8a1e('0xb0')](util['format'](_0x8a1e('0x158'),_0xa3ef29[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0xa3ef29[_0x8a1e('0x85')])){return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](_0x8a1e('0x135'));}if(!this[_0x8a1e('0x8d')](_0xa3ef29[_0x8a1e('0x6a')])){return this['channel']['noop'](_0x8a1e('0xb8'));}this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0x159'),_0xa3ef29['text']));var _0x4fc473=this['ispeechTTS'][_0x8a1e('0xb3')](this,_0xa3ef29);if(_0x4fc473){this['channel']['noop'](util[_0x8a1e('0xa7')]('ispeech\x20%s\x20file\x20created',_0x4fc473));var _0x565436=this[_0x8a1e('0x35')]['streamFile'](_0x4fc473,_0xa3ef29[_0x8a1e('0x138')]);try{fs[_0x8a1e('0x10a')](_0x4fc473+_0x8a1e('0x129'));}catch(_0x2002cb){logger[_0x8a1e('0x2b')](_0x2002cb);}return _0x565436;}return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0xa3ef29,_0x8a1e('0x15a'));};AGIVertices['prototype'][_0x8a1e('0x15b')]=function(_0x1c1e1d){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x15c'),_0x1c1e1d[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x1c1e1d[_0x8a1e('0x15d')])){return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x1c1e1d,_0x8a1e('0x15e'));}logger['info'](util[_0x8a1e('0xa7')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8a1e('0x35')][_0x8a1e('0x39')],_0x1c1e1d['findBy']));var _0x9bce9d=this[_0x8a1e('0x60')][_0x8a1e('0xb3')](this,_0x1c1e1d[_0x8a1e('0x15d')]);if(_0x9bce9d){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x8a1e('0x39')],_0x1c1e1d[_0x8a1e('0x15d')]));this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0x15f'),this[_0x8a1e('0x35')]['callerid'],_0x1c1e1d['findBy']));return{'code':0xc8,'result':_0x8a1e('0x160')};}else{logger[_0x8a1e('0xb0')](util['format'](_0x8a1e('0x161'),this['channel'][_0x8a1e('0x39')],_0x1c1e1d[_0x8a1e('0x15d')]));this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8a1e('0x35')][_0x8a1e('0x39')],_0x1c1e1d['findBy']));return{'code':0xc8,'result':_0x8a1e('0x162')};}};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x163')]=function(_0x4c3728){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x164'),_0x4c3728[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x4c3728[_0x8a1e('0x15d')])){return this['channel'][_0x8a1e('0x2b')](_0x4c3728,_0x8a1e('0x15e'));}logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x165'),this['channel'][_0x8a1e('0x39')],_0x4c3728[_0x8a1e('0x15d')]));var _0x15132b=this[_0x8a1e('0x5f')][_0x8a1e('0xb3')](this,_0x4c3728['findBy']);if(_0x15132b){logger[_0x8a1e('0xb0')](util['format'](_0x8a1e('0x15f'),this[_0x8a1e('0x35')][_0x8a1e('0x39')],_0x4c3728[_0x8a1e('0x15d')]));this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util['format'](_0x8a1e('0x15f'),this[_0x8a1e('0x35')][_0x8a1e('0x39')],_0x4c3728['findBy']));return{'code':0xc8,'result':_0x8a1e('0x160')};}else{logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x161'),this['channel']['callerid'],_0x4c3728[_0x8a1e('0x15d')]));this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0x161'),this[_0x8a1e('0x35')]['callerid'],_0x4c3728[_0x8a1e('0x15d')]));return{'code':0xc8,'result':_0x8a1e('0x162')};}};AGIVertices['prototype'][_0x8a1e('0x166')]=function(_0x1e3c4f){logger[_0x8a1e('0xb0')](util['format'](_0x8a1e('0x167'),_0x1e3c4f[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x1e3c4f['operation'])){return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x1e3c4f,_0x8a1e('0x168'));}this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0x169'),_0x1e3c4f['operation']));var _0x17ae8b=eval(_0x1e3c4f[_0x8a1e('0x16a')]);if(!this[_0x8a1e('0x8d')](_0x1e3c4f[_0x8a1e('0xe6')])){return this['channel'][_0x8a1e('0xb7')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0xf585c6=this['getVariable']['sync'](this,_0x1e3c4f[_0x8a1e('0xe6')]);if(!_0xf585c6){return this[_0x8a1e('0x35')]['error'](_0x1e3c4f,_0x8a1e('0xe8'));}if(_[_0x8a1e('0xa4')](_0x17ae8b)){var _0x1be73a=this;_0x17ae8b[_0x8a1e('0xe9')](function(_0x5a9c9a,_0x162408){_0x1be73a[_0x8a1e('0x35')]['setVariable'](util[_0x8a1e('0xa7')]('%s[%s]',_0xf585c6,_0x162408),_0x5a9c9a);});return this['channel'][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0x16b'),_0xf585c6));}else{return this[_0x8a1e('0x35')][_0x8a1e('0xeb')](_0xf585c6,_0x17ae8b);}};AGIVertices['prototype']['menu']=function(_0x2b0106){logger['info'](util['format'](_0x8a1e('0x16c'),_0x2b0106[_0x8a1e('0xb6')]));if(_0x2b0106[_0x8a1e('0xb4')]===0x0){return this[_0x8a1e('0xb2')](_0x2b0106);}_0x2b0106[_0x8a1e('0xb4')]-=0x1;if(!this[_0x8a1e('0x8d')](_0x2b0106[_0x8a1e('0x118')])){return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x2b0106,_0x8a1e('0x119'));}var _0x51c89c=this[_0x8a1e('0x1f')][_0x8a1e('0xb3')](this,_0x2b0106[_0x8a1e('0x118')]);if(!_0x51c89c){return this['channel'][_0x8a1e('0x2b')](_0x2b0106,'no\x20file\x20audio\x20found');}var _0x106df9=this['channel'][_0x8a1e('0x11a')](_0x51c89c,_0x2b0106['response'],_0x2b0106[_0x8a1e('0x16d')]);var _0x5b990a=_0x106df9[_0x8a1e('0xc3')];if(_0x106df9[_0x8a1e('0xc3')]===-0x1){this['createSquareDetailsReport'][_0x8a1e('0xb3')](this,_0x2b0106,'-1');return _0x106df9;}else if(_0x106df9[_0x8a1e('0xae')]===_0x8a1e('0x72')){_0x106df9[_0x8a1e('0xc3')]=_0x106df9['result'][_0x8a1e('0xa5')]>0x0?_0x106df9[_0x8a1e('0xc3')]:'t';}else if(_[_0x8a1e('0x42')](_0x106df9[_0x8a1e('0xc3')])){_0x106df9[_0x8a1e('0xc3')]='#';_0x5b990a='#';}if(!this[_0x8a1e('0x8d')](_0x2b0106['variable_id'])){this[_0x8a1e('0x35')][_0x8a1e('0xb7')](_0x8a1e('0xe7'));}else{var _0x2dfd54=this['getVariable'][_0x8a1e('0xb3')](this,_0x2b0106[_0x8a1e('0xe6')]);if(!_0x2dfd54){return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x2b0106,_0x8a1e('0xe8'));}this['channel'][_0x8a1e('0xeb')](_0x2dfd54,_0x5b990a);}this[_0x8a1e('0x34')][_0x8a1e('0xb3')](this,_0x2b0106,_0x5b990a);return _0x106df9;};AGIVertices[_0x8a1e('0x14')]['noop']=function(_0xb76a75){logger['info'](util[_0x8a1e('0xa7')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0xb76a75['label']));return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](_0xb76a75[_0x8a1e('0x16e')]||_0xb76a75[_0x8a1e('0xb6')]);};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x16f')]=function(_0x203aa5){logger['info'](util[_0x8a1e('0xa7')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x203aa5['label']));if(!this['isConfigured'](_0x203aa5[_0x8a1e('0x15d')])){return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x203aa5,_0x8a1e('0x15e'));}logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x165'),this[_0x8a1e('0x35')][_0x8a1e('0x39')],_0x203aa5[_0x8a1e('0x15d')]));var _0x4a60e1=this['getPause'][_0x8a1e('0xb3')](this,_0x203aa5[_0x8a1e('0x170')]);var _0x2787d7=this[_0x8a1e('0x5c')][_0x8a1e('0xb3')](this,_0x203aa5['findBy'],_0x4a60e1);if(_0x2787d7){logger['info'](util['format'](_0x8a1e('0x15f'),this['channel'][_0x8a1e('0x39')],_0x203aa5[_0x8a1e('0x15d')]));this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8a1e('0x35')][_0x8a1e('0x39')],_0x203aa5[_0x8a1e('0x15d')]));return{'code':0xc8,'result':_0x8a1e('0x160')};}else{logger['info'](util[_0x8a1e('0xa7')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8a1e('0x35')][_0x8a1e('0x39')],_0x203aa5[_0x8a1e('0x15d')]));this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8a1e('0x35')][_0x8a1e('0x39')],_0x203aa5[_0x8a1e('0x15d')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x171')]=function(_0x4f1665){logger['info'](util[_0x8a1e('0xa7')](_0x8a1e('0x172'),_0x4f1665[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x4f1665[_0x8a1e('0x118')])){return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x4f1665,_0x8a1e('0x119'));}var _0x3ade8d=this[_0x8a1e('0x1f')]['sync'](this,_0x4f1665['file_id']);if(!_0x3ade8d){return this['channel'][_0x8a1e('0x2b')](_0x4f1665,_0x8a1e('0x173'));}var _0x9968ed=this[_0x8a1e('0x35')][_0x8a1e('0xb9')](_0x8a1e('0x174'),[_0x3ade8d,_0x4f1665[_0x8a1e('0xf5')]]);if(_0x9968ed[_0x8a1e('0xc3')]===-0x1){return _0x9968ed;}return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0xd4'),_0x8a1e('0x174'),_0x3ade8d));};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x175')]=function(_0x48e2e6){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x176'),_0x48e2e6[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x48e2e6[_0x8a1e('0x177')])){return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x48e2e6,'no\x20queue\x20selected');}var _0x1600e0='';var _0x699419=parseInt(_0x48e2e6[_0x8a1e('0x177')],0xa);if(isNaN(_0x699419)){_0x1600e0=_0x48e2e6[_0x8a1e('0x177')];}else{_0x1600e0=this[_0x8a1e('0x15')]['sync'](this,_0x48e2e6[_0x8a1e('0x177')]);if(!_0x1600e0){return this['channel'][_0x8a1e('0x2b')](_0x48e2e6,_0x8a1e('0x178'));}}var _0x1b28f8='';if(this['isConfigured'](_0x48e2e6[_0x8a1e('0x118')])){var _0x4acf52=this['getSound']['sync'](this,_0x48e2e6[_0x8a1e('0x118')]);if(_0x4acf52){_0x1b28f8=_0x4acf52;}}this['createSquareDetailsReport'][_0x8a1e('0xb3')](this,_0x48e2e6,_0x1600e0);if(_0x48e2e6[_0x8a1e('0xf5')]['indexOf']('x')<0x0){_0x48e2e6[_0x8a1e('0xf5')]+='x';}if(_0x48e2e6['opts'][_0x8a1e('0x179')]('X')<0x0){_0x48e2e6[_0x8a1e('0xf5')]+='X';}this['channel'][_0x8a1e('0xeb')]('XMCS-QUEUE',_0x1600e0?_0x1600e0['toLowerCase']():'');var _0x4b8b94=this['channel'][_0x8a1e('0xb9')](_0x8a1e('0x17a'),[_0x1600e0,_0x48e2e6[_0x8a1e('0xf5')],_0x48e2e6[_0x8a1e('0x70')],_0x1b28f8,_0x48e2e6[_0x8a1e('0x72')],_0x48e2e6[_0x8a1e('0x7')],_0x48e2e6['macro'],_0x48e2e6[_0x8a1e('0x17b')],'',_0x48e2e6['position']]);if(_0x4b8b94[_0x8a1e('0xc3')]===-0x1){return _0x4b8b94;}return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0xd4'),_0x8a1e('0x17a'),_0x1600e0));};AGIVertices[_0x8a1e('0x14')]['record']=function(_0x13a2c7){logger['info'](util[_0x8a1e('0xa7')](_0x8a1e('0x17c'),_0x13a2c7[_0x8a1e('0xb6')]));var _0x304dfe=_0x13a2c7['recordingFormat']||'wav';var _0x123d70=util[_0x8a1e('0xa7')](_0x8a1e('0x17d'),this['channel']['uniqueid'],rs[_0x8a1e('0x120')](0x5));var _0x5becb6=util[_0x8a1e('0xa7')](_0x8a1e('0x17e'),FILES_PATH,_0x123d70,_0x304dfe);var _0x22df2d=util[_0x8a1e('0xa7')](_0x8a1e('0x13e'),FILES_PATH,_0x123d70);this[_0x8a1e('0x3a')][_0x8a1e('0xb3')](this,_0x13a2c7,_0x123d70,_0x5becb6);this[_0x8a1e('0x35')][_0x8a1e('0xeb')]('RECORDING_SAVENAME',_0x123d70);logger[_0x8a1e('0xb0')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x22df2d,_0x304dfe,_0x13a2c7['escape_digits'],_0x13a2c7[_0x8a1e('0x72')]);return this[_0x8a1e('0x35')][_0x8a1e('0x137')](_0x22df2d,_0x304dfe,_0x13a2c7['escape_digits'],_0x13a2c7[_0x8a1e('0x72')],undefined,!![]);};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x17f')]=function(_0x53885d){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x180'),_0x53885d[_0x8a1e('0xb6')]));if(!this['isConfigured'](_0x53885d[_0x8a1e('0x70')])){return this[_0x8a1e('0x35')]['noop'](_0x8a1e('0x181'));}var _0x329596=this[_0x8a1e('0x182')][_0x8a1e('0xb3')](this,_0x53885d);logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x183'),util[_0x8a1e('0x184')](_0x329596,{'showHidden':![],'depth':null})));if(!this[_0x8a1e('0x8d')](_0x53885d[_0x8a1e('0xe6')])){return this['channel'][_0x8a1e('0xb7')](_0x8a1e('0x185'));}var _0x5e536d=this[_0x8a1e('0xad')][_0x8a1e('0xb3')](this,_0x53885d[_0x8a1e('0xe6')]);if(!_0x5e536d){return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x53885d,_0x8a1e('0xe8'));}this[_0x8a1e('0x35')][_0x8a1e('0xeb')](util[_0x8a1e('0xa7')]('%s_STATUS_CODE',_0x5e536d),_0x329596[_0x8a1e('0x80')]?_0x329596[_0x8a1e('0x80')]:_0x8a1e('0x186'));this[_0x8a1e('0x35')]['setVariable'](util[_0x8a1e('0xa7')](_0x8a1e('0x187'),_0x5e536d),_0x329596[_0x8a1e('0x188')]?_0x329596['statusMessage']:'OK');if(_0x329596['body']){try{this[_0x8a1e('0xa6')](_0x329596['body'],_0x5e536d);}catch(_0xc6846){logger[_0x8a1e('0x2b')](util[_0x8a1e('0xa7')](_0x8a1e('0x189'),_0x5e536d));}}return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0x18a'),_0x5e536d));};AGIVertices['prototype'][_0x8a1e('0x18b')]=function(_0x1b648f){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x1b648f['label']));return this['channel'][_0x8a1e('0x18c')](_0x1b648f[_0x8a1e('0x18d')][_0x8a1e('0x66')](/\s+/g,''),_0x1b648f[_0x8a1e('0x18e')]);};AGIVertices['prototype'][_0x8a1e('0x18f')]=function(_0x543d18){logger['info'](util[_0x8a1e('0xa7')](_0x8a1e('0x190'),_0x543d18[_0x8a1e('0xb6')]));return this[_0x8a1e('0x35')][_0x8a1e('0x191')](_0x543d18[_0x8a1e('0x73')]['replace'](/\s+/g,''),_0x543d18[_0x8a1e('0x18e')]);};AGIVertices['prototype'][_0x8a1e('0x192')]=function(_0x120511){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x193'),_0x120511[_0x8a1e('0xb6')]));return this[_0x8a1e('0x35')][_0x8a1e('0x194')](_0x120511[_0x8a1e('0x6a')],_0x120511[_0x8a1e('0x18e')]);};AGIVertices[_0x8a1e('0x14')]['sendMail']=function(_0x3e0038){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x195'),_0x3e0038[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x3e0038[_0x8a1e('0x196')])){return this['channel'][_0x8a1e('0xb7')](_0x8a1e('0x197'));}var _0x1aa63f=this['getMailAccount'][_0x8a1e('0xb3')](this,_0x3e0038[_0x8a1e('0x196')]);if(!_0x1aa63f||!_0x1aa63f['Smtp']){return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x3e0038,'no\x20mail\x20account\x20found');}var _0x4300cd={'from':util[_0x8a1e('0xa7')](_0x8a1e('0x198'),_0x1aa63f[_0x8a1e('0x13')],_0x1aa63f['email']||_0x1aa63f[_0x8a1e('0x199')][_0x8a1e('0x19a')]),'to':_0x3e0038['to']||'','cc':_0x3e0038['cc']||'','bcc':_0x3e0038[_0x8a1e('0x19b')]||'','subject':_0x3e0038[_0x8a1e('0x19c')],'html':_0x3e0038[_0x8a1e('0x6a')],'text':_0x3e0038[_0x8a1e('0x6a')]};var _0x1deaa1={'tls':{'rejectUnauthorized':![]}};if(_0x1aa63f['Smtp'][_0x8a1e('0x19d')]){_0x1deaa1[_0x8a1e('0x19d')]=_0x1aa63f['Smtp'][_0x8a1e('0x19d')];}else{_0x1deaa1[_0x8a1e('0x19e')]=_0x1aa63f[_0x8a1e('0x199')][_0x8a1e('0x19e')];_0x1deaa1[_0x8a1e('0x19f')]=_0x1aa63f[_0x8a1e('0x199')][_0x8a1e('0x19f')];_0x1deaa1[_0x8a1e('0x1a0')]=_0x1aa63f[_0x8a1e('0x199')]['secure'];}if(_0x1aa63f['Smtp'][_0x8a1e('0x1a1')]){_0x1deaa1[_0x8a1e('0x1a2')]={'user':_0x1aa63f[_0x8a1e('0x199')][_0x8a1e('0x19a')],'pass':_0x1aa63f[_0x8a1e('0x199')][_0x8a1e('0x1a3')]};}if(this['isConfigured'](_0x3e0038[_0x8a1e('0x1a4')])){}logger[_0x8a1e('0xef')](_0x8a1e('0x1a5'),JSON[_0x8a1e('0x7d')](_0x4300cd));this[_0x8a1e('0x34')][_0x8a1e('0xb3')](this,_0x3e0038,_0x3e0038[_0x8a1e('0x196')]);this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0x1a6'),_0x1aa63f[_0x8a1e('0x13')]));this['sendMailMessage'][_0x8a1e('0xb3')](this,_0x1deaa1,_0x4300cd);return this['channel'][_0x8a1e('0xb7')](_0x8a1e('0x1a7'));};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x1a8')]=function(_0x38ed30){logger[_0x8a1e('0xb0')](util['format'](_0x8a1e('0x1a9'),_0x38ed30[_0x8a1e('0xb6')]));return this['channel'][_0x8a1e('0xb7')](_0x8a1e('0x1aa'));};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x1ab')]=function(_0x5cb006){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x1ac'),_0x5cb006['label']));if(!this[_0x8a1e('0x8d')](_0x5cb006[_0x8a1e('0x1ad')])){return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](_0x8a1e('0x1ae'));}var _0x205e6e=this[_0x8a1e('0x31')][_0x8a1e('0xb3')](this,_0x5cb006['sms_account_id']);if(!_0x205e6e){return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x5cb006,'no\x20sms\x20account\x20found');}var _0x170c0d={'body':_0x5cb006[_0x8a1e('0x1af')],'phone':_0x5cb006['to']||'','SmsAccountId':_0x205e6e['id']};logger[_0x8a1e('0xef')](_0x8a1e('0x1b0'),JSON[_0x8a1e('0x7d')](_0x170c0d));this[_0x8a1e('0x34')]['sync'](this,_0x5cb006,_0x5cb006[_0x8a1e('0x1ad')]);this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util['format'](_0x8a1e('0x1b1'),_0x205e6e['name']));this['createSmsMessage'][_0x8a1e('0xb3')](this,_0x170c0d);return this[_0x8a1e('0x35')]['noop'](_0x8a1e('0x1b2'));};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x1b3')]=function(_0x474fd1){logger['info'](util['format'](_0x8a1e('0x1b4'),_0x474fd1['label']));if(!this[_0x8a1e('0x8d')](_0x474fd1[_0x8a1e('0xe6')])){return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x474fd1,_0x8a1e('0x1b5'));}var _0x28f481=this[_0x8a1e('0xad')][_0x8a1e('0xb3')](this,_0x474fd1[_0x8a1e('0xe6')]);if(!_0x28f481){return this[_0x8a1e('0x35')]['error'](_0x474fd1,_0x8a1e('0xe8'));}return this[_0x8a1e('0x35')][_0x8a1e('0xeb')](_0x28f481,_0x474fd1['variable_value']);};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x1b6')]=function(_0x2955ff){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x1b7'),_0x2955ff[_0x8a1e('0xb6')]));this['channel'][_0x8a1e('0xb7')](_0x8a1e('0x1b8'));if(_0x2955ff['answer']===_0x8a1e('0x1b9')){this[_0x8a1e('0x35')]['noop'](_0x8a1e('0x1ba'));return this['channel'][_0x8a1e('0xc9')]();}return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](_0x8a1e('0x1bb'));};AGIVertices['prototype']['subproject']=function(_0x24ee1f){logger[_0x8a1e('0xb0')](util['format'](_0x8a1e('0x1bc'),_0x24ee1f['label']));if(!this[_0x8a1e('0x8d')](_0x24ee1f[_0x8a1e('0x1bd')])){return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x24ee1f,_0x8a1e('0x1be'));}var _0x4178a9=this[_0x8a1e('0x1bf')]['sync'](this,_0x24ee1f['project_id']);if(!this[_0x8a1e('0x8d')](_0x4178a9)){return this['channel'][_0x8a1e('0x2b')](_0x24ee1f,util[_0x8a1e('0xa7')](_0x8a1e('0x1c0'),_0x24ee1f[_0x8a1e('0x1bd')]));}if(_0x4178a9===this[_0x8a1e('0x35')][_0x8a1e('0x38')]){return this['channel'][_0x8a1e('0x2b')](_0x24ee1f,_0x8a1e('0x1c1'));}this[_0x8a1e('0x34')]['sync'](this,_0x24ee1f,_0x4178a9);var _0x10f5d9=this['channel'][_0x8a1e('0xb9')]('AGI',util['format'](_0x8a1e('0x1c2'),config['agi']['host']||_0x8a1e('0x1c3'),_0x4178a9,this['channel']['arg_1']));if(_0x10f5d9[_0x8a1e('0xc3')]===-0x1){return _0x10f5d9;}return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0xd4'),_0x8a1e('0x1c4'),_0x4178a9));};AGIVertices['prototype']['system']=function(_0x3b50b0){logger[_0x8a1e('0xb0')](util['format'](_0x8a1e('0x1c5'),_0x3b50b0[_0x8a1e('0xb6')]));var _0x3f3d70=this[_0x8a1e('0x64')]['sync'](this,_0x3b50b0[_0x8a1e('0xc8')]);this[_0x8a1e('0x34')][_0x8a1e('0xb3')](this,_0x3b50b0,_0x3b50b0['command']);if(this['isConfigured'](_0x3b50b0['variable_id'])){var _0x389c94=this[_0x8a1e('0xad')]['sync'](this,_0x3b50b0[_0x8a1e('0xe6')]);if(_0x389c94){this[_0x8a1e('0x35')][_0x8a1e('0xeb')](_0x389c94,_0x3f3d70);return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x3b50b0[_0x8a1e('0xc8')],_0x389c94));}}return this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x3b50b0[_0x8a1e('0xc8')]));};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x1c6')]=function(_0x595643){logger[_0x8a1e('0xb0')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x595643[_0x8a1e('0xb6')]));_0x595643[_0x8a1e('0x6a')]=_0x595643[_0x8a1e('0x6a')][_0x8a1e('0x66')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8a1e('0x8d')](_0x595643[_0x8a1e('0x68')])){return this['channel'][_0x8a1e('0xb7')](_0x8a1e('0x1c7'));}if(!this[_0x8a1e('0x8d')](_0x595643[_0x8a1e('0x6a')])){return this['channel'][_0x8a1e('0xb7')](_0x8a1e('0xb8'));}this['channel']['noop'](util['format'](_0x8a1e('0x1c8'),_0x595643[_0x8a1e('0x6a')]));var _0x584990=this['googleCloudTTS'][_0x8a1e('0xb3')](this,_0x595643);if(_0x584990){this['channel'][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0x1c9'),_0x584990));var _0x2b48c8=this[_0x8a1e('0x35')][_0x8a1e('0x109')](_0x584990);try{fs[_0x8a1e('0x10a')](_0x584990+_0x8a1e('0x129'));}catch(_0x226fc7){logger[_0x8a1e('0x2b')](_0x226fc7);}return _0x2b48c8;}return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x595643,_0x8a1e('0x1ca'));};AGIVertices['prototype'][_0x8a1e('0x1cb')]=function(_0x38b485){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x1cc'),_0x38b485[_0x8a1e('0xb6')]));_0x38b485[_0x8a1e('0x6a')]=_0x38b485[_0x8a1e('0x6a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8a1e('0x8d')](_0x38b485[_0x8a1e('0x6a')])){return this[_0x8a1e('0x35')]['noop'](_0x8a1e('0xb8'));}this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')](_0x8a1e('0x1cd'),_0x38b485['text']));var _0x165538=this['googleTTS'][_0x8a1e('0xb3')](this,_0x38b485);if(_0x165538){this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')]('Google\x20TTS\x20%s\x20file\x20created',_0x165538));var _0x15b014=this[_0x8a1e('0x35')][_0x8a1e('0x109')](_0x165538);try{fs[_0x8a1e('0x10a')](_0x165538+_0x8a1e('0x129'));}catch(_0x1377e2){logger['error'](_0x1377e2);}return _0x15b014;}return this[_0x8a1e('0x35')][_0x8a1e('0x2b')](_0x38b485,_0x8a1e('0x1ce'));};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x1cf')]=function(_0x2d3c39){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x2d3c39['label']));if(!this[_0x8a1e('0x8d')](_0x2d3c39[_0x8a1e('0x15d')])){return this[_0x8a1e('0x35')]['error'](_0x2d3c39,_0x8a1e('0x15e'));}logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')](_0x8a1e('0x165'),this[_0x8a1e('0x35')][_0x8a1e('0x39')],_0x2d3c39['findBy']));var _0x1c06ab=this['agentUnpause'][_0x8a1e('0xb3')](this,_0x2d3c39[_0x8a1e('0x15d')]);if(_0x1c06ab){logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x2d3c39[_0x8a1e('0x15d')]));this[_0x8a1e('0x35')][_0x8a1e('0xb7')](util[_0x8a1e('0xa7')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x2d3c39[_0x8a1e('0x15d')]));return{'code':0xc8,'result':_0x8a1e('0x160')};}else{logger[_0x8a1e('0xb0')](util[_0x8a1e('0xa7')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8a1e('0x35')][_0x8a1e('0x39')],_0x2d3c39[_0x8a1e('0x15d')]));this[_0x8a1e('0x35')]['noop'](util[_0x8a1e('0xa7')](_0x8a1e('0x161'),this['channel'][_0x8a1e('0x39')],_0x2d3c39['findBy']));return{'code':0xc8,'result':_0x8a1e('0x162')};}};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x1d0')]=function(_0x3eae26){logger['info'](util[_0x8a1e('0xa7')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x3eae26[_0x8a1e('0xb6')]));var _0x30fb4a=this['channel']['exec']('VOICEMAIL',[_0x3eae26['mailbox'],_0x3eae26[_0x8a1e('0x83')]]);if(_0x30fb4a[_0x8a1e('0xc3')]===-0x1){return _0x30fb4a;}return this[_0x8a1e('0x35')]['noop'](util[_0x8a1e('0xa7')]('Executed\x20command\x20%s\x20%s',_0x8a1e('0x1d1'),_0x3eae26[_0x8a1e('0x1d2')]));};AGIVertices[_0x8a1e('0x14')][_0x8a1e('0x1d3')]=function(_0x5b7dab){logger[_0x8a1e('0xb0')](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x5b7dab[_0x8a1e('0xb6')]));if(!this[_0x8a1e('0x8d')](_0x5b7dab[_0x8a1e('0xe6')])){return this[_0x8a1e('0x35')]['error'](_0x5b7dab,_0x8a1e('0x1b5'));}var _0x44d634=this['getVariable']['sync'](this,_0x5b7dab['variable_id']);if(!_0x44d634){return this[_0x8a1e('0x35')]['error'](_0x5b7dab,_0x8a1e('0xe8'));}var _0x36f0b6=this[_0x8a1e('0x35')]['getVariable'](_0x44d634);return{'code':0xc8,'result':_0x36f0b6[_0x8a1e('0xae')]?_0x36f0b6[_0x8a1e('0xae')]:'-'};};String[_0x8a1e('0x14')][_0x8a1e('0xac')]=function(_0x208470,_0x4797c9){return this[_0x8a1e('0xaa')](_0x208470)[_0x8a1e('0x1d4')](_0x4797c9);};module[_0x8a1e('0x1d5')]=AGIVertices;
\ No newline at end of file
diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js
index 9f817f3..f8e68b7 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 _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
+var _0x7bae=['stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','queue','updateAcw','uniqueid','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','destlinkedid','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','moment','../ami','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer'];(function(_0x12b359,_0x2ee638){var _0x12c15c=function(_0x36be12){while(--_0x36be12){_0x12b359['push'](_0x12b359['shift']());}};_0x12c15c(++_0x2ee638);}(_0x7bae,0x13b));var _0xe7ba=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x7bae[_0x5608a3];return _0x1ed50a;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xe7ba('0x0'));var ami=require(_0xe7ba('0x1'));var logger=require('../../../config/logger')(_0xe7ba('0x2'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xe7ba('0x3'));function Acw(_0x10908b){this[_0xe7ba('0x4')]=_0x10908b[_0xe7ba('0x4')];this[_0xe7ba('0x5')]=_0x10908b[_0xe7ba('0x5')];this[_0xe7ba('0x6')]=_0x10908b[_0xe7ba('0x6')];this[_0xe7ba('0x7')]={};ami['on'](_0xe7ba('0x8'),this[_0xe7ba('0x9')][_0xe7ba('0xa')](this));ami['on'](_0xe7ba('0xb'),this[_0xe7ba('0xc')]['bind'](this));ami['on'](_0xe7ba('0xd'),this[_0xe7ba('0xe')][_0xe7ba('0xa')](this));ami['on'](_0xe7ba('0xf'),this[_0xe7ba('0x10')][_0xe7ba('0xa')](this));ami['on'](_0xe7ba('0x11'),this[_0xe7ba('0x12')][_0xe7ba('0xa')](this));ami['on']('blindtransfer',this[_0xe7ba('0x13')]['bind'](this));ami['on'](_0xe7ba('0x14'),this[_0xe7ba('0x15')][_0xe7ba('0xa')](this));}function getDiff(_0x17e4e6){var _0x15d018=moment()[_0xe7ba('0x16')](0x0);var _0x561dbb=moment(_0x17e4e6)['milliseconds'](0x0);return _0x15d018[_0xe7ba('0x17')](_0x561dbb,_0xe7ba('0x18'));}Acw[_0xe7ba('0x19')]['startAcw']=function(_0x4390e3){try{var _0x4b20fd=this;var _0x590bab=this['channels'][_0x4390e3][_0xe7ba('0x1a')];var _0x4e87f5=this[_0xe7ba('0x7')][_0x4390e3]['queue'];var _0x4e3021=this['voiceQueues'][_0x4e87f5];var _0x3f326a=![];var _0x30086c=_0xe7ba('0x1b');if(_0x4e3021[_0xe7ba('0x1c')]){if(_0x4e3021[_0xe7ba('0x1d')]['name']){_0x3f326a=!![];_0x30086c=_0x4e3021[_0xe7ba('0x1d')][_0xe7ba('0x1e')];}}ami[_0xe7ba('0x1f')]({'action':_0xe7ba('0x20'),'interface':_0x590bab,'paused':!![],'reason':_0x30086c})['then'](function(_0x1076c5){if(_0x4b20fd[_0xe7ba('0x5')][_0x590bab]){return RpcUser['getAgent'](_0x4b20fd[_0xe7ba('0x5')][_0x590bab]['id'])[_0xe7ba('0x21')](function(_0x27c882){if(_0x27c882&&!_0x27c882[_0xe7ba('0x22')]){logger[_0xe7ba('0x23')](_0xe7ba('0x24'),_0x4390e3,_0x590bab,_0x4e87f5);var _0x293b14=_0x4b20fd[_0xe7ba('0x7')][_0x4390e3][_0xe7ba('0x25')]&&_0x4b20fd[_0xe7ba('0x7')][_0x4390e3]['destlinkedid']?_0x4b20fd['channels'][_0x4390e3]['destlinkedid']:_0x4390e3;return RpcUser['savePause'](_0x4b20fd[_0xe7ba('0x5')][_0x590bab],_0x30086c,_0x293b14)['then'](function(_0x4ecc0d){if(!_0x3f326a){_0x4b20fd['timers'][_0x590bab]={};logger[_0xe7ba('0x23')](_0xe7ba('0x26'),_0x4390e3,_0x4b20fd[_0xe7ba('0x4')][_0x4e87f5][_0xe7ba('0x27')],_0x590bab,_0x4e87f5);_0x4b20fd[_0xe7ba('0x6')][_0x590bab][_0xe7ba('0x28')]=setTimeout(_0x4b20fd[_0xe7ba('0x29')][_0xe7ba('0xa')](_0x4b20fd,_0x590bab),_0x4b20fd['voiceQueues'][_0x4e87f5][_0xe7ba('0x27')]*0x3e8);_0x4b20fd['timers'][_0x590bab][_0xe7ba('0x2a')]=moment()[_0xe7ba('0x2b')](_0xe7ba('0x2c'));_0x4b20fd['timers'][_0x590bab]['uniqueid']=_0x4390e3;_0x4b20fd[_0xe7ba('0x6')][_0x590bab][_0xe7ba('0x2d')]=_0x4e87f5;_0x4b20fd[_0xe7ba('0x6')][_0x590bab][_0xe7ba('0x2e')]=function(){var _0x268308=getDiff(_0x4b20fd['timers'][_0x590bab][_0xe7ba('0x2a')]);clearTimeout(_0x4b20fd[_0xe7ba('0x6')][_0x590bab]['timer']);_0x4b20fd[_0xe7ba('0x6')][_0x590bab]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x268308},_0x4b20fd[_0xe7ba('0x6')][_0x590bab][_0xe7ba('0x2f')],_0x590bab)[_0xe7ba('0x21')](function(_0x52f90e){logger[_0xe7ba('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x4390e3,_0x268308,_0x52f90e);})[_0xe7ba('0x30')](function(_0x343cd2){logger[_0xe7ba('0x31')](_0xe7ba('0x32'),_0x4390e3,_0x343cd2);});delete _0x4b20fd[_0xe7ba('0x6')][_0x590bab];};}});}else{logger['info'](_0xe7ba('0x33'),_0x4390e3,_0x590bab,_0x4e87f5);}});}})[_0xe7ba('0x30')](function(_0x4baf97){logger[_0xe7ba('0x31')](_0xe7ba('0x26'),_0x4390e3,_0x4b20fd[_0xe7ba('0x4')][_0x4e87f5]['acwTimeout'],_0x590bab,_0x4e87f5);})[_0xe7ba('0x34')](function(){delete _0x4b20fd[_0xe7ba('0x7')][_0x4390e3];});}catch(_0x5db8ab){logger[_0xe7ba('0x31')](_0xe7ba('0x35'),_0x5db8ab[_0xe7ba('0x36')]);}};Acw['prototype'][_0xe7ba('0x29')]=function(_0x43b313){try{var _0x575f4b=this;if(_0x575f4b[_0xe7ba('0x6')][_0x43b313]){_0x575f4b[_0xe7ba('0x6')][_0x43b313][_0xe7ba('0x28')]=![];var _0x582833=_0x575f4b['timers'][_0x43b313][_0xe7ba('0x2f')];var _0x2ebb27=_0x575f4b[_0xe7ba('0x6')][_0x43b313][_0xe7ba('0x2d')];var _0x3581ef=_0x575f4b['voiceQueues'][_0x2ebb27][_0xe7ba('0x27')];logger[_0xe7ba('0x23')](_0xe7ba('0x37'),_0x43b313);RpcUser[_0xe7ba('0x38')](this['agents'][_0x43b313]);RpcVoiceAgentReport[_0xe7ba('0x39')]({'acwtime':_0x3581ef,'agentacw':!![]},_0x582833,_0x43b313)[_0xe7ba('0x21')](function(_0x46e31a){logger[_0xe7ba('0x23')](_0xe7ba('0x3a'),_0x582833,_0x3581ef,_0x46e31a);})[_0xe7ba('0x30')](function(_0x124cc4){logger['error'](_0xe7ba('0x32'),_0x582833,_0x124cc4);});}else{logger[_0xe7ba('0x31')](_0xe7ba('0x3b'),_0x43b313);if(_0x575f4b[_0xe7ba('0x6')]){logger[_0xe7ba('0x23')](_0xe7ba('0x3c'),JSON[_0xe7ba('0x3d')](_0x575f4b[_0xe7ba('0x6')]));}}}catch(_0x39d903){logger['error'](_0xe7ba('0x3e'),_0x39d903[_0xe7ba('0x36')]);}};Acw['prototype']['syncAgentConnect']=function(_0x32053d){try{if(this[_0xe7ba('0x4')][_0x32053d[_0xe7ba('0x2d')]]&&(this['voiceQueues'][_0x32053d[_0xe7ba('0x2d')]][_0xe7ba('0x2')]||this[_0xe7ba('0x4')][_0x32053d[_0xe7ba('0x2d')]][_0xe7ba('0x1c')])){if(this['agents'][_0x32053d[_0xe7ba('0x1a')]]){this['channels'][_0x32053d[_0xe7ba('0x2f')]]={'queue':_0x32053d[_0xe7ba('0x2d')],'interface':_0x32053d[_0xe7ba('0x1a')],'destlinkedid':_0x32053d[_0xe7ba('0x3f')]};}}}catch(_0x3053a4){logger[_0xe7ba('0x31')](_0xe7ba('0x40'),_0x3053a4[_0xe7ba('0x36')]);}};Acw['prototype'][_0xe7ba('0x15')]=function(_0x4178b9){try{if(this[_0xe7ba('0x4')][_0x4178b9[_0xe7ba('0x2d')]]&&(this[_0xe7ba('0x4')][_0x4178b9[_0xe7ba('0x2d')]][_0xe7ba('0x2')]||this[_0xe7ba('0x4')][_0x4178b9[_0xe7ba('0x2d')]][_0xe7ba('0x1c')])){if(this['agents'][_0x4178b9[_0xe7ba('0x1a')]]){this['channels'][_0x4178b9[_0xe7ba('0x2f')]]={'queue':_0x4178b9[_0xe7ba('0x2d')],'interface':_0x4178b9[_0xe7ba('0x1a')]};}}}catch(_0x15177c){logger[_0xe7ba('0x31')](_0xe7ba('0x41'),_0x15177c['message']);}};Acw[_0xe7ba('0x19')][_0xe7ba('0xc')]=function(_0x3f17ed){try{if(this[_0xe7ba('0x7')][_0x3f17ed[_0xe7ba('0x2f')]]&&_[_0xe7ba('0x42')](this[_0xe7ba('0x7')][_0x3f17ed[_0xe7ba('0x2f')]][_0xe7ba('0x25')])){logger[_0xe7ba('0x23')](_0xe7ba('0x43'),_0x3f17ed['uniqueid']);this[_0xe7ba('0x44')](_0x3f17ed[_0xe7ba('0x2f')]);}else if(this[_0xe7ba('0x7')][_0x3f17ed[_0xe7ba('0x45')]]&&_[_0xe7ba('0x42')](this[_0xe7ba('0x7')][_0x3f17ed['linkedid']][_0xe7ba('0x25')])){logger[_0xe7ba('0x23')]('[%s][HANGUP:LINKEDID]',_0x3f17ed[_0xe7ba('0x45')]);this[_0xe7ba('0x44')](_0x3f17ed[_0xe7ba('0x45')]);}}catch(_0x1b9a05){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x1b9a05[_0xe7ba('0x36')]);}};Acw[_0xe7ba('0x19')][_0xe7ba('0xe')]=function(_0x5af106){try{if(this[_0xe7ba('0x7')][_0x5af106[_0xe7ba('0x2f')]]&&this[_0xe7ba('0x7')][_0x5af106[_0xe7ba('0x2f')]][_0xe7ba('0x25')]){logger[_0xe7ba('0x23')](_0xe7ba('0x46'),_0x5af106['uniqueid']);this[_0xe7ba('0x44')](_0x5af106[_0xe7ba('0x2f')]);}else if(this[_0xe7ba('0x7')][_0x5af106['linkedid']]&&this[_0xe7ba('0x7')][_0x5af106[_0xe7ba('0x45')]]['attended']){logger[_0xe7ba('0x23')](_0xe7ba('0x47'),_0x5af106['linkedid']);this[_0xe7ba('0x44')](_0x5af106['linkedid']);}}catch(_0xe2cbba){logger[_0xe7ba('0x31')](_0xe7ba('0x48'),_0xe2cbba['message']);}};Acw[_0xe7ba('0x19')][_0xe7ba('0x12')]=function(_0x314549){try{if(!_[_0xe7ba('0x49')](this[_0xe7ba('0x7')][_0x314549['transfereeuniqueid']])){this[_0xe7ba('0x44')](_0x314549[_0xe7ba('0x4a')]);if(this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4b')]]){this[_0xe7ba('0x7')][_0x314549['secondtransfereruniqueid']][_0xe7ba('0x25')]=!![];this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4c')]]=this[_0xe7ba('0x7')][_0x314549['secondtransfereruniqueid']];delete this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4b')]];}}else if(!_[_0xe7ba('0x49')](this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4c')]])){this[_0xe7ba('0x44')](_0x314549['transfertargetuniqueid']);if(this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4d')]]){this[_0xe7ba('0x7')][_0x314549['origtransfereruniqueid']][_0xe7ba('0x25')]=!![];this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4a')]]=this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4d')]];delete this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4d')]];}}}catch(_0x3351d5){logger[_0xe7ba('0x31')](_0xe7ba('0x4e'),_0x3351d5[_0xe7ba('0x36')]);}};Acw[_0xe7ba('0x19')]['syncBlindTransfer']=function(_0x131331){try{if(this[_0xe7ba('0x7')][_0x131331[_0xe7ba('0x4f')]]){logger['info'](_0xe7ba('0x50'),JSON['stringify'](_0x131331[_0xe7ba('0x4f')]));this[_0xe7ba('0x44')](_0x131331[_0xe7ba('0x4f')]);}else if(this['channels'][_0x131331['transfererlinkedid']]){logger[_0xe7ba('0x23')](_0xe7ba('0x51'),JSON[_0xe7ba('0x3d')](_0x131331['transfererlinkedid']));this[_0xe7ba('0x44')](_0x131331[_0xe7ba('0x52')]);}}catch(_0x3fe82a){logger[_0xe7ba('0x31')](_0xe7ba('0x53'),_0x3fe82a['message']);}};Acw[_0xe7ba('0x19')][_0xe7ba('0x10')]=function(_0x70ce9c){try{if(this['voiceQueues'][_0x70ce9c[_0xe7ba('0x2d')]]&&this[_0xe7ba('0x4')][_0x70ce9c[_0xe7ba('0x2d')]][_0xe7ba('0x54')]===_0xe7ba('0x55')){if(this[_0xe7ba('0x5')][_0x70ce9c[_0xe7ba('0x1a')]]){logger[_0xe7ba('0x23')](_0xe7ba('0x56'),_0x70ce9c[_0xe7ba('0x2f')],_0x70ce9c['interface'],_0x70ce9c[_0xe7ba('0x2d')]);return RpcUser[_0xe7ba('0x57')](this[_0xe7ba('0x5')][_0x70ce9c[_0xe7ba('0x1a')]],'Auto-Pause',_0x70ce9c['uniqueid']);}}}catch(_0x103eb8){logger[_0xe7ba('0x31')](_0xe7ba('0x58'),_0x103eb8['message']);}};module['exports']=Acw;
\ No newline at end of file
diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js
index d346ead..f907f0a 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 _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
+var _0x3e5a=['shutdown','info','resolve','then','actionSipPeerStatus','actionQueueSummary','log','asterisk-manager','bluebird','moment','util','../../config/logger','ami','../../config/environment','asterisk','username','password','keepConnected','action','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','Action','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionCoreShowChannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','port','once','close','connect'];(function(_0x30e01f,_0x4b4c42){var _0x54b90e=function(_0x503bec){while(--_0x503bec){_0x30e01f['push'](_0x30e01f['shift']());}};_0x54b90e(++_0x4b4c42);}(_0x3e5a,0x1db));var _0xa3e5=function(_0x4a9733,_0x1929ba){_0x4a9733=_0x4a9733-0x0;var _0x4753d4=_0x3e5a[_0x4a9733];return _0x4753d4;};'use strict';var Manager=require(_0xa3e5('0x0'));var BPromise=require(_0xa3e5('0x1'));var moment=require(_0xa3e5('0x2'));var util=require(_0xa3e5('0x3'));var _=require('lodash');var logger=require(_0xa3e5('0x4'))(_0xa3e5('0x5'));var config=require(_0xa3e5('0x6'));var ami=new Manager(config['asterisk']['port'],config['asterisk']['ip'],config[_0xa3e5('0x7')][_0xa3e5('0x8')],config[_0xa3e5('0x7')][_0xa3e5('0x9')],!![]);ami[_0xa3e5('0xa')]();ami['Action']=BPromise['promisify'](ami[_0xa3e5('0xb')]);function error(_0x1d5134){logger[_0xa3e5('0xc')](util[_0xa3e5('0xd')](_0xa3e5('0xe'),config[_0xa3e5('0x7')]['username'],config[_0xa3e5('0x7')]['ip'],config[_0xa3e5('0x7')]['port'],util[_0xa3e5('0xf')](_0x1d5134,![],null)));}function close(){logger[_0xa3e5('0xc')](util[_0xa3e5('0xd')](_0xa3e5('0x10'),config[_0xa3e5('0x7')][_0xa3e5('0x8')],config[_0xa3e5('0x7')]['ip'],config['asterisk']['port']));}ami[_0xa3e5('0x11')]=function(){return function(){return ami[_0xa3e5('0x12')]({'action':_0xa3e5('0x13')});};};ami[_0xa3e5('0x14')]=function(){return function(){return ami['Action']({'action':_0xa3e5('0x15')});};};ami['actionSipPeerStatus']=function(){return function(){return ami['Action']({'action':_0xa3e5('0x16')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xa3e5('0x12')]({'action':'queuesummary'});};};ami[_0xa3e5('0x17')]=function(){return function(){return ami[_0xa3e5('0x12')]({'action':'coreshowchannels'});};};function connect(_0x4321a2){logger['info'](util[_0xa3e5('0xd')](_0xa3e5('0x18'),config['asterisk'][_0xa3e5('0x8')],config[_0xa3e5('0x7')]['ip'],config[_0xa3e5('0x7')][_0xa3e5('0x19')]));ami['once'](_0xa3e5('0xc'),error);ami[_0xa3e5('0x1a')](_0xa3e5('0x1b'),close);}ami['on'](_0xa3e5('0x1c'),connect);ami['on'](_0xa3e5('0x1d'),function(_0x198f4d){logger['info'](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa3e5('0x7')]['username'],config[_0xa3e5('0x7')]['ip'],config[_0xa3e5('0x7')][_0xa3e5('0x19')],util[_0xa3e5('0xf')](_0x198f4d,![],null)));});ami['on']('fullybooted',function(_0x1a21f6){logger[_0xa3e5('0x1e')](util[_0xa3e5('0xd')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xa3e5('0x7')]['username'],config[_0xa3e5('0x7')]['ip'],config[_0xa3e5('0x7')]['port']));return BPromise[_0xa3e5('0x1f')]()[_0xa3e5('0x20')](ami['actionSipShowRegistry']())[_0xa3e5('0x20')](ami[_0xa3e5('0x14')]())['then'](ami[_0xa3e5('0x21')]())[_0xa3e5('0x20')](ami[_0xa3e5('0x22')]())['then'](ami[_0xa3e5('0x17')]())['catch'](function(_0x1e0aae){console[_0xa3e5('0x23')](_0x1e0aae);});});ami['once'](_0xa3e5('0xc'),error);ami[_0xa3e5('0x1a')](_0xa3e5('0x1b'),close);module['exports']=ami;
\ No newline at end of file
diff --git a/server/services/ami/client.js b/server/services/ami/client.js
index d986ac4..31c4635 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 _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
+var _0xef4e=['memberReport','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','ami','client','Request','request','rpc'];(function(_0x19c8ea,_0x22b480){var _0x55a71e=function(_0x28bbc0){while(--_0x28bbc0){_0x19c8ea['push'](_0x19c8ea['shift']());}};_0x55a71e(++_0x22b480);}(_0xef4e,0xa0));var _0xeef4=function(_0x3cdcfc,_0x5c259b){_0x3cdcfc=_0x3cdcfc-0x0;var _0x4b7c43=_0xef4e[_0x3cdcfc];return _0x4b7c43;};'use strict';var jayson=require(_0xeef4('0x0'));var BPromise=require(_0xeef4('0x1'));var logger=require(_0xeef4('0x2'))(_0xeef4('0x3'));var client=jayson[_0xeef4('0x4')]['http']({'port':0x2329});client[_0xeef4('0x5')]=function(_0x3cbefc,_0x5a651c){return new BPromise(function(_0x387d7f,_0x3c0f2b){return client[_0xeef4('0x6')](_0x3cbefc,_0x5a651c)['then'](function(_0x393d33){logger['debug'](_0xeef4('0x7'),_0xeef4('0x8'),_0x3cbefc,_0x5a651c,_0x393d33);if(_0x393d33['error']){logger['error'](_0xeef4('0x7'),_0xeef4('0x8'),_0x3cbefc,_0x393d33[_0xeef4('0x9')][_0xeef4('0xa')],_0x5a651c);return _0x3c0f2b(_0x393d33[_0xeef4('0x9')][_0xeef4('0xa')]);}else{return _0x387d7f(_0x393d33[_0xeef4('0xb')]);}})[_0xeef4('0xc')](function(_0x4567cd){logger[_0xeef4('0x9')](_0xeef4('0x7'),_0xeef4('0x8'),_0x3cbefc,_0x4567cd,_0x5a651c);return _0x3c0f2b(_0x4567cd);});});};module[_0xeef4('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 dd16696..e5bf6bf 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 _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
+var _0x7275=['voiceQueue','name','phone','firstName','Contact','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','substring','exports','util','lodash','moment','isNil','string'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7275,0x143));var _0x5727=function(_0x2ddad8,_0x11d8a9){_0x2ddad8=_0x2ddad8-0x0;var _0x2816d7=_0x7275[_0x2ddad8];return _0x2816d7;};'use strict';var util=require(_0x5727('0x0'));var _=require(_0x5727('0x1'));var moment=require(_0x5727('0x2'));function checkNameSurname(_0x517248,_0x3078c5,_0x49a209){var _0x2b1086='';if(!_[_0x5727('0x3')](_0x3078c5)&&'string'===typeof _0x3078c5){_0x2b1086+=_0x3078c5;}if(!_[_0x5727('0x3')](_0x49a209)&&_0x5727('0x4')===typeof _0x49a209){_0x2b1086+='\x20'+_0x49a209;}if(_0x2b1086!==''){return _0x2b1086;}return _0x517248;}function Action(_0x5b878c,_0x4c509e,_0x4872ba){this[_0x5727('0x5')]=_0x5b878c;this['uniqueid']=_0x4872ba||undefined;this[_0x5727('0x6')]=checkNameSurname(_0x4c509e['Contact'][_0x5727('0x7')],_0x4c509e['Contact'][_0x5727('0x8')],_0x4c509e[_0x5727('0x9')]['lastName']);this[_0x5727('0xa')]=_0x4c509e[_0x5727('0x9')]['phone'];this[_0x5727('0xb')]=_0x5b878c[_0x5727('0x6')];this['active']=_0x4c509e[_0x5727('0xc')]||![];this[_0x5727('0xd')]=_0x5b878c[_0x5727('0xd')];this[_0x5727('0xe')]=_0x5b878c[_0x5727('0xe')]||0x3;this[_0x5727('0xf')]=_0x4c509e['scheduledat'];this[_0x5727('0x10')]=_0x4c509e[_0x5727('0x10')];this[_0x5727('0x11')]=_0x4c509e[_0x5727('0x11')];this[_0x5727('0x12')]=_0x4c509e[_0x5727('0x12')];this[_0x5727('0x13')]=_0x4c509e['countnosuchnumberretry'];this[_0x5727('0x14')]=_0x4c509e[_0x5727('0x14')];this[_0x5727('0x15')]=_0x4c509e[_0x5727('0x15')];this[_0x5727('0x16')]=_0x4c509e[_0x5727('0x16')];this[_0x5727('0x17')]=_0x4c509e['countagentrejectretry'];this[_0x5727('0x18')]=_0x4c509e['ContactId'];this[_0x5727('0x19')]=_0x4c509e[_0x5727('0x19')];this['UserId']=_0x4c509e[_0x5727('0x1a')];this[_0x5727('0x1b')]=_0x4c509e[_0x5727('0x1b')];this[_0x5727('0x1c')]=_0x4c509e[_0x5727('0x1c')];this['idHopper']=_0x4c509e['id'];this['ContactFirstName']=_0x4c509e[_0x5727('0x9')][_0x5727('0x8')]||'';this[_0x5727('0x1d')]=moment()[_0x5727('0x1e')](_0x5727('0x1f'));this[_0x5727('0x20')]=_0x4c509e[_0x5727('0x20')];this['callbackuniqueid']=_0x4c509e[_0x5727('0x21')];this[_0x5727('0x22')]=_0x4c509e[_0x5727('0x22')];this['recallme']=_0x4c509e[_0x5727('0x23')];this[_0x5727('0x24')]='';this[_0x5727('0x25')]='';}Action['prototype']['getCaller']=function(){return util[_0x5727('0x1e')](_0x5727('0x26'),this['name'],this[_0x5727('0x5')]['dialCutDigit']>0x0?this[_0x5727('0xa')][_0x5727('0x27')](this['voiceQueue']['dialCutDigit']):this[_0x5727('0xa')]);};Action['prototype']['getQueue']=function(){return this[_0x5727('0xb')];};module[_0x5727('0x28')]=Action;
\ No newline at end of file
diff --git a/server/services/ami/dialer/additionalPhone.js b/server/services/ami/dialer/additionalPhone.js
index 7dec602..cc94d1d 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 _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
+var _0x8df4=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','number','starttime','responsetime','endtime','ringtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8df4,0x18d));var _0x48df=function(_0x393d69,_0x3a8c83){_0x393d69=_0x393d69-0x0;var _0x3cee37=_0x8df4[_0x393d69];return _0x3cee37;};'use strict';var util=require(_0x48df('0x0'));var _=require(_0x48df('0x1'));var moment=require('moment');function getSeconds(_0x12162a,_0x3fd5f3){var _0x39ef66=moment(_0x12162a)[_0x48df('0x2')](0x0);var _0xa5e1c4=moment(_0x3fd5f3)[_0x48df('0x2')](0x0);return _0x39ef66[_0x48df('0x3')](_0xa5e1c4,_0x48df('0x4'));}function AdditionalPhone(_0x2ad2ef){this['uniqueid']=_0x2ad2ef['uniqueid'];this[_0x48df('0x5')]=_0x2ad2ef['scheduledat']||undefined;this[_0x48df('0x6')]=_0x2ad2ef[_0x48df('0x6')];this['campaigntype']=_0x2ad2ef[_0x48df('0x6')]==='outbound'?_0x48df('0x7'):_0x2ad2ef[_0x48df('0x6')];this['countbusyretry']=_0x2ad2ef[_0x48df('0x8')];this['countcongestionretry']=_0x2ad2ef[_0x48df('0x9')];this[_0x48df('0xa')]=_0x2ad2ef[_0x48df('0xa')];this['countglobal']=_0x2ad2ef[_0x48df('0x8')]+_0x2ad2ef['countcongestionretry']+_0x2ad2ef[_0x48df('0xa')]+_0x2ad2ef[_0x48df('0xb')]+_0x2ad2ef[_0x48df('0xc')]+_0x2ad2ef['countabandonedretry']+_0x2ad2ef['countmachineretry']+_0x2ad2ef['countagentrejectretry'];this[_0x48df('0xb')]=_0x2ad2ef[_0x48df('0xb')];this[_0x48df('0xc')]=_0x2ad2ef['countdropretry'];this[_0x48df('0xd')]=_0x2ad2ef['countabandonedretry'];this[_0x48df('0xe')]=_0x2ad2ef[_0x48df('0xe')];this['countagentrejectretry']=_0x2ad2ef[_0x48df('0xf')];this[_0x48df('0x7')]=_0x2ad2ef[_0x48df('0x7')];this[_0x48df('0x10')]=_0x2ad2ef['name'];this['calleridnum']=_0x2ad2ef[_0x48df('0x11')];this[_0x48df('0x12')]=_0x2ad2ef[_0x48df('0x12')];this[_0x48df('0x13')]=_0x2ad2ef[_0x48df('0x13')];this[_0x48df('0x14')]=_0x2ad2ef[_0x48df('0x13')];this[_0x48df('0x15')]=getSeconds(_0x2ad2ef['responsetime'],_0x2ad2ef[_0x48df('0x12')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0x48df('0x16')]=_0x2ad2ef[_0x48df('0x16')];this[_0x48df('0x17')]=_0x2ad2ef['callbackuniqueid'];this[_0x48df('0x18')]=_0x2ad2ef[_0x48df('0x18')];this[_0x48df('0x19')]=_0x2ad2ef[_0x48df('0x19')];this[_0x48df('0x1a')]=_0x2ad2ef[_0x48df('0x1a')];this[_0x48df('0x1b')]=_0x2ad2ef[_0x48df('0x1b')];this[_0x48df('0x1c')]=_0x2ad2ef[_0x48df('0x1c')];this[_0x48df('0x1d')]=_0x2ad2ef['VoiceQueueId'];this[_0x48df('0x1e')]=_0x2ad2ef[_0x48df('0x1e')];this[_0x48df('0x1f')]=_0x2ad2ef[_0x48df('0x1f')]||'';this[_0x48df('0x20')]=_0x2ad2ef[_0x48df('0x20')]||'';}module[_0x48df('0x21')]=History;
\ No newline at end of file
diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js
index a7d9840..81ea69c 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 _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
+var _0x2807=['countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x144929,_0x35767f){var _0x118e61=function(_0x5b5244){while(--_0x5b5244){_0x144929['push'](_0x144929['shift']());}};_0x118e61(++_0x35767f);}(_0x2807,0x1d8));var _0x7280=function(_0x359673,_0x595545){_0x359673=_0x359673-0x0;var _0x48c2ee=_0x2807[_0x359673];return _0x48c2ee;};'use strict';var util=require(_0x7280('0x0'));var _=require(_0x7280('0x1'));var moment=require(_0x7280('0x2'));function getSeconds(_0xf37c7b,_0x4af4f7){var _0x1a04a2=moment(_0xf37c7b)[_0x7280('0x3')](0x0);var _0x279de2=moment(_0x4af4f7)['milliseconds'](0x0);return _0x1a04a2['diff'](_0x279de2,_0x7280('0x4'));}function AgentComplete(_0x5f33a3,_0x265c91){this[_0x7280('0x5')]=0x4;this[_0x7280('0x6')]=_0x7280('0x7');this[_0x7280('0x8')]=_0x5f33a3[_0x7280('0x8')];this[_0x7280('0x9')]=_0x5f33a3[_0x7280('0x9')];this[_0x7280('0xa')]=_0x5f33a3[_0x7280('0x9')]===_0x7280('0xb')?'queue':_0x5f33a3[_0x7280('0x9')];this[_0x7280('0xc')]=_0x5f33a3[_0x7280('0xc')];this['countcongestionretry']=_0x5f33a3[_0x7280('0xd')];this[_0x7280('0xe')]=_0x5f33a3[_0x7280('0xe')];this[_0x7280('0xf')]=_0x5f33a3[_0x7280('0xc')]+_0x5f33a3[_0x7280('0xd')]+_0x5f33a3[_0x7280('0xe')]+_0x5f33a3[_0x7280('0x10')]+_0x5f33a3[_0x7280('0x11')]+_0x5f33a3[_0x7280('0x12')]+_0x5f33a3[_0x7280('0x13')]+_0x5f33a3[_0x7280('0x14')];this[_0x7280('0x10')]=_0x5f33a3[_0x7280('0x10')];this['countdropretry']=_0x5f33a3[_0x7280('0x11')];this[_0x7280('0x12')]=_0x5f33a3[_0x7280('0x12')];this[_0x7280('0x13')]=_0x5f33a3['countmachineretry'];this[_0x7280('0x14')]=_0x5f33a3[_0x7280('0x14')];this[_0x7280('0x15')]=_0x265c91[_0x7280('0x15')];this[_0x7280('0x16')]=_0x5f33a3[_0x7280('0x17')];this[_0x7280('0x18')]=_0x5f33a3[_0x7280('0x19')];this[_0x7280('0x1a')]=_0x5f33a3['starttime'];this[_0x7280('0x1b')]=_0x5f33a3[_0x7280('0x1b')];this[_0x7280('0x1c')]=_0x5f33a3[_0x7280('0x1c')];this[_0x7280('0x1d')]=moment()[_0x7280('0x1e')](_0x7280('0x1f'));this[_0x7280('0x20')]=getSeconds(_0x5f33a3[_0x7280('0x1b')],_0x5f33a3[_0x7280('0x1a')]);this[_0x7280('0x21')]=getSeconds(_0x5f33a3[_0x7280('0x1c')],_0x5f33a3[_0x7280('0x1b')]);this[_0x7280('0x22')]=getSeconds(this[_0x7280('0x1d')],_0x5f33a3['answertime']);this[_0x7280('0x23')]=_0x265c91['queue'];this['membername']=_0x265c91[_0x7280('0x24')];this['reason']=_0x265c91[_0x7280('0x25')];this[_0x7280('0x26')]=_0x5f33a3[_0x7280('0x26')];this[_0x7280('0x27')]=_0x5f33a3['callbackuniqueid'];this[_0x7280('0x28')]=_0x5f33a3['callbackat'];this['recallme']=_0x5f33a3['recallme'];this[_0x7280('0x29')]=_0x5f33a3[_0x7280('0x29')];this[_0x7280('0x2a')]=_0x5f33a3[_0x7280('0x2a')];this['UserId']=_0x5f33a3[_0x7280('0x2b')];this['VoiceQueueId']=_0x5f33a3[_0x7280('0x2c')];this['CampaignId']=_0x5f33a3[_0x7280('0x2d')];this[_0x7280('0x2e')]=_0x5f33a3['originatecalleridnum']||'';this[_0x7280('0x2f')]=_0x5f33a3[_0x7280('0x2f')]||'';}module[_0x7280('0x30')]=AgentComplete;
\ No newline at end of file
diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js
index f5fa954..87fc866 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 _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
+var _0xac7d=['starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','uniqueid','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum'];(function(_0x39609a,_0x28a563){var _0xecd92=function(_0x57241a){while(--_0x57241a){_0x39609a['push'](_0x39609a['shift']());}};_0xecd92(++_0x28a563);}(_0xac7d,0x1cb));var _0xdac7=function(_0xda7530,_0xd4f7db){_0xda7530=_0xda7530-0x0;var _0x27e498=_0xac7d[_0xda7530];return _0x27e498;};'use strict';var util=require(_0xdac7('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x599971,_0x5d7f60){var _0x586bb2=moment(_0x599971)[_0xdac7('0x1')](0x0);var _0x13fa23=moment(_0x5d7f60)[_0xdac7('0x1')](0x0);return _0x586bb2[_0xdac7('0x2')](_0x13fa23,'seconds');}function Final(_0x75333e){this[_0xdac7('0x3')]=_0x75333e[_0xdac7('0x3')];this['scheduledat']=_0x75333e['scheduledat'];this[_0xdac7('0x4')]=_0x75333e['type'];this['campaigntype']=_0x75333e[_0xdac7('0x4')]===_0xdac7('0x5')?'queue':_0x75333e[_0xdac7('0x4')];this[_0xdac7('0x6')]=_0x75333e['countbusyretry'];this[_0xdac7('0x7')]=_0x75333e['countcongestionretry'];this['countnoanswerretry']=_0x75333e[_0xdac7('0x8')];this['countglobal']=_0x75333e[_0xdac7('0x6')]+_0x75333e[_0xdac7('0x7')]+_0x75333e[_0xdac7('0x8')]+_0x75333e[_0xdac7('0x9')]+_0x75333e[_0xdac7('0xa')]+_0x75333e[_0xdac7('0xb')]+_0x75333e[_0xdac7('0xc')]+_0x75333e[_0xdac7('0xd')];this[_0xdac7('0x9')]=_0x75333e[_0xdac7('0x9')];this[_0xdac7('0xa')]=_0x75333e['countdropretry'];this[_0xdac7('0xb')]=_0x75333e['countabandonedretry'];this['countmachineretry']=_0x75333e[_0xdac7('0xc')];this[_0xdac7('0xd')]=_0x75333e[_0xdac7('0xd')];this[_0xdac7('0xe')]=_0x75333e['queue'];this[_0xdac7('0xf')]=_0x75333e['calleridname'];this['calleridnum']=_0x75333e[_0xdac7('0x10')];this['starttime']=_0x75333e[_0xdac7('0x11')];this[_0xdac7('0x12')]=_0x75333e[_0xdac7('0x12')];this['endtime']=_0x75333e[_0xdac7('0x12')];this[_0xdac7('0x13')]=_0x75333e[_0xdac7('0x13')]||0x0;this['holdtime']=_0x75333e[_0xdac7('0x14')]||0x0;this[_0xdac7('0x15')]=_0x75333e['talktime']||0x0;this[_0xdac7('0x16')]=_0x75333e[_0xdac7('0x16')];this[_0xdac7('0x17')]=_0x75333e[_0xdac7('0x17')];this[_0xdac7('0x18')]=_0x75333e[_0xdac7('0x18')];this[_0xdac7('0x19')]=_0x75333e[_0xdac7('0x19')];this[_0xdac7('0x1a')]=_0x75333e[_0xdac7('0x1a')];this[_0xdac7('0x1b')]=_0x75333e['ListId'];this[_0xdac7('0x1c')]=_0x75333e[_0xdac7('0x1c')];this['VoiceQueueId']=_0x75333e[_0xdac7('0x1d')];this[_0xdac7('0x1e')]=_0x75333e[_0xdac7('0x1e')];this[_0xdac7('0x1f')]=_0x75333e[_0xdac7('0x1f')]||'';this['originatecalleridname']=_0x75333e[_0xdac7('0x20')]||'';}module[_0xdac7('0x21')]=Final;
\ No newline at end of file
diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js
index e112cf3..9330753 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 _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
+var _0x0217=['ListId','UserId','VoiceQueueId','exports','util','lodash','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x461d52,_0x43604b){var _0x25d252=function(_0x3bdc91){while(--_0x3bdc91){_0x461d52['push'](_0x461d52['shift']());}};_0x25d252(++_0x43604b);}(_0x0217,0xac));var _0x7021=function(_0x4ea845,_0x59dc7f){_0x4ea845=_0x4ea845-0x0;var _0x9b62e5=_0x0217[_0x4ea845];return _0x9b62e5;};'use strict';var util=require(_0x7021('0x0'));var _=require(_0x7021('0x1'));var moment=require(_0x7021('0x2'));function getSeconds(_0x3ca0d1,_0x4fa7e0){var _0x57483e=moment(_0x3ca0d1)[_0x7021('0x3')](0x0);var _0x1871e2=moment(_0x4fa7e0)[_0x7021('0x3')](0x0);return _0x57483e['diff'](_0x1871e2,_0x7021('0x4'));}function Hangup(_0x1ffd87,_0x469c3a){this['state']=0x4;this['statedesc']='Answer';this['scheduledat']=_0x1ffd87[_0x7021('0x5')];this[_0x7021('0x6')]=_0x1ffd87[_0x7021('0x6')];this[_0x7021('0x7')]=_0x1ffd87['type']===_0x7021('0x8')?_0x7021('0x9'):_0x1ffd87['type'];this['countbusyretry']=_0x1ffd87['countbusyretry'];this[_0x7021('0xa')]=_0x1ffd87[_0x7021('0xa')];this[_0x7021('0xb')]=_0x1ffd87[_0x7021('0xb')];this['countglobal']=_0x1ffd87[_0x7021('0xc')]+_0x1ffd87[_0x7021('0xa')]+_0x1ffd87[_0x7021('0xb')]+_0x1ffd87[_0x7021('0xd')]+_0x1ffd87['countdropretry']+_0x1ffd87[_0x7021('0xe')]+_0x1ffd87[_0x7021('0xf')]+_0x1ffd87[_0x7021('0x10')];this['countnosuchnumberretry']=_0x1ffd87['countnosuchnumberretry'];this[_0x7021('0x11')]=_0x1ffd87[_0x7021('0x11')];this[_0x7021('0xe')]=_0x1ffd87[_0x7021('0xe')];this['countmachineretry']=_0x1ffd87[_0x7021('0xf')];this[_0x7021('0x10')]=_0x1ffd87[_0x7021('0x10')];this[_0x7021('0x12')]=_0x469c3a[_0x7021('0x12')];this[_0x7021('0x13')]=_0x1ffd87['name'];this[_0x7021('0x14')]=_0x1ffd87[_0x7021('0x15')];this['starttime']=_0x1ffd87[_0x7021('0x16')];this[_0x7021('0x17')]=_0x1ffd87[_0x7021('0x17')];this[_0x7021('0x18')]=moment()[_0x7021('0x19')](_0x7021('0x1a'));this[_0x7021('0x1b')]=getSeconds(_0x1ffd87['responsetime'],_0x1ffd87[_0x7021('0x16')]);this[_0x7021('0x1c')]=0x0;this['talktime']=getSeconds(this[_0x7021('0x18')],_0x1ffd87['responsetime']);this[_0x7021('0x9')]=_0x1ffd87[_0x7021('0x9')];this[_0x7021('0x1d')]=_0x7021('0x1e');this[_0x7021('0x1f')]=_0x469c3a[_0x7021('0x20')];this[_0x7021('0x21')]=_0x1ffd87[_0x7021('0x21')];this['callbackuniqueid']=_0x1ffd87[_0x7021('0x22')];this['callbackat']=_0x1ffd87[_0x7021('0x23')];this[_0x7021('0x24')]=_0x1ffd87[_0x7021('0x24')];this[_0x7021('0x25')]=_0x1ffd87['ContactId'];this[_0x7021('0x26')]=_0x1ffd87[_0x7021('0x26')];this[_0x7021('0x27')]=_0x1ffd87[_0x7021('0x27')];this['VoiceQueueId']=_0x1ffd87[_0x7021('0x28')];this['CampaignId']=_0x1ffd87['CampaignId'];}module[_0x7021('0x29')]=Hangup;
\ No newline at end of file
diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js
index f3bef20..b5c97cf 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 _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
+var _0x1320=['countagentrejectretry','countdropretry','queue','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry'];(function(_0x1a8cf1,_0x4a933e){var _0x23e11d=function(_0x5a8c17){while(--_0x5a8c17){_0x1a8cf1['push'](_0x1a8cf1['shift']());}};_0x23e11d(++_0x4a933e);}(_0x1320,0x128));var _0x0132=function(_0x16154c,_0x29b943){_0x16154c=_0x16154c-0x0;var _0x4a2bb8=_0x1320[_0x16154c];return _0x4a2bb8;};'use strict';var util=require(_0x0132('0x0'));var _=require(_0x0132('0x1'));var moment=require(_0x0132('0x2'));function getSeconds(_0x3f7809,_0x248c15){var _0x353545=moment(_0x3f7809)['milliseconds'](0x0);var _0x4f1267=moment(_0x248c15)[_0x0132('0x3')](0x0);return _0x353545[_0x0132('0x4')](_0x4f1267,_0x0132('0x5'));}function History(_0x1bc1f8){this[_0x0132('0x6')]=_0x1bc1f8[_0x0132('0x6')];this['scheduledat']=_0x1bc1f8[_0x0132('0x7')]||undefined;this[_0x0132('0x8')]=_0x1bc1f8['type'];this[_0x0132('0x9')]=_0x1bc1f8[_0x0132('0x8')]==='outbound'?'queue':_0x1bc1f8[_0x0132('0x8')];this[_0x0132('0xa')]=_0x1bc1f8[_0x0132('0xa')];this[_0x0132('0xb')]=_0x1bc1f8[_0x0132('0xb')];this['countnoanswerretry']=_0x1bc1f8[_0x0132('0xc')];this['countglobal']=_0x1bc1f8['countbusyretry']+_0x1bc1f8[_0x0132('0xb')]+_0x1bc1f8[_0x0132('0xc')]+_0x1bc1f8[_0x0132('0xd')]+_0x1bc1f8['countdropretry']+_0x1bc1f8[_0x0132('0xe')]+_0x1bc1f8[_0x0132('0xf')]+_0x1bc1f8[_0x0132('0x10')];this[_0x0132('0xd')]=_0x1bc1f8[_0x0132('0xd')];this[_0x0132('0x11')]=_0x1bc1f8[_0x0132('0x11')];this[_0x0132('0xe')]=_0x1bc1f8[_0x0132('0xe')];this[_0x0132('0xf')]=_0x1bc1f8[_0x0132('0xf')];this[_0x0132('0x10')]=_0x1bc1f8[_0x0132('0x10')];this[_0x0132('0x12')]=_0x1bc1f8[_0x0132('0x12')];this['calleridname']=_0x1bc1f8[_0x0132('0x13')];this[_0x0132('0x14')]=_0x1bc1f8[_0x0132('0x15')];this[_0x0132('0x16')]=_0x1bc1f8[_0x0132('0x16')];this['responsetime']=_0x1bc1f8[_0x0132('0x17')];this[_0x0132('0x18')]=_0x1bc1f8[_0x0132('0x17')];this[_0x0132('0x19')]=getSeconds(_0x1bc1f8[_0x0132('0x17')],_0x1bc1f8[_0x0132('0x16')]);this['holdtime']=0x0;this[_0x0132('0x1a')]=0x0;this[_0x0132('0x1b')]=_0x1bc1f8[_0x0132('0x1b')];this[_0x0132('0x1c')]=_0x1bc1f8[_0x0132('0x1c')];this[_0x0132('0x1d')]=_0x1bc1f8['callbackat'];this[_0x0132('0x1e')]=_0x1bc1f8['recallme'];this[_0x0132('0x1f')]=_0x1bc1f8[_0x0132('0x1f')];this[_0x0132('0x20')]=_0x1bc1f8['ListId'];this[_0x0132('0x21')]=_0x1bc1f8[_0x0132('0x21')];this[_0x0132('0x22')]=_0x1bc1f8[_0x0132('0x22')];this[_0x0132('0x23')]=_0x1bc1f8['CampaignId'];this[_0x0132('0x24')]=_0x1bc1f8[_0x0132('0x24')]||'';this['originatecalleridname']=_0x1bc1f8[_0x0132('0x25')]||'';}module[_0x0132('0x26')]=History;
\ No newline at end of file
diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js
index 082d4e9..bc06c1b 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 _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
+var _0xdbe5=['launchHandleIvr','handleIvr','syncQueueSummary','dialActive','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','substring','dialCutDigit','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','buildObj','dialNoSuchNumberMaxRetry','noanswer','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','reason\x208\x20congestion','outboundAbandonedCallsDay','dialAbandonedMaxRetry','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','erlangCalls','predictiveIntervalErlangCallsDroppedCalls','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','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(','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','dialRecallMeTimeout','Agent','run','log','Contact\x20updated','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','--------\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','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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]','lodash','bluebird','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','defaults','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./hangup','env','roundrobin','prototype','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','callerid','format','voice_queue:save','campaign:ivr:%s','campaign:save','info','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','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','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','predictiveIntervalAvgHoldtime','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','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','startProgressive','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','stack','error','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','clearZombieChannels','uniqueId','[uniqueid]','[actions]','enqueue','isNil','Action','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','notFound','saveInDb','ListId','[emptyContact][createHistory]','Success','SIP/%s','status','unmonitored','uniqueid','variable','xcally-motion-dialer','dialAMDActive','value','state','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','outboundAnswerCallsDay','countmachineretry','countglobal','amd','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','VoiceQueueId','CampaignId','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','[syncAgentComplete][createHistory][0]','countcongestionretry','add','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','reason','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','agiafterat','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncQueueMember','actionid','locked','paused','stateinterface','rrmemory','idHopper','queueStatusComplete','pick','syncQueueStatusComplete','[unlock][syncQueueStatusComplete]','_rr','unlockRR','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','push','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','method\x20not\x20recognized'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xdbe5,0xbb));var _0x5dbe=function(_0x45821b,_0x4e1691){_0x45821b=_0x45821b-0x0;var _0x338e15=_0xdbe5[_0x45821b];return _0x338e15;};'use strict';var util=require('util');var _=require(_0x5dbe('0x0'));var BPromise=require(_0x5dbe('0x1'));var uuid=require('uuid');var moment=require(_0x5dbe('0x2'));var rr=require('rr');var md5=require(_0x5dbe('0x3'));var Redis=require(_0x5dbe('0x4'));var ut=require(_0x5dbe('0x5'));var config=require(_0x5dbe('0x6'));var logger=require(_0x5dbe('0x7'))(_0x5dbe('0x8'));var loggerBooked=require('../../../config/logger')(_0x5dbe('0x9'));var loggerPredictive=require(_0x5dbe('0x7'))(_0x5dbe('0xa'));var loggerPredictiveCalls=require('../../../config/logger')(_0x5dbe('0xb'));var loggerSyncQueueSummary=require(_0x5dbe('0x7'))('syncQueueSummary');var ami=require(_0x5dbe('0xc'));config['redis']=_[_0x5dbe('0xd')](config[_0x5dbe('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0x5dbe('0xf'))(new Redis(config[_0x5dbe('0xe')]));var cmHopper=require(_0x5dbe('0x10'));var cmHopperFinal=require(_0x5dbe('0x11'));var cmHopperHistory=require(_0x5dbe('0x12'));var cmHopperBlack=require(_0x5dbe('0x13'));var voiceQueueRt=require(_0x5dbe('0x14'));var Action=require(_0x5dbe('0x15'));var History=require(_0x5dbe('0x16'));var Final=require(_0x5dbe('0x17'));var AgentComplete=require(_0x5dbe('0x18'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x5dbe('0x19'));var ipAgi=process[_0x5dbe('0x1a')]['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':'rrmemory','roundrobin':_0x5dbe('0x1b')};var Sequence=function(){};Sequence[_0x5dbe('0x1c')]['enqueue']=function(_0x2987fd){this[_0x5dbe('0x1d')]=this[_0x5dbe('0x1d')]?this[_0x5dbe('0x1d')]['finally'](_0x2987fd):_0x2987fd();};function Dialer(_0x42082b,_0x40be03){this[_0x5dbe('0x1e')]=new Sequence();this[_0x5dbe('0x1f')]=_0x40be03;this['voiceQueues']=_0x42082b[_0x5dbe('0x20')];this[_0x5dbe('0x21')]=_0x42082b[_0x5dbe('0x21')];this[_0x5dbe('0x22')]=_0x42082b[_0x5dbe('0x22')];this[_0x5dbe('0x23')]=_0x42082b[_0x5dbe('0x23')];this[_0x5dbe('0x24')]=config['maxNumberOriginate']||0x2;this[_0x5dbe('0x25')]={};this[_0x5dbe('0x26')]={};this[_0x5dbe('0x27')]={};this['uniqueId']={};this[_0x5dbe('0x28')]={};this[_0x5dbe('0x29')]={};this['startProgressive']={};this[_0x5dbe('0x2a')]={};this[_0x5dbe('0x2b')]={};this[_0x5dbe('0x2c')]={};ami['on']('agentconnect',this[_0x5dbe('0x2d')][_0x5dbe('0x2e')](this));ami['on'](_0x5dbe('0x2f'),this[_0x5dbe('0x30')][_0x5dbe('0x2e')](this));ami['on'](_0x5dbe('0x31'),this[_0x5dbe('0x32')][_0x5dbe('0x2e')](this));ami['on'](_0x5dbe('0x33'),this[_0x5dbe('0x34')]['bind'](this));ami['on'](_0x5dbe('0x35'),this['syncQueueSummary'][_0x5dbe('0x2e')](this));ami['on'](_0x5dbe('0x36'),this[_0x5dbe('0x37')]['bind'](this));ami['on'](_0x5dbe('0x38'),this[_0x5dbe('0x39')]['bind'](this));ami['on'](_0x5dbe('0x3a'),this[_0x5dbe('0x3b')][_0x5dbe('0x2e')](this));ami['on'](_0x5dbe('0x3c'),this['syncQueueMember']['bind'](this));ami['on'](_0x5dbe('0x3d'),this['syncQueueStatusComplete'][_0x5dbe('0x2e')](this));this[_0x5dbe('0x3e')]();this[_0x5dbe('0x3f')]();}function isNotNull(_0x580dcb){return _0x580dcb!==null&&!_[_0x5dbe('0x40')](_0x580dcb);}function checkIsLoggedIn(_0x195544,_0x3c96a4){return function(){if(_0x3c96a4<=0x0){_0x195544[_0x5dbe('0x41')]=_0x5dbe('0x42');throw _0x195544[_0x5dbe('0x43')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x476d15){return _0x476d15;}function checkIsActive(_0x44de3a,_0x3fefa5){return function(){if(!isActive(_0x3fefa5)){_0x44de3a[_0x5dbe('0x41')]=_0x5dbe('0x44');throw _0x44de3a[_0x5dbe('0x43')]+_0x5dbe('0x45');}};}function checkInterval(_0x2ff198){return function(){if(!isNotNull(_0x2ff198[_0x5dbe('0x46')])){_0x2ff198['message']=_0x5dbe('0x47');throw _0x2ff198[_0x5dbe('0x43')]+_0x5dbe('0x48');}if(!isNotNull(_0x2ff198[_0x5dbe('0x46')][_0x5dbe('0x49')])){_0x2ff198[_0x5dbe('0x41')]=_0x5dbe('0x47');throw _0x2ff198['name']+_0x5dbe('0x48');}if(!isNotNull(_[_0x5dbe('0x4a')](_0x2ff198[_0x5dbe('0x46')][_0x5dbe('0x49')]))){_0x2ff198[_0x5dbe('0x41')]=_0x5dbe('0x47');throw _0x2ff198[_0x5dbe('0x43')]+_0x5dbe('0x48');}};}function msgResponse(_0x1d1049,_0x2bafe3,_0x134f8b){return{'action':_0x1d1049,'response':_0x2bafe3,'message':_0x134f8b,'stack':_0x134f8b};}function myreject(_0xcfd686){return function(_0x8b2cc6){return _0xcfd686(msgResponse(_0x5dbe('0x4b'),_0x5dbe('0x4c'),JSON[_0x5dbe('0x4d')](_0x8b2cc6)));};}function getSeconds(_0x5a7321,_0x2e83c6){var _0xb79c47=moment(_0x5a7321)[_0x5dbe('0x4e')](0x0);var _0x3b7936=moment(_0x2e83c6)[_0x5dbe('0x4e')](0x0);return _0xb79c47[_0x5dbe('0x4f')](_0x3b7936,_0x5dbe('0x50'));}function emit(_0x13e9d0,_0x1710ed,_0x29fcc6){io['to'](_0x13e9d0)[_0x5dbe('0x51')](_0x1710ed,_0x29fcc6);}function emitVoiceQueueSummary(_0x1f998f){if(_0x1f998f['type']==='outbound'){var _0x2c1426={'id':_0x1f998f['id'],'name':_0x1f998f[_0x5dbe('0x43')],'strategy':_0x1f998f[_0x5dbe('0x52')],'answered':_0x1f998f[_0x5dbe('0x53')],'available':_0x1f998f[_0x5dbe('0x54')],'loggedIn':_0x1f998f[_0x5dbe('0x55')],'pTalking':_0x1f998f[_0x5dbe('0x56')],'sumBillable':_0x1f998f['sumBillable'],'sumDuration':_0x1f998f[_0x5dbe('0x57')],'sumHoldTime':_0x1f998f[_0x5dbe('0x58')]||0x0,'talking':_0x1f998f[_0x5dbe('0x59')],'total':_0x1f998f[_0x5dbe('0x5a')],'type':_0x1f998f[_0x5dbe('0x5b')],'unmanaged':_0x1f998f[_0x5dbe('0x5c')],'abandoned':_0x1f998f[_0x5dbe('0x5d')],'waiting':_0x1f998f[_0x5dbe('0x5e')],'loggedInDb':_0x1f998f[_0x5dbe('0x5f')],'dialActive':_0x1f998f['dialActive'],'dialMethod':_0x1f998f[_0x5dbe('0x60')],'dialOriginateCallerIdName':_0x1f998f[_0x5dbe('0x61')],'dialOriginateCallerIdNumber':_0x1f998f[_0x5dbe('0x62')],'dialOriginateTimeout':_0x1f998f[_0x5dbe('0x63')],'dialPrefix':_0x1f998f[_0x5dbe('0x64')],'outboundAnswerAgiCallsDay':_0x1f998f[_0x5dbe('0x65')],'outboundAnswerCallsDay':_0x1f998f['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x1f998f[_0x5dbe('0x66')],'outboundBusyCallsDay':_0x1f998f[_0x5dbe('0x67')],'outboundCongestionCallsDay':_0x1f998f[_0x5dbe('0x68')],'outboundDropCallsDayACS':_0x1f998f[_0x5dbe('0x69')],'outboundDropCallsDayCallersExit':_0x1f998f[_0x5dbe('0x6a')],'outboundDropCallsDayTimeout':_0x1f998f[_0x5dbe('0x6b')],'outboundNoAnswerCallsDay':_0x1f998f[_0x5dbe('0x6c')],'outboundNoSuchCallsDay':_0x1f998f[_0x5dbe('0x6d')],'outboundOriginateFailureCallsDay':_0x1f998f[_0x5dbe('0x6e')],'outboundReCallsDay':_0x1f998f[_0x5dbe('0x6f')],'outboundRejectCallsDay':_0x1f998f['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x1f998f['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x1f998f['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x1f998f['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x1f998f[_0x5dbe('0x70')],'predictiveIntervalDroppedCallsCallersExit':_0x1f998f[_0x5dbe('0x71')],'predictiveIntervalDroppedCallsTimeout':_0x1f998f['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x1f998f[_0x5dbe('0x72')],'predictiveIntervalErlangCallsDroppedCalls':_0x1f998f['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1f998f[_0x5dbe('0x73')],'predictiveIntervalMultiplicativeFactor':_0x1f998f[_0x5dbe('0x74')],'predictiveIntervalPauses':_0x1f998f[_0x5dbe('0x75')],'predictiveIntervalAvailable':_0x1f998f[_0x5dbe('0x76')],'predictiveIntervalTotalCalls':_0x1f998f[_0x5dbe('0x77')],'message':_0x1f998f[_0x5dbe('0x41')],'originated':_0x1f998f[_0x5dbe('0x78')],'erlangCalls':_0x1f998f['erlangCalls'],'erlangCallToSecond':_0x1f998f[_0x5dbe('0x79')],'erlangAbandonmentRate':_0x1f998f[_0x5dbe('0x7a')],'erlangBusyFactor':_0x1f998f['erlangBusyFactor'],'startPredictive':_0x1f998f['startPredictive'],'startProgressive':_0x1f998f['startProgressive']};if(_0x1f998f[_0x5dbe('0x7b')]){_0x2c1426[_0x5dbe('0x7b')]={'id':_0x1f998f[_0x5dbe('0x7b')]['id'],'name':_0x1f998f[_0x5dbe('0x7b')]['name'],'active':_0x1f998f['Trunk'][_0x5dbe('0x7c')],'callerid':_0x1f998f[_0x5dbe('0x7b')][_0x5dbe('0x7d')]};}if(_0x1f998f[_0x5dbe('0x46')]){_0x2c1426[_0x5dbe('0x46')]={'id':_0x1f998f[_0x5dbe('0x46')]['id'],'name':_0x1f998f[_0x5dbe('0x46')][_0x5dbe('0x43')]};}var _0xd54999=md5(JSON[_0x5dbe('0x4d')](_0x2c1426));if(_0x1f998f[_0x5dbe('0x3')]!==_0xd54999){_0x1f998f[_0x5dbe('0x3')]=_0xd54999;emit(util[_0x5dbe('0x7e')]('voice:queue:%s',_0x2c1426['name']),_0x5dbe('0x7f'),_0x2c1426);}}}function emitCampaignSummary(_0x4b6c0a){if(_0x4b6c0a[_0x5dbe('0x5b')]==='ivr'){emit(util[_0x5dbe('0x7e')](_0x5dbe('0x80'),_0x4b6c0a[_0x5dbe('0x43')]),_0x5dbe('0x81'),_0x4b6c0a);}}function checkGetDataPredictive(_0x3516ca){if(isNotNull(_0x3516ca)){if(!_[_0x5dbe('0x4a')](_0x3516ca)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x83'),_0x3516ca[_0x5dbe('0x77')]);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x84'),_0x3516ca[_0x5dbe('0x85')]);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x86'),_0x3516ca[_0x5dbe('0x87')]);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x88'),_0x3516ca[_0x5dbe('0x71')]);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x89'),_0x3516ca[_0x5dbe('0x8a')]);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x8b'),_0x3516ca[_0x5dbe('0x70')]);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x8c'));if(_0x3516ca[_0x5dbe('0x77')]>0x0){if(!_[_0x5dbe('0x40')](_0x3516ca['predictiveIntervalAvgTalktime'])&&_0x3516ca[_0x5dbe('0x70')]>0x0){return!![];}else{loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x8d'));}if(!_['isUndefined'](_0x3516ca[_0x5dbe('0x8a')])&&_0x3516ca[_0x5dbe('0x8a')]>0x0){return!![];}else{loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x8e'));}}else{loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x8f'));}}else{loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x90'));}}else{loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x90'));}return![];}function mergeDataErlangB(_0x1d9f99){return function(_0x441da9){loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x91'));loggerPredictive['info'](_0x5dbe('0x92'),_0x441da9['erlangCalls']);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x441da9[_0x5dbe('0x79')]);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x93'),_0x441da9['erlangAbandonmentRate']);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x94'),_0x441da9[_0x5dbe('0x95')]);loggerPredictive['info'](_0x5dbe('0x93'),_0x441da9[_0x5dbe('0x7a')]);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x8c'));_[_0x5dbe('0x96')](_0x1d9f99,_0x441da9);};}function getDiff(_0x309415){var _0x1d4475=moment()['milliseconds'](0x0);var _0x5e6eb0=moment(_0x309415)['milliseconds'](0x0);return _0x1d4475[_0x5dbe('0x4f')](_0x5e6eb0,_0x5dbe('0x50'));}function ifInterval(_0x9177d6,_0x313678){if(_[_0x5dbe('0x40')](_0x313678)){return![];}if(getDiff(_0x313678)<_0x9177d6*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x4c84a7){if(isNotNull(_0x4c84a7)){if(!_[_0x5dbe('0x40')](_0x4c84a7[_0x5dbe('0x97')])){_0x4c84a7[_0x5dbe('0x97')]=undefined;loggerPredictive[_0x5dbe('0x82')](_0x4c84a7[_0x5dbe('0x43')],_0x5dbe('0x98'));}if(!_[_0x5dbe('0x40')](_0x4c84a7['startPredictive'])){_0x4c84a7[_0x5dbe('0x29')]=undefined;loggerPredictive['info'](_0x4c84a7['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x5dbe('0x40')](_0x4c84a7[_0x5dbe('0x99')])){clearInterval(_0x4c84a7[_0x5dbe('0x99')]);_0x4c84a7[_0x5dbe('0x99')]=undefined;loggerPredictive[_0x5dbe('0x82')](_0x4c84a7[_0x5dbe('0x43')],_0x5dbe('0x9a'));}}}function erlangb(_0x501976,_0x15dcfe){if(_0x15dcfe===0x0){return 0x0;}var _0x5876d9=0x1;for(var _0x1d5f07=0x1;_0x1d5f07<=_0x15dcfe;_0x1d5f07+=0x1){_0x5876d9=0x1+_0x5876d9*_0x1d5f07/_0x501976;}return 0x1/_0x5876d9;}function isVoiceQueueOutbound(_0x1a9fd0){return _0x1a9fd0===_0x5dbe('0x9b');}function isNotPreview(_0x2b219e){return _0x2b219e!==_0x5dbe('0x1f');}function isCampaignIvr(_0x3f371f){return _0x3f371f===_0x5dbe('0x9c');}function getCallerId(_0x3e2cb1,_0x247810,_0x2cb7cc){if(!_['isUndefined'](_0x2cb7cc)&&'string'===typeof _0x2cb7cc&&!_[_0x5dbe('0x4a')](_0x2cb7cc)){if(!_['isUndefined'](_0x247810)&&_0x5dbe('0x9d')===typeof _0x247810&&!_[_0x5dbe('0x4a')](_0x247810)){return util['format'](_0x5dbe('0x9e'),_0x247810,_0x2cb7cc);}return util['format']('\x22%s\x22\x20<%s>',_0x2cb7cc,_0x2cb7cc);}if(!_['isUndefined'](_0x3e2cb1)&&_0x5dbe('0x9d')===typeof _0x3e2cb1&&!_['isEmpty'](_0x3e2cb1)){return _0x3e2cb1;}return _0x5dbe('0x9f');}function loggerCatchQueueSummary(_0x168e9d,_0x38191b){return function(_0x480302){freeVariablesPredictive(_0x38191b);emitVoiceQueueSummary(_0x38191b);emitCampaignSummary(_0x38191b);loggerSyncQueueSummary['error'](_0x168e9d,util[_0x5dbe('0xa0')](_0x480302,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5c9121,_0x145935){return function(_0x10dbfc){loggerPredictive['error'](_0x145935[_0x5dbe('0x43')],_0x5c9121);loggerPredictive['error'](_0x10dbfc[_0x5dbe('0xa1')]);freeVariablesPredictive(_0x145935);};}function loggerCatch(_0xf11adb){return function(_0x133a0a){logger[_0x5dbe('0xa2')](_0xf11adb,util[_0x5dbe('0xa0')](_0x133a0a,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x17e7e9){return _0x17e7e9&&!_[_0x5dbe('0x40')](_0x17e7e9)&&_0x17e7e9[_0x5dbe('0xa3')]>0x0;}function decremetOriginate(_0x42d740){if(!_[_0x5dbe('0x40')](_0x42d740)&&_0x42d740!==null){if(_0x42d740[_0x5dbe('0xa4')](_0x5dbe('0x78'))){if(_0x42d740[_0x5dbe('0x78')]>0x0){_0x42d740[_0x5dbe('0x78')]-=0x1;}else{logger['error'](_0x5dbe('0xa5'));}}}else{logger[_0x5dbe('0xa2')](_0x5dbe('0xa6'));}}function checkContactLowerLimitOriginate(_0xf96e40,_0x448554,_0x406fd7){if(_0x448554>_0x406fd7){for(var _0x33acb6=0x0;_0x33acb6<_0x448554-_0x406fd7;_0x33acb6+=0x1){decremetOriginate(_0xf96e40);}}}function loggerGetContactDialer(_0x524b00,_0x513a9d,_0x4f16c7){return function(_0x4ffbf0){checkContactLowerLimitOriginate(_0x513a9d,_0x4f16c7,0x0);logger['error'](_0x524b00,util[_0x5dbe('0xa0')](_0x4ffbf0,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5e2ae1){return function(_0x4e1934){if(isNotNull(_0x4e1934)&&isNotNull(_0x4e1934[0x0])){if(_0x4e1934[0x0]['contactsRescheduled']>0x0){_0x5e2ae1[_0x5dbe('0x41')]=_0x5dbe('0xa7');logger[_0x5dbe('0x82')]('[getContactDialer2][ReScheduled]'+_0x5e2ae1[_0x5dbe('0x43')],_0x4e1934[0x0]['contactsRescheduled'],_0x5dbe('0xa8'));}else{_0x5e2ae1[_0x5dbe('0x41')]=_0x5dbe('0xa9');logger['info'](_0x5dbe('0xaa')+_0x5e2ae1[_0x5dbe('0x43')]);}}};}function notSendMessagesQueue(_0x2916f3){if(_0x2916f3[_0x5dbe('0xab')]){freeVariablesPredictive(_0x2916f3);if(_0x2916f3[_0x5dbe('0x78')]===0x0&&_0x2916f3[_0x5dbe('0x59')]===0x0&&_0x2916f3[_0x5dbe('0x5e')]===0x0&&(_0x2916f3[_0x5dbe('0x56')]||0x0)===0x0){_0x2916f3[_0x5dbe('0xab')]=![];_0x2916f3['available']=0x0;_0x2916f3[_0x5dbe('0x41')]=_0x5dbe('0x44');loggerSyncQueueSummary[_0x5dbe('0xa2')](_0x5dbe('0xac'),_0x2916f3[_0x5dbe('0x43')],_0x5dbe('0xad'));}else{_0x2916f3[_0x5dbe('0x41')]=_0x5dbe('0xae');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2916f3[_0x5dbe('0x43')],_0x5dbe('0xaf'));}emitVoiceQueueSummary(_0x2916f3);}}function notSendMessagesCampaign(_0x5bd811){if(_0x5bd811['sendMessageOneNotActive']){if(_0x5bd811['originated']===0x0){_0x5bd811[_0x5dbe('0xab')]=![];_0x5bd811[_0x5dbe('0x41')]=_0x5dbe('0x44');loggerSyncQueueSummary[_0x5dbe('0xa2')](_0x5dbe('0xb0'),_0x5bd811['name'],_0x5dbe('0xad'));}else{_0x5bd811[_0x5dbe('0x41')]=_0x5dbe('0xae');loggerSyncQueueSummary[_0x5dbe('0xa2')](_0x5dbe('0xb0'),_0x5bd811['name'],_0x5dbe('0xaf'));}emitCampaignSummary(_0x5bd811);}}function createObjHistory(_0x566f9d,_0x4ce81c,_0x47de54,_0x4b9a90,_0x42491c){_0x566f9d['message']=_0x47de54;var _0x1fb035=new Action(_0x566f9d,_0x4ce81c);var _0x28bcc2=new History(_0x1fb035);_0x28bcc2['state']=_0x4b9a90;_0x28bcc2[_0x5dbe('0xb1')]=_0x42491c;_0x28bcc2[_0x5dbe('0xb2')]=_0x1fb035[_0x5dbe('0xb3')];return _0x28bcc2;}Dialer[_0x5dbe('0x1c')][_0x5dbe('0x3f')]=function(){var _0x1dcd6a=this;setInterval(function(){_0x1dcd6a[_0x5dbe('0xb4')](_0x1dcd6a[_0x5dbe('0xb5')],_0x5dbe('0xb6'));_0x1dcd6a[_0x5dbe('0xb4')](_0x1dcd6a[_0x5dbe('0x26')],_0x5dbe('0xb7'));},0x32c8);};Dialer[_0x5dbe('0x1c')]['clearZombieChannels']=function(_0x15bbd9,_0x36d834){var _0x385036=this;for(var _0x1387a5 in _0x15bbd9){if(_0x15bbd9['hasOwnProperty'](_0x1387a5)){this[_0x5dbe('0x1e')][_0x5dbe('0xb8')](function(){if(!_[_0x5dbe('0xb9')](_0x15bbd9[_0x1387a5])){return ami[_0x5dbe('0xba')]({'action':'status','channel':_0x15bbd9[_0x1387a5][_0x5dbe('0xbb')]})[_0x5dbe('0xbc')](function(_0x3fd8b0){if(_0x3fd8b0[_0x5dbe('0x41')]===_0x5dbe('0xbd')){setTimeout(function(){if(_0x15bbd9[_0x1387a5]&&_0x15bbd9[_0x1387a5][_0x5dbe('0x5b')]!==_0x5dbe('0x9c')){_0x385036[_0x5dbe('0xbe')](_0x385036[_0x5dbe('0x20')][_0x15bbd9[_0x1387a5][_0x5dbe('0xbf')]]);logger['error'](_0x5dbe('0xc0'),_0x36d834,_0x1387a5,_0x15bbd9[_0x1387a5]['queue']);delete _0x15bbd9[_0x1387a5];}if(_0x15bbd9[_0x1387a5]&&_0x15bbd9[_0x1387a5][_0x5dbe('0x5b')]===_0x5dbe('0x9c')){_0x385036[_0x5dbe('0xbe')](_0x385036[_0x5dbe('0x21')][_0x15bbd9[_0x1387a5]['queue']]);logger[_0x5dbe('0xa2')](_0x5dbe('0xc1'),_0x36d834,_0x1387a5,_0x15bbd9[_0x1387a5]['queue']);delete _0x15bbd9[_0x1387a5];}},0x2328);}});}});}}};Dialer[_0x5dbe('0x1c')][_0x5dbe('0xc2')]=function(_0xdd632f){return BPromise[_0x5dbe('0xc3')]()[_0x5dbe('0xc4')](cmHopper[_0x5dbe('0xc2')](_0xdd632f))[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0xc5')));};Dialer[_0x5dbe('0x1c')][_0x5dbe('0xc6')]=function(_0x163276){return BPromise['resolve']()[_0x5dbe('0xc4')](cmHopperBlack['checkIsBlackList'](_0x163276))[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0xc7')));};Dialer[_0x5dbe('0x1c')][_0x5dbe('0xc8')]=function(_0x30a9ff){return BPromise[_0x5dbe('0xc3')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x30a9ff))[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0xc9')));};Dialer[_0x5dbe('0x1c')][_0x5dbe('0xca')]=function(_0x242872){return BPromise['resolve']()[_0x5dbe('0xc4')](cmHopperHistory['avgHandleTime'](_0x242872))[_0x5dbe('0xbc')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x5dbe('0x1c')][_0x5dbe('0xcb')]=function(_0x2a7766){return BPromise[_0x5dbe('0xc3')]()[_0x5dbe('0xc4')](cmHopper[_0x5dbe('0xcb')](_0x2a7766))['catch'](loggerCatch(_0x5dbe('0xcc')));};Dialer[_0x5dbe('0x1c')][_0x5dbe('0xcd')]=function(_0x1dcc1f,_0x3ad6fc,_0x25a348){return BPromise[_0x5dbe('0xc3')]()[_0x5dbe('0xc4')](cmHopper[_0x5dbe('0xcd')](_0x1dcc1f,_0x3ad6fc,_0x25a348))[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0xce')));};Dialer[_0x5dbe('0x1c')][_0x5dbe('0xcf')]=function(_0x42e2cd,_0x296ab8,_0x21de2b,_0x3c3f1e){return BPromise[_0x5dbe('0xc3')]()[_0x5dbe('0xc4')](cmHopper['getContactDialer'](_0x42e2cd,_0x296ab8,_0x21de2b,_0x3c3f1e))[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0xd0')));};Dialer[_0x5dbe('0x1c')][_0x5dbe('0xd1')]=function(_0x57aa97,_0x134ddc,_0x5decf5){return BPromise['resolve']()[_0x5dbe('0xc4')](cmHopper[_0x5dbe('0xd1')](_0x57aa97,_0x134ddc,_0x5decf5))[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0xd0')));};Dialer[_0x5dbe('0x1c')]['getVoiceQueueRtPauses']=function(_0x301354){return BPromise[_0x5dbe('0xc3')]()['then'](voiceQueueRt[_0x5dbe('0xd2')](_0x301354))[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0xd3')));};Dialer[_0x5dbe('0x1c')][_0x5dbe('0xd4')]=function(_0x2cbb66){return BPromise[_0x5dbe('0xc3')]()[_0x5dbe('0xc4')](cmHopper[_0x5dbe('0xd4')](_0x2cbb66))[_0x5dbe('0xbc')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0x5dbe('0xd5')]=function(_0x78ecde){return BPromise[_0x5dbe('0xc3')]()[_0x5dbe('0xc4')](cmHopperHistory[_0x5dbe('0xd5')](_0x78ecde))[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0xd6')));};Dialer[_0x5dbe('0x1c')]['updateOriginated']=function(_0x197a8e){if(!_[_0x5dbe('0x40')](_0x197a8e)&&_0x197a8e!==null){if(_0x197a8e['hasOwnProperty'](_0x5dbe('0x78'))){if(_0x197a8e['originated']>0x0){_0x197a8e[_0x5dbe('0x78')]-=0x1;}else{logger[_0x5dbe('0xa2')](_0x5dbe('0xd7'));}}}else{logger[_0x5dbe('0xa2')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x5dbe('0x1c')][_0x5dbe('0xd8')]=function(_0x3caa3e,_0x3db0cc){var _0x10cd93=this;return function(_0x32d99f){_0x10cd93[_0x5dbe('0xbe')](_0x3db0cc);logger[_0x5dbe('0xa2')](_0x3caa3e,util[_0x5dbe('0xa0')](_0x32d99f,{'showHidden':![],'depth':null}));};};Dialer[_0x5dbe('0x1c')]['emptyContact']=function(_0x20d8c8,_0x59672e,_0x43a846){var _0x3dcebb={'state':0x19,'statedesc':_0x5dbe('0xd9')};this['updateOriginated'](_0x59672e);this[_0x5dbe('0xda')](_['merge'](_0x3dcebb,_['pick'](_0x43a846,['ContactId',_0x5dbe('0xdb'),'UserId','VoiceQueueId','CampaignId'])),_0x5dbe('0xdc'),'[emptyContact]');logger['error'](_0x20d8c8);};Dialer[_0x5dbe('0x1c')]['isSuccess']=function(_0x30608c){return _0x30608c===_0x5dbe('0xdd');};Dialer[_0x5dbe('0x1c')]['isTrunkReachable']=function(_0x5674ae){return!_['isUndefined'](_0x5674ae)&&_0x5674ae&&!_[_0x5dbe('0x40')](_0x5674ae[_0x5dbe('0x43')])&&!_['isUndefined'](_0x5674ae[_0x5dbe('0x7c')])&&_0x5674ae[_0x5dbe('0x7c')]&&(this[_0x5dbe('0x23')][util[_0x5dbe('0x7e')](_0x5dbe('0xde'),_0x5674ae['name'])][_0x5dbe('0xdf')]==='reachable'||this[_0x5dbe('0x23')][util[_0x5dbe('0x7e')]('SIP/%s',_0x5674ae['name'])]['status']===_0x5dbe('0xe0'));};Dialer[_0x5dbe('0x1c')][_0x5dbe('0xda')]=function(_0x259e97,_0x4e9f56,_0x53f691){this['createHistory'](_0x259e97)[_0x5dbe('0xbc')](loggerCatch(_0x4e9f56));this[_0x5dbe('0xd4')](_0x259e97)[_0x5dbe('0xbc')](loggerCatch(_0x53f691));};Dialer[_0x5dbe('0x1c')][_0x5dbe('0x3b')]=function(_0x19c1c7){var _0x3ea52c=this['uniqueId'][_0x19c1c7[_0x5dbe('0xe1')]];var _0x627a35;if(!_[_0x5dbe('0xb9')](_0x19c1c7)&&!_[_0x5dbe('0xb9')](_0x19c1c7[_0x5dbe('0xe2')])&&!_[_0x5dbe('0xb9')](_0x19c1c7[_0x5dbe('0xe2')]['amdstatus'])&&_0x19c1c7['exten']===_0x5dbe('0xe3')&&_0x3ea52c){if(_0x3ea52c[_0x5dbe('0x5b')]!==_0x5dbe('0x9c')&&this[_0x5dbe('0x20')][_0x3ea52c[_0x5dbe('0xbf')]][_0x5dbe('0xe4')]&&_0x19c1c7[_0x5dbe('0xe5')]==='HANGUP'){delete this[_0x5dbe('0xb5')][_0x19c1c7[_0x5dbe('0xe1')]];this[_0x5dbe('0xbe')](this[_0x5dbe('0x20')][_0x3ea52c['queue']]);this[_0x5dbe('0x20')][_0x3ea52c[_0x5dbe('0xbf')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x3ea52c[_0x5dbe('0xbf')]][_0x5dbe('0x65')]+=0x1;_0x627a35=new Hangup(_0x3ea52c,_0x19c1c7);_0x627a35[_0x5dbe('0xe6')]=0x12;_0x627a35[_0x5dbe('0xb1')]=_0x5dbe('0xe7');_0x627a35[_0x5dbe('0xe8')]=_0x5dbe('0xe9');this['saveInDb'](_0x627a35,_0x5dbe('0xea'),'[syncHangupInAMD]');}if(_0x3ea52c[_0x5dbe('0x5b')]!==_0x5dbe('0x9c')&&this[_0x5dbe('0x20')][_0x3ea52c[_0x5dbe('0xbf')]][_0x5dbe('0xe4')]&&_0x19c1c7['value']==='MACHINE'){var _0x2873c5=this;return new BPromise(function(_0x1b5ed9,_0x3685d0){delete _0x2873c5['uniqueId'][_0x19c1c7[_0x5dbe('0xe1')]];_0x2873c5[_0x5dbe('0xbe')](_0x2873c5[_0x5dbe('0x20')][_0x3ea52c[_0x5dbe('0xbf')]]);_0x2873c5['voiceQueues'][_0x3ea52c[_0x5dbe('0xbf')]][_0x5dbe('0xeb')]+=0x1;_0x2873c5[_0x5dbe('0x20')][_0x3ea52c[_0x5dbe('0xbf')]][_0x5dbe('0x65')]+=0x1;var _0x281047=_0x2873c5[_0x5dbe('0x20')][_0x3ea52c[_0x5dbe('0xbf')]];var _0x59da94=new Hangup(_0x3ea52c,_0x19c1c7);_0x59da94[_0x5dbe('0xe6')]=0x13;_0x59da94['statedesc']='Machine';_0x59da94['membername']=_0x5dbe('0xe9');_0x59da94[_0x5dbe('0xec')]+=0x1;_0x59da94[_0x5dbe('0xed')]+=0x1;_0x59da94[_0x5dbe('0xee')]=!![];_0x2873c5[_0x5dbe('0xd5')](_0x59da94)[_0x5dbe('0xbc')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x59da94[_0x5dbe('0xef')]+_0x59da94['countcongestionretry']+_0x59da94[_0x5dbe('0xf0')]+_0x59da94[_0x5dbe('0xf1')]+_0x59da94[_0x5dbe('0xf2')]+_0x59da94[_0x5dbe('0xf3')]+_0x59da94[_0x5dbe('0xec')]+_0x59da94[_0x5dbe('0xf4')]>=_0x281047[_0x5dbe('0xf5')]){_0x2873c5[_0x5dbe('0xf6')](_0x59da94,_0x1b5ed9,_0x3685d0,'reason19\x20machine....');}else{if(_0x59da94['countmachineretry']>=_0x281047[_0x5dbe('0xf7')]){_0x2873c5[_0x5dbe('0xf8')](_0x59da94,_0x1b5ed9,_0x3685d0,_0x5dbe('0xf9'));}else{_0x2873c5[_0x5dbe('0xcb')]({'active':![],'countmachineretry':_0x59da94[_0x5dbe('0xec')],'scheduledat':moment()['add'](_0x281047[_0x5dbe('0xfa')],_0x5dbe('0xfb'))[_0x5dbe('0x7e')](_0x5dbe('0xfc')),'ContactId':_0x59da94[_0x5dbe('0xfd')],'ListId':_0x59da94[_0x5dbe('0xdb')],'VoiceQueueId':_0x59da94[_0x5dbe('0xfe')]||undefined,'CampaignId':_0x59da94[_0x5dbe('0xff')]||undefined})[_0x5dbe('0xbc')](loggerCatch('[rescheduleContact][Machine]'));_0x1b5ed9({'reschedule':0x1});}}});}if(_0x3ea52c['type']==='ivr'&&this[_0x5dbe('0x21')][_0x3ea52c[_0x5dbe('0xbf')]][_0x5dbe('0xe4')]&&_0x19c1c7[_0x5dbe('0xe5')]===_0x5dbe('0x100')){delete this[_0x5dbe('0xb5')][_0x19c1c7[_0x5dbe('0xe1')]];this[_0x5dbe('0xbe')](this[_0x5dbe('0x21')][_0x3ea52c[_0x5dbe('0xbf')]]);_0x627a35=new Hangup(_0x3ea52c,_0x19c1c7);_0x627a35['state']=0x12;_0x627a35['statedesc']=_0x5dbe('0xe7');_0x627a35[_0x5dbe('0xe8')]=_0x5dbe('0xe9');this[_0x5dbe('0xda')](_0x627a35,_0x5dbe('0x101'),_0x5dbe('0x102'));}if(_0x3ea52c[_0x5dbe('0x5b')]===_0x5dbe('0x9c')&&this[_0x5dbe('0x21')][_0x3ea52c[_0x5dbe('0xbf')]][_0x5dbe('0xe4')]&&_0x19c1c7['value']==='MACHINE'){var _0x2873c5=this;return new BPromise(function(_0x1f688d,_0x1c5aa2){delete _0x2873c5[_0x5dbe('0xb5')][_0x19c1c7[_0x5dbe('0xe1')]];_0x2873c5[_0x5dbe('0xbe')](_0x2873c5[_0x5dbe('0x21')][_0x3ea52c[_0x5dbe('0xbf')]]);_0x2873c5['campaigns'][_0x3ea52c[_0x5dbe('0xbf')]][_0x5dbe('0xeb')]+=0x1;_0x2873c5['campaigns'][_0x3ea52c[_0x5dbe('0xbf')]][_0x5dbe('0x65')]+=0x1;var _0x3dc37a=_0x2873c5[_0x5dbe('0x21')][_0x3ea52c[_0x5dbe('0xbf')]];var _0x347391=new Hangup(_0x3ea52c,_0x19c1c7);_0x347391[_0x5dbe('0xe6')]=0x13;_0x347391[_0x5dbe('0xb1')]=_0x5dbe('0x103');_0x347391[_0x5dbe('0xe8')]='AMD';_0x347391[_0x5dbe('0xec')]+=0x1;_0x347391[_0x5dbe('0xed')]+=0x1;_0x347391[_0x5dbe('0xee')]=!![];_0x2873c5[_0x5dbe('0xd5')](_0x347391)[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x104')));if(_0x347391[_0x5dbe('0xef')]+_0x347391[_0x5dbe('0x105')]+_0x347391[_0x5dbe('0xf0')]+_0x347391[_0x5dbe('0xf1')]+_0x347391[_0x5dbe('0xf2')]+_0x347391['countabandonedretry']+_0x347391[_0x5dbe('0xec')]+_0x347391[_0x5dbe('0xf4')]>=_0x3dc37a[_0x5dbe('0xf5')]){_0x2873c5[_0x5dbe('0xf6')](_0x347391,_0x1f688d,_0x1c5aa2,'reason19\x20machine....');}else{if(_0x347391[_0x5dbe('0xec')]>=_0x3dc37a[_0x5dbe('0xf7')]){_0x2873c5['createStateFinal'](_0x347391,_0x1f688d,_0x1c5aa2,_0x5dbe('0xf9'));}else{_0x2873c5[_0x5dbe('0xcb')]({'active':![],'countmachineretry':_0x347391['countmachineretry'],'scheduledat':moment()[_0x5dbe('0x106')](_0x3dc37a[_0x5dbe('0xfa')],_0x5dbe('0xfb'))[_0x5dbe('0x7e')](_0x5dbe('0xfc')),'ContactId':_0x347391['ContactId'],'ListId':_0x347391[_0x5dbe('0xdb')],'VoiceQueueId':_0x347391[_0x5dbe('0xfe')]||undefined,'CampaignId':_0x347391[_0x5dbe('0xff')]||undefined})[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x107')));_0x1f688d({'reschedule':0x1});}}});}}};Dialer[_0x5dbe('0x1c')]['syncHangup']=function(_0x224987){var _0x1999b4=this[_0x5dbe('0xb5')][_0x224987[_0x5dbe('0xe1')]];var _0x1ff9a3=this;var _0x1eaa51;if(_0x1999b4&&_0x1999b4[_0x5dbe('0x5b')]===_0x5dbe('0x9c')){delete this[_0x5dbe('0xb5')][_0x224987[_0x5dbe('0xe1')]];this['updateOriginated'](this['campaigns'][_0x1999b4[_0x5dbe('0xbf')]]);this[_0x5dbe('0x21')][_0x1999b4[_0x5dbe('0xbf')]][_0x5dbe('0x108')]+=0x1;_0x1eaa51=new Hangup(_0x1999b4,_0x224987);this[_0x5dbe('0xd5')](_0x1eaa51)[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x109')));this['moveContactManagedDialer'](_0x1eaa51)['catch'](loggerCatch(_0x5dbe('0x10a')));}if(_0x1999b4&&_0x1999b4[_0x5dbe('0x5b')]!==_0x5dbe('0x9c')&&isNotNull(this[_0x5dbe('0x20')][_0x1999b4[_0x5dbe('0xbf')]][_0x5dbe('0x10b')])){delete this[_0x5dbe('0xb5')][_0x224987[_0x5dbe('0xe1')]];this[_0x5dbe('0xbe')](this['voiceQueues'][_0x1999b4['queue']]);this[_0x5dbe('0x20')][_0x1999b4[_0x5dbe('0xbf')]][_0x5dbe('0xeb')]+=0x1;this[_0x5dbe('0x20')][_0x1999b4[_0x5dbe('0xbf')]]['outboundAnswerAgiCallsDay']+=0x1;_0x1eaa51=new Hangup(_0x1999b4,_0x224987);_0x1eaa51[_0x5dbe('0xe6')]=0x10;_0x1eaa51[_0x5dbe('0xb1')]=_0x5dbe('0x10c');_0x1eaa51[_0x5dbe('0xe8')]=_0x5dbe('0x10d');this[_0x5dbe('0xd5')](_0x1eaa51)['catch'](loggerCatch(_0x5dbe('0x109')));this[_0x5dbe('0xd4')](_0x1eaa51)[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x10a')));}if(_0x1999b4&&_0x1999b4['type']!=='ivr'&&!isNotNull(this[_0x5dbe('0x20')][_0x1999b4['queue']]['dialQueueProject'])){delete this[_0x5dbe('0xb5')][_0x224987[_0x5dbe('0xe1')]];this['updateOriginated'](this['voiceQueues'][_0x1999b4[_0x5dbe('0xbf')]]);this[_0x5dbe('0x20')][_0x1999b4[_0x5dbe('0xbf')]][_0x5dbe('0x10e')]+=0x1;_0x1eaa51=new Hangup(_0x1999b4,_0x224987);_0x1eaa51[_0x5dbe('0xe6')]=0xc;_0x1eaa51[_0x5dbe('0xb1')]=_0x224987[_0x5dbe('0x10f')];_0x1eaa51[_0x5dbe('0xe8')]=_0x5dbe('0x110');this[_0x5dbe('0xd5')](_0x1eaa51)[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x109')));this[_0x5dbe('0xd4')](_0x1eaa51)['catch'](loggerCatch(_0x5dbe('0x10a')));}};Dialer[_0x5dbe('0x1c')][_0x5dbe('0x34')]=function(_0x3c8850){var _0x1370b8=this[_0x5dbe('0xb5')][_0x3c8850['uniqueid']];var _0x4370e0=this;if(this[_0x5dbe('0x20')][_0x3c8850[_0x5dbe('0xbf')]]){if(_0x1370b8&&_0x1370b8[_0x5dbe('0x5b')]!==_0x5dbe('0x9c')){delete this['uniqueId'][_0x3c8850[_0x5dbe('0xe1')]];this[_0x5dbe('0x20')][_0x3c8850[_0x5dbe('0xbf')]]['outboundAnswerCallsDay']+=0x1;var _0x469bda=new AgentComplete(_0x1370b8,_0x3c8850);if(_0x3c8850[_0x5dbe('0x111')]==='agent'){_0x469bda['agiafterat']=this[_0x5dbe('0x20')][_0x3c8850[_0x5dbe('0xbf')]][_0x5dbe('0x112')]&&this[_0x5dbe('0x20')][_0x3c8850[_0x5dbe('0xbf')]][_0x5dbe('0x113')]?moment()['format'](_0x5dbe('0xfc')):undefined;}this[_0x5dbe('0xd5')](_0x469bda)['catch'](loggerCatch(_0x5dbe('0x114')));this[_0x5dbe('0xd4')](_0x469bda)['catch'](loggerCatch(_0x5dbe('0x115')));}}};Dialer[_0x5dbe('0x1c')][_0x5dbe('0x2d')]=function(_0x2523a2){if(this[_0x5dbe('0x20')][_0x2523a2[_0x5dbe('0xbf')]]){if(this[_0x5dbe('0xb5')][_0x2523a2['uniqueid']]&&this[_0x5dbe('0xb5')][_0x2523a2[_0x5dbe('0xe1')]][_0x5dbe('0x5b')]!==_0x5dbe('0x9c')){this[_0x5dbe('0xbe')](this[_0x5dbe('0x20')][_0x2523a2[_0x5dbe('0xbf')]]);this[_0x5dbe('0xb5')][_0x2523a2[_0x5dbe('0xe1')]][_0x5dbe('0x116')]=moment()[_0x5dbe('0x7e')](_0x5dbe('0xfc'));}}};Dialer['prototype'][_0x5dbe('0x117')]=function(_0x4d7e1e){this['createHistory'](_0x4d7e1e)[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x114')));this[_0x5dbe('0xd4')](_0x4d7e1e)['catch'](loggerCatch(_0x5dbe('0x118')));};Dialer[_0x5dbe('0x1c')][_0x5dbe('0x30')]=function(_0x1a3d03){var _0x5d20b1=this[_0x5dbe('0xb5')][_0x1a3d03['uniqueid']];var _0x5678c8=this;if(this['voiceQueues'][_0x1a3d03[_0x5dbe('0xbf')]]){if(_0x5d20b1&&_0x5d20b1[_0x5dbe('0x5b')]!==_0x5dbe('0x9c')){delete this['uniqueId'][_0x1a3d03[_0x5dbe('0xe1')]];this['updateOriginated'](this[_0x5dbe('0x20')][_0x1a3d03['queue']]);_0x5d20b1[_0x5dbe('0x119')]=moment()[_0x5dbe('0x7e')](_0x5dbe('0xfc'));var _0xc446d=new QueueCallerAbandon(_0x5d20b1,_0x1a3d03);if(getSeconds(_0x5d20b1['droptime'],_0x5d20b1[_0x5dbe('0x11a')])>=_0x5d20b1[_0x5dbe('0x11b')]){this[_0x5dbe('0x20')][_0x1a3d03[_0x5dbe('0xbf')]][_0x5dbe('0x87')]+=0x1;this[_0x5dbe('0x20')][_0x1a3d03[_0x5dbe('0xbf')]][_0x5dbe('0x6b')]+=0x1;this['voiceQueues'][_0x1a3d03[_0x5dbe('0xbf')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0xc446d['state']=0xa;_0xc446d[_0x5dbe('0xb1')]=_0x5dbe('0x11c');_0xc446d[_0x5dbe('0x11d')]=_0x5dbe('0x11e');_0xc446d[_0x5dbe('0x11f')]=this['voiceQueues'][_0x1a3d03[_0x5dbe('0xbf')]]['dialQueueProject2']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0xc446d[_0x5dbe('0xf2')]+=0x1;_0xc446d[_0x5dbe('0xed')]+=0x1;if(_0xc446d[_0x5dbe('0xf2')]>=this['voiceQueues'][_0x1a3d03[_0x5dbe('0xbf')]][_0x5dbe('0x120')]){this[_0x5dbe('0x117')](_0xc446d);}else{this[_0x5dbe('0xcb')]({'active':![],'countdropretry':_0xc446d[_0x5dbe('0xf2')],'scheduledat':moment()[_0x5dbe('0x106')](this[_0x5dbe('0x20')][_0x1a3d03[_0x5dbe('0xbf')]][_0x5dbe('0x121')],_0x5dbe('0xfb'))[_0x5dbe('0x7e')](_0x5dbe('0xfc')),'ContactId':_0x5d20b1[_0x5dbe('0xfd')],'ListId':_0x5d20b1['ListId'],'VoiceQueueId':_0x5d20b1[_0x5dbe('0xfe')]||undefined,'CampaignId':_0x5d20b1[_0x5dbe('0xff')]||undefined})[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x122')));var _0x485727=new History(_0xc446d);_0x485727[_0x5dbe('0xe6')]=0xa;_0x485727[_0x5dbe('0xb1')]=_0x5dbe('0x11c');_0x485727[_0x5dbe('0xb3')]=moment()[_0x5dbe('0x7e')](_0x5dbe('0xfc'));_0x485727[_0x5dbe('0xb2')]=_0x485727[_0x5dbe('0xb3')];_0x485727[_0x5dbe('0x123')]=_0xc446d['calleridname'];_0x485727['calleridnum']=_0xc446d[_0x5dbe('0x124')];this[_0x5dbe('0xd5')](_0x485727)[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x125')));}}else{this['voiceQueues'][_0x1a3d03[_0x5dbe('0xbf')]][_0x5dbe('0x71')]+=0x1;this[_0x5dbe('0x20')][_0x1a3d03[_0x5dbe('0xbf')]][_0x5dbe('0x6a')]+=0x1;_0xc446d['state']=0xb;_0xc446d[_0x5dbe('0xb1')]=_0x5dbe('0x126');_0xc446d[_0x5dbe('0x11d')]=_0x5dbe('0x127');_0xc446d[_0x5dbe('0xf3')]+=0x1;_0xc446d[_0x5dbe('0xed')]+=0x1;if(_0xc446d[_0x5dbe('0xf3')]>=this['voiceQueues'][_0x1a3d03[_0x5dbe('0xbf')]]['dialAbandonedMaxRetry']){this[_0x5dbe('0x117')](_0xc446d);}else{this[_0x5dbe('0xcb')]({'active':![],'countabandonedretry':_0xc446d[_0x5dbe('0xf3')],'scheduledat':moment()[_0x5dbe('0x106')](this[_0x5dbe('0x20')][_0x1a3d03[_0x5dbe('0xbf')]]['dialAbandonedRetryFrequency'],_0x5dbe('0xfb'))[_0x5dbe('0x7e')](_0x5dbe('0xfc')),'ContactId':_0x5d20b1[_0x5dbe('0xfd')],'ListId':_0x5d20b1[_0x5dbe('0xdb')],'VoiceQueueId':_0x5d20b1[_0x5dbe('0xfe')]||undefined,'CampaignId':_0x5d20b1[_0x5dbe('0xff')]||undefined})['catch'](loggerCatch(_0x5dbe('0x128')));var _0x485727=new History(_0xc446d);_0x485727[_0x5dbe('0xe6')]=0xb;_0x485727['statedesc']=_0x5dbe('0x126');_0x485727['starttime']=moment()[_0x5dbe('0x7e')](_0x5dbe('0xfc'));_0x485727[_0x5dbe('0xb2')]=_0x485727[_0x5dbe('0xb3')];_0x485727[_0x5dbe('0x123')]=_0xc446d[_0x5dbe('0x123')];_0x485727[_0x5dbe('0x124')]=_0xc446d[_0x5dbe('0x124')];this[_0x5dbe('0xd5')](_0x485727)['catch'](loggerCatch(_0x5dbe('0x129')));}}}}};Dialer[_0x5dbe('0x1c')]['syncNewExten']=function(_0x21bcad){if(this[_0x5dbe('0x26')][_0x21bcad['uniqueid']]){this['actions'][_0x21bcad['uniqueid']][_0x5dbe('0xbb')]=_0x21bcad[_0x5dbe('0xbb')];}if(this[_0x5dbe('0xb5')][_0x21bcad[_0x5dbe('0xe1')]]){this[_0x5dbe('0xb5')][_0x21bcad[_0x5dbe('0xe1')]][_0x5dbe('0xbb')]=_0x21bcad[_0x5dbe('0xbb')];}};Dialer[_0x5dbe('0x1c')][_0x5dbe('0x12a')]=function(_0x203d98){if(strategy[this[_0x5dbe('0x20')][this[_0x5dbe('0x26')][_0x203d98[_0x5dbe('0x12b')]][_0x5dbe('0xbf')]][_0x5dbe('0x52')]]===_0x5dbe('0x1b')){if(this[_0x5dbe('0x26')][_0x203d98['actionid']]&&_[_0x5dbe('0xb9')](this[_0x5dbe('0x26')][_0x203d98[_0x5dbe('0x12b')]][_0x5dbe('0x12c')])&&_0x203d98[_0x5dbe('0xdf')]==='1'&&_0x203d98[_0x5dbe('0x12d')]==='0'){if(this[_0x5dbe('0x22')][_0x203d98[_0x5dbe('0x12e')]]){if(!this[_0x5dbe('0x22')][_0x203d98['stateinterface']][_0x5dbe('0x12c')]){this['agents'][_0x203d98[_0x5dbe('0x12e')]][_0x5dbe('0x12c')]=!![];this[_0x5dbe('0x26')][_0x203d98[_0x5dbe('0x12b')]][_0x5dbe('0x12c')]=!![];this[_0x5dbe('0x26')][_0x203d98[_0x5dbe('0x12b')]][_0x5dbe('0x12e')]=_0x203d98[_0x5dbe('0x12e')];}}}}else if((strategy[this[_0x5dbe('0x20')][this[_0x5dbe('0x26')][_0x203d98['actionid']]['queue']][_0x5dbe('0x52')]]||'rrmemory')===_0x5dbe('0x12f')){if(this[_0x5dbe('0x26')][_0x203d98[_0x5dbe('0x12b')]]){if(this[_0x5dbe('0x22')][_0x203d98[_0x5dbe('0x12e')]]){this['actions'][_0x203d98['actionid']][_0x5dbe('0x12e')]=_0x203d98[_0x5dbe('0x12e')];if(_[_0x5dbe('0xb9')](this[_0x5dbe('0x2b')][this['actions'][_0x203d98[_0x5dbe('0x12b')]][_0x5dbe('0xbf')]])){this[_0x5dbe('0x2b')][this[_0x5dbe('0x26')][_0x203d98[_0x5dbe('0x12b')]]['queue']]=[];}this[_0x5dbe('0x2b')][this[_0x5dbe('0x26')][_0x203d98[_0x5dbe('0x12b')]]['queue']]['push'](_['merge'](_['pick'](this[_0x5dbe('0x26')][_0x203d98[_0x5dbe('0x12b')]],[_0x5dbe('0x130'),_0x5dbe('0x12e')]),{'status':_0x203d98[_0x5dbe('0xdf')],'paused':_0x203d98[_0x5dbe('0x12d')]}));}}}};function unlockQueueStatus(_0x4182a0,_0x49918a){setTimeout(function(){if(_['isUndefined'](_0x4182a0[_0x5dbe('0x131')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x49918a);}_0x4182a0['queueStatusComplete']=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x49918a,JSON[_0x5dbe('0x4d')](_[_0x5dbe('0x132')](_0x4182a0,['name','queueStatusComplete'])));},0x1f3);}Dialer['prototype'][_0x5dbe('0x133')]=function(_0x399177){var _0x4bcd7a=this;var _0x33e19e=_0x4bcd7a[_0x5dbe('0x20')][_0x4bcd7a[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]][_0x5dbe('0xbf')]];if(strategy[this[_0x5dbe('0x20')][this[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]][_0x5dbe('0xbf')]][_0x5dbe('0x52')]]===_0x5dbe('0x1b')){if(this[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]]&&this[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]][_0x5dbe('0x12e')]){this[_0x5dbe('0x1f')]['run'](this[_0x5dbe('0x26')][_0x399177['actionid']][_0x5dbe('0x130')],this[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]][_0x5dbe('0x12e')])[_0x5dbe('0xbc')](function(_0x16d99f){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x5dbe('0xa0')](_0x16d99f,{'showHidden':![],'depth':null}));})['finally'](function(){_0x4bcd7a[_0x5dbe('0xbe')](_0x4bcd7a[_0x5dbe('0x20')][_0x4bcd7a[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]][_0x5dbe('0xbf')]]);_0x4bcd7a['agents'][_0x4bcd7a[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]][_0x5dbe('0x12e')]]['locked']=![];delete _0x4bcd7a[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]];unlockQueueStatus(_0x33e19e);});}else{this[_0x5dbe('0xbe')](this['voiceQueues'][this[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]][_0x5dbe('0xbf')]]);this[_0x5dbe('0xcb')]({'active':![],'ContactId':this[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]][_0x5dbe('0xfd')],'ListId':this['actions'][_0x399177['actionid']]['ListId'],'VoiceQueueId':this[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]][_0x5dbe('0xfe')]||undefined,'CampaignId':this[_0x5dbe('0x26')][_0x399177['actionid']][_0x5dbe('0xff')]||undefined})[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x134')));delete this['actions'][_0x399177[_0x5dbe('0x12b')]];unlockQueueStatus(_0x33e19e);}}else if((strategy[this[_0x5dbe('0x20')][this[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]][_0x5dbe('0xbf')]][_0x5dbe('0x52')]]||_0x5dbe('0x12f'))===_0x5dbe('0x12f')){var _0x27958b;if(this[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]]&&!_[_0x5dbe('0x4a')](this[_0x5dbe('0x2b')][this[_0x5dbe('0x26')][_0x399177['actionid']]['queue']])){if(this[_0x5dbe('0x2c')][_0x4bcd7a[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]][_0x5dbe('0xbf')]]){this[_0x5dbe('0x2c')][_0x4bcd7a[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]][_0x5dbe('0xbf')]]=this[_0x5dbe('0x2c')][this[_0x5dbe('0x26')][_0x399177['actionid']][_0x5dbe('0xbf')]]?this['queueBookedRR'][this[_0x5dbe('0x26')][_0x399177['actionid']][_0x5dbe('0xbf')]]:this['queueBooked'][this['actions'][_0x399177['actionid']]['queue']]?this[_0x5dbe('0x2b')][this[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]][_0x5dbe('0xbf')]][_0x5dbe('0x135')]||0x0:0x0;}this['queueBooked'][this['actions'][_0x399177[_0x5dbe('0x12b')]][_0x5dbe('0xbf')]][_0x5dbe('0x135')]=this[_0x5dbe('0x2c')][this[_0x5dbe('0x26')][_0x399177[_0x5dbe('0x12b')]][_0x5dbe('0xbf')]];for(var _0x148fc1=0x0;_0x148fc1=0x0?!![]:![];})[_0x5dbe('0xbc')](myreject(_0x2363e0)));}}else{_0x3de57a['push'](ami[_0x5dbe('0xba')]({'action':_0x5dbe('0x14d'),'command':util['format']('iftime\x20%s,%s',_0x1b5184,!_['isUndefined'](config['timezones'][_0x4d344f])?_0x4d344f:'')})[_0x5dbe('0xc4')](function(_0x12d081){return _0x12d081[_0x5dbe('0x150')][_0x5dbe('0x151')](_0x5dbe('0x152'))>=0x0?!![]:![];})[_0x5dbe('0xbc')](myreject(_0x2363e0)));}BPromise[_0x5dbe('0x153')](_0x3de57a)[_0x5dbe('0xc4')](function(_0x345b65){var _0x2f0d16=_[_0x5dbe('0x154')](_0x345b65);if(_0x2f0d16){return _0x2f9b47(_0x2f0d16);}else{_0x15ec31[_0x5dbe('0x41')]=_0x5355c4?_0x5dbe('0x155'):_0x5dbe('0x156');return _0x2363e0(msgResponse(_0x5dbe('0x157'),'Failure',_0x5dbe('0x158')+_0x5355c4+'\x20'+_0x5b2771+_0x5dbe('0x159')+util[_0x5dbe('0xa0')](_0x1b5184,{'showHidden':![],'depth':null})+_0x5dbe('0x15a')+_0x4d344f));}})[_0x5dbe('0xbc')](function(_0x8fa169){return _0x2363e0(msgResponse('ifTime',_0x5dbe('0x146'),JSON[_0x5dbe('0x4d')](_0x8fa169)));});});};Dialer[_0x5dbe('0x1c')][_0x5dbe('0x15b')]=function(_0x378d66){var _0x15d50a=this;return function(){switch(_0x378d66[_0x5dbe('0x60')]){case _0x5dbe('0x15c'):freeVariablesPredictive(_0x378d66);_0x15d50a[_0x5dbe('0x15d')](_0x378d66,0x1);break;case'power':freeVariablesPredictive(_0x378d66);_0x15d50a[_0x5dbe('0x15d')](_0x378d66,_0x378d66['dialPowerLevel']);break;case _0x5dbe('0xa'):_0x15d50a[_0x5dbe('0xa')](_0x378d66);break;case _0x5dbe('0x9'):freeVariablesPredictive(_0x378d66);_0x15d50a[_0x5dbe('0x15d')](_0x378d66,0x1);break;default:freeVariablesPredictive(_0x378d66);logger['error']('Queue',_0x378d66[_0x5dbe('0x43')],_0x5dbe('0x15e'));}};};Dialer['prototype'][_0x5dbe('0x15f')]=function(_0x424d64){var _0x53ce3c=this;return function(){_0x53ce3c[_0x5dbe('0x160')](_0x424d64);};};Dialer['prototype'][_0x5dbe('0x161')]=function(_0x13d437){var _0x322864=this;if(isNotPreview(_0x13d437[_0x5dbe('0x60')])){if(isVoiceQueueOutbound(_0x13d437[_0x5dbe('0x5b')])&&isActive(_0x13d437['dialActive'])){_0x13d437[_0x5dbe('0xab')]=!![];BPromise[_0x5dbe('0xc3')]()['then'](checkIsLoggedIn(_0x13d437,_0x13d437[_0x5dbe('0x55')]))[_0x5dbe('0xc4')](checkIsActive(_0x13d437,_0x13d437[_0x5dbe('0x162')]))[_0x5dbe('0xc4')](checkInterval(_0x13d437))[_0x5dbe('0xc4')](_0x322864[_0x5dbe('0x140')](_0x13d437))[_0x5dbe('0xc4')](_0x322864[_0x5dbe('0x144')](_0x13d437[_0x5dbe('0x163')],_0x13d437[_0x5dbe('0x164')],_0x13d437['name'],_0x13d437))[_0x5dbe('0xc4')](_0x322864[_0x5dbe('0x165')](_0x13d437[_0x5dbe('0x46')],_0x13d437[_0x5dbe('0x164')],_0x13d437[_0x5dbe('0x43')],_0x13d437))['then'](_0x322864[_0x5dbe('0x15b')](_0x13d437))[_0x5dbe('0xbc')](loggerCatchQueueSummary(_0x5dbe('0x166'),_0x13d437));}else{notSendMessagesQueue(_0x13d437);}}else{freeVariablesPredictive(_0x13d437);}};Dialer[_0x5dbe('0x1c')]['syncCampaigns']=function(){var _0x104155=this;var _0x3cea6e;for(var _0x30c48a in this[_0x5dbe('0x21')]){if(this[_0x5dbe('0x21')][_0x5dbe('0xa4')](_0x30c48a)){_0x3cea6e=this[_0x5dbe('0x21')][_0x30c48a];if(isCampaignIvr(_0x3cea6e[_0x5dbe('0x5b')])&&isActive(_0x3cea6e[_0x5dbe('0x7c')])){_0x3cea6e[_0x5dbe('0xab')]=!![];BPromise[_0x5dbe('0xc3')]()[_0x5dbe('0xc4')](checkIsActive(_0x3cea6e,_0x3cea6e[_0x5dbe('0x7c')]))[_0x5dbe('0xc4')](checkInterval(_0x3cea6e))['then'](_0x104155[_0x5dbe('0x140')](_0x3cea6e))[_0x5dbe('0xc4')](_0x104155[_0x5dbe('0x144')](_0x3cea6e[_0x5dbe('0x163')],_0x3cea6e[_0x5dbe('0x164')],_0x3cea6e[_0x5dbe('0x43')],_0x3cea6e))['then'](_0x104155[_0x5dbe('0x165')](_0x3cea6e[_0x5dbe('0x46')],_0x3cea6e[_0x5dbe('0x164')],_0x3cea6e['name'],_0x3cea6e))['then'](_0x104155[_0x5dbe('0x15f')](_0x3cea6e))['catch'](loggerCatchQueueSummary(_0x5dbe('0x167'),_0x3cea6e));}else{notSendMessagesCampaign(_0x3cea6e);}}}};function getCallerIdRandom(_0x60346,_0x386197){var _0x4fc526,_0x45b06d,_0xa5eaf6;if(_0x386197<=0x0){_0x386197=0x1;}_0x4fc526=new RegExp(_0x5dbe('0x168')+_0x386197+'}$');_0x45b06d=Math['pow'](0xa,_0x386197-0x1);_0xa5eaf6=Math[_0x5dbe('0x169')](0xa,_0x386197)-0x1;return util[_0x5dbe('0x7e')]('%s',_[_0x5dbe('0x16a')](_0x60346,_0x4fc526,_[_0x5dbe('0x16b')](_0x45b06d,_0xa5eaf6)));}function extractCalleridName(_0x42a283){var _0xbdd001=_0x42a283[_0x5dbe('0x16c')](/"(.*?)"/);return _0xbdd001?_0xbdd001[0x1]:_0x42a283;}function extractCalleridNumber(_0x3d56ab){var _0x3286c0=_0x3d56ab[_0x5dbe('0x16c')](/<(.*?)>/);return _0x3286c0?_0x3286c0[0x1]:_0x3d56ab;}Dialer[_0x5dbe('0x1c')][_0x5dbe('0x16d')]=function(_0x220ce5,_0x1716e7){var _0x21f9cc=this;var _0x55c7c2=uuid['v4']();this[_0x5dbe('0x26')][_0x55c7c2]=new Action(_0x220ce5,_0x1716e7,_0x55c7c2);return new BPromise(function(_0x1fb9d4,_0x10b482){if(_[_0x5dbe('0x40')](_0x220ce5)&&_0x5dbe('0x16e')!==typeof _0x220ce5){return _0x10b482(msgResponse(_0x5dbe('0x16f'),_0x5dbe('0x146'),_0x5dbe('0x170')));}if(_[_0x5dbe('0x40')](_0x1716e7[_0x5dbe('0x171')][_0x5dbe('0x172')])||_0x1716e7[_0x5dbe('0x171')][_0x5dbe('0x172')]===null){return _0x10b482(msgResponse(_0x5dbe('0x16f'),'Failure',_0x5dbe('0x173')));}var _0x404789={'XMD-CALLERID':_0x21f9cc[_0x5dbe('0x26')][_0x55c7c2]['getCaller'](),'XMD-AGI':_0x220ce5[_0x5dbe('0x10b')]?util[_0x5dbe('0x7e')]('\x22agi://%s/square,%s\x22',ipAgi,_0x220ce5[_0x5dbe('0x10b')]):_0x5dbe('0x174'),'XMD-AGIAFTER':_0x220ce5[_0x5dbe('0x112')]?util[_0x5dbe('0x7e')](_0x5dbe('0x175'),ipAgi,_0x220ce5[_0x5dbe('0x112')]):'NONE','XMD-QUEUE':_0x220ce5['type']===_0x5dbe('0x9b')?util[_0x5dbe('0x7e')](_0x5dbe('0x176'),_0x220ce5[_0x5dbe('0x43')],_0x220ce5['dialQueueOptions']||'',_0x220ce5['dialAgiAfterHangupAgent']?'c':'',_0x220ce5[_0x5dbe('0x11b')]||0x3):'NONE','XMD-CONTACTID':_0x1716e7['ContactId'],'XMD-CDRTYPE':_0x5dbe('0x8'),'CALLERID(all)':_0x21f9cc[_0x5dbe('0x26')][_0x55c7c2][_0x5dbe('0x177')](),'XMD-AMD':_0x220ce5[_0x5dbe('0xe4')]?_0x5dbe('0x178'):_0x5dbe('0x174'),'XMD-DESTINATION':_0x5dbe('0xe3')};if(_0x220ce5[_0x5dbe('0xe4')]){_0x404789[_0x5dbe('0x179')]=_0x220ce5['dialAMDInitialSilence']||0x9c4;_0x404789[_0x5dbe('0x17a')]=_0x220ce5['dialAMDGreeting']||0x5dc;_0x404789['XMD-AMDAFTERGREETINGSILENCE']=_0x220ce5[_0x5dbe('0x17b')]||0x320;_0x404789[_0x5dbe('0x17c')]=_0x220ce5[_0x5dbe('0x17d')]||0x1388;_0x404789[_0x5dbe('0x17e')]=_0x220ce5[_0x5dbe('0x17f')]||0x64;_0x404789['XMD-AMDBETWEENWORDSSILENCE']=_0x220ce5['dialAMDBetweenWordsSilence']||0x32;_0x404789[_0x5dbe('0x180')]=_0x220ce5[_0x5dbe('0x181')]||0x3;_0x404789[_0x5dbe('0x182')]=_0x220ce5[_0x5dbe('0x183')]||0x100;_0x404789[_0x5dbe('0x184')]=_0x220ce5[_0x5dbe('0x185')]||0x1388;}if(_0x220ce5[_0x5dbe('0x5b')]===_0x5dbe('0x9b')){_0x404789[_0x5dbe('0x186')]=_0x1716e7['VoiceQueueId'];}else{_0x404789[_0x5dbe('0x187')]=_0x1716e7[_0x5dbe('0xff')];}for(var _0x3d34fa in _0x1716e7[_0x5dbe('0x171')]){if(_0x1716e7['Contact']['hasOwnProperty'](_0x3d34fa)){if(isNotNull(_0x1716e7[_0x5dbe('0x171')][_0x3d34fa])&&_0x3d34fa!=='id'&&_0x3d34fa!==_0x5dbe('0x188')&&_0x3d34fa!==_0x5dbe('0x189')&&_0x3d34fa!==_0x5dbe('0x18a')){_0x404789[util[_0x5dbe('0x7e')]('%s%s',_0x5dbe('0x18b'),_[_0x5dbe('0x18c')](_0x3d34fa))]=_0x1716e7[_0x5dbe('0x171')][_0x3d34fa];}}}var _0x55ef6b=_0x21f9cc['isTrunkReachable'](_0x220ce5[_0x5dbe('0x7b')])?getCallerId(_0x220ce5[_0x5dbe('0x7b')]['callerid'],_0x220ce5[_0x5dbe('0x61')],_0x220ce5[_0x5dbe('0x18d')]>0x0?getCallerIdRandom(_0x220ce5[_0x5dbe('0x62')],_0x220ce5[_0x5dbe('0x18d')]):_0x220ce5['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x220ce5[_0x5dbe('0x142')])?_0x220ce5['Trunk'][_0x5dbe('0x7d')]:_0x220ce5['TrunkBackup'][_0x5dbe('0x7d')],_0x220ce5[_0x5dbe('0x61')],_0x220ce5['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x220ce5['dialOriginateCallerIdNumber'],_0x220ce5[_0x5dbe('0x18d')]):_0x220ce5[_0x5dbe('0x62')]);if(_0x55ef6b){_0x404789[_0x5dbe('0x18e')]=_0x21f9cc[_0x5dbe('0x26')][_0x55c7c2][_0x5dbe('0x18f')]=extractCalleridName(_0x55ef6b);_0x404789[_0x5dbe('0x190')]=_0x21f9cc[_0x5dbe('0x26')][_0x55c7c2]['originatecalleridnum']=extractCalleridNumber(_0x55ef6b);}return ami[_0x5dbe('0xba')]({'actionid':_0x55c7c2,'action':_0x5dbe('0x16f'),'channel':_0x21f9cc['isTrunkReachable'](_0x220ce5[_0x5dbe('0x7b')])?util[_0x5dbe('0x7e')](_0x5dbe('0x191'),_0x220ce5[_0x5dbe('0x7b')][_0x5dbe('0x43')],isNotNull(_0x220ce5[_0x5dbe('0x64')])?_0x220ce5[_0x5dbe('0x64')][_0x5dbe('0x192')]()||'':'',_0x220ce5['dialCutDigit']>0x0?_0x1716e7[_0x5dbe('0x171')][_0x5dbe('0x172')][_0x5dbe('0x193')](_0x220ce5[_0x5dbe('0x194')]):_0x1716e7['Contact'][_0x5dbe('0x172')]):util[_0x5dbe('0x7e')](_0x5dbe('0x191'),_[_0x5dbe('0xb9')](_0x220ce5[_0x5dbe('0x142')])?_0x220ce5[_0x5dbe('0x7b')][_0x5dbe('0x43')]:_0x220ce5[_0x5dbe('0x142')][_0x5dbe('0x43')],isNotNull(_0x220ce5[_0x5dbe('0x64')])?_0x220ce5[_0x5dbe('0x64')][_0x5dbe('0x192')]()||'':'',_0x220ce5[_0x5dbe('0x194')]>0x0?_0x1716e7[_0x5dbe('0x171')][_0x5dbe('0x172')][_0x5dbe('0x193')](_0x220ce5['dialCutDigit']):_0x1716e7[_0x5dbe('0x171')][_0x5dbe('0x172')]),'callerid':_0x55ef6b,'Exten':_0x5dbe('0xe3'),'Context':_0x5dbe('0x195'),'Priority':'1','variable':_0x404789,'timeout':(_0x220ce5[_0x5dbe('0x63')]||0x1e)*0x3e8,'async':!![],'channelid':_0x55c7c2})[_0x5dbe('0xc4')](function(_0x31b15f){return _0x1fb9d4(_0x31b15f);})['catch'](function(_0x34c215){_0x220ce5[_0x5dbe('0x6e')]+=0x1;var _0x179354=new History(_0x21f9cc[_0x5dbe('0x26')][_0x55c7c2]);logger[_0x5dbe('0xa2')](util[_0x5dbe('0x7e')](_0x5dbe('0x196'),JSON[_0x5dbe('0x4d')](_0x34c215)));_0x179354[_0x5dbe('0xe6')]=0xe;_0x179354['statedesc']=_0x5dbe('0x197');_0x179354[_0x5dbe('0xb3')]=moment()[_0x5dbe('0x7e')](_0x5dbe('0xfc'));_0x179354[_0x5dbe('0xb2')]=_0x179354[_0x5dbe('0xb3')];_0x21f9cc['createHistory'](_0x179354)[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x198')));_0x21f9cc[_0x5dbe('0xd4')](_0x179354)[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x198')))['finally'](function(){delete _0x21f9cc[_0x5dbe('0x26')][_0x55c7c2];return _0x10b482(msgResponse(_0x5dbe('0x16f'),_0x5dbe('0x4c'),'originate\x20action\x20Error'));});});});};Dialer[_0x5dbe('0x1c')]['syncOriginateResponse']=function(_0x341b48){var _0x39646d=this[_0x5dbe('0x26')][_0x341b48[_0x5dbe('0x12b')]];var _0x35fc95=this;if(_0x39646d){delete this['actions'][_0x341b48[_0x5dbe('0x12b')]];_0x39646d[_0x5dbe('0x11a')]=moment()[_0x5dbe('0x7e')](_0x5dbe('0xfc'));var _0x13d461=_0x39646d[_0x5dbe('0x5b')]===_0x5dbe('0x9c')?this[_0x5dbe('0x21')][_0x39646d['queue']]:this[_0x5dbe('0x20')][_0x39646d[_0x5dbe('0x199')]()];if(!this['isSuccess'](_0x341b48[_0x5dbe('0x19a')])){this['updateOriginated'](_0x13d461);return this[_0x5dbe('0x19b')](_0x39646d,_0x13d461,_0x341b48)['then'](function(_0xbc8cfe){})[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x19c')));}else{this[_0x5dbe('0xb5')][_0x341b48['uniqueid']]=_0x39646d;}}};Dialer['prototype'][_0x5dbe('0x19d')]=function(_0x5c8e09,_0x218988,_0x51dbb1){var _0x53f633=new History(_0x218988);if(_0x53f633[_0x5dbe('0xef')]+_0x53f633['countcongestionretry']+_0x53f633['countnoanswerretry']+_0x53f633['countnosuchnumberretry']+_0x53f633[_0x5dbe('0xf2')]+_0x53f633[_0x5dbe('0xf3')]+_0x53f633[_0x5dbe('0xec')]+_0x53f633['countagentrejectretry']>=_0x51dbb1[_0x5dbe('0xf5')]-0x1){return!![];}switch(_0x5c8e09){case 0x3:if(_0x53f633[_0x5dbe('0xf0')]>=_0x51dbb1[_0x5dbe('0x19e')]-0x1){return!![];}else{this[_0x5dbe('0xcb')]({'active':![],'countnoanswerretry':_0x53f633[_0x5dbe('0xf0')]+=0x1,'scheduledat':moment()[_0x5dbe('0x106')](_0x51dbb1['dialNoAnswerRetryFrequency'],_0x5dbe('0xfb'))[_0x5dbe('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x53f633[_0x5dbe('0xfd')],'ListId':_0x53f633[_0x5dbe('0xdb')],'VoiceQueueId':_0x53f633[_0x5dbe('0xfe')]||undefined,'CampaignId':_0x53f633[_0x5dbe('0xff')]||undefined})['catch'](loggerCatch(_0x5dbe('0x19f')));}break;case 0x5:if(_0x53f633[_0x5dbe('0xef')]>=_0x51dbb1['dialBusyMaxRetry']-0x1){return!![];}else{this[_0x5dbe('0xcb')]({'active':![],'countbusyretry':_0x53f633[_0x5dbe('0xef')]+=0x1,'scheduledat':moment()[_0x5dbe('0x106')](_0x51dbb1['dialBusyRetryFrequency'],_0x5dbe('0xfb'))[_0x5dbe('0x7e')](_0x5dbe('0xfc')),'ContactId':_0x53f633[_0x5dbe('0xfd')],'ListId':_0x53f633['ListId'],'VoiceQueueId':_0x53f633[_0x5dbe('0xfe')]||undefined,'CampaignId':_0x53f633['CampaignId']||undefined})[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x1a0')));}break;case 0x8:if(_0x53f633[_0x5dbe('0x105')]>=_0x51dbb1[_0x5dbe('0x1a1')]-0x1){return!![];}else{this[_0x5dbe('0xcb')]({'active':![],'countcongestionretry':_0x53f633[_0x5dbe('0x105')]+=0x1,'scheduledat':moment()[_0x5dbe('0x106')](_0x51dbb1['dialCongestionRetryFrequency'],'minutes')[_0x5dbe('0x7e')](_0x5dbe('0xfc')),'ContactId':_0x53f633[_0x5dbe('0xfd')],'ListId':_0x53f633[_0x5dbe('0xdb')],'VoiceQueueId':_0x53f633[_0x5dbe('0xfe')]||undefined,'CampaignId':_0x53f633[_0x5dbe('0xff')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;case 0x0:if(_0x53f633[_0x5dbe('0xf1')]>=_0x51dbb1['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x5dbe('0xcb')]({'active':![],'countnosuchnumberretry':_0x53f633[_0x5dbe('0xf1')]+=0x1,'scheduledat':moment()[_0x5dbe('0x106')](_0x51dbb1['dialNoSuchNumberRetryFrequency'],'minutes')[_0x5dbe('0x7e')](_0x5dbe('0xfc')),'ContactId':_0x53f633['ContactId'],'ListId':_0x53f633[_0x5dbe('0xdb')],'VoiceQueueId':_0x53f633[_0x5dbe('0xfe')]||undefined,'CampaignId':_0x53f633[_0x5dbe('0xff')]||undefined})[_0x5dbe('0xbc')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x53f633[_0x5dbe('0xf2')]>=_0x51dbb1[_0x5dbe('0x120')]-0x1){return!![];}else{this[_0x5dbe('0xcb')]({'active':![],'countdropretry':_0x53f633[_0x5dbe('0xf2')]+=0x1,'scheduledat':moment()[_0x5dbe('0x106')](_0x51dbb1[_0x5dbe('0x121')],_0x5dbe('0xfb'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x53f633[_0x5dbe('0xfd')],'ListId':_0x53f633[_0x5dbe('0xdb')],'VoiceQueueId':_0x53f633[_0x5dbe('0xfe')]||undefined,'CampaignId':_0x53f633['CampaignId']||undefined})[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x122')));}break;case 0xb:if(_0x53f633[_0x5dbe('0xf3')]>=_0x51dbb1['dialAbandonedMaxRetry']-0x1){return!![];}else{this[_0x5dbe('0xcb')]({'active':![],'countabandonedretry':_0x53f633[_0x5dbe('0xf3')]+=0x1,'scheduledat':moment()['add'](_0x51dbb1['dialAbandonedRetryFrequency'],_0x5dbe('0xfb'))['format'](_0x5dbe('0xfc')),'ContactId':_0x53f633[_0x5dbe('0xfd')],'ListId':_0x53f633[_0x5dbe('0xdb')],'VoiceQueueId':_0x53f633['VoiceQueueId']||undefined,'CampaignId':_0x53f633[_0x5dbe('0xff')]||undefined})[_0x5dbe('0xbc')](loggerCatch('[rescheduleContact][Abandoned]'));}break;case 0x13:if(_0x53f633[_0x5dbe('0xec')]>=_0x51dbb1[_0x5dbe('0xf7')]-0x1){return!![];}else{this[_0x5dbe('0xcb')]({'active':![],'countmachineretry':_0x53f633[_0x5dbe('0xec')]+=0x1,'scheduledat':moment()[_0x5dbe('0x106')](_0x51dbb1[_0x5dbe('0xfa')],_0x5dbe('0xfb'))[_0x5dbe('0x7e')](_0x5dbe('0xfc')),'ContactId':_0x53f633[_0x5dbe('0xfd')],'ListId':_0x53f633[_0x5dbe('0xdb')],'VoiceQueueId':_0x53f633[_0x5dbe('0xfe')]||undefined,'CampaignId':_0x53f633['CampaignId']||undefined})['catch'](loggerCatch(_0x5dbe('0x107')));}break;case 0x14:if(_0x53f633[_0x5dbe('0xf4')]>=_0x51dbb1['dialAgentRejectMaxRetry']-0x1){return!![];}else{this[_0x5dbe('0xcb')]({'active':![],'countagentrejectretry':_0x53f633[_0x5dbe('0xf4')]+=0x1,'scheduledat':moment()[_0x5dbe('0x106')](_0x51dbb1[_0x5dbe('0x1a2')],_0x5dbe('0xfb'))[_0x5dbe('0x7e')](_0x5dbe('0xfc')),'ContactId':_0x53f633[_0x5dbe('0xfd')],'ListId':_0x53f633[_0x5dbe('0xdb')],'VoiceQueueId':_0x53f633[_0x5dbe('0xfe')]||undefined,'CampaignId':_0x53f633[_0x5dbe('0xff')]||undefined})['catch'](loggerCatch(_0x5dbe('0x1a3')));}break;default:return!![];}};Dialer[_0x5dbe('0x1c')]['callProgressDetecting']=function(_0x33a31a,_0x4b03b9,_0x401426){var _0x559e1f=this;var _0x3a9e3f=new History(_0x33a31a);return new BPromise(function(_0x358a4b,_0x1f3437){if(_[_0x5dbe('0x40')](_0x4b03b9)&&_0x5dbe('0x16e')!==typeof _0x4b03b9){return _0x1f3437(msgResponse(_0x5dbe('0x1a4'),_0x5dbe('0x146'),'entity\x20is\x20undefine'));}if(_[_0x5dbe('0x40')](_0x401426)&&_0x5dbe('0x16e')!==typeof _0x401426){return _0x1f3437(msgResponse(_0x5dbe('0x1a4'),_0x5dbe('0x146'),_0x5dbe('0x1a5')));}switch(_0x401426[_0x5dbe('0x111')]){case'0':_0x4b03b9[_0x5dbe('0x6d')]+=0x1;_0x3a9e3f[_0x5dbe('0xe6')]=0x0;_0x3a9e3f[_0x5dbe('0xb1')]=_0x5dbe('0x1a6');_0x3a9e3f[_0x5dbe('0xf1')]+=0x1;_0x3a9e3f[_0x5dbe('0xed')]+=0x1;ami[_0x5dbe('0x51')]('custom:agentnosuchnumber',ut[_0x5dbe('0x1a7')](_0x33a31a,'nosuchnumber'));_0x559e1f[_0x5dbe('0xd5')](_0x3a9e3f)[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x104')));if(_0x559e1f[_0x5dbe('0x19d')](0x0,_0x33a31a,_0x4b03b9)){if(_0x3a9e3f[_0x5dbe('0xf1')]>=_0x4b03b9[_0x5dbe('0x1a8')]){_0x559e1f[_0x5dbe('0xf8')](_0x3a9e3f,_0x358a4b,_0x1f3437,'reason\x200\x20no\x20such\x20number....');}else{_0x559e1f[_0x5dbe('0xf6')](_0x3a9e3f,_0x358a4b,_0x1f3437,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x4b03b9[_0x5dbe('0x6c')]+=0x1;_0x3a9e3f[_0x5dbe('0xe6')]=0x3;_0x3a9e3f['statedesc']='NoAnswer';_0x3a9e3f[_0x5dbe('0xf0')]+=0x1;_0x3a9e3f['countglobal']+=0x1;ami[_0x5dbe('0x51')]('custom:agentnoanswer',ut[_0x5dbe('0x1a7')](_0x33a31a,_0x5dbe('0x1a9')));_0x559e1f['createHistory'](_0x3a9e3f)[_0x5dbe('0xbc')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x559e1f['checkRetriveMax'](0x3,_0x33a31a,_0x4b03b9)){if(_0x3a9e3f[_0x5dbe('0xf0')]>=_0x4b03b9[_0x5dbe('0x19e')]){_0x559e1f['createStateFinal'](_0x3a9e3f,_0x358a4b,_0x1f3437,_0x5dbe('0x1aa'));}else{_0x559e1f[_0x5dbe('0xf6')](_0x3a9e3f,_0x358a4b,_0x1f3437,_0x5dbe('0x1aa'));}}break;case'5':_0x4b03b9[_0x5dbe('0x67')]+=0x1;_0x3a9e3f['state']=0x5;_0x3a9e3f[_0x5dbe('0xb1')]='Busy';_0x3a9e3f['countbusyretry']+=0x1;_0x3a9e3f['countglobal']+=0x1;ami[_0x5dbe('0x51')](_0x5dbe('0x1ab'),ut['buildObj'](_0x33a31a,_0x5dbe('0x1ac')));_0x559e1f['createHistory'](_0x3a9e3f)[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x1ad')));if(_0x559e1f[_0x5dbe('0x19d')](0x5,_0x33a31a,_0x4b03b9)){if(_0x3a9e3f['countbusyretry']>=_0x4b03b9['dialBusyMaxRetry']){_0x559e1f[_0x5dbe('0xf8')](_0x3a9e3f,_0x358a4b,_0x1f3437,'reason\x205\x20busy');}else{_0x559e1f[_0x5dbe('0xf6')](_0x3a9e3f,_0x358a4b,_0x1f3437,_0x5dbe('0x1ae'));}}break;case'8':_0x4b03b9[_0x5dbe('0x68')]+=0x1;_0x3a9e3f[_0x5dbe('0xe6')]=0x8;_0x3a9e3f[_0x5dbe('0xb1')]=_0x5dbe('0x1af');_0x3a9e3f[_0x5dbe('0x105')]+=0x1;_0x3a9e3f['countglobal']+=0x1;ami[_0x5dbe('0x51')](_0x5dbe('0x1b0'),ut[_0x5dbe('0x1a7')](_0x33a31a,'congestion'));_0x559e1f['createHistory'](_0x3a9e3f)[_0x5dbe('0xbc')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x559e1f[_0x5dbe('0x19d')](0x8,_0x33a31a,_0x4b03b9)){if(_0x3a9e3f[_0x5dbe('0x105')]>=_0x4b03b9[_0x5dbe('0x1a1')]){_0x559e1f['createStateFinal'](_0x3a9e3f,_0x358a4b,_0x1f3437,_0x5dbe('0x1b1'));}else{_0x559e1f['stateGlobal'](_0x3a9e3f,_0x358a4b,_0x1f3437,_0x5dbe('0x1b1'));}}break;case'11':_0x4b03b9[_0x5dbe('0x1b2')]+=0x1;_0x3a9e3f[_0x5dbe('0xe6')]=0xb;_0x3a9e3f['statedesc']=_0x5dbe('0x126');_0x3a9e3f['countabandonedretry']+=0x1;_0x3a9e3f[_0x5dbe('0xed')]+=0x1;_0x559e1f['createHistory'](_0x3a9e3f)['catch'](loggerCatch(_0x5dbe('0x129')));if(_0x559e1f['checkRetriveMax'](0xb,_0x33a31a,_0x4b03b9)){if(_0x3a9e3f[_0x5dbe('0xf3')]>=_0x4b03b9[_0x5dbe('0x1b3')]){_0x559e1f['createStateFinal'](_0x3a9e3f,_0x358a4b,_0x1f3437,_0x5dbe('0x1b4'));}else{_0x559e1f[_0x5dbe('0xf6')](_0x3a9e3f,_0x358a4b,_0x1f3437,_0x5dbe('0x1b4'));}}break;case'20':_0x4b03b9[_0x5dbe('0x1b5')]+=0x1;_0x3a9e3f[_0x5dbe('0xe6')]=0x14;_0x3a9e3f[_0x5dbe('0xb1')]='AgentReject';_0x3a9e3f[_0x5dbe('0xf4')]+=0x1;_0x3a9e3f[_0x5dbe('0xed')]+=0x1;ami[_0x5dbe('0x51')](_0x5dbe('0x1b6'),ut[_0x5dbe('0x1a7')](_0x33a31a,_0x5dbe('0x1b7')));_0x559e1f[_0x5dbe('0xd5')](_0x3a9e3f)['catch'](loggerCatch(_0x5dbe('0x1b8')));if(_0x559e1f['checkRetriveMax'](0x14,_0x33a31a,_0x4b03b9)){if(_0x3a9e3f[_0x5dbe('0xf4')]>=_0x4b03b9[_0x5dbe('0x1b9')]){_0x559e1f[_0x5dbe('0xf8')](_0x3a9e3f,_0x358a4b,_0x1f3437,'reason\x2020\x20agentreject');}else{_0x559e1f[_0x5dbe('0xf6')](_0x3a9e3f,_0x358a4b,_0x1f3437,_0x5dbe('0x1ba'));}}break;default:_0x4b03b9[_0x5dbe('0x10e')]+=0x1;_0x3a9e3f[_0x5dbe('0xe6')]=0xc;_0x3a9e3f['statedesc']=_0x401426[_0x5dbe('0x111')];_0x559e1f[_0x5dbe('0xd5')](_0x3a9e3f)['catch'](loggerCatch(_0x5dbe('0x1bb')));if(_0x559e1f['checkRetriveMax'](_0x401426[_0x5dbe('0x111')],_0x33a31a,_0x4b03b9)){if(_0x3a9e3f[_0x5dbe('0xef')]+_0x3a9e3f[_0x5dbe('0x105')]+_0x3a9e3f[_0x5dbe('0xf0')]+_0x3a9e3f[_0x5dbe('0xf1')]+_0x3a9e3f['countdropretry']+_0x3a9e3f[_0x5dbe('0xf3')]+_0x3a9e3f[_0x5dbe('0xec')]+_0x3a9e3f[_0x5dbe('0xf4')]>=_0x4b03b9['dialGlobalMaxRetry']){_0x559e1f[_0x5dbe('0xf6')](_0x3a9e3f,_0x358a4b,_0x1f3437,_0x401426[_0x5dbe('0x111')]);}else{_0x559e1f[_0x5dbe('0xf8')](_0x3a9e3f,_0x358a4b,_0x1f3437,_0x401426[_0x5dbe('0x111')]);}}}});};Dialer['prototype'][_0x5dbe('0xf6')]=function(_0x1c5c75,_0x1e88b0,_0x346c9f,_0x53d34a){var _0x3a88cf=new Final(_0x1c5c75);_0x3a88cf['state']=0xf;_0x3a88cf[_0x5dbe('0xb1')]=_0x5dbe('0x1bc');this['createStateFinal'](_0x3a88cf,_0x1e88b0,_0x346c9f,_0x53d34a);};Dialer[_0x5dbe('0x1c')][_0x5dbe('0xf8')]=function(_0x5de6ec,_0x252bd4,_0x4c7a96,_0x1a9fc0){this['moveContactManagedDialer'](_0x5de6ec)['then'](function(_0x25c661){return _0x252bd4(msgResponse('[callProgressDetecting]',_0x5dbe('0xdd'),_0x1a9fc0));})[_0x5dbe('0xbc')](function(_0x510d02){return _0x4c7a96(msgResponse('[moveContactManagedDialer][0]',_0x5dbe('0x146'),_0x5dbe('0x1bd')));});};Dialer['prototype'][_0x5dbe('0xa')]=function(_0x278e83){var _0x16da23=this;var _0x4f5c49=_0x278e83[_0x5dbe('0x1be')]/0x64;var _0x3cc877=_0x278e83[_0x5dbe('0x6b')]/(_0x278e83['outboundDropCallsDayTimeout']+_0x278e83['outboundAnswerCallsDay']);var _0x4332f2=Math[_0x5dbe('0x1bf')](_0x278e83[_0x5dbe('0x76')]*(_0x278e83[_0x5dbe('0x1c0')]/0x64));var _0x4c31c6=Math[_0x5dbe('0x1bf')](_0x278e83[_0x5dbe('0x76')]*(_0x278e83[_0x5dbe('0x1c1')]/0x64));var _0x28d71e=_0x278e83['available']+_0x278e83[_0x5dbe('0x59')];var _0x1f7bc9=Math[_0x5dbe('0x1c2')](_0x278e83['erlangCalls']*_0x278e83[_0x5dbe('0x7a')]*_0x278e83['predictiveIntervalHitRate']*_0x278e83['predictiveIntervalMultiplicativeFactor']);if(_[_0x5dbe('0x40')](_0x278e83[_0x5dbe('0x97')])){if(!_[_0x5dbe('0x40')](_0x278e83[_0x5dbe('0x29')])){_0x278e83[_0x5dbe('0x29')]=undefined;loggerPredictive[_0x5dbe('0xa2')](_0x5dbe('0x1c3'),_0x5dbe('0x1c4'));}if(!_[_0x5dbe('0x40')](_0x278e83[_0x5dbe('0x99')])){loggerPredictive[_0x5dbe('0xa2')](_0x5dbe('0x1c3'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x278e83[_0x5dbe('0x99')]);_0x278e83[_0x5dbe('0x99')]=undefined;}_0x278e83['startProgressive']=moment()[_0x5dbe('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x278e83[_0x5dbe('0x43')],'collection\x20data\x20in\x20progressive\x20at',_0x278e83[_0x5dbe('0x97')]);this[_0x5dbe('0x15d')](_0x278e83,0x1);}else if(ifInterval(_0x278e83[_0x5dbe('0x1c5')],_0x278e83[_0x5dbe('0x97')])){this[_0x5dbe('0x15d')](_0x278e83,0x1);loggerPredictiveCalls['info'](_0x5dbe('0x1c6'),_0x278e83[_0x5dbe('0x97')],_0x278e83[_0x5dbe('0x43')]);_0x278e83[_0x5dbe('0x1c7')]=0x0;_0x278e83[_0x5dbe('0x1c8')]=0x0;}else if(_0x4f5c49<_0x3cc877&&_0x278e83['dialPredictiveOptimization']===_0x5dbe('0x1c9')){freeVariablesPredictive(_0x278e83);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x1ca'),_0x5dbe('0x1cb'),_0x3cc877,'startProgressive',_0x278e83['name']);}else if(_0x1f7bc9<_0x278e83[_0x5dbe('0x1c8')]&&_0x278e83[_0x5dbe('0x1cc')]===_0x5dbe('0x1c9')){freeVariablesPredictive(_0x278e83);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x1cd'),_0x5dbe('0x1ce'),_0x1f7bc9,_0x5dbe('0x1cf'),_0x278e83['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x278e83[_0x5dbe('0x43')]);}else if(!ifInterval(_0x278e83['dialPredictiveInterval'],_0x278e83[_0x5dbe('0x97')])&&_[_0x5dbe('0x40')](_0x278e83[_0x5dbe('0x29')])&&!_['isUndefined'](_0x278e83[_0x5dbe('0x97')])){_0x278e83['startPredictive']=moment()[_0x5dbe('0x7e')](_0x5dbe('0xfc'));loggerPredictive[_0x5dbe('0x82')](_0x278e83['name'],'started\x20in\x20predictive\x20at',_0x278e83[_0x5dbe('0x29')]);this[_0x5dbe('0xca')](_0x278e83[_0x5dbe('0x1c5')])[_0x5dbe('0xc4')](this['getDataPredictive'](_0x278e83))['then'](mergeDataErlangB(_0x278e83))[_0x5dbe('0xc4')](this['startMethodPredictive'](_0x278e83))[_0x5dbe('0xbc')](loggerCatchPredictive(_0x5dbe('0x1d0'),_0x278e83));}else if(!ifInterval(_0x278e83['dialPredictiveInterval'],_0x278e83[_0x5dbe('0x29')])){_0x278e83[_0x5dbe('0x1c8')]=0x0;_0x278e83[_0x5dbe('0x29')]=moment()[_0x5dbe('0x7e')](_0x5dbe('0xfc'));loggerPredictive[_0x5dbe('0x82')](_0x278e83[_0x5dbe('0x43')],_0x5dbe('0x1d1'),_0x278e83['startPredictive']);clearInterval(_0x278e83['handlePredictive']);_0x278e83[_0x5dbe('0x99')]=undefined;this[_0x5dbe('0xca')](_0x278e83[_0x5dbe('0x1c5')])[_0x5dbe('0xc4')](this[_0x5dbe('0x1d2')](_0x278e83))[_0x5dbe('0xc4')](mergeDataErlangB(_0x278e83))[_0x5dbe('0xc4')](this['startMethodPredictive'](_0x278e83))[_0x5dbe('0xbc')](loggerCatchPredictive(_0x5dbe('0x1d3'),_0x278e83));}else if(_0x278e83[_0x5dbe('0x76')]&&_0x28d71e<_0x278e83[_0x5dbe('0x76')]-_0x4c31c6){freeVariablesPredictive(_0x278e83);loggerPredictive[_0x5dbe('0x82')](_0x278e83[_0x5dbe('0x43')],_0x5dbe('0x1d4'),_0x28d71e,_0x5dbe('0x1d5'),_0x278e83['predictiveIntervalAvailable'],'-',_0x4c31c6,'=',_0x278e83[_0x5dbe('0x76')]-_0x4c31c6,')');}else if(_0x278e83[_0x5dbe('0x76')]&&_0x28d71e>_0x278e83[_0x5dbe('0x76')]+_0x4332f2){freeVariablesPredictive(_0x278e83);loggerPredictive['info'](_0x278e83[_0x5dbe('0x43')],_0x5dbe('0x1d4'),_0x28d71e,_0x5dbe('0x1d6'),_0x278e83[_0x5dbe('0x76')],'+',_0x4332f2,'=',_0x278e83['predictiveIntervalAvailable']+_0x4332f2,')');}};Dialer[_0x5dbe('0x1c')][_0x5dbe('0x1d2')]=function(_0x21e17d){var _0x12d056=this;return function(_0x193bb5){return new BPromise(function(_0x3f2eac,_0x2aa8eb){_[_0x5dbe('0x96')](_0x21e17d,_0x193bb5[0x0]);if(checkGetDataPredictive(_0x193bb5[0x0])){var _0x5a0d4=_0x21e17d[_0x5dbe('0x76')]=_0x21e17d[_0x5dbe('0x59')]+_0x21e17d['available'];var _0x589645=_0x21e17d['dialPredictiveInterval']*0x3c;var _0x4a2165=_0x193bb5[0x0][_0x5dbe('0x70')]+_0x193bb5[0x0][_0x5dbe('0x8a')];var _0x3a813a=(_0x193bb5[0x0][_0x5dbe('0x85')]+_0x193bb5[0x0][_0x5dbe('0x87')]+_0x193bb5[0x0][_0x5dbe('0x71')])/_0x193bb5[0x0]['predictiveIntervalTotalCalls'];_0x21e17d[_0x5dbe('0x73')]=_0x3a813a>0x0?_0x3a813a:0x1;switch(_0x21e17d[_0x5dbe('0x1cc')]){case _0x5dbe('0x1c9'):var _0x35c869=_0x21e17d[_0x5dbe('0x1be')]/0x64;return _0x12d056[_0x5dbe('0x1d7')](_0x5a0d4,_0x589645,_0x4a2165,_0x3a813a,_0x35c869)['then'](function(_0x3a3c1e){return _0x3f2eac(_0x3a3c1e);});case'agentBusyFactor':var _0x52384b=_0x21e17d[_0x5dbe('0x1be')]/0x64;return _0x12d056[_0x5dbe('0x1d8')](_0x5a0d4,_0x589645,_0x4a2165,_0x3a813a,_0x52384b)[_0x5dbe('0xc4')](function(_0x5a855c){return _0x3f2eac(_0x5a855c);});default:return _0x2aa8eb(msgResponse(_0x5dbe('0x1d9'),_0x5dbe('0x146'),_0x5dbe('0x1da')));}}else{return _0x2aa8eb(msgResponse(_0x5dbe('0x1d9'),_0x5dbe('0x146'),_0x5dbe('0x1db')));}});};};Dialer[_0x5dbe('0x1c')][_0x5dbe('0x1dc')]=function(_0x4e828f){var _0x5ddb46=this;return function(_0x24e580){return new BPromise(function(_0x65490a,_0x2d256e){_['merge'](_0x4e828f,_0x24e580[0x0]);if(checkGetDataPredictive(_0x24e580[0x0])){loggerPredictive[_0x5dbe('0x82')](JSON[_0x5dbe('0x4d')](_0x24e580[0x0]));if(_0x4e828f['dialPredictiveOptimization']==='dropRate'){return _0x5ddb46[_0x5dbe('0xd2')](_0x4e828f['id'])[_0x5dbe('0xc4')](function(_0x1ee6a9){var _0x220972=_0x4e828f[_0x5dbe('0x55')]-_0x1ee6a9[0x0][_0x5dbe('0x1dd')];var _0x5a5e99=_0x4e828f[_0x5dbe('0x1c5')]*0x3c;var _0x49c7e3=_0x24e580[0x0][_0x5dbe('0x70')]+_0x24e580[0x0][_0x5dbe('0x8a')];var _0x37efad=(_0x24e580[0x0][_0x5dbe('0x85')]+_0x24e580[0x0][_0x5dbe('0x87')]+_0x24e580[0x0][_0x5dbe('0x71')])/_0x24e580[0x0][_0x5dbe('0x77')];var _0x4e5c34=_0x4e828f['dialPredictiveOptimizationPercentage']/0x64;_0x4e828f[_0x5dbe('0x75')]=_0x1ee6a9[0x0][_0x5dbe('0x1dd')]||0x0;_0x4e828f[_0x5dbe('0x73')]=_0x37efad>0x0?_0x37efad:0x1;return _0x5ddb46[_0x5dbe('0x1d7')](_0x220972,_0x5a5e99,_0x49c7e3,_0x37efad,_0x4e5c34);})[_0x5dbe('0xc4')](function(_0x532498){return _0x65490a(_0x532498);})[_0x5dbe('0xbc')](function(_0x16c50a){return _0x2d256e(msgResponse('[CatchErlangB]','Failure',JSON[_0x5dbe('0x4d')](_0x16c50a)));});}if(_0x4e828f[_0x5dbe('0x1cc')]===_0x5dbe('0x1de')){return _0x5ddb46['getVoiceQueueRtPauses'](_0x4e828f['id'])[_0x5dbe('0xc4')](function(_0x22206a){var _0x4da282=_0x4e828f[_0x5dbe('0x55')]-_0x22206a[0x0][_0x5dbe('0x1dd')];var _0x390839=_0x4e828f[_0x5dbe('0x1c5')]*0x3c;var _0x2fc626=_0x24e580[0x0][_0x5dbe('0x70')]+_0x24e580[0x0][_0x5dbe('0x8a')];var _0x3f5182=(_0x24e580[0x0]['predictiveIntervalAnsweredCalls']+_0x24e580[0x0][_0x5dbe('0x87')]+_0x24e580[0x0][_0x5dbe('0x71')])/_0x24e580[0x0]['predictiveIntervalTotalCalls'];var _0x280339=_0x4e828f[_0x5dbe('0x1be')]/0x64;_0x4e828f['predictiveIntervalPauses']=_0x22206a[0x0][_0x5dbe('0x1dd')]||0x0;_0x4e828f['predictiveIntervalHitRate']=_0x3f5182>0x0?_0x3f5182:0x1;return _0x5ddb46[_0x5dbe('0x1d8')](_0x4da282,_0x390839,_0x2fc626,_0x3f5182,_0x280339);})[_0x5dbe('0xc4')](function(_0x3174cd){return _0x65490a(_0x3174cd);})['catch'](function(_0x2f45b1){return _0x2d256e(msgResponse('[CatchErlangB]',_0x5dbe('0x146'),JSON['stringify'](_0x2f45b1)));});}}else{return _0x2d256e(msgResponse(_0x5dbe('0x1d9'),_0x5dbe('0x146'),_0x5dbe('0x1db')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x1a0c74){var _0xa1405b=this;return function(){var _0x59175f=0x0;var _0x2d6348=Math[_0x5dbe('0x1c2')](_0x1a0c74[_0x5dbe('0x79')]*0x3e8);if(_0x2d6348>0x0){_0x2d6348=_0x2d6348<0x64?0x64:_0x2d6348;loggerPredictive[_0x5dbe('0x82')](_0x1a0c74['name'],_0x5dbe('0x1df'),_0x2d6348,'milliseconds');_0x1a0c74[_0x5dbe('0x99')]=setInterval(function(){_0xa1405b[_0x5dbe('0x99')](_0x1a0c74);loggerPredictiveCalls[_0x5dbe('0x82')](_0x5dbe('0x1e0'),_0x59175f+=0x1);},_0x2d6348);}else{loggerPredictive[_0x5dbe('0x82')](_0x1a0c74[_0x5dbe('0x43')],_0x5dbe('0x1e1'));}};};Dialer['prototype'][_0x5dbe('0x1e2')]=function(_0x20db5f,_0x3cde4e){var _0x273c91=this;return function(_0x3ad59b){if(_[_0x5dbe('0x4a')](_0x3ad59b)){if(_[_0x5dbe('0xb9')](_0x3cde4e[_0x5dbe('0x1e3')])||!_0x3cde4e[_0x5dbe('0x1e4')]){if(_0x20db5f[_0x5dbe('0x60')]===_0x5dbe('0x9')){_0x20db5f['queueStatusComplete']=_[_0x5dbe('0x40')](_0x20db5f[_0x5dbe('0x131')])?!![]:_0x20db5f[_0x5dbe('0x131')];var _0x32d7b8=uuid['v4']();_0x273c91[_0x5dbe('0x26')][_0x32d7b8]=new Action(_0x20db5f,_0x3cde4e,_0x32d7b8);loggerBooked['info']('[booked][checkContactBlack]',_0x32d7b8,_0x5dbe('0x1e5'),JSON[_0x5dbe('0x4d')](_0x20db5f[_0x5dbe('0x131')]),'Queue:\x20',_0x20db5f[_0x5dbe('0x43')]);if(_0x20db5f[_0x5dbe('0x131')]){_0x20db5f[_0x5dbe('0x131')]=![];_0x273c91[_0x5dbe('0x2b')][_0x273c91[_0x5dbe('0x26')][_0x32d7b8]['queue']]=[];ami[_0x5dbe('0xba')]({'actionid':_0x32d7b8,'action':_0x5dbe('0x1e6'),'queue':_0x20db5f[_0x5dbe('0x43')]})[_0x5dbe('0xbc')](function(_0x265c4e){_0x273c91[_0x5dbe('0xbe')](_0x20db5f);_0x273c91[_0x5dbe('0xcb')]({'active':![],'ContactId':_0x273c91['actions'][_0x32d7b8][_0x5dbe('0xfd')],'ListId':_0x273c91[_0x5dbe('0x26')][_0x32d7b8][_0x5dbe('0xdb')],'VoiceQueueId':_0x273c91[_0x5dbe('0x26')][_0x32d7b8][_0x5dbe('0xfe')]||undefined,'CampaignId':_0x273c91[_0x5dbe('0x26')][_0x32d7b8][_0x5dbe('0xff')]||undefined})[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x1e7')));delete _0x273c91[_0x5dbe('0x26')][_0x32d7b8];});}else{loggerBooked[_0x5dbe('0x82')](_0x5dbe('0x1e8'),JSON[_0x5dbe('0x4d')](_0x20db5f[_0x5dbe('0x131')]),_0x5dbe('0x1e9'),_0x20db5f['name']);_0x273c91[_0x5dbe('0xbe')](_0x20db5f);_0x273c91[_0x5dbe('0xcb')]({'active':![],'ContactId':_0x273c91[_0x5dbe('0x26')][_0x32d7b8]['ContactId'],'ListId':_0x273c91['actions'][_0x32d7b8]['ListId'],'VoiceQueueId':_0x273c91[_0x5dbe('0x26')][_0x32d7b8][_0x5dbe('0xfe')]||undefined,'CampaignId':_0x273c91[_0x5dbe('0x26')][_0x32d7b8][_0x5dbe('0xff')]||undefined})[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x1e7')));delete _0x273c91[_0x5dbe('0x26')][_0x32d7b8];}}else{return _0x273c91[_0x5dbe('0x16d')](_0x20db5f,_0x3cde4e);}}else{if(getDiff(_0x3cde4e['scheduledat'])<_0x20db5f[_0x5dbe('0x1ea')]*0x3c){if(_0x3cde4e['Agent']&&!_0x3cde4e[_0x5dbe('0x1eb')]['voicePause']){_0x273c91[_0x5dbe('0x1f')][_0x5dbe('0x1ec')](_0x3cde4e['id'])['finally'](function(){_0x273c91['updateOriginated'](_0x20db5f);});}else{_0x273c91[_0x5dbe('0xcd')]({'active':![]},_0x3cde4e['id'],0x1)['finally'](function(){console[_0x5dbe('0x1ed')](_0x5dbe('0x1ee'));_0x273c91[_0x5dbe('0xbe')](_0x20db5f);});}}else{_0x20db5f[_0x5dbe('0x6f')]+=0x1;_0x273c91['updateOriginated'](_0x20db5f);if(_0x20db5f[_0x5dbe('0x1ef')]){_0x273c91[_0x5dbe('0xcb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3cde4e['ContactId'],'ListId':_0x3cde4e[_0x5dbe('0xdb')],'VoiceQueueId':_0x3cde4e['VoiceQueueId']||undefined,'CampaignId':_0x3cde4e['CampaignId']||undefined})[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x1f0')));_0x273c91[_0x5dbe('0xd5')](createObjHistory(_0x20db5f,_0x3cde4e,'RECALLINQUEUE',0x17,_0x5dbe('0x1f1')))[_0x5dbe('0xbc')](loggerCatch(_0x5dbe('0x1f2')));}else{_0x273c91[_0x5dbe('0xda')](createObjHistory(_0x20db5f,_0x3cde4e,'RECALLFAILEDTIMEOUT',0x16,_0x5dbe('0x1f3')),_0x5dbe('0x1f4'),_0x5dbe('0x1f5'));}}}}else{_0x20db5f[_0x5dbe('0x66')]+=0x1;_0x273c91[_0x5dbe('0xda')](createObjHistory(_0x20db5f,_0x3cde4e,_0x5dbe('0x1f6'),0xd,'Blacklist'),_0x5dbe('0x1f7'),'[Originate][MoveBlacklist]');throw _0x5dbe('0x1f8');}};};Dialer['prototype'][_0x5dbe('0x160')]=function(_0x18178f){var _0x350514=this;var _0x40ff06=[];var _0x278bfb=_0x18178f[_0x5dbe('0x1f9')]-_0x18178f['originated']-_0x18178f[_0x5dbe('0x1fa')];emitCampaignSummary(_0x18178f);if(_0x278bfb>0x0){if(_0x278bfb>this['maxNumberOriginate']){_0x278bfb=this[_0x5dbe('0x24')];}_0x18178f[_0x5dbe('0x1fa')]+=_0x278bfb;this[_0x5dbe('0xd1')](_0x18178f['id'],_0x278bfb,_0x18178f[_0x5dbe('0x1fb')])[_0x5dbe('0xc4')](function(_0x2976b2){_0x18178f[_0x5dbe('0x1fa')]-=_0x278bfb;_0x18178f['temp']=_0x18178f[_0x5dbe('0x1fa')]>0x0?_0x18178f[_0x5dbe('0x1fa')]:0x0;if(!checkContactEmpty(_0x2976b2)){_0x18178f['message']=_0x5dbe('0xa9');logger[_0x5dbe('0x82')](_0x5dbe('0x1fc')+_0x18178f[_0x5dbe('0x43')]);}else{_0x18178f[_0x5dbe('0x78')]+=_0x2976b2[_0x5dbe('0xa3')];_0x18178f[_0x5dbe('0x41')]=_0x5dbe('0x1fd');for(var _0x5c119a=0x0;_0x5c119a<_0x2976b2['length'];_0x5c119a+=0x1){_0x18178f[_0x5dbe('0x1fe')]+=0x1;if(_['isNil'](_0x2976b2[_0x5c119a])||_[_0x5dbe('0xb9')](_0x2976b2[_0x5c119a][_0x5dbe('0x171')])||_[_0x5dbe('0xb9')](_0x2976b2[_0x5c119a][_0x5dbe('0x171')][_0x5dbe('0x172')])){_0x350514[_0x5dbe('0x1ff')]('[actionOriginate]\x20',_0x18178f,_0x2976b2[_0x5c119a]);}else{_0x350514[_0x5dbe('0xc8')](_[_0x5dbe('0x132')](_0x2976b2[_0x5c119a],[_0x5dbe('0xff'),_0x5dbe('0x200')]))[_0x5dbe('0xc4')](_0x350514[_0x5dbe('0x1e2')](_0x18178f,_0x2976b2[_0x5c119a]))[_0x5dbe('0xbc')](_0x350514[_0x5dbe('0xd8')](_0x5dbe('0x201'),_0x18178f));}}}})[_0x5dbe('0xbc')](loggerGetContactDialer(_0x5dbe('0x202'),_0x18178f,_0x278bfb));}};Dialer['prototype'][_0x5dbe('0x15d')]=function(_0x28c902,_0x113fa9){var _0x2db6f4=this;var _0x57d7ef=[];var _0x26b84e=_0x113fa9>=0x1?_0x113fa9:0x1;var _0xd70e1=[];if(_0x28c902[_0x5dbe('0x60')]==='booked'){_0x26b84e=0x1;}var _0x302bbb=Math[_0x5dbe('0x1c2')](_0x28c902['available']*_0x26b84e)-_0x28c902[_0x5dbe('0x78')]-_0x28c902[_0x5dbe('0x1fa')];emitVoiceQueueSummary(_0x28c902);if(_0x28c902[_0x5dbe('0x203')]>0x0){var _0xaf417c=_0x28c902[_0x5dbe('0x203')]-_0x28c902[_0x5dbe('0x78')]-_0x28c902[_0x5dbe('0x59')]-_0x28c902['temp']-_0x28c902[_0x5dbe('0x56')];if(_0x302bbb>_0xaf417c){_0x302bbb=_0xaf417c;}}if(_0x302bbb>0x0){if(_0x28c902['dialMethod']==='booked'){_0x302bbb=0x1;}if(_0x302bbb>this[_0x5dbe('0x24')]){_0x302bbb=this[_0x5dbe('0x24')];}_0x28c902['temp']+=_0x302bbb;for(var _0x270eb4 in this['agents']){if(this[_0x5dbe('0x22')][_0x5dbe('0xa4')](_0x270eb4)){if(this[_0x5dbe('0x22')][_0x270eb4][_0x5dbe('0xe6')]===_0x5dbe('0x204')&&this['agents'][_0x270eb4]['status']===_0x5dbe('0x205')){_0x57d7ef['push'](this[_0x5dbe('0x22')][_0x270eb4]['id']);}}}this[_0x5dbe('0xcf')](_0x28c902['id'],_0x57d7ef,_0x302bbb,_0x28c902[_0x5dbe('0x1fb')])[_0x5dbe('0xc4')](function(_0x2df93b){_0x28c902[_0x5dbe('0x1fa')]-=_0x302bbb;_0x28c902[_0x5dbe('0x1fa')]=_0x28c902['temp']>0x0?_0x28c902[_0x5dbe('0x1fa')]:0x0;if(!checkContactEmpty(_0x2df93b)){_0x2db6f4[_0x5dbe('0xc2')](_0x28c902)[_0x5dbe('0xc4')](sendMessageReschedule(_0x28c902))[_0x5dbe('0xbc')](loggerCatch('[countReScheduled]\x20'));}else{_0x28c902[_0x5dbe('0x78')]+=_0x2df93b[_0x5dbe('0xa3')];_0x28c902[_0x5dbe('0x41')]=_0x28c902['dialMethod']===_0x5dbe('0x9')?_0x5dbe('0x178'):_0x5dbe('0x1fd');for(var _0x27cc43=0x0;_0x27cc43<_0x2df93b[_0x5dbe('0xa3')];_0x27cc43+=0x1){if(_[_0x5dbe('0xb9')](_0x2df93b[_0x27cc43])||_[_0x5dbe('0xb9')](_0x2df93b[_0x27cc43][_0x5dbe('0x171')])||_['isNil'](_0x2df93b[_0x27cc43][_0x5dbe('0x171')][_0x5dbe('0x172')])){_0x2db6f4[_0x5dbe('0x1ff')](_0x5dbe('0x206'),_0x28c902,_0x2df93b[_0x27cc43]);}else{_0x2db6f4[_0x5dbe('0xc6')](_[_0x5dbe('0x132')](_0x2df93b[_0x27cc43],[_0x5dbe('0xfe'),_0x5dbe('0x200')]))[_0x5dbe('0xc4')](_0x2db6f4[_0x5dbe('0x1e2')](_0x28c902,_0x2df93b[_0x27cc43]))[_0x5dbe('0xbc')](_0x2db6f4[_0x5dbe('0xd8')](_0x5dbe('0x206'),_0x28c902));}}}})[_0x5dbe('0xbc')](loggerGetContactDialer(_0x5dbe('0x207'),_0x28c902,_0x302bbb));}};Dialer['prototype'][_0x5dbe('0x99')]=function(_0x16e8a6){var _0x166d12=this;if(_0x16e8a6[_0x5dbe('0x203')]>0x0){var _0x208838=_0x16e8a6[_0x5dbe('0x203')]-_0x16e8a6[_0x5dbe('0x78')]-_0x16e8a6[_0x5dbe('0x59')];if(_0x208838>0x0){this[_0x5dbe('0x208')](_0x16e8a6);}else{loggerPredictiveCalls[_0x5dbe('0x82')](_0x5dbe('0x209'));}}else{this['tryOriginatePredictive'](_0x16e8a6);}};Dialer['prototype'][_0x5dbe('0x208')]=function(_0x2b2ccf){var _0x3d5bbd=this;var _0x1e685b=[];_0x2b2ccf[_0x5dbe('0x78')]+=0x1;for(var _0x2c6258 in this[_0x5dbe('0x22')]){if(this['agents'][_0x5dbe('0xa4')](_0x2c6258)){if(this[_0x5dbe('0x22')][_0x2c6258]['state']===_0x5dbe('0x204')&&this['agents'][_0x2c6258][_0x5dbe('0xdf')]===_0x5dbe('0x205')){_0x1e685b[_0x5dbe('0x14c')](this['agents'][_0x2c6258]['id']);}}}this[_0x5dbe('0xcf')](_0x2b2ccf['id'],_0x1e685b,0x1,_0x2b2ccf[_0x5dbe('0x1fb')])['then'](function(_0xba0000){if(!checkContactEmpty(_0xba0000)){checkContactLowerLimitOriginate(_0x2b2ccf,0x1,0x0);_0x3d5bbd[_0x5dbe('0xc2')](_0x2b2ccf)[_0x5dbe('0xc4')](sendMessageReschedule(_0x2b2ccf))['catch'](loggerCatch(_0x5dbe('0xc5')));}else{_0x2b2ccf[_0x5dbe('0x41')]=_0x5dbe('0x1fd');if(_[_0x5dbe('0xb9')](_0xba0000[0x0])||_['isNil'](_0xba0000[0x0][_0x5dbe('0x171')])||_[_0x5dbe('0xb9')](_0xba0000[0x0]['Contact'][_0x5dbe('0x172')])){_0x3d5bbd[_0x5dbe('0x1ff')](_0x5dbe('0x206'),_0x2b2ccf,_0xba0000[0x0]);}else{_0x3d5bbd['checkIsBlackList'](_[_0x5dbe('0x132')](_0xba0000[0x0],[_0x5dbe('0xfe'),'Contact.phone']))[_0x5dbe('0xc4')](_0x3d5bbd[_0x5dbe('0x1e2')](_0x2b2ccf,_0xba0000[0x0]))[_0x5dbe('0xbc')](_0x3d5bbd[_0x5dbe('0xd8')](_0x5dbe('0x20a'),_0x2b2ccf));}}})[_0x5dbe('0xbc')](loggerGetContactDialer('[getContactDialerPredictive]',_0x2b2ccf,0x1));emitVoiceQueueSummary(_0x2b2ccf);};Dialer['prototype'][_0x5dbe('0x1d7')]=function(_0x1927f6,_0x84d01a,_0x56ff7a,_0x5e9219,_0x45b72a,_0x4c3f9f){loggerPredictive['info'](_0x5dbe('0x20b'));loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x20c'),_0x1927f6);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x20d'),_0x84d01a);loggerPredictive[_0x5dbe('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',_0x56ff7a);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x20e'),_0x5e9219);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x20f'),_0x45b72a);loggerPredictive['info'](_0x5dbe('0x8c'));return new BPromise(function(_0x167830,_0x5c4d40){if(_0x1927f6<=0x0||isNaN(_0x1927f6)){return _0x5c4d40(msgResponse('[abandonmentRate]',_0x5dbe('0x4c'),_0x5dbe('0x210')+_0x1927f6));}if(_0x56ff7a<=0x0||isNaN(_0x56ff7a)){return _0x5c4d40(msgResponse(_0x5dbe('0x211'),_0x5dbe('0x4c'),_0x5dbe('0x212')+_0x56ff7a));}if(_0x5e9219<=0x0||isNaN(_0x5e9219)){return _0x5c4d40(msgResponse(_0x5dbe('0x211'),_0x5dbe('0x4c'),_0x5dbe('0x213')+_0x5e9219));}if(_0x84d01a<=0x0||isNaN(_0x84d01a)){return _0x5c4d40(msgResponse(_0x5dbe('0x211'),_0x5dbe('0x4c'),_0x5dbe('0x214')+_0x84d01a));}if(_0x45b72a<=0x0||isNaN(_0x45b72a)){return _0x5c4d40(msgResponse(_0x5dbe('0x211'),'Error',_0x5dbe('0x215')+_0x45b72a));}_0x4c3f9f=_0x4c3f9f||0x0;var _0x3399ca=0x1/_0x56ff7a;var _0x1e5153=0x0;var _0x4592b1=0x0;var _0x21ceec=0x0;var _0x42eebc=0x0;for(var _0x1bbc59=0x0;_0x21ceec<_0x45b72a;_0x1bbc59+=0x1){_0x4592b1=_0x1bbc59/_0x84d01a;_0x1e5153=(_0x5e9219*_0x4592b1+_0x4c3f9f)/_0x3399ca;_0x21ceec=erlangb(_0x1e5153,_0x1927f6);_0x42eebc=_0x1e5153/_0x1927f6*(0x1-erlangb(_0x1e5153,_0x1927f6));}return _0x167830({'erlangCalls':_0x1bbc59,'erlangCallToSecond':_0x84d01a/_0x1bbc59,'erlangAbandonmentRate':_0x21ceec,'erlangBusyFactor':_0x42eebc});});};Dialer['prototype']['busyFactor']=function(_0x1c4ba4,_0x2f6e65,_0x151607,_0x3c9d53,_0x4a382c,_0x18368d){loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x216'));loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x20c'),_0x1c4ba4);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x20d'),_0x2f6e65);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x217'),_0x151607);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x20e'),_0x3c9d53);loggerPredictive[_0x5dbe('0x82')](_0x5dbe('0x218'),_0x4a382c);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x4c7fb2,_0x1386a7){if(_0x1c4ba4<=0x0||isNaN(_0x1c4ba4)){return _0x1386a7(msgResponse(_0x5dbe('0x219'),'Error',_0x5dbe('0x210')+_0x1c4ba4));}if(_0x151607<=0x0||isNaN(_0x151607)){return _0x1386a7(msgResponse('[busyFactor]',_0x5dbe('0x4c'),'Ts\x20=\x20'+_0x151607));}if(_0x3c9d53<=0x0||isNaN(_0x3c9d53)){return _0x1386a7(msgResponse(_0x5dbe('0x219'),_0x5dbe('0x4c'),_0x5dbe('0x213')+_0x3c9d53));}if(_0x2f6e65<=0x0||isNaN(_0x2f6e65)){return _0x1386a7(msgResponse(_0x5dbe('0x219'),'Error',_0x5dbe('0x214')+_0x2f6e65));}if(_0x4a382c<=0x0||isNaN(_0x4a382c)){return _0x1386a7(msgResponse(_0x5dbe('0x219'),'Error','Umin\x20=\x20'+_0x4a382c));}_0x18368d=_0x18368d||0x0;var _0xdfd72=0x1/_0x151607;var _0x307bcd=0x0;var _0x41c54d=0x0;var _0x57c2a1=0x0;var _0xe837e=0x0;for(var _0x2c3e02=0x0;_0xe837e<_0x4a382c;_0x2c3e02+=0x1){_0x41c54d=_0x2c3e02/_0x2f6e65;_0x307bcd=(_0x3c9d53*_0x41c54d+_0x18368d)/_0xdfd72;_0x57c2a1=erlangb(_0x307bcd,_0x1c4ba4);_0xe837e=_0x307bcd/_0x1c4ba4*(0x1-erlangb(_0x307bcd,_0x1c4ba4));}return _0x4c7fb2({'erlangCalls':_0x2c3e02,'erlangCallToSecond':_0x2f6e65/_0x2c3e02,'erlangAbandonmentRate':_0x57c2a1,'erlangBusyFactor':_0xe837e});});};module['exports']=Dialer;
\ No newline at end of file
diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js
index 24d3941..36d75b1 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 _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
+var _0x7bcd=['endtime','droptime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','number','starttime','responsetime'];(function(_0x1c75ae,_0x2650e6){var _0x12cc39=function(_0x3ea4c2){while(--_0x3ea4c2){_0x1c75ae['push'](_0x1c75ae['shift']());}};_0x12cc39(++_0x2650e6);}(_0x7bcd,0x139));var _0xd7bc=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0x7bcd[_0x12bcf7];return _0x2825a;};'use strict';var util=require(_0xd7bc('0x0'));var _=require('lodash');var moment=require(_0xd7bc('0x1'));function getSeconds(_0x884680,_0x4d8439){var _0x1a0808=moment(_0x884680)[_0xd7bc('0x2')](0x0);var _0x24340e=moment(_0x4d8439)[_0xd7bc('0x2')](0x0);return _0x1a0808[_0xd7bc('0x3')](_0x24340e,_0xd7bc('0x4'));}function QueueCallerAbandon(_0x76a88b,_0x36af90){this[_0xd7bc('0x5')]=_0x76a88b['scheduledat'];this[_0xd7bc('0x6')]=_0x76a88b[_0xd7bc('0x6')];this[_0xd7bc('0x7')]=_0x76a88b['type']==='outbound'?_0xd7bc('0x8'):_0x76a88b[_0xd7bc('0x6')];this[_0xd7bc('0x9')]=_0x76a88b['countbusyretry'];this['countcongestionretry']=_0x76a88b[_0xd7bc('0xa')];this[_0xd7bc('0xb')]=_0x76a88b[_0xd7bc('0xb')];this[_0xd7bc('0xc')]=_0x76a88b['countbusyretry']+_0x76a88b[_0xd7bc('0xa')]+_0x76a88b[_0xd7bc('0xb')]+_0x76a88b[_0xd7bc('0xd')]+_0x76a88b[_0xd7bc('0xe')]+_0x76a88b[_0xd7bc('0xf')]+_0x76a88b[_0xd7bc('0x10')]+_0x76a88b[_0xd7bc('0x11')];this[_0xd7bc('0xd')]=_0x76a88b[_0xd7bc('0xd')];this['countdropretry']=_0x76a88b[_0xd7bc('0xe')];this['countabandonedretry']=_0x76a88b[_0xd7bc('0xf')];this[_0xd7bc('0x10')]=_0x76a88b[_0xd7bc('0x10')];this[_0xd7bc('0x11')]=_0x76a88b[_0xd7bc('0x11')];this['uniqueid']=_0x36af90['uniqueid'];this[_0xd7bc('0x12')]=_0x76a88b[_0xd7bc('0x13')];this['calleridnum']=_0x76a88b[_0xd7bc('0x14')];this[_0xd7bc('0x15')]=_0x76a88b['starttime'];this[_0xd7bc('0x16')]=_0x76a88b[_0xd7bc('0x16')];this['droptime']=_0x76a88b['droptime'];this[_0xd7bc('0x17')]=this[_0xd7bc('0x18')];this[_0xd7bc('0x19')]=getSeconds(_0x76a88b['responsetime'],_0x76a88b[_0xd7bc('0x15')]);this[_0xd7bc('0x1a')]=getSeconds(this[_0xd7bc('0x18')],_0x76a88b[_0xd7bc('0x16')]);this[_0xd7bc('0x1b')]=0x0;this['queue']=_0x36af90[_0xd7bc('0x8')];this[_0xd7bc('0x1c')]=_0x36af90[_0xd7bc('0x1d')];this[_0xd7bc('0x1e')]=_0x36af90[_0xd7bc('0x1e')];this[_0xd7bc('0x1f')]=_0x76a88b['callback'];this[_0xd7bc('0x20')]=_0x76a88b[_0xd7bc('0x20')];this['callbackat']=_0x76a88b[_0xd7bc('0x21')];this[_0xd7bc('0x22')]=_0x76a88b[_0xd7bc('0x22')];this[_0xd7bc('0x23')]=_0x76a88b[_0xd7bc('0x23')];this[_0xd7bc('0x24')]=_0x76a88b['ListId'];this[_0xd7bc('0x25')]=_0x76a88b[_0xd7bc('0x25')];this[_0xd7bc('0x26')]=_0x76a88b[_0xd7bc('0x26')];this[_0xd7bc('0x27')]=_0x76a88b[_0xd7bc('0x27')];this['originatecalleridnum']=_0x76a88b[_0xd7bc('0x28')]||'';this['originatecalleridname']=_0x76a88b['originatecalleridname']||'';}module[_0xd7bc('0x29')]=QueueCallerAbandon;
\ No newline at end of file
diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js
index 71c9821..364f36b 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 _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
+var _0x6912=['AttachmentId','exports','lodash','moment','uniqueid','channel','format','%s/%s/%s','Trunk','name','fax','localstationid','headerinfo','path'];(function(_0x196782,_0x515df1){var _0x3cbb13=function(_0x7be9ba){while(--_0x7be9ba){_0x196782['push'](_0x196782['shift']());}};_0x3cbb13(++_0x515df1);}(_0x6912,0x1ec));var _0x2691=function(_0x500440,_0x1d2a1e){_0x500440=_0x500440-0x0;var _0x180971=_0x6912[_0x500440];return _0x180971;};'use strict';var util=require('util');var _=require(_0x2691('0x0'));var moment=require(_0x2691('0x1'));function Action(_0x2ed6db,_0x2f85e7,_0x5ba92b){this[_0x2691('0x2')]=_0x2ed6db||undefined;this[_0x2691('0x3')]=util[_0x2691('0x4')](_0x2691('0x5'),_0x2f85e7['tech'],_0x2f85e7[_0x2691('0x6')][_0x2691('0x7')],_0x5ba92b[_0x2691('0x8')]);this['localstationid']=_0x2f85e7[_0x2691('0x9')];this[_0x2691('0xa')]=_0x2f85e7[_0x2691('0xa')];this[_0x2691('0xb')]=_0x5ba92b['path'];this[_0x2691('0xc')]=_0x5ba92b['AttachmentId'];}module[_0x2691('0xd')]=Action;
\ No newline at end of file
diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js
index fa8f917..4ec2d7d 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 _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
+var _0xbe6c=['newstate','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncHangup','originateresponse','syncOriginateResponse','prototype','context','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','channelstate','channelstatedesc','value','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','then','notify','fax','.pdf','catch','error','\x20notify\x20','stringify','merge','pick','response','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','faxpages','SUCCESS','updateStatus','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','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','execute','%s/%s.tif','dir','XMF-PATH','Action','addVariables','ext','isTrunkReachable','isNil','active','format','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./rpcDb','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbe6c,0x1be));var _0xcbe6=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xbe6c[_0x1694f5];return _0x5b4321;};'use strict';var util=require(_0xcbe6('0x0'));var _=require(_0xcbe6('0x1'));var BPromise=require(_0xcbe6('0x2'));var uuid=require('uuid');var moment=require(_0xcbe6('0x3'));var path=require(_0xcbe6('0x4'));var tiff2pdf=require(_0xcbe6('0x5'));var gs=require(_0xcbe6('0x6'));var logger=require(_0xcbe6('0x7'))('fax');var ami=require(_0xcbe6('0x8'));var rpcDb=require(_0xcbe6('0x9'));var Channel=require('./channel');var ut=require(_0xcbe6('0xa'));var Action=require('./action');var faxAccount=require(_0xcbe6('0xb'));var attachment=require(_0xcbe6('0xc'));var faxMessage=require(_0xcbe6('0xd'));function Fax(_0xde4c19){this[_0xcbe6('0xe')]={};this[_0xcbe6('0xf')]=_0xde4c19[_0xcbe6('0xf')];this[_0xcbe6('0x10')]=_0xde4c19[_0xcbe6('0x10')];this[_0xcbe6('0x11')]={};ami['on'](_0xcbe6('0x12'),this[_0xcbe6('0x13')][_0xcbe6('0x14')](this));ami['on'](_0xcbe6('0x15'),this['syncVarSet'][_0xcbe6('0x14')](this));ami['on'](_0xcbe6('0x16'),this[_0xcbe6('0x17')]['bind'](this));ami['on'](_0xcbe6('0x18'),this[_0xcbe6('0x19')][_0xcbe6('0x14')](this));ami['on'](_0xcbe6('0x1a'),this['syncFaxStatus'][_0xcbe6('0x14')](this));ami['on'](_0xcbe6('0x1b'),this['syncReceiveFax'][_0xcbe6('0x14')](this));ami['on']('hangup',this[_0xcbe6('0x1c')][_0xcbe6('0x14')](this));ami['on'](_0xcbe6('0x1d'),this[_0xcbe6('0x1e')][_0xcbe6('0x14')](this));}Fax[_0xcbe6('0x1f')][_0xcbe6('0x13')]=function(_0x5f40b0){if(_0x5f40b0[_0xcbe6('0x20')]==='from-voip-provider'){for(var _0x1e6a46 in this['faxAccounts']){if(this[_0xcbe6('0xf')]['hasOwnProperty'](_0x1e6a46)){if(_0x5f40b0[_0xcbe6('0x21')]===this[_0xcbe6('0xf')][_0x1e6a46][_0xcbe6('0x22')]){this[_0xcbe6('0xe')][_0x5f40b0['uniqueid']]={};this[_0xcbe6('0xe')][_0x5f40b0[_0xcbe6('0x23')]][_0xcbe6('0x24')]=_0x5f40b0[_0xcbe6('0x24')];this['channels'][_0x5f40b0[_0xcbe6('0x23')]]['id']=this['faxAccounts'][_0x1e6a46]['id'];this[_0xcbe6('0xe')][_0x5f40b0[_0xcbe6('0x23')]][_0xcbe6('0x25')]=this[_0xcbe6('0xf')][_0x1e6a46][_0xcbe6('0x25')];logger[_0xcbe6('0x26')](_0x5f40b0['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x5f40b0[_0xcbe6('0x23')]]){this[_0xcbe6('0xe')][_0x5f40b0[_0xcbe6('0x23')]]={};this[_0xcbe6('0xe')][_0x5f40b0[_0xcbe6('0x23')]]['channel']=_0x5f40b0[_0xcbe6('0x24')];logger[_0xcbe6('0x26')](_0x5f40b0[_0xcbe6('0x23')],_0xcbe6('0x27'));}};Fax[_0xcbe6('0x1f')]['syncVarSet']=function(_0x244065){if(this[_0xcbe6('0xe')][_0x244065[_0xcbe6('0x23')]]){for(var _0x374aa1 in _0x244065['variable']){if(_0x244065[_0xcbe6('0x28')][_0xcbe6('0x29')](_0x374aa1)){this['channels'][_0x244065['uniqueid']][_0x374aa1]=_0x244065['value'];}}}};Fax[_0xcbe6('0x1f')][_0xcbe6('0x17')]=function(_0x547e43){if(this[_0xcbe6('0xe')][_0x547e43[_0xcbe6('0x23')]]){this[_0xcbe6('0xe')][_0x547e43['uniqueid']][_0xcbe6('0x2a')]=_0x547e43[_0xcbe6('0x2a')];this['channels'][_0x547e43[_0xcbe6('0x23')]]['channelstatedesc']=_0x547e43[_0xcbe6('0x2b')];}};Fax[_0xcbe6('0x1f')][_0xcbe6('0x19')]=function(_0x1af2bd){if(this[_0xcbe6('0xe')][_0x1af2bd[_0xcbe6('0x23')]]){for(var _0x2bfc54 in _0x1af2bd['variable']){if(_0x1af2bd[_0xcbe6('0x28')][_0xcbe6('0x29')](_0x2bfc54)){this[_0xcbe6('0xe')][_0x1af2bd[_0xcbe6('0x23')]][_0x2bfc54]=_0x1af2bd[_0xcbe6('0x2c')];}}}};Fax['prototype']['syncFaxStatus']=function(_0x54b9e7){if(this[_0xcbe6('0xe')][_0x54b9e7[_0xcbe6('0x23')]]){this['channels'][_0x54b9e7[_0xcbe6('0x23')]][_0xcbe6('0x2d')]=_0x54b9e7[_0xcbe6('0x2d')];this[_0xcbe6('0xe')][_0x54b9e7['uniqueid']][_0xcbe6('0x2e')]=_0x54b9e7[_0xcbe6('0x2e')];this[_0xcbe6('0xe')][_0x54b9e7['uniqueid']]['localstationid']=_0x54b9e7['localstationid'];this['channels'][_0x54b9e7[_0xcbe6('0x23')]][_0xcbe6('0x2f')]=_0x54b9e7[_0xcbe6('0x2f')];logger[_0xcbe6('0x26')](_0x54b9e7[_0xcbe6('0x23')],_0xcbe6('0x30'));}};Fax['prototype'][_0xcbe6('0x31')]=function(_0x307b0f){var _0x56b430=this;if(this[_0xcbe6('0xe')][_0x307b0f[_0xcbe6('0x23')]]){var _0x157311=this['channels'][_0x307b0f['uniqueid']]['id'];this[_0xcbe6('0xe')][_0x307b0f[_0xcbe6('0x23')]][_0xcbe6('0x32')]=_0x307b0f[_0xcbe6('0x32')];this[_0xcbe6('0xe')][_0x307b0f['uniqueid']]['pagestransferred']=_0x307b0f['pagestransferred'];this[_0xcbe6('0xe')][_0x307b0f['uniqueid']]['localstationid']=_0x307b0f['localstationid'];this[_0xcbe6('0xe')][_0x307b0f['uniqueid']][_0xcbe6('0x33')]=_0x307b0f[_0xcbe6('0x33')];this['channels'][_0x307b0f[_0xcbe6('0x23')]]['transferrate']=_0x307b0f[_0xcbe6('0x34')];this['channels'][_0x307b0f[_0xcbe6('0x23')]][_0xcbe6('0x2f')]=_0x307b0f[_0xcbe6('0x2f')];this[_0xcbe6('0xe')][_0x307b0f[_0xcbe6('0x23')]][_0xcbe6('0x35')]=_0x307b0f[_0xcbe6('0x35')];if(this[_0xcbe6('0xe')][_0x307b0f[_0xcbe6('0x23')]]['pagestransferred']>0x0){tiff2pdf(_0x307b0f[_0xcbe6('0x2f')],_0xcbe6('0x36'),function(_0xf673){logger[_0xcbe6('0x26')](_0x307b0f['uniqueid'],_0xcbe6('0x37'),_0xf673[_0xcbe6('0x38')]);attachment[_0xcbe6('0x39')]({'name':path[_0xcbe6('0x3a')](_0x307b0f[_0xcbe6('0x2f')])[_0xcbe6('0x25')],'basename':path[_0xcbe6('0x3a')](_0x307b0f[_0xcbe6('0x2f')])[_0xcbe6('0x25')]+'.pdf','type':_0xcbe6('0x3b')})[_0xcbe6('0x3c')](function(_0x18c90e){faxAccount[_0xcbe6('0x3d')](_0x157311,{'from':_0x307b0f[_0xcbe6('0x35')],'mapKey':_0xcbe6('0x3e'),'body':path['parse'](_0x307b0f[_0xcbe6('0x2f')])[_0xcbe6('0x25')]+_0xcbe6('0x3f'),'AttachmentId':_0x18c90e['id']})[_0xcbe6('0x40')](function(_0x23e36e){logger[_0xcbe6('0x41')](_0x307b0f[_0xcbe6('0x23')],_0xcbe6('0x42'),JSON[_0xcbe6('0x43')](_0x23e36e));});})[_0xcbe6('0x40')](function(_0x292173){logger[_0xcbe6('0x41')](_0x307b0f['uniqueid'],'\x20receiveFax\x20',JSON['stringify'](_0x292173));});});}logger['info'](_0x307b0f[_0xcbe6('0x23')],'\x20receiveFax\x20');}};Fax['prototype'][_0xcbe6('0x1e')]=function(_0x43fd1c){if(this[_0xcbe6('0x11')][_0x43fd1c[_0xcbe6('0x23')]]){_[_0xcbe6('0x44')](this[_0xcbe6('0xe')][_0x43fd1c[_0xcbe6('0x23')]],_[_0xcbe6('0x45')](_0x43fd1c,[_0xcbe6('0x46'),'reason']));}};function updateStatus(_0x2986df){if(_0x2986df[_0xcbe6('0x47')]){faxMessage['update'](_0x2986df[_0xcbe6('0x47')],{'failMessage':_0xcbe6('0x48')})[_0xcbe6('0x3c')](function(_0x1e54ec){ut[_0xcbe6('0x49')](_0xcbe6('0x4a'),_0x1e54ec);})[_0xcbe6('0x40')](function(_0x37f342){ut['logger'](_0xcbe6('0x4b'),_0x37f342);});}else{ut[_0xcbe6('0x49')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xcbe6('0x1f')]['updateStatus']=function(_0x4cbdbc,_0x454f9e,_0x9a1acc){var _0x32d111=this;var _0x1fa923={};if(_0x454f9e){_0x1fa923={'read':_0x454f9e};}else{_0x1fa923={'failMessage':_0x9a1acc};}if(this[_0xcbe6('0x11')][_0x4cbdbc]['AttachmentId']){faxMessage[_0xcbe6('0x4c')](this[_0xcbe6('0x11')][_0x4cbdbc][_0xcbe6('0x47')],_0x1fa923)[_0xcbe6('0x3c')](function(_0x2f0817){ut[_0xcbe6('0x49')](_0xcbe6('0x4d'),_0x2f0817);})['catch'](function(_0xddc13a){ut[_0xcbe6('0x49')](_0xcbe6('0x4e'),_0xddc13a);})[_0xcbe6('0x4f')](function(){delete _0x32d111['channels'][_0x4cbdbc];delete _0x32d111[_0xcbe6('0x11')][_0x4cbdbc];});}else{ut[_0xcbe6('0x49')]('[Fax][Message][NoUpdate2]');delete this[_0xcbe6('0xe')][_0x4cbdbc];delete this[_0xcbe6('0x11')][_0x4cbdbc];}};Fax[_0xcbe6('0x1f')][_0xcbe6('0x1c')]=function(_0x420319){var _0x24746b=this;if(this[_0xcbe6('0xe')][_0x420319[_0xcbe6('0x23')]]){if(this['actions'][_0x420319[_0xcbe6('0x23')]]){this['channels'][_0x420319[_0xcbe6('0x23')]]['id']=this[_0xcbe6('0x11')][_0x420319[_0xcbe6('0x23')]]['id'];this[_0xcbe6('0xe')][_0x420319['uniqueid']][_0xcbe6('0x25')]=this[_0xcbe6('0x11')][_0x420319['uniqueid']][_0xcbe6('0x25')];}logger[_0xcbe6('0x26')](_0x420319['uniqueid'],this[_0xcbe6('0x11')][_0x420319[_0xcbe6('0x23')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this['channels'][_0x420319['uniqueid']]));if(this[_0xcbe6('0x11')][_0x420319[_0xcbe6('0x23')]]){if(this[_0xcbe6('0xe')][_0x420319[_0xcbe6('0x23')]][_0xcbe6('0x50')]>0x0&&this[_0xcbe6('0xe')][_0x420319[_0xcbe6('0x23')]][_0xcbe6('0x1a')]===_0xcbe6('0x51')){this[_0xcbe6('0x52')](_0x420319[_0xcbe6('0x23')],!![]);}else{this[_0xcbe6('0x52')](_0x420319[_0xcbe6('0x23')],![],this['channels'][_0x420319['uniqueid']]['faxstatusstring']?_0xcbe6('0x53')+this[_0xcbe6('0xe')][_0x420319[_0xcbe6('0x23')]][_0xcbe6('0x54')]:_0xcbe6('0x55'));}}}};Fax['prototype'][_0xcbe6('0x56')]=function(_0x5ba7b5){var _0x2ad812=this;return new BPromise(function(_0xe6e30d,_0xdd5730){_0x2ad812[_0xcbe6('0x57')](_0x5ba7b5,_0x2ad812[_0xcbe6('0xf')][_0x5ba7b5[_0xcbe6('0x58')]])[_0xcbe6('0x3c')](function(_0x85ce61){ut[_0xcbe6('0x49')]('[Fax][execOriginate][success]',_0x85ce61);_0xe6e30d(ut[_0xcbe6('0x38')](_0xcbe6('0x59')));})['catch'](function(_0x4345a3){ut[_0xcbe6('0x49')](_0xcbe6('0x5a'),_0x4345a3);updateStatus(_0x5ba7b5);_0xdd5730(ut[_0xcbe6('0x38')](_0xcbe6('0x5b')));});});};Fax['prototype'][_0xcbe6('0x5c')]=function(_0x280c91){var _0x325f5d=this;return new BPromise(function(_0x5f4d5d,_0x20350c){var _0x3dc691=_0x325f5d[_0xcbe6('0x5d')](_0x325f5d['faxAccounts'][_0x280c91['FaxAccountId']][_0xcbe6('0x5e')],_0x280c91);if(_0x3dc691[_0xcbe6('0x5f')]){_0x5f4d5d(ut['message'](_0xcbe6('0x60')));}else{_0x20350c(ut[_0xcbe6('0x38')](_0x3dc691[_0xcbe6('0x38')]));}});};function originate(_0xc4d7b1,_0x5c28dc,_0x54420a){return new BPromise(function(_0x5dcc3e,_0x54c952){if(_0x54420a){var _0x2ec113=util['format'](_0xcbe6('0x61'),path[_0xcbe6('0x3a')](_0xc4d7b1[_0xcbe6('0x4')])['name'],_0xc4d7b1[_0xcbe6('0x4')]);gs[_0xcbe6('0x62')](_0x2ec113)[_0xcbe6('0x3c')](function(){_0xc4d7b1[_0xcbe6('0x4')]=util['format'](_0xcbe6('0x63'),path[_0xcbe6('0x3a')](_0xc4d7b1[_0xcbe6('0x4')])[_0xcbe6('0x64')],path[_0xcbe6('0x3a')](_0xc4d7b1['path'])[_0xcbe6('0x25')]);_0x5c28dc[_0xcbe6('0x65')]=_0xc4d7b1['path'];ut[_0xcbe6('0x49')]('Convert\x20pdf\x20to\x20tif','');ami[_0xcbe6('0x66')](ut['variablesAction'](_0xc4d7b1,_0x5c28dc))[_0xcbe6('0x3c')](function(_0x25eb75){_0x5dcc3e(_0x25eb75);})[_0xcbe6('0x40')](function(_0x49c423){_0x54c952(_0x49c423);});})[_0xcbe6('0x40')](function(_0x2a87a5){_0x54c952(_0x2a87a5);});}else{ami['Action'](ut['variablesAction'](_0xc4d7b1,_0x5c28dc))[_0xcbe6('0x3c')](function(_0x4bec13){_0x5dcc3e(_0x4bec13);})[_0xcbe6('0x40')](function(_0x151846){_0x54c952(_0x151846);});}});}Fax[_0xcbe6('0x1f')]['execOriginate']=function(_0x429d7d,_0x3993a0){var _0x4ed535=this;return new BPromise(function(_0x135d81,_0x3cb3a1){var _0x284660=uuid['v4']();var _0x3fdcf8=ut[_0xcbe6('0x67')](_0x429d7d,_0x3993a0);_0x4ed535[_0xcbe6('0x11')][_0x284660]=new Action(_0x284660,_0x3993a0,_0x429d7d);var _0x8fe5=_0x4ed535[_0xcbe6('0x11')][_0x284660];if(path['parse'](_0x429d7d[_0xcbe6('0x4')])[_0xcbe6('0x68')]==='.pdf'){originate(_0x8fe5,_0x3fdcf8,!![])[_0xcbe6('0x3c')](function(_0x15f970){_0x135d81(_0x15f970);})[_0xcbe6('0x40')](function(_0x267726){_0x3cb3a1(_0x267726);});}else{originate(_0x8fe5,_0x3fdcf8,![])[_0xcbe6('0x3c')](function(_0x5ed7d6){_0x135d81(_0x5ed7d6);})['catch'](function(_0x50e7e1){_0x3cb3a1(_0x50e7e1);});}});};Fax[_0xcbe6('0x1f')][_0xcbe6('0x69')]=function(_0x3b656e){return!_[_0xcbe6('0x6a')](_0x3b656e)&&!_[_0xcbe6('0x6a')](_0x3b656e[_0xcbe6('0x25')])&&!_[_0xcbe6('0x6a')](_0x3b656e[_0xcbe6('0x6b')])&&_0x3b656e[_0xcbe6('0x6b')]&&!_[_0xcbe6('0x6a')](this[_0xcbe6('0x10')][util[_0xcbe6('0x6c')](_0xcbe6('0x6d'),_0x3b656e[_0xcbe6('0x25')])])&&!_[_0xcbe6('0x6a')](this[_0xcbe6('0x10')][util[_0xcbe6('0x6c')](_0xcbe6('0x6d'),_0x3b656e[_0xcbe6('0x25')])][_0xcbe6('0x2e')])&&(this[_0xcbe6('0x10')][util[_0xcbe6('0x6c')]('SIP/%s',_0x3b656e[_0xcbe6('0x25')])][_0xcbe6('0x2e')]===_0xcbe6('0x6e')||this[_0xcbe6('0x10')][util[_0xcbe6('0x6c')](_0xcbe6('0x6d'),_0x3b656e[_0xcbe6('0x25')])][_0xcbe6('0x2e')]===_0xcbe6('0x6f'));};Fax['prototype']['checkTrunk']=function(_0x16ed9c,_0x7a19b4){if(!this['isTrunkReachable'](_0x16ed9c)){ut[_0xcbe6('0x49')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xcbe6('0x6a')](_0x16ed9c)?'':_0x16ed9c[_0xcbe6('0x25')]+_0xcbe6('0x70'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_['isNil'](_0x7a19b4[_0xcbe6('0x3e')])){ut[_0xcbe6('0x49')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xcbe6('0x43')](_0x7a19b4));return{'isValid':![],'message':_0xcbe6('0x71')};}if(_[_0xcbe6('0x6a')](_0x7a19b4[_0xcbe6('0x4')])){ut[_0xcbe6('0x49')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x7a19b4));return{'isValid':![],'message':_0xcbe6('0x72')};}return{'isValid':!![],'message':_0xcbe6('0x73')};};module[_0xcbe6('0x74')]=Fax;
\ No newline at end of file
diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js
index bbc95be..cc485b0 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 _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
+var _0x6de3=['bluebird','../../../config/logger','preview','lodash','inspect','notify','resolve','then','catch','[Notify]\x20','util'];(function(_0x1e5693,_0x497f61){var _0x35242d=function(_0x24bc8b){while(--_0x24bc8b){_0x1e5693['push'](_0x1e5693['shift']());}};_0x35242d(++_0x497f61);}(_0x6de3,0x11d));var _0x36de=function(_0x15d2cf,_0x3f725b){_0x15d2cf=_0x15d2cf-0x0;var _0x200fcb=_0x6de3[_0x15d2cf];return _0x200fcb;};'use strict';var util=require(_0x36de('0x0'));var BPromise=require(_0x36de('0x1'));var logger=require(_0x36de('0x2'))(_0x36de('0x3'));var _=require(_0x36de('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x30dccd){return function(_0x33cad6){logger['error'](_0x30dccd,util[_0x36de('0x5')](_0x33cad6,{'showHidden':![],'depth':null}));};}exports[_0x36de('0x6')]=function(_0x152fc1,_0x1a1b2c){return BPromise[_0x36de('0x7')]()[_0x36de('0x8')](faxAccount['notify'](_0x152fc1,_0x1a1b2c))[_0x36de('0x9')](loggerCatch(_0x36de('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 191468c..6bd782b 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 _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
+var _0xf216=['bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax'];(function(_0x457941,_0x3ec443){var _0x31254e=function(_0x8ae70e){while(--_0x8ae70e){_0x457941['push'](_0x457941['shift']());}};_0x31254e(++_0x3ec443);}(_0xf216,0x1cb));var _0x6f21=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xf216[_0x87b0ff];return _0x3bc0b2;};'use strict';var util=require(_0x6f21('0x0'));var logger=require(_0x6f21('0x1'))(_0x6f21('0x2'));var BPromise=require(_0x6f21('0x3'));var exec=require(_0x6f21('0x4'))[_0x6f21('0x5')];exports[_0x6f21('0x6')]=function(_0x4440e6){return new BPromise(function(_0x13f47a,_0x521438){exec(_0x4440e6,function(_0x1e389d,_0x3483cf,_0x43d84f){logger[_0x6f21('0x7')](_0x6f21('0x8'),_0x3483cf);if(_0x1e389d){logger[_0x6f21('0x7')](_0x6f21('0x8'),_0x6f21('0x9'),util[_0x6f21('0xa')](_0x1e389d,{'showHidden':![],'depth':null}),_0x3483cf,_0x43d84f);_0x521438(_0x1e389d);}_0x13f47a(_0x3483cf);});});};
\ 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 77a06b3..26ba14c 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 _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
+var _0xde2c=['message','logger','info','inspect','addVariables','ecm','headerinfo','format','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','uniqueid','originate','channel','xcally-motion-fax','util','lodash','moment','../../../../config/logger','fax'];(function(_0x265eec,_0x4b78c5){var _0x4ed819=function(_0x1b65ed){while(--_0x1b65ed){_0x265eec['push'](_0x265eec['shift']());}};_0x4ed819(++_0x4b78c5);}(_0xde2c,0x7f));var _0xcde2=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0xde2c[_0x53bcc3];return _0x47c959;};'use strict';var util=require(_0xcde2('0x0'));var _=require(_0xcde2('0x1'));var moment=require(_0xcde2('0x2'));var logger=require(_0xcde2('0x3'))(_0xcde2('0x4'));exports[_0xcde2('0x5')]=function(_0x33bb0c){return{'message':_0x33bb0c};};exports[_0xcde2('0x6')]=function(_0x55c175,_0x4353c8){logger[_0xcde2('0x7')](_0x55c175,util[_0xcde2('0x8')](_0x4353c8,{'showHidden':![],'depth':null}));};exports[_0xcde2('0x9')]=function(_0x401b16,_0x53c558){var _0x2b27ef={'XMF-ECM':_0x53c558[_0xcde2('0xa')],'XMF-HEADERINFO':_0x53c558[_0xcde2('0xb')],'XMF-MINRATE':_0x53c558['minrate'],'XMF-MAXRATE':_0x53c558['maxrate'],'XMF-MODEM':util[_0xcde2('0xc')](_0xcde2('0xd'),_0x53c558['modem']),'XMF-GATEWAY':_0x53c558[_0xcde2('0xe')],'XMF-FAXDETECT':_0x53c558[_0xcde2('0xf')],'XMF-T38TIMEOUT':_0x53c558[_0xcde2('0x10')],'XMF-LOCALSTATIONID':_0x53c558[_0xcde2('0x11')],'XMF-PATH':_0x401b16['path']};return _0x2b27ef;};exports['variablesAction']=function(_0x25677f,_0x1bc697){return{'actionid':_0x25677f[_0xcde2('0x12')],'action':_0xcde2('0x13'),'channel':_0x25677f[_0xcde2('0x14')],'Exten':_0xcde2('0x15'),'Context':'from-sip','Priority':'1','callerid':util[_0xcde2('0xc')]('\x22%s\x22\x20<%s>',_0x25677f[_0xcde2('0xb')]?_0x25677f['headerinfo']:'',_0x25677f['localstationid']),'variable':_0x1bc697,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x25677f[_0xcde2('0x12')]};};
\ No newline at end of file
diff --git a/server/services/ami/index.js b/server/services/ami/index.js
index c0932e2..10ad750 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 _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
+var _0xaba8=['then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','hour','resolve'];(function(_0x3fe393,_0x234a3a){var _0x534d14=function(_0x277fab){while(--_0x277fab){_0x3fe393['push'](_0x3fe393['shift']());}};_0x534d14(++_0x234a3a);}(_0xaba8,0xaf));var _0x8aba=function(_0x2fcf2a,_0x418ad8){_0x2fcf2a=_0x2fcf2a-0x0;var _0x57e20e=_0xaba8[_0x2fcf2a];return _0x57e20e;};'use strict';var BPromise=require(_0x8aba('0x0'));var util=require(_0x8aba('0x1'));var moment=require(_0x8aba('0x2'));var server=require('./server');var Realtime=require(_0x8aba('0x3'));var Report=require(_0x8aba('0x4'));var Acw=require(_0x8aba('0x5'));var Trigger=require(_0x8aba('0x6'));var Dialer=require('./dialer');var Preview=require(_0x8aba('0x7'));var Fax=require(_0x8aba('0x8'));var user=require(_0x8aba('0x9'));var voiceQueue=require(_0x8aba('0xa'));var voiceQueueReport=require(_0x8aba('0xb'));var voiceCallReport=require(_0x8aba('0xc'));var trunk=require('./rpc/trunk');var trigger=require(_0x8aba('0xd'));var template=require(_0x8aba('0xe'));var cmHopperHistory=require(_0x8aba('0xf'));var campaign=require(_0x8aba('0x10'));var voiceExtension=require(_0x8aba('0x11'));var faxAccount=require(_0x8aba('0x12'));var zendesk=require(_0x8aba('0x13'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x8aba('0x14'));var freshdesk=require(_0x8aba('0x15'));var desk=require(_0x8aba('0x16'));var zoho=require(_0x8aba('0x17'));var vtiger=require(_0x8aba('0x18'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x8aba('0x19'));var dynamics365=require(_0x8aba('0x1a'));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()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x8aba('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x8aba('0x1c')]()[_0x8aba('0x1d')](user['getAgents']())[_0x8aba('0x1d')](realtime[_0x8aba('0x1e')]())[_0x8aba('0x1d')](user[_0x8aba('0x1f')]())[_0x8aba('0x1d')](realtime[_0x8aba('0x20')]())['then'](trunk[_0x8aba('0x21')]())[_0x8aba('0x1d')](realtime[_0x8aba('0x22')]())[_0x8aba('0x1d')](voiceQueue[_0x8aba('0x23')]())[_0x8aba('0x1d')](realtime[_0x8aba('0x24')]())[_0x8aba('0x1d')](trigger[_0x8aba('0x25')]())['then'](realtime[_0x8aba('0x26')]())[_0x8aba('0x1d')](template['getTemplates']())[_0x8aba('0x1d')](realtime['initTemplates']())[_0x8aba('0x1d')](zendesk[_0x8aba('0x27')]())[_0x8aba('0x1d')](realtime[_0x8aba('0x28')]())[_0x8aba('0x1d')](salesforce[_0x8aba('0x29')]())[_0x8aba('0x1d')](realtime[_0x8aba('0x2a')]())[_0x8aba('0x1d')](sugarcrm[_0x8aba('0x2b')]())[_0x8aba('0x1d')](realtime[_0x8aba('0x2c')]())[_0x8aba('0x1d')](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x8aba('0x2d')]())[_0x8aba('0x1d')](desk[_0x8aba('0x2e')]())[_0x8aba('0x1d')](realtime[_0x8aba('0x2f')]())['then'](zoho[_0x8aba('0x30')]())[_0x8aba('0x1d')](realtime[_0x8aba('0x31')]())[_0x8aba('0x1d')](vtiger[_0x8aba('0x32')]())[_0x8aba('0x1d')](realtime['initVtigerAccounts']())[_0x8aba('0x1d')](freshsales[_0x8aba('0x33')]())[_0x8aba('0x1d')](realtime[_0x8aba('0x34')]())[_0x8aba('0x1d')](servicenow['getServicenowAccounts']())[_0x8aba('0x1d')](realtime['initServicenowAccounts']())['then'](dynamics365[_0x8aba('0x35')]())[_0x8aba('0x1d')](realtime[_0x8aba('0x36')]())[_0x8aba('0x1d')](campaign[_0x8aba('0x37')]())[_0x8aba('0x1d')](realtime[_0x8aba('0x38')]())[_0x8aba('0x1d')](voiceExtension[_0x8aba('0x39')]())[_0x8aba('0x1d')](realtime[_0x8aba('0x3a')]())[_0x8aba('0x1d')](faxAccount[_0x8aba('0x3b')]())['then'](realtime[_0x8aba('0x3c')]())[_0x8aba('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0x8aba('0x1c')]()[_0x8aba('0x1d')](voiceQueueReport['getVoiceQueueReports']())[_0x8aba('0x1d')](realtime['initVoiceQueueReports']())[_0x8aba('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0x8aba('0x3d')]())['then'](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime[_0x8aba('0x3e')]())[_0x8aba('0x1d')](voiceCallReport['getVoiceCallReports']())[_0x8aba('0x1d')](realtime[_0x8aba('0x3f')]())[_0x8aba('0x1d')](function(_0x4143ff){})[_0x8aba('0x40')](function(_0x36f510){console[_0x8aba('0x41')](_0x36f510);});}function main(){return server[_0x8aba('0x42')](realtime,preview,fax)[_0x8aba('0x1d')](function(_0x1bef7c){return initRealtime();})[_0x8aba('0x1d')](function(){return initParams();})[_0x8aba('0x1d')](function(){report[_0x8aba('0x43')]();setInterval(initRealtime,0x1388);})[_0x8aba('0x40')](function(_0x9dfe93){console[_0x8aba('0x41')](_0x9dfe93);});}main();
\ No newline at end of file
diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js
index e34a638..15060ab 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 _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
+var _0x60f4=['stateTime','stringify','user:%s','exports','lodash','util','md5','ioredis','../../../config/environment','redis','socket.io-emitter','name','email','accountcode','fullname','state','unknown','status','address','phone','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','not_inuse','idle','statePause','toNumber','format'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x60f4,0xf9));var _0x460f=function(_0x15f5b2,_0x41b6d6){_0x15f5b2=_0x15f5b2-0x0;var _0x5d9a5c=_0x60f4[_0x15f5b2];return _0x5d9a5c;};'use strict';var _=require(_0x460f('0x0'));var util=require(_0x460f('0x1'));var moment=require('moment');var md5=require(_0x460f('0x2'));var Redis=require(_0x460f('0x3'));var config=require(_0x460f('0x4'));config[_0x460f('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x460f('0x6'))(new Redis(config['redis']));function Agent(_0xdc6889){this['id']=_0xdc6889['id']||0x0;this['name']=_0xdc6889[_0x460f('0x7')]||'';this['email']=_0xdc6889[_0x460f('0x8')]||'';this[_0x460f('0x9')]=_0xdc6889[_0x460f('0x9')]||'';this['fullname']=_0xdc6889[_0x460f('0xa')]||'';this[_0x460f('0xb')]=_0x460f('0xc');this['stateTime']=0x0;this[_0x460f('0xd')]=_0x460f('0xc');this[_0x460f('0xe')]='';this[_0x460f('0xf')]='';this['mobile']='';this[_0x460f('0x10')]='';this[_0x460f('0x11')]=_0xdc6889[_0x460f('0x11')]||![];this[_0x460f('0x12')]=_0x460f('0xc');this[_0x460f('0x13')]=0x0;this[_0x460f('0x14')]='';this[_0x460f('0x15')]='';this[_0x460f('0x16')]=![];this[_0x460f('0x17')]=![];this[_0x460f('0x2')]='';}Agent[_0x460f('0x18')][_0x460f('0x19')]=function(_0x4d120a){var _0x449d96;if(_0x4d120a&&_0x4d120a['state']){_0x449d96=_0x4d120a[_0x460f('0xb')]['toLowerCase']();switch(_0x449d96){case _0x460f('0x1a'):_0x449d96=_0x460f('0x1b');break;case'inuse':_0x449d96='talking';break;}}if(_0x449d96&&this[_0x460f('0x12')]!==_0x449d96||_0x4d120a[_0x460f('0x1c')]){this[_0x460f('0x13')]=_[_0x460f('0x1d')](moment()[_0x460f('0x1e')]('x'));}if(_0x449d96){this[_0x460f('0x12')]=_0x449d96;}var _0x166fa6={'id':this['id'],'name':this[_0x460f('0x7')],'email':this[_0x460f('0x8')],'accountcode':this[_0x460f('0x9')],'fullname':this['fullname'],'state':this[_0x460f('0xb')],'stateTime':this[_0x460f('0x1f')],'status':this[_0x460f('0xd')],'address':this[_0x460f('0xe')],'online':this[_0x460f('0x11')],'voiceStatus':this[_0x460f('0x12')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x460f('0x14')],'voiceStatusQueue':this[_0x460f('0x15')],'interface':this[_0x460f('0x10')],'onhold':this[_0x460f('0x16')]};var _0x10fd9d=md5(JSON[_0x460f('0x20')](_0x166fa6));if(this[_0x460f('0x2')]!==_0x10fd9d){this[_0x460f('0x2')]=_0x10fd9d;io['to'](util[_0x460f('0x1e')](_0x460f('0x21'),_0x166fa6[_0x460f('0x7')]))['emit']('user:save',_0x166fa6);}};module[_0x460f('0x22')]=Agent;
\ No newline at end of file
diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js
index 7cf8de7..4e682cd 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 _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
+var _0xce20=['Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup'];(function(_0x59fc7f,_0x33a2ba){var _0x25535a=function(_0xd11ba0){while(--_0xd11ba0){_0x59fc7f['push'](_0x59fc7f['shift']());}};_0x25535a(++_0x33a2ba);}(_0xce20,0xd7));var _0x0ce2=function(_0x23c0e5,_0x48368a){_0x23c0e5=_0x23c0e5-0x0;var _0x203842=_0xce20[_0x23c0e5];return _0x203842;};'use strict';function Campaign(_0x298c65){this['id']=_0x298c65['id']||0x0;this[_0x0ce2('0x0')]=_0x298c65[_0x0ce2('0x0')]||'';this['type']=_0x298c65[_0x0ce2('0x1')]||_0x0ce2('0x2');this['originated']=0x0;this[_0x0ce2('0x3')]=0x0;this[_0x0ce2('0x4')]=0x0;this[_0x0ce2('0x5')]=0x0;this[_0x0ce2('0x6')]='';this[_0x0ce2('0x7')]=!![];this['active']=_0x298c65[_0x0ce2('0x8')];this[_0x0ce2('0x9')]=_0x298c65[_0x0ce2('0x9')];this[_0x0ce2('0xa')]=_0x298c65['dialTimezone']||null;this[_0x0ce2('0xb')]=_0x298c65[_0x0ce2('0xb')]?_0x298c65[_0x0ce2('0xb')]:null;this['dialOriginateCallerIdName']=_0x298c65[_0x0ce2('0xc')];this['dialOriginateCallerIdNumber']=_0x298c65[_0x0ce2('0xd')];this[_0x0ce2('0xe')]=_0x298c65['dialOriginateTimeout']||0x1e;this[_0x0ce2('0xf')]=_0x298c65[_0x0ce2('0xf')];this[_0x0ce2('0x10')]=_0x298c65[_0x0ce2('0x10')];this[_0x0ce2('0x11')]=_0x298c65[_0x0ce2('0x11')];this[_0x0ce2('0x12')]=_0x298c65[_0x0ce2('0x12')];this['dialNoAnswerMaxRetry']=_0x298c65[_0x0ce2('0x13')];this[_0x0ce2('0x14')]=_0x298c65[_0x0ce2('0x14')];this[_0x0ce2('0x15')]=_0x298c65[_0x0ce2('0x15')];this[_0x0ce2('0x16')]=_0x298c65[_0x0ce2('0x16')]||0x3;this[_0x0ce2('0x17')]=_0x298c65[_0x0ce2('0x17')]||0x96;this[_0x0ce2('0x18')]=_0x298c65[_0x0ce2('0x18')]||0x3;this[_0x0ce2('0x19')]=_0x298c65[_0x0ce2('0x19')]||0x96;this['dialAbandonedMaxRetry']=_0x298c65['dialAbandonedMaxRetry']||0x3;this[_0x0ce2('0x1a')]=_0x298c65[_0x0ce2('0x1a')]||0x96;this[_0x0ce2('0x1b')]=_0x298c65[_0x0ce2('0x1b')]||0x3;this[_0x0ce2('0x1c')]=_0x298c65[_0x0ce2('0x1c')]||0x96;this[_0x0ce2('0x1d')]=_0x298c65['dialAgentRejectMaxRetry']||0x3;this[_0x0ce2('0x1e')]=_0x298c65[_0x0ce2('0x1e')]||0x96;this[_0x0ce2('0x1f')]=_0x298c65['dialOrderByScheduledAt']||'DESC';this['dialPrefix']=_0x298c65['dialPrefix']||undefined;this[_0x0ce2('0x20')]=_0x298c65['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x0ce2('0x21')]=_0x298c65[_0x0ce2('0x21')]||undefined;this[_0x0ce2('0x22')]=_0x298c65[_0x0ce2('0x22')]?_0x298c65['TrunkBackup']:undefined;this[_0x0ce2('0x23')]=_0x298c65[_0x0ce2('0x23')]?_0x298c65['Trunk']:undefined;this[_0x0ce2('0x24')]=_0x298c65['Interval']?_0x298c65[_0x0ce2('0x24')]:undefined;this['SquareProject']=_0x298c65[_0x0ce2('0x25')]?_0x298c65[_0x0ce2('0x25')]:undefined;this[_0x0ce2('0x26')]=_0x298c65[_0x0ce2('0x25')]?_0x298c65[_0x0ce2('0x25')][_0x0ce2('0x0')]:undefined;this[_0x0ce2('0x27')]=_0x298c65[_0x0ce2('0x27')]||![];this[_0x0ce2('0x28')]=_0x298c65[_0x0ce2('0x28')];this[_0x0ce2('0x29')]=_0x298c65['dialAMDGreeting'];this[_0x0ce2('0x2a')]=_0x298c65['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x298c65[_0x0ce2('0x2b')];this[_0x0ce2('0x2c')]=_0x298c65[_0x0ce2('0x2c')];this['dialAMDBetweenWordsSilence']=_0x298c65[_0x0ce2('0x2d')];this[_0x0ce2('0x2e')]=_0x298c65['dialAMDMaximumNumberOfWords'];this[_0x0ce2('0x2f')]=_0x298c65[_0x0ce2('0x2f')];this[_0x0ce2('0x30')]=_0x298c65['dialAMDMaximumWordLength'];}module[_0x0ce2('0x31')]=Campaign;
\ No newline at end of file
diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js
index de4a4b6..cb66e59 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 _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
+var _0x6d0c=['queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','linkedid','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6d0c,0x8c));var _0xc6d0=function(_0x211952,_0x22c0af){_0x211952=_0x211952-0x0;var _0x5eba8a=_0x6d0c[_0x211952];return _0x5eba8a;};'use strict';function Channel(){this[_0xc6d0('0x0')]=null;this[_0xc6d0('0x1')]='';this[_0xc6d0('0x2')]='';this[_0xc6d0('0x3')]=0x0;this[_0xc6d0('0x4')]='';this[_0xc6d0('0x5')]=undefined;this['connectedlinename']=undefined;this[_0xc6d0('0x6')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0xc6d0('0x7')]=0x0;this['exten']=0x0;this['answered']=![];this[_0xc6d0('0x8')]=null;this[_0xc6d0('0x9')]=null;this[_0xc6d0('0xa')]=![];this[_0xc6d0('0xb')]=![];this[_0xc6d0('0xc')]='';this[_0xc6d0('0xd')]='';this[_0xc6d0('0xe')]=0x0;this[_0xc6d0('0xf')]=0x0;this[_0xc6d0('0x10')]=0x0;this[_0xc6d0('0x11')]=null;this[_0xc6d0('0x12')]=null;this[_0xc6d0('0x13')]=null;this[_0xc6d0('0x14')]=![];this[_0xc6d0('0x15')]=null;this[_0xc6d0('0x16')]=null;this[_0xc6d0('0x17')]=[];this[_0xc6d0('0x18')]=undefined;this[_0xc6d0('0x19')]=undefined;this[_0xc6d0('0x1a')]=0x0;}module['exports']=Channel;
\ No newline at end of file
diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js
index 3c1a3eb..5bf4a6c 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 _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
+var _0x4b1f=['remoteUri','authType','password','consumerKey','consumerSecret','token','type','serverUrl','exports','name','username'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0x4b1f,0x195));var _0xf4b1=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x4b1f[_0x1da527];return _0x40fc7c;};'use strict';function DeskAccount(_0x3ca797){this['id']=_0x3ca797['id']||0x0;this[_0xf4b1('0x0')]=_0x3ca797['name']||'';this[_0xf4b1('0x1')]=_0x3ca797[_0xf4b1('0x1')]||'';this[_0xf4b1('0x2')]=_0x3ca797['remoteUri']||'';this[_0xf4b1('0x3')]=_0x3ca797[_0xf4b1('0x3')]||'';this[_0xf4b1('0x4')]=_0x3ca797['password']||'';this['consumerKey']=_0x3ca797[_0xf4b1('0x5')]||'';this[_0xf4b1('0x6')]=_0x3ca797[_0xf4b1('0x6')]||'';this[_0xf4b1('0x7')]=_0x3ca797[_0xf4b1('0x7')]||'';this['tokenSecret']=_0x3ca797['tokenSecret']||'';this['type']=_0x3ca797[_0xf4b1('0x8')]||'';this['serverUrl']=_0x3ca797[_0xf4b1('0x9')]||'';this['Configurations']=_0x3ca797['Configurations']||{};}module[_0xf4b1('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 38d3cdb..20a0a8e 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 _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
+var _0xc45b=['Configurations','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x579f88,_0xb8632d){var _0xcff854=function(_0x5ed35e){while(--_0x5ed35e){_0x579f88['push'](_0x579f88['shift']());}};_0xcff854(++_0xb8632d);}(_0xc45b,0x169));var _0xbc45=function(_0x3d0227,_0x37c3c1){_0x3d0227=_0x3d0227-0x0;var _0x19648e=_0xc45b[_0x3d0227];return _0x19648e;};'use strict';function Dynamics365Account(_0x115474){this['id']=_0x115474['id']||0x0;this[_0xbc45('0x0')]=_0x115474[_0xbc45('0x0')]||'';this[_0xbc45('0x1')]=_0x115474[_0xbc45('0x1')]||'';this[_0xbc45('0x2')]=_0x115474[_0xbc45('0x2')]||'';this[_0xbc45('0x3')]=_0x115474[_0xbc45('0x3')]||'';this[_0xbc45('0x4')]=_0x115474[_0xbc45('0x4')]||'';this[_0xbc45('0x5')]=_0x115474['clientId']||'';this[_0xbc45('0x6')]=_0x115474[_0xbc45('0x6')]||{};this['serverUrl']=_0x115474[_0xbc45('0x7')]||'';this[_0xbc45('0x8')]=_0x115474[_0xbc45('0x8')]||{};}module['exports']=Dynamics365Account;
\ No newline at end of file
diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js
index 6b2f25a..8effd45 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 _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
+var _0xa380=['ListId','name','description','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','Trunk'];(function(_0x273e8f,_0x4b9aea){var _0x5a9927=function(_0x564560){while(--_0x564560){_0x273e8f['push'](_0x273e8f['shift']());}};_0x5a9927(++_0x4b9aea);}(_0xa380,0x153));var _0x0a38=function(_0x2a5863,_0x22bfdc){_0x2a5863=_0x2a5863-0x0;var _0x4c4e00=_0xa380[_0x2a5863];return _0x4c4e00;};'use strict';function FaxAccount(_0x5a8adc){this['id']=_0x5a8adc['id']||0x0;this[_0x0a38('0x0')]=_0x5a8adc[_0x0a38('0x0')]||'';this[_0x0a38('0x1')]=_0x5a8adc['description'];this['ecm']=_0x5a8adc['ecm'];this[_0x0a38('0x2')]=_0x5a8adc[_0x0a38('0x2')];this[_0x0a38('0x3')]=_0x5a8adc[_0x0a38('0x3')];this[_0x0a38('0x4')]=_0x5a8adc['minrate']||0x960;this[_0x0a38('0x5')]=_0x5a8adc[_0x0a38('0x5')]||0x3840;this[_0x0a38('0x6')]=_0x5a8adc[_0x0a38('0x6')]||'v17,v27,v29';this['gateway']=_0x5a8adc[_0x0a38('0x7')]||'no';this[_0x0a38('0x8')]=_0x5a8adc[_0x0a38('0x8')]||'no';this[_0x0a38('0x9')]=_0x5a8adc[_0x0a38('0x9')]||0x1388;this[_0x0a38('0xa')]=_0x5a8adc[_0x0a38('0xa')]||'SIP';this[_0x0a38('0xb')]=_0x5a8adc[_0x0a38('0xb')]?_0x5a8adc[_0x0a38('0xb')]:undefined;this[_0x0a38('0xc')]=_0x5a8adc[_0x0a38('0xc')];this['key']=_0x5a8adc['key'];}module['exports']=FaxAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js
index f33b2ef..db5c313 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 _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
+var _0xc76a=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0xc7ac87,_0x2f8b4d){var _0x20cf60=function(_0x1035cb){while(--_0x1035cb){_0xc7ac87['push'](_0xc7ac87['shift']());}};_0x20cf60(++_0x2f8b4d);}(_0xc76a,0x1d3));var _0xac76=function(_0x374754,_0x35921e){_0x374754=_0x374754-0x0;var _0x1d203f=_0xc76a[_0x374754];return _0x1d203f;};'use strict';function FreshdeskAccount(_0x4283eb){this['id']=_0x4283eb['id']||0x0;this['name']=_0x4283eb[_0xac76('0x0')]||'';this[_0xac76('0x1')]=_0x4283eb['username']||'';this[_0xac76('0x2')]=_0x4283eb[_0xac76('0x3')]||'';this[_0xac76('0x4')]=_0x4283eb[_0xac76('0x4')]||'';this[_0xac76('0x5')]=_0x4283eb[_0xac76('0x5')]||'';this['Configurations']=_0x4283eb[_0xac76('0x6')]||{};}module[_0xac76('0x7')]=FreshdeskAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js
index 9cf8920..1dca2e9 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 _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
+var _0x602e=['name','username','apiKey','remoteUri','Configurations','exports'];(function(_0x275c8d,_0x12caef){var _0x30c4eb=function(_0x5ebaf3){while(--_0x5ebaf3){_0x275c8d['push'](_0x275c8d['shift']());}};_0x30c4eb(++_0x12caef);}(_0x602e,0x108));var _0xe602=function(_0x328bd3,_0x9cf5a5){_0x328bd3=_0x328bd3-0x0;var _0x458149=_0x602e[_0x328bd3];return _0x458149;};'use strict';function FreshsalesAccount(_0x1e7bf6){this['id']=_0x1e7bf6['id']||0x0;this['name']=_0x1e7bf6[_0xe602('0x0')]||'';this[_0xe602('0x1')]=_0x1e7bf6['username']||'';this[_0xe602('0x2')]=_0x1e7bf6['token']||'';this[_0xe602('0x3')]=_0x1e7bf6[_0xe602('0x3')]||'';this['serverUrl']=_0x1e7bf6['serverUrl']||'';this[_0xe602('0x4')]=_0x1e7bf6[_0xe602('0x4')]||{};}module[_0xe602('0x5')]=FreshsalesAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js
index dc5fa64..0d5b7fc 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 _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
+var _0x4916=['uniqueid','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','lastAssignedTo','mohtime','variables','exports','type','inbound'];(function(_0x491514,_0x55e112){var _0x1e1df0=function(_0x4f5a7d){while(--_0x4f5a7d){_0x491514['push'](_0x491514['shift']());}};_0x1e1df0(++_0x55e112);}(_0x4916,0x12a));var _0x6491=function(_0x32eb1f,_0x1fc0a6){_0x32eb1f=_0x32eb1f-0x0;var _0x47ff8f=_0x4916[_0x32eb1f];return _0x47ff8f;};'use strict';function QueueReport(){this[_0x6491('0x0')]=_0x6491('0x1');this[_0x6491('0x2')]='';this[_0x6491('0x3')]='';this['calleridname']='';this[_0x6491('0x4')]='';this[_0x6491('0x5')]=null;this[_0x6491('0x6')]=null;this[_0x6491('0x7')]=0x1;this[_0x6491('0x8')]=0x1;this[_0x6491('0x9')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this[_0x6491('0xa')]=null;this[_0x6491('0xb')]=![];this['queuecallerexitAt']=null;this[_0x6491('0xc')]=0x1;this[_0x6491('0xd')]='';this[_0x6491('0xe')]='';this[_0x6491('0xf')]='';this[_0x6491('0x10')]='';this[_0x6491('0x11')]='';this[_0x6491('0x12')]='';this[_0x6491('0x13')]='';this[_0x6491('0x14')]=0x0;this['assigned']=![];this[_0x6491('0x15')]='';this[_0x6491('0x16')]=0x0;this[_0x6491('0x17')]={};}module[_0x6491('0x18')]=QueueReport;
\ No newline at end of file
diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js
index 3cf8fbb..febfdd4 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 _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
+var _0x1892=['remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username'];(function(_0x341837,_0x52e151){var _0x3fe92a=function(_0x38200c){while(--_0x38200c){_0x341837['push'](_0x341837['shift']());}};_0x3fe92a(++_0x52e151);}(_0x1892,0x8d));var _0x2189=function(_0x559fb6,_0x29408b){_0x559fb6=_0x559fb6-0x0;var _0x270b89=_0x1892[_0x559fb6];return _0x270b89;};'use strict';function SalesforceAccount(_0x21cb2d){this['id']=_0x21cb2d['id']||0x0;this['name']=_0x21cb2d[_0x2189('0x0')]||'';this[_0x2189('0x1')]=_0x21cb2d['username']||'';this[_0x2189('0x2')]=_0x21cb2d[_0x2189('0x2')]||'';this['password']=_0x21cb2d[_0x2189('0x3')]||'';this[_0x2189('0x4')]=_0x21cb2d[_0x2189('0x4')]||'';this[_0x2189('0x5')]=_0x21cb2d[_0x2189('0x5')]||'';this[_0x2189('0x6')]=_0x21cb2d[_0x2189('0x6')]||'';this[_0x2189('0x7')]=_0x21cb2d[_0x2189('0x7')]||'integrationTab';this[_0x2189('0x8')]=_0x21cb2d[_0x2189('0x8')]||'';this[_0x2189('0x9')]=_0x21cb2d[_0x2189('0x9')]||{};}module[_0x2189('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 cc15db6..da490ae 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 _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
+var _0xeaed=['password','remoteUri','serverUrl','Configurations','exports','username'];(function(_0x33e38f,_0x470253){var _0x3afcfa=function(_0x3a558c){while(--_0x3a558c){_0x33e38f['push'](_0x33e38f['shift']());}};_0x3afcfa(++_0x470253);}(_0xeaed,0x15b));var _0xdeae=function(_0xe2941b,_0xc5bf1){_0xe2941b=_0xe2941b-0x0;var _0x515196=_0xeaed[_0xe2941b];return _0x515196;};'use strict';function ServicenowAccount(_0x353929){this['id']=_0x353929['id']||0x0;this['name']=_0x353929['name']||'';this['username']=_0x353929[_0xdeae('0x0')]||'';this[_0xdeae('0x1')]=_0x353929['password']||'';this[_0xdeae('0x2')]=_0x353929['remoteUri']||'';this[_0xdeae('0x3')]=_0x353929[_0xdeae('0x3')]||'';this[_0xdeae('0x4')]=_0x353929[_0xdeae('0x4')]||{};}module[_0xdeae('0x5')]=ServicenowAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js
index 5eba12f..66bac69 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 _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
+var _0xe23c=['username','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x2c5d09,_0x104b0e){var _0x23f99d=function(_0x3bca0b){while(--_0x3bca0b){_0x2c5d09['push'](_0x2c5d09['shift']());}};_0x23f99d(++_0x104b0e);}(_0xe23c,0x15b));var _0xce23=function(_0x4d8666,_0x2ff19d){_0x4d8666=_0x4d8666-0x0;var _0x37175b=_0xe23c[_0x4d8666];return _0x37175b;};'use strict';function SugarcrmAccount(_0x4c10e6){this['id']=_0x4c10e6['id']||0x0;this[_0xce23('0x0')]=_0x4c10e6['name']||'';this['username']=_0x4c10e6[_0xce23('0x1')]||'';this['password']=_0x4c10e6['password']||'';this[_0xce23('0x2')]=_0x4c10e6[_0xce23('0x2')]||'';this[_0xce23('0x3')]=_0x4c10e6['serverUrl']||'';this[_0xce23('0x4')]=_0x4c10e6[_0xce23('0x4')]||{};}module[_0xce23('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 22e7ebe..f8aa569 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 _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
+var _0x01f3=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0x1a3aec,_0x1e36b2){var _0x6ed1bc=function(_0x165abb){while(--_0x165abb){_0x1a3aec['push'](_0x1a3aec['shift']());}};_0x6ed1bc(++_0x1e36b2);}(_0x01f3,0xa8));var _0x301f=function(_0x4fb789,_0x6b8092){_0x4fb789=_0x4fb789-0x0;var _0x49b5e4=_0x01f3[_0x4fb789];return _0x49b5e4;};'use strict';function Telephone(_0x1ce259){this['id']=_0x1ce259['id']||0x0;this[_0x301f('0x0')]=_0x1ce259[_0x301f('0x0')]||'';this['accountcode']=_0x1ce259[_0x301f('0x1')]||'';this[_0x301f('0x2')]=_0x301f('0x3');this[_0x301f('0x4')]=0x0;this[_0x301f('0x5')]=_0x301f('0x3');this[_0x301f('0x6')]='';}module[_0x301f('0x7')]=Telephone;
\ No newline at end of file
diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js
index c409c22..94d1d92 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 _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
+var _0x5b92=['exports','name','html'];(function(_0x2d2e0d,_0x2bf907){var _0x103367=function(_0x14299c){while(--_0x14299c){_0x2d2e0d['push'](_0x2d2e0d['shift']());}};_0x103367(++_0x2bf907);}(_0x5b92,0xdf));var _0x25b9=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5b92[_0x3947c9];return _0x2e7871;};'use strict';function template(_0x24716c){this['id']=_0x24716c['id']||0x0;this[_0x25b9('0x0')]=_0x24716c['name']||'';this[_0x25b9('0x1')]=_0x24716c[_0x25b9('0x1')]||'';}module[_0x25b9('0x2')]=template;
\ No newline at end of file
diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js
index c54c759..e22fea7 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 _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
+var _0x00bb=['status','AllConditions','AnyConditions','exports','name','channel'];(function(_0x1436c7,_0x242c82){var _0x520fbf=function(_0x236011){while(--_0x236011){_0x1436c7['push'](_0x1436c7['shift']());}};_0x520fbf(++_0x242c82);}(_0x00bb,0x1d8));var _0xb00b=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x00bb[_0x134c2e];return _0x2825db;};'use strict';function Trigger(_0x4b870b){this['id']=_0x4b870b['id']||0x0;this[_0xb00b('0x0')]=_0x4b870b[_0xb00b('0x0')]||'';this['channel']=_0x4b870b[_0xb00b('0x1')]||'voice';this[_0xb00b('0x2')]=_0x4b870b[_0xb00b('0x2')]||![];this['AllConditions']=_0x4b870b[_0xb00b('0x3')]||[];this[_0xb00b('0x4')]=_0x4b870b['AnyConditions']||[];this['Actions']=_0x4b870b['Actions']||[];}module[_0xb00b('0x5')]=Trigger;
\ No newline at end of file
diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js
index 20ca86d..e69c6dd 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 _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
+var _0x55c7=['registry','indexOf','host','port','refresh','registrationtime','exports','active','name','state','unknown','status'];(function(_0x55c669,_0xbfa424){var _0x4f6b43=function(_0x3a83f4){while(--_0x3a83f4){_0x55c669['push'](_0x55c669['shift']());}};_0x4f6b43(++_0xbfa424);}(_0x55c7,0x127));var _0x755c=function(_0x9cc6a1,_0x176dc3){_0x9cc6a1=_0x9cc6a1-0x0;var _0x435800=_0x55c7[_0x9cc6a1];return _0x435800;};'use strict';function Trunk(_0x49c835){this['id']=_0x49c835['id']||0x0;this[_0x755c('0x0')]=_0x49c835[_0x755c('0x0')]||![];this[_0x755c('0x1')]=_0x49c835[_0x755c('0x1')]||'';this[_0x755c('0x2')]=_0x755c('0x3');this['stateTime']=0x0;this[_0x755c('0x4')]='unknown';this[_0x755c('0x5')]=_0x49c835['registry']&&_0x49c835[_0x755c('0x5')][_0x755c('0x6')](':')?_0x49c835[_0x755c('0x5')]['split'](':')[0x0]:'';this[_0x755c('0x7')]='';this[_0x755c('0x8')]='';this['domain']='';this['domainport']='';this[_0x755c('0x9')]='';this['stateRegistry']=_0x755c('0x3');this[_0x755c('0xa')]='';this['address']='';}module[_0x755c('0xb')]=Trunk;
\ No newline at end of file
diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js
index ffe77da..5917828 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 _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
+var _0x6d76=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6d76,0xee));var _0x66d7=function(_0x2087e6,_0x4e7e98){_0x2087e6=_0x2087e6-0x0;var _0x740ed2=_0x6d76[_0x2087e6];return _0x740ed2;};'use strict';function voiceExtension(_0x58499a){this['id']=_0x58499a['id']||0x0;this[_0x66d7('0x0')]=_0x58499a[_0x66d7('0x0')]||'';this[_0x66d7('0x1')]=_0x58499a[_0x66d7('0x1')]||'none';this[_0x66d7('0x2')]=_0x58499a['mandatoryDisposition']||![];}module[_0x66d7('0x3')]=voiceExtension;
\ No newline at end of file
diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js
index 21b051e..0e25855 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 _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
+var _0x8cde=['not_inuse','inuse','busy','ringing','ringinuse','wav49','gsm','name','monitor_format','type','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','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','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0x8cde,0x78));var _0xe8cd=function(_0x12d6c2,_0x409bc8){_0x12d6c2=_0x12d6c2-0x0;var _0x1c9825=_0x8cde[_0x12d6c2];return _0x1c9825;};'use strict';var statusDesc=[_0xe8cd('0x0'),_0xe8cd('0x1'),_0xe8cd('0x2'),_0xe8cd('0x3'),'invalid','unavailable',_0xe8cd('0x4'),_0xe8cd('0x5'),'onhold'];var monitorFormat={'wav':'wav','wav49':_0xe8cd('0x6'),'gsm':_0xe8cd('0x7')};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x42f772){this['id']=_0x42f772['id']||0x0;this[_0xe8cd('0x8')]=_0x42f772[_0xe8cd('0x8')]||'';this[_0xe8cd('0x9')]=_0x42f772['monitor_format']||'';this[_0xe8cd('0xa')]=_0x42f772[_0xe8cd('0xa')]||'inbound';this['waiting']=0x0;this[_0xe8cd('0xb')]=0x0;this[_0xe8cd('0xc')]=0x0;this[_0xe8cd('0xd')]=0x0;this[_0xe8cd('0xe')]=0x0;this[_0xe8cd('0xf')]=0x0;this[_0xe8cd('0x10')]=0x0;this[_0xe8cd('0x11')]=0x0;this[_0xe8cd('0x12')]=0x0;this[_0xe8cd('0x13')]=0x0;this[_0xe8cd('0x14')]=0x0;this['acw']=_0x42f772[_0xe8cd('0x15')]||![];this[_0xe8cd('0x16')]=_0x42f772[_0xe8cd('0x16')]||0xa;this['autopause']=_0x42f772[_0xe8cd('0x17')]||'no';this[_0xe8cd('0x18')]=!![];this[_0xe8cd('0x19')]='';this[_0xe8cd('0x1a')]=0x0;this[_0xe8cd('0x1b')]=0x0;this[_0xe8cd('0x1c')]=_0x42f772[_0xe8cd('0x1c')]||null;this[_0xe8cd('0x1d')]=_0x42f772[_0xe8cd('0x1d')]?_0x42f772[_0xe8cd('0x1d')]:null;this[_0xe8cd('0x1e')]=_0x42f772[_0xe8cd('0x1e')];this[_0xe8cd('0x1f')]=_0x42f772['dialMethod']||_0xe8cd('0x20');this[_0xe8cd('0x21')]=_0x42f772[_0xe8cd('0x21')]||0x0;this['dialLimitQueue']=_0x42f772[_0xe8cd('0x22')]||0x0;this[_0xe8cd('0x23')]=_0x42f772[_0xe8cd('0x23')]||0x1;this['dialPredictiveOptimization']=_0x42f772[_0xe8cd('0x24')]||_0xe8cd('0x25');this[_0xe8cd('0x26')]=_0x42f772[_0xe8cd('0x26')]||0.03;this[_0xe8cd('0x27')]=_0x42f772['dialPredictiveInterval']||0x258;this[_0xe8cd('0x28')]=_0x42f772[_0xe8cd('0x28')]||'anonymous';this[_0xe8cd('0x29')]=_0x42f772[_0xe8cd('0x29')]||'anonymous';this[_0xe8cd('0x2a')]=_0x42f772['dialOriginateTimeout']||0x1e;this[_0xe8cd('0x2b')]=_0x42f772[_0xe8cd('0x2b')]||_0xe8cd('0x2c');this['dialQueueTimeout']=_0x42f772[_0xe8cd('0x2d')]||0x3;this[_0xe8cd('0x2e')]=_0x42f772['dialQueueProject']||undefined;this[_0xe8cd('0x2f')]=_0x42f772['dialCongestionMaxRetry']||0x3;this[_0xe8cd('0x30')]=_0x42f772[_0xe8cd('0x30')]||0x96;this[_0xe8cd('0x31')]=_0x42f772[_0xe8cd('0x31')]||0x3;this[_0xe8cd('0x32')]=_0x42f772[_0xe8cd('0x32')]||0x96;this[_0xe8cd('0x33')]=_0x42f772[_0xe8cd('0x33')]||0x3;this[_0xe8cd('0x34')]=_0x42f772[_0xe8cd('0x34')]||0x96;this[_0xe8cd('0x35')]=_0x42f772[_0xe8cd('0x35')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x42f772[_0xe8cd('0x36')]||0x96;this['dialDropMaxRetry']=_0x42f772['dialDropMaxRetry']||0x3;this[_0xe8cd('0x37')]=_0x42f772[_0xe8cd('0x37')]||0x96;this[_0xe8cd('0x38')]=_0x42f772[_0xe8cd('0x38')]||0x3;this['dialAbandonedRetryFrequency']=_0x42f772[_0xe8cd('0x39')]||0x96;this[_0xe8cd('0x3a')]=_0x42f772[_0xe8cd('0x3a')]||0x3;this[_0xe8cd('0x3b')]=_0x42f772[_0xe8cd('0x3b')]||0x96;this[_0xe8cd('0x3c')]=_0x42f772[_0xe8cd('0x3c')]||0x3;this[_0xe8cd('0x3d')]=_0x42f772[_0xe8cd('0x3d')]||0x96;this[_0xe8cd('0x3e')]=_0x42f772[_0xe8cd('0x3e')]||0x4;this[_0xe8cd('0x3f')]=_0x42f772[_0xe8cd('0x3f')]?_0x42f772['Trunk']:undefined;this[_0xe8cd('0x40')]=_0x42f772[_0xe8cd('0x40')]?_0x42f772[_0xe8cd('0x40')]:undefined;this['dialPrefix']=_0x42f772[_0xe8cd('0x41')]||undefined;this[_0xe8cd('0x42')]=_0x42f772['Interval']?_0x42f772[_0xe8cd('0x42')]:undefined;this['dialOrderByScheduledAt']=_0x42f772[_0xe8cd('0x43')]||'DESC';this[_0xe8cd('0x44')]=_0x42f772[_0xe8cd('0x44')]||undefined;this[_0xe8cd('0x45')]=_0x42f772[_0xe8cd('0x45')]||undefined;this['strategy']=strategy[_0x42f772[_0xe8cd('0x46')]]||_0xe8cd('0x47');this[_0xe8cd('0x48')]=!![];this[_0xe8cd('0x49')]=_0x42f772['dialAMDActive']||![];this[_0xe8cd('0x4a')]=_0x42f772['dialAMDInitialSilence'];this[_0xe8cd('0x4b')]=_0x42f772[_0xe8cd('0x4b')];this[_0xe8cd('0x4c')]=_0x42f772[_0xe8cd('0x4c')];this[_0xe8cd('0x4d')]=_0x42f772['dialAMDTotalAnalysisTime'];this[_0xe8cd('0x4e')]=_0x42f772['dialAMDMinWordLength'];this[_0xe8cd('0x4f')]=_0x42f772[_0xe8cd('0x4f')];this['dialAMDMaximumNumberOfWords']=_0x42f772[_0xe8cd('0x50')];this[_0xe8cd('0x51')]=_0x42f772['dialAMDSilenceThreshold'];this[_0xe8cd('0x52')]=_0x42f772[_0xe8cd('0x52')];this[_0xe8cd('0x53')]=0x0;this['pTalking']=0x0;this[_0xe8cd('0x54')]=_0x42f772[_0xe8cd('0x54')];this[_0xe8cd('0x55')]=0x0;this[_0xe8cd('0x56')]=0x0;this[_0xe8cd('0x57')]=0x0;this[_0xe8cd('0x58')]=0x0;this[_0xe8cd('0x59')]=0x0;this[_0xe8cd('0x5a')]=0x0;this[_0xe8cd('0x5b')]=0x0;this[_0xe8cd('0x5c')]=0x0;this[_0xe8cd('0x5d')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xe8cd('0x5e')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xe8cd('0x5f')]=0x0;this[_0xe8cd('0x60')]=0x0;this[_0xe8cd('0x61')]=undefined;this['startPredictive']=undefined;this[_0xe8cd('0x62')]=undefined;this[_0xe8cd('0x63')]=1.05;this[_0xe8cd('0x64')]=0x0;this[_0xe8cd('0x65')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xe8cd('0x66')]=0x0;this[_0xe8cd('0x67')]=0x0;this[_0xe8cd('0x68')]=0x0;this[_0xe8cd('0x69')]=0x0;this[_0xe8cd('0x6a')]=0x0;this[_0xe8cd('0x6b')]=_0x42f772['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x42f772[_0xe8cd('0x6c')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xe8cd('0x6d')]=0x0;this[_0xe8cd('0x6e')]=0x1;this[_0xe8cd('0x6f')]=0x0;this[_0xe8cd('0x70')]=0x0;this[_0xe8cd('0x71')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x42f772[_0xe8cd('0x72')]||0x1e;this[_0xe8cd('0x73')]=_0x42f772[_0xe8cd('0x73')]||![];this[_0xe8cd('0x74')]=_0x42f772['dialQueueProject2']||undefined;this[_0xe8cd('0x75')]=_0x42f772[_0xe8cd('0x75')]||![];this[_0xe8cd('0x76')]=_0x42f772['dialAgiAfterHangupAgent']||![];this[_0xe8cd('0x9')]=monitorFormat[_0x42f772[_0xe8cd('0x9')]]?monitorFormat[_0x42f772['monitor_format']]:undefined;this[_0xe8cd('0x77')]=_0x42f772['mandatoryDisposition']||![];this[_0xe8cd('0x78')]=_0x42f772[_0xe8cd('0x78')]?_0x42f772[_0xe8cd('0x78')]:undefined;}module['exports']=VoiceQueue;
\ No newline at end of file
diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js
index 2b6f1c1..109e7d8 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 _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
+var _0xf17e=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x3a57b0,_0x567cdd){var _0x28bfbc=function(_0x2275f3){while(--_0x2275f3){_0x3a57b0['push'](_0x3a57b0['shift']());}};_0x28bfbc(++_0x567cdd);}(_0xf17e,0x1c1));var _0xef17=function(_0x56ea67,_0x255351){_0x56ea67=_0x56ea67-0x0;var _0x1958f7=_0xf17e[_0x56ea67];return _0x1958f7;};'use strict';function VtigerAccount(_0x56ca77){this['id']=_0x56ca77['id']||0x0;this[_0xef17('0x0')]=_0x56ca77[_0xef17('0x0')]||'';this[_0xef17('0x1')]=_0x56ca77[_0xef17('0x1')]||'';this[_0xef17('0x2')]=_0x56ca77[_0xef17('0x2')]||'';this[_0xef17('0x3')]=_0x56ca77['remoteUri']||'';this[_0xef17('0x4')]=_0x56ca77[_0xef17('0x4')]||'';this['Configurations']=_0x56ca77[_0xef17('0x5')]||{};}module[_0xef17('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 9eb13c4..5cff73b 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 _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
+var _0x0b0e=['exports','name','username','password','token','remoteUri','authType','type','serverUrl','Configurations'];(function(_0x198446,_0x119c8f){var _0x38d7b7=function(_0x293752){while(--_0x293752){_0x198446['push'](_0x198446['shift']());}};_0x38d7b7(++_0x119c8f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x412686,_0x3fde24){_0x412686=_0x412686-0x0;var _0x18619e=_0x0b0e[_0x412686];return _0x18619e;};'use strict';function ZendeskAccount(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['username']=_0x29cd1e[_0xe0b0('0x1')]||'';this[_0xe0b0('0x2')]=_0x29cd1e[_0xe0b0('0x2')]||'';this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||'';this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||'';this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||'';this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||'integrationTab';this['serverUrl']=_0x29cd1e[_0xe0b0('0x7')]||'';this[_0xe0b0('0x8')]=_0x29cd1e[_0xe0b0('0x8')]||{};}module[_0xe0b0('0x9')]=ZendeskAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js
index aeabb34..288d4a2 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 _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
+var _0xbcae=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x139a25,_0x1707d7){var _0x330a62=function(_0x3092b4){while(--_0x3092b4){_0x139a25['push'](_0x139a25['shift']());}};_0x330a62(++_0x1707d7);}(_0xbcae,0xa9));var _0xebca=function(_0x35caba,_0x35f4a1){_0x35caba=_0x35caba-0x0;var _0x4bc428=_0xbcae[_0x35caba];return _0x4bc428;};'use strict';function ZohoAccount(_0x368872){this['id']=_0x368872['id']||0x0;this[_0xebca('0x0')]=_0x368872[_0xebca('0x0')]||'';this[_0xebca('0x1')]=_0x368872[_0xebca('0x1')]||'';this[_0xebca('0x2')]=_0x368872[_0xebca('0x2')]||'';this[_0xebca('0x3')]=_0x368872[_0xebca('0x3')]||'';this[_0xebca('0x4')]=_0x368872['clientId']||'';this[_0xebca('0x5')]=_0x368872[_0xebca('0x5')]||'';this['serverUrl']=_0x368872[_0xebca('0x6')]||'';this[_0xebca('0x7')]=_0x368872[_0xebca('0x7')]||'';this['refreshToken']=_0x368872[_0xebca('0x8')]||'';this[_0xebca('0x9')]=_0x368872[_0xebca('0x9')]||{};}module[_0xebca('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 b1306fe..9b98737 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 _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
+var _0x1e89=['countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','util','lodash','moment','isNil','uniqueid','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','firstName','active','phone','scheduledat','countbusyretry','countcongestionretry'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0x1e89,0x64));var _0x91e8=function(_0x574851,_0x166518){_0x574851=_0x574851-0x0;var _0x5d7b4d=_0x1e89[_0x574851];return _0x5d7b4d;};'use strict';var util=require(_0x91e8('0x0'));var _=require(_0x91e8('0x1'));var moment=require(_0x91e8('0x2'));function checkNameSurname(_0x1521ce,_0x27db6c,_0x2082ce){var _0x2aab7b='';if(!_[_0x91e8('0x3')](_0x27db6c)&&'string'===typeof _0x27db6c){_0x2aab7b+=_0x27db6c;}if(!_[_0x91e8('0x3')](_0x2082ce)&&'string'===typeof _0x2082ce){_0x2aab7b+='\x20'+_0x2082ce;}if(_0x2aab7b!==''){return _0x2aab7b;}return _0x1521ce;}function Action(_0x5db141,_0x2666ca,_0x1676c2,_0x2e7133,_0x102a42){this[_0x91e8('0x4')]=_0x1676c2||undefined;this['idContact']=_0x5db141['id'];this['queue']=_0x2666ca[_0x91e8('0x5')];this[_0x91e8('0x6')]=_0x2666ca[_0x91e8('0x6')];this[_0x91e8('0x7')]=_0x91e8('0x8');this[_0x91e8('0x9')]=![];this[_0x91e8('0xa')]=_[_0x91e8('0x3')](_0x5db141[_0x91e8('0xb')])?undefined:_0x5db141[_0x91e8('0xb')][_0x91e8('0x5')];this[_0x91e8('0xc')]=this['membername']?util[_0x91e8('0xd')](_0x91e8('0xe'),this[_0x91e8('0xa')]):_0x2e7133||undefined;this[_0x91e8('0xf')]=checkNameSurname(_0x5db141[_0x91e8('0x10')]['phone'],_0x5db141['Contact'][_0x91e8('0x11')],_0x5db141[_0x91e8('0x10')]['lastName']);this[_0x91e8('0x12')]=_0x5db141[_0x91e8('0x12')]||![];this['calleridnum']=_0x5db141['Contact'][_0x91e8('0x13')];this['scheduledat']=_0x5db141[_0x91e8('0x14')];this['countbusyretry']=_0x5db141[_0x91e8('0x15')]||0x0;this[_0x91e8('0x16')]=_0x5db141[_0x91e8('0x16')]||0x0;this[_0x91e8('0x17')]=_0x5db141[_0x91e8('0x17')]||0x0;this['countglobal']=(_0x5db141[_0x91e8('0x15')]||0x0)+(_0x5db141[_0x91e8('0x16')]||0x0)+(_0x5db141[_0x91e8('0x17')]||0x0)+(_0x5db141[_0x91e8('0x18')]||0x0)+(_0x5db141[_0x91e8('0x19')]||0x0)+(_0x5db141[_0x91e8('0x1a')]||0x0)+(_0x5db141[_0x91e8('0x1b')]||0x0)+(_0x5db141[_0x91e8('0x1c')]||0x0);this['countnosuchnumberretry']=_0x5db141['countnosuchnumberretry']||0x0;this[_0x91e8('0x19')]=_0x5db141[_0x91e8('0x19')]||0x0;this[_0x91e8('0x1a')]=_0x5db141['countabandonedretry']||0x0;this['countmachineretry']=_0x5db141['countmachineretry']||0x0;this[_0x91e8('0x1c')]=_0x5db141[_0x91e8('0x1c')]||0x0;this[_0x91e8('0x1d')]=_0x5db141[_0x91e8('0x1d')];this['callbackuniqueid']=_0x5db141[_0x91e8('0x1e')];this[_0x91e8('0x1f')]=_0x5db141[_0x91e8('0x1f')];this[_0x91e8('0x20')]=_0x5db141[_0x91e8('0x20')];this[_0x91e8('0x21')]=_0x5db141[_0x91e8('0x21')];this['ListId']=_0x5db141[_0x91e8('0x22')];this['UserId']=_[_0x91e8('0x3')](_0x5db141['Agent'])?_0x5db141[_0x91e8('0x23')]:_0x5db141['Agent']['id'];this['VoiceQueueId']=_0x5db141['VoiceQueueId'];this[_0x91e8('0x24')]='';this[_0x91e8('0x25')]='';}Action[_0x91e8('0x26')][_0x91e8('0x27')]=function(){return util[_0x91e8('0xd')]('\x22%s\x22\x20<%s>',this[_0x91e8('0xf')],this[_0x91e8('0x28')]);};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 10d11f1..efaf81e 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 _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
+var _0x03ca=['extractCalleridNumber','merge','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','isFailure','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','variables','filterKey','keys','addVariable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','preview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','sequence','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','syncAttendedTransfer','syncBlindTransfer','campaignsPreview','emit','name','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','loopCampaigns','syncCampaigns','clockClearZombieChannels','clearZombieChannels','hasOwnProperty','outbound','setMessage','recallMe','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','linkedid','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','pTalking:\x20','custom:agentconnect','buildAcw','custom:agentcomplete','complete','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','uniqueid','BUSY','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','activeContact','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','countcongestionretry','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','outboundUnknownCallsDay','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','callProgressDetectingAgent','isUndefined','object','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','unlock','unlockContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','catch','[Preview][checkIsBlackList]','Call\x20unsuccessful','[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','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','dialRandomLastDigitCallerIdNumber','getCallerId','getCallerIdRandom','extractCalleridName'];(function(_0x58e582,_0x41b688){var _0x27f1cd=function(_0x530c74){while(--_0x530c74){_0x58e582['push'](_0x58e582['shift']());}};_0x27f1cd(++_0x41b688);}(_0x03ca,0x172));var _0xa03c=function(_0x4ab3ba,_0x512040){_0x4ab3ba=_0x4ab3ba-0x0;var _0x23c1bd=_0x03ca[_0x4ab3ba];return _0x23c1bd;};'use strict';var util=require(_0xa03c('0x0'));var _=require(_0xa03c('0x1'));var BPromise=require(_0xa03c('0x2'));var uuid=require(_0xa03c('0x3'));var moment=require(_0xa03c('0x4'));var md5=require(_0xa03c('0x5'));var Redis=require(_0xa03c('0x6'));var config=require(_0xa03c('0x7'));var logger=require('../../../config/logger')(_0xa03c('0x8'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0xa03c('0x9'));var rpcDb=require(_0xa03c('0xa'));var Action=require(_0xa03c('0xb'));var ut=require(_0xa03c('0xc'));config[_0xa03c('0xd')]=_[_0xa03c('0xe')](config[_0xa03c('0xd')],{'host':_0xa03c('0xf'),'port':0x18eb});var io=require(_0xa03c('0x10'))(new Redis(config[_0xa03c('0xd')]));var Sequence=function(){};Sequence[_0xa03c('0x11')]['enqueue']=function(_0x4f559e){this[_0xa03c('0x12')]=this[_0xa03c('0x12')]?this[_0xa03c('0x12')]['finally'](_0x4f559e):_0x4f559e();};function Preview(_0x29289d){this[_0xa03c('0x13')]=new Sequence();this['campaignsPreview']=_0x29289d['voiceQueues'];this[_0xa03c('0x14')]=_0x29289d['trunks'];this[_0xa03c('0x15')]={};this['agents']=_0x29289d[_0xa03c('0x16')];this['clockClearZombieChannels']=0x0;ami['on'](_0xa03c('0x17'),this[_0xa03c('0x18')][_0xa03c('0x19')](this));ami['on'](_0xa03c('0x1a'),this[_0xa03c('0x1b')][_0xa03c('0x19')](this));ami['on']('hanguprequest',this[_0xa03c('0x1c')][_0xa03c('0x19')](this));ami['on'](_0xa03c('0x1d'),this[_0xa03c('0x1e')][_0xa03c('0x19')](this));ami['on'](_0xa03c('0x1f'),this['syncNewExten'][_0xa03c('0x19')](this));ami['on'](_0xa03c('0x20'),this[_0xa03c('0x21')][_0xa03c('0x19')](this));ami['on']('attendedtransfer',this[_0xa03c('0x22')]['bind'](this));ami['on']('blindtransfer',this[_0xa03c('0x23')]['bind'](this));this['loopCampaigns'](this[_0xa03c('0x24')]);}function emit(_0x46cc31,_0x20963f,_0x2171d1){io['to'](_0x46cc31)[_0xa03c('0x25')](_0x20963f,_0x2171d1);}function emitCampaignPreview(_0x42cc1d){if(_0x42cc1d['type']==='outbound'){var _0xcb5c94={'id':_0x42cc1d['id'],'name':_0x42cc1d[_0xa03c('0x26')],'strategy':_0x42cc1d[_0xa03c('0x27')],'answered':_0x42cc1d['answered'],'available':_0x42cc1d[_0xa03c('0x28')],'loggedIn':_0x42cc1d[_0xa03c('0x29')],'pTalking':_0x42cc1d[_0xa03c('0x2a')],'sumBillable':_0x42cc1d[_0xa03c('0x2b')],'sumDuration':_0x42cc1d[_0xa03c('0x2c')],'sumHoldTime':_0x42cc1d[_0xa03c('0x2d')]||0x0,'talking':_0x42cc1d['talking'],'total':_0x42cc1d[_0xa03c('0x2e')],'type':_0x42cc1d[_0xa03c('0x2f')],'unmanaged':_0x42cc1d[_0xa03c('0x30')],'abandoned':_0x42cc1d[_0xa03c('0x31')],'waiting':_0x42cc1d[_0xa03c('0x32')],'loggedInDb':_0x42cc1d['loggedInDb'],'dialActive':_0x42cc1d[_0xa03c('0x33')],'dialMethod':_0x42cc1d[_0xa03c('0x34')],'dialOriginateCallerIdName':_0x42cc1d[_0xa03c('0x35')],'dialOriginateCallerIdNumber':_0x42cc1d[_0xa03c('0x36')],'dialOriginateTimeout':_0x42cc1d[_0xa03c('0x37')],'dialPrefix':_0x42cc1d['dialPrefix'],'outboundAnswerAgiCallsDay':_0x42cc1d['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x42cc1d[_0xa03c('0x38')],'outboundBlacklistCallsDay':_0x42cc1d['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x42cc1d['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x42cc1d['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x42cc1d['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x42cc1d[_0xa03c('0x39')],'outboundDropCallsDayTimeout':_0x42cc1d[_0xa03c('0x3a')],'outboundNoAnswerCallsDay':_0x42cc1d[_0xa03c('0x3b')],'outboundNoSuchCallsDay':_0x42cc1d[_0xa03c('0x3c')],'outboundOriginateFailureCallsDay':_0x42cc1d[_0xa03c('0x3d')],'outboundReCallsDay':_0x42cc1d[_0xa03c('0x3e')],'outboundRejectCallsDay':_0x42cc1d['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x42cc1d['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x42cc1d['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x42cc1d[_0xa03c('0x3f')],'predictiveIntervalAvgHoldtime':_0x42cc1d['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x42cc1d[_0xa03c('0x40')],'predictiveIntervalDroppedCallsCallersExit':_0x42cc1d['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x42cc1d[_0xa03c('0x41')],'predictiveIntervalErlangCalls':_0x42cc1d[_0xa03c('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0x42cc1d[_0xa03c('0x43')],'predictiveIntervalHitRate':_0x42cc1d[_0xa03c('0x44')],'predictiveIntervalMultiplicativeFactor':_0x42cc1d[_0xa03c('0x45')],'predictiveIntervalPauses':_0x42cc1d[_0xa03c('0x46')],'predictiveIntervalAvailable':_0x42cc1d[_0xa03c('0x47')],'predictiveIntervalTotalCalls':_0x42cc1d[_0xa03c('0x48')],'message':_0x42cc1d[_0xa03c('0x49')],'originated':_0x42cc1d[_0xa03c('0x4a')],'erlangCalls':_0x42cc1d[_0xa03c('0x4b')],'erlangCallToSecond':_0x42cc1d[_0xa03c('0x4c')],'erlangAbandonmentRate':_0x42cc1d[_0xa03c('0x4d')],'erlangBusyFactor':_0x42cc1d['erlangBusyFactor'],'startPredictive':_0x42cc1d[_0xa03c('0x4e')],'startProgressive':_0x42cc1d[_0xa03c('0x4f')]};if(_0x42cc1d[_0xa03c('0x50')]){_0xcb5c94[_0xa03c('0x50')]={'id':_0x42cc1d[_0xa03c('0x50')]['id'],'name':_0x42cc1d[_0xa03c('0x50')][_0xa03c('0x26')],'active':_0x42cc1d[_0xa03c('0x50')]['active'],'callerid':_0x42cc1d['Trunk'][_0xa03c('0x51')]};}if(_0x42cc1d[_0xa03c('0x52')]){_0xcb5c94[_0xa03c('0x52')]={'id':_0x42cc1d['Interval']['id'],'name':_0x42cc1d[_0xa03c('0x52')][_0xa03c('0x26')]};}var _0x326da6=md5(JSON[_0xa03c('0x53')](_0xcb5c94));if(_0x42cc1d['md5']!==_0x326da6){_0x42cc1d[_0xa03c('0x5')]=_0x326da6;emit(util['format'](_0xa03c('0x54'),_0xcb5c94[_0xa03c('0x26')]),_0xa03c('0x55'),_0xcb5c94);}}}function emitVoiceQueueChannelRemove(_0x5e13f9){logger[_0xa03c('0x56')](_0xa03c('0x57'),JSON['stringify'](_0x5e13f9));emit(util[_0xa03c('0x58')](_0xa03c('0x54'),_0x5e13f9[_0xa03c('0x26')]),_0xa03c('0x59'),_0x5e13f9);}function notSendMessagesQueue(_0x5683d5){if(_0x5683d5[_0xa03c('0x5a')]){if(_0x5683d5[_0xa03c('0x4a')]===0x0&&_0x5683d5[_0xa03c('0x2a')]===0x0){_0x5683d5['sendMessageOneNotActive']=![];_0x5683d5[_0xa03c('0x28')]=0x0;_0x5683d5[_0xa03c('0x5b')]=0x0;_0x5683d5['message']=_0xa03c('0x5c');ut[_0xa03c('0x5d')](_0xa03c('0x5e'),_0x5683d5[_0xa03c('0x26')]+'\x20is\x20not\x20active');}else{_0x5683d5[_0xa03c('0x49')]=_0xa03c('0x5f');ut[_0xa03c('0x5d')](_0xa03c('0x5e'),_0x5683d5['name']+'\x20is\x20disactive');}emitCampaignPreview(_0x5683d5);}}Preview[_0xa03c('0x11')][_0xa03c('0x60')]=function(){var _0xd54a10=this;setInterval(function(){_0xd54a10['syncCampaigns']();},0x7cf);};Preview['prototype'][_0xa03c('0x61')]=function(){var _0x4f2067=this[_0xa03c('0x24')];this[_0xa03c('0x62')]+=0x1;for(var _0x7e4bb5 in _0x4f2067){if(_0x4f2067['hasOwnProperty'](_0x7e4bb5)&&(_0x4f2067[_0x7e4bb5]['dialMethod']===_0xa03c('0x8')||_0x4f2067[_0x7e4bb5][_0xa03c('0x34')]==='booked')&&_0x4f2067[_0x7e4bb5]['type']==='outbound'){if(this[_0xa03c('0x62')]>0x7){this[_0xa03c('0x62')]=0x0;this[_0xa03c('0x63')]();}}if(_0x4f2067[_0xa03c('0x64')](_0x7e4bb5)&&_0x4f2067[_0x7e4bb5][_0xa03c('0x34')]===_0xa03c('0x8')&&_0x4f2067[_0x7e4bb5]['type']===_0xa03c('0x65')){if(_0x4f2067[_0x7e4bb5][_0xa03c('0x33')]){this[_0xa03c('0x66')](_0x4f2067[_0x7e4bb5]);this[_0xa03c('0x67')](_0x4f2067[_0x7e4bb5]);}else{notSendMessagesQueue(_0x4f2067[_0x7e4bb5]);}}}};Preview[_0xa03c('0x11')][_0xa03c('0x68')]=function(_0x37994f){var _0x4b1239=this;this['sequence'][_0xa03c('0x69')](function(){if(!_[_0xa03c('0x6a')](_0x4b1239[_0xa03c('0x15')][_0x37994f])){loggerAction['info'](_0xa03c('0x6b'),_0x37994f,_0xa03c('0x6c'),_0x4b1239['actions'][_0x37994f][_0xa03c('0x6d')],_0xa03c('0x6e'),JSON[_0xa03c('0x53')](_0x4b1239[_0xa03c('0x24')][_0x4b1239[_0xa03c('0x15')][_0x37994f][_0xa03c('0x6d')]][_0xa03c('0x4a')]),'pTalking:\x20',JSON[_0xa03c('0x53')](_0x4b1239[_0xa03c('0x24')][_0x4b1239[_0xa03c('0x15')][_0x37994f][_0xa03c('0x6d')]][_0xa03c('0x2a')]),JSON[_0xa03c('0x53')](_0x4b1239[_0xa03c('0x15')][_0x37994f][_0xa03c('0x6f')]),JSON[_0xa03c('0x53')](_[_0xa03c('0x70')](_0x4b1239[_0xa03c('0x15')][_0x37994f],[_0xa03c('0x71'),_0xa03c('0x72'),_0xa03c('0x73'),_0xa03c('0x74')])));return ami[_0xa03c('0x75')]({'action':_0xa03c('0x76'),'channel':_0x4b1239[_0xa03c('0x15')][_0x37994f][_0xa03c('0x77')]})['catch'](function(_0x7269e8){if(_0x7269e8['message']===_0xa03c('0x78')){setTimeout(function(){if(_0x4b1239[_0xa03c('0x15')][_0x37994f]){ut[_0xa03c('0x79')](_0x4b1239['campaignsPreview'][_0x4b1239['actions'][_0x37994f]['queue']],'[clearZombieChannel]');if(_0x4b1239['actions'][_0x37994f][_0xa03c('0x6f')]===!![]){ut[_0xa03c('0x7a')](_0x4b1239[_0xa03c('0x24')][_0x4b1239[_0xa03c('0x15')][_0x37994f]['queue']],'[clearZombieChannel]');ut[_0xa03c('0x7b')](_0xa03c('0x7c')+_0x37994f,_0x4b1239[_0xa03c('0x15')][_0x37994f][_0xa03c('0x6d')]);}ut[_0xa03c('0x7b')](_0xa03c('0x7d')+_0x37994f,_0x4b1239[_0xa03c('0x15')][_0x37994f]['queue']);delete _0x4b1239[_0xa03c('0x15')][_0x37994f];}},0x2328);}});}});};Preview['prototype'][_0xa03c('0x63')]=function(){var _0x181a3c=this;loggerAction[_0xa03c('0x56')](_0xa03c('0x7e'),_[_0xa03c('0x7f')](this['actions']));for(var _0x4a2a03 in this[_0xa03c('0x15')]){if(_0x181a3c[_0xa03c('0x15')][_0xa03c('0x64')](_0x4a2a03)){_0x181a3c[_0xa03c('0x68')](_0x4a2a03);}}};Preview[_0xa03c('0x11')][_0xa03c('0x67')]=function(_0x1caabd){var _0x14d3fd=this;rpcDb[_0xa03c('0x80')](_0x1caabd['id'],ut['agentReadyId'](this[_0xa03c('0x16')]))[_0xa03c('0x81')](function(_0x2fe9a6){if(!_['isNil'](_0x2fe9a6)){for(var _0x3cae1f=0x0;_0x3cae1f<_0x2fe9a6['length'];_0x3cae1f+=0x1){if(ut[_0xa03c('0x82')](_0x2fe9a6[_0x3cae1f][_0xa03c('0x83')])<_0x1caabd[_0xa03c('0x84')]*0x3c){if(_0x2fe9a6[_0x3cae1f][_0xa03c('0x85')]&&!_0x2fe9a6[_0x3cae1f][_0xa03c('0x85')][_0xa03c('0x86')]){_0x14d3fd[_0xa03c('0x87')](_0x2fe9a6[_0x3cae1f]['id'])[_0xa03c('0x81')](ut[_0xa03c('0x88')]('[RecallMe]'))['catch'](ut[_0xa03c('0x88')]('[RecallMe]'));}else{rpcDb[_0xa03c('0x89')](_0x2fe9a6[_0x3cae1f]['id']);}}else{var _0x3638c5=new Action(_0x2fe9a6[_0x3cae1f],_0x1caabd);_0x3638c5[_0xa03c('0x8a')]=moment()[_0xa03c('0x58')](_0xa03c('0x8b'));_0x1caabd[_0xa03c('0x3e')]+=0x1;ut[_0xa03c('0x8c')](_0x3638c5,0x17,_0xa03c('0x8d'));if(_0x1caabd['dialRecallInQueue']){rpcDb[_0xa03c('0x8e')](ut['createBody'](_0x2fe9a6[_0x3cae1f]));rpcDb[_0xa03c('0x8f')](_0x3638c5,_0xa03c('0x90'));}else{ut['logCustomer'](_0x3638c5,0x16,'RecallFailedTimeout');rpcDb[_0xa03c('0x8f')](_0x3638c5,_0xa03c('0x91'));rpcDb[_0xa03c('0x92')](_0x3638c5,_0xa03c('0x91'));}}}}})['catch'](ut['logger2'](_0xa03c('0x93')));};Preview[_0xa03c('0x11')][_0xa03c('0x66')]=function(_0x58be6f){_0x58be6f[_0xa03c('0x5a')]=!![];if(ut[_0xa03c('0x94')](_0x58be6f[_0xa03c('0x29')])){_0x58be6f[_0xa03c('0x49')]='AGENTS_NOT_LOGGED';}else if(!ut[_0xa03c('0x95')](_0x58be6f[_0xa03c('0x33')])){_0x58be6f[_0xa03c('0x49')]='NOT_ACTIVE';}else if(!this['isTrunkReachable'](_0x58be6f[_0xa03c('0x50')])){if(!this[_0xa03c('0x96')](_0x58be6f[_0xa03c('0x97')])){_0x58be6f[_0xa03c('0x49')]=_0xa03c('0x98');}else{_0x58be6f[_0xa03c('0x49')]=_0xa03c('0x99');}}else{_0x58be6f[_0xa03c('0x49')]=_0xa03c('0x99');}emitCampaignPreview(_0x58be6f);};Preview[_0xa03c('0x11')][_0xa03c('0x9a')]=function(_0x10b565,_0x112d59,_0x484eaf){var _0x5112be=this;var _0x211fd8=this['actions'][_0x112d59];var _0x329f41=this[_0xa03c('0x24')][_0x211fd8[_0xa03c('0x6d')]];var _0x4e2843;if(_0x329f41){switch(_0x484eaf){case'1':_0x329f41[_0xa03c('0x3c')]+=0x1;_0x211fd8[_0xa03c('0x9b')]+=0x1;_0x211fd8[_0xa03c('0x9c')]=ut[_0xa03c('0x9d')](_0x211fd8);ut[_0xa03c('0x8c')](_0x211fd8,0x0,_0xa03c('0x9e'));ami[_0xa03c('0x25')]('custom:agentnosuchnumber',ut[_0xa03c('0x9f')](_0x211fd8,_0xa03c('0xa0')));rpcDb['createCustomerHistory'](_0x211fd8,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xa03c('0x9d')](_0x211fd8)>=_0x329f41[_0xa03c('0xa1')]){_0x4e2843=ut[_0xa03c('0xa2')](_0x211fd8,0xf,_0xa03c('0xa3'));rpcDb['createCustomerFinal'](_0x4e2843,_0xa03c('0xa4'));}else{if(_0x211fd8[_0xa03c('0x9b')]>=_0x329f41['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x211fd8,_0xa03c('0xa4'));}else{rpcDb[_0xa03c('0xa5')](ut[_0xa03c('0xa6')](_0x211fd8,_0xa03c('0x9b'),_0x329f41['dialNoSuchNumberRetryFrequency']),_0x211fd8[_0xa03c('0xa7')],_0x211fd8['activeContact']);}}delete this[_0xa03c('0x15')][_0x10b565[_0xa03c('0xa8')]];break;case'ANSWER':var _0x53d422=moment()[_0xa03c('0x58')](_0xa03c('0x8b'));_0x211fd8[_0xa03c('0xa9')]=_0x53d422;_0x211fd8[_0xa03c('0xaa')]=_0x53d422;_0x211fd8['dialAnswer']=!![];_0x329f41['pTalking']+=0x1;logger[_0xa03c('0x56')](_0xa03c('0xab'),_0x211fd8['uniqueid'],_0xa03c('0xac'),_0x329f41[_0xa03c('0x26')],_0xa03c('0xad'),_0x329f41[_0xa03c('0x2a')]);ami[_0xa03c('0x25')](_0xa03c('0xae'),ut[_0xa03c('0x9f')](_0x211fd8,'connect'));if(_0x329f41['acw']){ami['emit']('custom:agentConnectPreview',ut[_0xa03c('0xaf')](_0x211fd8));}break;case'16':ami[_0xa03c('0x25')](_0xa03c('0xb0'),ut[_0xa03c('0x9f')](_0x211fd8,_0xa03c('0xb1')));emitVoiceQueueChannelRemove(ut[_0xa03c('0x9f')](_0x211fd8,_0xa03c('0xb1')));_0x329f41[_0xa03c('0x38')]+=0x1;_0x329f41[_0xa03c('0x2e')]+=0x1;_0x329f41[_0xa03c('0xb2')]+=0x1;ut[_0xa03c('0x7a')](_0x329f41,_0xa03c('0xb3'));_0x211fd8[_0xa03c('0x9c')]=ut[_0xa03c('0x9d')](_0x211fd8);ut[_0xa03c('0x8c')](_0x211fd8,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211fd8,_0xa03c('0xb4'));rpcDb['createCustomerFinal'](_0x211fd8,_0xa03c('0xb5'));rpcDb['crateCustomerReportQueue'](_0x211fd8);_0x329f41[_0xa03c('0x2c')]+=_0x211fd8['talktime'];_0x329f41[_0xa03c('0x2b')]+=_0x211fd8[_0xa03c('0xb6')];logger[_0xa03c('0x56')](_0xa03c('0xb7'),_0x211fd8[_0xa03c('0xb8')],_0xa03c('0xac'),_0x329f41['name'],_0xa03c('0xad'),_0x329f41[_0xa03c('0x2a')]);delete this[_0xa03c('0x15')][_0x10b565['linkedid']];break;case _0xa03c('0xb9'):_0x329f41[_0xa03c('0xba')]+=0x1;_0x211fd8[_0xa03c('0xbb')]+=0x1;_0x211fd8[_0xa03c('0x9c')]=ut[_0xa03c('0x9d')](_0x211fd8);ut[_0xa03c('0x8c')](_0x211fd8,0x5,_0xa03c('0xbc'));ami[_0xa03c('0x25')](_0xa03c('0xbd'),ut[_0xa03c('0x9f')](_0x211fd8,'busy'));rpcDb[_0xa03c('0x8f')](_0x211fd8,_0xa03c('0xbe'));if(ut[_0xa03c('0x9d')](_0x211fd8)>=_0x329f41[_0xa03c('0xa1')]){_0x4e2843=ut[_0xa03c('0xa2')](_0x211fd8,0xf,'Global');rpcDb[_0xa03c('0x92')](_0x4e2843,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x211fd8[_0xa03c('0xbb')]>=_0x329f41['dialBusyMaxRetry']){rpcDb[_0xa03c('0x92')](_0x211fd8,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut[_0xa03c('0xa6')](_0x211fd8,_0xa03c('0xbb'),_0x329f41[_0xa03c('0xbf')]),_0x211fd8[_0xa03c('0xa7')],_0x211fd8[_0xa03c('0xc0')]);}}break;case'NOANSWER':_0x329f41['outboundNoAnswerCallsDay']+=0x1;_0x211fd8[_0xa03c('0xc1')]+=0x1;_0x211fd8[_0xa03c('0x9c')]=ut['totalGlobal'](_0x211fd8);ut[_0xa03c('0x8c')](_0x211fd8,0x3,_0xa03c('0xc2'));ami[_0xa03c('0x25')](_0xa03c('0xc3'),ut[_0xa03c('0x9f')](_0x211fd8,_0xa03c('0xc4')));rpcDb[_0xa03c('0x8f')](_0x211fd8,_0xa03c('0xc5'));if(ut[_0xa03c('0x9d')](_0x211fd8)>=_0x329f41[_0xa03c('0xa1')]){_0x4e2843=ut[_0xa03c('0xa2')](_0x211fd8,0xf,_0xa03c('0xa3'));rpcDb['createCustomerFinal'](_0x4e2843,_0xa03c('0xc6'));}else{if(_0x211fd8[_0xa03c('0xc1')]>=_0x329f41[_0xa03c('0xc7')]){rpcDb[_0xa03c('0x92')](_0x211fd8,_0xa03c('0xc5'));}else{rpcDb[_0xa03c('0xa5')](ut[_0xa03c('0xa6')](_0x211fd8,'countnoanswerretry',_0x329f41[_0xa03c('0xc8')]),_0x211fd8[_0xa03c('0xa7')],_0x211fd8['activeContact']);}}break;case'CONGESTION':_0x329f41[_0xa03c('0xc9')]+=0x1;_0x211fd8['countcongestionretry']+=0x1;_0x211fd8[_0xa03c('0x9c')]=ut[_0xa03c('0x9d')](_0x211fd8);ut[_0xa03c('0x8c')](_0x211fd8,0x8,'Congestion');ami[_0xa03c('0x25')](_0xa03c('0xca'),ut[_0xa03c('0x9f')](_0x211fd8,'congestion'));rpcDb[_0xa03c('0x8f')](_0x211fd8,_0xa03c('0xcb'));if(ut[_0xa03c('0x9d')](_0x211fd8)>=_0x329f41[_0xa03c('0xa1')]){_0x4e2843=ut[_0xa03c('0xa2')](_0x211fd8,0xf,_0xa03c('0xa3'));rpcDb[_0xa03c('0x92')](_0x4e2843,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x211fd8[_0xa03c('0xcc')]>=_0x329f41[_0xa03c('0xcd')]){rpcDb[_0xa03c('0x92')](_0x211fd8,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xa03c('0xa5')](ut[_0xa03c('0xa6')](_0x211fd8,_0xa03c('0xcc'),_0x329f41[_0xa03c('0xbf')]),_0x211fd8[_0xa03c('0xa7')],_0x211fd8[_0xa03c('0xc0')]);}}break;case _0xa03c('0xce'):_0x329f41[_0xa03c('0xcf')]+=0x1;_0x211fd8[_0xa03c('0xd0')]+=0x1;_0x211fd8[_0xa03c('0x9c')]=ut[_0xa03c('0x9d')](_0x211fd8);ut['logCustomer'](_0x211fd8,0x14,'AgentReject');ami[_0xa03c('0x25')](_0xa03c('0xd1'),ut[_0xa03c('0x9f')](_0x211fd8,_0xa03c('0xd2')));rpcDb[_0xa03c('0x8f')](_0x211fd8,_0xa03c('0xd3'));if(ut[_0xa03c('0x9d')](_0x211fd8)>=_0x329f41[_0xa03c('0xa1')]){_0x4e2843=ut[_0xa03c('0xa2')](_0x211fd8,0x14,_0xa03c('0xd4'));rpcDb[_0xa03c('0x92')](_0x4e2843,_0xa03c('0xd5'));}else{if(_0x211fd8[_0xa03c('0xd0')]>=_0x329f41[_0xa03c('0xd6')]){rpcDb[_0xa03c('0x92')](_0x211fd8,_0xa03c('0xd5'));}else{rpcDb[_0xa03c('0xa5')](ut['scheduledAt'](_0x211fd8,_0xa03c('0xd0'),_0x329f41[_0xa03c('0xd7')]),_0x211fd8['unlockAgent'],_0x211fd8['activeContact']);}}break;case'ABANDONED':_0x329f41[_0xa03c('0xd8')]+=0x1;_0x211fd8[_0xa03c('0xd9')]+=0x1;_0x211fd8[_0xa03c('0x9c')]=ut[_0xa03c('0x9d')](_0x211fd8);ut[_0xa03c('0x8c')](_0x211fd8,0xb,_0xa03c('0xda'));rpcDb[_0xa03c('0x8f')](_0x211fd8,_0xa03c('0xdb'));if(ut['totalGlobal'](_0x211fd8)>=_0x329f41[_0xa03c('0xa1')]){_0x4e2843=ut[_0xa03c('0xa2')](_0x211fd8,0xf,_0xa03c('0xa3'));rpcDb[_0xa03c('0x92')](_0x4e2843,_0xa03c('0xdb'));}else{if(_0x211fd8[_0xa03c('0xdc')]>=_0x329f41[_0xa03c('0xdd')]){rpcDb[_0xa03c('0x92')](_0x211fd8,_0xa03c('0xdb'));}else{rpcDb[_0xa03c('0xa5')](ut['scheduledAt'](_0x211fd8,_0xa03c('0xd9'),_0x329f41[_0xa03c('0xde')]),_0x211fd8[_0xa03c('0xa7')],_0x211fd8[_0xa03c('0xc0')]);}}break;default:if(_0x211fd8[_0xa03c('0x6f')]){ut['decrementTalkink'](_0x329f41,_0xa03c('0xdf'));ut[_0xa03c('0x7b')](_0xa03c('0xe0')+_0x329f41['name'],_0x10b565);}_0x329f41[_0xa03c('0xe1')]+=0x1;_0x211fd8['countglobal']=ut['totalGlobal'](_0x211fd8);ut[_0xa03c('0x8c')](_0x211fd8,0xc,_0x10b565[_0xa03c('0xe2')]||_0x10b565[_0xa03c('0xe3')]);rpcDb[_0xa03c('0x8f')](_0x211fd8,_0xa03c('0xe4'));if(ut[_0xa03c('0x9d')](_0x211fd8)>=_0x329f41[_0xa03c('0xa1')]){_0x4e2843=ut[_0xa03c('0xa2')](_0x211fd8,0xf,_0xa03c('0xa3'));rpcDb[_0xa03c('0x92')](_0x4e2843,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xa03c('0x92')](_0x211fd8,_0xa03c('0xe5'));}delete this[_0xa03c('0x15')][_0x10b565[_0xa03c('0xa8')]];}if(!(_0x211fd8['dialAnswer']&&_0x484eaf==='16')){ut['updateOriginated'](_0x329f41,'[callProgressDetectingCustomer]');logger[_0xa03c('0x56')](_0xa03c('0xe6'),_0x211fd8[_0xa03c('0xb8')],_0xa03c('0xac'),_0x329f41[_0xa03c('0x26')],_0xa03c('0x6e'),_0x329f41[_0xa03c('0x4a')]);}if(_0x484eaf!==_0xa03c('0xe7')){delete this[_0xa03c('0x15')][_0x10b565[_0xa03c('0xa8')]];delete this[_0xa03c('0x15')][_0x10b565['destlinkedid']];}}};Preview['prototype'][_0xa03c('0xe8')]=function(_0x4448c9,_0xf433f7,_0x121233){if(_[_0xa03c('0xe9')](_0xf433f7)&&_0xa03c('0xea')!==typeof _0xf433f7){return;}if(_[_0xa03c('0xe9')](_0x121233)&&_0xa03c('0xea')!==typeof _0x121233){return;}switch(_0x121233['reason']){case'0':ut['logAgent'](_0x4448c9,0x0,_0xa03c('0x9e'));rpcDb[_0xa03c('0xeb')](_0x4448c9,_0xa03c('0xec'));break;case'3':ut[_0xa03c('0xed')](_0x4448c9,0x3,_0xa03c('0xc2'));rpcDb[_0xa03c('0xeb')](_0x4448c9,_0xa03c('0xee'));break;case'5':ut[_0xa03c('0xed')](_0x4448c9,0x5,_0xa03c('0xbc'));rpcDb[_0xa03c('0xeb')](_0x4448c9,_0xa03c('0xef'));break;case'8':ut[_0xa03c('0xed')](_0x4448c9,0x8,'Congestion');rpcDb[_0xa03c('0xeb')](_0x4448c9,_0xa03c('0xf0'));break;case'22':ut[_0xa03c('0xed')](_0x4448c9,0x16,_0xa03c('0xf1'));rpcDb[_0xa03c('0xeb')](_0x4448c9,_0xa03c('0xf2'));break;default:ut['logAgent'](_0x4448c9,0xc,_0x121233[_0xa03c('0xf3')]);rpcDb[_0xa03c('0xeb')](_0x4448c9,'[callProgressDetectingAgent][logCongestion]');}ut['updateOriginated'](_0xf433f7,'[callProgressDetectingAgent]');logger[_0xa03c('0x56')](_0xa03c('0xf4'),_0x4448c9[_0xa03c('0xb8')],_0xa03c('0xac'),_0xf433f7['name'],'originated:\x20',_0xf433f7[_0xa03c('0x4a')]);delete this[_0xa03c('0x15')][_0x4448c9[_0xa03c('0xb8')]];};Preview['prototype'][_0xa03c('0xf5')]=function(_0x1fecc6,_0x1e3665,_0x2972bd,_0x41350d,_0x2676b4){var _0x4e417f=this;return new BPromise(function(_0x31b850,_0x339fb4){if(_[_0xa03c('0x6a')](_0x1e3665)||_[_0xa03c('0x6a')](_0x1e3665[_0xa03c('0xf6')])||_[_0xa03c('0x6a')](_0x1e3665['Contact'][_0xa03c('0xf7')])||_[_0xa03c('0x6a')](_0x1e3665[_0xa03c('0x73')])){_0x339fb4(ut['message'](_0xa03c('0xf8'),_0x41350d,_0x2676b4));return;}var _0x3095a7=uuid['v4']();var _0x2a1311=_0x4e417f[_0xa03c('0x24')][_0x1e3665[_0xa03c('0x6c')][_0xa03c('0x26')]];var _0x1bad05=_0x2972bd?_0x4e417f[_0xa03c('0x16')][_0x2972bd]['id']:undefined;_0x4e417f[_0xa03c('0x15')][_0x3095a7]=new Action(_0x1e3665,_0x2a1311,_0x3095a7,_0x2972bd,_0x1bad05);var _0x162ce7=_0x4e417f[_0xa03c('0x15')][_0x3095a7];_0x162ce7[_0xa03c('0xa7')]=_0x41350d;_0x162ce7[_0xa03c('0xc0')]=_0x2676b4;_0x162ce7[_0xa03c('0xf9')]=_0x2972bd;if(_[_0xa03c('0xfa')](_0x1fecc6)){_0x4e417f[_0xa03c('0xfb')](_0x162ce7,_0x2a1311,_0x1e3665,_0x2972bd)[_0xa03c('0x81')](function(_0x249779){logger[_0xa03c('0x56')]('[Preview][execCall][success]',_0xa03c('0xfc')+_0x162ce7['queue']+_0xa03c('0xfd')+_0x162ce7[_0xa03c('0xfe')],JSON[_0xa03c('0x53')](_0x249779));ami[_0xa03c('0x25')](_0xa03c('0xff'),ut['buildObj'](_0x162ce7,_0xa03c('0x100')));_0x31b850(ut[_0xa03c('0x49')](_0xa03c('0x101')));})['catch'](function(_0x11cfe9){ut['logger'](_0xa03c('0x102'),_0x11cfe9);_0x339fb4(ut[_0xa03c('0x49')](_0xa03c('0x103'),_0x41350d,_0x2676b4));});}else{_0x2a1311[_0xa03c('0x104')]+=0x1;ut[_0xa03c('0x105')](_0x162ce7);rpcDb[_0xa03c('0x106')](_0x162ce7,_0xa03c('0x107'));delete _0x4e417f[_0xa03c('0x15')][_0x3095a7];_0x339fb4(ut[_0xa03c('0x49')](_0xa03c('0x108'),_0x41350d,_0x2676b4));}});};Preview['prototype'][_0xa03c('0x96')]=function(_0x4852ed){return!_[_0xa03c('0x6a')](_0x4852ed)&&!_[_0xa03c('0x6a')](_0x4852ed[_0xa03c('0x26')])&&!_['isNil'](_0x4852ed['active'])&&_0x4852ed[_0xa03c('0x109')]&&!_[_0xa03c('0x6a')](this[_0xa03c('0x14')][util[_0xa03c('0x58')]('SIP/%s',_0x4852ed[_0xa03c('0x26')])])&&!_[_0xa03c('0x6a')](this[_0xa03c('0x14')][util[_0xa03c('0x58')](_0xa03c('0x10a'),_0x4852ed[_0xa03c('0x26')])][_0xa03c('0x76')])&&(this[_0xa03c('0x14')][util[_0xa03c('0x58')](_0xa03c('0x10a'),_0x4852ed['name'])][_0xa03c('0x76')]===_0xa03c('0x10b')||this['trunks'][util[_0xa03c('0x58')]('SIP/%s',_0x4852ed[_0xa03c('0x26')])]['status']===_0xa03c('0x10c'));};Preview[_0xa03c('0x11')][_0xa03c('0x87')]=function(_0x5a6f92,_0x198cc7){var _0x493775=this;return new BPromise(function(_0x57f3ef,_0x16570d){_0x493775['execRun'](_0x5a6f92,_0x198cc7)['then'](function(_0xb2ef3d){_0x57f3ef(_[_0xa03c('0x70')](_0xb2ef3d,[_0xa03c('0x49')]));})['catch'](function(_0x2fa5ef){if(_0x2fa5ef[_0xa03c('0x10d')]){rpcDb[_0xa03c('0x10e')](_0x5a6f92);}if(_0x2fa5ef['active']){rpcDb[_0xa03c('0x89')](_0x5a6f92);}_0x16570d(_['pick'](_0x2fa5ef,[_0xa03c('0x49')]));});});};Preview[_0xa03c('0x11')][_0xa03c('0x10f')]=function(_0x148679,_0x28989b){var _0x5f0116=this;return new BPromise(function(_0x14c1ab,_0x147959){var _0x9f8c7d,_0x4650ab;rpcDb[_0xa03c('0x110')](_0x148679)['then'](function(_0x1dcf71){if(!_[_0xa03c('0x6a')](_0x1dcf71[0x0])){_0x4650ab=_0x1dcf71[0x0][_0xa03c('0x111')]?![]:!![];_0x9f8c7d=_0x1dcf71[0x0]['recallme']?!![]:![];_0x9f8c7d=_0x28989b?!![]:_0x9f8c7d;}var _0xcd853b=_0x5f0116[_0xa03c('0x112')](_0x1dcf71);if(_0xcd853b[_0xa03c('0x113')]){rpcDb[_0xa03c('0x114')](_['pick'](_0x1dcf71[0x0],[_0xa03c('0x73'),_0xa03c('0x115')]))['then'](function(_0x4eabb2){_0x5f0116['checkInBlack'](_0x4eabb2,_0x1dcf71[0x0],_0x28989b,_0x4650ab,_0x9f8c7d)['then'](function(_0x5af8de){_0x14c1ab(_0x5af8de);})['catch'](function(_0x222ef2){_0x147959(_0x222ef2);});})[_0xa03c('0x116')](function(_0x1d67cb){ut[_0xa03c('0x5d')](_0xa03c('0x117'),_0x1d67cb);_0x147959(ut[_0xa03c('0x49')]('Call\x20unsuccessful',_0x4650ab,_0x9f8c7d));});}else{_0x147959(ut['message'](_0xcd853b[_0xa03c('0x49')],_0x4650ab,_0x9f8c7d));}})[_0xa03c('0x116')](function(_0x5d9f9d){ut[_0xa03c('0x5d')]('[Preview][getContactPreview]',_0x5d9f9d);_0x147959(ut[_0xa03c('0x49')](_0xa03c('0x118'),![],!![]));});});};Preview[_0xa03c('0x11')][_0xa03c('0x112')]=function(_0x365866){if(_[_0xa03c('0x6a')](_0x365866)||_[_0xa03c('0xfa')](_0x365866)||!_['isNil'](_0x365866[0x0][_0xa03c('0x85')])&&_[_0xa03c('0x6a')](_0x365866[0x0]['Agent'][_0xa03c('0x26')])){ut[_0xa03c('0x5d')](_0xa03c('0x119'),_0x365866);return{'isValid':![],'message':_0xa03c('0x11a')};}var _0x3e10eb=this['campaignsPreview'][_0x365866[0x0]['Queue'][_0xa03c('0x26')]];_0x3e10eb['message']=_0xa03c('0x99');if(_[_0xa03c('0x6a')](_0x3e10eb)){ut['logger'](_0xa03c('0x11b'),_0x3e10eb);return{'isValid':![],'message':_0xa03c('0x11c')};}if(!this[_0xa03c('0x96')](_0x3e10eb['Trunk'])){ut[_0xa03c('0x5d')](_0xa03c('0x11d'),_0xa03c('0x11e')+_0x3e10eb['name']+_0xa03c('0x11f'));if(!this['isTrunkReachable'](_0x3e10eb[_0xa03c('0x97')])){ut[_0xa03c('0x5d')](_0xa03c('0x11d'),_0x3e10eb[_0xa03c('0x26')]+_0xa03c('0x120'));return{'isValid':![],'message':_0xa03c('0x121')};}}if(!ut[_0xa03c('0x95')](_0x3e10eb[_0xa03c('0x33')])){ut[_0xa03c('0x5d')](_0xa03c('0x122'),_0x3e10eb[_0xa03c('0x26')]+_0xa03c('0x123'));return{'isValid':![],'message':_0xa03c('0x11e')+_0x3e10eb[_0xa03c('0x26')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xa03c('0x124')};};Preview['prototype'][_0xa03c('0xfb')]=function(_0x693f08,_0x5e6967,_0x51b09f,_0x204ade){var _0x125a48=this;return new BPromise(function(_0x591372,_0x58d212){var _0xa7ad9=_0x693f08['uniqueid'];var _0x3c45a8=_0x125a48[_0xa03c('0x96')](_0x5e6967[_0xa03c('0x50')])?util[_0xa03c('0x58')](_0xa03c('0x125'),_0x5e6967['Trunk'][_0xa03c('0x26')],_[_0xa03c('0x6a')](_0x5e6967['dialPrefix'])?'':_0x5e6967[_0xa03c('0x126')][_0xa03c('0x127')]()||'',_0x5e6967[_0xa03c('0x128')]>0x0?_0x51b09f[_0xa03c('0xf6')][_0xa03c('0xf7')]['substring'](_0x5e6967[_0xa03c('0x128')]):_0x51b09f['Contact'][_0xa03c('0xf7')]):util[_0xa03c('0x58')](_0xa03c('0x125'),_['isNil'](_0x5e6967[_0xa03c('0x97')])?_0x5e6967[_0xa03c('0x50')]['name']:_0x5e6967['TrunkBackup'][_0xa03c('0x26')],_[_0xa03c('0x6a')](_0x5e6967[_0xa03c('0x126')])?'':_0x5e6967[_0xa03c('0x126')][_0xa03c('0x127')]()||'',_0x5e6967[_0xa03c('0x128')]>0x0?_0x51b09f[_0xa03c('0xf6')]['phone'][_0xa03c('0x129')](_0x5e6967['dialCutDigit']):_0x51b09f['Contact'][_0xa03c('0xf7')]);var _0xe9c680=_0x125a48[_0xa03c('0x96')](_0x5e6967[_0xa03c('0x50')])?ut['getCallerId'](_0x5e6967[_0xa03c('0x50')][_0xa03c('0x51')],_0x5e6967[_0xa03c('0x35')],_0x5e6967[_0xa03c('0x12a')]>0x0?ut['getCallerIdRandom'](_0x5e6967['dialOriginateCallerIdNumber'],_0x5e6967[_0xa03c('0x12a')]):_0x5e6967[_0xa03c('0x36')]):ut[_0xa03c('0x12b')](_[_0xa03c('0x6a')](_0x5e6967[_0xa03c('0x97')])?_0x5e6967[_0xa03c('0x50')][_0xa03c('0x51')]:_0x5e6967[_0xa03c('0x97')][_0xa03c('0x51')],_0x5e6967[_0xa03c('0x35')],_0x5e6967['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xa03c('0x12c')](_0x5e6967[_0xa03c('0x36')],_0x5e6967[_0xa03c('0x12a')]):_0x5e6967[_0xa03c('0x36')]);if(_0xe9c680){_0x693f08['originatecalleridname']=ut[_0xa03c('0x12d')](_0xe9c680);_0x693f08['originatecalleridnum']=ut[_0xa03c('0x12e')](_0xe9c680);}var _0x5560e3=ut['addVariables'](_0x5e6967,_0x51b09f,_0x3c45a8,_0xe9c680,_0xa7ad9,_0x693f08);_[_0xa03c('0x12f')](_0x693f08,ut[_0xa03c('0x130')](_0x5560e3));_0x693f08[_0xa03c('0x8a')]=moment()[_0xa03c('0x58')](_0xa03c('0x8b'));ami[_0xa03c('0x75')](ut[_0xa03c('0x131')](_0x693f08,_0x5e6967,_0x5560e3,_0x693f08[_0xa03c('0xc0')],_0x204ade))['then'](function(_0xb69339){_0x5e6967[_0xa03c('0x4a')]+=0x1;logger['info']('[originated][increment]',_0xa7ad9,'\x20Queue',_0x5e6967['name'],'originated:\x20',_0x5e6967[_0xa03c('0x4a')]);_0x591372(_0xb69339);})[_0xa03c('0x116')](function(_0x25e935){ut[_0xa03c('0xed')](_0x693f08,0xe,_0xa03c('0x132'));rpcDb[_0xa03c('0xeb')](_0x693f08,_0xa03c('0x133'));_0x58d212(_0x25e935);});});};Preview[_0xa03c('0x11')][_0xa03c('0x134')]=function(_0x162581){if(this['actions'][_0x162581[_0xa03c('0xa8')]]){this['actions'][_0x162581[_0xa03c('0xa8')]][_0xa03c('0x77')]=_0x162581[_0xa03c('0x77')];}};Preview[_0xa03c('0x11')][_0xa03c('0x18')]=function(_0x2ff6f6){var _0x1c9316=this;var _0x2997c2=this[_0xa03c('0x15')][_0x2ff6f6[_0xa03c('0x135')]];if(_0x2997c2){if(_0x2997c2[_0xa03c('0xf9')]&&this[_0xa03c('0x16')][_0x2997c2[_0xa03c('0xf9')]]){ut[_0xa03c('0x136')](_0x2997c2,this[_0xa03c('0x16')][_0x2997c2[_0xa03c('0xf9')]]['name'],this[_0xa03c('0x16')][_0x2997c2[_0xa03c('0xf9')]]['id']);}var _0x19fbf7=_[_0xa03c('0x137')](_0x2997c2);_0x19fbf7[_0xa03c('0xa9')]=moment()['format'](_0xa03c('0x8b'));var _0x1068bd=_0x1c9316[_0xa03c('0x24')][_0x2997c2[_0xa03c('0x6d')]];if(ut[_0xa03c('0x138')](_0x2ff6f6['response'])){if(_0x2997c2[_0xa03c('0xa7')]){rpcDb[_0xa03c('0x10e')](_0x2997c2[_0xa03c('0xfe')]);}if(_0x2997c2[_0xa03c('0xc0')]){rpcDb['disableContact'](_0x2997c2['idContact']);}ami[_0xa03c('0x25')]('custom:agentringnoanswer',ut[_0xa03c('0x9f')](_0x2997c2,_0xa03c('0x139')));this['callProgressDetectingAgent'](_0x19fbf7,_0x1068bd,_0x2ff6f6);}else{_0x2997c2[_0xa03c('0x8a')]=moment()['format'](_0xa03c('0x8b'));ut[_0xa03c('0xed')](_0x19fbf7,0x4,_0xa03c('0x13a'));rpcDb[_0xa03c('0xeb')](_0x19fbf7,_0xa03c('0x13b'));}}};Preview['prototype'][_0xa03c('0x1b')]=function(_0x45e672){var _0x39bc5a=this;var _0x548807=this[_0xa03c('0x15')][_0x45e672[_0xa03c('0xa8')]];var _0x1284d9;if(_0x548807){_0x1284d9=this[_0xa03c('0x24')][_0x548807[_0xa03c('0x6d')]];logger[_0xa03c('0x56')](_0xa03c('0x13c'),_0x45e672[_0xa03c('0xa8')],_0xa03c('0xac'),_0x1284d9['name'],_0xa03c('0xad'),_0x1284d9[_0xa03c('0x2a')]);}if(this[_0xa03c('0x15')][_0x45e672['linkedid']]&&_0x45e672[_0xa03c('0xa8')]!==_0x45e672[_0xa03c('0xb8')]){if(_0x45e672[_0xa03c('0x13d')]==='16'&&this[_0xa03c('0x15')][_0x45e672[_0xa03c('0xa8')]][_0xa03c('0x6f')]){this[_0xa03c('0x9a')](_0x45e672,_0x45e672[_0xa03c('0xa8')],_0x45e672[_0xa03c('0x13d')]);}else if(this[_0xa03c('0x15')][_0x45e672[_0xa03c('0xa8')]][_0xa03c('0x6f')]){logger[_0xa03c('0x56')](_0xa03c('0x13e'),_0x45e672[_0xa03c('0xa8')],_0x45e672[_0xa03c('0x13d')],_0xa03c('0xac'),_0x1284d9['name'],_0xa03c('0xad'),_0x1284d9[_0xa03c('0x2a')]);this[_0xa03c('0x9a')](_0x45e672,_0x45e672[_0xa03c('0xa8')],_0x45e672[_0xa03c('0x13d')]);}}else if(_0x548807&&_[_0xa03c('0x6a')](_0x548807[_0xa03c('0x13f')])&&_0x1284d9[_0xa03c('0x140')]&&_0x45e672['linkedid']===_0x45e672[_0xa03c('0xb8')]&&_[_0xa03c('0x6a')](_0x45e672[_0xa03c('0xf3')])&&_0x45e672[_0xa03c('0x13d')]==='16'&&_0x45e672[_0xa03c('0x141')]==='6'&&_[_0xa03c('0xe9')](_0x548807['transfer'])){if(_0x548807[_0xa03c('0xa7')]){rpcDb[_0xa03c('0x10e')](_0x548807[_0xa03c('0xfe')]);}if(_0x548807[_0xa03c('0xc0')]){rpcDb[_0xa03c('0x89')](_0x548807[_0xa03c('0xfe')]);}_0x45e672['reason']='22';this[_0xa03c('0xe8')](_0x548807,_0x1284d9,_0x45e672);}else if(_0x548807&&_0x548807[_0xa03c('0x142')]){if(_0x45e672[_0xa03c('0x13d')]==='16'&&this[_0xa03c('0x15')][_0x45e672[_0xa03c('0xa8')]][_0xa03c('0x6f')]){logger[_0xa03c('0x56')](_0xa03c('0x143'),_0x45e672[_0xa03c('0xa8')],_0x45e672['cause'],'\x20Queue',_0x1284d9['name'],_0xa03c('0xad'),_0x1284d9[_0xa03c('0x2a')]);this[_0xa03c('0x9a')](_0x45e672,_0x45e672[_0xa03c('0xa8')],_0x45e672[_0xa03c('0x13d')]);}else if(this[_0xa03c('0x15')][_0x45e672[_0xa03c('0xa8')]]['dialAnswer']){logger[_0xa03c('0x56')](_0xa03c('0x13e'),_0x45e672[_0xa03c('0xa8')],_0x45e672[_0xa03c('0x13d')],_0xa03c('0xac'),_0x1284d9[_0xa03c('0x26')],_0xa03c('0xad'),_0x1284d9['pTalking']);this[_0xa03c('0x9a')](_0x45e672,_0x45e672['linkedid'],_0x45e672[_0xa03c('0x13d')]);}}};Preview[_0xa03c('0x11')][_0xa03c('0x1e')]=function(_0x3cbf5b){if(this[_0xa03c('0x15')][_0x3cbf5b[_0xa03c('0x144')]]&&_0x3cbf5b[_0xa03c('0x144')]!==_0x3cbf5b[_0xa03c('0x145')]){this[_0xa03c('0x9a')](_0x3cbf5b,_0x3cbf5b[_0xa03c('0x144')],_0x3cbf5b[_0xa03c('0xe3')]);}};Preview[_0xa03c('0x11')]['syncHangupRequest']=function(_0x51ffd7){if(this[_0xa03c('0x15')][_0x51ffd7[_0xa03c('0xa8')]]&&_0x51ffd7['linkedid']!==_0x51ffd7[_0xa03c('0xb8')]&&!this[_0xa03c('0x15')][_0x51ffd7[_0xa03c('0xa8')]][_0xa03c('0x6f')]){if(_0x51ffd7['cause']==='1'){this[_0xa03c('0x9a')](_0x51ffd7,_0x51ffd7['linkedid'],_0x51ffd7[_0xa03c('0x13d')]);}}};Preview[_0xa03c('0x11')]['addVariable']=function(_0x111729,_0x51b85a,_0x1781ca){if(this['actions'][_0x111729]){if(_[_0xa03c('0x6a')](this[_0xa03c('0x15')][_0x111729][_0xa03c('0x146')])){this[_0xa03c('0x15')][_0x111729]['variables']={};}this[_0xa03c('0x15')][_0x111729][_0xa03c('0x146')][_0x51b85a]=_0x1781ca;}};Preview[_0xa03c('0x11')]['syncVarSet']=function(_0x44ecb1){try{if(!_['isNil'](_0x44ecb1)){if(ut[_0xa03c('0x147')](_[_0xa03c('0x148')](_0x44ecb1['variable'])[0x0])){this[_0xa03c('0x149')](_0x44ecb1['uniqueid'],_[_0xa03c('0x148')](_0x44ecb1['variable'])[0x0],_0x44ecb1[_0xa03c('0x14a')]);}}}catch(_0x4e01e1){logger['error'](_0xa03c('0x14b'),util[_0xa03c('0x14c')](_0x4e01e1,{'showHidden':![],'depth':null}));}};Preview[_0xa03c('0x11')][_0xa03c('0x22')]=function(_0x10ea2c){if(_0x10ea2c){if(this['actions'][_0x10ea2c[_0xa03c('0x14d')]]){this[_0xa03c('0x15')][_0x10ea2c[_0xa03c('0x14d')]][_0xa03c('0x142')]=!![];}}};Preview[_0xa03c('0x11')][_0xa03c('0x23')]=function(_0x21214f){if(_0x21214f){if(this[_0xa03c('0x15')][_0x21214f['transfererlinkedid']]){this[_0xa03c('0x15')][_0x21214f[_0xa03c('0x14e')]]['transfer']=!![];}}};module[_0xa03c('0x14f')]=Preview;
\ No newline at end of file
diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js
index 99a7311..b23366c 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 _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
+var _0x3937=['queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','context','exten','holdtime','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','rescheduleContact','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createHistory','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue'];(function(_0x31e5c0,_0x95f72c){var _0x5db965=function(_0x871a96){while(--_0x871a96){_0x31e5c0['push'](_0x31e5c0['shift']());}};_0x5db965(++_0x95f72c);}(_0x3937,0xbf));var _0x7393=function(_0x377ed7,_0x7b6295){_0x377ed7=_0x377ed7-0x0;var _0x5ea487=_0x3937[_0x377ed7];return _0x5ea487;};'use strict';var util=require(_0x7393('0x0'));var BPromise=require('bluebird');var logger=require(_0x7393('0x1'))(_0x7393('0x2'));var _=require('lodash');var cmHopper=require(_0x7393('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x7393('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x7393('0x5'));var agentReportPreview=require(_0x7393('0x6'));var voiceQueueReport=require(_0x7393('0x7'));function loggerCatch(_0x1f538f){return function(_0x15eabd){logger[_0x7393('0x8')](_0x1f538f,util[_0x7393('0x9')](_0x15eabd,{'showHidden':![],'depth':null}));};}function create(_0x26668a){return BPromise[_0x7393('0xa')]()['then'](cmHopperHistory['createHistory'](_0x26668a))[_0x7393('0xb')](loggerCatch(_0x7393('0xc')));}function createAgent(_0x1cc3fd){return BPromise['resolve']()[_0x7393('0xd')](agentReportPreview['createHistory'](_0x1cc3fd))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x497b6b){return BPromise[_0x7393('0xa')]()[_0x7393('0xd')](cmHopper[_0x7393('0xe')](_0x497b6b,!![]))['catch'](loggerCatch(_0x7393('0xf')));}exports[_0x7393('0x10')]=function(_0x20fb41){return BPromise[_0x7393('0xa')]()[_0x7393('0xd')](cmHopperBlack[_0x7393('0x10')](_0x20fb41))[_0x7393('0xb')](loggerCatch(_0x7393('0x11')));};exports[_0x7393('0x12')]=function(_0x4e521c){return BPromise['resolve']()[_0x7393('0xd')](cmHopper['getContactPreview'](_0x4e521c))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0x7393('0x13')]=function(_0x54dc47,_0x2a1180){create(_0x54dc47)[_0x7393('0xb')](loggerCatch(_0x2a1180));moveContact(_0x54dc47)['catch'](loggerCatch(_0x2a1180));};exports[_0x7393('0x14')]=function(_0x5745cb,_0x5694b6){createAgent(_0x5745cb)[_0x7393('0xb')](loggerCatch(_0x5694b6));};exports[_0x7393('0x15')]=function(_0x1b032c,_0x1dc3e3){create(_0x1b032c)[_0x7393('0xb')](loggerCatch(_0x1dc3e3));};exports[_0x7393('0x16')]=function(_0x21f712,_0x208b9a){moveContact(_0x21f712)['catch'](loggerCatch(_0x208b9a));};exports['rescheduleContact']=function(_0x30eae3,_0x16f617,_0x3979b7){if(_0x16f617){_0x30eae3[_0x7393('0x17')]=null;}if(_0x3979b7){_0x30eae3[_0x7393('0x18')]=![];}return BPromise['resolve']()['then'](cmHopper['rescheduleContact'](_0x30eae3))[_0x7393('0xb')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x2bf7a9){return BPromise[_0x7393('0xa')]()['then'](cmHopper[_0x7393('0x19')](_0x2bf7a9))[_0x7393('0xb')](loggerCatch(_0x7393('0x1a')));};exports[_0x7393('0x1b')]=function(_0x3fe456){return BPromise[_0x7393('0xa')]()[_0x7393('0xd')](cmHopper[_0x7393('0x1b')]({'UserId':null},_0x3fe456,0x1))[_0x7393('0xb')](loggerCatch(_0x7393('0x1c')));};exports[_0x7393('0x1d')]=function(_0x123ab4){return BPromise[_0x7393('0xa')]()['then'](cmHopper[_0x7393('0x1b')]({'active':![]},_0x123ab4,0x1))[_0x7393('0xb')](loggerCatch(_0x7393('0x1e')));};exports[_0x7393('0x1f')]=function(_0x1013aa){var _0xd8dfae={};_0xd8dfae['type']=_0x1013aa[_0x7393('0x20')];_0xd8dfae['uniqueid']=_0x1013aa[_0x7393('0x21')];_0xd8dfae['calleridnum']=_0x1013aa[_0x7393('0x22')];_0xd8dfae[_0x7393('0x23')]=_0x1013aa[_0x7393('0x23')];_0xd8dfae[_0x7393('0x24')]=_0x1013aa[_0x7393('0x24')];_0xd8dfae[_0x7393('0x25')]=_0x1013aa[_0x7393('0x26')];_0xd8dfae[_0x7393('0x27')]=_0x1013aa[_0x7393('0x26')];_0xd8dfae[_0x7393('0x28')]=0x1;_0xd8dfae[_0x7393('0x29')]=_0x1013aa[_0x7393('0x2a')];_0xd8dfae['connectedlinename']=_0x1013aa['membername'];_0xd8dfae[_0x7393('0x2b')]='from-sip';_0xd8dfae[_0x7393('0x2c')]='xcally-motion-preview';_0xd8dfae[_0x7393('0x2d')]=0x0;_0xd8dfae['assigned']=0x1;_0xd8dfae[_0x7393('0x2e')]=_0x1013aa[_0x7393('0x2f')];_0xd8dfae[_0x7393('0x30')]=_0x7393('0x31');return BPromise[_0x7393('0xa')]()[_0x7393('0xd')](voiceQueueReport[_0x7393('0x32')](_0xd8dfae))[_0x7393('0xb')](loggerCatch(_0x7393('0x33')));};exports[_0x7393('0x34')]=function(_0x585d47,_0x17e110){return BPromise['resolve']()[_0x7393('0xd')](cmHopper['getContactRecallMe'](_0x585d47,_0x17e110))[_0x7393('0xb')](loggerCatch(_0x7393('0x35')));};exports[_0x7393('0x36')]=function(_0x308cfb){return BPromise[_0x7393('0xa')]()['then'](cmHopper[_0x7393('0x37')](_0x308cfb,!![],!![]))['catch'](loggerCatch(_0x7393('0x38')));};
\ 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 2e261c3..92dc6ac 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 _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
+var _0xc00b=['updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','statedesc','Blacklist','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','state','logLookAgent','membername','UserId','logCustomer','ringtime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnosuchnumberretry','clone','Global','scheduledAt','active','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','name','queue','interface','buildAcw','agentReadyId','not_inuse','status','reachable','getDiff','createBody','CampaignId','filterKey','idContact','type','dialAnswer','scheduledat','countnoanswerretry','countglobal','callback','callbackat','recallme','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','util','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','seconds','loggerCatch','error','inspect','info','loggerError','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','calleridname','calleridnum','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','dialPreviewUrl','format','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper'];(function(_0x1b5a6f,_0x122f36){var _0x21a20a=function(_0xfa2172){while(--_0xfa2172){_0x1b5a6f['push'](_0x1b5a6f['shift']());}};_0x21a20a(++_0x122f36);}(_0xc00b,0x1e5));var _0xbc00=function(_0x1baa84,_0x3c938e){_0x1baa84=_0x1baa84-0x0;var _0x18523b=_0xc00b[_0x1baa84];return _0x18523b;};'use strict';var util=require(_0xbc00('0x0'));var _=require('lodash');var moment=require('moment');var logger=require('../../../../config/logger')(_0xbc00('0x1'));var ipAgi=process['env'][_0xbc00('0x2')]||_0xbc00('0x3');function getSeconds(_0x38080a,_0x161d6a){var _0x5db11b=moment(_0x38080a)[_0xbc00('0x4')](0x0);var _0x5b47bf=moment(_0x161d6a)[_0xbc00('0x4')](0x0);return _0x5db11b['diff'](_0x5b47bf,_0xbc00('0x5'));}exports[_0xbc00('0x6')]=function(_0x284270){return function(_0x221909){logger[_0xbc00('0x7')](_0x284270,util[_0xbc00('0x8')](_0x221909,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1a53a7,_0x57192a){logger[_0xbc00('0x9')](_0x1a53a7,util[_0xbc00('0x8')](_0x57192a,{'showHidden':![],'depth':null}));};exports[_0xbc00('0xa')]=function(_0x52706d,_0x45a418){logger['error'](_0x52706d,util[_0xbc00('0x8')](_0x45a418,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x466d56){return function(_0x248684){logger[_0xbc00('0x9')](_0x466d56,util['inspect'](_0x248684,{'showHidden':![],'depth':null}));};};exports[_0xbc00('0xb')]=function(_0x20f2c3,_0x7fb50c,_0x55f770){return{'message':_0x20f2c3,'unlock':_0x7fb50c,'active':_0x55f770};};exports[_0xbc00('0xc')]=function(_0xd05e85,_0x573cf4,_0x33ce58){if(!_[_0xbc00('0xd')](_0x33ce58)&&_0xbc00('0xe')===typeof _0x33ce58&&!_[_0xbc00('0xf')](_0x33ce58)){if(!_[_0xbc00('0xd')](_0x573cf4)&&_0xbc00('0xe')===typeof _0x573cf4&&!_[_0xbc00('0xf')](_0x573cf4)){return util['format']('\x22%s\x22\x20<%s>',_0x573cf4,_0x33ce58);}return util['format'](_0xbc00('0x10'),_0x33ce58,_0x33ce58);}if(!_['isUndefined'](_0xd05e85)&&_0xbc00('0xe')===typeof _0xd05e85&&!_['isEmpty'](_0xd05e85)){return _0xd05e85;}return _0xbc00('0x11');};exports[_0xbc00('0x12')]=function(_0x492c4f){if(_[_0xbc00('0x13')](_0x492c4f)){return![];}return _0x492c4f;};exports['addVariables']=function(_0x44590e,_0x2189b6,_0x48b39b,_0x340f91,_0x225ee6,_0x33780b){var _0x13abd5={'XMD-QUEUE':_0x2189b6[_0xbc00('0x14')]?_0x2189b6[_0xbc00('0x14')]['name']:'','XMD-CALLERID':_0x340f91,'XMD-CALLERID-PREVIEW':_0x33780b?util['format'](_0xbc00('0x10'),_0x33780b[_0xbc00('0x15')],_0x33780b[_0xbc00('0x16')]):_0x340f91,'XMD-DIALID':_0x225ee6,'XMD-CONTACTID':_0x2189b6['ContactId'],'XMD-CDRTYPE':_0xbc00('0x17'),'CALLERID(all)':_0x340f91,'XMD-VOICEQUEUEID':_0x2189b6[_0xbc00('0x18')],'XMD-DIALCHANNEL':_0x48b39b,'XMD-DIALTIMEOUT':_0x44590e['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0xbc00('0x19'),_0x44590e[_0xbc00('0x1a')]?'g':'',_[_0xbc00('0xf')](_0x44590e['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x44590e[_0xbc00('0x1b')]||'','XMD-AGI':_0x44590e['dialQueueProject']?util[_0xbc00('0x1c')](_0xbc00('0x1d'),ipAgi,_0x44590e['dialQueueProject']):_0xbc00('0x1e'),'XMD-AGIAFTER':_0x44590e[_0xbc00('0x1a')]?util[_0xbc00('0x1c')](_0xbc00('0x1d'),ipAgi,_0x44590e['dialQueueProject2']):_0xbc00('0x1e'),'XMD-ORIGINATECALLERIDNUM':_0x33780b?_0x33780b[_0xbc00('0x1f')]:'','XMD-ORIGINATECALLERIDNAME':_0x33780b?_0x33780b[_0xbc00('0x20')]:'','XMD-DESTINATION':_0xbc00('0x21')};if(!_[_0xbc00('0xf')](_0x44590e[_0xbc00('0x22')])){_0x13abd5[util[_0xbc00('0x1c')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x44590e[_0xbc00('0x22')];_0x13abd5[util[_0xbc00('0x1c')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x225ee6;}if(_0x2189b6&&_0x2189b6[_0xbc00('0x23')]){for(var _0x2d4fad in _0x2189b6[_0xbc00('0x23')]){if(_0x2189b6[_0xbc00('0x23')][_0xbc00('0x24')](_0x2d4fad)){if(!_[_0xbc00('0x13')](_0x2189b6[_0xbc00('0x23')][_0x2d4fad])&&_0x2d4fad!=='id'&&_0x2d4fad!==_0xbc00('0x25')&&_0x2d4fad!==_0xbc00('0x26')&&_0x2d4fad!==_0xbc00('0x27')){_0x13abd5[util['format'](_0xbc00('0x28'),_0xbc00('0x29'),_[_0xbc00('0x2a')](_0x2d4fad))]=_0x2189b6[_0xbc00('0x23')][_0x2d4fad];}}}}return _0x13abd5;};exports['toLowerVariables']=function(_0xf61553){var _0x58d431={};for(var _0x10c1b8 in _0xf61553){if(_0xf61553[_0xbc00('0x24')](_0x10c1b8)){_0x58d431[util[_0xbc00('0x1c')]('%s',_['toLower'](_0x10c1b8))]=_0xf61553[_0x10c1b8];}}return{'variables':_0x58d431};};exports[_0xbc00('0x2b')]=function(_0x213b2e,_0x173d14){if(!_['isNil'](_0x213b2e)){if(_0x213b2e[_0xbc00('0x24')](_0xbc00('0x2c'))){if(_0x213b2e[_0xbc00('0x2c')]>0x0){_0x213b2e[_0xbc00('0x2c')]-=0x1;}else{logger[_0xbc00('0x7')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x173d14);}}}else{logger[_0xbc00('0x7')](_0xbc00('0x2d'),_0x173d14);}};exports[_0xbc00('0x2e')]=function(_0x20fca0){var _0x468625=moment()[_0xbc00('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');_0x20fca0['state']=0xd;_0x20fca0[_0xbc00('0x2f')]=_0xbc00('0x30');_0x20fca0[_0xbc00('0x31')]=_0x468625;_0x20fca0[_0xbc00('0x32')]=_0x468625;_0x20fca0[_0xbc00('0x33')]=_0x468625;};exports['logAgent']=function(_0x570060,_0x442562,_0x1856e7){var _0x24b091=moment()['format'](_0xbc00('0x34'));_0x570060[_0xbc00('0x35')]=_0x442562;_0x570060[_0xbc00('0x2f')]=_0x1856e7;_0x570060[_0xbc00('0x32')]=_0x24b091;_0x570060['ringtime']=getSeconds(_0x570060[_0xbc00('0x32')],_0x570060['starttime']);};exports[_0xbc00('0x36')]=function(_0xf0964f,_0x5ead44,_0x49d090){_0xf0964f[_0xbc00('0x37')]=_0x5ead44;_0xf0964f[_0xbc00('0x38')]=_0x49d090;};exports[_0xbc00('0x39')]=function(_0x7d36a2,_0x1ac48f,_0x30bb86){var _0x18dea0=moment()[_0xbc00('0x1c')](_0xbc00('0x34'));_0x7d36a2['state']=_0x1ac48f;_0x7d36a2[_0xbc00('0x2f')]=_0x30bb86;_0x7d36a2['responsetime']=_0x7d36a2[_0xbc00('0x32')]?_0x7d36a2[_0xbc00('0x32')]:_0x18dea0;_0x7d36a2['endtime']=_0x7d36a2[_0xbc00('0x33')]?_0x7d36a2['endtime']:_0x18dea0;_0x7d36a2[_0xbc00('0x3a')]=getSeconds(_0x7d36a2[_0xbc00('0x32')]||0x0,_0x7d36a2[_0xbc00('0x31')]||0x0);_0x7d36a2['talktime']=_0x7d36a2[_0xbc00('0x3b')]?getSeconds(_0x7d36a2['endtime'],_0x7d36a2[_0xbc00('0x3b')]):0x0;};exports[_0xbc00('0x3c')]=function(_0x3d0eb3){return _0x3d0eb3===_0xbc00('0x3d');};exports[_0xbc00('0x3e')]=function(_0x5353e4,_0x5e9861,_0x536944,_0x5621b1,_0x3516a7){var _0xebe335=_0x5621b1?'RECALL':_0x5353e4[_0xbc00('0x15')];_0xebe335=_0x3516a7?_0xbc00('0x3f'):_0xebe335;return{'actionid':_0x5353e4[_0xbc00('0x40')],'action':'originate','channel':_0x5353e4[_0xbc00('0x41')],'callerid':util[_0xbc00('0x1c')]('\x22%s\x22\x20<%s>',_0xebe335,_0x5353e4['calleridnum']),'Exten':'xcally-motion-preview','Context':_0xbc00('0x42'),'Priority':'1','variable':_0x536944,'timeout':(_0x5e9861[_0xbc00('0x43')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5353e4[_0xbc00('0x40')]};};exports[_0xbc00('0x44')]=function(_0xc3bf7e){return _0xc3bf7e[_0xbc00('0x45')]+_0xc3bf7e[_0xbc00('0x46')]+_0xc3bf7e['countnoanswerretry']+_0xc3bf7e['countagentrejectretry']+_0xc3bf7e[_0xbc00('0x47')];};exports['cloneAction']=function(_0x43a386){var _0x5bd628=_[_0xbc00('0x48')](_0x43a386);_0x5bd628[_0xbc00('0x35')]=0xf;_0x5bd628['statedesc']=_0xbc00('0x49');return _0x5bd628;};exports[_0xbc00('0x4a')]=function(_0x5ec178,_0x3fa95f,_0x59f6a9){var _0x1a6642={};_0x1a6642[_0x3fa95f]=_0x5ec178[_0x3fa95f];_0x1a6642[_0xbc00('0x4b')]=![];_0x1a6642['scheduledat']=moment()[_0xbc00('0x4c')](_0x59f6a9,_0xbc00('0x4d'))['format'](_0xbc00('0x34'));_0x1a6642[_0xbc00('0x4e')]=_0x5ec178[_0xbc00('0x4e')];_0x1a6642[_0xbc00('0x4f')]=_0x5ec178[_0xbc00('0x4f')];_0x1a6642[_0xbc00('0x18')]=_0x5ec178[_0xbc00('0x18')]||undefined;return _0x1a6642;};exports[_0xbc00('0x50')]=function(_0x2ad010,_0x1377c0){if(!_[_0xbc00('0x13')](_0x2ad010)){if(_0x2ad010['pTalking']>0x0){_0x2ad010[_0xbc00('0x51')]-=0x1;}else{logger[_0xbc00('0x7')](_0x1377c0,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xbc00('0x7')](_0x1377c0,_0xbc00('0x52'));}};exports[_0xbc00('0x53')]=function(_0xa25584){if(_0xa25584<=0x0){return!![];}return![];};exports[_0xbc00('0x54')]=function(_0x175ea5,_0x38c9ee){_0x175ea5[_0xbc00('0x55')]=_0x38c9ee;_0x175ea5[_0xbc00('0x56')]=_0x175ea5[_0xbc00('0x57')];_0x175ea5[_0xbc00('0x58')]=_0x175ea5[_0xbc00('0x41')];return _0x175ea5;};exports[_0xbc00('0x59')]=function(_0x6aeba8){var _0x4da05c={};_0x4da05c[_0xbc00('0x57')]=_0x6aeba8[_0xbc00('0x57')];_0x4da05c[_0xbc00('0x58')]=_0x6aeba8['channelAgent'];_0x4da05c[_0xbc00('0x40')]=_0x6aeba8[_0xbc00('0x40')];return _0x4da05c;};exports[_0xbc00('0x5a')]=function(_0x2fc4f1){var _0x3292c0=[];for(var _0x2574ca in _0x2fc4f1){if(_0x2fc4f1[_0xbc00('0x24')](_0x2574ca)){if(!_[_0xbc00('0x13')](_0x2fc4f1[_0x2574ca])&&_0x2fc4f1[_0x2574ca][_0xbc00('0x35')]===_0xbc00('0x5b')&&_0x2fc4f1[_0x2574ca][_0xbc00('0x5c')]===_0xbc00('0x5d')){_0x3292c0['push'](_0x2fc4f1[_0x2574ca]['id']);}}}return _0x3292c0;};exports[_0xbc00('0x5e')]=function(_0x4eb0de){var _0xd764e5=moment()['milliseconds'](0x0);var _0x4040d0=moment(_0x4eb0de)['milliseconds'](0x0);return _0xd764e5['diff'](_0x4040d0,_0xbc00('0x5'));};exports[_0xbc00('0x5f')]=function(_0x13c338){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x13c338[_0xbc00('0x4e')],'ListId':_0x13c338['ListId'],'VoiceQueueId':_0x13c338[_0xbc00('0x18')]||undefined,'CampaignId':_0x13c338[_0xbc00('0x60')]||undefined};};exports[_0xbc00('0x61')]=function(_0x5c0a39){if(_0x5c0a39===_0xbc00('0x40')||_0x5c0a39===_0xbc00('0x62')||_0x5c0a39===_0xbc00('0x57')||_0x5c0a39===_0xbc00('0x63')||_0x5c0a39==='campaigntype'||_0x5c0a39===_0xbc00('0x64')||_0x5c0a39===_0xbc00('0x37')||_0x5c0a39===_0xbc00('0x41')||_0x5c0a39==='calleridname'||_0x5c0a39===_0xbc00('0x4b')||_0x5c0a39===_0xbc00('0x16')||_0x5c0a39===_0xbc00('0x65')||_0x5c0a39==='countbusyretry'||_0x5c0a39==='countcongestionretry'||_0x5c0a39===_0xbc00('0x66')||_0x5c0a39===_0xbc00('0x67')||_0x5c0a39===_0xbc00('0x68')||_0x5c0a39==='callbackuniqueid'||_0x5c0a39===_0xbc00('0x69')||_0x5c0a39===_0xbc00('0x6a')||_0x5c0a39===_0xbc00('0x4e')||_0x5c0a39===_0xbc00('0x4f')||_0x5c0a39===_0xbc00('0x38')||_0x5c0a39===_0xbc00('0x18')||_0x5c0a39==='sipcallid'||_0x5c0a39==='xmd-voicequeueid'||_0x5c0a39===_0xbc00('0x6b')||_0x5c0a39===_0xbc00('0x6c')||_0x5c0a39===_0xbc00('0x6d')||_0x5c0a39===_0xbc00('0x6e')||_0x5c0a39==='xmd-dialtimeout'||_0x5c0a39==='xmd-dialoptions'||_0x5c0a39===_0xbc00('0x6f')||_0x5c0a39===_0xbc00('0x70')||_0x5c0a39===_0xbc00('0x71')||_0x5c0a39===_0xbc00('0x72')||_0x5c0a39==='xmd-callerid'||_0x5c0a39===_0xbc00('0x73')||_0x5c0a39===_0xbc00('0x74')||_0x5c0a39===_0xbc00('0x75')||_0x5c0a39===_0xbc00('0x76')||_0x5c0a39===_0xbc00('0x77')||_0x5c0a39===_0xbc00('0x78')||_0x5c0a39===_0xbc00('0x79')||_0x5c0a39===_0xbc00('0x7a')||_0x5c0a39===_0xbc00('0x7b')||_0x5c0a39==='rtpaudioqosrttbridged'||_0x5c0a39===_0xbc00('0x75')||_0x5c0a39===_0xbc00('0x76')||_0x5c0a39===_0xbc00('0x77')||_0x5c0a39==='rtpaudioqosjitterbridged'||_0x5c0a39===_0xbc00('0x79')||_0x5c0a39===_0xbc00('0x7a')||_0x5c0a39===_0xbc00('0x7b')||_0x5c0a39===_0xbc00('0x7c')||_0x5c0a39===_0xbc00('0x7d')||_0x5c0a39==='bridgepvtcallid'||_0x5c0a39==='state'||_0x5c0a39===_0xbc00('0x2f')){return![];}return!![];};exports[_0xbc00('0x7e')]=function(_0x20375a,_0x55f2ac){var _0x2efabc,_0x1c0535,_0x549926;if(_0x55f2ac<=0x0){_0x55f2ac=0x1;}_0x2efabc=new RegExp(_0xbc00('0x7f')+_0x55f2ac+'}$');_0x1c0535=Math[_0xbc00('0x80')](0xa,_0x55f2ac-0x1);_0x549926=Math[_0xbc00('0x80')](0xa,_0x55f2ac)-0x1;return util['format']('%s',_['replace'](_0x20375a,_0x2efabc,_[_0xbc00('0x81')](_0x1c0535,_0x549926)));};exports[_0xbc00('0x82')]=function(_0x1c25b6){var _0x30d70d=_0x1c25b6[_0xbc00('0x83')](/"(.*?)"/);return _0x30d70d?_0x30d70d[0x1]:_0x1c25b6;};exports['extractCalleridNumber']=function(_0x540e58){var _0x4288d9=_0x540e58[_0xbc00('0x83')](/<(.*?)>/);return _0x4288d9?_0x4288d9[0x1]:_0x540e58;};
\ No newline at end of file
diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js
index 59b4f0a..cb888ab 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 _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
+var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x4ea1b1,_0x5f173d){var _0x1a7305=function(_0x486513){while(--_0x486513){_0x4ea1b1['push'](_0x4ea1b1['shift']());}};_0x1a7305(++_0x5f173d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1e1913,_0x641418){_0x1e1913=_0x1e1913-0x0;var _0xcb59ce=_0x5f2f[_0x1e1913];return _0xcb59ce;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}};
\ No newline at end of file
diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js
index 8f482cd..eee28f0 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 _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
+var _0xae2b=['format','SIP/%s','name','isNil','total','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','answered','unmanaged','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','interface','isUndefined','initTelephones','initTrunks','voiceQueues','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','diff','sumDuration','initVoiceCallReports','outbound','disposition','ANSWERED','duration','billableseconds','initCampaigns','campaigns','SquareProject','initFaxAccounts','bluebird','util','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','templates','voiceExtensions','channels','queueChannels','timers','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty'];(function(_0x5a905e,_0x31aa4a){var _0x4124d6=function(_0x37c28a){while(--_0x37c28a){_0x5a905e['push'](_0x5a905e['shift']());}};_0x4124d6(++_0x31aa4a);}(_0xae2b,0xb3));var _0xbae2=function(_0x35a9d0,_0x31afde){_0x35a9d0=_0x35a9d0-0x0;var _0x440450=_0xae2b[_0x35a9d0];return _0x440450;};'use strict';var BPromise=require(_0xbae2('0x0'));var util=require(_0xbae2('0x1'));var _=require('lodash');var moment=require(_0xbae2('0x2'));var Agent=require(_0xbae2('0x3'));var Telephone=require(_0xbae2('0x4'));var Trunk=require(_0xbae2('0x5'));var VoiceQueue=require(_0xbae2('0x6'));var Trigger=require(_0xbae2('0x7'));var Template=require('../model/template');var Campaign=require(_0xbae2('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xbae2('0x9'));var SalesforceAccount=require(_0xbae2('0xa'));var FreshdeskAccount=require(_0xbae2('0xb'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xbae2('0xc'));var Dynamics365Account=require(_0xbae2('0xd'));var FreshsalesAccount=require(_0xbae2('0xe'));var FaxAccount=require(_0xbae2('0xf'));var Realtime=function(){this[_0xbae2('0x10')]={};this[_0xbae2('0x11')]={};this[_0xbae2('0x12')]={};this['voiceQueues']={};this['triggers']={};this['campaigns']={};this[_0xbae2('0x13')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbae2('0x14')]={};this[_0xbae2('0x15')]={};this[_0xbae2('0x16')]={};this['outboundChannels']={};this[_0xbae2('0x17')]={};this[_0xbae2('0x18')]={};this['salesforceAccounts']={};this[_0xbae2('0x19')]={};this[_0xbae2('0x1a')]={};this[_0xbae2('0x1b')]={};this[_0xbae2('0x1c')]={};this[_0xbae2('0x1d')]={};this[_0xbae2('0x1e')]={};this[_0xbae2('0x1f')]={};this['freshsalesAccounts']={};this[_0xbae2('0x20')]={};};function freeIsNotKey(_0x523e23,_0x2ad31c,_0x390e95){var _0x4fdcb3=_[_0xbae2('0x21')](_0x523e23,function(_0x45ab0f,_0x48ec0c){return _0x45ab0f[_0x390e95];});for(var _0x27e323 in _0x2ad31c){if(_0x2ad31c[_0xbae2('0x22')](_0x27e323)){if(!_0x4fdcb3[_0x27e323]){delete _0x2ad31c[_0x27e323];}}}}function freeIsNotKeySip(_0x46145a,_0x4ed862){var _0x21c9fa=_['mapKeys'](_0x46145a,function(_0x4ee2d1,_0xb9d11c){return util[_0xbae2('0x23')](_0xbae2('0x24'),_0x4ee2d1[_0xbae2('0x25')]);});for(var _0x53b581 in _0x4ed862){if(_0x4ed862[_0xbae2('0x22')](_0x53b581)){if(!_0x21c9fa[_0x53b581]){delete _0x4ed862[_0x53b581];}}}}function freeIsNotKeyAgent(_0x3f2d99,_0x4a42be){var _0x5ba648=_[_0xbae2('0x21')](_0x3f2d99,function(_0x3f1e04,_0xd01446){var _0x1b9b24=_[_0xbae2('0x26')](_0x3f1e04['interface'])?util['format'](_0xbae2('0x24'),_0x3f1e04[_0xbae2('0x25')]):_0x3f1e04['interface'];return _0x1b9b24;});for(var _0x2f1da9 in _0x4a42be){if(_0x4a42be[_0xbae2('0x22')](_0x2f1da9)){if(!_0x5ba648[_0x2f1da9]){delete _0x4a42be[_0x2f1da9];}}}}function clearVoiceCallReports(_0x4154fd){_0x4154fd[_0xbae2('0x27')]=0x0;_0x4154fd['answered']=0x0;_0x4154fd[_0xbae2('0x28')]=0x0;_0x4154fd['sumDuration']=0x0;_0x4154fd[_0xbae2('0x29')]=0x0;}function clearCampaigns(_0x90a9a8){if(!_[_0xbae2('0x2a')](_0x90a9a8)){for(var _0x352fd2 in _0x90a9a8){if(_0x90a9a8[_0xbae2('0x22')](_0x352fd2)){_0x90a9a8[_0x352fd2]['ivrTotalCallsDays']=0x0;_0x90a9a8[_0x352fd2][_0xbae2('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x2513c1){if(!_['isEmpty'](_0x2513c1)){for(var _0x1361e7 in _0x2513c1){if(_0x2513c1[_0xbae2('0x22')](_0x1361e7)){_0x2513c1[_0x1361e7][_0xbae2('0x27')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x2c')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x2d')]=0x0;_0x2513c1[_0x1361e7]['abandoned']=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x28')]=0x0;_0x2513c1[_0x1361e7]['sumDuration']=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x29')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x2e')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x2f')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x30')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x31')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x32')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x33')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x34')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x35')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x36')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x37')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x38')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x39')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x2e')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x3a')]=0x0;_0x2513c1[_0x1361e7][_0xbae2('0x3b')]=!![];}}}}Realtime['prototype'][_0xbae2('0x3c')]=function(_0x3ca0a9,_0x5dec6e){for(var _0x587d96 in _0x5dec6e){if(_0x3ca0a9[_0xbae2('0x22')](_0x587d96)){_0x3ca0a9[_0x587d96]=_0x5dec6e[_0x587d96];}}};Realtime[_0xbae2('0x3d')][_0xbae2('0x3e')]=function(){var _0xd6502f=this;return function(_0x5dc71c){if(_0x5dc71c){freeIsNotKeyAgent(_0x5dc71c,_0xd6502f[_0xbae2('0x10')]);for(var _0x225b56=0x0,_0x35c929={},_0x34492a={};_0x225b56<_0x5dc71c[_0xbae2('0x3f')];_0x225b56+=0x1){_0x35c929=_0x5dc71c[_0x225b56];var _0x144231=_[_0xbae2('0x26')](_0x35c929[_0xbae2('0x40')])?util[_0xbae2('0x23')]('SIP/%s',_0x35c929[_0xbae2('0x25')]):_0x35c929[_0xbae2('0x40')];if(_[_0xbae2('0x41')](_0xd6502f[_0xbae2('0x10')][_0x144231])){_0xd6502f['agents'][_0x144231]=new Agent(_0x35c929);}else{_0xd6502f[_0xbae2('0x3c')](_0xd6502f[_0xbae2('0x10')][_0x144231],_0x35c929);}}}return _0xd6502f[_0xbae2('0x10')];};};Realtime[_0xbae2('0x3d')][_0xbae2('0x42')]=function(){var _0x4bbb21=this;return function(_0x21f1e1){if(_0x21f1e1){freeIsNotKeySip(_0x21f1e1,_0x4bbb21['telephones']);for(var _0x2f082d=0x0,_0x14ac8d={},_0x179856={};_0x2f082d<_0x21f1e1[_0xbae2('0x3f')];_0x2f082d+=0x1){_0x14ac8d=_0x21f1e1[_0x2f082d];if(_['isUndefined'](_0x4bbb21[_0xbae2('0x11')][util['format']('SIP/%s',_0x14ac8d['name'])])){_0x4bbb21[_0xbae2('0x11')][util[_0xbae2('0x23')](_0xbae2('0x24'),_0x14ac8d[_0xbae2('0x25')])]=new Telephone(_0x14ac8d);}else{_0x4bbb21[_0xbae2('0x3c')](_0x4bbb21['telephones'][util['format'](_0xbae2('0x24'),_0x14ac8d['name'])],_0x14ac8d);}}}return _0x4bbb21[_0xbae2('0x11')];};};Realtime[_0xbae2('0x3d')][_0xbae2('0x43')]=function(){var _0x21175c=this;return function(_0x35be12){if(_0x35be12){freeIsNotKeySip(_0x35be12,_0x21175c[_0xbae2('0x12')]);for(var _0x680b84=0x0,_0x307457={},_0x672935={};_0x680b84<_0x35be12[_0xbae2('0x3f')];_0x680b84+=0x1){_0x307457=_0x35be12[_0x680b84];if(_[_0xbae2('0x41')](_0x21175c[_0xbae2('0x12')][util['format']('SIP/%s',_0x307457['name'])])){_0x21175c[_0xbae2('0x12')][util[_0xbae2('0x23')]('SIP/%s',_0x307457[_0xbae2('0x25')])]=new Trunk(_0x307457);}else{_0x21175c[_0xbae2('0x3c')](_0x21175c[_0xbae2('0x12')][util[_0xbae2('0x23')](_0xbae2('0x24'),_0x307457['name'])],_0x307457);}}}return _0x21175c['trunks'];};};Realtime[_0xbae2('0x3d')]['initVoiceQueues']=function(){var _0x3ba1f9=this;return function(_0x931ed7){if(_0x931ed7){freeIsNotKey(_0x931ed7,_0x3ba1f9[_0xbae2('0x44')],_0xbae2('0x25'));for(var _0x37fa18=0x0,_0x548842={},_0x5792e9={};_0x37fa18<_0x931ed7['length'];_0x37fa18+=0x1){_0x548842=_0x931ed7[_0x37fa18];if(_[_0xbae2('0x41')](_0x3ba1f9['voiceQueues'][_0x548842['name']])){_0x3ba1f9[_0xbae2('0x44')][_0x548842[_0xbae2('0x25')]]=new VoiceQueue(_0x548842);}else{_0x3ba1f9['mergeFromDatabase'](_0x3ba1f9['voiceQueues'][_0x548842['name']],_0x548842);}}}return _0x3ba1f9['voiceQueues'];};};Realtime[_0xbae2('0x3d')][_0xbae2('0x45')]=function(){var _0x4dd072=this;return function(_0x472bf4){if(_0x472bf4){freeIsNotKey(_0x472bf4,_0x4dd072[_0xbae2('0x46')],'id');for(var _0x2a6903=0x0,_0x133285={},_0xbca7aa={};_0x2a6903<_0x472bf4[_0xbae2('0x3f')];_0x2a6903+=0x1){_0x133285=_0x472bf4[_0x2a6903];if(_[_0xbae2('0x41')](_0x4dd072[_0xbae2('0x46')][_0x133285['id']])){_0x4dd072[_0xbae2('0x46')][_0x133285['id']]=new Trigger(_0x133285);}else{_0x4dd072[_0xbae2('0x3c')](_0x4dd072[_0xbae2('0x46')][_0x133285['id']],_0x133285);}}}return _0x4dd072[_0xbae2('0x46')];};};Realtime['prototype'][_0xbae2('0x47')]=function(){var _0x5630ac=this;return function(_0x31ba99){if(_0x31ba99){freeIsNotKey(_0x31ba99,_0x5630ac['templates'],'id');for(var _0x2ad12b=0x0,_0x20fffa={},_0x4b184d={};_0x2ad12b<_0x31ba99['length'];_0x2ad12b+=0x1){_0x20fffa=_0x31ba99[_0x2ad12b];if(_[_0xbae2('0x41')](_0x5630ac[_0xbae2('0x13')][_0x20fffa['id']])){_0x5630ac[_0xbae2('0x13')][_0x20fffa['id']]=new Template(_0x20fffa);}else{_0x5630ac[_0xbae2('0x3c')](_0x5630ac[_0xbae2('0x13')][_0x20fffa['id']],_0x20fffa);}}}return _0x5630ac[_0xbae2('0x13')];};};Realtime[_0xbae2('0x3d')][_0xbae2('0x48')]=function(){var _0x527514=this;return function(_0x3855b){if(_0x3855b){freeIsNotKey(_0x3855b,_0x527514[_0xbae2('0x18')],'id');for(var _0x485475=0x0,_0x1b14db={},_0x4779a1={};_0x485475<_0x3855b[_0xbae2('0x3f')];_0x485475+=0x1){_0x1b14db=_0x3855b[_0x485475];if(_[_0xbae2('0x41')](_0x527514[_0xbae2('0x18')][_0x1b14db['id']])){_0x527514[_0xbae2('0x18')][_0x1b14db['id']]=new ZendeskAccount(_0x1b14db);}else{_0x527514[_0xbae2('0x3c')](_0x527514['zendeskAccounts'][_0x1b14db['id']],_0x1b14db);}}}return _0x527514[_0xbae2('0x18')];};};Realtime[_0xbae2('0x3d')][_0xbae2('0x49')]=function(){var _0x57221a=this;return function(_0x2b68e1){if(_0x2b68e1){freeIsNotKey(_0x2b68e1,_0x57221a['salesforceAccounts'],'id');for(var _0x1b107a=0x0,_0x12e2c0={},_0x117ed7={};_0x1b107a<_0x2b68e1[_0xbae2('0x3f')];_0x1b107a+=0x1){_0x12e2c0=_0x2b68e1[_0x1b107a];if(_[_0xbae2('0x41')](_0x57221a[_0xbae2('0x4a')][_0x12e2c0['id']])){_0x57221a[_0xbae2('0x4a')][_0x12e2c0['id']]=new SalesforceAccount(_0x12e2c0);}else{_0x57221a[_0xbae2('0x3c')](_0x57221a[_0xbae2('0x4a')][_0x12e2c0['id']],_0x12e2c0);}}}return _0x57221a[_0xbae2('0x4a')];};};Realtime['prototype'][_0xbae2('0x4b')]=function(){var _0x2d3635=this;return function(_0x473dd8){if(_0x473dd8){freeIsNotKey(_0x473dd8,_0x2d3635[_0xbae2('0x1a')],'id');for(var _0x349a96=0x0,_0x2472d8={},_0x135988={};_0x349a96<_0x473dd8[_0xbae2('0x3f')];_0x349a96+=0x1){_0x2472d8=_0x473dd8[_0x349a96];if(_['isUndefined'](_0x2d3635['freshdeskAccounts'][_0x2472d8['id']])){_0x2d3635[_0xbae2('0x1a')][_0x2472d8['id']]=new FreshdeskAccount(_0x2472d8);}else{_0x2d3635[_0xbae2('0x3c')](_0x2d3635[_0xbae2('0x1a')][_0x2472d8['id']],_0x2472d8);}}}return _0x2d3635['freshdeskAccounts'];};};Realtime[_0xbae2('0x3d')][_0xbae2('0x4c')]=function(){var _0x451059=this;return function(_0x3a3058){if(_0x3a3058){freeIsNotKey(_0x3a3058,_0x451059[_0xbae2('0x1b')],'id');for(var _0x39074e=0x0,_0x39f697={},_0xe749ae={};_0x39074e<_0x3a3058['length'];_0x39074e+=0x1){_0x39f697=_0x3a3058[_0x39074e];if(_[_0xbae2('0x41')](_0x451059['zohoAccounts'][_0x39f697['id']])){_0x451059[_0xbae2('0x1b')][_0x39f697['id']]=new ZohoAccount(_0x39f697);}else{_0x451059['mergeFromDatabase'](_0x451059[_0xbae2('0x1b')][_0x39f697['id']],_0x39f697);}}}return _0x451059['zohoAccounts'];};};Realtime[_0xbae2('0x3d')]['initDeskAccounts']=function(){var _0x571be8=this;return function(_0x255504){if(_0x255504){freeIsNotKey(_0x255504,_0x571be8[_0xbae2('0x1c')],'id');for(var _0x4d6368=0x0,_0xca412d={},_0x332d68={};_0x4d6368<_0x255504[_0xbae2('0x3f')];_0x4d6368+=0x1){_0xca412d=_0x255504[_0x4d6368];if(_[_0xbae2('0x41')](_0x571be8[_0xbae2('0x1c')][_0xca412d['id']])){_0x571be8['deskAccounts'][_0xca412d['id']]=new DeskAccount(_0xca412d);}else{_0x571be8[_0xbae2('0x3c')](_0x571be8['deskAccounts'][_0xca412d['id']],_0xca412d);}}}return _0x571be8[_0xbae2('0x1c')];};};Realtime['prototype'][_0xbae2('0x4d')]=function(){var _0x412cbc=this;return function(_0x4e0625){if(_0x4e0625){freeIsNotKey(_0x4e0625,_0x412cbc['sugarcrmAccounts'],'id');for(var _0x2b238e=0x0,_0x1d8f54={},_0x33888e={};_0x2b238e<_0x4e0625[_0xbae2('0x3f')];_0x2b238e+=0x1){_0x1d8f54=_0x4e0625[_0x2b238e];if(_[_0xbae2('0x41')](_0x412cbc[_0xbae2('0x19')][_0x1d8f54['id']])){_0x412cbc['sugarcrmAccounts'][_0x1d8f54['id']]=new SugarcrmAccount(_0x1d8f54);}else{_0x412cbc[_0xbae2('0x3c')](_0x412cbc[_0xbae2('0x19')][_0x1d8f54['id']],_0x1d8f54);}}}return _0x412cbc[_0xbae2('0x19')];};};Realtime[_0xbae2('0x3d')][_0xbae2('0x4e')]=function(){var _0x3a612e=this;return function(_0x262aef){if(_0x262aef){freeIsNotKey(_0x262aef,_0x3a612e['vtigerAccounts'],'id');for(var _0x530cab=0x0,_0x2e4ed2={},_0x828c72={};_0x530cab<_0x262aef[_0xbae2('0x3f')];_0x530cab+=0x1){_0x2e4ed2=_0x262aef[_0x530cab];if(_[_0xbae2('0x41')](_0x3a612e[_0xbae2('0x1d')][_0x2e4ed2['id']])){_0x3a612e[_0xbae2('0x1d')][_0x2e4ed2['id']]=new VtigerAccount(_0x2e4ed2);}else{_0x3a612e['mergeFromDatabase'](_0x3a612e[_0xbae2('0x1d')][_0x2e4ed2['id']],_0x2e4ed2);}}}return _0x3a612e['vtigerAccounts'];};};Realtime['prototype'][_0xbae2('0x4f')]=function(){var _0x491219=this;return function(_0x927a07){if(_0x927a07){freeIsNotKey(_0x927a07,_0x491219[_0xbae2('0x1e')],'id');for(var _0x4f8920=0x0,_0x234f5b={},_0xfb4696={};_0x4f8920<_0x927a07[_0xbae2('0x3f')];_0x4f8920+=0x1){_0x234f5b=_0x927a07[_0x4f8920];if(_['isUndefined'](_0x491219[_0xbae2('0x1e')][_0x234f5b['id']])){_0x491219[_0xbae2('0x1e')][_0x234f5b['id']]=new ServicenowAccount(_0x234f5b);}else{_0x491219[_0xbae2('0x3c')](_0x491219[_0xbae2('0x1e')][_0x234f5b['id']],_0x234f5b);}}}return _0x491219[_0xbae2('0x1e')];};};Realtime[_0xbae2('0x3d')][_0xbae2('0x50')]=function(){var _0xf21479=this;return function(_0x369101){if(_0x369101){freeIsNotKey(_0x369101,_0xf21479[_0xbae2('0x1f')],'id');for(var _0x32e212=0x0,_0x386a99={},_0x26fb0c={};_0x32e212<_0x369101[_0xbae2('0x3f')];_0x32e212+=0x1){_0x386a99=_0x369101[_0x32e212];if(_[_0xbae2('0x41')](_0xf21479[_0xbae2('0x1f')][_0x386a99['id']])){_0xf21479['dynamics365Accounts'][_0x386a99['id']]=new Dynamics365Account(_0x386a99);}else{_0xf21479['mergeFromDatabase'](_0xf21479[_0xbae2('0x1f')][_0x386a99['id']],_0x386a99);}}}return _0xf21479['dynamics365Accounts'];};};Realtime[_0xbae2('0x3d')]['initFreshsalesAccounts']=function(){var _0x5af9c1=this;return function(_0x14405a){if(_0x14405a){freeIsNotKey(_0x14405a,_0x5af9c1[_0xbae2('0x51')],'id');for(var _0x4f7abd=0x0,_0x51e2a0={},_0x18eeb8={};_0x4f7abd<_0x14405a[_0xbae2('0x3f')];_0x4f7abd+=0x1){_0x51e2a0=_0x14405a[_0x4f7abd];if(_[_0xbae2('0x41')](_0x5af9c1[_0xbae2('0x51')][_0x51e2a0['id']])){_0x5af9c1[_0xbae2('0x51')][_0x51e2a0['id']]=new FreshsalesAccount(_0x51e2a0);}else{_0x5af9c1[_0xbae2('0x3c')](_0x5af9c1[_0xbae2('0x51')][_0x51e2a0['id']],_0x51e2a0);}}}return _0x5af9c1[_0xbae2('0x51')];};};Realtime[_0xbae2('0x3d')][_0xbae2('0x52')]=function(){var _0x4be206=this;return function(_0x2cc88a){for(var _0x3ffdfe=0x0;_0x3ffdfe<_0x2cc88a[_0xbae2('0x3f')];_0x3ffdfe+=0x1){_[_0xbae2('0x53')](_0x4be206[_0xbae2('0x44')][_0x2cc88a[_0x3ffdfe][_0xbae2('0x25')]],_0x2cc88a[_0x3ffdfe]);}return _0x4be206[_0xbae2('0x44')];};};Realtime[_0xbae2('0x3d')]['initVoiceQueueReports']=function(){var _0x196031=this;return function(_0x1cbe50){clearVoiceQueues(_0x196031['voiceQueues']);if(_0x1cbe50){_0x1cbe50=_[_0xbae2('0x54')](_0x1cbe50,_0xbae2('0x55'));for(var _0x360b19 in _0x1cbe50){if(_0x1cbe50[_0xbae2('0x22')](_0x360b19)){var _0x5dee94={};for(var _0x131e72=0x0;_0x131e72<_0x1cbe50[_0x360b19]['length'];_0x131e72+=0x1){var _0x5fde4a=_0x1cbe50[_0x360b19][_0x131e72][_0xbae2('0x56')];if(_0x196031[_0xbae2('0x44')][_0x5fde4a]){if(_0x1cbe50[_0x360b19][_0x131e72][_0xbae2('0x57')]){_0x196031[_0xbae2('0x44')][_0x5fde4a]['unmanaged']+=0x1;}if(_0x1cbe50[_0x360b19][_0x131e72][_0xbae2('0x58')]){_0x196031[_0xbae2('0x44')][_0x5fde4a][_0xbae2('0x59')]+=0x1;}_0x196031[_0xbae2('0x44')][_0x5fde4a]['sumHoldTime']+=moment(_0x1cbe50[_0x360b19][_0x131e72][_0xbae2('0x5a')])['diff'](moment(_0x1cbe50[_0x360b19][_0x131e72]['queuecallerjoinAt']),_0xbae2('0x5b'))||0x0;if(_0x131e72===_0x1cbe50[_0x360b19][_0xbae2('0x3f')]-0x1){_0x196031[_0xbae2('0x44')][_0x5fde4a]['sumDuration']+=moment(_0x1cbe50[_0x360b19][_0x131e72][_0xbae2('0x5c')]||_0x1cbe50[_0x360b19][_0x131e72]['queuecallerabandonAt']||_0x1cbe50[_0x360b19][_0x131e72][_0xbae2('0x5d')])['diff'](moment(_0x1cbe50[_0x360b19][_0x131e72]['queuecallerjoinAt']),_0xbae2('0x5b'))||0x0;_0x196031[_0xbae2('0x44')][_0x5fde4a][_0xbae2('0x27')]+=0x1;if(_0x1cbe50[_0x360b19][_0x131e72][_0xbae2('0x5e')]){_0x196031['voiceQueues'][_0x5fde4a][_0xbae2('0x2c')]+=0x1;_0x196031['voiceQueues'][_0x5fde4a][_0xbae2('0x29')]+=moment(_0x1cbe50[_0x360b19][_0x131e72][_0xbae2('0x5c')])[_0xbae2('0x5f')](moment(_0x1cbe50[_0x360b19][_0x131e72][_0xbae2('0x5a')]),_0xbae2('0x5b'))||0x0;}}else{_0x196031[_0xbae2('0x44')][_0x5fde4a][_0xbae2('0x60')]+=_0x196031[_0xbae2('0x44')][_0x5fde4a][_0xbae2('0x28')]||0x0;}}}}}}return _0x196031[_0xbae2('0x44')];};};Realtime[_0xbae2('0x3d')][_0xbae2('0x61')]=function(){var _0x5ebf69=this;return function(_0x1c768a){clearVoiceCallReports(_0x5ebf69[_0xbae2('0x62')]);if(_0x1c768a){for(var _0x3f9568=0x0;_0x3f9568<_0x1c768a[_0xbae2('0x3f')];_0x3f9568+=0x1){_0x5ebf69['outbound'][_0xbae2('0x27')]+=0x1;_0x5ebf69[_0xbae2('0x62')][_0xbae2('0x60')]+=_0x1c768a[_0x3f9568]['duration'];if(_0x1c768a[_0x3f9568][_0xbae2('0x63')]===_0xbae2('0x64')){_0x5ebf69[_0xbae2('0x62')][_0xbae2('0x2c')]+=0x1;_0x5ebf69[_0xbae2('0x62')][_0xbae2('0x28')]+=_0x1c768a[_0x3f9568][_0xbae2('0x65')]-_0x1c768a[_0x3f9568][_0xbae2('0x66')]||0x0;_0x5ebf69[_0xbae2('0x62')][_0xbae2('0x29')]+=_0x1c768a[_0x3f9568][_0xbae2('0x66')];}}}return _0x5ebf69[_0xbae2('0x62')];};};Realtime['prototype'][_0xbae2('0x67')]=function(){var _0x1a8e62=this;return function(_0x2abb9a){if(_0x2abb9a){freeIsNotKey(_0x2abb9a,_0x1a8e62['campaigns'],_0xbae2('0x25'));for(var _0x3f1ad2=0x0,_0x609a62={};_0x3f1ad2<_0x2abb9a[_0xbae2('0x3f')];_0x3f1ad2+=0x1){_0x609a62=_0x2abb9a[_0x3f1ad2];if(_[_0xbae2('0x41')](_0x1a8e62[_0xbae2('0x68')][_0x609a62[_0xbae2('0x25')]])){_0x1a8e62[_0xbae2('0x68')][_0x609a62[_0xbae2('0x25')]]=new Campaign(_0x609a62);}else{_0x1a8e62[_0xbae2('0x3c')](_0x1a8e62[_0xbae2('0x68')][_0x609a62[_0xbae2('0x25')]],_0x609a62);_0x1a8e62[_0xbae2('0x68')][_0x609a62[_0xbae2('0x25')]]['dialQueueProject']=_0x609a62['SquareProject']?_0x609a62[_0xbae2('0x69')][_0xbae2('0x25')]:undefined;}}}return _0x1a8e62[_0xbae2('0x68')];};};Realtime[_0xbae2('0x3d')]['initVoiceExtensions']=function(){var _0x421c57=this;return function(_0x4eb381){if(_0x4eb381){freeIsNotKey(_0x4eb381,_0x421c57[_0xbae2('0x14')],'id');for(var _0x42f471=0x0,_0x4cee8e={};_0x42f471<_0x4eb381[_0xbae2('0x3f')];_0x42f471+=0x1){_0x4cee8e=_0x4eb381[_0x42f471];if(_[_0xbae2('0x41')](_0x421c57[_0xbae2('0x14')][_0x4cee8e['id']])){_0x421c57[_0xbae2('0x14')][_0x4cee8e['id']]=new VoiceExtension(_0x4cee8e);}else{_0x421c57['mergeFromDatabase'](_0x421c57[_0xbae2('0x14')][_0x4cee8e['id']],_0x4cee8e);}}}return _0x421c57['voiceExtensions'];};};Realtime[_0xbae2('0x3d')]['initCampaignHopperHistory']=function(){var _0xfe8f0f=this;return function(_0x3707df){clearCampaigns(_0xfe8f0f[_0xbae2('0x68')]);for(var _0x32a3c3=0x0;_0x32a3c3<_0x3707df[_0xbae2('0x3f')];_0x32a3c3+=0x1){_[_0xbae2('0x53')](_0xfe8f0f[_0xbae2('0x68')][_0x3707df[_0x32a3c3][_0xbae2('0x25')]],_0x3707df[_0x32a3c3]);}return _0xfe8f0f['campaigns'];};};Realtime[_0xbae2('0x3d')][_0xbae2('0x6a')]=function(){var _0x2246f8=this;return function(_0xdd1cd7){if(_0xdd1cd7){freeIsNotKey(_0xdd1cd7,_0x2246f8[_0xbae2('0x20')],'id');for(var _0x2e8c86=0x0,_0x10571d={},_0x5cbd61={};_0x2e8c86<_0xdd1cd7['length'];_0x2e8c86+=0x1){_0x10571d=_0xdd1cd7[_0x2e8c86];if(_[_0xbae2('0x41')](_0x2246f8['faxAccounts'][_0x10571d['id']])){_0x2246f8[_0xbae2('0x20')][_0x10571d['id']]=new FaxAccount(_0x10571d);}else{_0x2246f8[_0xbae2('0x3c')](_0x2246f8['faxAccounts'][_0x10571d['id']],_0x10571d);}}}return _0x2246f8['faxAccounts'];};};module['exports']=Realtime;
\ No newline at end of file
diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js
index 4f91fba..eccdccd 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 _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
+var _0xdbbc=['SIP/%s','blindTransfer','exports','lodash','../../../config/environment','../../../config/logger','ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','name','isNil','find','accountcode','interface','format','length','connectedlinenum','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','calleridpreview','calleridnum','originatecalleridnum','channel','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','monitorFilename','createdAt','exten','xcally-motion-preview','connectedlinename','membername','xcally-motion-dialer','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf'];(function(_0x1c3429,_0x11d159){var _0x1609bd=function(_0x5ce42c){while(--_0x5ce42c){_0x1c3429['push'](_0x1c3429['shift']());}};_0x1609bd(++_0x11d159);}(_0xdbbc,0x147));var _0xcdbb=function(_0x442c36,_0x3dbe3c){_0x442c36=_0x442c36-0x0;var _0x7f1070=_0xdbbc[_0x442c36];return _0x7f1070;};'use strict';var BPromise=require('bluebird');var _=require(_0xcdbb('0x0'));var moment=require('moment');var util=require('util');var config=require(_0xcdbb('0x1'));var logger=require(_0xcdbb('0x2'))(_0xcdbb('0x3'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xcdbb('0x4'));var RpcVoiceCallReport=require(_0xcdbb('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xcdbb('0x6'));var RpcVoiceQueueReport=require(_0xcdbb('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xcdbb('0x8'));var VoiceCallReport=require(_0xcdbb('0x9'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xcdbb('0xa'));var UserReport=require('./userReport');function Report(_0x148cf2){this[_0xcdbb('0xb')]=_0x148cf2;this[_0xcdbb('0xc')]=_0x148cf2[_0xcdbb('0xc')];this[_0xcdbb('0xd')]=_0x148cf2[_0xcdbb('0xd')];}Report[_0xcdbb('0xe')][_0xcdbb('0xf')]=function(_0x2737a9){var _0x34ee6a=new VoiceQueueReport(this['realtime']);var _0x36fd76=new VoiceAgentReport(this[_0xcdbb('0xb')]);var _0x5389fc=new VoiceDialReport(this[_0xcdbb('0xb')]);var _0x308c68=new VoiceCallReport(this[_0xcdbb('0xb')]);var _0x3e31a3=new UserReport(this['realtime']);if(config[_0xcdbb('0x10')]&&config['xdr'][_0xcdbb('0x11')]){ami['on']('custom:voiceQueueReport',this[_0xcdbb('0x12')][_0xcdbb('0x13')](this));ami['on']('custom:voiceCallReport',this[_0xcdbb('0x14')]['bind'](this));ami['on'](_0xcdbb('0x15'),this[_0xcdbb('0x16')][_0xcdbb('0x13')](this));ami['on']('custom:voiceDialReport',this[_0xcdbb('0x17')][_0xcdbb('0x13')](this));ami['on'](_0xcdbb('0x18'),this['blindTransfer'][_0xcdbb('0x13')](this));ami['on'](_0xcdbb('0x19'),this[_0xcdbb('0x1a')]['bind'](this));}};Report[_0xcdbb('0xe')][_0xcdbb('0x1b')]=function(_0x44c7b5){var _0x597e4e=undefined;_0x597e4e=_['find'](this[_0xcdbb('0xc')],function(_0x52994e){return _0x52994e['accountcode']==_0x44c7b5||_0x52994e[_0xcdbb('0x1c')]==_0x44c7b5;});if(_[_0xcdbb('0x1d')](_0x597e4e)){var _0x3c37db=_[_0xcdbb('0x1e')](this[_0xcdbb('0xd')],function(_0x1997df){return _0x1997df[_0xcdbb('0x1f')]==_0x44c7b5||_0x1997df[_0xcdbb('0x1c')]==_0x44c7b5;});if(_0x3c37db){_0x597e4e=_[_0xcdbb('0x1e')](this[_0xcdbb('0xc')],function(_0x4c643f){return _0x4c643f[_0xcdbb('0x20')]==util[_0xcdbb('0x21')]('SIP/%s',_0x3c37db[_0xcdbb('0x1c')]);});}}return _0x597e4e;};Report['prototype'][_0xcdbb('0x12')]=function(_0x11fdf9){for(var _0x3e7156=0x0;_0x3e7156<_0x11fdf9[_0xcdbb('0x22')];_0x3e7156+=0x1){var _0x32eba5=this['findAgent'](_0x11fdf9[_0x3e7156][_0xcdbb('0x23')]);if(_0x32eba5){_0x11fdf9[_0x3e7156]['accountcode']=_0x32eba5[_0xcdbb('0x1f')];_0x11fdf9[_0x3e7156]['assigned']=!![];_0x11fdf9[_0x3e7156][_0xcdbb('0x24')]=_0x32eba5[_0xcdbb('0x1c')];_0x11fdf9[_0x3e7156][_0xcdbb('0x20')]=_[_0xcdbb('0x1d')](_0x32eba5[_0xcdbb('0x20')])?util[_0xcdbb('0x21')]('SIP/%s',_0x32eba5[_0xcdbb('0x1c')]):_0x32eba5[_0xcdbb('0x20')];if(_0x11fdf9[_0x3e7156][_0xcdbb('0x25')]){_0x11fdf9[_0x3e7156][_0xcdbb('0x26')]=moment()[_0xcdbb('0x21')](_0xcdbb('0x27'));}if(_0x11fdf9[_0x3e7156][_0xcdbb('0x28')]){_0x11fdf9[_0x3e7156][_0xcdbb('0x29')]=moment()['format'](_0xcdbb('0x27'));}RpcMemberReport[_0xcdbb('0x12')](_0x11fdf9[_0x3e7156]);}RpcVoiceQueueReport[_0xcdbb('0x2a')](_0x11fdf9[_0x3e7156]);}};function extractCalleridNumber(_0x155cda){var _0xab6e80=_0x155cda[_0xcdbb('0x2b')](/<(.*?)>/);return _0xab6e80?_0xab6e80[0x1]:_0x155cda;}Report['prototype'][_0xcdbb('0x14')]=function(_0x5c589b){_0x5c589b[_0xcdbb('0x2c')]=_0x5c589b[_0xcdbb('0x2c')]||_0x5c589b['exten'];if(_0x5c589b[_0xcdbb('0x2d')]==_0xcdbb('0x2e')){_0x5c589b[_0xcdbb('0x2f')]=_0xcdbb('0x30');_0x5c589b[_0xcdbb('0x31')]=_0x5c589b[_0xcdbb('0x30')];if(_0x5c589b[_0xcdbb('0x32')]==_0xcdbb('0x33')){_0x5c589b[_0xcdbb('0x1f')]='';_0x5c589b[_0xcdbb('0x2c')]=extractCalleridNumber(_0x5c589b[_0xcdbb('0x34')]);}else if(_0x5c589b[_0xcdbb('0x32')]=='from-sip'){if(_0x5c589b[_0xcdbb('0x2c')]=='xcally-motion-preview'){_0x5c589b[_0xcdbb('0x2c')]=extractCalleridNumber(_0x5c589b[_0xcdbb('0x35')]);_0x5c589b[_0xcdbb('0x36')]=_0x5c589b[_0xcdbb('0x37')];_0x5c589b['destinationchannel']=[_0x5c589b[_0xcdbb('0x38')],_0x5c589b[_0xcdbb('0x38')]=_0x5c589b[_0xcdbb('0x39')]][0x0];_0x5c589b[_0xcdbb('0x34')]=_0x5c589b[_0xcdbb('0x35')];}else{_0x5c589b[_0xcdbb('0x2c')]=_0x5c589b[_0xcdbb('0x36')];_0x5c589b[_0xcdbb('0x36')]=_0x5c589b[_0xcdbb('0x37')];if(_0x5c589b[_0xcdbb('0x3a')]==_0xcdbb('0x3b')){_0x5c589b['accountcode']=_0x5c589b['connectedlinenum'];}else{_0x5c589b[_0xcdbb('0x1f')]='';}}}}else{_0x5c589b[_0xcdbb('0x34')]=util[_0xcdbb('0x21')](_0xcdbb('0x3c'),_0x5c589b[_0xcdbb('0x3d')],_0x5c589b[_0xcdbb('0x36')]);}RpcVoiceCallReport['create'](_0x5c589b);if(_0x5c589b[_0xcdbb('0x3e')]){for(var _0x55a859=0x0;_0x55a859<_0x5c589b[_0xcdbb('0x3f')]['length'];_0x55a859+=0x1){_0x5c589b[_0xcdbb('0x40')]=_0x5c589b['monitors'][_0x55a859]['filename'];_0x5c589b[_0xcdbb('0x41')]=_0x5c589b['monitors'][_0x55a859][_0xcdbb('0x41')];if(_0x5c589b[_0xcdbb('0x42')]==_0xcdbb('0x43')){_0x5c589b[_0xcdbb('0x36')]=_0x5c589b[_0xcdbb('0x23')];_0x5c589b[_0xcdbb('0x3d')]=_0x5c589b['connectedlinename'];_0x5c589b[_0xcdbb('0x23')]=_0x5c589b[_0xcdbb('0x1f')];_0x5c589b[_0xcdbb('0x44')]=_0x5c589b[_0xcdbb('0x45')];_0x5c589b[_0xcdbb('0x42')]=_0x5c589b[_0xcdbb('0x37')];}else if(_0x5c589b[_0xcdbb('0x42')]==_0xcdbb('0x46')){_0x5c589b['calleridnum']=_0x5c589b['destination'];_0x5c589b[_0xcdbb('0x42')]=_0x5c589b[_0xcdbb('0x37')];}RpcVoiceRecording[_0xcdbb('0x2a')](_0x5c589b);}}};Report[_0xcdbb('0xe')][_0xcdbb('0x16')]=function(_0x1cc44c){if(_['isArray'](_0x1cc44c)){_0x1cc44c[_0xcdbb('0x47')](function(_0x522394){RpcVoiceAgentReport[_0xcdbb('0x2a')](_0x522394);});}else{RpcVoiceAgentReport[_0xcdbb('0x2a')](_0x1cc44c);}};Report[_0xcdbb('0xe')][_0xcdbb('0x17')]=function(_0x566e2e){RpcVoiceDialReport[_0xcdbb('0x2a')](_0x566e2e);var _0xe100e=undefined;var _0x111055=_0x566e2e[_0xcdbb('0x38')];if(_[_0xcdbb('0x48')](_0x111055,'Local')){var _0x3e8512=_0x111055[_0xcdbb('0x49')](_0x111055[_0xcdbb('0x4a')]('/')+0x1,_0x111055[_0xcdbb('0x4a')]('@'));_0xe100e=_[_0xcdbb('0x1e')](this[_0xcdbb('0xc')],function(_0x3ce96b){return _0x3ce96b[_0xcdbb('0x4b')]==_0x3e8512||_0x3ce96b[_0xcdbb('0x4c')]==_0x3e8512||_0x3ce96b[_0xcdbb('0x1f')]==_0x3e8512;});}else{var _0x3e8512=_0x111055[_0xcdbb('0x49')](_0x111055[_0xcdbb('0x4a')]('/')+0x1,_0x111055[_0xcdbb('0x4d')]('-'));_0xe100e=this[_0xcdbb('0x1b')](_0x3e8512);}if(_0xe100e){_0x566e2e[_0xcdbb('0x20')]=_[_0xcdbb('0x1d')](_0xe100e[_0xcdbb('0x20')])?util[_0xcdbb('0x21')](_0xcdbb('0x4e'),_0xe100e[_0xcdbb('0x1c')]):_0xe100e[_0xcdbb('0x20')];_0x566e2e[_0xcdbb('0x45')]=_0xe100e['name'];_0x566e2e['accountcode']=_0xe100e[_0xcdbb('0x1f')];RpcMemberReport['voiceDialReport'](_0x566e2e);}};Report[_0xcdbb('0xe')][_0xcdbb('0x4f')]=function(_0xcf12b){RpcVoiceTransferReport[_0xcdbb('0x4f')](_0xcf12b);};Report[_0xcdbb('0xe')][_0xcdbb('0x1a')]=function(_0x2c6391){RpcVoiceTransferReport[_0xcdbb('0x1a')](_0x2c6391);};module[_0xcdbb('0x50')]=Report;
\ No newline at end of file
diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js
index 4428506..d283200 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 _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
+var _0xd3ee=['resolve','actionSipShowRegistry','then','actionDeviceStateList','actionSipPeerStatus','catch','error','inspect','prototype','isNotNull','emit','find','state','omit','event','username','format','name','trunk:save','[syncRegistry][UserReport]','device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','telephone:%s','trunk:%s','startsWith','Queue','indexOf','phone','accountcode','[syncDeviceState][UserReport]','peer','registered','address','status','telephone:save','[syncPeerStatus][UserReport]','lodash','moment','bluebird','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0xd3ee,0xab));var _0xed3e=function(_0x3de6c1,_0x4cb097){_0x3de6c1=_0x3de6c1-0x0;var _0x4453c8=_0xd3ee[_0x3de6c1];return _0x4453c8;};'use strict';var _=require(_0xed3e('0x0'));var moment=require(_0xed3e('0x1'));var BPromise=require(_0xed3e('0x2'));var util=require(_0xed3e('0x3'));var Redis=require(_0xed3e('0x4'));var config=require(_0xed3e('0x5'));var logger=require('../../../config/logger')(_0xed3e('0x6'));var ami=require(_0xed3e('0x7'));config[_0xed3e('0x8')]=_[_0xed3e('0x9')](config[_0xed3e('0x8')],{'host':_0xed3e('0xa'),'port':0x18eb});var io=require(_0xed3e('0xb'))(new Redis(config[_0xed3e('0x8')]));function UserReport(_0x11858d){this[_0xed3e('0xc')]=_0x11858d[_0xed3e('0xc')];this[_0xed3e('0xd')]=_0x11858d[_0xed3e('0xd')];this[_0xed3e('0xe')]=_0x11858d[_0xed3e('0xe')];ami['on'](_0xed3e('0xf'),this[_0xed3e('0x10')][_0xed3e('0x11')](this));ami['on'](_0xed3e('0x12'),this[_0xed3e('0x10')][_0xed3e('0x11')](this));ami['on'](_0xed3e('0x13'),this[_0xed3e('0x14')]['bind'](this));ami['on'](_0xed3e('0x15'),this[_0xed3e('0x16')]['bind'](this));this[_0xed3e('0x17')]();return BPromise[_0xed3e('0x18')]()['then'](ami[_0xed3e('0x19')]())[_0xed3e('0x1a')](ami[_0xed3e('0x1b')]())['then'](ami[_0xed3e('0x1c')]())[_0xed3e('0x1d')](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0xedd8f1){return function(_0x344edb){logger[_0xed3e('0x1e')](_0xedd8f1,util[_0xed3e('0x1f')](_0x344edb,{'showHidden':![],'depth':null}));};}UserReport[_0xed3e('0x20')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0xed3e('0x1a')](ami[_0xed3e('0x19')]())['then'](ami[_0xed3e('0x1b')]())['then'](ami[_0xed3e('0x1c')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport[_0xed3e('0x20')][_0xed3e('0x21')]=function(_0x1d5d4b){return _0x1d5d4b!==null&&!_['isUndefined'](_0x1d5d4b);};UserReport[_0xed3e('0x20')][_0xed3e('0x22')]=function(_0x108092,_0x5ee222,_0x105496){io['to'](_0x108092)[_0xed3e('0x22')](_0x5ee222,_0x105496);};UserReport[_0xed3e('0x20')][_0xed3e('0x10')]=function(_0x59ac69){try{if(this[_0xed3e('0x21')](_0x59ac69)){var _0x1a08a2=_[_0xed3e('0x23')](this[_0xed3e('0xc')],{'registry':_0x59ac69['username']});if(_0x1a08a2){_0x59ac69['stateRegistry']=_0x59ac69[_0xed3e('0x24')];_['merge'](_0x1a08a2,_[_0xed3e('0x25')](_0x59ac69,[_0xed3e('0x26'),'actionid',_0xed3e('0x27'),_0xed3e('0x24')]));this[_0xed3e('0x22')](util[_0xed3e('0x28')]('trunk:%s',_0x1a08a2[_0xed3e('0x29')]),_0xed3e('0x2a'),_0x1a08a2);}}}catch(_0x1393a1){logger[_0xed3e('0x1e')](_0xed3e('0x2b'),util['inspect'](_0x1393a1,{'showHidden':![],'depth':null}));}};UserReport[_0xed3e('0x20')][_0xed3e('0x14')]=function(_0x5ed164){try{if(this['isNotNull'](_0x5ed164)){if(this[_0xed3e('0xd')][_0x5ed164[_0xed3e('0x2c')]]){if(!this['agents'][_0x5ed164[_0xed3e('0x2c')]][_0xed3e('0x2d')]||_0x5ed164[_0xed3e('0x24')][_0xed3e('0x2e')]()==_0xed3e('0x2f')){this[_0xed3e('0xd')][_0x5ed164[_0xed3e('0x2c')]]['local']=![];if(this[_0xed3e('0xd')][_0x5ed164[_0xed3e('0x2c')]]['state']!==_0x5ed164[_0xed3e('0x24')]['toLowerCase']()){this['agents'][_0x5ed164[_0xed3e('0x2c')]][_0xed3e('0x30')]=_[_0xed3e('0x31')](moment()[_0xed3e('0x28')]('x'));}this[_0xed3e('0xd')][_0x5ed164['device']][_0xed3e('0x24')]=_0x5ed164[_0xed3e('0x24')][_0xed3e('0x2e')]();this[_0xed3e('0xd')][_0x5ed164[_0xed3e('0x2c')]][_0xed3e('0x32')](_0x5ed164);}}else if(this[_0xed3e('0xe')][_0x5ed164[_0xed3e('0x2c')]]){if(this['telephones'][_0x5ed164['device']][_0xed3e('0x24')]!==_0x5ed164[_0xed3e('0x24')][_0xed3e('0x2e')]()){this['telephones'][_0x5ed164[_0xed3e('0x2c')]][_0xed3e('0x30')]=_[_0xed3e('0x31')](moment()['format']('x'));}this['telephones'][_0x5ed164['device']][_0xed3e('0x24')]=_0x5ed164[_0xed3e('0x24')][_0xed3e('0x2e')]();this['emit'](util[_0xed3e('0x28')](_0xed3e('0x33'),this[_0xed3e('0xe')][_0x5ed164['device']][_0xed3e('0x29')]),'telephone:save',this['telephones'][_0x5ed164[_0xed3e('0x2c')]]);}else if(this['trunks'][_0x5ed164['device']]){if(this[_0xed3e('0xc')][_0x5ed164[_0xed3e('0x2c')]][_0xed3e('0x24')]!==_0x5ed164[_0xed3e('0x24')][_0xed3e('0x2e')]()){this[_0xed3e('0xc')][_0x5ed164[_0xed3e('0x2c')]][_0xed3e('0x30')]=_['toNumber'](moment()[_0xed3e('0x28')]('x'));}this[_0xed3e('0xc')][_0x5ed164['device']]['state']=_0x5ed164[_0xed3e('0x24')]['toLowerCase']();this['emit'](util[_0xed3e('0x28')](_0xed3e('0x34'),this['trunks'][_0x5ed164[_0xed3e('0x2c')]][_0xed3e('0x29')]),_0xed3e('0x2a'),this['trunks'][_0x5ed164[_0xed3e('0x2c')]]);}else if(_[_0xed3e('0x35')](_0x5ed164[_0xed3e('0x2c')],_0xed3e('0x36'))){}else if(_[_0xed3e('0x35')](_0x5ed164[_0xed3e('0x2c')],'Local')){var _0x1cf6a8=_0x5ed164['device'];var _0x27a107=_0x1cf6a8['substring'](_0x1cf6a8[_0xed3e('0x37')]('/')+0x1,_0x1cf6a8[_0xed3e('0x37')]('@'));var _0x22953c=_[_0xed3e('0x23')](this['agents'],function(_0x311b0f){return _0x311b0f['mobile']==_0x27a107||_0x311b0f[_0xed3e('0x38')]==_0x27a107||_0x311b0f[_0xed3e('0x39')]==_0x27a107;});if(_0x22953c){if(_0x22953c[_0xed3e('0x24')]!==_0x5ed164[_0xed3e('0x24')][_0xed3e('0x2e')]()){_0x22953c[_0xed3e('0x30')]=_[_0xed3e('0x31')](moment()[_0xed3e('0x28')]('x'));}_0x22953c[_0xed3e('0x24')]=_0x5ed164['state'][_0xed3e('0x2e')]();_0x22953c['local']=!![];_0x22953c['updateStatusRealtime'](_0x5ed164);}}else{}}}catch(_0x11463e){logger[_0xed3e('0x1e')](_0xed3e('0x3a'),util[_0xed3e('0x1f')](_0x11463e,{'showHidden':![],'depth':null}));}};UserReport[_0xed3e('0x20')][_0xed3e('0x16')]=function(_0x478e06){try{if(this[_0xed3e('0x21')](_0x478e06)&&this[_0xed3e('0x21')](_0x478e06[_0xed3e('0x15')])){if(this['agents'][_0x478e06[_0xed3e('0x3b')]]){if(!this[_0xed3e('0xd')][_0x478e06['peer']]['local']||_0x478e06[_0xed3e('0x15')][_0xed3e('0x2e')]()==_0xed3e('0x3c')){this[_0xed3e('0xd')][_0x478e06[_0xed3e('0x3b')]][_0xed3e('0x2d')]=![];this['agents'][_0x478e06['peer']]['status']=_0x478e06['peerstatus'][_0xed3e('0x2e')]();this[_0xed3e('0xd')][_0x478e06[_0xed3e('0x3b')]][_0xed3e('0x3d')]=_0x478e06[_0xed3e('0x3d')];this[_0xed3e('0xd')][_0x478e06[_0xed3e('0x3b')]][_0xed3e('0x32')](_0x478e06);}}else if(this[_0xed3e('0xe')][_0x478e06['peer']]){this[_0xed3e('0xe')][_0x478e06['peer']][_0xed3e('0x3e')]=_0x478e06[_0xed3e('0x15')]['toLowerCase']();this[_0xed3e('0xe')][_0x478e06[_0xed3e('0x3b')]][_0xed3e('0x3d')]=_0x478e06[_0xed3e('0x3d')];this[_0xed3e('0x22')](util[_0xed3e('0x28')](_0xed3e('0x33'),this[_0xed3e('0xe')][_0x478e06[_0xed3e('0x3b')]][_0xed3e('0x29')]),_0xed3e('0x3f'),this[_0xed3e('0xe')][_0x478e06[_0xed3e('0x3b')]]);}else if(this[_0xed3e('0xc')][_0x478e06[_0xed3e('0x3b')]]){this['trunks'][_0x478e06[_0xed3e('0x3b')]][_0xed3e('0x3e')]=_0x478e06[_0xed3e('0x15')][_0xed3e('0x2e')]();this['trunks'][_0x478e06[_0xed3e('0x3b')]]['address']=_0x478e06['address'];this[_0xed3e('0x22')](util[_0xed3e('0x28')](_0xed3e('0x34'),this[_0xed3e('0xc')][_0x478e06[_0xed3e('0x3b')]][_0xed3e('0x29')]),_0xed3e('0x2a'),this[_0xed3e('0xc')][_0x478e06[_0xed3e('0x3b')]]);}else{}}}catch(_0x1cd94d){logger[_0xed3e('0x1e')](_0xed3e('0x40'),util[_0xed3e('0x1f')](_0x1cd94d,{'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 947c38e..a40d078 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 _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
+var _0xa3d6=['[syncAttendedTransfer][VoiceAgentReport]','syncBlindTransfer','transfereruniqueid','channel','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','prototype','emit','isUndefined','isNotNull','uniqueid','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','merge','event','privilege','custom:agentcalled','format','membername','user:called','error','hasOwnProperty','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','user:%s','custom:agentconnect','agentringnoanswerAt','lastevent','answered_elsewhere','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','inspect','reason','rejected','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','agentconnectAt','agentcompleteAt','complete','talktime','transfer','acw','agentacw','acwtime','acwTimeout','omit','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','diff','seconds','secondtransfereruniqueid'];(function(_0x38f358,_0x454d2b){var _0x88d447=function(_0x132ebb){while(--_0x132ebb){_0x38f358['push'](_0x38f358['shift']());}};_0x88d447(++_0x454d2b);}(_0xa3d6,0x7b));var _0x6a3d=function(_0x5c8d3b,_0x50e575){_0x5c8d3b=_0x5c8d3b-0x0;var _0xaccaf=_0xa3d6[_0x5c8d3b];return _0xaccaf;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x6a3d('0x0'));var Redis=require(_0x6a3d('0x1'));var config=require(_0x6a3d('0x2'));var logger=require('../../../config/logger')(_0x6a3d('0x3'));var ami=require(_0x6a3d('0x4'));config[_0x6a3d('0x5')]=_[_0x6a3d('0x6')](config['redis'],{'host':_0x6a3d('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6a3d('0x5')]));function VoiceAgentReport(_0x360a52){this[_0x6a3d('0x8')]={};this[_0x6a3d('0x9')]=_0x360a52['voiceQueues'];this[_0x6a3d('0xa')]=_0x360a52[_0x6a3d('0xa')];this[_0x6a3d('0xb')]={};ami['on'](_0x6a3d('0xc'),this[_0x6a3d('0xd')]['bind'](this));ami['on'](_0x6a3d('0xe'),this[_0x6a3d('0xf')][_0x6a3d('0x10')](this));ami['on'](_0x6a3d('0x11'),this[_0x6a3d('0x12')]['bind'](this));ami['on'](_0x6a3d('0x13'),this[_0x6a3d('0x14')][_0x6a3d('0x10')](this));ami['on'](_0x6a3d('0x15'),this[_0x6a3d('0x16')]['bind'](this));ami['on']('varset',this[_0x6a3d('0x17')][_0x6a3d('0x10')](this));ami['on']('hangup',this[_0x6a3d('0x18')]['bind'](this));ami['on']('musiconholdstart',this[_0x6a3d('0x19')][_0x6a3d('0x10')](this));ami['on'](_0x6a3d('0x1a'),this[_0x6a3d('0x1b')][_0x6a3d('0x10')](this));ami['on'](_0x6a3d('0x1c'),this[_0x6a3d('0x1d')]['bind'](this));ami['on'](_0x6a3d('0x1e'),this['syncBlindTransfer'][_0x6a3d('0x10')](this));}VoiceAgentReport[_0x6a3d('0x1f')]['emit']=function(_0x3ef8a3,_0x5bcc4c,_0x4bc245){io['to'](_0x3ef8a3)[_0x6a3d('0x20')](_0x5bcc4c,_0x4bc245);};VoiceAgentReport[_0x6a3d('0x1f')]['isNotNull']=function(_0x261d70){return _0x261d70!==null&&!_[_0x6a3d('0x21')](_0x261d70);};VoiceAgentReport[_0x6a3d('0x1f')][_0x6a3d('0xd')]=function(_0x34778b){try{if(this[_0x6a3d('0x22')](_0x34778b)){if(_[_0x6a3d('0x21')](this[_0x6a3d('0x8')][_0x34778b[_0x6a3d('0x23')]])){this[_0x6a3d('0x8')][_0x34778b[_0x6a3d('0x23')]]={};}if(_[_0x6a3d('0x21')](this[_0x6a3d('0x8')][_0x34778b[_0x6a3d('0x23')]][_0x34778b[_0x6a3d('0x24')]])){this[_0x6a3d('0x8')][_0x34778b['uniqueid']][_0x34778b[_0x6a3d('0x24')]]={'agentcalledAt':moment()['format'](_0x6a3d('0x25')),'lastevent':_0x6a3d('0x26'),'variables':this['variables'][_0x34778b['uniqueid']],'type':this[_0x6a3d('0x9')][_0x34778b[_0x6a3d('0x27')]]?this[_0x6a3d('0x9')][_0x34778b[_0x6a3d('0x27')]][_0x6a3d('0x28')]||'inbound':'inbound'};}_[_0x6a3d('0x29')](this[_0x6a3d('0x8')][_0x34778b['uniqueid']][_0x34778b[_0x6a3d('0x24')]],_['omit'](_0x34778b,[_0x6a3d('0x2a'),_0x6a3d('0x2b')]));ami[_0x6a3d('0x20')](_0x6a3d('0x2c'),this[_0x6a3d('0x8')][_0x34778b[_0x6a3d('0x23')]][_0x34778b[_0x6a3d('0x24')]]);this[_0x6a3d('0x20')](util[_0x6a3d('0x2d')]('user:%s',_0x34778b[_0x6a3d('0x2e')]),_0x6a3d('0x2f'),this[_0x6a3d('0x8')][_0x34778b[_0x6a3d('0x23')]][_0x34778b[_0x6a3d('0x24')]]);}}catch(_0x33ea5e){logger[_0x6a3d('0x30')]('[syncAgentCalled][VoiceAgentReport]',util['inspect'](_0x33ea5e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6a3d('0xf')]=function(_0x2687e2){try{if(this[_0x6a3d('0x22')](_0x2687e2)){if(this[_0x6a3d('0x8')][_0x2687e2[_0x6a3d('0x23')]]){for(var _0xc079bf in this[_0x6a3d('0x8')][_0x2687e2[_0x6a3d('0x23')]]){if(this[_0x6a3d('0x8')][_0x2687e2[_0x6a3d('0x23')]][_0x6a3d('0x31')](_0xc079bf)){if(_0x2687e2[_0x6a3d('0x24')]===_0xc079bf){this[_0x6a3d('0x8')][_0x2687e2[_0x6a3d('0x23')]][_0xc079bf]['agentconnectAt']=moment()['format'](_0x6a3d('0x25'));this['channels'][_0x2687e2['uniqueid']][_0xc079bf]['lastevent']=_0x6a3d('0x32');this[_0x6a3d('0x8')][_0x2687e2['uniqueid']][_0xc079bf]['holdtime']=_0x2687e2[_0x6a3d('0x33')];this[_0x6a3d('0x8')][_0x2687e2[_0x6a3d('0x23')]][_0xc079bf]['connectedlinenum']=_0x2687e2[_0x6a3d('0x34')];this[_0x6a3d('0x8')][_0x2687e2[_0x6a3d('0x23')]][_0xc079bf][_0x6a3d('0x35')]=_0x2687e2[_0x6a3d('0x35')];this['channels'][_0x2687e2[_0x6a3d('0x23')]][_0xc079bf][_0x6a3d('0x36')]=_0x2687e2['destchannelstate'];this[_0x6a3d('0x8')][_0x2687e2[_0x6a3d('0x23')]][_0xc079bf][_0x6a3d('0x37')]=_0x2687e2[_0x6a3d('0x37')];_[_0x6a3d('0x29')](this[_0x6a3d('0xa')][_0x2687e2[_0x6a3d('0x38')]],_[_0x6a3d('0x39')](_0x2687e2,[_0x6a3d('0x27'),_0x6a3d('0x3a')]));this[_0x6a3d('0x20')](util[_0x6a3d('0x2d')](_0x6a3d('0x3b'),_0x2687e2[_0x6a3d('0x2e')]),'user:agentconnect',this['channels'][_0x2687e2[_0x6a3d('0x23')]][_0x2687e2[_0x6a3d('0x24')]]);ami[_0x6a3d('0x20')](_0x6a3d('0x3c'),this['channels'][_0x2687e2[_0x6a3d('0x23')]][_0xc079bf]);}else if(!this[_0x6a3d('0x8')][_0x2687e2['uniqueid']][_0xc079bf][_0x6a3d('0x11')]&&!this[_0x6a3d('0x8')][_0x2687e2[_0x6a3d('0x23')]][_0xc079bf][_0x6a3d('0x15')]){this['channels'][_0x2687e2[_0x6a3d('0x23')]][_0xc079bf]['agentringnoanswer']=!![];this['channels'][_0x2687e2[_0x6a3d('0x23')]][_0xc079bf][_0x6a3d('0x3d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x6a3d('0x8')][_0x2687e2['uniqueid']][_0xc079bf]['reason']='answered_elsewhere';this[_0x6a3d('0x8')][_0x2687e2['uniqueid']][_0xc079bf][_0x6a3d('0x3e')]=_0x6a3d('0x3f');this[_0x6a3d('0x8')][_0x2687e2[_0x6a3d('0x23')]][_0xc079bf][_0x6a3d('0x40')]=_0x2687e2[_0x6a3d('0x24')];this[_0x6a3d('0x8')][_0x2687e2[_0x6a3d('0x23')]][_0xc079bf]['answeredelsewheremembername']=_0x2687e2['membername'];ami[_0x6a3d('0x20')](_0x6a3d('0x41'),this[_0x6a3d('0x8')][_0x2687e2[_0x6a3d('0x23')]][_0xc079bf]);}}}}}}catch(_0x3a336c){logger[_0x6a3d('0x30')](_0x6a3d('0x42'),util[_0x6a3d('0x43')](_0x3a336c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a3d('0x1f')][_0x6a3d('0x12')]=function(_0x268c20){try{if(this[_0x6a3d('0x22')](_0x268c20)){if(this[_0x6a3d('0x8')][_0x268c20['uniqueid']]&&this['channels'][_0x268c20[_0x6a3d('0x23')]][_0x268c20[_0x6a3d('0x24')]]){this[_0x6a3d('0x8')][_0x268c20[_0x6a3d('0x23')]][_0x268c20[_0x6a3d('0x24')]]['agentringnoanswer']=!![];this['channels'][_0x268c20[_0x6a3d('0x23')]][_0x268c20[_0x6a3d('0x24')]][_0x6a3d('0x3d')]=moment()[_0x6a3d('0x2d')](_0x6a3d('0x25'));this[_0x6a3d('0x8')][_0x268c20[_0x6a3d('0x23')]][_0x268c20[_0x6a3d('0x24')]][_0x6a3d('0x44')]=_0x6a3d('0x45');this[_0x6a3d('0x8')][_0x268c20[_0x6a3d('0x23')]][_0x268c20[_0x6a3d('0x24')]][_0x6a3d('0x3e')]='rejected';ami[_0x6a3d('0x20')]('custom:agentringnoanswer',this[_0x6a3d('0x8')][_0x268c20['uniqueid']][_0x268c20[_0x6a3d('0x24')]]);}}}catch(_0x18da2e){logger[_0x6a3d('0x30')](_0x6a3d('0x46'),util['inspect'](_0x18da2e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a3d('0x1f')][_0x6a3d('0x14')]=function(_0x44be01){try{if(this[_0x6a3d('0x22')](_0x44be01)){if(this[_0x6a3d('0x8')][_0x44be01[_0x6a3d('0x23')]]){for(var _0x39443c in this['channels'][_0x44be01['uniqueid']]){if(this['channels'][_0x44be01[_0x6a3d('0x23')]][_0x6a3d('0x31')](_0x39443c)&&!this['channels'][_0x44be01[_0x6a3d('0x23')]][_0x39443c][_0x6a3d('0x11')]&&!this[_0x6a3d('0x8')][_0x44be01['uniqueid']][_0x39443c][_0x6a3d('0x15')]){this[_0x6a3d('0x8')][_0x44be01['uniqueid']][_0x39443c]['agentringnoanswer']=!![];this[_0x6a3d('0x8')][_0x44be01[_0x6a3d('0x23')]][_0x39443c][_0x6a3d('0x3d')]=moment()[_0x6a3d('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6a3d('0x8')][_0x44be01[_0x6a3d('0x23')]][_0x39443c][_0x6a3d('0x44')]=_0x6a3d('0x47');this[_0x6a3d('0x8')][_0x44be01['uniqueid']][_0x39443c][_0x6a3d('0x3e')]=_0x6a3d('0x47');ami['emit'](_0x6a3d('0x48'),this[_0x6a3d('0x8')][_0x44be01['uniqueid']][_0x39443c]);}}}}}catch(_0xa8dd8f){logger[_0x6a3d('0x30')]('[syncQueueCallerAbandon][VoiceAgentReport]',util['inspect'](_0xa8dd8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a3d('0x1f')][_0x6a3d('0x16')]=function(_0x340c8d){try{if(this['isNotNull'](_0x340c8d)){if(this[_0x6a3d('0x8')][_0x340c8d[_0x6a3d('0x23')]]){for(var _0x4c4de1 in this['channels'][_0x340c8d[_0x6a3d('0x23')]]){if(this[_0x6a3d('0x8')][_0x340c8d[_0x6a3d('0x23')]]['hasOwnProperty'](_0x4c4de1)){if(this[_0x6a3d('0x8')][_0x340c8d[_0x6a3d('0x23')]][_0x4c4de1][_0x6a3d('0x49')]&&!this[_0x6a3d('0x8')][_0x340c8d['uniqueid']][_0x4c4de1][_0x6a3d('0x15')]){this[_0x6a3d('0x8')][_0x340c8d[_0x6a3d('0x23')]][_0x4c4de1][_0x6a3d('0x15')]=!![];this[_0x6a3d('0x8')][_0x340c8d[_0x6a3d('0x23')]][_0x4c4de1][_0x6a3d('0x4a')]=moment()[_0x6a3d('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6a3d('0x8')][_0x340c8d[_0x6a3d('0x23')]][_0x4c4de1][_0x6a3d('0x3e')]=_0x6a3d('0x4b');this['channels'][_0x340c8d[_0x6a3d('0x23')]][_0x4c4de1][_0x6a3d('0x4c')]=_0x340c8d['talktime'];this[_0x6a3d('0x8')][_0x340c8d['uniqueid']][_0x4c4de1][_0x6a3d('0x44')]=_0x340c8d[_0x6a3d('0x44')]==_0x6a3d('0x4d')?'agent':_0x340c8d[_0x6a3d('0x44')];if(this['voiceQueues'][_0x340c8d[_0x6a3d('0x27')]]&&this[_0x6a3d('0x9')][_0x340c8d[_0x6a3d('0x27')]][_0x6a3d('0x4e')]){this[_0x6a3d('0x8')][_0x340c8d[_0x6a3d('0x23')]][_0x4c4de1][_0x6a3d('0x4f')]=!![];this[_0x6a3d('0x8')][_0x340c8d[_0x6a3d('0x23')]][_0x4c4de1][_0x6a3d('0x50')]=this[_0x6a3d('0x9')][_0x340c8d[_0x6a3d('0x27')]][_0x6a3d('0x51')];}this[_0x6a3d('0xa')][_0x340c8d[_0x6a3d('0x38')]]=_[_0x6a3d('0x52')](this[_0x6a3d('0xa')][_0x340c8d[_0x6a3d('0x38')]],[_0x6a3d('0x27'),'destconnectedlinenum']);this[_0x6a3d('0x20')](util['format'](_0x6a3d('0x3b'),_0x340c8d[_0x6a3d('0x2e')]),_0x6a3d('0x53'),this[_0x6a3d('0x8')][_0x340c8d[_0x6a3d('0x23')]][_0x4c4de1]);ami[_0x6a3d('0x20')](_0x6a3d('0x54'),this['channels'][_0x340c8d[_0x6a3d('0x23')]][_0x4c4de1]);}}}}}}catch(_0x506d47){logger[_0x6a3d('0x30')](_0x6a3d('0x55'),util[_0x6a3d('0x43')](_0x506d47,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a3d('0x1f')]['syncVarSet']=function(_0x29d2ea){try{if(this[_0x6a3d('0x22')](_0x29d2ea)){this[_0x6a3d('0x56')](_0x29d2ea[_0x6a3d('0x23')],_[_0x6a3d('0x57')](_0x29d2ea[_0x6a3d('0x58')])[0x0],_0x29d2ea[_0x6a3d('0x59')]);if(this[_0x6a3d('0x8')][_0x29d2ea[_0x6a3d('0x23')]]){for(var _0x57b6a6 in this[_0x6a3d('0x8')][_0x29d2ea[_0x6a3d('0x23')]]){if(this[_0x6a3d('0x8')][_0x29d2ea[_0x6a3d('0x23')]][_0x6a3d('0x31')](_0x57b6a6)){if(_[_0x6a3d('0x21')](this[_0x6a3d('0x8')][_0x29d2ea[_0x6a3d('0x23')]][_0x57b6a6][_0x6a3d('0xb')])){this[_0x6a3d('0x8')][_0x29d2ea[_0x6a3d('0x23')]][_0x57b6a6][_0x6a3d('0xb')]={};}this[_0x6a3d('0x8')][_0x29d2ea[_0x6a3d('0x23')]][_0x57b6a6][_0x6a3d('0xb')]=this[_0x6a3d('0xb')][_0x29d2ea['uniqueid']];}}}}}catch(_0x1f1079){logger[_0x6a3d('0x30')]('[syncVarSet][VoiceAgentReport]',util[_0x6a3d('0x43')](_0x1f1079,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a3d('0x1f')][_0x6a3d('0x56')]=function(_0x193f0f,_0x25ae57,_0x18609f){var _0x2c9167=[_0x6a3d('0x5a'),'rtpaudioqosbridged',_0x6a3d('0x5b'),_0x6a3d('0x5c'),_0x6a3d('0x5d'),'rtpaudioqoslossbridged',_0x6a3d('0x5e'),_0x6a3d('0x5f'),_0x6a3d('0x60'),'sipuri',_0x6a3d('0x61'),'bridgepvtcallid',_0x6a3d('0x62'),_0x6a3d('0x63'),_0x6a3d('0x64'),_0x6a3d('0x65'),'membername',_0x6a3d('0x66'),'memberrealtime'];if(!_['isNil'](_0x25ae57)&&!_['includes'](_0x2c9167,_0x25ae57)){if(_[_0x6a3d('0x21')](this[_0x6a3d('0xb')][_0x193f0f])){this['variables'][_0x193f0f]={};}this['variables'][_0x193f0f][_0x25ae57]=_0x18609f;}};VoiceAgentReport[_0x6a3d('0x1f')][_0x6a3d('0x18')]=function(_0x585999){try{if(this[_0x6a3d('0x22')](_0x585999)){if(this[_0x6a3d('0x8')][_0x585999[_0x6a3d('0x23')]]){for(var _0x1d0aae in this[_0x6a3d('0x8')][_0x585999[_0x6a3d('0x23')]]){if(this[_0x6a3d('0x8')][_0x585999[_0x6a3d('0x23')]]['hasOwnProperty'](_0x1d0aae)){if(this[_0x6a3d('0x8')][_0x585999['uniqueid']][_0x1d0aae][_0x6a3d('0x44')]==_0x6a3d('0x4d')&&this[_0x6a3d('0x8')][_0x585999[_0x6a3d('0x23')]][_0x1d0aae][_0x6a3d('0x15')]){this[_0x6a3d('0x8')][_0x585999[_0x6a3d('0x23')]][_0x1d0aae]['agentcompleteAt']=moment()[_0x6a3d('0x2d')](_0x6a3d('0x25'));}}}ami[_0x6a3d('0x20')]('custom:voiceAgentReport',_[_0x6a3d('0x67')](this[_0x6a3d('0x8')][_0x585999['uniqueid']]));delete this[_0x6a3d('0x8')][_0x585999['uniqueid']];}if(this[_0x6a3d('0xb')][_0x585999[_0x6a3d('0x23')]]){delete this[_0x6a3d('0xb')][_0x585999[_0x6a3d('0x23')]];}}}catch(_0x4f3bdb){logger[_0x6a3d('0x30')](_0x6a3d('0x68'),util['inspect'](_0x4f3bdb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a3d('0x1f')][_0x6a3d('0x1d')]=function(_0x5842a3){try{if(this[_0x6a3d('0x22')](_0x5842a3)){if(this['channels'][_0x5842a3['transfereeuniqueid']]){for(var _0x254ac1 in this[_0x6a3d('0x8')][_0x5842a3['transfereeuniqueid']]){if(this[_0x6a3d('0x8')][_0x5842a3['transfereeuniqueid']][_0x6a3d('0x31')](_0x254ac1)){if(_0x5842a3['origtransfereruniqueid']===_0x254ac1){var _0x599183=moment();this[_0x6a3d('0x8')][_0x5842a3[_0x6a3d('0x69')]][_0x254ac1][_0x6a3d('0x15')]=!![];this[_0x6a3d('0x8')][_0x5842a3['transfereeuniqueid']][_0x254ac1][_0x6a3d('0x4a')]=moment()[_0x6a3d('0x2d')](_0x6a3d('0x25'));this[_0x6a3d('0x8')][_0x5842a3[_0x6a3d('0x69')]][_0x254ac1]['reason']=_0x6a3d('0x4d');this[_0x6a3d('0x8')][_0x5842a3[_0x6a3d('0x69')]][_0x254ac1][_0x6a3d('0x3e')]=_0x6a3d('0x4b');this[_0x6a3d('0x8')][_0x5842a3[_0x6a3d('0x69')]][_0x254ac1]['talktime']=_0x599183[_0x6a3d('0x6a')](this[_0x6a3d('0x8')][_0x5842a3[_0x6a3d('0x69')]][_0x254ac1]['agentconnectAt'],_0x6a3d('0x6b'));}}}}if(this[_0x6a3d('0x8')][_0x5842a3[_0x6a3d('0x6c')]]){var _0x3a38bc=this[_0x6a3d('0x8')][_0x5842a3[_0x6a3d('0x6c')]];this['channels'][_0x5842a3[_0x6a3d('0x6c')]]=this['channels'][_0x5842a3[_0x6a3d('0x69')]];this[_0x6a3d('0x8')][_0x5842a3[_0x6a3d('0x69')]]=_0x3a38bc;}}}catch(_0x340233){logger[_0x6a3d('0x30')](_0x6a3d('0x6d'),util[_0x6a3d('0x43')](_0x340233,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a3d('0x1f')][_0x6a3d('0x6e')]=function(_0x37c5f8){try{if(this[_0x6a3d('0x22')](_0x37c5f8)){if(this[_0x6a3d('0x8')][_0x37c5f8[_0x6a3d('0x69')]]){for(var _0x1ef256 in this[_0x6a3d('0x8')][_0x37c5f8[_0x6a3d('0x69')]]){if(this[_0x6a3d('0x8')][_0x37c5f8[_0x6a3d('0x69')]][_0x6a3d('0x31')](_0x1ef256)){if(_0x37c5f8[_0x6a3d('0x6f')]===_0x1ef256){var _0x11af9e=moment();this['channels'][_0x37c5f8[_0x6a3d('0x69')]][_0x1ef256][_0x6a3d('0x15')]=!![];this['channels'][_0x37c5f8[_0x6a3d('0x69')]][_0x1ef256][_0x6a3d('0x4a')]=_0x11af9e;this['channels'][_0x37c5f8[_0x6a3d('0x69')]][_0x1ef256][_0x6a3d('0x44')]=_0x6a3d('0x4d');this['channels'][_0x37c5f8['transfereeuniqueid']][_0x1ef256][_0x6a3d('0x3e')]=_0x6a3d('0x4b');this[_0x6a3d('0x8')][_0x37c5f8[_0x6a3d('0x69')]][_0x1ef256]['talktime']=_0x11af9e[_0x6a3d('0x6a')](this[_0x6a3d('0x8')][_0x37c5f8[_0x6a3d('0x69')]][_0x1ef256]['agentconnectAt'],'seconds');}}}}}}catch(_0x8be740){logger[_0x6a3d('0x30')]('[syncBlindTransfer][VoiceAgentReport]',util[_0x6a3d('0x43')](_0x8be740,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a3d('0x1f')][_0x6a3d('0x19')]=function(_0x1c84a6){var _0x168214='';try{if(this[_0x6a3d('0x22')](_0x1c84a6)){if(_0x1c84a6[_0x6a3d('0x70')]){_0x168214=_0x1c84a6[_0x6a3d('0x70')]['substring'](0x0,_0x1c84a6[_0x6a3d('0x70')][_0x6a3d('0x71')]('-'));if(this[_0x6a3d('0xa')][_0x168214]){this[_0x6a3d('0xa')][_0x168214][_0x6a3d('0x72')]=!![];}}}}catch(_0x51ce4a){logger[_0x6a3d('0x30')](_0x6a3d('0x73'),util['inspect'](_0x51ce4a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a3d('0x1f')][_0x6a3d('0x1b')]=function(_0x378e45){var _0x3f6d33='';try{if(this[_0x6a3d('0x22')](_0x378e45)){if(_0x378e45['channel']){_0x3f6d33=_0x378e45[_0x6a3d('0x70')]['substring'](0x0,_0x378e45[_0x6a3d('0x70')][_0x6a3d('0x71')]('-'));if(this[_0x6a3d('0xa')][_0x3f6d33]){this[_0x6a3d('0xa')][_0x3f6d33][_0x6a3d('0x72')]=![];}}}}catch(_0x2afb66){logger[_0x6a3d('0x30')]('[syncMusicOnHoldStop][VoiceAgentReport]',util[_0x6a3d('0x43')](_0x2afb66,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js
index 7840db6..6765a20 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 _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
+var _0x8958=['mohstarttime','[syncMusicOnHoldStop][VoiceCallReport]','exports','lodash','../../../config/environment','ami','../ami','../model/channel','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','socket.io-emitter','channels','agents','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','resolve','then','actionCoreShowChannels','catch','log','prototype','isNotNull','emit','uniqueid','linkedid','isUndefined','pick','keys','[syncNewCallerId][VoiceCallReport]','channel','OutgoingSpoolFailed','format','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','from-sip','split','exten','name','user:agentconnect','accountcode','error','inspect','appdata','applicationdata','starttime','duration','seconds','merge','includes','application','startsWith','cdr(','[syncNewExten][VoiceCallReport]','answered','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','calleridname','destinationchannel','toNumber','UserId','membername','syncMixMonitorFilename','monitor','.wav49','replace','.WAV','find','monitors','isNil','variable','mixmonitor_filename','xmd-callerid','callerid','value','xmd-cdrtype','type','xmd-queue','originatecalleridnum','destination','calleridpreview','xmcs-queue','sipcalluniqueid','sipcallid','syncHangup','endtime','answertime','billableseconds','context','omit','user:%s','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransferercalleridnum','transfertargetcalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','syncBlindTransfer','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohtime','milliseconds'];(function(_0x43ec25,_0x22baa9){var _0x23fe70=function(_0x171e6a){while(--_0x171e6a){_0x43ec25['push'](_0x43ec25['shift']());}};_0x23fe70(++_0x22baa9);}(_0x8958,0x93));var _0x8895=function(_0x21a60e,_0x57a2eb){_0x21a60e=_0x21a60e-0x0;var _0x4ad1f3=_0x8958[_0x21a60e];return _0x4ad1f3;};'use strict';var BPromise=require('bluebird');var _=require(_0x8895('0x0'));var moment=require('moment');var util=require('util');var path=require('path');var Redis=require('ioredis');var config=require(_0x8895('0x1'));var logger=require('../../../config/logger')(_0x8895('0x2'));var ami=require(_0x8895('0x3'));var Channel=require(_0x8895('0x4'));var statusDesc=['unknown',_0x8895('0x5'),_0x8895('0x6'),_0x8895('0x7'),_0x8895('0x8'),_0x8895('0x9'),'ringing',_0x8895('0xa'),_0x8895('0xb')];var applications=[_0x8895('0xc'),_0x8895('0xd'),_0x8895('0xe'),_0x8895('0xf'),_0x8895('0x10'),_0x8895('0x11')];var dispositions=[_0x8895('0x12'),_0x8895('0x13'),'FAILED',_0x8895('0x12'),_0x8895('0x12'),_0x8895('0x12'),_0x8895('0x14'),_0x8895('0x15'),_0x8895('0x13'),'FAILED',_0x8895('0x13')];var actions={};config[_0x8895('0x16')]=_[_0x8895('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8895('0x18'))(new Redis(config['redis']));function VoiceCallReport(_0x4156f5){this[_0x8895('0x19')]=_0x4156f5[_0x8895('0x19')];this[_0x8895('0x1a')]=_0x4156f5[_0x8895('0x1a')];ami['on']('coreshowchannel',this[_0x8895('0x1b')][_0x8895('0x1c')](this));ami['on'](_0x8895('0x1d'),this[_0x8895('0x1b')][_0x8895('0x1c')](this));ami['on'](_0x8895('0x1e'),this[_0x8895('0x1f')][_0x8895('0x1c')](this));ami['on'](_0x8895('0x20'),this[_0x8895('0x21')][_0x8895('0x1c')](this));ami['on'](_0x8895('0x22'),this[_0x8895('0x23')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0x8895('0x1c')](this));ami['on'](_0x8895('0x24'),this[_0x8895('0x25')][_0x8895('0x1c')](this));ami['on'](_0x8895('0x26'),this[_0x8895('0x27')][_0x8895('0x1c')](this));ami['on'](_0x8895('0x28'),this['syncBlindTransfer'][_0x8895('0x1c')](this));ami['on'](_0x8895('0x29'),this[_0x8895('0x2a')][_0x8895('0x1c')](this));ami['on'](_0x8895('0x2b'),this['syncMusicOnHoldStop']['bind'](this));return BPromise[_0x8895('0x2c')]()[_0x8895('0x2d')](ami[_0x8895('0x2e')]())[_0x8895('0x2f')](function(_0x4fc150){console[_0x8895('0x30')](_0x4fc150);});}VoiceCallReport[_0x8895('0x31')][_0x8895('0x32')]=function(_0x5486a6){return _0x5486a6!==null&&!_['isUndefined'](_0x5486a6);};VoiceCallReport[_0x8895('0x31')]['emit']=function(_0x3d51b0,_0x3e3b48,_0x10b48f){io['to'](_0x3d51b0)[_0x8895('0x33')](_0x3e3b48,_0x10b48f);};VoiceCallReport[_0x8895('0x31')]['syncNewCallerId']=function(_0x4d567a){try{if(this[_0x8895('0x32')](_0x4d567a)){if(_0x4d567a[_0x8895('0x34')]===_0x4d567a[_0x8895('0x35')]){if(!_[_0x8895('0x36')](this[_0x8895('0x19')][_0x4d567a['uniqueid']])){_['merge'](this[_0x8895('0x19')][_0x4d567a[_0x8895('0x34')]],_[_0x8895('0x37')](_0x4d567a,_[_0x8895('0x38')](this[_0x8895('0x19')][_0x4d567a['uniqueid']])));}}}}catch(_0x1da939){logger['error'](_0x8895('0x39'),util['inspect'](_0x1da939,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8895('0x31')][_0x8895('0x1f')]=function(_0x233473){try{if(this[_0x8895('0x32')](_0x233473)){if(_0x233473[_0x8895('0x34')]===_0x233473['linkedid']&&_0x233473[_0x8895('0x3a')]!=_0x8895('0x3b')){if(_[_0x8895('0x36')](this[_0x8895('0x19')][_0x233473[_0x8895('0x34')]])){this['channels'][_0x233473[_0x8895('0x34')]]=new Channel();this['channels'][_0x233473[_0x8895('0x34')]]['starttime']=moment()[_0x8895('0x3c')](_0x8895('0x3d'));this[_0x8895('0x19')][_0x233473[_0x8895('0x34')]][_0x8895('0x3e')]=dispositions[_['toNumber'](_0x233473[_0x8895('0x3f')])];_['merge'](this[_0x8895('0x19')][_0x233473[_0x8895('0x34')]],_[_0x8895('0x37')](_0x233473,_[_0x8895('0x38')](this[_0x8895('0x19')][_0x233473[_0x8895('0x34')]])));if(_0x233473['context']===_0x8895('0x40')){if(this[_0x8895('0x1a')][_0x233473['channel'][_0x8895('0x41')]('-')[0x0]]){this['agents'][_0x233473[_0x8895('0x3a')][_0x8895('0x41')]('-')[0x0]]['destconnectedlinenum']=_0x233473[_0x8895('0x42')];this[_0x8895('0x33')](util['format']('user:%s',this[_0x8895('0x1a')][_0x233473[_0x8895('0x3a')][_0x8895('0x41')]('-')[0x0]][_0x8895('0x43')]),_0x8895('0x44'),{'destaccountcode':this['agents'][_0x233473[_0x8895('0x3a')][_0x8895('0x41')]('-')[0x0]][_0x8895('0x45')],'destconnectedlinenum':_0x233473[_0x8895('0x42')]});}}}}}}catch(_0x1d9e26){logger[_0x8895('0x46')]('[syncNewChannel][VoiceCallReport]',util[_0x8895('0x47')](_0x1d9e26,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x8895('0x1b')]=function(_0x6eec55){try{if(this['isNotNull'](_0x6eec55)){if(_0x6eec55[_0x8895('0x34')]===_0x6eec55['linkedid']&&_0x6eec55[_0x8895('0x42')]!='h'&&_0x6eec55['channel']!='OutgoingSpoolFailed'){_0x6eec55['application']=_0x6eec55['application']['toLowerCase']();_0x6eec55['applicationdata']=(_0x6eec55[_0x8895('0x48')]||_0x6eec55[_0x8895('0x49')])['toLowerCase']();if(_['isUndefined'](this[_0x8895('0x19')][_0x6eec55[_0x8895('0x34')]])){this['channels'][_0x6eec55[_0x8895('0x34')]]=new Channel();this[_0x8895('0x19')][_0x6eec55[_0x8895('0x34')]][_0x8895('0x4a')]=_0x6eec55[_0x8895('0x4b')]?moment()['subtract'](moment['duration'](_0x6eec55['duration'])[_0x8895('0x4c')](),'seconds')[_0x8895('0x3c')](_0x8895('0x3d')):moment()[_0x8895('0x3c')](_0x8895('0x3d'));this['channels'][_0x6eec55[_0x8895('0x34')]][_0x8895('0x3e')]=_0x8895('0x12');}_[_0x8895('0x4d')](this[_0x8895('0x19')][_0x6eec55[_0x8895('0x34')]],_[_0x8895('0x37')](_0x6eec55,_[_0x8895('0x38')](this['channels'][_0x6eec55[_0x8895('0x34')]])));if(_[_0x8895('0x4e')](applications,_0x6eec55['application'])){this[_0x8895('0x19')][_0x6eec55['uniqueid']]['lastapplication']=_0x6eec55[_0x8895('0x4f')];this[_0x8895('0x19')][_0x6eec55[_0x8895('0x34')]]['lastdata']=_0x6eec55[_0x8895('0x49')];if(_0x6eec55['application']===_0x8895('0xc')&&_[_0x8895('0x50')](_0x6eec55[_0x8895('0x49')],_0x8895('0x51'))){var _0x2f3bf1=_0x6eec55[_0x8895('0x49')][_0x8895('0x41')]('=');var _0x4dde7c=_0x2f3bf1[0x0]['match'](/cdr\((.*)\)/);if(_0x4dde7c){this[_0x8895('0x19')][_0x6eec55[_0x8895('0x34')]][_0x4dde7c[0x1]]=_0x2f3bf1[0x1];}}else if(_0x6eec55['application']===_0x8895('0xd')){this['channels'][_0x6eec55['uniqueid']][_0x8895('0xd')]=_0x6eec55['applicationdata'][_0x8895('0x41')](',')[0x0];}}}}}catch(_0x2c2979){logger[_0x8895('0x46')](_0x8895('0x52'),util[_0x8895('0x47')](_0x2c2979,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8895('0x31')][_0x8895('0x21')]=function(_0x38d6ae){try{if(this['isNotNull'](_0x38d6ae)){if(_0x38d6ae[_0x8895('0x34')]!==_0x38d6ae[_0x8895('0x35')]){if(this[_0x8895('0x19')][_0x38d6ae['linkedid']]){if(_0x38d6ae[_0x8895('0x3f')]==='6'){if(!this[_0x8895('0x19')][_0x38d6ae[_0x8895('0x35')]][_0x8895('0x53')]){var _0x1e264a=moment();this[_0x8895('0x19')][_0x38d6ae[_0x8895('0x35')]][_0x8895('0x53')]=!![];this[_0x8895('0x19')][_0x38d6ae[_0x8895('0x35')]]['answertime']=_0x1e264a[_0x8895('0x3c')](_0x8895('0x3d'));if(this[_0x8895('0x19')][_0x38d6ae[_0x8895('0x35')]][_0x8895('0x4a')]){this['channels'][_0x38d6ae[_0x8895('0x35')]][_0x8895('0x54')]=_0x1e264a[_0x8895('0x55')](this[_0x8895('0x19')][_0x38d6ae[_0x8895('0x35')]]['starttime'],_0x8895('0x4c'));}}this[_0x8895('0x19')][_0x38d6ae[_0x8895('0x35')]]['linkedid']=_0x38d6ae[_0x8895('0x34')];if(_0x38d6ae[_0x8895('0x56')]!==_0x8895('0x57')){this['channels'][_0x38d6ae[_0x8895('0x35')]][_0x8895('0x58')]=_0x38d6ae['calleridnum'];}this[_0x8895('0x19')][_0x38d6ae[_0x8895('0x35')]]['connectedlinename']=_0x38d6ae[_0x8895('0x59')];this[_0x8895('0x19')][_0x38d6ae[_0x8895('0x35')]][_0x8895('0x5a')]=_0x38d6ae['channel'];this['channels'][_0x38d6ae[_0x8895('0x35')]][_0x8895('0x3e')]=dispositions[_[_0x8895('0x5b')](_0x38d6ae['channelstate'])];if(this[_0x8895('0x1a')][_0x38d6ae[_0x8895('0x3a')]['split']('-')[0x0]]){this[_0x8895('0x19')][_0x38d6ae['linkedid']][_0x8895('0x5c')]=this[_0x8895('0x1a')][_0x38d6ae[_0x8895('0x3a')][_0x8895('0x41')]('-')[0x0]]['id'];this[_0x8895('0x19')][_0x38d6ae['linkedid']]['membername']=this[_0x8895('0x1a')][_0x38d6ae[_0x8895('0x3a')]['split']('-')[0x0]][_0x8895('0x43')];}}}}else{if(this[_0x8895('0x19')][_0x38d6ae[_0x8895('0x34')]]){if(_0x38d6ae[_0x8895('0x3f')]==='6'){if(this['agents'][_0x38d6ae[_0x8895('0x3a')][_0x8895('0x41')]('-')[0x0]]){this[_0x8895('0x19')][_0x38d6ae[_0x8895('0x34')]][_0x8895('0x5c')]=this[_0x8895('0x1a')][_0x38d6ae[_0x8895('0x3a')][_0x8895('0x41')]('-')[0x0]]['id'];this[_0x8895('0x19')][_0x38d6ae[_0x8895('0x34')]][_0x8895('0x5d')]=this[_0x8895('0x1a')][_0x38d6ae[_0x8895('0x3a')][_0x8895('0x41')]('-')[0x0]][_0x8895('0x43')];}}}}}}catch(_0x534c7d){logger['error']('[syncNewState][VoiceCallReport]',util[_0x8895('0x47')](_0x534c7d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8895('0x31')][_0x8895('0x5e')]=function(_0x38f960,_0x148951){if(this['channels'][_0x38f960]){this[_0x8895('0x19')][_0x38f960][_0x8895('0x5f')]=!![];if(_['endsWith'](_0x148951,_0x8895('0x60'))){_0x148951=_0x148951[_0x8895('0x61')](_0x8895('0x60'),_0x8895('0x62'));}this[_0x8895('0x19')][_0x38f960]['monitorFilename']=_0x148951;var _0x6440ea=_[_0x8895('0x63')](this[_0x8895('0x19')][_0x38f960][_0x8895('0x64')],{'filename':_0x148951});if(_[_0x8895('0x65')](_0x6440ea)){this[_0x8895('0x19')][_0x38f960][_0x8895('0x64')]['push']({'filename':_0x148951,'createdAt':moment()[_0x8895('0x3c')](_0x8895('0x3d')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0x8895('0x31')][_0x8895('0x23')]=function(_0x46efed){try{if(this[_0x8895('0x32')](_0x46efed)){if(this[_0x8895('0x19')][_0x46efed['uniqueid']]&&_0x46efed[_0x8895('0x3a')]!='OutgoingSpoolFailed'){if(this[_0x8895('0x32')](_0x46efed[_0x8895('0x66')])){if(this['isNotNull'](_0x46efed[_0x8895('0x66')][_0x8895('0x67')])){this[_0x8895('0x5e')](_0x46efed[_0x8895('0x34')],_0x46efed['value']);}else if(this[_0x8895('0x32')](_0x46efed['variable']['xmd-phone'])){this[_0x8895('0x19')][_0x46efed[_0x8895('0x34')]][_0x8895('0x56')]=_0x46efed['value'];}else if(this[_0x8895('0x32')](_0x46efed['variable'][_0x8895('0x68')])){this[_0x8895('0x19')][_0x46efed[_0x8895('0x34')]][_0x8895('0x69')]=_0x46efed[_0x8895('0x6a')];}else if(this['isNotNull'](_0x46efed['variable'][_0x8895('0x6b')])){this['channels'][_0x46efed[_0x8895('0x34')]][_0x8895('0x6c')]=_0x46efed['value'];}else if(this[_0x8895('0x32')](_0x46efed[_0x8895('0x66')][_0x8895('0x6d')])){this[_0x8895('0x19')][_0x46efed[_0x8895('0x34')]]['queue']=_0x46efed[_0x8895('0x6a')]['split'](',')[0x0];}else if(this['isNotNull'](_0x46efed[_0x8895('0x66')]['xmd-originatecalleridnum'])){this[_0x8895('0x19')][_0x46efed[_0x8895('0x34')]][_0x8895('0x6e')]=_0x46efed[_0x8895('0x6a')];}else if(this['isNotNull'](_0x46efed['variable']['xmd-destination'])){this[_0x8895('0x19')][_0x46efed[_0x8895('0x34')]][_0x8895('0x6f')]=_0x46efed[_0x8895('0x6a')];}else if(this[_0x8895('0x32')](_0x46efed[_0x8895('0x66')]['xmd-callerid-preview'])){this[_0x8895('0x19')][_0x46efed[_0x8895('0x34')]][_0x8895('0x70')]=_0x46efed['value'];}else if(this[_0x8895('0x32')](_0x46efed['variable'][_0x8895('0x71')])){this['channels'][_0x46efed[_0x8895('0x34')]][_0x8895('0xd')]=_0x46efed['value'];}else if(this[_0x8895('0x32')](_0x46efed[_0x8895('0x66')]['sipcallid'])){this[_0x8895('0x19')][_0x46efed[_0x8895('0x34')]][_0x8895('0x72')]=_0x46efed[_0x8895('0x6a')];}}}else if(this[_0x8895('0x32')](_0x46efed[_0x8895('0x66')][_0x8895('0x67')])){if(_0x46efed['value']){var _0x2816bf=path['parse'](_0x46efed[_0x8895('0x6a')])[_0x8895('0x43')];this[_0x8895('0x5e')](_0x2816bf,_0x46efed[_0x8895('0x6a')]);}}else if(this['channels'][_0x46efed[_0x8895('0x35')]]){if(this[_0x8895('0x32')](_0x46efed[_0x8895('0x66')])){if(this[_0x8895('0x32')](_0x46efed[_0x8895('0x66')][_0x8895('0x73')])){this[_0x8895('0x19')][_0x46efed[_0x8895('0x35')]]['sipcalllinkedid']=_0x46efed[_0x8895('0x6a')];}}}}}catch(_0x45cdca){logger['error']('[syncVarSet][VoiceCallReport]',util[_0x8895('0x47')](_0x45cdca,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8895('0x31')][_0x8895('0x74')]=function(_0xfbb2){try{if(this['isNotNull'](_0xfbb2)){if(this['channels'][_0xfbb2[_0x8895('0x34')]]){var _0x42ebe2=moment();this[_0x8895('0x19')][_0xfbb2[_0x8895('0x34')]][_0x8895('0x75')]=_0x42ebe2['format'](_0x8895('0x3d'));this[_0x8895('0x19')][_0xfbb2['uniqueid']][_0x8895('0x4b')]=_0x42ebe2[_0x8895('0x55')](this[_0x8895('0x19')][_0xfbb2[_0x8895('0x34')]][_0x8895('0x4a')],_0x8895('0x4c'));if(this['channels'][_0xfbb2[_0x8895('0x34')]][_0x8895('0x53')]){this['channels'][_0xfbb2['uniqueid']]['billableseconds']=_0x42ebe2[_0x8895('0x55')](this[_0x8895('0x19')][_0xfbb2['uniqueid']][_0x8895('0x76')],'seconds');this['channels'][_0xfbb2['uniqueid']][_0x8895('0x54')]=this[_0x8895('0x19')][_0xfbb2[_0x8895('0x34')]][_0x8895('0x4b')]-this[_0x8895('0x19')][_0xfbb2['uniqueid']][_0x8895('0x77')];}if(_0xfbb2[_0x8895('0x78')]===_0x8895('0x40')){if(this['agents'][_0xfbb2['channel']['split']('-')[0x0]]){this[_0x8895('0x1a')][_0xfbb2[_0x8895('0x3a')][_0x8895('0x41')]('-')[0x0]]=_[_0x8895('0x79')](this[_0x8895('0x1a')][_0xfbb2[_0x8895('0x3a')][_0x8895('0x41')]('-')[0x0]],['destconnectedlinenum']);this[_0x8895('0x33')](util['format'](_0x8895('0x7a'),this['agents'][_0xfbb2[_0x8895('0x3a')][_0x8895('0x41')]('-')[0x0]][_0x8895('0x43')]),_0x8895('0x7b'),{'destaccountcode':this[_0x8895('0x1a')][_0xfbb2[_0x8895('0x3a')][_0x8895('0x41')]('-')[0x0]]['accountcode']});}}ami[_0x8895('0x33')](_0x8895('0x7c'),this[_0x8895('0x19')][_0xfbb2[_0x8895('0x34')]]);delete this[_0x8895('0x19')][_0xfbb2['uniqueid']];}}}catch(_0x464d1c){logger['error'](_0x8895('0x7d'),util[_0x8895('0x47')](_0x464d1c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8895('0x31')][_0x8895('0x27')]=function(_0x378e72){try{if(this[_0x8895('0x32')](_0x378e72)){if(this[_0x8895('0x19')][_0x378e72[_0x8895('0x7e')]]){this[_0x8895('0x19')][_0x378e72['transfereeuniqueid']][_0x8895('0x7f')]=_0x378e72['origtransferercalleridnum'];this[_0x8895('0x19')][_0x378e72[_0x8895('0x7e')]][_0x8895('0x80')]=_0x378e72['transfertargetcalleridnum'];if(this[_0x8895('0x19')][_0x378e72['secondtransfereruniqueid']]){var _0x620af9=this[_0x8895('0x19')][_0x378e72[_0x8895('0x81')]];this[_0x8895('0x19')][_0x378e72['secondtransfereruniqueid']]=this['channels'][_0x378e72[_0x8895('0x7e')]];this['channels'][_0x378e72['transfereeuniqueid']]=_0x620af9;}}else if(this[_0x8895('0x19')][_0x378e72['transfertargetuniqueid']]){this[_0x8895('0x19')][_0x378e72[_0x8895('0x82')]][_0x8895('0x7f')]=_0x378e72[_0x8895('0x83')];this[_0x8895('0x19')][_0x378e72[_0x8895('0x82')]][_0x8895('0x80')]=_0x378e72[_0x8895('0x84')];if(this[_0x8895('0x19')][_0x378e72['origtransfereruniqueid']]){var _0x620af9=this[_0x8895('0x19')][_0x378e72[_0x8895('0x85')]];this['channels'][_0x378e72[_0x8895('0x85')]]=this[_0x8895('0x19')][_0x378e72[_0x8895('0x82')]];this['channels'][_0x378e72[_0x8895('0x82')]]=_0x620af9;}}}}catch(_0x25511e){logger[_0x8895('0x46')](_0x8895('0x86'),util[_0x8895('0x47')](_0x25511e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8895('0x31')][_0x8895('0x87')]=function(_0x510d69){try{if(this[_0x8895('0x32')](_0x510d69)){if(this[_0x8895('0x19')][_0x510d69[_0x8895('0x7e')]]){this[_0x8895('0x19')][_0x510d69[_0x8895('0x7e')]][_0x8895('0x7f')]=_0x510d69['transfereecalleridnum'];this[_0x8895('0x19')][_0x510d69[_0x8895('0x7e')]]['transferconnectedlinenum']=_0x510d69['extension'];this[_0x8895('0x74')]({'event':_0x8895('0x88'),'uniqueid':_0x510d69['transfereeuniqueid'],'context':_0x510d69[_0x8895('0x78')],'channel':_0x510d69[_0x8895('0x89')]});}}}catch(_0x6715b){logger[_0x8895('0x46')](_0x8895('0x8a'),util['inspect'](_0x6715b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8895('0x31')][_0x8895('0x2a')]=function(_0x4691f2){try{if(this[_0x8895('0x32')](_0x4691f2)){if(this[_0x8895('0x19')][_0x4691f2[_0x8895('0x34')]]){if(!_[_0x8895('0x65')](this[_0x8895('0x19')][_0x4691f2[_0x8895('0x34')]][_0x8895('0x76')])){this[_0x8895('0x19')][_0x4691f2[_0x8895('0x34')]]['mohstarttime']=moment()[_0x8895('0x3c')](_0x8895('0x3d'));}}}}catch(_0x3e041f){logger[_0x8895('0x46')]('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x8895('0x47')](_0x3e041f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8895('0x31')]['syncMusicOnHoldStop']=function(_0x5d3262){try{if(this[_0x8895('0x32')](_0x5d3262)){if(this['channels'][_0x5d3262[_0x8895('0x34')]]){if(!_['isNil'](this['channels'][_0x5d3262[_0x8895('0x34')]]['mohstarttime'])){this[_0x8895('0x19')][_0x5d3262['uniqueid']][_0x8895('0x8b')]+=moment()[_0x8895('0x8c')](0x0)['diff'](this[_0x8895('0x19')][_0x5d3262[_0x8895('0x34')]][_0x8895('0x8d')],'seconds');delete this['channels'][_0x5d3262[_0x8895('0x34')]][_0x8895('0x8d')];}}}}catch(_0x36c828){logger[_0x8895('0x46')](_0x8895('0x8e'),util[_0x8895('0x47')](_0x36c828,{'showHidden':![],'depth':null}));}};module[_0x8895('0x8f')]=VoiceCallReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js
index 547ce95..0e0309f 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 _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
+var _0x6ea5=['redis','outboundChannels','outbound','variables','syncDialBegin','bind','dialend','syncDialEnd','syncVarSet','hangup','syncHangup','prototype','isUndefined','emit','isNotNull','merge','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','privilege','voice:outbound','voice_outbound_channel:save','channels','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','lastevent','[syncDialEnd][VoiceDialReport]','addVariable','keys','variable','value','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','memberdynamic','memberinterface','memberlastcall','membername','memberrealtime','isNil','endtime','duration','diff','starttime','seconds','complete','total','answertime','answered','billableseconds','sumHoldTime','holdtime','sumBillable','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','moment','ioredis','../../../config/environment','ami','../ami','defaults','localhost','socket.io-emitter'];(function(_0x10904c,_0x5864a0){var _0x14fd02=function(_0x5480e4){while(--_0x5480e4){_0x10904c['push'](_0x10904c['shift']());}};_0x14fd02(++_0x5864a0);}(_0x6ea5,0xa5));var _0x56ea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6ea5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x56ea('0x0'));var moment=require(_0x56ea('0x1'));var util=require('util');var Redis=require(_0x56ea('0x2'));var config=require(_0x56ea('0x3'));var logger=require('../../../config/logger')(_0x56ea('0x4'));var ami=require(_0x56ea('0x5'));config['redis']=_[_0x56ea('0x6')](config['redis'],{'host':_0x56ea('0x7'),'port':0x18eb});var io=require(_0x56ea('0x8'))(new Redis(config[_0x56ea('0x9')]));function VoiceDialReport(_0x3235c7){this['channels']=_0x3235c7[_0x56ea('0xa')];this[_0x56ea('0xb')]=_0x3235c7[_0x56ea('0xb')];this[_0x56ea('0xc')]={};ami['on']('dialbegin',this[_0x56ea('0xd')][_0x56ea('0xe')](this));ami['on'](_0x56ea('0xf'),this[_0x56ea('0x10')][_0x56ea('0xe')](this));ami['on']('varset',this[_0x56ea('0x11')][_0x56ea('0xe')](this));ami['on'](_0x56ea('0x12'),this[_0x56ea('0x13')]['bind'](this));}VoiceDialReport[_0x56ea('0x14')]['isNotNull']=function(_0x54cfb7){return _0x54cfb7!==null&&!_[_0x56ea('0x15')](_0x54cfb7);};VoiceDialReport[_0x56ea('0x14')][_0x56ea('0x16')]=function(_0x3b8b45,_0xb74b3a,_0x54cf01){io['to'](_0x3b8b45)[_0x56ea('0x16')](_0xb74b3a,_0x54cf01);};VoiceDialReport[_0x56ea('0x14')][_0x56ea('0xd')]=function(_0x17f75c){try{if(this[_0x56ea('0x17')](_0x17f75c)){if(this['channels'][_0x17f75c['uniqueid']]){_[_0x56ea('0x18')](this['channels'][_0x17f75c[_0x56ea('0x19')]],{'starttime':moment()[_0x56ea('0x1a')](_0x56ea('0x1b')),'lastevent':_0x56ea('0x1c'),'interface':_0x17f75c[_0x56ea('0x1d')][_0x56ea('0x1e')](0x0,_0x17f75c[_0x56ea('0x1d')][_0x56ea('0x1f')]('-')),'membername':_0x17f75c['channel']['substring'](_0x17f75c[_0x56ea('0x1d')][_0x56ea('0x1f')]('/')+0x1,_0x17f75c[_0x56ea('0x1d')][_0x56ea('0x1f')]('-'))},_['omit'](_0x17f75c,['event',_0x56ea('0x20')]));this[_0x56ea('0x16')](_0x56ea('0x21'),_0x56ea('0x22'),this[_0x56ea('0x23')][_0x17f75c[_0x56ea('0x19')]]);ami['emit'](_0x56ea('0x24'),this[_0x56ea('0x23')][_0x17f75c[_0x56ea('0x19')]]);}}}catch(_0x5dc6ef){logger[_0x56ea('0x25')](_0x56ea('0x26'),util[_0x56ea('0x27')](_0x5dc6ef,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x56ea('0x14')][_0x56ea('0x10')]=function(_0xa3394){try{if(this[_0x56ea('0x17')](_0xa3394)){if(this['channels'][_0xa3394[_0x56ea('0x19')]]){this[_0x56ea('0x23')][_0xa3394[_0x56ea('0x19')]][_0x56ea('0x28')]=_0xa3394[_0x56ea('0x28')];if(_0xa3394[_0x56ea('0x28')]===_0x56ea('0x29')){this[_0x56ea('0x23')][_0xa3394['uniqueid']][_0x56ea('0x2a')]=_0xa3394[_0x56ea('0x2a')];this[_0x56ea('0x23')][_0xa3394[_0x56ea('0x19')]][_0x56ea('0x2b')]=_0xa3394[_0x56ea('0x2b')];this[_0x56ea('0x23')][_0xa3394['uniqueid']]['answertime']=moment()['format'](_0x56ea('0x1b'));this['channels'][_0xa3394[_0x56ea('0x19')]][_0x56ea('0x2c')]='connect';ami[_0x56ea('0x16')]('custom:dialconnect',this[_0x56ea('0x23')][_0xa3394[_0x56ea('0x19')]]);}this[_0x56ea('0x16')](_0x56ea('0x21'),_0x56ea('0x22'),this['channels'][_0xa3394[_0x56ea('0x19')]]);}}}catch(_0x1afb2d){logger['error'](_0x56ea('0x2d'),util[_0x56ea('0x27')](_0x1afb2d,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x56ea('0x11')]=function(_0xfb4e6){try{if(this[_0x56ea('0x17')](_0xfb4e6)){this[_0x56ea('0x2e')](_0xfb4e6[_0x56ea('0x19')],_[_0x56ea('0x2f')](_0xfb4e6[_0x56ea('0x30')])[0x0],_0xfb4e6['value']);if(this['isNotNull'](_0xfb4e6[_0x56ea('0x30')])&&this[_0x56ea('0x17')](_0xfb4e6[_0x56ea('0x30')]['outboundrouteid'])){if(_[_0x56ea('0x15')](this['channels'][_0xfb4e6[_0x56ea('0x19')]])){this[_0x56ea('0x23')][_0xfb4e6['uniqueid']]={'routeId':_0xfb4e6[_0x56ea('0x31')],'variables':this['variables'][_0xfb4e6[_0x56ea('0x19')]]};this[_0x56ea('0x16')](_0x56ea('0x21'),_0x56ea('0x22'),this[_0x56ea('0x23')][_0xfb4e6[_0x56ea('0x19')]]);}}}}catch(_0x3c7657){logger[_0x56ea('0x25')]('[syncVarSet][VoiceDialReport]',util['inspect'](_0x3c7657,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x56ea('0x14')][_0x56ea('0x2e')]=function(_0x3a717b,_0x23a2c7,_0x3b4291){var _0x1f3c30=['rtpaudioqos',_0x56ea('0x32'),_0x56ea('0x33'),_0x56ea('0x34'),_0x56ea('0x35'),_0x56ea('0x36'),_0x56ea('0x37'),'rtpaudioqosrttbridged',_0x56ea('0x38'),_0x56ea('0x39'),_0x56ea('0x3a'),'bridgepvtcallid','membercalls',_0x56ea('0x3b'),_0x56ea('0x3c'),_0x56ea('0x3d'),_0x56ea('0x3e'),'memberpenalty',_0x56ea('0x3f')];if(!_[_0x56ea('0x40')](_0x23a2c7)&&!_['includes'](_0x1f3c30,_0x23a2c7)){if(_[_0x56ea('0x15')](this[_0x56ea('0xc')][_0x3a717b])){this[_0x56ea('0xc')][_0x3a717b]={};}this[_0x56ea('0xc')][_0x3a717b][_0x23a2c7]=_0x3b4291;}};VoiceDialReport[_0x56ea('0x14')][_0x56ea('0x13')]=function(_0x16356d){try{if(this['isNotNull'](_0x16356d)){if(this[_0x56ea('0x23')][_0x16356d['uniqueid']]){this[_0x56ea('0x23')][_0x16356d[_0x56ea('0x19')]][_0x56ea('0x41')]=moment()[_0x56ea('0x1a')](_0x56ea('0x1b'));this[_0x56ea('0x23')][_0x16356d[_0x56ea('0x19')]][_0x56ea('0x42')]=moment(this['channels'][_0x16356d[_0x56ea('0x19')]][_0x56ea('0x41')])[_0x56ea('0x43')](this[_0x56ea('0x23')][_0x16356d['uniqueid']][_0x56ea('0x44')],_0x56ea('0x45'));this[_0x56ea('0x23')][_0x16356d[_0x56ea('0x19')]][_0x56ea('0x2c')]=_0x56ea('0x46');this[_0x56ea('0xb')][_0x56ea('0x47')]+=0x1;if(this[_0x56ea('0x23')][_0x16356d[_0x56ea('0x19')]][_0x56ea('0x48')]){this[_0x56ea('0xb')][_0x56ea('0x49')]+=0x1;this[_0x56ea('0x23')][_0x16356d[_0x56ea('0x19')]]['holdtime']=moment(this[_0x56ea('0x23')][_0x16356d[_0x56ea('0x19')]]['answertime'])[_0x56ea('0x43')](this[_0x56ea('0x23')][_0x16356d['uniqueid']][_0x56ea('0x44')],_0x56ea('0x45'));this[_0x56ea('0x23')][_0x16356d[_0x56ea('0x19')]][_0x56ea('0x4a')]=moment(this[_0x56ea('0x23')][_0x16356d[_0x56ea('0x19')]][_0x56ea('0x41')])[_0x56ea('0x43')](this[_0x56ea('0x23')][_0x16356d[_0x56ea('0x19')]]['answertime'],_0x56ea('0x45'));this[_0x56ea('0xb')][_0x56ea('0x4b')]+=this['channels'][_0x16356d['uniqueid']][_0x56ea('0x4c')]||0x0;this[_0x56ea('0xb')][_0x56ea('0x4d')]+=this['channels'][_0x16356d[_0x56ea('0x19')]]['billableseconds'];}this['outbound'][_0x56ea('0x4e')]+=this[_0x56ea('0x23')][_0x16356d['uniqueid']][_0x56ea('0x42')];ami[_0x56ea('0x16')](_0x56ea('0x4f'),this[_0x56ea('0x23')][_0x16356d['uniqueid']]);ami[_0x56ea('0x16')](_0x56ea('0x50'),this['channels'][_0x16356d[_0x56ea('0x19')]]);this['emit']('voice:outbound',_0x56ea('0x51'),this['outbound']);logger['info'](_0x56ea('0x52'),JSON[_0x56ea('0x53')](this['channels'][_0x16356d[_0x56ea('0x19')]]));this[_0x56ea('0x16')](_0x56ea('0x21'),_0x56ea('0x54'),this['channels'][_0x16356d[_0x56ea('0x19')]]);delete this[_0x56ea('0x23')][_0x16356d[_0x56ea('0x19')]];}if(this[_0x56ea('0xc')][_0x16356d[_0x56ea('0x19')]]){delete this['variables'][_0x16356d[_0x56ea('0x19')]];}}}catch(_0x5d9c86){logger[_0x56ea('0x25')](_0x56ea('0x55'),util['inspect'](_0x5d9c86,{'showHidden':![],'depth':null}));}};module[_0x56ea('0x56')]=VoiceDialReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js
index 4648397..a4b3783 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 _0x4a80=['ABANDONED','[syncQueueCallerAbandon][VoiceQueueReport]','queuecallerleaveAt','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','[syncAgentConnect][VoiceQueueReport]','queuecallerabandonAt','assigned','lastAssignedTo','membername','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','transfertype','FORWARD','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','[syncAgentComplete][VoiceQueueReport]','syncVarSet','variable','value','TIMEOUT','lastevent','timeout','custom:timeout','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','length','diff','sumDuration','milliseconds','custom:queuecallerunmanaged','custom:queuecallerabandon','syncAttendedTransfer','transfereeuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLIND','extension','BlindTransfer','context','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','syncMusicOnHoldStart','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','bluebird','md5','../../../config/logger','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','enqueue','tail','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','queuesummarycomplete','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','hangup','syncHangup','fullybooted','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isUndefined','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','prototype','switch','isNil','Action','channel','catch','message','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','error','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','voice_queue_channel:save','info','stringify','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','name','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','total','unmanaged','abandoned','Trunk','active','callerid','Interval','clearZombieChannels','queues','[queuesummary]','syncQueueSummary','isNotNull','queue','toNumber','callers','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncQueueSummaryComplete','syncNewExten','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','pick','keys','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerexitreason'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0x4a80,0x111));var _0x04a8=function(_0x109b5b,_0x4a6a4f){_0x109b5b=_0x109b5b-0x0;var _0x18c24d=_0x4a80[_0x109b5b];return _0x18c24d;};'use strict';var _=require(_0x04a8('0x0'));var moment=require('moment');var BPromise=require(_0x04a8('0x1'));var util=require('util');var md5=require(_0x04a8('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x04a8('0x3'))('ami');var ami=require(_0x04a8('0x4'));var QueueReport=require(_0x04a8('0x5'));config[_0x04a8('0x6')]=_[_0x04a8('0x7')](config['redis'],{'host':_0x04a8('0x8'),'port':0x18eb});var io=require(_0x04a8('0x9'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x04a8('0xa')]=function(_0x21de51){this[_0x04a8('0xb')]=this['tail']?this[_0x04a8('0xb')]['finally'](_0x21de51):_0x21de51();};function VoiceQueueReport(_0x37eabc){this[_0x04a8('0xc')]=new Sequence();this[_0x04a8('0xd')]={};this[_0x04a8('0xe')]=_0x37eabc[_0x04a8('0xe')];this[_0x04a8('0xf')]=_0x37eabc[_0x04a8('0x10')];this[_0x04a8('0x11')]=_0x37eabc['voiceQueues'];this[_0x04a8('0x12')]=!![];this[_0x04a8('0x13')]=_0x37eabc[_0x04a8('0x13')];this[_0x04a8('0x14')]={};ami['on'](_0x04a8('0x15'),this['syncQueueSummary']['bind'](this));ami['on'](_0x04a8('0x16'),this['syncQueueSummaryComplete'][_0x04a8('0x17')](this));ami['on'](_0x04a8('0x18'),this[_0x04a8('0x19')][_0x04a8('0x17')](this));ami['on'](_0x04a8('0x1a'),this[_0x04a8('0x1b')][_0x04a8('0x17')](this));ami['on']('queuecallerleave',this[_0x04a8('0x1c')][_0x04a8('0x17')](this));ami['on'](_0x04a8('0x1d'),this[_0x04a8('0x1e')][_0x04a8('0x17')](this));ami['on'](_0x04a8('0x1f'),this[_0x04a8('0x20')][_0x04a8('0x17')](this));ami['on'](_0x04a8('0x21'),this['syncVarSet'][_0x04a8('0x17')](this));ami['on'](_0x04a8('0x22'),this[_0x04a8('0x23')][_0x04a8('0x17')](this));ami['on'](_0x04a8('0x24'),this['syncFullyBooted']['bind'](this));ami['on'](_0x04a8('0x25'),this['syncMusicOnHoldStart'][_0x04a8('0x17')](this));ami['on'](_0x04a8('0x26'),this[_0x04a8('0x27')][_0x04a8('0x17')](this));ami['on'](_0x04a8('0x28'),this['syncAttendedTransfer'][_0x04a8('0x17')](this));ami['on'](_0x04a8('0x29'),this[_0x04a8('0x2a')][_0x04a8('0x17')](this));this[_0x04a8('0x2b')]();this[_0x04a8('0x2c')]();}function isNotNull(_0x4a3912){return _0x4a3912!==null&&!_[_0x04a8('0x2d')](_0x4a3912);}function clearChannels(_0x372f28){if(!_[_0x04a8('0x2e')](_0x372f28)){for(var _0x5f476e in _0x372f28){if(_0x372f28[_0x04a8('0x2f')](_0x5f476e)){delete _0x372f28[_0x5f476e];}}}}function clearCampaigns(_0x3b5173){if(!_[_0x04a8('0x2e')](_0x3b5173)){for(var _0x35dd03 in _0x3b5173){if(_0x3b5173[_0x04a8('0x2f')](_0x35dd03)){_0x3b5173[_0x35dd03][_0x04a8('0x30')]=0x0;}}}}function clearVoiceQueues(_0x39e0e0){if(!_[_0x04a8('0x2e')](_0x39e0e0)){for(var _0x275939 in _0x39e0e0){if(_0x39e0e0[_0x04a8('0x2f')](_0x275939)){_0x39e0e0[_0x275939]['originated']=0x0;_0x39e0e0[_0x275939][_0x04a8('0x31')]=0x0;_0x39e0e0[_0x275939][_0x04a8('0x32')]=0x0;_0x39e0e0[_0x275939][_0x04a8('0x33')]=0x0;_0x39e0e0[_0x275939][_0x04a8('0x34')]=!![];}}}}function clearAgentBooked(_0x239a2f){if(!_[_0x04a8('0x2e')](_0x239a2f)){for(var _0x72c510 in _0x239a2f){if(_0x239a2f[_0x04a8('0x2f')](_0x72c510)){_0x239a2f[_0x72c510]['unlockRR']=!![];}}}}VoiceQueueReport[_0x04a8('0x35')]['clearZombieChannels']=function(){var _0x10e97a=this;for(var _0x56790b in this[_0x04a8('0xf')]){if(this['channels'][_0x04a8('0x2f')](_0x56790b)&&!this[_0x04a8('0xf')][_0x56790b][_0x04a8('0x36')]){this['sequence'][_0x04a8('0xa')](function(){if(!_[_0x04a8('0x37')](_0x10e97a[_0x04a8('0xf')][_0x56790b])){return ami[_0x04a8('0x38')]({'action':'status','channel':_0x10e97a['channels'][_0x56790b][_0x04a8('0x39')]})[_0x04a8('0x3a')](function(_0x297fb5){if(_0x297fb5[_0x04a8('0x3b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x10e97a[_0x04a8('0xf')][_0x56790b]){delete _0x10e97a['channels'][_0x56790b];logger['error'](_0x04a8('0x3c'),_0x56790b);}if(_0x10e97a[_0x04a8('0xd')][_0x56790b]){delete _0x10e97a[_0x04a8('0xd')][_0x56790b];logger['error'](_0x04a8('0x3d'),_0x56790b);}if(_0x10e97a[_0x04a8('0x14')][_0x56790b]){delete _0x10e97a[_0x04a8('0x14')][_0x56790b];logger['error'](_0x04a8('0x3e'),_0x56790b);}},0x1f40);}});}});}}};VoiceQueueReport[_0x04a8('0x35')]['syncFullyBooted']=function(){logger[_0x04a8('0x3f')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this['channels']);this[_0x04a8('0x40')](this[_0x04a8('0xd')]);clearAgentBooked(this[_0x04a8('0xe')]);clearVoiceQueues(this[_0x04a8('0x11')]);clearCampaigns(this[_0x04a8('0x13')]);};VoiceQueueReport[_0x04a8('0x35')]['clearQueueReport']=function(_0x331182){var _0x138ce3=this;if(!_[_0x04a8('0x2e')](_0x331182)){for(var _0x166733 in _0x331182){if(_0x331182[_0x04a8('0x2f')](_0x166733)){_0x138ce3[_0x04a8('0x41')](_0x331182[_0x166733]);delete _0x331182[_0x166733];}}}};function loggerCatch(_0x5910c4){return function(_0x19d2cb){logger[_0x04a8('0x3f')](_0x5910c4,util[_0x04a8('0x42')](_0x19d2cb,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x04a8('0x35')][_0x04a8('0x43')]=function(_0x349a55,_0x4a9a48,_0x43bbcb){io['to'](_0x349a55)[_0x04a8('0x43')](_0x4a9a48,_0x43bbcb);};VoiceQueueReport[_0x04a8('0x35')][_0x04a8('0x44')]=function(_0x4b6bc3){this[_0x04a8('0x43')](util[_0x04a8('0x45')](_0x04a8('0x46'),_0x4b6bc3['name']),_0x04a8('0x47'),_0x4b6bc3);};VoiceQueueReport['prototype']['emitVoiceQueueChannelRemove']=function(_0x189351){logger[_0x04a8('0x48')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x04a8('0x49')](_0x189351));this[_0x04a8('0x43')](util['format'](_0x04a8('0x46'),_0x189351['name']),_0x04a8('0x4a'),_0x189351);};VoiceQueueReport[_0x04a8('0x35')][_0x04a8('0x4b')]=function(_0x479ddb){if(_0x479ddb[_0x04a8('0x4c')]===_0x04a8('0x4d')){var _0x5387d2={'id':_0x479ddb['id'],'name':_0x479ddb[_0x04a8('0x4e')],'strategy':_0x479ddb[_0x04a8('0x4f')],'answered':_0x479ddb[_0x04a8('0x50')],'available':_0x479ddb[_0x04a8('0x51')],'loggedIn':_0x479ddb[_0x04a8('0x52')],'pTalking':_0x479ddb['pTalking'],'sumBillable':_0x479ddb[_0x04a8('0x53')],'sumDuration':_0x479ddb['sumDuration'],'sumHoldTime':_0x479ddb[_0x04a8('0x54')]||0x0,'talking':_0x479ddb[_0x04a8('0x31')],'total':_0x479ddb[_0x04a8('0x55')],'type':_0x479ddb[_0x04a8('0x4c')],'unmanaged':_0x479ddb[_0x04a8('0x56')],'abandoned':_0x479ddb[_0x04a8('0x57')],'waiting':_0x479ddb[_0x04a8('0x33')]};if(_0x479ddb[_0x04a8('0x58')]){_0x5387d2[_0x04a8('0x58')]={'id':_0x479ddb['Trunk']['id'],'name':_0x479ddb[_0x04a8('0x58')][_0x04a8('0x4e')],'active':_0x479ddb[_0x04a8('0x58')][_0x04a8('0x59')],'callerid':_0x479ddb['Trunk'][_0x04a8('0x5a')]};}if(_0x479ddb[_0x04a8('0x5b')]){_0x5387d2['Interval']={'id':_0x479ddb[_0x04a8('0x5b')]['id'],'name':_0x479ddb[_0x04a8('0x5b')][_0x04a8('0x4e')]};}var _0x562c72=md5(JSON[_0x04a8('0x49')](_0x5387d2));if(_0x479ddb[_0x04a8('0x2')]!==_0x562c72){_0x479ddb[_0x04a8('0x2')]=_0x562c72;this[_0x04a8('0x43')](util[_0x04a8('0x45')](_0x04a8('0x46'),_0x5387d2[_0x04a8('0x4e')]),'voice_queue:save',_0x5387d2);}}};VoiceQueueReport[_0x04a8('0x35')]['isNotNull']=function(_0x29608b){return _0x29608b!==null&&!_[_0x04a8('0x2d')](_0x29608b);};VoiceQueueReport[_0x04a8('0x35')]['loopQueueShow']=function(){var _0x22385e=this;setInterval(function(){_0x22385e[_0x04a8('0x5c')]();ami['Action']({'action':_0x04a8('0x5d')})[_0x04a8('0x3a')](loggerCatch('[queues]'));},0x2710);};VoiceQueueReport[_0x04a8('0x35')]['loopQueueSummary']=function(){var _0x2e0909=this;setInterval(function(){if(_0x2e0909[_0x04a8('0x12')]){return ami['Action']({'action':_0x04a8('0x15')})['then'](function(_0x549122){_0x2e0909['flagQueueSummary']=![];})[_0x04a8('0x3a')](loggerCatch(_0x04a8('0x5e')));}},0x3e8);};VoiceQueueReport['prototype'][_0x04a8('0x5f')]=function(_0x3cb27b){try{if(this[_0x04a8('0x60')](_0x3cb27b)&&this[_0x04a8('0x60')](_0x3cb27b['queue'])){if(this[_0x04a8('0x11')][_0x3cb27b[_0x04a8('0x61')]]){var _0x318794=_['countBy'](this[_0x04a8('0xf')],'queue')[_0x3cb27b['queue']]||0x0;var _0x28d957=_0x318794-_0x3cb27b['callers'];if(this[_0x04a8('0x11')][_0x3cb27b['queue']]['waiting']!==_[_0x04a8('0x62')](_0x3cb27b[_0x04a8('0x63')])||this[_0x04a8('0x11')][_0x3cb27b[_0x04a8('0x61')]][_0x04a8('0x52')]!==_[_0x04a8('0x62')](_0x3cb27b[_0x04a8('0x64')])||this[_0x04a8('0x11')][_0x3cb27b[_0x04a8('0x61')]][_0x04a8('0x51')]!==_['toNumber'](_0x3cb27b[_0x04a8('0x51')])||this['voiceQueues'][_0x3cb27b[_0x04a8('0x61')]]['talking']!==_0x28d957){this[_0x04a8('0x11')][_0x3cb27b[_0x04a8('0x61')]][_0x04a8('0x33')]=_['toNumber'](_0x3cb27b[_0x04a8('0x63')]);this[_0x04a8('0x11')][_0x3cb27b[_0x04a8('0x61')]][_0x04a8('0x52')]=_[_0x04a8('0x62')](_0x3cb27b[_0x04a8('0x64')]);this[_0x04a8('0x11')][_0x3cb27b[_0x04a8('0x61')]][_0x04a8('0x51')]=_[_0x04a8('0x62')](_0x3cb27b['available']);this[_0x04a8('0x11')][_0x3cb27b[_0x04a8('0x61')]]['talking']=_0x28d957>0x0?_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={};_0x4d2c350x0?_0x538b8f:0x0;this[_0x78a9('0x13')][_0x3b802c[_0x78a9('0x5f')]][_0x78a9('0x51')]=this['voiceQueues'][_0x3b802c[_0x78a9('0x5f')]][_0x78a9('0x51')]>_[_0x78a9('0x61')](_0x3b802c[_0x78a9('0x63')])?_[_0x78a9('0x61')](_0x3b802c[_0x78a9('0x63')]):this['voiceQueues'][_0x3b802c[_0x78a9('0x5f')]][_0x78a9('0x51')];this['emitVoiceQueueSummary'](this[_0x78a9('0x13')][_0x3b802c[_0x78a9('0x5f')]]);}ami[_0x78a9('0x40')](_0x78a9('0x64'),this[_0x78a9('0x13')][_0x3b802c[_0x78a9('0x5f')]]);}}}catch(_0x31bb27){logger[_0x78a9('0x3a')](_0x78a9('0x65'),util[_0x78a9('0x3f')](_0x31bb27,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x78a9('0x1a')]=function(_0x162de2){this[_0x78a9('0x14')]=!![];};VoiceQueueReport[_0x78a9('0xb')]['syncNewExten']=function(_0x4ccd35){};VoiceQueueReport[_0x78a9('0xb')][_0x78a9('0x66')]=function(_0x2bd3da){try{if(this[_0x78a9('0x59')](_0x2bd3da)){if(_['isUndefined'](this['queueReports'][_0x2bd3da[_0x78a9('0x67')]])){this['queueReports'][_0x2bd3da[_0x78a9('0x67')]]=[];this[_0x78a9('0x33')][_0x2bd3da[_0x78a9('0x67')]]={};}var _0x5c84a0=new QueueReport();_0x5c84a0[_0x78a9('0x42')]=_0x2bd3da['queue'];_0x5c84a0[_0x78a9('0x4a')]=this['voiceQueues'][_0x5c84a0[_0x78a9('0x42')]]&&this['voiceQueues'][_0x5c84a0[_0x78a9('0x42')]][_0x78a9('0x4a')]?this['voiceQueues'][_0x5c84a0['name']][_0x78a9('0x4a')]||_0x78a9('0x4b'):'inbound';_0x5c84a0[_0x78a9('0x5f')]=_0x2bd3da['queue'];_0x5c84a0[_0x78a9('0x68')]=moment()[_0x78a9('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c84a0[_0x78a9('0x69')]=_0x2bd3da[_0x78a9('0x69')];_0x5c84a0[_0x78a9('0x6a')]=_0x2bd3da[_0x78a9('0x6a')];_[_0x78a9('0x6b')](_0x5c84a0,_[_0x78a9('0x6c')](_0x2bd3da,_[_0x78a9('0x6d')](_0x5c84a0)));this[_0x78a9('0x10')][_0x2bd3da[_0x78a9('0x67')]][_0x78a9('0x6e')](_0x5c84a0);this[_0x78a9('0x33')][_0x2bd3da[_0x78a9('0x67')]]=_0x5c84a0;this['emitVoiceQueueChannelSave'](_0x5c84a0);}}catch(_0x203700){logger[_0x78a9('0x3a')](_0x78a9('0x6f'),util['inspect'](_0x203700,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78a9('0xb')][_0x78a9('0x70')]=function(_0x2f128c){try{if(this[_0x78a9('0x59')](_0x2f128c)){if(this['queueReports'][_0x2f128c[_0x78a9('0x67')]]){var _0x5d5ff2=_['last'](this[_0x78a9('0x10')][_0x2f128c[_0x78a9('0x67')]]);_0x5d5ff2[_0x78a9('0x71')]=![];_0x5d5ff2[_0x78a9('0x72')]=null;_0x5d5ff2['holdtime']=_0x2f128c[_0x78a9('0x73')];_0x5d5ff2['originalposition']=_0x2f128c[_0x78a9('0x74')];_0x5d5ff2['queuecallerabandon']=!![];_0x5d5ff2[_0x78a9('0x75')]=moment()[_0x78a9('0x46')](_0x78a9('0x76'));_0x5d5ff2[_0x78a9('0x77')]=_0x78a9('0x78');_0x5d5ff2[_0x78a9('0x79')]=null;this[_0x78a9('0x33')][_0x2f128c[_0x78a9('0x67')]]=_0x5d5ff2;this[_0x78a9('0x3e')](_0x5d5ff2);}}}catch(_0xdc6394){logger[_0x78a9('0x3a')](_0x78a9('0x7a'),util[_0x78a9('0x3f')](_0xdc6394,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78a9('0xb')][_0x78a9('0x1d')]=function(_0x288c20){try{if(this[_0x78a9('0x59')](_0x288c20)){if(this['queueReports'][_0x288c20['uniqueid']]){var _0x5eb4f3=_[_0x78a9('0x7b')](this[_0x78a9('0x10')][_0x288c20['uniqueid']]);_0x5eb4f3[_0x78a9('0x7c')]=moment()[_0x78a9('0x46')](_0x78a9('0x76'));_0x5eb4f3[_0x78a9('0x7d')]=_0x288c20[_0x78a9('0x7d')];_0x5eb4f3[_0x78a9('0x7e')]=_0x288c20['connectedlinename'];this[_0x78a9('0x33')][_0x288c20[_0x78a9('0x67')]]=_0x5eb4f3;this[_0x78a9('0x41')](_0x5eb4f3);}}}catch(_0x451e1e){logger[_0x78a9('0x3a')](_0x78a9('0x7f'),util[_0x78a9('0x3f')](_0x451e1e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78a9('0xb')][_0x78a9('0x21')]=function(_0x3b3d94){try{if(this[_0x78a9('0x59')](_0x3b3d94)){if(this[_0x78a9('0x10')][_0x3b3d94[_0x78a9('0x67')]]){var _0x550394=_[_0x78a9('0x7b')](this[_0x78a9('0x10')][_0x3b3d94[_0x78a9('0x67')]]);_0x550394[_0x78a9('0x71')]=!![];_0x550394[_0x78a9('0x77')]=_0x78a9('0x80');}}}catch(_0x1f9245){logger[_0x78a9('0x3a')](_0x78a9('0x81'),util['inspect'](_0x1f9245,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78a9('0xb')][_0x78a9('0x1f')]=function(_0x36a69c){try{if(this['isNotNull'](_0x36a69c)){if(this['queueReports'][_0x36a69c[_0x78a9('0x67')]]){var _0x227b75=_['last'](this[_0x78a9('0x10')][_0x36a69c['uniqueid']]);_0x227b75['queuecallerabandon']=![];_0x227b75[_0x78a9('0x75')]=null;_0x227b75[_0x78a9('0x82')]=!![];_0x227b75[_0x78a9('0x79')]=_0x36a69c[_0x78a9('0x83')];_0x227b75[_0x78a9('0x73')]=_0x36a69c[_0x78a9('0x73')];_0x227b75['queuecallercomplete']=!![];_0x227b75[_0x78a9('0x84')]=![];_0x227b75['queuecallerexitAt']=null;if(!_0x227b75[_0x78a9('0x85')]){if(_0x36a69c[_0x78a9('0x86')]=='transfer'){_0x227b75[_0x78a9('0x77')]=_0x78a9('0x87');}else{if(_[_0x78a9('0x88')](_0x36a69c[_0x78a9('0x89')]['toLowerCase'](),'local/')){if(this['queueReports'][_0x36a69c[_0x78a9('0x8a')]]){var _0x5c4281=_[_0x78a9('0x7b')](this['queueReports'][_0x36a69c[_0x78a9('0x8a')]]);_0x5c4281['queuecallercomplete']=![];_0x5c4281[_0x78a9('0x84')]=!![];_0x5c4281[_0x78a9('0x8b')]=moment(_0x227b75[_0x78a9('0x68')])[_0x78a9('0x8c')](_0x36a69c[_0x78a9('0x73')],_0x78a9('0x8d'))[_0x78a9('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c4281[_0x78a9('0x77')]=_0x78a9('0x8e');_0x5c4281[_0x78a9('0x85')]=!![];_0x5c4281[_0x78a9('0x8f')]='FORWARD';_0x5c4281[_0x78a9('0x90')]=_0x36a69c['destexten'];_0x5c4281[_0x78a9('0x91')]=_0x36a69c[_0x78a9('0x67')];var _0x33d890=this['queueReports'][_0x36a69c[_0x78a9('0x8a')]];this[_0x78a9('0x10')][_0x36a69c['linkedid']]=this[_0x78a9('0x10')][_0x36a69c[_0x78a9('0x67')]];this[_0x78a9('0x10')][_0x36a69c[_0x78a9('0x67')]]=_0x33d890;}}else{_0x227b75[_0x78a9('0x77')]=_0x78a9('0x92')+_0x36a69c[_0x78a9('0x86')][_0x78a9('0x93')]();}}}this['channels'][_0x36a69c[_0x78a9('0x67')]]=_0x227b75;this[_0x78a9('0x3e')](_0x227b75);}}}catch(_0x2799f2){logger['error'](_0x78a9('0x94'),util['inspect'](_0x2799f2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x78a9('0x95')]=function(_0x2491dd){try{if(this[_0x78a9('0x59')](_0x2491dd)){this[_0x78a9('0x96')](_0x2491dd[_0x78a9('0x67')],_[_0x78a9('0x6d')](_0x2491dd['variable'])[0x0],_0x2491dd[_0x78a9('0x97')]);if(this[_0x78a9('0x10')][_0x2491dd['uniqueid']]){var _0x54e851=_[_0x78a9('0x7b')](this['queueReports'][_0x2491dd[_0x78a9('0x67')]]);if(_0x54e851){if(this[_0x78a9('0x59')](_0x2491dd[_0x78a9('0x98')])&&this[_0x78a9('0x59')](_0x2491dd[_0x78a9('0x98')][_0x78a9('0x99')])){switch(_0x2491dd[_0x78a9('0x97')]){case _0x78a9('0x9a'):_0x54e851[_0x78a9('0x84')]=![];_0x54e851[_0x78a9('0x8b')]=null;break;case'TIMEOUT':_0x54e851[_0x78a9('0x9b')]='timeout';ami[_0x78a9('0x40')]('custom:timeout',_0x54e851);break;default:_0x54e851[_0x78a9('0x84')]=!![];_0x54e851[_0x78a9('0x8b')]=moment()['format'](_0x78a9('0x76'));_0x54e851[_0x78a9('0x7c')]=moment()[_0x78a9('0x46')]('YYYY-MM-DD\x20HH:mm:ss');}_0x54e851['queuecallerabandon']=![];_0x54e851[_0x78a9('0x75')]=null;_0x54e851[_0x78a9('0x77')]=_0x2491dd['value'];this['channels'][_0x2491dd[_0x78a9('0x67')]]=_0x54e851;this[_0x78a9('0x3e')](_0x54e851);}else if(this[_0x78a9('0x59')](_0x2491dd[_0x78a9('0x98')])&&this[_0x78a9('0x59')](_0x2491dd[_0x78a9('0x98')][_0x78a9('0x9c')])){if(!_0x54e851[_0x78a9('0x9d')]){_0x54e851['queuecallerexit']=!![];_0x54e851['queuecallerexitAt']=moment()['format'](_0x78a9('0x76'));_0x54e851[_0x78a9('0x77')]=_0x78a9('0x9e');_0x54e851[_0x78a9('0x7c')]=moment()['format'](_0x78a9('0x76'));this[_0x78a9('0x33')][_0x2491dd[_0x78a9('0x67')]]=_0x54e851;}}_0x54e851['variables']=this[_0x78a9('0x16')][_0x2491dd['uniqueid']];}}}}catch(_0x30c131){logger['error']('[syncVarSet][VoiceQueueReport]',util['inspect'](_0x30c131,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x2411f2,_0x1cd0d4,_0x5b4012){var _0x47b334=[_0x78a9('0x9f'),_0x78a9('0xa0'),_0x78a9('0xa1'),_0x78a9('0xa2'),_0x78a9('0xa3'),_0x78a9('0xa4'),_0x78a9('0xa5'),'rtpaudioqosrttbridged',_0x78a9('0xa6'),_0x78a9('0xa7'),_0x78a9('0xa8'),'bridgepvtcallid',_0x78a9('0xa9'),_0x78a9('0xaa'),'memberinterface',_0x78a9('0xab'),_0x78a9('0x83'),_0x78a9('0xac'),_0x78a9('0xad')];if(!_[_0x78a9('0x35')](_0x1cd0d4)&&!_['includes'](_0x47b334,_0x1cd0d4)){if(_['isUndefined'](this['variables'][_0x2411f2])){this['variables'][_0x2411f2]={};}this['variables'][_0x2411f2][_0x1cd0d4]=_0x5b4012;}};VoiceQueueReport[_0x78a9('0xb')][_0x78a9('0x23')]=function(_0x329af3){try{if(this[_0x78a9('0x59')](_0x329af3)){if(this[_0x78a9('0x10')][_0x329af3[_0x78a9('0x67')]]){for(var _0x5ccec9=0x0,_0x59be20={};_0x5ccec9=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
+var _0xc854=['lodash','../client','voiceQueueReport','queuecallercompleteAt','voice','isNil','interface','SIP/%s','queuecallerleaveAt','diff','inbound','exten','agent','accountcode','toNumber','uniqueid','CreateMemberReport','Request','membername','TALKING','starttime','endtime','seconds','moment'];(function(_0x1f6691,_0x3a3d46){var _0xf786b6=function(_0x2afbdb){while(--_0x2afbdb){_0x1f6691['push'](_0x1f6691['shift']());}};_0xf786b6(++_0x3a3d46);}(_0xc854,0x17f));var _0x4c85=function(_0x5e8282,_0x1f2962){_0x5e8282=_0x5e8282-0x0;var _0x5cd37d=_0xc854[_0x5e8282];return _0x5cd37d;};'use strict';var moment=require(_0x4c85('0x0'));var _=require(_0x4c85('0x1'));var util=require('util');var client=require(_0x4c85('0x2'));exports[_0x4c85('0x3')]=function(_0x539fcc){var _0x1441ef=_0x539fcc[_0x4c85('0x4')]||_0x539fcc['queuecallerexitAt'];return client['Request']('CreateMemberReport',{'body':{'channel':_0x4c85('0x5'),'membername':_0x539fcc['lastAssignedTo'],'interface':_[_0x4c85('0x6')](_0x539fcc[_0x4c85('0x7')])?util['format'](_0x4c85('0x8'),_0x539fcc['lastAssignedTo']):_0x539fcc[_0x4c85('0x7')],'type':'TALKING','enterAt':_0x539fcc[_0x4c85('0x9')],'exitAt':_0x1441ef,'duration':moment(_0x1441ef)[_0x4c85('0xa')](_0x539fcc[_0x4c85('0x9')],'seconds'),'data1':_0x4c85('0xb'),'data2':_0x539fcc['calleridnum'],'data3':_0x539fcc[_0x4c85('0xc')],'data4':null,'data5':_0x539fcc['queue'],'role':_0x4c85('0xd'),'internal':_0x539fcc[_0x4c85('0xe')]?_[_0x4c85('0xf')](_0x539fcc['accountcode']):undefined,'uniqueid':_0x539fcc[_0x4c85('0x10')]},'log':_0x4c85('0x11')});};exports['voiceDialReport']=function(_0x3cc811){return client[_0x4c85('0x12')](_0x4c85('0x11'),{'body':{'channel':'voice','membername':_0x3cc811[_0x4c85('0x13')],'interface':_0x3cc811[_0x4c85('0x7')],'type':_0x4c85('0x14'),'enterAt':_0x3cc811[_0x4c85('0x15')],'exitAt':_0x3cc811[_0x4c85('0x16')],'duration':moment(_0x3cc811[_0x4c85('0x16')])[_0x4c85('0xa')](_0x3cc811[_0x4c85('0x15')],_0x4c85('0x17'))>=0x0?moment(_0x3cc811[_0x4c85('0x16')])['diff'](_0x3cc811[_0x4c85('0x15')],_0x4c85('0x17')):null,'data1':'outbound','data2':_0x3cc811[_0x4c85('0xe')],'data3':_0x3cc811[_0x4c85('0xc')],'data4':_0x3cc811['dialstring']||null,'role':'agent','internal':_0x3cc811[_0x4c85('0xe')]?_[_0x4c85('0xf')](_0x3cc811['accountcode']):undefined,'uniqueid':_0x3cc811['uniqueid']},'log':_0x4c85('0x11')});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js
index afb7559..e1e43cd 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 _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
+var _0xbf6e=['html','Request','GetTemplate','name'];(function(_0x573241,_0xb968af){var _0x1c5d0e=function(_0x192212){while(--_0x192212){_0x573241['push'](_0x573241['shift']());}};_0x1c5d0e(++_0xb968af);}(_0xbf6e,0x149));var _0xebf6=function(_0x3626fe,_0x33dbfd){_0x3626fe=_0x3626fe-0x0;var _0x23e475=_0xbf6e[_0x3626fe];return _0x23e475;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x1f94d5){return function(_0x2b658d){return client[_0xebf6('0x0')](_0xebf6('0x1'),{'options':{'raw':!![],'attributes':['id',_0xebf6('0x2'),_0xebf6('0x3')]},'log':_0xebf6('0x1')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js
index e618c9b..7c4029d 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 _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
+var _0x9cb2=['data7','../client','getTriggers','GetTrigger','name','channel','Condition','field','operator','value','AnyConditions','Action','action','data1','data3','data4','data5','data6'];(function(_0x4ed40a,_0x1502b0){var _0x4dfc9a=function(_0x15d17b){while(--_0x15d17b){_0x4ed40a['push'](_0x4ed40a['shift']());}};_0x4dfc9a(++_0x1502b0);}(_0x9cb2,0xc7));var _0x29cb=function(_0x316b9f,_0x56bc64){_0x316b9f=_0x316b9f-0x0;var _0x353d01=_0x9cb2[_0x316b9f];return _0x353d01;};'use strict';var client=require(_0x29cb('0x0'));exports[_0x29cb('0x1')]=function(_0xfc05e6){return function(_0x259194){return client['Request'](_0x29cb('0x2'),{'options':{'raw':![],'attributes':['id',_0x29cb('0x3'),_0x29cb('0x4'),'status'],'include':[{'model':_0x29cb('0x5'),'as':'AllConditions','attributes':['id',_0x29cb('0x6'),_0x29cb('0x7'),_0x29cb('0x8')]},{'model':_0x29cb('0x5'),'as':_0x29cb('0x9'),'attributes':['id',_0x29cb('0x6'),_0x29cb('0x7'),'value']},{'model':_0x29cb('0xa'),'as':'Actions','attributes':['id',_0x29cb('0xb'),_0x29cb('0xc'),'data2',_0x29cb('0xd'),_0x29cb('0xe'),_0x29cb('0xf'),_0x29cb('0x10'),_0x29cb('0x11')]}]},'log':'GetTrigger'});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js
index 64fc0a1..4e3a027 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 _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
+var _0xf4fa=['name','registry','GetTrunk','getTrunks','Request'];(function(_0x3d2c09,_0x5eff70){var _0x70316f=function(_0x264379){while(--_0x264379){_0x3d2c09['push'](_0x3d2c09['shift']());}};_0x70316f(++_0x5eff70);}(_0xf4fa,0x107));var _0xaf4f=function(_0x54fc83,_0x3e2f6a){_0x54fc83=_0x54fc83-0x0;var _0x5a0ec0=_0xf4fa[_0x54fc83];return _0x5a0ec0;};'use strict';var client=require('../client');exports[_0xaf4f('0x0')]=function(_0x49cb99){return function(_0x3da9a9){return client[_0xaf4f('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xaf4f('0x2'),_0xaf4f('0x3')]},'log':_0xaf4f('0x4')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js
index 058ef16..c7e4ba1 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 _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
+var _0x5f29=['savePause','saveUnpause','UnpauseUser','fullname','voicePause','getAgent','../client','getAgents','Request','GetUser','agent','name','email','accountcode','online','lastLoginAt','pauseType','lastPauseAt','phone','mobile','interface','telephone','internal','getTelephones'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0x5f29,0x126));var _0x95f2=function(_0x165bf3,_0x49fcfc){_0x165bf3=_0x165bf3-0x0;var _0xd12540=_0x5f29[_0x165bf3];return _0xd12540;};'use strict';var client=require(_0x95f2('0x0'));exports[_0x95f2('0x1')]=function(){return function(){return client[_0x95f2('0x2')](_0x95f2('0x3'),{'options':{'raw':![],'where':{'role':_0x95f2('0x4')},'attributes':['id',_0x95f2('0x5'),_0x95f2('0x6'),_0x95f2('0x7'),'fullname',_0x95f2('0x8'),_0x95f2('0x9'),_0x95f2('0xa'),_0x95f2('0xb'),'voicePause',_0x95f2('0xc'),_0x95f2('0xd'),_0x95f2('0xe')]},'log':'getAgents'});};};exports['getTelephones']=function(){return function(){return client[_0x95f2('0x2')](_0x95f2('0x3'),{'options':{'raw':!![],'where':{'role':_0x95f2('0xf')},'attributes':['id',_0x95f2('0x5'),_0x95f2('0x7'),_0x95f2('0x10')]},'log':_0x95f2('0x11')});};};exports[_0x95f2('0x12')]=function(_0x1579ec,_0x1f4895,_0x16cbd4){return client['Request']('PauseUser',{'body':{'type':_0x1f4895,'uniqueid':_0x16cbd4},'options':{'where':{'id':_0x1579ec['id']}},'log':'savePause'});};exports[_0x95f2('0x13')]=function(_0x57fed4){return client[_0x95f2('0x2')](_0x95f2('0x14'),{'body':{},'options':{'where':{'id':_0x57fed4['id']}},'log':_0x95f2('0x12')});};exports['getAgent']=function(_0x47b583){return client[_0x95f2('0x2')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x95f2('0x4'),'id':_0x47b583},'attributes':['id',_0x95f2('0x5'),_0x95f2('0x6'),_0x95f2('0x7'),_0x95f2('0x15'),_0x95f2('0x8'),_0x95f2('0x9'),'pauseType','lastPauseAt',_0x95f2('0x16'),_0x95f2('0xe')]},'log':_0x95f2('0x17')});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js
index eb3ecd8..d99d1ca 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 _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
+var _0xff14=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x1ebb10,_0x156b3e){var _0x20d709=function(_0x4cc093){while(--_0x4cc093){_0x1ebb10['push'](_0x1ebb10['shift']());}};_0x20d709(++_0x156b3e);}(_0xff14,0x1ca));var _0x4ff1=function(_0x253fb5,_0x1fe76d){_0x253fb5=_0x253fb5-0x0;var _0x179359=_0xff14[_0x253fb5];return _0x179359;};'use strict';var client=require(_0x4ff1('0x0'));exports[_0x4ff1('0x1')]=function(_0x4a6134){return client[_0x4ff1('0x2')](_0x4ff1('0x3'),{'body':_0x4a6134,'log':_0x4ff1('0x3')});};exports[_0x4ff1('0x4')]=function(_0x5b9afc,_0x3e5af7,_0x3857b3){return client[_0x4ff1('0x2')](_0x4ff1('0x5'),{'body':_0x5b9afc,'options':{'where':{'uniqueid':_0x3e5af7,'interface':_0x3857b3,'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 841714d..c247537 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 _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
+var _0x6d9a=['format','endOf','day','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','billableseconds','moment','util','lodash','../client','create','CreateVoiceCallReport','merge','calleridnum','context','getVoiceCallReports','Request'];(function(_0x48bdb2,_0x229521){var _0x4a2a40=function(_0x2cd6b7){while(--_0x2cd6b7){_0x48bdb2['push'](_0x48bdb2['shift']());}};_0x4a2a40(++_0x229521);}(_0x6d9a,0x115));var _0xa6d9=function(_0x128b31,_0x577fb7){_0x128b31=_0x128b31-0x0;var _0x8c5b38=_0x6d9a[_0x128b31];return _0x8c5b38;};'use strict';var moment=require(_0xa6d9('0x0'));var util=require(_0xa6d9('0x1'));var _=require(_0xa6d9('0x2'));var client=require(_0xa6d9('0x3'));exports[_0xa6d9('0x4')]=function(_0x2a5131){return client['Request'](_0xa6d9('0x5'),{'body':_[_0xa6d9('0x6')](_0x2a5131,{'source':_0x2a5131[_0xa6d9('0x7')],'destinationcontext':_0x2a5131[_0xa6d9('0x8')],'callerid':_0x2a5131['callerid'],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0xa6d9('0x9')]=function(){return function(){return client[_0xa6d9('0xa')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf']('day')[_0xa6d9('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xa6d9('0xc')](_0xa6d9('0xd'))[_0xa6d9('0xb')](_0xa6d9('0xe'))]}},'attributes':['type',_0xa6d9('0xf'),_0xa6d9('0x10'),_0xa6d9('0x11')]},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js
index a0bc5d4..6964628 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 _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
+var _0x9beb=['create','CreateVoiceDialReport'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9beb,0xdc));var _0xb9be=function(_0x3a99ca,_0x1e1db9){_0x3a99ca=_0x3a99ca-0x0;var _0x4c7bf9=_0x9beb[_0x3a99ca];return _0x4c7bf9;};'use strict';var client=require('../client');exports[_0xb9be('0x0')]=function(_0x20d5b0){return client['Request'](_0xb9be('0x1'),{'body':_0x20d5b0,'log':_0xb9be('0x1')});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js
index 067d0f6..c08fe32 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 _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
+var _0x9ffd=['../client','getVoiceExtensions','Request','exten','recordingFormat'];(function(_0x98f636,_0x40a8bc){var _0x2c7481=function(_0x2b6d67){while(--_0x2b6d67){_0x98f636['push'](_0x98f636['shift']());}};_0x2c7481(++_0x40a8bc);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x480a11,_0x598ff2){_0x480a11=_0x480a11-0x0;var _0xfee687=_0x9ffd[_0x480a11];return _0xfee687;};'use strict';var client=require(_0xd9ff('0x0'));exports[_0xd9ff('0x1')]=function(){return function(){return client[_0xd9ff('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xd9ff('0x3'),_0xd9ff('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xd9ff('0x1')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js
index d287fca..c7a9651 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 _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
+var _0xa619=['dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','interval','../client','getVoiceQueues','GetVoiceQueue','name','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0xa619,0x182));var _0x9a61=function(_0x3d38a5,_0x24dee2){_0x3d38a5=_0x3d38a5-0x0;var _0x14fe9a=_0xa619[_0x3d38a5];return _0x14fe9a;};'use strict';var client=require(_0x9a61('0x0'));exports[_0x9a61('0x1')]=function(){return function(){return client['Request'](_0x9a61('0x2'),{'options':{'raw':![],'attributes':['id',_0x9a61('0x3'),'acw','acwTimeout',_0x9a61('0x4'),_0x9a61('0x5'),_0x9a61('0x6'),_0x9a61('0x7'),_0x9a61('0x8'),'dialLimitChannel',_0x9a61('0x9'),_0x9a61('0xa'),_0x9a61('0xb'),_0x9a61('0xc'),_0x9a61('0xd'),_0x9a61('0xe'),_0x9a61('0xf'),_0x9a61('0x10'),_0x9a61('0x11'),_0x9a61('0x12'),_0x9a61('0x13'),_0x9a61('0x14'),_0x9a61('0x15'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x9a61('0x16'),'dialNoAnswerRetryFrequency',_0x9a61('0x17'),'dialTimezone',_0x9a61('0x18'),_0x9a61('0x19'),_0x9a61('0x1a'),_0x9a61('0x1b'),_0x9a61('0x1c'),'dialAMDGreeting',_0x9a61('0x1d'),_0x9a61('0x1e'),_0x9a61('0x1f'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0x9a61('0x20'),_0x9a61('0x21'),'timeout','dialRecallMeTimeout',_0x9a61('0x22'),'dialOrderByScheduledAt',_0x9a61('0x23'),_0x9a61('0x24'),_0x9a61('0x25'),_0x9a61('0x5'),_0x9a61('0x26'),_0x9a61('0x27'),'dialCutDigit','dialNoSuchNumberMaxRetry',_0x9a61('0x28'),'dialDropMaxRetry',_0x9a61('0x29'),_0x9a61('0x2a'),_0x9a61('0x2b'),'dialMachineMaxRetry',_0x9a61('0x2c'),'dialAgentRejectMaxRetry',_0x9a61('0x2d'),_0x9a61('0x2e'),_0x9a61('0x2f'),_0x9a61('0x30')],'include':[{'model':_0x9a61('0x31'),'as':_0x9a61('0x31'),'attributes':['id',_0x9a61('0x3'),'callerid',_0x9a61('0x32')]},{'model':_0x9a61('0x33'),'as':_0x9a61('0x34'),'attributes':['id',_0x9a61('0x3')]},{'model':_0x9a61('0x31'),'as':_0x9a61('0x35'),'attributes':['id',_0x9a61('0x3'),_0x9a61('0x36'),'active']},{'model':_0x9a61('0x37'),'as':_0x9a61('0x37'),'attributes':['id',_0x9a61('0x3')],'include':[{'model':_0x9a61('0x37'),'as':'Intervals','attributes':['id',_0x9a61('0x3'),_0x9a61('0x38')]}]}]},'log':'getVoiceQueues'});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js
index 31eda43..ec129f9 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 _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
+var _0xef0a=['GetVoiceQueueReports','moment','lodash','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandonAt'];(function(_0x191c9e,_0x2fa108){var _0x409289=function(_0x14a93d){while(--_0x14a93d){_0x191c9e['push'](_0x191c9e['shift']());}};_0x409289(++_0x2fa108);}(_0xef0a,0xdd));var _0xaef0=function(_0x190c00,_0xeebb5b){_0x190c00=_0x190c00-0x0;var _0xa11640=_0xef0a[_0x190c00];return _0xa11640;};'use strict';var moment=require(_0xaef0('0x0'));var _=require(_0xaef0('0x1'));var client=require(_0xaef0('0x2'));exports[_0xaef0('0x3')]=function(_0x2e0672){return client[_0xaef0('0x4')](_0xaef0('0x5'),{'body':_0x2e0672,'log':_0xaef0('0x5')});};exports[_0xaef0('0x6')]=function(){return function(){return client[_0xaef0('0x4')](_0xaef0('0x7'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xaef0('0x8'))[_0xaef0('0x9')](_0xaef0('0xa')),moment()[_0xaef0('0xb')]('day')['format'](_0xaef0('0xa'))]}},'attributes':[_0xaef0('0xc'),_0xaef0('0xd'),_0xaef0('0xe'),_0xaef0('0xf'),_0xaef0('0x10'),_0xaef0('0x11'),_0xaef0('0x12'),_0xaef0('0x13'),'queuecallerabandon',_0xaef0('0x14')]},'log':_0xaef0('0x15')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js
index 8f7bbc3..4e7448f 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 _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
+var _0xff96=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x52cb4a,_0x217996){var _0x2d84e7=function(_0x1ecdb2){while(--_0x1ecdb2){_0x52cb4a['push'](_0x52cb4a['shift']());}};_0x2d84e7(++_0x217996);}(_0xff96,0x1f2));var _0x6ff9=function(_0x503a0c,_0xbc78c5){_0x503a0c=_0x503a0c-0x0;var _0x3b2e83=_0xff96[_0x503a0c];return _0x3b2e83;};'use strict';var client=require(_0x6ff9('0x0'));exports[_0x6ff9('0x1')]=function(_0xe0bfe7){return function(){return client[_0x6ff9('0x2')](_0x6ff9('0x3'),{'options':{'where':{'VoiceQueueId':_0xe0bfe7,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js
index b3fe9f2..c6c34ac 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 _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
+var _0x99b2=['create','Request','CreateVoiceRecording','merge','monitorFilename','lodash'];(function(_0x59930e,_0x114ca7){var _0x5093a3=function(_0x2f9e69){while(--_0x2f9e69){_0x59930e['push'](_0x59930e['shift']());}};_0x5093a3(++_0x114ca7);}(_0x99b2,0x11f));var _0x299b=function(_0x2675ca,_0x2b0dd7){_0x2675ca=_0x2675ca-0x0;var _0x44a1a4=_0x99b2[_0x2675ca];return _0x44a1a4;};'use strict';var _=require(_0x299b('0x0'));var client=require('../client');exports[_0x299b('0x1')]=function(_0x1de2ce){return client[_0x299b('0x2')](_0x299b('0x3'),{'body':_[_0x299b('0x4')](_0x1de2ce,{'value':_0x1de2ce[_0x299b('0x5')]}),'log':_0x299b('0x3')});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js
index 25c4a31..068e14c 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 _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
+var _0x8fc6=['Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeaccountcode','transfereecontext','transfereelinkedid','context','blind','attendedTransfer','result','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','../client','blindTransfer'];(function(_0x32d6c3,_0x36288e){var _0x5cf4bc=function(_0x51538f){while(--_0x51538f){_0x32d6c3['push'](_0x32d6c3['shift']());}};_0x5cf4bc(++_0x36288e);}(_0x8fc6,0x6d));var _0x68fc=function(_0x3e0991,_0x4f7df4){_0x3e0991=_0x3e0991-0x0;var _0xea4798=_0x8fc6[_0x3e0991];return _0xea4798;};'use strict';var client=require(_0x68fc('0x0'));exports[_0x68fc('0x1')]=function(_0x3476ff){return client[_0x68fc('0x2')](_0x68fc('0x3'),{'body':{'result':_0x3476ff['result'],'transfererchannel':_0x3476ff[_0x68fc('0x4')],'transferercalleridnum':_0x3476ff[_0x68fc('0x5')],'transferercalleridname':_0x3476ff[_0x68fc('0x6')],'transfererconnectedlinenum':_0x3476ff[_0x68fc('0x7')],'transfererconnectedlinename':_0x3476ff[_0x68fc('0x8')],'transfereraccountcode':_0x3476ff[_0x68fc('0x9')],'transferercontext':_0x3476ff[_0x68fc('0xa')],'transfererexten':_0x3476ff[_0x68fc('0xb')],'transfererlinkedid':_0x3476ff['transfererlinkedid'],'transfereechannel':_0x3476ff[_0x68fc('0xc')],'transfereecalleridnum':_0x3476ff[_0x68fc('0xd')],'transfereecalleridname':_0x3476ff[_0x68fc('0xe')],'transfereeconnectedlinenum':_0x3476ff['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x3476ff['transfereeconnectedlinename'],'transfereeaccountcode':_0x3476ff[_0x68fc('0xf')],'transfereecontext':_0x3476ff[_0x68fc('0x10')],'transfereeexten':_0x3476ff['transfereeexten'],'transfereelinkedid':_0x3476ff[_0x68fc('0x11')],'isexternal':_0x3476ff['isexternal'],'context':_0x3476ff[_0x68fc('0x12')],'extension':_0x3476ff['extension'],'type':_0x68fc('0x13')},'log':_0x68fc('0x3')});};exports[_0x68fc('0x14')]=function(_0x429c4a){return client[_0x68fc('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x429c4a[_0x68fc('0x15')],'transfererchannel':_0x429c4a[_0x68fc('0x16')],'transferercalleridnum':_0x429c4a['origtransferercalleridnum'],'transferercalleridname':_0x429c4a['origtransferercalleridname'],'transfererconnectedlinenum':_0x429c4a['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x429c4a[_0x68fc('0x17')],'transfereraccountcode':_0x429c4a[_0x68fc('0x18')],'transferercontext':_0x429c4a[_0x68fc('0x19')],'transfererexten':_0x429c4a[_0x68fc('0x1a')],'transfererlinkedid':_0x429c4a[_0x68fc('0x1b')],'transfereechannel':_0x429c4a['transfertargetchannel'],'transfereecalleridnum':_0x429c4a['transfertargetcalleridnum'],'transfereecalleridname':_0x429c4a['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x429c4a[_0x68fc('0x1c')],'transfereeconnectedlinename':_0x429c4a[_0x68fc('0x1d')],'transfereeaccountcode':_0x429c4a[_0x68fc('0x1e')],'transfereecontext':_0x429c4a['transfertargetcontext'],'transfereeexten':_0x429c4a[_0x68fc('0x1f')],'transfereelinkedid':_0x429c4a[_0x68fc('0x20')],'isexternal':_0x429c4a[_0x68fc('0x21')],'context':_0x429c4a[_0x68fc('0x22')],'extension':_0x429c4a[_0x68fc('0x23')],'type':_0x68fc('0x24')},'log':_0x68fc('0x3')});};
\ No newline at end of file
diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js
index 254d122..3a6a183 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 _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
+var _0xd155=['predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','values','channels','length','map','find','channel','%s.%s','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','push','YYYY-MM-DD\x20HH:mm:ss','rec','status','uniqueid','MixMonitor\x20Success','mixmonitorid','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','trunks','outboundChannels','campaigns','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','pick','module','Action','then','message','catch','isConnected','ami\x20disconnected','join','command','action','Command','content','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd155,0x15d));var _0x5d15=function(_0x2460d9,_0x15da87){_0x2460d9=_0x2460d9-0x0;var _0x4bc204=_0xd155[_0x2460d9];return _0x4bc204;};'use strict';var _=require(_0x5d15('0x0'));var util=require('util');var jayson=require(_0x5d15('0x1'));var schema=require(_0x5d15('0x2'));var BPromise=require(_0x5d15('0x3'));var moment=require(_0x5d15('0x4'));var config=require(_0x5d15('0x5'));var properties=require(_0x5d15('0x6'));var ami=require(_0x5d15('0x7'));exports['listen']=function(_0x124ab7,_0x105abb,_0x112daa){return new BPromise(function(_0x204aa8,_0x5c4156){var _0x3df375={'QueuePause':function(_0x139e94){return new Promise(function(_0x3ad398,_0x423cf7){var _0xce24a5=util[_0x5d15('0x8')](_0x5d15('0x9'),'SIP',_0x139e94[_0x5d15('0xa')]);if(_0x124ab7[_0x5d15('0xb')]&&_0x124ab7[_0x5d15('0xb')][_0xce24a5]&&_0x124ab7['timers'][_0xce24a5][_0x5d15('0xc')]){_0x124ab7[_0x5d15('0xb')][_0xce24a5][_0x5d15('0xd')]();}if(_0x124ab7[_0x5d15('0xe')][_0xce24a5]){_0x124ab7['agents'][_0xce24a5][_0x5d15('0xf')]({'statePause':_0x139e94[_0x5d15('0x10')]?!![]:![]});}_0x3ad398({'code':0xc8,'message':_0x5d15('0x11')});});},'Reload':function(_0x3d94be){var _0x21c88e=this;return new Promise(function(_0x21c43d,_0x242c38){if(ami['isConnected']()==![]){return _0x242c38(_0x21c88e[_0x5d15('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x5d15('0x13')][_0x5d15('0x14')],'ami\x20disconnected']['join']('\x20')));}_0x3d94be=_[_0x5d15('0x15')](_0x3d94be,_['keys'](properties[_0x5d15('0x16')]));_0x3d94be['action']='Reload';return ami[_0x5d15('0x17')](_0x3d94be)[_0x5d15('0x18')](function(_0x2c9f02){_0x21c43d({'code':0xc8,'message':_0x2c9f02[_0x5d15('0x19')]});})[_0x5d15('0x1a')](function(_0xeb167b){_0x242c38(_0x21c88e['error'](0x1f5,_0xeb167b[_0x5d15('0x19')]));});});},'Command':function(_0x55be35){var _0x450917=this;return new Promise(function(_0x3e3c00,_0x5e66ed){if(ami[_0x5d15('0x1b')]()==![]){return _0x5e66ed(_0x450917[_0x5d15('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x5d15('0x13')][_0x5d15('0x14')],_0x5d15('0x1c')][_0x5d15('0x1d')]('\x20')));}_0x55be35=_[_0x5d15('0x15')](_0x55be35,_0x5d15('0x1e'));_0x55be35[_0x5d15('0x1f')]=_0x5d15('0x20');return ami['Action'](_0x55be35)['then'](function(_0x8bcd5b){_0x3e3c00({'code':0xc8,'message':_0x8bcd5b[_0x5d15('0x21')]});})['catch'](function(_0x52407a){_0x5e66ed(_0x450917[_0x5d15('0x12')](0x1f5,_0x52407a['message']));});});},'VoiceQueues':function(_0x2186dc){return new Promise(function(_0x216494,_0x4fb2a2){var _0x128fb4=[];for(var _0x1b57f8 in _0x124ab7[_0x5d15('0x22')]){if(_0x124ab7[_0x5d15('0x22')]['hasOwnProperty'](_0x1b57f8)){var _0x260134=_0x124ab7[_0x5d15('0x22')][_0x1b57f8];var _0x2533de={'id':_0x260134['id'],'name':_0x260134['name'],'strategy':_0x260134[_0x5d15('0x23')],'answered':_0x260134[_0x5d15('0x24')],'available':_0x260134[_0x5d15('0x25')],'loggedIn':_0x260134[_0x5d15('0x26')],'pTalking':_0x260134[_0x5d15('0x27')],'sumBillable':_0x260134[_0x5d15('0x28')],'sumDuration':_0x260134[_0x5d15('0x29')],'sumHoldTime':_0x260134[_0x5d15('0x2a')]||0x0,'talking':_0x260134[_0x5d15('0x2b')],'total':_0x260134[_0x5d15('0x2c')],'type':_0x260134[_0x5d15('0x2d')],'unmanaged':_0x260134[_0x5d15('0x2e')],'abandoned':_0x260134[_0x5d15('0x2f')],'waiting':_0x260134['waiting'],'loggedInDb':_0x260134[_0x5d15('0x30')]};if(_0x260134[_0x5d15('0x2d')]==='outbound'){_0x2533de[_0x5d15('0x31')]=_0x260134['dialActive'];_0x2533de[_0x5d15('0x32')]=_0x260134[_0x5d15('0x32')];_0x2533de[_0x5d15('0x33')]=_0x260134[_0x5d15('0x33')];_0x2533de['dialOriginateCallerIdNumber']=_0x260134[_0x5d15('0x34')];_0x2533de[_0x5d15('0x35')]=_0x260134[_0x5d15('0x35')];_0x2533de[_0x5d15('0x36')]=_0x260134['dialPrefix'];_0x2533de[_0x5d15('0x37')]=_0x260134[_0x5d15('0x37')];_0x2533de['outboundAnswerCallsDay']=_0x260134[_0x5d15('0x38')];_0x2533de[_0x5d15('0x39')]=_0x260134[_0x5d15('0x39')];_0x2533de[_0x5d15('0x3a')]=_0x260134[_0x5d15('0x3a')];_0x2533de['outboundCongestionCallsDay']=_0x260134['outboundCongestionCallsDay'];_0x2533de['outboundDropCallsDayACS']=_0x260134[_0x5d15('0x3b')];_0x2533de[_0x5d15('0x3c')]=_0x260134[_0x5d15('0x3c')];_0x2533de['outboundDropCallsDayTimeout']=_0x260134[_0x5d15('0x3d')];_0x2533de[_0x5d15('0x3e')]=_0x260134[_0x5d15('0x3e')];_0x2533de[_0x5d15('0x3f')]=_0x260134[_0x5d15('0x3f')];_0x2533de[_0x5d15('0x40')]=_0x260134[_0x5d15('0x40')];_0x2533de[_0x5d15('0x41')]=_0x260134[_0x5d15('0x41')];_0x2533de[_0x5d15('0x42')]=_0x260134[_0x5d15('0x42')];_0x2533de['outboundUnknownCallsDay']=_0x260134[_0x5d15('0x43')];_0x2533de['predictiveIntervalAnsweredCalls']=_0x260134[_0x5d15('0x44')];_0x2533de[_0x5d15('0x45')]=_0x260134['predictiveIntervalAvgHoldtime'];_0x2533de[_0x5d15('0x46')]=_0x260134[_0x5d15('0x46')];_0x2533de[_0x5d15('0x47')]=_0x260134[_0x5d15('0x47')];_0x2533de['predictiveIntervalDroppedCallsTimeout']=_0x260134[_0x5d15('0x48')];_0x2533de[_0x5d15('0x49')]=_0x260134[_0x5d15('0x49')];_0x2533de[_0x5d15('0x4a')]=_0x260134['predictiveIntervalErlangCallsDroppedCalls'];_0x2533de[_0x5d15('0x4b')]=_0x260134[_0x5d15('0x4b')];_0x2533de[_0x5d15('0x4c')]=_0x260134[_0x5d15('0x4c')];_0x2533de['predictiveIntervalPauses']=_0x260134['predictiveIntervalPauses'];_0x2533de['predictiveIntervalAvailable']=_0x260134[_0x5d15('0x4d')];_0x2533de[_0x5d15('0x4e')]=_0x260134['predictiveIntervalTotalCalls'];_0x2533de[_0x5d15('0x19')]=_0x260134['message'];_0x2533de[_0x5d15('0x4f')]=_0x260134[_0x5d15('0x4f')];_0x2533de[_0x5d15('0x50')]=_0x260134[_0x5d15('0x50')];_0x2533de[_0x5d15('0x51')]=_0x260134[_0x5d15('0x51')];_0x2533de[_0x5d15('0x52')]=_0x260134[_0x5d15('0x52')];_0x2533de[_0x5d15('0x53')]=_0x260134['erlangBusyFactor'];_0x2533de[_0x5d15('0x54')]=_0x260134['startPredictive'];_0x2533de[_0x5d15('0x55')]=_0x260134['startProgressive'];}if(_0x260134[_0x5d15('0x56')]){_0x2533de[_0x5d15('0x56')]={'id':_0x260134[_0x5d15('0x56')]['id'],'name':_0x260134['Trunk']['name'],'active':_0x260134['Trunk']['active'],'callerid':_0x260134[_0x5d15('0x56')][_0x5d15('0x57')]};}if(_0x260134[_0x5d15('0x58')]){_0x2533de['Interval']={'id':_0x260134[_0x5d15('0x58')]['id'],'name':_0x260134[_0x5d15('0x58')][_0x5d15('0xa')]};}_0x128fb4['push'](_0x2533de);}}_0x216494({'count':_0x128fb4['length'],'rows':_0x128fb4});});},'VoiceChannels':function(_0x13dee2){return new Promise(function(_0x27a62d,_0x6fc771){var _0x5b9028=_[_0x5d15('0x59')](_0x124ab7[_0x5d15('0x5a')]);_0x27a62d({'count':_0x5b9028[_0x5d15('0x5b')],'rows':_0x5b9028});});},'VoiceChannelMixMonitor':function(_0x39d79f){var _0x372d52=this;return new Promise(function(_0x11ac1c,_0xc34865){if(ami['isConnected']()==![]){return _0xc34865(_0x372d52[_0x5d15('0x12')](0x1f4,[config[_0x5d15('0x13')]['ip'],config[_0x5d15('0x13')][_0x5d15('0x14')],_0x5d15('0x1c')][_0x5d15('0x1d')]('\x20')));}var _0x51cfd8=schema(properties['voicechannel'])['validate'](_0x39d79f);if(_0x51cfd8['length']>0x0){return _0xc34865(_0x372d52[_0x5d15('0x12')](0x1f4,_[_0x5d15('0x5c')](_0x51cfd8,_0x5d15('0x19'))[_0x5d15('0x1d')](',\x20')));}var _0x215e0a=_[_0x5d15('0x5d')](_0x124ab7[_0x5d15('0x5a')],{'uniqueid':_0x39d79f['uniqueid']});if(_0x215e0a&&_0x215e0a[_0x5d15('0x5e')]){var _0x2a85bf=util[_0x5d15('0x8')](_0x5d15('0x5f'),_0x39d79f['filename']||_0x39d79f['uniqueid'],_0x39d79f['format']||_0x5d15('0x60'));return ami[_0x5d15('0x17')]({'action':_0x5d15('0x61'),'channel':_0x215e0a[_0x5d15('0x5e')],'file':_0x2a85bf,'options':_0x5d15('0x62')})[_0x5d15('0x18')](function(_0x1d8483){var _0x2635c9=_[_0x5d15('0x5d')](_0x215e0a['monitors'],{'filename':_0x5d15('0x63')+_0x2a85bf[_0x5d15('0x64')]()});if(_[_0x5d15('0x65')](_0x2635c9)){_0x215e0a[_0x5d15('0x66')][_0x5d15('0x67')]({'filename':_0x5d15('0x63')+_0x2a85bf[_0x5d15('0x64')](),'createdAt':moment()[_0x5d15('0x8')](_0x5d15('0x68')),'mixmonitorid':_0x1d8483['mixmonitorid'],'status':_0x5d15('0x69')});}else{_0x2635c9['mixmonitorid']=_0x1d8483['mixmonitorid'];_0x2635c9[_0x5d15('0x6a')]=_0x5d15('0x69');}_0x11ac1c({'code':0xc8,'message':[_0x39d79f[_0x5d15('0x6b')],_0x5d15('0x6c'),_0x1d8483[_0x5d15('0x6d')]]['join']('\x20'),'mixmonitorid':_0x1d8483[_0x5d15('0x6d')]});})[_0x5d15('0x1a')](function(_0x20a00d){_0xc34865(_0x372d52[_0x5d15('0x12')](0x1f5,[_0x39d79f[_0x5d15('0x6b')],_0x20a00d[_0x5d15('0x19')][_0x5d15('0x64')]()][_0x5d15('0x1d')]('\x20')));});}else{return _0xc34865(_0x372d52[_0x5d15('0x12')](0x1f5,_0x5d15('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0x4a5887){var _0x573a46=this;return new Promise(function(_0x217558,_0x4f1679){if(ami[_0x5d15('0x1b')]()==![]){return _0x4f1679(_0x573a46[_0x5d15('0x12')](0x1f4,[config[_0x5d15('0x13')]['ip'],config[_0x5d15('0x13')][_0x5d15('0x14')],_0x5d15('0x1c')][_0x5d15('0x1d')]('\x20')));}var _0x2103a4=schema(properties[_0x5d15('0x6f')])['validate'](_0x4a5887);if(_0x2103a4[_0x5d15('0x5b')]>0x0){return _0x4f1679(_0x573a46[_0x5d15('0x12')](0x1f4,_['map'](_0x2103a4,'message')['join'](',\x20')));}var _0x5a0fcb=_['find'](_0x124ab7[_0x5d15('0x5a')],{'uniqueid':_0x4a5887[_0x5d15('0x6b')]});if(_0x5a0fcb){return BPromise[_0x5d15('0x70')]()['then'](function(){if(_0x5a0fcb[_0x5d15('0x5e')]){return ami['Action']({'action':_0x5d15('0x71'),'channel':_0x5a0fcb[_0x5d15('0x5e')],'mixmonitorid':_0x4a5887[_0x5d15('0x6d')]})['catch'](function(_0x32d01f){});}})[_0x5d15('0x18')](function(){if(_0x5a0fcb[_0x5d15('0x72')]){return ami['Action']({'action':_0x5d15('0x71'),'channel':_0x5a0fcb[_0x5d15('0x72')],'mixmonitorid':_0x4a5887[_0x5d15('0x6d')]})[_0x5d15('0x1a')](function(_0x11fc9b){});}})['then'](function(_0x3b340e){var _0x183fb5=_[_0x5d15('0x5d')](_0x5a0fcb[_0x5d15('0x66')],{'mixmonitorid':_0x4a5887[_0x5d15('0x6d')]});if(_0x183fb5){_0x183fb5['status']=_0x5d15('0x73');}})[_0x5d15('0x18')](function(){var _0x3f9e91=util[_0x5d15('0x8')](_0x5d15('0x5f'),_0x4a5887['filename']||_0x4a5887['uniqueid'],_0x4a5887[_0x5d15('0x8')]||_0x5d15('0x60'));var _0x1cd1c3=_[_0x5d15('0x5d')](_0x5a0fcb[_0x5d15('0x66')],{'filename':_0x5d15('0x63')+_0x3f9e91[_0x5d15('0x64')]()});if(_0x1cd1c3){_0x1cd1c3[_0x5d15('0x6a')]='stop';}})['then'](function(){_0x217558({'code':0xc8,'message':[_0x4a5887[_0x5d15('0x6b')],_0x5d15('0x74')][_0x5d15('0x1d')]('\x20')});})[_0x5d15('0x1a')](function(_0x408338){_0x4f1679(_0x573a46['error'](0x1f5,[_0x4a5887[_0x5d15('0x6b')],_0x408338[_0x5d15('0x19')][_0x5d15('0x64')]()][_0x5d15('0x1d')]('\x20')));});}else{return _0x4f1679(_0x573a46[_0x5d15('0x12')](0x1f5,_0x5d15('0x6e')));}});},'VoiceQueuesChannels':function(_0x3f0525){return new Promise(function(_0x469e6c,_0x27101c){var _0x31ac27=_[_0x5d15('0x59')](_0x124ab7[_0x5d15('0x75')]);_0x469e6c({'count':_0x31ac27[_0x5d15('0x5b')],'rows':_0x31ac27});});},'VoiceQueuesChannel':function(_0x4e5c79){var _0x5a8ef6=this;return new Promise(function(_0x3a30ce,_0x1b6649){var _0x54a29c=schema(properties[_0x5d15('0x76')])[_0x5d15('0x2')](_0x4e5c79);if(_0x54a29c[_0x5d15('0x5b')]>0x0){return _0x1b6649(_0x5a8ef6[_0x5d15('0x12')](0x1f4,_[_0x5d15('0x5c')](_0x54a29c,_0x5d15('0x19'))[_0x5d15('0x1d')](',\x20')));}var _0x43b718=_[_0x5d15('0x5d')](_0x124ab7[_0x5d15('0x75')],{'uniqueid':_0x4e5c79[_0x5d15('0x6b')]});if(_0x43b718){_0x3a30ce(_0x43b718);}else{return _0x1b6649(_0x5a8ef6[_0x5d15('0x12')](0x1f5,_0x5d15('0x6e')));}});},'VoiceQueuesChannelHangup':function(_0x215813){var _0x462ece=this;return new Promise(function(_0x24640b,_0x35dcac){if(ami[_0x5d15('0x1b')]()==![]){return _0x35dcac(_0x462ece[_0x5d15('0x12')](0x1f4,[config[_0x5d15('0x13')]['ip'],config[_0x5d15('0x13')][_0x5d15('0x14')],'ami\x20disconnected']['join']('\x20')));}var _0x1f36c1=schema(properties[_0x5d15('0x77')])[_0x5d15('0x2')](_0x215813);if(_0x1f36c1[_0x5d15('0x5b')]>0x0){return _0x35dcac(_0x462ece['error'](0x1f4,_[_0x5d15('0x5c')](_0x1f36c1,_0x5d15('0x19'))[_0x5d15('0x1d')](',\x20')));}var _0x1ec1a3=_[_0x5d15('0x5d')](_0x124ab7[_0x5d15('0x75')],{'uniqueid':_0x215813[_0x5d15('0x6b')]});if(_0x1ec1a3&&_0x1ec1a3[_0x5d15('0x5e')]){return ami[_0x5d15('0x17')]({'action':_0x5d15('0x78'),'channel':_0x1ec1a3['channel']})[_0x5d15('0x18')](function(_0x52cb4c){_0x24640b({'code':0xc8,'message':[_0x215813[_0x5d15('0x6b')],_0x52cb4c[_0x5d15('0x19')]['toLowerCase']()][_0x5d15('0x1d')]('\x20')});})['catch'](function(_0x2384ac){_0x35dcac(_0x462ece[_0x5d15('0x12')](0x1f5,[_0x215813[_0x5d15('0x6b')],_0x2384ac[_0x5d15('0x19')][_0x5d15('0x64')]()]['join']('\x20')));});}else{return _0x35dcac(_0x462ece['error'](0x1f5,_0x5d15('0x6e')));}});},'VoiceQueuesChannelRedirect':function(_0x5d2f93){var _0x2437ee=this;return new Promise(function(_0x46da68,_0x59cb86){if(ami[_0x5d15('0x1b')]()==![]){return _0x59cb86(_0x2437ee[_0x5d15('0x12')](0x1f4,[config[_0x5d15('0x13')]['ip'],config[_0x5d15('0x13')][_0x5d15('0x14')],_0x5d15('0x1c')][_0x5d15('0x1d')]('\x20')));}var _0xceacf5=schema(properties[_0x5d15('0x79')])[_0x5d15('0x2')](_0x5d2f93);if(_0xceacf5[_0x5d15('0x5b')]>0x0){return _0x59cb86(_0x2437ee[_0x5d15('0x12')](0x1f4,_['map'](_0xceacf5,'message')[_0x5d15('0x1d')](',\x20')));}var _0x46b33c=_[_0x5d15('0x5d')](_0x124ab7[_0x5d15('0x75')],{'uniqueid':_0x5d2f93[_0x5d15('0x6b')]});if(_0x46b33c&&_0x46b33c[_0x5d15('0x5e')]){return ami['Action']({'action':'Redirect','channel':_0x46b33c[_0x5d15('0x5e')],'exten':_0x5d2f93[_0x5d15('0x7a')],'context':_0x5d2f93[_0x5d15('0x7b')]||_0x46b33c['context'],'priority':0x1})[_0x5d15('0x18')](function(_0x578fe5){_0x46da68({'code':0xc8,'message':[_0x5d2f93['uniqueid'],_0x578fe5[_0x5d15('0x19')][_0x5d15('0x64')]()][_0x5d15('0x1d')]('\x20')});})[_0x5d15('0x1a')](function(_0x234ba3){_0x59cb86(_0x2437ee[_0x5d15('0x12')](0x1f5,[_0x5d2f93[_0x5d15('0x6b')],_0x234ba3[_0x5d15('0x19')]['toLowerCase']()]['join']('\x20')));});}else{return _0x59cb86(_0x2437ee[_0x5d15('0x12')](0x1f5,_0x5d15('0x6e')));}});},'Agents':function(_0x2b8bbc){return new Promise(function(_0x38e8d0,_0x5a2280){var _0x3fe721=_[_0x5d15('0x59')](_0x124ab7[_0x5d15('0xe')]);_0x38e8d0({'count':_0x3fe721['length'],'rows':_0x3fe721});});},'Telephones':function(_0x412387){return new Promise(function(_0x41f126,_0x542d1b){var _0x1ac1e0=_[_0x5d15('0x59')](_0x124ab7['telephones']);_0x41f126({'count':_0x1ac1e0[_0x5d15('0x5b')],'rows':_0x1ac1e0});});},'Trunks':function(_0x2a0054){return new Promise(function(_0x338e50,_0xb621f3){var _0x36b99e=_[_0x5d15('0x59')](_0x124ab7[_0x5d15('0x7c')]);_0x338e50({'count':_0x36b99e[_0x5d15('0x5b')],'rows':_0x36b99e});});},'OutboundChannels':function(_0x2dc3c3){return new Promise(function(_0x16de6b,_0x56b694){var _0x1d331d=_[_0x5d15('0x59')](_0x124ab7[_0x5d15('0x7d')]);_0x16de6b({'count':_0x1d331d['length'],'rows':_0x1d331d});});},'Outbound':function(_0x5d3f39){return new Promise(function(_0x4e2142,_0x227a92){_0x4e2142(_0x124ab7['outbound']);});},'Campaigns':function(_0x29c62b){return new Promise(function(_0x16d277,_0x438f63){var _0x27d043=_[_0x5d15('0x59')](_0x124ab7[_0x5d15('0x7e')]);_0x16d277({'count':_0x27d043[_0x5d15('0x5b')],'rows':_0x27d043});});},'VoiceQueuesPreview':function(_0x7f09ba){var _0x5407b1=this;return new Promise(function(_0x78535f,_0x7ae008){_0x105abb['run'](_0x7f09ba['id'])[_0x5d15('0x18')](function(_0x21656a){_0x78535f({'code':0xc8,'message':_0x21656a['message']});})[_0x5d15('0x1a')](function(_0x1622ef){_0x7ae008(_0x5407b1['error'](0x1f4,_0x1622ef[_0x5d15('0x19')]));});});},'EventManager':function(_0x4ec0fe){var _0x17a9c8=this;return new Promise(function(_0x11df46,_0x308256){if(!_0x4ec0fe['event']){return _0x308256(_0x17a9c8[_0x5d15('0x12')](0x1f4,_0x5d15('0x7f')));}ami[_0x5d15('0x80')](_0x5d15('0x81')+_0x4ec0fe[_0x5d15('0x82')],_0x4ec0fe[_0x5d15('0x19')]);_0x11df46({'code':0xc8,'message':_0x4ec0fe});});},'FaxAccounts':function(_0x424dcd){return new Promise(function(_0x583bad,_0x15ee9c){var _0x5b1c85=_['values'](_0x124ab7[_0x5d15('0x83')]);_0x583bad({'count':_0x5b1c85['length'],'rows':_0x5b1c85});});},'SendFax':function(_0x2b3029){var _0x4adf5e=this;return new Promise(function(_0x4a9d91,_0x1d60de){_0x112daa[_0x5d15('0x84')](_0x2b3029)[_0x5d15('0x18')](function(_0x4b95ca){_0x4a9d91({'code':0xc8,'message':_0x4b95ca[_0x5d15('0x19')]});})['catch'](function(_0x50726b){_0x1d60de(_0x4adf5e['error'](0x1f4,_0x50726b[_0x5d15('0x19')]));});});},'CheckAfterSend':function(_0x165ef5){var _0x2ea391=this;return new Promise(function(_0x76acb3,_0x30c8b2){_0x112daa[_0x5d15('0x85')](_0x165ef5)['then'](function(_0x1ee105){_0x76acb3({'code':0xc8,'message':_0x1ee105['message']});})[_0x5d15('0x1a')](function(_0x3449f3){_0x30c8b2(_0x2ea391[_0x5d15('0x12')](0x1f4,_0x3449f3['message']));});});}};var _0x1ec340=jayson[_0x5d15('0x86')](_0x3df375)[_0x5d15('0x87')]();_0x1ec340['on'](_0x5d15('0x12'),function(_0xf26af){return _0x5c4156(_0xf26af);});_0x1ec340[_0x5d15('0x88')](0x232a,_0x5d15('0x89'),function(){console['log'](_0x5d15('0x8a'),0x232a);return _0x204aa8(_0x5d15('0x8b')+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 c60358b..919823e 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 _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
+var _0x5a13=['trigger:%s','action','toLowerCase','[%s][%s]\x20Contact\x20not\x20found','createContact','[%s][%s]\x20Contact\x20created:%s','xmd-contactid2','user:%s','format','merge','catch','error','[%s][%s]\x20Error\x20creating\x20contact','[%s][%s]\x20Autocreate\x20disabled','util','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','redis','info','stringify','emit','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','destcalleridname','','destcalleridnum','uniqueid','phone','resolve','showContact','omit','then','[%s][%s]\x20Contact\x20found:%s','name'];(function(_0x464001,_0x2ed1db){var _0x5693d2=function(_0x225a76){while(--_0x225a76){_0x464001['push'](_0x464001['shift']());}};_0x5693d2(++_0x2ed1db);}(_0x5a13,0x92));var _0x35a1=function(_0x488a00,_0x192514){_0x488a00=_0x488a00-0x0;var _0x290c2f=_0x5a13[_0x488a00];return _0x290c2f;};'use strict';var BPromise=require('bluebird');var util=require(_0x35a1('0x0'));var _=require(_0x35a1('0x1'));var Redis=require(_0x35a1('0x2'));var config=require(_0x35a1('0x3'));var logger=require(_0x35a1('0x4'))(_0x35a1('0x5'));var cmContactRpc=require('../../rpc/cmContact');config[_0x35a1('0x6')]=_['defaults'](config[_0x35a1('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x4222a1,_0x3bd7c9,_0xb00a35,_0x3ed235){logger[_0x35a1('0x7')]('[%s][%s]',_0x4222a1,'',_0x3bd7c9,_0xb00a35,JSON[_0x35a1('0x8')](_0x3ed235));io['to'](_0x3bd7c9)[_0x35a1('0x9')](_0xb00a35,_0x3ed235);}exports[_0x35a1('0xa')]=function(_0x3c4501,_0x10d627,_0x2d9801){_0x2d9801[_0x35a1('0xb')]=0x0;if(_0x10d627[_0x35a1('0xc')]&&parseInt(_0x10d627[_0x35a1('0xc')],0xa)){var _0x5ee208={'ListId':parseInt(_0x10d627[_0x35a1('0xd')],0xa),'phone':_0x2d9801[_0x35a1('0xe')]};if(_[_0x35a1('0xf')](_0x2d9801[_0x35a1('0x10')])){_0x5ee208[_0x35a1('0x11')]=_0x2d9801['calleridname']&&_0x2d9801[_0x35a1('0x12')]!==''?_0x2d9801[_0x35a1('0x12')]:_0x2d9801[_0x35a1('0xe')]||_0x2d9801['uniqueid'];}else{_0x5ee208[_0x35a1('0x11')]=_0x2d9801[_0x35a1('0x13')]&&_0x2d9801[_0x35a1('0x13')]!==_0x35a1('0x14')?_0x2d9801['destcalleridname']:_0x2d9801[_0x35a1('0x15')]||_0x2d9801[_0x35a1('0x16')];_0x5ee208[_0x35a1('0x17')]=_0x2d9801[_0x35a1('0x13')]&&_0x2d9801['destcalleridname']!==_0x35a1('0x14')?_0x2d9801[_0x35a1('0x13')]:_0x2d9801['destcalleridnum']||_0x2d9801[_0x35a1('0x16')];}BPromise[_0x35a1('0x18')]()['then'](cmContactRpc[_0x35a1('0x19')]({'where':_[_0x35a1('0x1a')](_0x5ee208,[_0x35a1('0x11')])}))[_0x35a1('0x1b')](function(_0x363fb4){if(_0x363fb4){logger['info'](_0x35a1('0x1c'),_0x2d9801[_0x35a1('0x16')],'',_0x363fb4['id']);if(_0x3c4501){_0x2d9801['xmd-contactid2']=_0x363fb4['id'];emit(_0x2d9801['uniqueid'],util['format']('user:%s',_0x3c4501[_0x35a1('0x1d')]),util['format'](_0x35a1('0x1e'),_0x10d627[_0x35a1('0x1f')][_0x35a1('0x20')]()),_['merge'](_0x2d9801,{'ListId':parseInt(_0x10d627[_0x35a1('0xd')],0xa)}));}return;}else{logger[_0x35a1('0x7')](_0x35a1('0x21'),_0x2d9801[_0x35a1('0x16')],'');return BPromise[_0x35a1('0x18')]()[_0x35a1('0x1b')](cmContactRpc[_0x35a1('0x22')](_0x5ee208));}})[_0x35a1('0x1b')](function(_0x4c8945){if(_0x4c8945){logger[_0x35a1('0x7')](_0x35a1('0x23'),_0x2d9801['uniqueid'],'',_0x4c8945['id']);if(_0x3c4501){_0x2d9801[_0x35a1('0x24')]=_0x4c8945['id'];emit(_0x2d9801[_0x35a1('0x16')],util['format'](_0x35a1('0x25'),_0x3c4501[_0x35a1('0x1d')]),util[_0x35a1('0x26')](_0x35a1('0x1e'),_0x10d627[_0x35a1('0x1f')][_0x35a1('0x20')]()),_[_0x35a1('0x27')](_0x2d9801,{'ListId':parseInt(_0x10d627[_0x35a1('0xd')],0xa)}));}}})[_0x35a1('0x28')](function(_0x516595){logger[_0x35a1('0x29')](_0x35a1('0x2a'),_0x2d9801['uniqueid'],'',JSON['stringify'](_0x516595));});}else{if(_0x3c4501){logger[_0x35a1('0x7')](_0x35a1('0x2b'),_0x2d9801[_0x35a1('0x16')],'');emit(_0x2d9801[_0x35a1('0x16')],util[_0x35a1('0x26')](_0x35a1('0x25'),_0x3c4501[_0x35a1('0x1d')]),util[_0x35a1('0x26')]('trigger:%s',_0x10d627['action'][_0x35a1('0x20')]()),_[_0x35a1('0x27')]({'ListId':parseInt(_0x10d627[_0x35a1('0xd')],0xa)},_0x2d9801));}}};
\ No newline at end of file
diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js
index 55a978f..c677984 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 _0x57fc=['./script','../../../config/environment','../ami','redis','defaults','localhost','socket.io-emitter','popup','triggers','agents','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','accounts','servicenowAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:outgoingmessage','custom:acceptmessage','prototype','info','stringify','emit','clone','checkTriggers','hasOwnProperty','checkTrigger','merge','variables','Actions','length','interface','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','html','data2','render','uri','buildUri','data3','isNil','data4','location','uriLocation','windowWidth','800','data5','windowHeight','data6','600','winapp','winArguments','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','exec','integration','voiceQueues','routeId','urlforward','AllConditions','every','checkConditions','channel','some','field','account','chat','ChatWebsiteId','value','operator','upperFirst','AccountId','message','event','queue','agent','membername','lastevent','util','url','mustache','ioredis','./urlforward','./integration','./cmContact'];(function(_0x2335d2,_0xf13ea4){var _0x24051a=function(_0x119053){while(--_0x119053){_0x2335d2['push'](_0x2335d2['shift']());}};_0x24051a(++_0xf13ea4);}(_0x57fc,0x1c9));var _0xc57f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x57fc[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xc57f('0x0'));var _=require('lodash');var url=require(_0xc57f('0x1'));var Mustache=require(_0xc57f('0x2'));var Redis=require(_0xc57f('0x3'));var urlforward=require(_0xc57f('0x4'));var integration=require(_0xc57f('0x5'));var cmContact=require(_0xc57f('0x6'));var script=require(_0xc57f('0x7'));var cmContactRpc=require('../rpc/cmContact');var config=require(_0xc57f('0x8'));var logger=require('../../../config/logger')('trigger');var ami=require(_0xc57f('0x9'));config[_0xc57f('0xa')]=_[_0xc57f('0xb')](config[_0xc57f('0xa')],{'host':_0xc57f('0xc'),'port':0x18eb});var io=require(_0xc57f('0xd'))(new Redis(config[_0xc57f('0xa')]));var operators={'equals':function(_0x35148c,_0x3ce12d){return _0x35148c==_0x3ce12d;},'not_equals':function(_0x379b45,_0x285c21){return _0x379b45!=_0x285c21;}};var barAndWebActions=[_0xc57f('0xe'),'url','winapp'];function Trigger(_0x153a17){this[_0xc57f('0xf')]=_0x153a17['triggers'];this[_0xc57f('0x10')]=_0x153a17[_0xc57f('0x10')];this['voiceQueues']=_0x153a17['voiceQueues'];this[_0xc57f('0x11')]=_0x153a17[_0xc57f('0x11')];this[_0xc57f('0x12')]=_0x153a17[_0xc57f('0x12')];this['zendeskAccounts']=_0x153a17[_0xc57f('0x13')];this[_0xc57f('0x14')]=_0x153a17[_0xc57f('0x14')];this[_0xc57f('0x15')]=_0x153a17[_0xc57f('0x15')];this[_0xc57f('0x16')]=_0x153a17[_0xc57f('0x16')];this['zohoAccounts']=_0x153a17[_0xc57f('0x17')];this[_0xc57f('0x18')]=_0x153a17['deskAccounts'];this[_0xc57f('0x19')]=_0x153a17[_0xc57f('0x19')];this['servicenowAccounts']=_0x153a17['servicenowAccounts'];this[_0xc57f('0x1a')]=_0x153a17[_0xc57f('0x1a')];this[_0xc57f('0x1b')]=_0x153a17[_0xc57f('0x1b')];this[_0xc57f('0x1c')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xc57f('0x15')],'freshdesk':this[_0xc57f('0x14')],'sugarcrm':this[_0xc57f('0x16')],'zoho':this[_0xc57f('0x17')],'desk':this[_0xc57f('0x18')],'vtiger':this[_0xc57f('0x19')],'dynamics365':this[_0xc57f('0x1a')],'freshsales':this[_0xc57f('0x1b')],'servicenow':this[_0xc57f('0x1d')]};ami['on'](_0xc57f('0x1e'),this[_0xc57f('0x1f')][_0xc57f('0x20')](this));ami['on'](_0xc57f('0x21'),this[_0xc57f('0x1f')][_0xc57f('0x20')](this));ami['on'](_0xc57f('0x22'),this[_0xc57f('0x1f')]['bind'](this));ami['on'](_0xc57f('0x23'),this[_0xc57f('0x1f')][_0xc57f('0x20')](this));ami['on'](_0xc57f('0x24'),this[_0xc57f('0x1f')][_0xc57f('0x20')](this));ami['on']('custom:agentnoanswer',this[_0xc57f('0x1f')][_0xc57f('0x20')](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0xc57f('0x20')](this));ami['on'](_0xc57f('0x25'),this[_0xc57f('0x1f')]['bind'](this));ami['on'](_0xc57f('0x26'),this[_0xc57f('0x1f')]['bind'](this));ami['on'](_0xc57f('0x27'),this[_0xc57f('0x1f')][_0xc57f('0x20')](this));ami['on'](_0xc57f('0x28'),this[_0xc57f('0x1f')][_0xc57f('0x20')](this));ami['on'](_0xc57f('0x29'),this[_0xc57f('0x2a')][_0xc57f('0x20')](this));ami['on'](_0xc57f('0x2b'),this[_0xc57f('0x2a')]['bind'](this));ami['on'](_0xc57f('0x2c'),this['syncAgentDial'][_0xc57f('0x20')](this));ami['on'](_0xc57f('0x2d'),this[_0xc57f('0x1f')][_0xc57f('0x20')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0xc57f('0x20')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent']['bind'](this));ami['on'](_0xc57f('0x2e'),this[_0xc57f('0x1f')][_0xc57f('0x20')](this));ami['on'](_0xc57f('0x2f'),this[_0xc57f('0x1f')][_0xc57f('0x20')](this));ami['on']('custom:rejectmessage',this['syncCustomEvent']['bind'](this));}Trigger[_0xc57f('0x30')]['emit']=function(_0x291013,_0x47a04a,_0xb10178){logger[_0xc57f('0x31')](_0x291013,_0x47a04a,JSON[_0xc57f('0x32')](_0xb10178));io['to'](_0x291013)[_0xc57f('0x33')](_0x47a04a,_0xb10178);};Trigger[_0xc57f('0x30')][_0xc57f('0x1f')]=function(_0x12715f){var _0x44a6d2=_[_0xc57f('0x34')](_0x12715f);this['checkTriggers'](_0x44a6d2);};Trigger[_0xc57f('0x30')][_0xc57f('0x2a')]=function(_0xb5789c){if(this[_0xc57f('0x10')][_0xb5789c['interface']]){this[_0xc57f('0x1f')](_0xb5789c);}};Trigger[_0xc57f('0x30')][_0xc57f('0x35')]=function(_0x5a035b){var _0x3c319d;for(var _0x1e8fe6 in this['triggers']){if(this[_0xc57f('0xf')][_0xc57f('0x36')](_0x1e8fe6)){if(this[_0xc57f('0xf')][_0x1e8fe6]['status']){_0x3c319d=this[_0xc57f('0x37')](this[_0xc57f('0xf')][_0x1e8fe6],_0x5a035b);if(_0x3c319d){_[_0xc57f('0x38')](_0x5a035b,_0x5a035b[_0xc57f('0x39')]);for(var _0x3916ec=0x0,_0x16581a,_0x1c6b2b,_0x826c54;_0x3916ec0x0){_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(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 d6acc4b..a8dd90d 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 _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
+var _0xde5f=['substring','lastIndexOf','message','contacts?$select=telephone1','outbound','enduserId','forEach','type','string','customField','idField','indexOf','content','ticketType','incident','assign','getString','Subjects','Descriptions','Fields','phonecall','/contacts(','callDirection','queue','headers','format','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','ticketId','inspect','lodash','bluebird','request-promise','util','md5','ioredis','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','POST','remoteUri','username','password','clientSecret','then','access_token','error','toUpperCase','GET','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId','systemuserid','catch','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','Bearer\x20'];(function(_0x4a3569,_0x24a2c0){var _0x1b89e9=function(_0x373e32){while(--_0x373e32){_0x4a3569['push'](_0x4a3569['shift']());}};_0x1b89e9(++_0x24a2c0);}(_0xde5f,0xd6));var _0xfde5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde5f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfde5('0x0'));var BPromise=require(_0xfde5('0x1'));var rp=require(_0xfde5('0x2'));var util=require(_0xfde5('0x3'));var intUtil=require('./util');var md5=require(_0xfde5('0x4'));var Redis=require(_0xfde5('0x5'));var logger=require('../../../../config/logger')(_0xfde5('0x6'));var config=require(_0xfde5('0x7'));config[_0xfde5('0x8')]=_['defaults'](config['redis'],{'host':_0xfde5('0x9'),'port':0x18eb});var io=require(_0xfde5('0xa'))(new Redis(config[_0xfde5('0x8')]));function getAuthToken(_0x39ca57,_0x2a6fe9,_0x1ddae6){var _0x520823={'method':_0xfde5('0xb'),'uri':_0x2a6fe9,'form':{'client_id':_0x39ca57['clientId'],'resource':_0x39ca57[_0xfde5('0xc')],'username':_0x39ca57[_0xfde5('0xd')],'password':_0x39ca57['password'],'grant_type':_0xfde5('0xe'),'client_secret':_0x39ca57[_0xfde5('0xf')]},'json':!![]};return rp(_0x520823)[_0xfde5('0x10')](function(_0x3a07e0){return _0x3a07e0[_0xfde5('0x11')];})['catch'](function(_0x50fa1e){logger[_0xfde5('0x12')]('['+[_0x1ddae6[_0xfde5('0x13')]()]+']\x20Wrong\x20credentials!');return _0x50fa1e['message'];});}function getUser(_0x8bb77f,_0x35279c,_0x399fb2,_0x54aa11,_0x1a8599,_0x47c0ad){return new BPromise(function(_0x3c6f41,_0x23e56a){return getAuthToken(_0x35279c,_0x54aa11,_0x47c0ad)[_0xfde5('0x10')](function(_0x537710){var _0x231e28={'method':_0xfde5('0x14'),'uri':_0x1a8599+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x537710,'OData-Version':_0xfde5('0x15')},'json':!![]};return rp(_0x231e28);})[_0xfde5('0x10')](function(_0x25dbfd){var _0x3c449d=_0x25dbfd[_0xfde5('0x16')];var _0x4e972c=![];var _0x6d8fdc=null;if(!_[_0xfde5('0x17')](_0x399fb2)){if(intUtil[_0xfde5('0x18')](_0x399fb2[_0xfde5('0x19')])){_0x8bb77f[_0xfde5('0x1a')]=_0x399fb2[_0xfde5('0x19')];for(_0x6d8fdc=0x0;_0x6d8fdc<_0x3c449d[_0xfde5('0x1b')];_0x6d8fdc++){if(_0x3c449d[_0x6d8fdc][_0xfde5('0x1c')]===_0x399fb2['email']&&!_0x3c449d[_0x6d8fdc][_0xfde5('0x1d')]){_0x4e972c=!![];logger[_0xfde5('0x1e')]('['+[_0x47c0ad[_0xfde5('0x13')]()]+_0xfde5('0x1f')+_0x3c449d[_0x6d8fdc]['systemuserid']+'!');_0x8bb77f[_0xfde5('0x20')]=_0x3c449d[_0x6d8fdc][_0xfde5('0x21')];}}}}if(!_0x4e972c){logger['info']('['+[_0x47c0ad[_0xfde5('0x13')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x8bb77f[_0xfde5('0x1a')]=_0x35279c[_0xfde5('0xd')];for(_0x6d8fdc=0x0;_0x6d8fdc<_0x3c449d[_0xfde5('0x1b')];_0x6d8fdc++){if(_0x3c449d[_0x6d8fdc][_0xfde5('0x1c')]===_0x35279c['username']){_0x8bb77f[_0xfde5('0x20')]=_0x3c449d[_0x6d8fdc][_0xfde5('0x21')];}}}_0x3c6f41(_0x8bb77f);})[_0xfde5('0x22')](function(_0x347bcc){_0x23e56a(_0x347bcc['message']);});});}function createEndUser(_0x44dab4,_0x3f6ac6,_0x5bb256,_0x20cf7d,_0x460683,_0x42f019){return new BPromise(function(_0x2ab0a3,_0x5a29c4){return getAuthToken(_0x3f6ac6,_0x5bb256,_0x42f019)['then'](function(_0x3d579e){var _0x4f1246=_0x42f019[_0xfde5('0x23')]()==='outbound'?_0x460683[_0xfde5('0x24')]:_0x460683[_0xfde5('0x25')];var _0x3dbd34={'method':'POST','uri':_0x20cf7d+_0xfde5('0x26'),'body':{'telephone1':_0x4f1246,'fullname':_0x4f1246,'firstname':_0x4f1246,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xfde5('0x27')+_0x44dab4[_0xfde5('0x20')]+')'},'headers':{'Authorization':_0xfde5('0x28')+_0x3d579e,'OData-Version':_0xfde5('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3dbd34);})[_0xfde5('0x10')](function(_0x555c93){var _0x259b28=_0x555c93['headers']['odata-entityid'];var _0x5e5f61=_0x259b28[_0xfde5('0x29')](_0x259b28[_0xfde5('0x2a')]('(')+0x1,_0x259b28[_0xfde5('0x2a')](')'));_0x44dab4['enduserId']=_0x5e5f61;_0x2ab0a3(_0x44dab4);})[_0xfde5('0x22')](function(_0x2ccbb7){_0x5a29c4(_0x2ccbb7[_0xfde5('0x2b')]);});});}function getEndUser(_0x5becaa,_0x551615,_0x206e2b,_0x5daf64,_0xb303b3,_0x2874dd){return new BPromise(function(_0x487461,_0x44482b){return getAuthToken(_0x551615,_0x206e2b,_0x2874dd)[_0xfde5('0x10')](function(_0x4328b6){var _0x76a6dc={'method':'GET','uri':_0x5daf64+_0xfde5('0x2c'),'headers':{'Authorization':'Bearer\x20'+_0x4328b6,'If-None-Match':null,'OData-Version':_0xfde5('0x15')},'json':!![]};return rp(_0x76a6dc);})['then'](function(_0x5e5735){var _0x56ebed=null;if(_0x5e5735){var _0x67a33f=_0x5e5735[_0xfde5('0x16')];var _0x230240=![];for(_0x56ebed=0x0;_0x56ebed<_0x67a33f['length'];_0x56ebed++){var _0x3c0517=_0x2874dd[_0xfde5('0x23')]()===_0xfde5('0x2d')?_0xb303b3[_0xfde5('0x24')]:_0xb303b3[_0xfde5('0x25')];if(_0x67a33f[_0x56ebed]['telephone1']===_0x3c0517){_0x230240=!![];_0x5becaa['enduserId']=_0x67a33f[_0x56ebed]['contactid'];}}if(_0x230240){_0x487461(_0x5becaa);}else{return createEndUser(_0x5becaa,_0x551615,_0x206e2b,_0x5daf64,_0xb303b3,_0x2874dd)[_0xfde5('0x10')](function(_0x1a77bb){logger[_0xfde5('0x1e')]('['+[_0x2874dd[_0xfde5('0x13')]()]+']\x20Enduser\x20created!',_0x1a77bb['enduserId']);_0x487461(_0x1a77bb);});}}else{return createEndUser(_0x5becaa,_0x551615,_0x206e2b,_0x5daf64,_0xb303b3,_0x2874dd)['then'](function(_0x5dea7c){logger[_0xfde5('0x1e')]('['+[_0x2874dd[_0xfde5('0x13')]()]+']\x20Enduser\x20Created!',_0x5dea7c[_0xfde5('0x2e')]);_0x487461(_0x5dea7c);});}});});}function getCustomFields(_0x2bdd38,_0x57fc53,_0x58e88d){var _0x1d79d2={};if(_0x2bdd38[_0xfde5('0x1b')]>0x0){_[_0xfde5('0x2f')](_0x2bdd38,function(_0x9b7a03){if(_0x9b7a03[_0xfde5('0x30')]===_0xfde5('0x31')&&_0x9b7a03['nameField']&&!_0x9b7a03[_0xfde5('0x32')]){var _0x1ecc2b=_0x9b7a03[_0xfde5('0x33')][_0xfde5('0x23')]();var _0x37d271=_0x1ecc2b[_0xfde5('0x29')](0x0,_0x1ecc2b[_0xfde5('0x34')]('_'));var _0x31904e=_0x1ecc2b[_0xfde5('0x29')](_0x1ecc2b['indexOf']('_')+0x1);if(_0x37d271===_0x58e88d){_0x1d79d2[_0x31904e]=_0x9b7a03[_0xfde5('0x35')];}}});}return _0x1d79d2;}function getTicket(_0x5e3882,_0x32a8e0,_0x15329b,_0x2ae4b3,_0x6b829d,_0x32817f,_0x2d4635){return new BPromise(function(_0x3405ff,_0x4b0b79){var _0x1556aa;return getAuthToken(_0x32a8e0,_0x15329b,_0x2d4635)[_0xfde5('0x10')](function(_0x16e34f){if(_0x32817f[_0xfde5('0x36')]===_0xfde5('0x37')){_0x1556aa={'method':'POST','uri':_0x2ae4b3+'incidents','body':Object[_0xfde5('0x38')]({},{'title':intUtil[_0xfde5('0x39')](_0x32817f[_0xfde5('0x3a')],_0x6b829d,'\x20'),'description':intUtil[_0xfde5('0x39')](_0x32817f[_0xfde5('0x3b')],_0x6b829d,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x5e3882[_0xfde5('0x2e')]+')','ownerid@odata.bind':_0xfde5('0x27')+_0x5e3882[_0xfde5('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x32817f[_0xfde5('0x3c')],_0x6b829d,_0x32817f[_0xfde5('0x36')])),'headers':{'Authorization':_0xfde5('0x28')+_0x16e34f,'OData-Version':_0xfde5('0x15')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x32817f['ticketType']===_0xfde5('0x3d')){_0x1556aa={'method':_0xfde5('0xb'),'uri':_0x2ae4b3+'phonecalls','body':Object['assign']({},{'subject':intUtil[_0xfde5('0x39')](_0x32817f[_0xfde5('0x3a')],_0x6b829d,'\x20'),'phonenumber':String(_0x6b829d[_0xfde5('0x25')]),'description':intUtil['getString'](_0x32817f[_0xfde5('0x3b')],_0x6b829d,'\x0a'),'regardingobjectid_contact@odata.bind':_0xfde5('0x3e')+_0x5e3882[_0xfde5('0x2e')]+')','ownerid@odata.bind':_0xfde5('0x27')+_0x5e3882[_0xfde5('0x20')]+')','directioncode':_0x5e3882[_0xfde5('0x3f')]===_0xfde5('0x40')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xfde5('0x27')+_0x5e3882['userId']+')','participationtypemask':_0x5e3882[_0xfde5('0x3f')]===_0xfde5('0x40')?0x2:0x1},{'partyid_contact@odata.bind':_0xfde5('0x3e')+_0x5e3882[_0xfde5('0x2e')]+')','participationtypemask':_0x5e3882[_0xfde5('0x3f')]===_0xfde5('0x40')?0x1:0x2}]},getCustomFields(_0x32817f['Fields'],_0x6b829d,_0x32817f[_0xfde5('0x36')])),'headers':{'Authorization':_0xfde5('0x28')+_0x16e34f,'OData-Version':_0xfde5('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1556aa);})[_0xfde5('0x10')](function(_0x21545d){var _0xc51556=_0x21545d[_0xfde5('0x41')]['odata-entityid'];var _0x4c1293=_0xc51556['substring'](_0xc51556[_0xfde5('0x2a')]('(')+0x1,_0xc51556[_0xfde5('0x2a')](')'));_0x5e3882['ticketId']=_0x4c1293;_0x3405ff(_0x5e3882);})[_0xfde5('0x22')](function(_0x22e2de){_0x4b0b79(_0x22e2de[_0xfde5('0x2b')]);});});}function emit(_0x438334,_0xb420ac,_0xde1a9b,_0x1c8349){var _0x211280={'uri':util[_0xfde5('0x42')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x438334,_0xde1a9b,_0x1c8349)};io['to'](util[_0xfde5('0x42')](_0xfde5('0x43'),_0xb420ac))['emit'](_0xfde5('0x44'),_0x211280);}exports['cs']=function(_0xebc412,_0x56e4bf,_0x3284a1,_0x152e03,_0x139d30,_0x56da70,_0xb0a5a,_0x51da91){var _0x2e31c4={};_0x56da70[_0xfde5('0xc')]=intUtil[_0xfde5('0x45')](_0x56da70[_0xfde5('0xc')]);_0x56da70[_0xfde5('0x46')]=intUtil[_0xfde5('0x45')](_0x56da70[_0xfde5('0x46')]);_0x2e31c4[_0xfde5('0x3f')]=_0x51da91===_0xfde5('0x40')||_0x51da91===_0xfde5('0x47')?_0xfde5('0x40'):_0xfde5('0x2d');var _0x2090a9=util[_0xfde5('0x42')]('%s/api/data/v9.0/',_0x56da70['remoteUri']);var _0xac43b2=util[_0xfde5('0x42')](_0xfde5('0x48'),_0x56da70[_0xfde5('0x49')]);var _0x25f787=util[_0xfde5('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x56da70[_0xfde5('0x46')],_0x56e4bf[_0xfde5('0x4a')],md5(_0x56e4bf[_0xfde5('0x4a')]));if(_0x139d30&&_0x139d30['monitor_format']){logger[_0xfde5('0x1e')](_0xfde5('0x4b'),_0xfde5('0x4c'));_0x56e4bf[_0xfde5('0x4d')]=_0x25f787;}else if(_0xb0a5a&&_0xb0a5a[_0xfde5('0x4e')]&&_0xb0a5a[_0xfde5('0x4e')]!=='none'){logger[_0xfde5('0x1e')](_0xfde5('0x4f'),_0xfde5('0x4c'));_0x56e4bf[_0xfde5('0x4d')]=_0x25f787;}else{_0x56e4bf[_0xfde5('0x4d')]='';}return getUser(_0x2e31c4,_0x56da70,_0x152e03,_0xac43b2,_0x2090a9,_0x51da91)[_0xfde5('0x10')](function(_0x178820){logger[_0xfde5('0x1e')]('['+_0x51da91[_0xfde5('0x13')]()+']\x20The\x20User\x20ID\x20is:',_0x178820['userId']);logger[_0xfde5('0x1e')]('['+_0x51da91[_0xfde5('0x13')]()+_0xfde5('0x50'),_0x178820[_0xfde5('0x1a')]);return getEndUser(_0x178820,_0x56da70,_0xac43b2,_0x2090a9,_0x56e4bf,_0x51da91);})[_0xfde5('0x10')](function(_0xec2ab2){logger[_0xfde5('0x1e')]('['+_0x51da91['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0xec2ab2[_0xfde5('0x2e')]);logger[_0xfde5('0x1e')]('['+_0x51da91['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x56e4bf[_0xfde5('0x25')]);return getTicket(_0xec2ab2,_0x56da70,_0xac43b2,_0x2090a9,_0x56e4bf,_0x3284a1,_0x51da91);})[_0xfde5('0x10')](function(_0x5f3da4){logger[_0xfde5('0x1e')](util[_0xfde5('0x42')]('['+_0x51da91[_0xfde5('0x13')]()+_0xfde5('0x51'),_0x3284a1[_0xfde5('0x36')],_0x5f3da4['ticketId']));logger['info'](util[_0xfde5('0x42')]('['+_0x51da91['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x51da91));if(_0x51da91!==_0xfde5('0x47')){logger['info']('['+_0x51da91[_0xfde5('0x13')]()+']',_0xfde5('0x52'));emit(_0x56da70[_0xfde5('0xc')],_0x152e03['name'],_0x3284a1[_0xfde5('0x36')],_0x5f3da4[_0xfde5('0x53')]);}})[_0xfde5('0x22')](function(_0x4322f6){logger[_0xfde5('0x12')]('['+_0x51da91['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0xfde5('0x54')](_0x4322f6,{'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 07d3a2b..e18a3a6 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 _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
+var _0x72f9=['debug','[HTTP]','stringify','defaults','GET','map','forEach','type','string','nameField','customField','toString','idField','custom_fields','push','variable','variableName','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','error','[QUEUE]','outbound','serverUrl','recordingFormat','none','Authorization','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','trigger:browser:url','catch','unmanaged','lastevent','toUpperCase','request-promise','md5','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions',' ','Tags','Fields','keyBy','value','format','POST','then','Ticket\x20created!','validateEmail','remoteUri','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','base64'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x72f9,0xe9));var _0x972f=function(_0x3fe393,_0x234a3a){_0x3fe393=_0x3fe393-0x0;var _0x534d14=_0x72f9[_0x3fe393];return _0x534d14;};'use strict';var _=require('lodash');var rp=require(_0x972f('0x0'));var md5=require(_0x972f('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x972f('0x2'))(_0x972f('0x3'));config[_0x972f('0x4')]=_['defaults'](config[_0x972f('0x4')],{'host':_0x972f('0x5'),'port':0x18eb});var io=require(_0x972f('0x6'))(new Redis(config[_0x972f('0x4')]));var headers={'Content-Type':_0x972f('0x7'),'Accept':_0x972f('0x7')};function emit(_0x2e826e,_0xf50589,_0x4bcdb6){io['to'](_0x2e826e)[_0x972f('0x8')](_0xf50589,_0x4bcdb6);}function getTicket(_0x463fd7,_0x438173,_0x3012b4,_0x42ed77,_0x4ac494){logger[_0x972f('0x9')](_0x972f('0xa'));var _0x1bb10e=_[_0x972f('0xb')]({'responder_id':_0x438173['id'],'requester_id':_0x3012b4['id'],'name':util['format'](_0x972f('0xc'),_0x4ac494[_0x972f('0xd')]),'phone':_0x4ac494[_0x972f('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x972f('0xf')](_0x42ed77['Subjects'],_0x4ac494,'\x20'),'description':intUtil['getString'](_0x42ed77[_0x972f('0x10')],_0x4ac494,_0x972f('0x11')),'tags':getTags(_0x42ed77[_0x972f('0x12')],'name')},getCustomFields(_0x42ed77[_0x972f('0x13')],_0x4ac494));_0x1bb10e['custom_fields']=_['mapValues'](_[_0x972f('0x14')](_0x1bb10e['custom_fields'],'id'),_0x972f('0x15'));return request({'uri':util[_0x972f('0x16')]('%s/api/v2/tickets',_0x463fd7['remoteUri']),'method':_0x972f('0x17'),'body':_0x1bb10e})[_0x972f('0x18')](function(_0x3f6df8){logger['info'](_0x972f('0x19'));return _0x3f6df8;});}function getUser(_0x43d3c5,_0x52ab12){if(intUtil[_0x972f('0x1a')](_0x52ab12)){return request({'uri':util[_0x972f('0x16')]('%s/api/v2/agents',_0x43d3c5[_0x972f('0x1b')]),'qs':{'email':_0x52ab12}})[_0x972f('0x18')](function(_0x2e8514){if(_0x2e8514[_0x972f('0x1c')]){logger[_0x972f('0x9')](_0x972f('0x1d'));return _[_0x972f('0x1e')](_0x2e8514,function(_0xd7ef0d){return _0xd7ef0d['contact'][_0x972f('0x1f')]===_0x52ab12;});}else{logger[_0x972f('0x9')](_0x972f('0x20'));return request({'uri':util[_0x972f('0x16')]('%s/api/v2/agents/me',_0x43d3c5[_0x972f('0x1b')])})['then'](function(_0x1cbf8e){logger['info'](_0x972f('0x21'));return _0x1cbf8e;});}});}else{logger[_0x972f('0x9')](_0x972f('0x22'));return request({'uri':util[_0x972f('0x16')](_0x972f('0x23'),_0x43d3c5['remoteUri'])})[_0x972f('0x18')](function(_0x284587){logger[_0x972f('0x9')]('Admin\x20account\x20selected.');return _0x284587;});}}function getEndUser(_0xff63d8,_0xa469ef,_0x196fb6){logger[_0x972f('0x9')](_0x972f('0x24'),_0x196fb6);return request({'uri':util[_0x972f('0x16')](_0x972f('0x25'),_0xff63d8[_0x972f('0x1b')]),'qs':{'phone':_0x196fb6}})[_0x972f('0x18')](function(_0x1f2615){if(_0x1f2615[_0x972f('0x1c')]){logger['info'](_0x972f('0x26'));return _[_0x972f('0x1e')](_0x1f2615,{'phone':_0x196fb6});}else{logger[_0x972f('0x9')](_0x972f('0x27'));return request({'uri':util['format'](_0x972f('0x25'),_0xff63d8[_0x972f('0x1b')]),'method':_0x972f('0x17'),'body':{'name':_0xa469ef,'phone':_0x196fb6}})[_0x972f('0x18')](function(_0x47d792){logger[_0x972f('0x9')]('Enduser\x20created.');return _0x47d792;});}});}function getAuth(_0x5c50fa){return util[_0x972f('0x16')](_0x972f('0x28'),new Buffer(_0x5c50fa[_0x972f('0x29')]+':X')['toString'](_0x972f('0x2a')));}function request(_0x3ed541){logger[_0x972f('0x2b')](_0x972f('0x2c'),JSON[_0x972f('0x2d')](_0x3ed541));return rp(_[_0x972f('0x2e')](_0x3ed541,{'method':_0x972f('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0xd627b5,_0x125038){var _0x1c8ded=[];if(_0xd627b5&&_0xd627b5['length']>0x0){_0x1c8ded=_[_0x972f('0x30')](_0xd627b5,_0x125038);}return _0x1c8ded;}function getCustomFields(_0x3b9c54,_0x29a10a){var _0x1cdc39=[];var _0x2fef36={'custom_fields':[]};if(_0x3b9c54['length']>0x0){_[_0x972f('0x31')](_0x3b9c54,function(_0x3b461d){if(_0x3b461d[_0x972f('0x32')]===_0x972f('0x33')&&_0x3b461d[_0x972f('0x34')]&&!_0x3b461d[_0x972f('0x35')]){_0x2fef36[_0x3b461d[_0x972f('0x34')]['toLowerCase']()]=_0x3b461d['content'][_0x972f('0x36')]();}else if(_0x3b461d[_0x972f('0x32')]===_0x972f('0x33')&&_0x3b461d[_0x972f('0x37')]&&_0x3b461d['customField']){_0x2fef36[_0x972f('0x38')][_0x972f('0x39')]({'id':_0x3b461d[_0x972f('0x37')],'value':_0x3b461d['content'][_0x972f('0x36')]()});}else if(_0x3b461d['type']===_0x972f('0x3a')&&_0x3b461d[_0x972f('0x3b')]&&_0x3b461d[_0x972f('0x37')]&&_0x3b461d['customField']){_0x29a10a[_0x3b461d[_0x972f('0x3b')]]&&_0x2fef36['custom_fields'][_0x972f('0x39')]({'id':_0x3b461d[_0x972f('0x37')],'value':_0x29a10a[_0x3b461d[_0x972f('0x3b')]]['toString']()});}else if(_0x3b461d['type']===_0x972f('0x3c')&&_0x3b461d[_0x972f('0x3d')]&&_0x3b461d['Variable']['name']&&_0x3b461d[_0x972f('0x37')]&&_0x3b461d['customField']){_0x29a10a[_0x3b461d[_0x972f('0x3d')][_0x972f('0x3e')][_0x972f('0x3f')]()]&&_0x2fef36[_0x972f('0x38')][_0x972f('0x39')]({'id':_0x3b461d[_0x972f('0x37')],'value':_0x29a10a[_0x3b461d[_0x972f('0x3d')]['name']['toLowerCase']()][_0x972f('0x36')]()});}});}return _0x2fef36;}exports[_0x972f('0x40')]=function(_0x592a8e,_0x5d0d0f,_0x4ad94c,_0x5d738a,_0x4bc67c,_0x5a470a){var _0x1ded26,_0xa19dbd;_0x5a470a[_0x972f('0x1b')]=intUtil[_0x972f('0x41')](_0x5a470a[_0x972f('0x1b')]);_0x5a470a['serverUrl']=intUtil[_0x972f('0x41')](_0x5a470a['serverUrl']);if(_0x4bc67c&&_0x4bc67c[_0x972f('0x42')]){logger['info']('[QUEUE]',_0x972f('0x43'));_0x5d0d0f[_0x972f('0x44')]=util[_0x972f('0x16')](_0x972f('0x45'),_0x5a470a['serverUrl'],_0x5d0d0f[_0x972f('0x46')],md5(_0x5d0d0f['uniqueid']));}else{_0x5d0d0f[_0x972f('0x44')]='';}headers['Authorization']=getAuth(_0x5a470a);return getUser(_0x5a470a,_0x5d738a[_0x972f('0x1f')])['then'](function(_0x49368c){_0x1ded26=_0x49368c;logger[_0x972f('0x9')]('The\x20User\x20ID\x20is:',_0x1ded26['id']);return getEndUser(_0x5a470a,_0x5d0d0f[_0x972f('0xd')],_0x5d0d0f[_0x972f('0xe')]);})[_0x972f('0x18')](function(_0x307380){_0xa19dbd=_0x307380;logger[_0x972f('0x9')]('The\x20Enduser\x20ID\x20is:',_0xa19dbd['id']);return getTicket(_0x5a470a,_0x1ded26,_0xa19dbd,_0x4ad94c,_0x5d0d0f);})[_0x972f('0x18')](function(_0x2ef7e4){if(_0x2ef7e4&&_0x2ef7e4['id']){logger['info'](_0x972f('0x19'));logger[_0x972f('0x9')](_0x972f('0x47'),_0x2ef7e4['id']);logger[_0x972f('0x9')]('[QUEUE]',_0x972f('0x48'));emit(util[_0x972f('0x16')](_0x972f('0x49'),_0x5d738a[_0x972f('0x3e')]),'trigger:browser:url',{'uri':util[_0x972f('0x16')](_0x972f('0x4a'),_0x5a470a['remoteUri'],_0x2ef7e4['id'])});}})['catch'](function(_0x33a379){logger[_0x972f('0x4b')](_0x972f('0x4c'),JSON['stringify'](_0x33a379));});};exports[_0x972f('0x4d')]=function(_0x4855d6,_0x405ce8,_0x1182df,_0x135d15,_0xe0bad3,_0x30f1d1,_0x131f14){var _0x44c4e0,_0x436c44;_0x30f1d1['remoteUri']=intUtil[_0x972f('0x41')](_0x30f1d1['remoteUri']);_0x30f1d1[_0x972f('0x4e')]=intUtil[_0x972f('0x41')](_0x30f1d1[_0x972f('0x4e')]);if(_0x131f14&&_0x131f14[_0x972f('0x4f')]&&_0x131f14[_0x972f('0x4f')]!==_0x972f('0x50')){logger[_0x972f('0x9')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x405ce8[_0x972f('0x44')]=util[_0x972f('0x16')](_0x972f('0x45'),_0x30f1d1[_0x972f('0x4e')],_0x405ce8[_0x972f('0x46')],md5(_0x405ce8['uniqueid']));}headers[_0x972f('0x51')]=getAuth(_0x30f1d1);return getUser(_0x30f1d1,_0x135d15['email'])[_0x972f('0x18')](function(_0x553fbe){_0x44c4e0=_0x553fbe;logger[_0x972f('0x9')](_0x972f('0x52'),_0x44c4e0['id']);return getEndUser(_0x30f1d1,_0x405ce8[_0x972f('0x53')],_0x405ce8[_0x972f('0x54')]);})[_0x972f('0x18')](function(_0x552b54){_0x436c44=_0x552b54;logger[_0x972f('0x9')](_0x972f('0x55'),_0x436c44['id']);return getTicket(_0x30f1d1,_0x44c4e0,_0x436c44,_0x1182df,_0x405ce8);})[_0x972f('0x18')](function(_0x11c9d7){if(_0x11c9d7&&_0x11c9d7['id']){logger[_0x972f('0x9')](_0x972f('0x19'));logger[_0x972f('0x9')](_0x972f('0x47'),_0x11c9d7['id']);logger[_0x972f('0x9')](_0x972f('0x56'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x972f('0x16')](_0x972f('0x49'),_0x135d15[_0x972f('0x3e')]),_0x972f('0x57'),{'uri':util[_0x972f('0x16')]('%s/helpdesk/tickets/%d',_0x30f1d1[_0x972f('0x1b')],_0x11c9d7['id'])});}})[_0x972f('0x58')](function(_0x223828){logger[_0x972f('0x4b')](_0x972f('0x56'),JSON[_0x972f('0x2d')](_0x223828));});};exports[_0x972f('0x59')]=function(_0x2f7afc,_0x3cca3e,_0x4c3311,_0x3b9fd9,_0x5354f9,_0x453bba){var _0x1d504a,_0x740147;_0x453bba[_0x972f('0x1b')]=intUtil[_0x972f('0x41')](_0x453bba['remoteUri']);_0x453bba[_0x972f('0x4e')]=intUtil[_0x972f('0x41')](_0x453bba[_0x972f('0x4e')]);if(_0x5354f9&&_0x5354f9[_0x972f('0x42')]){logger[_0x972f('0x9')]('['+_0x3cca3e[_0x972f('0x5a')][_0x972f('0x5b')]()+']',_0x972f('0x43'));_0x3cca3e[_0x972f('0x44')]=util[_0x972f('0x16')](_0x972f('0x45'),_0x453bba['serverUrl'],_0x3cca3e[_0x972f('0x46')],md5(_0x3cca3e[_0x972f('0x46')]));}else{_0x3cca3e[_0x972f('0x44')]='';}headers[_0x972f('0x51')]=getAuth(_0x453bba);return getUser(_0x453bba,'')['then'](function(_0x514287){_0x1d504a=_0x514287;logger[_0x972f('0x9')](_0x972f('0x52'),_0x1d504a['id']);return getEndUser(_0x453bba,_0x3cca3e[_0x972f('0xd')],_0x3cca3e[_0x972f('0xe')]);})[_0x972f('0x18')](function(_0x421570){_0x740147=_0x421570;logger[_0x972f('0x9')](_0x972f('0x55'),_0x740147['id']);return getTicket(_0x453bba,_0x1d504a,_0x740147,_0x4c3311,_0x3cca3e);})[_0x972f('0x18')](function(_0xa102a8){if(_0xa102a8){logger[_0x972f('0x9')](_0x972f('0x19'));logger[_0x972f('0x9')]('The\x20Ticket\x20ID\x20is:',_0xa102a8['id']);}})['catch'](function(_0x285a45){logger[_0x972f('0x4b')]('['+_0x3cca3e[_0x972f('0x5a')][_0x972f('0x5b')]()+']',JSON[_0x972f('0x2d')](_0x285a45));});};
\ 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 db14b8d..127daf5 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 _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
+var _0xedee=['freshsales','redis','localhost','GET','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','Admin\x20found:','adminId','catch','error','toUpperCase','message','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userId','User\x20found:','Admin\x20selected','userEmail','Requested\x20Resource\x20not\x20Found','filters','forEach','name','All\x20Contacts','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contacts','find','work_number','contactNumber','mobile_number','endUserId','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','format','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','apiKey','remoteUri','serverUrl','username','toLowerCase','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','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','moment','bluebird','ioredis','./util','../../../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xedee,0x152));var _0xeede=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xedee[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var rp=require(_0xeede('0x0'));var md5=require('md5');var util=require('util');var moment=require(_0xeede('0x1'));var Promise=require(_0xeede('0x2'));var Redis=require(_0xeede('0x3'));var intUtil=require(_0xeede('0x4'));var config=require(_0xeede('0x5'));var logger=require('../../../../config/logger')(_0xeede('0x6'));config[_0xeede('0x7')]=_['defaults'](config[_0xeede('0x7')],{'host':_0xeede('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x4d32ab,_0x153daa,_0x35715f,_0x5925e8){return new Promise(function(_0x34e7e8,_0x5d1e71){var _0x203111=![];var _0x59fed5={'method':_0xeede('0x9'),'uri':_0x5925e8+'/api/selector/owners','json':!![]};_0x59fed5[_0xeede('0xa')]=_0x35715f;logger[_0xeede('0xb')](_0xeede('0xc'));return rp(_0x59fed5)[_0xeede('0xd')](function(_0x28b7c4){if(_0x28b7c4){var _0x237d54=_0x28b7c4[_0xeede('0xe')];var _0x5428f6=null;for(_0x5428f6=0x0;_0x5428f6<_0x237d54[_0xeede('0xf')];_0x5428f6++){if(_0x237d54[_0x5428f6][_0xeede('0x10')]===_0x4d32ab[_0xeede('0x11')]){_0x4d32ab['adminId']=_0x237d54[_0x5428f6]['id'];_0x203111=!![];}}if(_0x203111){logger[_0xeede('0xb')](_0xeede('0x12'),_0x4d32ab[_0xeede('0x13')]);_0x34e7e8(_0x4d32ab);}else{_0x5d1e71({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x5d1e71({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xeede('0x14')](function(_0x673a40){logger[_0xeede('0x15')]('['+[_0x153daa[_0xeede('0x16')]()]+']',_0x673a40[_0xeede('0x17')]);_0x5d1e71(_0x673a40);});});}function getUser(_0xe4b5e6,_0x5ec578,_0x1ddc0f){return function(_0x49afa5){return new Promise(function(_0x4ef03c,_0x31493a){var _0x162478={'method':_0xeede('0x9'),'uri':_0x1ddc0f+'/api/selector/owners','json':!![]};_0x162478['headers']=_0x5ec578;logger[_0xeede('0xb')](_0xeede('0x18'));return rp(_0x162478)[_0xeede('0xd')](function(_0x21b1b5){if(_0x21b1b5){var _0x118bd5=_0x21b1b5[_0xeede('0xe')];var _0x18a28d=![];var _0x45aa19=null;if(_0x49afa5['agentEmail']!==null){logger['info'](_0xeede('0x19'),_0x49afa5[_0xeede('0x1a')]);_0x49afa5['userEmail']=_0x49afa5[_0xeede('0x1a')];for(_0x45aa19=0x0;_0x45aa19<_0x118bd5[_0xeede('0xf')];_0x45aa19++){if(_0x118bd5[_0x45aa19][_0xeede('0x10')]===_0x49afa5[_0xeede('0x1a')]){_0x18a28d=!![];_0x49afa5[_0xeede('0x1b')]=_0x118bd5[_0x45aa19]['id'];logger[_0xeede('0xb')](_0xeede('0x1c'),_0x49afa5[_0xeede('0x1b')]);}}}if(!_0x18a28d){logger['info'](_0xeede('0x1d'));_0x49afa5[_0xeede('0x1e')]=_0x49afa5[_0xeede('0x11')];_0x49afa5[_0xeede('0x1b')]=_0x49afa5[_0xeede('0x13')];_0x18a28d=!![];}if(_0x18a28d){_0x4ef03c(_0x49afa5);}else{_0x31493a({'statusCode':0x194,'message':_0xeede('0x1f')});}}else{_0x31493a({'statusCode':0x194,'message':_0xeede('0x1f')});}})[_0xeede('0x14')](function(_0x140c52){logger[_0xeede('0x15')]('['+[_0xe4b5e6[_0xeede('0x16')]()]+']',_0x140c52[_0xeede('0x17')]);_0x31493a(_0x140c52);});});};}function getEndUser(_0x5b9244,_0x43b3ac,_0x4dfb84){return function(_0x164530){return new Promise(function(_0x34e495,_0x9a9be7){var _0x55fd1b=0x0;var _0x58d3a8={'method':_0xeede('0x9'),'uri':_0x4dfb84+'/api/contacts/filters','json':!![]};_0x58d3a8[_0xeede('0xa')]=_0x43b3ac;logger[_0xeede('0xb')]('Getting\x20contacts\x20filter');return rp(_0x58d3a8)[_0xeede('0xd')](function(_0x2ecd53){_0x2ecd53[_0xeede('0x20')][_0xeede('0x21')](function(_0x3dd46a){if(_0x3dd46a[_0xeede('0x22')]===_0xeede('0x23')){_0x55fd1b=_0x3dd46a['id'];}});})[_0xeede('0xd')](function(){logger[_0xeede('0xb')]('Getting\x20contact\x20list');var _0x24f543={'method':_0xeede('0x9'),'uri':_0x4dfb84+_0xeede('0x24')+_0x55fd1b,'json':!![]};_0x24f543[_0xeede('0xa')]=_0x43b3ac;return rp(_0x24f543);})['then'](function(_0x43a07a){logger[_0xeede('0xb')](_0xeede('0x25'),_0x164530['contactNumber']);if(_0x43a07a[_0xeede('0x26')][_0xeede('0xf')]>0x0){var _0x182dbb=_[_0xeede('0x27')](_0x43a07a[_0xeede('0x26')],function(_0x4b2a71){if(_0x4b2a71[_0xeede('0x28')]===_0x164530[_0xeede('0x29')]||_0x4b2a71[_0xeede('0x2a')]===_0x164530[_0xeede('0x29')]){return _0x4b2a71;}});if(_0x182dbb){_0x164530[_0xeede('0x2b')]=_0x182dbb['id'];logger[_0xeede('0xb')]('Contact\x20found:',_0x164530[_0xeede('0x2b')]);_0x34e495(_0x164530);}else{return createEndUser(_0x164530,_0x5b9244,_0x43b3ac,_0x4dfb84)['then'](function(_0x26d993){logger[_0xeede('0xb')](_0xeede('0x2c'),_0x164530[_0xeede('0x2b')]);_0x34e495(_0x26d993);});}}else{return createEndUser(_0x164530,_0x5b9244,_0x43b3ac,_0x4dfb84)['then'](function(_0x24ba2f){logger['info'](_0xeede('0x2c'),_0x164530['endUserId']);_0x34e495(_0x24ba2f);});}})[_0xeede('0x14')](function(_0x484301){throw new Error(_0x484301['message']);});});};}function createEndUser(_0x2e55bd,_0x828103,_0x5e2d43,_0x2732b6){return new Promise(function(_0x4d2863,_0x41bf3d){var _0x5edb49=moment();var _0x38fa41={'method':_0xeede('0x2d'),'uri':_0x2732b6+_0xeede('0x2e'),'body':{'contact':{'last_name':_0x2e55bd[_0xeede('0x29')],'work_number':_0x2e55bd[_0xeede('0x29')],'mobile_number':_0x2e55bd[_0xeede('0x29')],'owner_id':_0x2e55bd[_0xeede('0x1b')],'created_at':_0x5edb49['format'](_0xeede('0x2f'))}},'json':!![]};_0x38fa41[_0xeede('0xa')]=_0x5e2d43;logger['info'](_0xeede('0x30'));return rp(_0x38fa41)['then'](function(_0x54be2c){_0x2e55bd[_0xeede('0x2b')]=_0x54be2c[_0xeede('0x31')]['id'];_0x4d2863(_0x2e55bd);})[_0xeede('0x14')](function(_0x2c02e3){logger[_0xeede('0x15')]('['+[_0x828103[_0xeede('0x16')]()]+']',_0x2c02e3[_0xeede('0x17')]);_0x41bf3d(_0x2c02e3[_0xeede('0x17')]);});});}function getTicket(_0x27402e,_0x360222,_0x5748b4,_0x462be5,_0x6fffdc){return function(_0x1fad71){logger[_0xeede('0xb')](_0xeede('0x32'));return new Promise(function(_0x331769,_0x422208){var _0x1f2cb1=moment();var _0x235488={'method':_0xeede('0x2d'),'uri':_0x5748b4+_0xeede('0x33'),'body':{'title':intUtil[_0xeede('0x34')](_0x462be5[_0xeede('0x35')],_0x6fffdc,'\x20'),'description':intUtil['getString'](_0x462be5[_0xeede('0x36')],_0x6fffdc,'\x0a'),'owner_id':_0x1fad71[_0xeede('0x1b')],'creater_id':_0x1fad71['adminId'],'targetable_id':_0x1fad71[_0xeede('0x2b')],'targetable_type':'Contact','created_at':_0x1f2cb1['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x1f2cb1['add'](0x1e,'m')[_0xeede('0x37')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x235488[_0xeede('0xa')]=_0x360222;return rp(_0x235488)[_0xeede('0xd')](function(_0x2fba4e){_0x1fad71[_0xeede('0x38')]=_0x2fba4e[_0xeede('0x39')]['id'];logger[_0xeede('0xb')](_0xeede('0x3a'),_0x1fad71[_0xeede('0x38')]);_0x331769(_0x1fad71);})[_0xeede('0x14')](function(_0x1013e4){logger[_0xeede('0x15')]('['+[_0x27402e[_0xeede('0x16')]()]+']',_0x1013e4['message']);_0x422208(_0x1013e4[_0xeede('0x17')]);});});};}function emit(_0x31c250,_0xafd48c,_0x39d0a2){var _0x4d126f={'uri':_0x31c250+_0xeede('0x3b')+_0x39d0a2};io['to'](util[_0xeede('0x37')](_0xeede('0x3c'),_0xafd48c))[_0xeede('0x3d')](_0xeede('0x3e'),_0x4d126f);}exports['cs']=function(_0x50bdf4,_0xda569d,_0x46c92b,_0x2f63c1,_0x13f295,_0xdb7f5b,_0x22a0d4,_0x3b5d70){var _0x46241e={};var _0x2480a2={'Authorization':'Token\x20token='+_0xdb7f5b[_0xeede('0x3f')]};_0xdb7f5b[_0xeede('0x40')]=intUtil['stripTrailingSlash'](_0xdb7f5b[_0xeede('0x40')]);_0xdb7f5b[_0xeede('0x41')]=intUtil['stripTrailingSlash'](_0xdb7f5b[_0xeede('0x41')]);var _0x470b36=_0xdb7f5b[_0xeede('0x40')];_0x46241e['adminEmail']=_0xdb7f5b[_0xeede('0x42')];_0x46241e[_0xeede('0x29')]=_0x3b5d70[_0xeede('0x43')]()===_0xeede('0x44')?_0xda569d[_0xeede('0x45')]:_0xda569d[_0xeede('0x46')];_0x46241e[_0xeede('0x47')]=_0x3b5d70===_0xeede('0x48')||_0x3b5d70===_0xeede('0x49')?_0xeede('0x48'):'outbound';if(_0x2f63c1){_0x46241e[_0xeede('0x1a')]=_0x2f63c1[_0xeede('0x10')];}var _0x4ad330=util[_0xeede('0x37')](_0xeede('0x4a'),_0xdb7f5b[_0xeede('0x41')],_0xda569d[_0xeede('0x4b')],md5(_0xda569d[_0xeede('0x4b')]));if(_0x13f295&&_0x13f295[_0xeede('0x4c')]){logger[_0xeede('0xb')](_0xeede('0x4d'),_0xeede('0x4e'));_0xda569d['recordingURL']=_0x4ad330;}else if(_0x22a0d4&&_0x22a0d4[_0xeede('0x4f')]&&_0x22a0d4[_0xeede('0x4f')]!==_0xeede('0x50')){logger[_0xeede('0xb')]('[OUTBOUND]',_0xeede('0x4e'));_0xda569d[_0xeede('0x51')]=_0x4ad330;}else{_0xda569d[_0xeede('0x51')]='';}return getAdminId(_0x46241e,_0x3b5d70,_0x2480a2,_0x470b36)[_0xeede('0xd')](getUser(_0x3b5d70,_0x2480a2,_0x470b36))[_0xeede('0xd')](getEndUser(_0x3b5d70,_0x2480a2,_0x470b36))[_0xeede('0xd')](getTicket(_0x3b5d70,_0x2480a2,_0x470b36,_0x46c92b,_0xda569d))['then'](function(_0x3eb371){logger[_0xeede('0xb')](util['format'](_0xeede('0x52'),_0x3eb371[_0xeede('0x38')]));if(_0x3b5d70!==_0xeede('0x49')){logger[_0xeede('0xb')]('['+[_0x3b5d70[_0xeede('0x16')]()]+']',_0xeede('0x53'));emit(_0x470b36,_0x2f63c1[_0xeede('0x22')],_0x3eb371[_0xeede('0x2b')]);}})[_0xeede('0x14')](function(_0x372236){logger[_0xeede('0x15')]('['+[_0x3b5d70[_0xeede('0x16')]()]+_0xeede('0x54'),util[_0xeede('0x55')](_0x372236,{'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 4fd7d94..cd915b7 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 _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
+var _0x0b0e=['./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','desk','vtiger','dynamics365','freshsales','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','outbound','log','unmanaged','freshdesk','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./sugarcrm','./freshdesk','./zoho'];(function(_0x43d94e,_0x5808ec){var _0x5a9ef7=function(_0x5501b9){while(--_0x5501b9){_0x43d94e['push'](_0x43d94e['shift']());}};_0x5a9ef7(++_0x5808ec);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2867d8,_0xef3ee0){_0x2867d8=_0x2867d8-0x0;var _0x3b8176=_0x0b0e[_0x2867d8];return _0x3b8176;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var zendesk=require(_0xe0b0('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0xe0b0('0x2'));var freshdesk=require(_0xe0b0('0x3'));var zoho=require(_0xe0b0('0x4'));var desk=require(_0xe0b0('0x5'));var vtiger=require(_0xe0b0('0x6'));var servicenow=require(_0xe0b0('0x7'));var dynamics365=require(_0xe0b0('0x8'));var freshsales=require(_0xe0b0('0x9'));var integrations=[_0xe0b0('0xa'),_0xe0b0('0xb'),_0xe0b0('0xc'),'freshdesk','zoho',_0xe0b0('0xd'),_0xe0b0('0xe'),_0xe0b0('0xf'),_0xe0b0('0x10'),'servicenow'];exports[_0xe0b0('0x11')]=function(_0x1dd3b8,_0x553d4f,_0x1fef28,_0x2f32b6,_0x574d96,_0x399320){if(_0x1fef28){if(_[_0xe0b0('0x12')](integrations,_0x1dd3b8[_0xe0b0('0x13')]['toLowerCase']())){try{var _0x3068c0=null;var _0x1c358a='';var _0x3cc19a=_0x1fef28[_0x1dd3b8[_0xe0b0('0x13')][_0xe0b0('0x14')]()];if(_0x3cc19a){var _0x4d2bf7=_0x3cc19a[_0x1dd3b8[_0xe0b0('0x15')]];if(_0x4d2bf7){var _0x154de6=_[_0xe0b0('0x16')](_0x4d2bf7[_0xe0b0('0x17')],{'id':parseInt(_0x1dd3b8[_0xe0b0('0x18')],0xa)});if(_0x154de6){if(_0x2f32b6){if(_0x574d96&&_0x553d4f['queue']){_0x1c358a=_0xe0b0('0x19');}else if(_0x553d4f['routeId']){_0x1c358a=_0xe0b0('0x1a');}else{console[_0xe0b0('0x1b')]('EVENT\x20UNKNOWN',_0x553d4f);}}else{_0x1c358a=_0xe0b0('0x1c');}switch(_0x1dd3b8['data1'][_0xe0b0('0x14')]()){case _0xe0b0('0xa'):zendesk[_0x1c358a](_0x1dd3b8,_0x553d4f,_0x154de6,_0x2f32b6,_0x574d96,_0x4d2bf7,_0x399320);break;case'salesforce':salesforce[_0x1c358a](_0x1dd3b8,_0x553d4f,_0x154de6,_0x2f32b6,_0x574d96,_0x4d2bf7,_0x399320);break;case'sugarcrm':sugarcrm[_0x1c358a](_0x1dd3b8,_0x553d4f,_0x154de6,_0x2f32b6,_0x574d96,_0x4d2bf7,_0x399320);break;case _0xe0b0('0x1d'):freshdesk[_0x1c358a](_0x1dd3b8,_0x553d4f,_0x154de6,_0x2f32b6,_0x574d96,_0x4d2bf7,_0x399320);break;case'zoho':zoho[_0x1c358a](_0x1dd3b8,_0x553d4f,_0x154de6,_0x2f32b6,_0x574d96,_0x4d2bf7,_0x399320);break;case'desk':desk[_0x1c358a](_0x1dd3b8,_0x553d4f,_0x154de6,_0x2f32b6,_0x574d96,_0x4d2bf7,_0x399320);break;case'vtiger':vtiger[_0x1c358a](_0x1dd3b8,_0x553d4f,_0x154de6,_0x2f32b6,_0x574d96,_0x4d2bf7,_0x399320);break;case _0xe0b0('0x10'):freshsales['cs'](_0x1dd3b8,_0x553d4f,_0x154de6,_0x2f32b6,_0x574d96,_0x4d2bf7,_0x399320,_0x1c358a);break;case'servicenow':servicenow['cs'](_0x1dd3b8,_0x553d4f,_0x154de6,_0x2f32b6,_0x574d96,_0x4d2bf7,_0x399320,_0x1c358a);break;case'dynamics365':dynamics365['cs'](_0x1dd3b8,_0x553d4f,_0x154de6,_0x2f32b6,_0x574d96,_0x4d2bf7,_0x399320,_0x1c358a);break;default:console[_0xe0b0('0x1b')]('unknown\x20integration');}}else{_0x3068c0=require(_0xe0b0('0x1e'))(_0x1dd3b8['data1'][_0xe0b0('0x14')]());_0x3068c0[_0xe0b0('0x1f')](_0xe0b0('0x20'),util[_0xe0b0('0x21')](_0xe0b0('0x22'),_0x1dd3b8['data1']['toLowerCase'](),_0x1dd3b8[_0xe0b0('0x18')]));}}else{_0x3068c0=require('../../../../config/logger')(_0x1dd3b8[_0xe0b0('0x13')][_0xe0b0('0x14')]());_0x3068c0['error'](_0xe0b0('0x20'),util['format'](_0xe0b0('0x23'),_0x1dd3b8['data1'][_0xe0b0('0x14')](),_0x1dd3b8['data2']));}}else{}}catch(_0x3e5c88){console['error'](_0x3e5c88);}}}};
\ 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 cfb54d6..bf9ec0e 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 _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
+var _0xce38=['name','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','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','unmanaged','monitor_format','lastevent','toUpperCase','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','util','ioredis','./util','../../../../config/logger','redis','localhost','socket.io-emitter','emit','ticketType','assign','utc','Subjects','getString','Descriptions','WhoId','Case','sobject','create','validateEmail','User','execute','length','Email','info','Agent\x20%s\x20found.','Name','identity','resolve','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','Task','moduleSearch','find','Lead','contact','Contact','lead','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','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','upperFirst','type','string','idField','content','toString','variableName','customVariable','Variable','toLowerCase','password','concat','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xce38,0x163));var _0x8ce3=function(_0xec1b03,_0x1ed76f){_0xec1b03=_0xec1b03-0x0;var _0x140c51=_0xce38[_0xec1b03];return _0x140c51;};'use strict';var _=require(_0x8ce3('0x0'));var rp=require('request-promise');var moment=require(_0x8ce3('0x1'));var BPromise=require(_0x8ce3('0x2'));var md5=require(_0x8ce3('0x3'));var jsforce=require('jsforce');var util=require(_0x8ce3('0x4'));var Redis=require(_0x8ce3('0x5'));var intUtil=require(_0x8ce3('0x6'));var config=require('../../../../config/environment');var logger=require(_0x8ce3('0x7'))('salesforce');config[_0x8ce3('0x8')]=_['defaults'](config[_0x8ce3('0x8')],{'host':_0x8ce3('0x9'),'port':0x18eb});var io=require(_0x8ce3('0xa'))(new Redis(config['redis']));function emit(_0x241558,_0x3ddfc6,_0x11b3ad){io['to'](_0x241558)[_0x8ce3('0xb')](_0x3ddfc6,_0x11b3ad);}function getTicket(_0x2c04dc,_0xc75deb,_0x11b0ec,_0x4ad581,_0x2142ec,_0x529ec3,_0x259dfd,_0xf686b9){var _0xcb3d1f={};if(_0x4ad581[_0x8ce3('0xc')]==='Task'){_0xcb3d1f=Object[_0x8ce3('0xd')]({},{'OwnerId':_0xc75deb['id'],'ActivityDate':moment[_0x8ce3('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x4ad581[_0x8ce3('0xf')],_0x2142ec,'\x20'),'Description':intUtil[_0x8ce3('0x10')](_0x4ad581[_0x8ce3('0x11')],_0x2142ec,'\x0a')},getCustomFields(_0x529ec3,_0x2142ec));if(_0x11b0ec){_0xcb3d1f[_0x8ce3('0x12')]=_0x11b0ec['id'];}}else if(_0x4ad581[_0x8ce3('0xc')]===_0x8ce3('0x13')){_0xcb3d1f=Object[_0x8ce3('0xd')]({},{'OwnerId':_0xc75deb['id'],'Subject':intUtil[_0x8ce3('0x10')](_0x4ad581[_0x8ce3('0xf')],_0x2142ec,'\x20'),'Description':intUtil[_0x8ce3('0x10')](_0x4ad581[_0x8ce3('0x11')],_0x2142ec,'\x0a')},getCustomFields(_0x529ec3,_0x2142ec));if(_0x11b0ec){_0xcb3d1f['ContactId']=_0x11b0ec['id'];}}return _0x259dfd[_0x8ce3('0x14')](_0x4ad581[_0x8ce3('0xc')])[_0x8ce3('0x15')](_0xcb3d1f);}function getUser(_0x45df32,_0x595da1,_0x3b0f27){if(!_['isNil'](_0x595da1)&&intUtil[_0x8ce3('0x16')](_0x595da1)){var _0x3b99a3={'Email':_0x595da1};var _0x45f59d={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3b0f27[_0x8ce3('0x14')](_0x8ce3('0x17'))['find'](_0x3b99a3,_0x45f59d)[_0x8ce3('0x18')]()['then'](function(_0x408f53){if(_0x408f53[_0x8ce3('0x19')]){var _0x12285f=_['find'](_0x408f53,function(_0x5afae8){return _0x5afae8[_0x8ce3('0x1a')]===_0x595da1;});if(_0x12285f){logger[_0x8ce3('0x1b')](_0x8ce3('0x1c'),_0x595da1);return BPromise['resolve']({'id':_0x12285f['Id'],'name':_0x12285f[_0x8ce3('0x1d')]});}}else{logger[_0x8ce3('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x595da1);return _0x3b0f27[_0x8ce3('0x1e')]()['then'](function(_0x41b385){return BPromise[_0x8ce3('0x1f')]({'id':_0x41b385[_0x8ce3('0x20')],'name':_0x41b385[_0x8ce3('0x21')]});});}});}else{logger[_0x8ce3('0x1b')](_0x8ce3('0x22'),_0x595da1);return _0x3b0f27[_0x8ce3('0x1e')]()[_0x8ce3('0x23')](function(_0x3bea55){return BPromise[_0x8ce3('0x1f')]({'id':_0x3bea55[_0x8ce3('0x20')],'name':_0x3bea55[_0x8ce3('0x21')]});});}}function getEndUser(_0x397648,_0x1ee1c8,_0x2c6a0c,_0x171b8e,_0xd92c){var _0x1c01c1={'Phone':_0x171b8e};var _0x139e2f={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x8ce3('0x1f')]()[_0x8ce3('0x23')](function(){if(_0x1ee1c8[_0x8ce3('0xc')]===_0x8ce3('0x24')){logger[_0x8ce3('0x1b')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x171b8e,_0x1ee1c8[_0x8ce3('0x25')]);switch(_0x1ee1c8[_0x8ce3('0x25')]){case'contact_lead':return _0xd92c['sobject']('Contact')[_0x8ce3('0x26')](_0x1c01c1,_0x139e2f)[_0x8ce3('0x18')]()[_0x8ce3('0x23')](function(_0x544a49){if(_0x544a49&&_0x544a49[_0x8ce3('0x19')]){return _0x544a49;}else{return _0xd92c['sobject'](_0x8ce3('0x27'))[_0x8ce3('0x26')](_0x1c01c1,_0x139e2f);}});case _0x8ce3('0x28'):return _0xd92c[_0x8ce3('0x14')](_0x8ce3('0x29'))[_0x8ce3('0x26')](_0x1c01c1,_0x139e2f)[_0x8ce3('0x18')]();case _0x8ce3('0x2a'):return _0xd92c['sobject']('Lead')['find'](_0x1c01c1,_0x139e2f);default:return null;}}else if(_0x1ee1c8[_0x8ce3('0xc')]===_0x8ce3('0x13')){logger[_0x8ce3('0x1b')](_0x8ce3('0x2b'),_0x171b8e,'contact');return _0xd92c[_0x8ce3('0x14')]('Contact')['find'](_0x1c01c1,_0x139e2f)['execute']();}})['then'](function(_0x2eff61){if(_0x2eff61&&_0x2eff61['length']){var _0x4b6e61=_[_0x8ce3('0x26')](_0x2eff61,function(_0x47be15){return _0x47be15[_0x8ce3('0x2c')]===_0x171b8e;});if(_0x4b6e61){return BPromise['resolve']({'id':_0x4b6e61['Id'],'name':_0x4b6e61[_0x8ce3('0x1d')],'phone':_0x4b6e61['Phone']});}}})[_0x8ce3('0x23')](function(_0x4d881f){if(_0x4d881f){logger[_0x8ce3('0x1b')](_0x8ce3('0x2d'),_0x171b8e);return BPromise[_0x8ce3('0x1f')](_0x4d881f);}else{logger[_0x8ce3('0x1b')](_0x8ce3('0x2e'),_0x171b8e);var _0x1e6cf5={'LastName':_0x2c6a0c!==''?_0x2c6a0c:util[_0x8ce3('0x2f')](_0x8ce3('0x30'),_0x171b8e),'Phone':_0x171b8e};if(_0x1ee1c8[_0x8ce3('0x31')]){if(_0x1ee1c8[_0x8ce3('0x31')]===_0x8ce3('0x28')){logger[_0x8ce3('0x1b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x171b8e,_0x1ee1c8['moduleCreate']);}else if(_0x1ee1c8[_0x8ce3('0x31')]===_0x8ce3('0x2a')&&_0x1ee1c8['ticketType']===_0x8ce3('0x24')){logger[_0x8ce3('0x1b')](_0x8ce3('0x32'),_0x171b8e,_0x1ee1c8[_0x8ce3('0x31')]);_0x1e6cf5['Company']=_0x8ce3('0x33');}else{return null;}}return _0xd92c[_0x8ce3('0x14')](_[_0x8ce3('0x34')](_0x1ee1c8[_0x8ce3('0x31')]))[_0x8ce3('0x15')](_0x1e6cf5);}});}function getCustomFields(_0x468616,_0x2340f1){var _0x24358a={};if(_0x468616['length']>0x0){_['forEach'](_0x468616,function(_0x440445){if(_0x440445[_0x8ce3('0x35')]===_0x8ce3('0x36')&&_0x440445[_0x8ce3('0x37')]){_0x24358a[_0x440445[_0x8ce3('0x37')]]=_0x440445[_0x8ce3('0x38')][_0x8ce3('0x39')]();}else if(_0x440445['type']==='variable'&&_0x440445[_0x8ce3('0x3a')]&&_0x440445[_0x8ce3('0x37')]){_0x2340f1[_0x440445[_0x8ce3('0x3a')]]&&(_0x24358a[_0x440445['idField']]=_0x2340f1[_0x440445[_0x8ce3('0x3a')]][_0x8ce3('0x39')]());}else if(_0x440445[_0x8ce3('0x35')]===_0x8ce3('0x3b')&&_0x440445[_0x8ce3('0x3c')]&&_0x440445['Variable']['name']&&_0x440445['idField']){_0x2340f1[_0x440445[_0x8ce3('0x3c')]['name'][_0x8ce3('0x3d')]()]&&(_0x24358a[_0x440445['idField']]=_0x2340f1[_0x440445['Variable']['name'][_0x8ce3('0x3d')]()][_0x8ce3('0x39')]());}});}return _0x24358a;}function getConnection(_0x1cdc0c){var _0x3da698=_0x1cdc0c[_0x8ce3('0x3e')][_0x8ce3('0x3f')](_0x1cdc0c['securityToken']);var _0x5fb9ff=new jsforce[(_0x8ce3('0x40'))]({'oauth2':{'loginUrl':_0x1cdc0c[_0x8ce3('0x41')]||_0x8ce3('0x42'),'clientId':_0x1cdc0c['clientId'],'clientSecret':_0x1cdc0c[_0x8ce3('0x43')]}});return _0x5fb9ff[_0x8ce3('0x44')](_0x1cdc0c['username'],_0x3da698)[_0x8ce3('0x23')](function(){logger[_0x8ce3('0x1b')](_0x8ce3('0x45'));return _0x5fb9ff;});}exports[_0x8ce3('0x46')]=function(_0x524392,_0x4cb5bc,_0x26e123,_0x213f8a,_0x5e8e5c,_0x1bfc8e){var _0x83a5a7,_0x592df2,_0x3cfc0c,_0x758d69;_0x1bfc8e[_0x8ce3('0x47')]=intUtil[_0x8ce3('0x48')](_0x1bfc8e[_0x8ce3('0x47')]);_0x1bfc8e[_0x8ce3('0x41')]=intUtil[_0x8ce3('0x48')](_0x1bfc8e[_0x8ce3('0x41')]);if(_0x5e8e5c&&_0x5e8e5c['monitor_format']){logger[_0x8ce3('0x1b')](_0x8ce3('0x49'),_0x8ce3('0x4a'));_0x4cb5bc[_0x8ce3('0x4b')]=util[_0x8ce3('0x2f')](_0x8ce3('0x4c'),_0x1bfc8e[_0x8ce3('0x47')],_0x4cb5bc['uniqueid'],md5(_0x4cb5bc['uniqueid']));}else{_0x4cb5bc[_0x8ce3('0x4b')]='';}return getConnection(_0x1bfc8e)[_0x8ce3('0x23')](function(_0x8a6273){_0x758d69=_0x8a6273;return getUser(_0x1bfc8e,_0x213f8a[_0x8ce3('0x4d')],_0x758d69);})['then'](function(_0x3da062){_0x83a5a7=_0x3da062;return getEndUser(_0x1bfc8e,_0x26e123,_0x4cb5bc['calleridname'],_0x4cb5bc[_0x8ce3('0x4e')],_0x758d69);})[_0x8ce3('0x23')](function(_0x493c4f){_0x592df2=_0x493c4f;return getTicket(_0x1bfc8e,_0x83a5a7,_0x592df2,_0x26e123,_0x4cb5bc,_0x26e123[_0x8ce3('0x4f')],_0x758d69,_0x8ce3('0x46'));})[_0x8ce3('0x23')](function(_0x2841e2){_0x3cfc0c=_0x2841e2;logger[_0x8ce3('0x1b')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x3cfc0c['id']);logger[_0x8ce3('0x1b')](_0x8ce3('0x50'),_0x3cfc0c['id'],_0x213f8a[_0x8ce3('0x51')],_0x1bfc8e[_0x8ce3('0x35')]);switch(_0x1bfc8e['type']){case _0x8ce3('0x52'):emit(util[_0x8ce3('0x2f')](_0x8ce3('0x53'),_0x213f8a[_0x8ce3('0x51')]),_0x8ce3('0x54'),{'recordId':_0x3cfc0c['id']});break;case _0x8ce3('0x55'):emit(util[_0x8ce3('0x2f')](_0x8ce3('0x53'),_0x213f8a['name']),_0x8ce3('0x56'),{'uri':util[_0x8ce3('0x2f')](_0x8ce3('0x57'),_0x758d69[_0x8ce3('0x58')],_0x3cfc0c['id'])});break;default:logger[_0x8ce3('0x59')](_0x8ce3('0x5a'));}})[_0x8ce3('0x5b')](function(_0x3beaba){logger[_0x8ce3('0x59')](_0x8ce3('0x49'),JSON[_0x8ce3('0x5c')](_0x3beaba));});};exports[_0x8ce3('0x5d')]=function(_0x2808b2,_0x39e71f,_0x1820c3,_0x47edd1,_0x1b133c,_0x2b8f73,_0x1fd227){var _0x2a4a8d,_0x8ec7cf,_0x2816b6,_0x276890;_0x2b8f73[_0x8ce3('0x47')]=intUtil[_0x8ce3('0x48')](_0x2b8f73[_0x8ce3('0x47')]);_0x2b8f73[_0x8ce3('0x41')]=intUtil[_0x8ce3('0x48')](_0x2b8f73[_0x8ce3('0x41')]);if(_0x1fd227&&_0x1fd227[_0x8ce3('0x5e')]&&_0x1fd227[_0x8ce3('0x5e')]!==_0x8ce3('0x5f')){logger[_0x8ce3('0x1b')](_0x8ce3('0x60'),_0x8ce3('0x4a'));_0x39e71f[_0x8ce3('0x4b')]=util[_0x8ce3('0x2f')](_0x8ce3('0x4c'),_0x2b8f73[_0x8ce3('0x47')],_0x39e71f['uniqueid'],md5(_0x39e71f[_0x8ce3('0x61')]));}return getConnection(_0x2b8f73)['then'](function(_0x1fa796){_0x276890=_0x1fa796;return getUser(_0x2b8f73,_0x47edd1[_0x8ce3('0x4d')],_0x276890);})[_0x8ce3('0x23')](function(_0xc5c03f){_0x2a4a8d=_0xc5c03f;return getEndUser(_0x2b8f73,_0x1820c3,_0x39e71f[_0x8ce3('0x62')],_0x39e71f['destcalleridnum'],_0x276890);})['then'](function(_0x2f36bb){_0x8ec7cf=_0x2f36bb;return getTicket(_0x2b8f73,_0x2a4a8d,_0x8ec7cf,_0x1820c3,_0x39e71f,_0x1820c3['Fields'],_0x276890,_0x8ce3('0x5d'));})[_0x8ce3('0x23')](function(_0x629c46){_0x2816b6=_0x629c46;logger[_0x8ce3('0x1b')](_0x8ce3('0x63'),_0x2816b6['id']);logger[_0x8ce3('0x1b')](_0x8ce3('0x64'),_0x2816b6['id'],_0x47edd1[_0x8ce3('0x51')],_0x2b8f73['type']);switch(_0x2b8f73[_0x8ce3('0x35')]){case _0x8ce3('0x52'):emit(util[_0x8ce3('0x2f')](_0x8ce3('0x53'),_0x47edd1[_0x8ce3('0x51')]),'trigger:salesforce:display',{'recordId':_0x2816b6['id']});break;case _0x8ce3('0x55'):emit(util['format']('user:%s',_0x47edd1[_0x8ce3('0x51')]),_0x8ce3('0x56'),{'uri':util['format'](_0x8ce3('0x57'),_0x276890[_0x8ce3('0x58')],_0x2816b6['id'])});break;default:logger[_0x8ce3('0x59')](_0x8ce3('0x60'),_0x8ce3('0x65'));}})[_0x8ce3('0x5b')](function(_0x44912c){logger[_0x8ce3('0x59')]('[OUTBOUND]',JSON[_0x8ce3('0x5c')](_0x44912c));});};exports[_0x8ce3('0x66')]=function(_0xbf136f,_0x35fb7f,_0x1845fb,_0x1bf0a0,_0x4591d2,_0x409ca0){var _0x5b2092,_0x16336c,_0x297a08,_0xe64b66;_0x409ca0[_0x8ce3('0x47')]=intUtil[_0x8ce3('0x48')](_0x409ca0['serverUrl']);_0x409ca0[_0x8ce3('0x41')]=intUtil['stripTrailingSlash'](_0x409ca0['remoteUri']);if(_0x4591d2&&_0x4591d2[_0x8ce3('0x67')]){logger[_0x8ce3('0x1b')]('['+_0x35fb7f[_0x8ce3('0x68')][_0x8ce3('0x69')]()+']','Recording\x20is\x20enabled!');_0x35fb7f['recordingURL']=util['format'](_0x8ce3('0x4c'),_0x409ca0[_0x8ce3('0x47')],_0x35fb7f[_0x8ce3('0x61')],md5(_0x35fb7f[_0x8ce3('0x61')]));}else{_0x35fb7f[_0x8ce3('0x4b')]='';}return getConnection(_0x409ca0)[_0x8ce3('0x23')](function(_0x384a31){_0xe64b66=_0x384a31;if(!_['isNil'](_0x1bf0a0)){return getUser(_0x409ca0,_0x1bf0a0[_0x8ce3('0x51')],_0xe64b66);}else{return getUser(_0x409ca0,null,_0xe64b66);}})['then'](function(_0x3a08a5){_0x5b2092=_0x3a08a5;return getEndUser(_0x409ca0,_0x1845fb,_0x35fb7f[_0x8ce3('0x6a')],_0x35fb7f['calleridnum'],_0xe64b66);})[_0x8ce3('0x23')](function(_0x1d16b8){_0x16336c=_0x1d16b8;return getTicket(_0x409ca0,_0x5b2092,_0x16336c,_0x1845fb,_0x35fb7f,_0x1845fb[_0x8ce3('0x4f')],_0xe64b66);})[_0x8ce3('0x23')](function(_0x5b0b33){_0x297a08=_0x5b0b33;logger['info']('['+_0x35fb7f[_0x8ce3('0x68')][_0x8ce3('0x69')]()+_0x8ce3('0x6b'),_0x297a08['id']);logger[_0x8ce3('0x1b')]('['+_0x35fb7f['lastevent'][_0x8ce3('0x69')]()+_0x8ce3('0x6c'),_0x409ca0[_0x8ce3('0x35')]);})['catch'](function(_0x317d80){logger[_0x8ce3('0x59')]('['+_0x35fb7f['lastevent'][_0x8ce3('0x69')]()+']',JSON[_0x8ce3('0x5c')](_0x317d80));});};
\ 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 87a202f..8797565 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 _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
+var _0xadb5=['endUserNumber','user','System','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','type','string','nameField','customField','idField','toLowerCase','content','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','incident','Incident','Incident\x20-\x20','forEach','push','length','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','then','result','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','],\x20getUser\x20input\x20crm','userEmail','GET','],\x20getUser\x20rp\x20obj','active','true','userId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','POST','sys_user?'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0xadb5,0xad));var _0x5adb=function(_0x5314d6,_0x1718ec){_0x5314d6=_0x5314d6-0x0;var _0x1528d3=_0xadb5[_0x5314d6];return _0x1528d3;};'use strict';var _=require('lodash');var Promise=require(_0x5adb('0x0'));var rp=require('request-promise');var util=require(_0x5adb('0x1'));var md5=require(_0x5adb('0x2'));var Redis=require(_0x5adb('0x3'));var intUtil=require('./util');var config=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));config['redis']=_[_0x5adb('0x7')](config[_0x5adb('0x8')],{'host':_0x5adb('0x9'),'port':0x18eb});var io=require(_0x5adb('0xa'))(new Redis(config[_0x5adb('0x8')]));function getAdminUser(_0x353885,_0x47228a,_0x6d1b45,_0x41261c,_0x7293ab,_0x34f59d){return new Promise(function(_0x336bad,_0x129f5a){var _0x275428={'method':'GET','uri':_0x41261c+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x7293ab+'&'+_0x34f59d,'auth':_0x47228a,'json':!![]};return rp(_0x275428)[_0x5adb('0xb')](function(_0x1ea238){if(_0x1ea238[_0x5adb('0xc')]['length']>0x0){_0x6d1b45[_0x5adb('0xd')]=_0x1ea238['result'][0x0][_0x5adb('0xe')];}logger['info']('['+[_0x353885[_0x5adb('0xf')]()]+_0x5adb('0x10'),_0x6d1b45);_0x336bad(_0x6d1b45);})[_0x5adb('0x11')](function(_0x5c929a){logger[_0x5adb('0x12')]('['+[_0x353885[_0x5adb('0xf')]()]+']',_0x5c929a[_0x5adb('0x13')]);_0x129f5a(_0x5c929a['message']);});});}function getUser(_0x2312de,_0x518823,_0x367d82,_0x42a482,_0x30614e){return function(_0x304784){logger[_0x5adb('0x14')]('['+[_0x2312de[_0x5adb('0xf')]()]+_0x5adb('0x15'),_0x304784);return new Promise(function(_0x42f4c6,_0xb953a6){if(intUtil['validateEmail'](_0x304784[_0x5adb('0x16')])){var _0x5de028={'method':_0x5adb('0x17'),'uri':_0x367d82+'sys_user?sysparm_query=email%3D'+_0x304784[_0x5adb('0x16')]+'&'+_0x42a482+'&'+_0x30614e,'auth':_0x518823,'json':!![]};logger['info']('['+[_0x2312de['toUpperCase']()]+_0x5adb('0x18'),_0x5de028);return rp(_0x5de028)[_0x5adb('0xb')](function(_0x438671){logger[_0x5adb('0x14')]('['+[_0x2312de[_0x5adb('0xf')]()]+'],\x20getUser\x20entity',_0x438671);if(_0x438671[_0x5adb('0xc')]['length']>0x0&&String(_0x438671['result'][0x0][_0x5adb('0x19')])===_0x5adb('0x1a')){_0x304784[_0x5adb('0x1b')]=_0x438671[_0x5adb('0xc')][0x0][_0x5adb('0xe')];}else{_0x304784[_0x5adb('0x1b')]=_0x304784[_0x5adb('0xd')];_0x304784['userEmail']=_0x304784[_0x5adb('0x1c')];}logger[_0x5adb('0x14')]('['+[_0x2312de[_0x5adb('0xf')]()]+_0x5adb('0x1d'),_0x304784);_0x42f4c6(_0x304784);})[_0x5adb('0x11')](function(_0x49f203){logger[_0x5adb('0x12')]('['+[_0x2312de[_0x5adb('0xf')]()]+']',_0x49f203['message']);_0xb953a6(_0x49f203[_0x5adb('0x13')]);});}else{logger[_0x5adb('0x14')]('['+[_0x2312de[_0x5adb('0xf')]()]+']\x20using\x20admin\x20profile');_0x304784[_0x5adb('0x1b')]=_0x304784[_0x5adb('0xd')];_0x304784[_0x5adb('0x16')]=_0x304784[_0x5adb('0x1c')];_0x42f4c6(_0x304784);}});};}function createEndUser(_0x36459b,_0x1c06c4,_0x4a5d46,_0x49992e,_0x5d457e){logger[_0x5adb('0x14')]('['+[_0x36459b[_0x5adb('0xf')]()]+_0x5adb('0x1e'),_0x4a5d46);return new Promise(function(_0x512bab,_0x137a5c){var _0x4de310={'method':_0x5adb('0x1f'),'uri':_0x49992e+_0x5adb('0x20')+_0x5d457e,'body':{'user_name':_0x4a5d46[_0x5adb('0x21')],'roles':_0x5adb('0x22'),'first_name':_0x4a5d46[_0x5adb('0x21')],'active':_0x5adb('0x1a'),'date_format':_0x5adb('0x23'),'phone':_0x4a5d46[_0x5adb('0x21')]},'auth':_0x1c06c4,'json':!![]};return rp(_0x4de310)[_0x5adb('0xb')](function(_0x260295){logger['info']('['+[_0x36459b[_0x5adb('0xf')]()]+'],\x20EndUser\x20schema',_0x260295[_0x5adb('0xc')]);_0x4a5d46[_0x5adb('0x24')]=_0x260295['result'][_0x5adb('0xe')];_0x512bab(_0x4a5d46);})[_0x5adb('0x11')](function(_0x461a39){logger['error']('['+[_0x36459b[_0x5adb('0xf')]()]+']',_0x461a39[_0x5adb('0x13')]);_0x137a5c(_0x461a39['message']);});});}function getEndUser(_0x5bb227,_0x1ed9ea,_0x49dd03,_0x663ea0,_0x222568){return function(_0x3c2b07){logger[_0x5adb('0x14')]('['+[_0x5bb227[_0x5adb('0xf')]()]+'],\x20getEndUser\x20input\x20crm',_0x3c2b07);return new Promise(function(_0x2f7abe,_0x215b88){var _0x1c3a5c={'method':'GET','uri':_0x49dd03+'sys_user?sysparm_query=phone%3D'+_0x3c2b07[_0x5adb('0x21')]+'&'+_0x663ea0+'&'+_0x222568,'auth':_0x1ed9ea,'json':!![]};return rp(_0x1c3a5c)[_0x5adb('0xb')](function(_0x586820){if(_0x586820[_0x5adb('0xc')]['length']>0x0){_0x3c2b07[_0x5adb('0x24')]=_0x586820['result'][0x0][_0x5adb('0xe')];logger['info']('['+[_0x5bb227[_0x5adb('0xf')]()]+_0x5adb('0x25'),_0x3c2b07);_0x2f7abe(_0x3c2b07);}else{return createEndUser(_0x5bb227,_0x1ed9ea,_0x3c2b07,_0x49dd03,_0x663ea0)['then'](function(_0x4761e3){logger['info']('['+[_0x5bb227[_0x5adb('0xf')]()]+_0x5adb('0x26'),_0x4761e3);_0x2f7abe(_0x4761e3);});}})[_0x5adb('0x11')](function(_0x50edd1){logger[_0x5adb('0x12')]('['+[_0x5bb227[_0x5adb('0xf')]()]+']',_0x50edd1[_0x5adb('0x13')]);_0x215b88(_0x50edd1[_0x5adb('0x13')]);});});};}function getCustomFields(_0x22aa95,_0x52d74f){var _0x50fe99={};if(_0x22aa95['length']>0x0){_['forEach'](_0x22aa95,function(_0x427c71){if(_0x427c71[_0x5adb('0x27')]===_0x5adb('0x28')&&_0x427c71[_0x5adb('0x29')]&&!_0x427c71[_0x5adb('0x2a')]){_0x50fe99[_0x427c71[_0x5adb('0x2b')][_0x5adb('0x2c')]()]=_0x427c71[_0x5adb('0x2d')]['toString']();}else if(_0x427c71['type']===_0x5adb('0x28')&&_0x427c71['idField']&&_0x427c71[_0x5adb('0x2a')]){_0x50fe99[_0x427c71[_0x5adb('0x2b')][_0x5adb('0x2c')]()]=_0x427c71[_0x5adb('0x2d')][_0x5adb('0x2e')]();}else if(_0x427c71['type']===_0x5adb('0x2f')&&_0x427c71[_0x5adb('0x30')]&&_0x427c71['idField']&&_0x427c71[_0x5adb('0x2a')]){_0x50fe99[_0x427c71[_0x5adb('0x2b')]['toLowerCase']()]=_0x52d74f[_0x427c71[_0x5adb('0x30')]][_0x5adb('0x2e')]();}else if(_0x427c71[_0x5adb('0x27')]===_0x5adb('0x31')&&_0x427c71[_0x5adb('0x32')]&&_0x427c71[_0x5adb('0x32')][_0x5adb('0x33')]&&_0x427c71['idField']&&_0x427c71['customField']){_0x50fe99[_0x427c71[_0x5adb('0x2b')][_0x5adb('0x2c')]()]=_0x52d74f[_0x427c71[_0x5adb('0x32')][_0x5adb('0x33')]['toLowerCase']()]['toString']();}});}return _0x50fe99;}function getTicket(_0xaa32e4,_0x4d7d86,_0x264dfd,_0x72218,_0x1713bc,_0x5358c0){return function(_0x182cbc){logger[_0x5adb('0x14')]('['+[_0xaa32e4['toUpperCase']()]+_0x5adb('0x34'),_0x182cbc);return new Promise(function(_0x251f45,_0x1cdb03){var _0x24758f=_0xaa32e4[_0x5adb('0x2c')]()===_0x5adb('0x35')?_0x182cbc[_0x5adb('0x1b')]:_0x182cbc[_0x5adb('0x24')];var _0x49e1a1={'method':_0x5adb('0x1f'),'uri':_0x264dfd+'incident'+'?'+_0x5358c0,'body':Object['assign']({},{'active':'true','caller_id':_0x24758f,'assigned_to':_0x182cbc[_0x5adb('0x1b')],'short_description':intUtil[_0x5adb('0x36')](_0x72218[_0x5adb('0x37')],_0x1713bc,'\x20'),'description':intUtil['getString'](_0x72218[_0x5adb('0x38')],_0x1713bc,'\x0a')},getCustomFields(_0x72218['Fields'],_0x1713bc)),'auth':_0x4d7d86,'json':!![]};return rp(_0x49e1a1)[_0x5adb('0xb')](function(_0x2c3f21){logger[_0x5adb('0x14')]('['+[_0xaa32e4['toUpperCase']()]+_0x5adb('0x39'),_0x2c3f21['result']);_0x182cbc[_0x5adb('0x3a')]=_0x2c3f21[_0x5adb('0xc')]['sys_id'];_0x182cbc[_0x5adb('0x3b')]=_0x2c3f21[_0x5adb('0xc')][_0x5adb('0x3c')];logger[_0x5adb('0x14')]('['+[_0xaa32e4[_0x5adb('0xf')]()]+']\x20getTicket\x20crm',_0x182cbc);_0x251f45(_0x182cbc);})[_0x5adb('0x11')](function(_0x3a5703){logger[_0x5adb('0x12')]('['+[_0xaa32e4[_0x5adb('0xf')]()]+']',_0x3a5703['message']);_0x1cdb03(_0x3a5703[_0x5adb('0x13')]);});});};}function createRemoteTag(_0x14a46f,_0x3b4794,_0x4d98d0,_0x2b34a8){return new Promise(function(_0xd0e5b7,_0x444a6c){var _0xfd3471={'method':'POST','uri':_0x4d98d0+_0x5adb('0x3d')+'?'+_0x2b34a8,'body':{'short_description':_0x14a46f,'global':!![],'active':!![],'name':_0x14a46f},'auth':_0x3b4794,'json':!![]};return rp(_0xfd3471)[_0x5adb('0xb')](function(_0x28b291){var _0x2cee37=_0x28b291[_0x5adb('0xc')]['sys_id'];_0xd0e5b7(_0x2cee37);});});}function getRemoteTag(_0x378938,_0x4b8d28,_0x2b790d,_0x4f7227,_0x31ae72){return new Promise(function(_0x35df22,_0x1a9358){var _0x42f6d9={'method':'GET','uri':_0x2b790d+_0x5adb('0x3d')+_0x5adb('0x3e')+_0x378938+'&'+_0x4f7227,'auth':_0x4b8d28,'json':!![]};return rp(_0x42f6d9)[_0x5adb('0xb')](function(_0x53d262){if(_0x53d262['result']['length']>0x0){var _0x18ee9a=_0x53d262[_0x5adb('0xc')][0x0][_0x5adb('0xe')];_0x35df22(_0x18ee9a);}else{return createRemoteTag(_0x378938,_0x4b8d28,_0x2b790d,_0x4f7227)[_0x5adb('0xb')](function(_0xa833f4){_0x35df22(_0xa833f4);});}});});}function assignTagToIncident(_0xb06bee,_0x204b9b,_0x8d7810,_0xc880af,_0x380d76){return new Promise(function(_0x452767,_0x1df439){var _0x2c2357={'method':'POST','uri':_0x8d7810+'label_entry'+'?'+_0x380d76,'body':{'label':_0xb06bee,'table':_0x5adb('0x3f'),'id_type':_0x5adb('0x40'),'table_key':_0xc880af[_0x5adb('0x3a')],'title':_0x5adb('0x41')+_0xc880af['ticketNumber'],'id_display':_0xc880af[_0x5adb('0x3b')]},'auth':_0x204b9b,'json':!![]};return rp(_0x2c2357)[_0x5adb('0xb')](function(_0x5d2d2f){_0x452767();})[_0x5adb('0x11')](function(){_0x452767();});});}function manageTags(_0x476e62,_0x1505f7,_0x5edd60,_0x30d185,_0x409357,_0x19df2f,_0x30c92c){return new Promise(function(_0x330290,_0x428019){var _0x513f26=[];_0x1505f7[_0x5adb('0x42')](function(_0x1f042f){_0x513f26[_0x5adb('0x43')](getRemoteTag(_0x1f042f,_0x5edd60,_0x30d185,_0x19df2f,_0x30c92c));});return Promise['all'](_0x513f26)[_0x5adb('0xb')](function(_0x239862){if(_0x239862[_0x5adb('0x44')]){logger['info']('['+[_0x476e62[_0x5adb('0xf')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x239862);var _0xa8ff64=[];_0x239862[_0x5adb('0x42')](function(_0x24e1ab){_0xa8ff64['push'](assignTagToIncident(_0x24e1ab,_0x5edd60,_0x30d185,_0x409357,_0x19df2f));});return Promise[_0x5adb('0x45')](_0xa8ff64)[_0x5adb('0xb')](function(){_0x330290();})['catch'](function(){_0x330290();});}else{_0x330290();}});});}function getTags(_0x12711e,_0x432a3e,_0x248739,_0x3fcad5,_0x55cd0a,_0x4290bb){return function(_0x2b8298){return new Promise(function(_0x307f07,_0x16716e){var _0x5b7556=[];var _0x53a4bc=_0x3fcad5[_0x5adb('0x46')];if(_0x53a4bc&&_0x53a4bc['length']>0x0){_0x5b7556=_['map'](_0x53a4bc,'name');}if(_0x5b7556[_0x5adb('0x44')]>0x0){return manageTags(_0x12711e,_0x5b7556,_0x432a3e,_0x248739,_0x2b8298,_0x55cd0a,_0x4290bb)[_0x5adb('0xb')](function(){_0x307f07(_0x2b8298);});}else{_0x307f07(_0x2b8298);}});};}function emit(_0x48bb5c,_0x395350,_0x91e023){var _0xcdde17=_0x5adb('0x47')+_0x5adb('0x48')+_0x5adb('0x49')+_0x5adb('0x4a');var _0x1ffcd3={'uri':_0x48bb5c+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x91e023+_0xcdde17};io['to'](util['format']('user:%s',_0x395350))[_0x5adb('0x4b')](_0x5adb('0x4c'),_0x1ffcd3);}exports['cs']=function(_0x3a0d1b,_0x2a55a3,_0x1f59bb,_0x2f6ef7,_0x386c76,_0x25f761,_0x58455b,_0x5e55c2){var _0x1fc73b={};var _0x56df90={'user':_0x25f761[_0x5adb('0x4d')],'pass':_0x25f761[_0x5adb('0x4e')]};var _0x2146f0=_0x5adb('0x4f');var _0x40140f=_0x5adb('0x50');_0x25f761[_0x5adb('0x51')]=intUtil[_0x5adb('0x52')](_0x25f761['remoteUri']);_0x25f761[_0x5adb('0x53')]=intUtil[_0x5adb('0x52')](_0x25f761[_0x5adb('0x53')]);var _0x5d3aa4=util[_0x5adb('0x54')](_0x5adb('0x55'),_0x25f761['remoteUri']);_0x1fc73b[_0x5adb('0x16')]=!_['isNil'](_0x2f6ef7)?_0x2f6ef7[_0x5adb('0x56')]:null;_0x1fc73b[_0x5adb('0x1c')]=_0x25f761['email'];_0x1fc73b[_0x5adb('0x21')]=_0x5e55c2[_0x5adb('0x2c')]()===_0x5adb('0x35')?_0x2a55a3[_0x5adb('0x57')]:_0x2a55a3[_0x5adb('0x58')];_0x1fc73b[_0x5adb('0x59')]=_0x5e55c2===_0x5adb('0x5a')||_0x5e55c2===_0x5adb('0x5b')?'queue':_0x5adb('0x35');var _0x31345d=util[_0x5adb('0x54')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x25f761['serverUrl'],_0x2a55a3[_0x5adb('0x5c')],md5(_0x2a55a3['uniqueid']));if(_0x386c76&&_0x386c76[_0x5adb('0x5d')]){logger[_0x5adb('0x14')](_0x5adb('0x5e'),'Recording\x20is\x20enabled!');_0x2a55a3[_0x5adb('0x5f')]=_0x31345d;}else if(_0x58455b&&_0x58455b[_0x5adb('0x60')]&&_0x58455b[_0x5adb('0x60')]!==_0x5adb('0x61')){logger[_0x5adb('0x14')]('[OUTBOUND]',_0x5adb('0x62'));_0x2a55a3[_0x5adb('0x5f')]=_0x31345d;}else{_0x2a55a3[_0x5adb('0x5f')]='';}return getAdminUser(_0x5e55c2,_0x56df90,_0x1fc73b,_0x5d3aa4,_0x40140f,_0x2146f0)[_0x5adb('0xb')](getUser(_0x5e55c2,_0x56df90,_0x5d3aa4,_0x40140f,_0x2146f0))['then'](getEndUser(_0x5e55c2,_0x56df90,_0x5d3aa4,_0x40140f,_0x2146f0))[_0x5adb('0xb')](getTicket(_0x5e55c2,_0x56df90,_0x5d3aa4,_0x1f59bb,_0x2a55a3,_0x40140f))[_0x5adb('0xb')](function(_0x182873){logger[_0x5adb('0x14')](util[_0x5adb('0x54')](_0x5adb('0x63'),_0x182873[_0x5adb('0x3a')]));logger['info'](util[_0x5adb('0x54')](_0x5adb('0x64'),_0x5e55c2));if(_0x5e55c2!=='unmanaged'){logger[_0x5adb('0x14')]('['+[_0x5e55c2[_0x5adb('0xf')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x25f761[_0x5adb('0x51')],_0x2f6ef7['name'],_0x182873[_0x5adb('0x3a')]);}})[_0x5adb('0x11')](function(_0x4a2ebc){logger[_0x5adb('0x12')]('['+[_0x5e55c2['toUpperCase']()]+_0x5adb('0x65'),util[_0x5adb('0x66')](_0x4a2ebc,{'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 373b76a..aced4a9 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 _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
+var _0xa7ee=['Ticket\x20created!','charAt','[OUTBOUND]','toUpperCase','contacts','lastevent','lodash','bluebird','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','POST','info','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','duration_hours','parent_type','Contacts','parent_name','length','variableName','JSON','Calls','Basic\x20%s','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','stringify','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','Caller\x20-\x20%s','Enduser\x20created.','map','forEach','string','customField','nameField','content','idField','push','type','custom_fields','customVariable','Variable','toLowerCase','username','password','PLAIN','xCALLY\x20Motion\x20integration','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','calleridnum','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','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','catch','error','outbound','recordingFormat','none','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Outbound'];(function(_0xbe3382,_0x5d6862){var _0xc809a4=function(_0x403573){while(--_0x403573){_0xbe3382['push'](_0xbe3382['shift']());}};_0xc809a4(++_0x5d6862);}(_0xa7ee,0x159));var _0xea7e=function(_0x118139,_0x7ce965){_0x118139=_0x118139-0x0;var _0x2fece9=_0xa7ee[_0x118139];return _0x2fece9;};'use strict';var _=require(_0xea7e('0x0'));var rp=require('request-promise');var BPromise=require(_0xea7e('0x1'));var md5=require(_0xea7e('0x2'));var util=require(_0xea7e('0x3'));var Redis=require(_0xea7e('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xea7e('0x5'))('sugarcrm');config[_0xea7e('0x6')]=_[_0xea7e('0x7')](config[_0xea7e('0x6')],{'host':_0xea7e('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xea7e('0x6')]));var def={'method':_0xea7e('0x9'),'json':!![]};function emit(_0x303dab,_0x38d996,_0x8541da){io['to'](_0x303dab)['emit'](_0x38d996,_0x8541da);}function getTicket(_0x5b94d7,_0x30cf8c,_0x4b661f,_0xb52b7e,_0x141f18,_0x158eb7,_0x24a39b,_0x4da86b){logger[_0xea7e('0xa')]('Creating\x20new\x20ticket...');var _0x335f29=new Date();var _0x31b671=[{'name':_0xea7e('0xb'),'value':intUtil[_0xea7e('0xc')](_0xb52b7e[_0xea7e('0xd')],_0x141f18,'\x20')},{'name':_0xea7e('0xe'),'value':_0x30cf8c['id']},{'name':_0xea7e('0xf'),'value':_0x30cf8c['id']},{'name':_0xea7e('0x10'),'value':intUtil['getString'](_0xb52b7e[_0xea7e('0x11')],_0x141f18,'\x0a')},{'name':_0xea7e('0x12'),'value':_0x335f29[_0xea7e('0x13')]()[_0xea7e('0x14')](0x0,0x13)['replace']('T','\x20')},{'name':_0xea7e('0x15'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x4b661f['id']},{'name':_0xea7e('0x16'),'value':_0xea7e('0x17')},{'name':_0xea7e('0x18'),'value':_0x4b661f['name']},{'name':'direction','value':_0x4da86b}];if(_0x158eb7[_0xea7e('0x19')]){_['forEach'](_0x158eb7,function(_0x195d5a){if(_0x141f18[_0x195d5a[_0xea7e('0x1a')]]){_0x31b671['push']({'name':_0x195d5a['idField'],'value':_0x141f18[_0x195d5a[_0xea7e('0x1a')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xea7e('0x1b'),'rest_data':JSON['stringify']({'session':_0x24a39b['id'],'module_name':_0xea7e('0x1c'),'name_value_list':_0x31b671})}});}function getAuth(_0x1def2a){return util['format'](_0xea7e('0x1d'),new Buffer(_0x1def2a['apiKey']+':X')[_0xea7e('0x1e')](_0xea7e('0x1f')));}function getServerInfo(_0xf779ad){return request({'form':{'method':_0xea7e('0x20'),'input_type':_0xea7e('0x1b'),'response_type':_0xea7e('0x1b'),'rest_data':JSON['stringify']({'session':_0xf779ad['id']})}});}function getUser(_0xd41599,_0x1ddcc7,_0x4e8b96){if(!_[_0xea7e('0x21')](_0x1ddcc7)){logger[_0xea7e('0xa')](_0xea7e('0x22'),_0x1ddcc7);return request({'form':{'method':'get_entry_list','input_type':_0xea7e('0x1b'),'response_type':_0xea7e('0x1b'),'rest_data':JSON[_0xea7e('0x23')]({'session':_0x4e8b96['id'],'module_name':'Employees','query':util[_0xea7e('0x24')](_0xea7e('0x25'),_0x1ddcc7),'order_by':'','offset':'0','select_fields':['id',_0xea7e('0xb'),_0xea7e('0x26')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xea7e('0x27')](function(_0x789f9e){if(_0x789f9e[_0xea7e('0x28')][_0xea7e('0x19')]){var _0x1067cd=_[_0xea7e('0x29')](_0x789f9e['entry_list'],function(_0x1744f3){return _0x1744f3[_0xea7e('0x2a')]['user_name'][_0xea7e('0x2b')]===_0x1ddcc7;});if(_0x1067cd){logger[_0xea7e('0xa')](_0xea7e('0x2c'));return BPromise[_0xea7e('0x2d')]({'id':_0x1067cd[_0xea7e('0x2a')]['id']['value'],'name':_0x1067cd[_0xea7e('0x2a')][_0xea7e('0xb')]['value']});}}logger[_0xea7e('0xa')](_0xea7e('0x2e'));return BPromise['resolve']({'id':_0x4e8b96[_0xea7e('0x2a')]['user_id'][_0xea7e('0x2b')],'name':_0x4e8b96[_0xea7e('0x2a')][_0xea7e('0x26')][_0xea7e('0x2b')]});});}else{logger[_0xea7e('0xa')](_0xea7e('0x2f'));return BPromise['resolve']({'id':_0x4e8b96[_0xea7e('0x2a')][_0xea7e('0x30')][_0xea7e('0x2b')],'name':_0x4e8b96[_0xea7e('0x2a')][_0xea7e('0x26')][_0xea7e('0x2b')]});}}function getEndUser(_0x55b63e,_0x519022,_0xb53ef9,_0x2b3744){logger[_0xea7e('0xa')]('Searching\x20enduser\x20with\x20phone',_0xb53ef9);return request({'form':{'method':_0xea7e('0x31'),'input_type':_0xea7e('0x1b'),'response_type':_0xea7e('0x1b'),'rest_data':JSON[_0xea7e('0x23')]({'session':_0x2b3744['id'],'module_name':_0xea7e('0x17'),'query':util[_0xea7e('0x24')](_0xea7e('0x32'),_0xb53ef9),'order_by':'','offset':'0','select_fields':['id',_0xea7e('0xb'),_0xea7e('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xea7e('0x27')](function(_0x334324){if(_0x334324[_0xea7e('0x28')][_0xea7e('0x19')]){var _0x2decb9=_[_0xea7e('0x29')](_0x334324['entry_list'],function(_0x3b4b4e){return _0x3b4b4e[_0xea7e('0x2a')][_0xea7e('0x33')][_0xea7e('0x2b')]===_0xb53ef9;});if(_0x2decb9){logger['info'](_0xea7e('0x34'));return BPromise['resolve']({'id':_0x2decb9[_0xea7e('0x2a')]['id']['value'],'name':_0x2decb9[_0xea7e('0x2a')][_0xea7e('0xb')][_0xea7e('0x2b')],'phone':_0x2decb9[_0xea7e('0x2a')][_0xea7e('0x33')][_0xea7e('0x2b')]});}}else{logger['info'](_0xea7e('0x35'));return request({'form':{'method':_0xea7e('0x36'),'input_type':'JSON','response_type':_0xea7e('0x1b'),'rest_data':JSON['stringify']({'session':_0x2b3744['id'],'module_name':_0xea7e('0x17'),'name_value_list':[{'name':_0xea7e('0x37'),'value':_0x519022!==''?_0x519022:util[_0xea7e('0x24')](_0xea7e('0x38'),_0xb53ef9)},{'name':_0xea7e('0x33'),'value':_0xb53ef9}]})}})[_0xea7e('0x27')](function(_0x157ec3){logger[_0xea7e('0xa')](_0xea7e('0x39'));return BPromise[_0xea7e('0x2d')]({'id':_0x157ec3['id'],'name':_0x157ec3[_0xea7e('0x28')][_0xea7e('0x37')][_0xea7e('0x2b')],'phone':_0x157ec3[_0xea7e('0x28')][_0xea7e('0x33')][_0xea7e('0x2b')]});});}});}function request(_0x507d92){logger['debug']('[HTTP]',JSON['stringify'](_0x507d92));return rp(_['merge'](def,_0x507d92));}function getTags(_0x5f0fbf,_0x2a6131){var _0x5c3a0c=[];if(_0x5f0fbf&&_0x5f0fbf[_0xea7e('0x19')]>0x0){_0x5c3a0c=_[_0xea7e('0x3a')](_0x5f0fbf,_0x2a6131);}return _0x5c3a0c;}function getCustomFields(_0x4e499e,_0x5c9e86){var _0x1ac12d=[];var _0x121ce6={'custom_fields':[]};if(_0x4e499e[_0xea7e('0x19')]>0x0){_[_0xea7e('0x3b')](_0x4e499e,function(_0x521744){if(_0x521744['type']===_0xea7e('0x3c')&&_0x521744['nameField']&&!_0x521744[_0xea7e('0x3d')]){_0x121ce6[_0x521744[_0xea7e('0x3e')]['toLowerCase']()]=_0x521744[_0xea7e('0x3f')][_0xea7e('0x1e')]();}else if(_0x521744['type']===_0xea7e('0x3c')&&_0x521744[_0xea7e('0x40')]&&_0x521744['customField']){_0x121ce6['custom_fields'][_0xea7e('0x41')]({'id':_0x521744[_0xea7e('0x40')],'value':_0x521744['content'][_0xea7e('0x1e')]()});}else if(_0x521744[_0xea7e('0x42')]==='variable'&&_0x521744[_0xea7e('0x1a')]&&_0x521744[_0xea7e('0x40')]&&_0x521744[_0xea7e('0x3d')]){_0x5c9e86[_0x521744[_0xea7e('0x1a')]]&&_0x121ce6[_0xea7e('0x43')][_0xea7e('0x41')]({'id':_0x521744[_0xea7e('0x40')],'value':_0x5c9e86[_0x521744['variableName']][_0xea7e('0x1e')]()});}else if(_0x521744[_0xea7e('0x42')]===_0xea7e('0x44')&&_0x521744[_0xea7e('0x45')]&&_0x521744[_0xea7e('0x45')][_0xea7e('0xb')]&&_0x521744['idField']&&_0x521744[_0xea7e('0x3d')]){_0x5c9e86[_0x521744[_0xea7e('0x45')][_0xea7e('0xb')][_0xea7e('0x46')]()]&&_0x121ce6[_0xea7e('0x43')][_0xea7e('0x41')]({'id':_0x521744['idField'],'value':_0x5c9e86[_0x521744[_0xea7e('0x45')][_0xea7e('0xb')][_0xea7e('0x46')]()]['toString']()});}});}return _0x121ce6;}function getConnection(_0x3d0243){return request({'method':_0xea7e('0x9'),'form':{'method':'login','input_type':_0xea7e('0x1b'),'response_type':_0xea7e('0x1b'),'rest_data':JSON[_0xea7e('0x23')]({'user_auth':{'user_name':_0x3d0243[_0xea7e('0x47')],'password':_0x3d0243[_0xea7e('0x48')],'encryption':_0xea7e('0x49')},'application':_0xea7e('0x4a')})}})[_0xea7e('0x27')](function(_0x3a2912){var _0x4c2c73=_0x3a2912;if(_0x4c2c73['id']){def['sessionID']=_0x4c2c73['id'];return BPromise[_0xea7e('0x2d')](_0x4c2c73);}else{throw new Error(util[_0xea7e('0x24')]('Account\x20%d\x20is\x20not\x20valid',_0x3d0243['id']));}});}function setRelationship(_0x338cbb,_0x5b0bcb,_0x10b3ba,_0x40f092){return request({'form':{'method':_0xea7e('0x4b'),'input_type':'JSON','response_type':_0xea7e('0x1b'),'rest_data':JSON[_0xea7e('0x23')]({'session':_0x338cbb['id'],'module_name':_0xea7e('0x1c'),'module_id':_0x10b3ba['id'],'link_field_name':_0x40f092,'related_ids':[_0x5b0bcb['id']]})}});}exports[_0xea7e('0x4c')]=function(_0x9aa251,_0x4fa681,_0x47de8f,_0xf8e601,_0x349705,_0xeae827){var _0x1da457,_0x57ee06,_0x2fde0c,_0x28529b;_0xeae827[_0xea7e('0x4d')]=intUtil[_0xea7e('0x4e')](_0xeae827[_0xea7e('0x4d')]);_0xeae827['serverUrl']=intUtil['stripTrailingSlash'](_0xeae827[_0xea7e('0x4f')]);def[_0xea7e('0x50')]=util['format'](_0xea7e('0x51'),_0xeae827[_0xea7e('0x4d')]);if(_0x349705&&_0x349705[_0xea7e('0x52')]){logger[_0xea7e('0xa')](_0xea7e('0x53'),'Recording\x20is\x20enabled!');_0x4fa681['recordingURL']=util[_0xea7e('0x24')](_0xea7e('0x54'),_0xeae827[_0xea7e('0x4f')],_0x4fa681[_0xea7e('0x55')],md5(_0x4fa681[_0xea7e('0x55')]));}else{_0x4fa681[_0xea7e('0x56')]='';}return getConnection(_0xeae827)[_0xea7e('0x27')](function(_0x4eb217){_0x28529b=_0x4eb217;return getUser(_0xeae827,_0xf8e601['name'],_0x28529b);})['then'](function(_0xf79204){_0x1da457=_0xf79204;logger[_0xea7e('0xa')]('The\x20User\x20ID\x20is:',_0x1da457['id']);return getEndUser(_0xeae827,_0x4fa681[_0xea7e('0x57')],_0x4fa681[_0xea7e('0x58')],_0x28529b);})['then'](function(_0x3a8514){_0x57ee06=_0x3a8514;logger[_0xea7e('0xa')]('The\x20Enduser\x20ID\x20is:',_0x57ee06['id']);return getTicket(_0xeae827,_0x1da457,_0x57ee06,_0x47de8f,_0x4fa681,_0x47de8f[_0xea7e('0x59')],_0x28529b,_0xea7e('0x5a'));})[_0xea7e('0x27')](function(_0x2a31d5){_0x2fde0c=_0x2a31d5;logger[_0xea7e('0xa')]('Ticket\x20created!');logger['info'](_0xea7e('0x5b'),_0x2fde0c['id']);return setRelationship(_0x28529b,_0x1da457,_0x2fde0c,_0xea7e('0x5c'));})[_0xea7e('0x27')](function(){return setRelationship(_0x28529b,_0x57ee06,_0x2fde0c,'contacts');})[_0xea7e('0x27')](function(){return getServerInfo(_0x28529b);})[_0xea7e('0x27')](function(_0x69c46){var _0x1645ba=parseInt(_0x69c46[_0xea7e('0x5d')]['charAt'](0x0));var _0x5398fa=util[_0xea7e('0x24')](_0xea7e('0x5e'),_0xeae827['remoteUri'],_0x2fde0c['id']);if(_0x1645ba>0x6){_0x5398fa=util[_0xea7e('0x24')](_0xea7e('0x5f'),_0xeae827['remoteUri'],_0x2fde0c['id']);}logger[_0xea7e('0xa')](_0xea7e('0x53'),_0xea7e('0x60'));emit(util[_0xea7e('0x24')](_0xea7e('0x61'),_0xf8e601[_0xea7e('0xb')]),'trigger:browser:url',{'uri':_0x5398fa});})[_0xea7e('0x62')](function(_0x53e59c){logger[_0xea7e('0x63')](_0xea7e('0x53'),JSON[_0xea7e('0x23')](_0x53e59c));});};exports[_0xea7e('0x64')]=function(_0x4a5607,_0x3d5022,_0x4b99c2,_0x460f8e,_0xfb16eb,_0x567313,_0x1c2bdd){var _0x139af6,_0x23ce9c,_0x4bd0bf,_0x306937;_0x567313['remoteUri']=intUtil['stripTrailingSlash'](_0x567313['remoteUri']);_0x567313[_0xea7e('0x4f')]=intUtil['stripTrailingSlash'](_0x567313['serverUrl']);def[_0xea7e('0x50')]=util[_0xea7e('0x24')](_0xea7e('0x51'),_0x567313[_0xea7e('0x4d')]);if(_0x1c2bdd&&_0x1c2bdd[_0xea7e('0x65')]&&_0x1c2bdd['recordingFormat']!==_0xea7e('0x66')){logger['info']('[OUTBOUND]',_0xea7e('0x67'));_0x3d5022[_0xea7e('0x56')]=util['format'](_0xea7e('0x54'),_0x567313[_0xea7e('0x4f')],_0x3d5022['uniqueid'],md5(_0x3d5022['uniqueid']));}return getConnection(_0x567313)['then'](function(_0x4fbaae){_0x306937=_0x4fbaae;return getUser(_0x567313,_0x460f8e[_0xea7e('0xb')],_0x306937);})['then'](function(_0x2c10a6){_0x139af6=_0x2c10a6;logger[_0xea7e('0xa')](_0xea7e('0x68'),_0x139af6['id']);return getEndUser(_0x567313,_0x3d5022['destcalleridname'],_0x3d5022['destcalleridnum'],_0x306937);})[_0xea7e('0x27')](function(_0x2102a5){_0x23ce9c=_0x2102a5;logger['info'](_0xea7e('0x69'),_0x23ce9c['id']);return getTicket(_0x567313,_0x139af6,_0x23ce9c,_0x4b99c2,_0x3d5022,_0x4b99c2[_0xea7e('0x59')],_0x306937,_0xea7e('0x6a'));})[_0xea7e('0x27')](function(_0x1314d0){_0x4bd0bf=_0x1314d0;logger[_0xea7e('0xa')](_0xea7e('0x6b'));logger[_0xea7e('0xa')](_0xea7e('0x5b'),_0x4bd0bf['id']);return setRelationship(_0x306937,_0x139af6,_0x4bd0bf,_0xea7e('0x5c'));})[_0xea7e('0x27')](function(){return setRelationship(_0x306937,_0x23ce9c,_0x4bd0bf,'contacts');})[_0xea7e('0x27')](function(){return getServerInfo(_0x306937);})[_0xea7e('0x27')](function(_0x3358a3){var _0x48933d=parseInt(_0x3358a3[_0xea7e('0x5d')][_0xea7e('0x6c')](0x0));var _0x31dbdc=util[_0xea7e('0x24')](_0xea7e('0x5e'),_0x567313[_0xea7e('0x4d')],_0x4bd0bf['id']);if(_0x48933d>0x6){_0x31dbdc=util[_0xea7e('0x24')](_0xea7e('0x5f'),_0x567313[_0xea7e('0x4d')],_0x4bd0bf['id']);}logger['info'](_0xea7e('0x6d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xea7e('0x24')](_0xea7e('0x61'),_0x460f8e['name']),'trigger:browser:url',{'uri':_0x31dbdc});})[_0xea7e('0x62')](function(_0x47afc2){logger['error'](_0xea7e('0x6d'),JSON['stringify'](_0x47afc2));});};exports['unmanaged']=function(_0xd18255,_0x25d46f,_0x31e468,_0x4f7da8,_0x5af7c9,_0x147826){var _0x1fed12,_0x1e9ffa,_0x8de69e,_0x563e40;_0x147826['remoteUri']=intUtil[_0xea7e('0x4e')](_0x147826[_0xea7e('0x4d')]);_0x147826[_0xea7e('0x4f')]=intUtil[_0xea7e('0x4e')](_0x147826[_0xea7e('0x4f')]);def[_0xea7e('0x50')]=util[_0xea7e('0x24')](_0xea7e('0x51'),_0x147826[_0xea7e('0x4d')]);if(_0x5af7c9&&_0x5af7c9[_0xea7e('0x52')]){logger[_0xea7e('0xa')]('['+_0x25d46f['lastevent'][_0xea7e('0x6e')]()+']',_0xea7e('0x67'));_0x25d46f[_0xea7e('0x56')]=util[_0xea7e('0x24')](_0xea7e('0x54'),_0x147826[_0xea7e('0x4f')],_0x25d46f[_0xea7e('0x55')],md5(_0x25d46f[_0xea7e('0x55')]));}else{_0x25d46f[_0xea7e('0x56')]='';}return getConnection(_0x147826)['then'](function(_0x10413e){_0x563e40=_0x10413e;if(!_[_0xea7e('0x21')](_0x4f7da8)){return getUser(_0x147826,_0x4f7da8[_0xea7e('0xb')],_0x563e40);}else{return getUser(_0x147826,null,_0x563e40);}})[_0xea7e('0x27')](function(_0x243f45){_0x1fed12=_0x243f45;logger[_0xea7e('0xa')](_0xea7e('0x68'),_0x1fed12['id']);return getEndUser(_0x147826,_0x25d46f[_0xea7e('0x57')],_0x25d46f[_0xea7e('0x58')],_0x563e40);})['then'](function(_0x318011){_0x1e9ffa=_0x318011;logger[_0xea7e('0xa')]('The\x20Enduser\x20ID\x20is:',_0x1e9ffa['id']);return getTicket(_0x147826,_0x1fed12,_0x1e9ffa,_0x31e468,_0x25d46f,_0x31e468[_0xea7e('0x59')],_0x563e40,'Inbound');})[_0xea7e('0x27')](function(_0x5eaa32){_0x8de69e=_0x5eaa32;logger[_0xea7e('0xa')](_0xea7e('0x6b'));logger[_0xea7e('0xa')](_0xea7e('0x5b'),_0x8de69e['id']);return setRelationship(_0x563e40,_0x1fed12,_0x8de69e,'users');})['then'](function(){return setRelationship(_0x563e40,_0x1e9ffa,_0x8de69e,_0xea7e('0x6f'));})[_0xea7e('0x27')](function(){return getServerInfo(_0x563e40);})['catch'](function(_0x3bbc33){logger['error']('['+_0x25d46f[_0xea7e('0x70')][_0xea7e('0x6e')]()+']',JSON['stringify'](_0x3bbc33));});};
\ 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 cec077b..0202f2f 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 _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
+var _0x48f5=['customVariable','Variable','name','toLowerCase','keyValue','key','format','%s:\x20%s','keyContent','keyType','join','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','string','push','content','type','variable','variableName','toString'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x48f5,0x1a7));var _0x548f=function(_0x60953a,_0x49ec5d){_0x60953a=_0x60953a-0x0;var _0x136a6e=_0x48f5[_0x60953a];return _0x136a6e;};'use strict';var _=require(_0x548f('0x0'));var util=require(_0x548f('0x1'));exports[_0x548f('0x2')]=function(_0x2388d3,_0x17c946,_0x2ceefb){var _0x1c53f4=[];if(_0x2388d3[_0x548f('0x3')]>0x0){var _0x3264ea=_[_0x548f('0x4')](_0x2388d3,['id']);for(var _0x40085a=0x0;_0x40085a<_0x3264ea[_0x548f('0x3')];_0x40085a++){var _0x49e928=_0x3264ea[_0x40085a];if(_0x49e928['type']===_0x548f('0x5')){_0x1c53f4[_0x548f('0x6')](_0x49e928[_0x548f('0x7')]);}else if(_0x49e928[_0x548f('0x8')]===_0x548f('0x9')&&_0x49e928[_0x548f('0xa')]){_0x17c946[_0x49e928['variableName']]&&_0x1c53f4['push'](_0x17c946[_0x49e928['variableName']][_0x548f('0xb')]());}else if(_0x49e928[_0x548f('0x8')]===_0x548f('0xc')&&_0x49e928['Variable']&&_0x49e928[_0x548f('0xd')]['name']){_0x17c946[_0x49e928[_0x548f('0xd')][_0x548f('0xe')][_0x548f('0xf')]()]&&_0x1c53f4[_0x548f('0x6')](_0x17c946[_0x49e928[_0x548f('0xd')][_0x548f('0xe')][_0x548f('0xf')]()]['toString']());}else if(_0x49e928['type']===_0x548f('0x10')){if(_0x49e928['keyType']==='string'&&_0x49e928[_0x548f('0x11')]){_0x1c53f4[_0x548f('0x6')](util[_0x548f('0x12')](_0x548f('0x13'),_0x49e928[_0x548f('0x11')],_0x49e928[_0x548f('0x14')]));}else if(_0x49e928['keyType']===_0x548f('0x9')&&_0x49e928[_0x548f('0xa')]&&_0x49e928[_0x548f('0x11')]){_0x17c946[_0x49e928[_0x548f('0xa')]]&&_0x1c53f4[_0x548f('0x6')](util[_0x548f('0x12')](_0x548f('0x13'),_0x49e928[_0x548f('0x11')],_0x17c946[_0x49e928['variableName']]));}else if(_0x49e928[_0x548f('0x15')]===_0x548f('0xc')&&_0x49e928[_0x548f('0xd')]&&_0x49e928[_0x548f('0xd')][_0x548f('0xe')]&&_0x49e928[_0x548f('0x11')]){_0x17c946[_0x49e928[_0x548f('0xd')][_0x548f('0xe')][_0x548f('0xf')]()]&&_0x1c53f4[_0x548f('0x6')](util[_0x548f('0x12')]('%s:\x20%s',_0x49e928['key'],_0x17c946[_0x49e928[_0x548f('0xd')][_0x548f('0xe')]['toLowerCase']()]));}}}}return _0x1c53f4[_0x548f('0x16')](_0x2ceefb);};exports[_0x548f('0x17')]=function(_0xaa885f){var _0x2753cc=_0xaa885f['slice'](-0x1);if(_0x2753cc==='/'){_0xaa885f=_0xaa885f[_0x548f('0x18')](0x0,_0xaa885f[_0x548f('0x19')](_0x2753cc));}return _0xaa885f;};exports[_0x548f('0x1a')]=function(_0x392d7b){if(!_[_0x548f('0x1b')](_0x392d7b)&&_0x392d7b!==''){var _0x570266=/^(([^<>()\[\]\\.,;:\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 _0x570266[_0x548f('0x1c')](String(_0x392d7b)['toLowerCase']());}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 2b350be..f6057f2 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 _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
+var _0x8d4d=['[OUTBOUND]','unmanaged','lastevent','toUpperCase','Ticket\x20created!','lodash','request-promise','md5','util','ioredis','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Open','getString','Subjects','Descriptions','POST','format','%s/webservice.php','remoteUri','create','username','HelpDesk','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','stringify','validateEmail','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','Searching\x20end\x20user\x20with\x20phone','GET','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!','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','sessionName','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','user:%s','outbound','serverUrl','recordingFormat','none','destcalleridname','destcalleridnum','trigger:browser:url'];(function(_0x55d11b,_0x11f7de){var _0x145d2b=function(_0x5e2b1d){while(--_0x5e2b1d){_0x55d11b['push'](_0x55d11b['shift']());}};_0x145d2b(++_0x11f7de);}(_0x8d4d,0x134));var _0xd8d4=function(_0x54caf6,_0x4b4c6b){_0x54caf6=_0x54caf6-0x0;var _0x1e94f0=_0x8d4d[_0x54caf6];return _0x1e94f0;};'use strict';var _=require(_0xd8d4('0x0'));var rp=require(_0xd8d4('0x1'));var BPromise=require('bluebird');var md5=require(_0xd8d4('0x2'));var util=require(_0xd8d4('0x3'));var Redis=require(_0xd8d4('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xd8d4('0x5'))(_0xd8d4('0x6'));config[_0xd8d4('0x7')]=_['defaults'](config['redis'],{'host':_0xd8d4('0x8'),'port':0x18eb});var io=require(_0xd8d4('0x9'))(new Redis(config[_0xd8d4('0x7')]));function emit(_0x17fc68,_0x1fed99,_0x117b63){io['to'](_0x17fc68)[_0xd8d4('0xa')](_0x1fed99,_0x117b63);}function getCustomFields(_0x11078a,_0x5a5229){var _0x19f474={};if(_0x11078a[_0xd8d4('0xb')]>0x0){_[_0xd8d4('0xc')](_0x11078a,function(_0x45caeb){if(_0x45caeb[_0xd8d4('0xd')]===_0xd8d4('0xe')&&_0x45caeb[_0xd8d4('0xf')]){_0x19f474[_0x45caeb['idField']]=_0x45caeb[_0xd8d4('0x10')][_0xd8d4('0x11')]();}else if(_0x45caeb[_0xd8d4('0xd')]===_0xd8d4('0x12')&&_0x45caeb[_0xd8d4('0x13')]&&_0x45caeb[_0xd8d4('0xf')]&&_0x5a5229[_0x45caeb[_0xd8d4('0x13')]]){_0x19f474[_0x45caeb[_0xd8d4('0xf')]]=_0x5a5229[_0x45caeb[_0xd8d4('0x13')]]['toString']();}else if(_0x45caeb[_0xd8d4('0xd')]===_0xd8d4('0x14')&&_0x45caeb[_0xd8d4('0x15')]&&_0x45caeb['Variable'][_0xd8d4('0x16')]&&_0x45caeb['idField']&&_0x5a5229[_0x45caeb[_0xd8d4('0x15')][_0xd8d4('0x16')][_0xd8d4('0x17')]()]){_0x19f474[_0x45caeb[_0xd8d4('0xf')]]=_0x5a5229[_0x45caeb[_0xd8d4('0x15')][_0xd8d4('0x16')][_0xd8d4('0x17')]()]['toString']();}});}return _0x19f474;}function createTicket(_0x22cc7f,_0x1a6ca5,_0x4fbadf,_0x4c48eb,_0x3e033b,_0x721a4b,_0x496c56){logger[_0xd8d4('0x18')](_0xd8d4('0x19'));var _0x20993e=_[_0xd8d4('0x1a')]({'parent_id':'','assigned_user_id':_0x1a6ca5['id'],'ticketpriorities':'Normal','ticketstatus':_0xd8d4('0x1b'),'ticket_title':intUtil[_0xd8d4('0x1c')](_0x4c48eb[_0xd8d4('0x1d')],_0x3e033b,'\x20'),'description':intUtil[_0xd8d4('0x1c')](_0x4c48eb[_0xd8d4('0x1e')],_0x3e033b,'\x0a'),'contact_id':_0x4fbadf['id']},getCustomFields(_0x721a4b,_0x3e033b));var _0x3355df={'method':_0xd8d4('0x1f'),'uri':util[_0xd8d4('0x20')](_0xd8d4('0x21'),_0x22cc7f[_0xd8d4('0x22')]),'form':{'operation':_0xd8d4('0x23'),'username':_0x22cc7f[_0xd8d4('0x24')],'sessionName':_0x496c56['sessionName'],'elementType':_0xd8d4('0x25'),'element':JSON['stringify'](_0x20993e)},'json':!![]};return request(_0x3355df)[_0xd8d4('0x26')](function(_0x484f5a){if(_0x484f5a[_0xd8d4('0x27')]){return BPromise[_0xd8d4('0x28')]({'id':_0x484f5a['result']['id']});}else{throw new Error(util['format'](_0xd8d4('0x29'),JSON['stringify'](_0x484f5a[_0xd8d4('0x2a')])));}})[_0xd8d4('0x2b')](function(_0x1a680a){var _0x27b7cb=_0x1a680a[_0xd8d4('0x2c')]||0x1f4;logger[_0xd8d4('0x2a')](_0xd8d4('0x2d'),'createTicket',_0x27b7cb,JSON[_0xd8d4('0x2e')](_0x1a680a));});}function getUser(_0x41ad19,_0x10ba39,_0x2e29d8){if(intUtil[_0xd8d4('0x2f')](_0x10ba39)){logger[_0xd8d4('0x18')]('Getting\x20agent\x20with\x20email',_0x10ba39);return request({'method':'GET','uri':util[_0xd8d4('0x20')](_0xd8d4('0x21'),_0x41ad19[_0xd8d4('0x22')]),'qs':{'operation':'query','username':_0x41ad19[_0xd8d4('0x24')],'sessionName':_0x2e29d8['sessionName'],'query':util[_0xd8d4('0x20')](_0xd8d4('0x30'),_0x10ba39)},'json':!![]})[_0xd8d4('0x26')](function(_0x10a15c){if(_0x10a15c[_0xd8d4('0x27')]&&_0x10a15c[_0xd8d4('0x31')][_0xd8d4('0xb')]){logger[_0xd8d4('0x18')]('Agent\x20found!');return BPromise['resolve']({'id':_0x10a15c[_0xd8d4('0x31')][0x0]['id'],'email':_0x10a15c['result'][0x0]['email1'],'name':_0x10a15c['result'][0x0]['first_name']+'\x20'+_0x10a15c[_0xd8d4('0x31')][_0xd8d4('0x32')]});}else{logger[_0xd8d4('0x18')](_0xd8d4('0x33'));return BPromise[_0xd8d4('0x28')]({'id':_0x2e29d8[_0xd8d4('0x34')],'email':_0x41ad19[_0xd8d4('0x24')],'name':_0xd8d4('0x35')});}})[_0xd8d4('0x2b')](function(_0x997fc5){var _0x206de3=_0x997fc5[_0xd8d4('0x2c')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0xd8d4('0x36'),_0x206de3,JSON['stringify'](_0x997fc5));});}else{logger[_0xd8d4('0x18')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xd8d4('0x28')]({'id':_0x2e29d8[_0xd8d4('0x34')],'email':_0x41ad19[_0xd8d4('0x24')],'name':'admin'})[_0xd8d4('0x2b')](function(_0x3aeb72){var _0x3f8ce7=_0x3aeb72[_0xd8d4('0x2c')]||0x1f4;logger[_0xd8d4('0x2a')](_0xd8d4('0x2d'),_0xd8d4('0x36'),_0x3f8ce7,JSON[_0xd8d4('0x2e')](_0x3aeb72));});}}function getEndUser(_0x4d73bf,_0x35d06f,_0x324669,_0x4974c9){logger[_0xd8d4('0x18')](_0xd8d4('0x37'),_0x324669);return request({'method':_0xd8d4('0x38'),'uri':util['format'](_0xd8d4('0x21'),_0x4d73bf['remoteUri']),'qs':{'operation':_0xd8d4('0x39'),'username':_0x4d73bf[_0xd8d4('0x24')],'sessionName':_0x4974c9['sessionName'],'query':util[_0xd8d4('0x20')](_0xd8d4('0x3a'),_0x324669,_0x324669,_0x324669,_0x324669,_0x324669)},'json':!![]})['then'](function(_0x585fbc){if(_0x585fbc[_0xd8d4('0x27')]&&_0x585fbc[_0xd8d4('0x31')]['length']){logger[_0xd8d4('0x18')](_0xd8d4('0x3b'));return BPromise[_0xd8d4('0x28')]({'id':_0x585fbc['result'][0x0]['id'],'name':_0x585fbc[_0xd8d4('0x31')][0x0]['firstname']+'\x20'+_0x585fbc[_0xd8d4('0x31')][0x0][_0xd8d4('0x3c')],'phone':_0x324669});}else{logger[_0xd8d4('0x18')](_0xd8d4('0x3d'));return request({'method':_0xd8d4('0x1f'),'uri':util[_0xd8d4('0x20')](_0xd8d4('0x21'),_0x4d73bf[_0xd8d4('0x22')]),'form':{'operation':'create','sessionName':_0x4974c9[_0xd8d4('0x3e')],'elementType':'Contacts','element':JSON['stringify']({'lastname':_0x35d06f,'phone':_0x324669,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x379bb0){logger[_0xd8d4('0x18')](_0xd8d4('0x3f'));return BPromise[_0xd8d4('0x28')]({'id':_0x379bb0[_0xd8d4('0x31')]['id'],'name':_0x379bb0[_0xd8d4('0x31')][_0xd8d4('0x3c')],'phone':_0x379bb0[_0xd8d4('0x31')][_0xd8d4('0x40')]});})[_0xd8d4('0x2b')](function(_0x27198a){var _0x2b6f5d=_0x27198a[_0xd8d4('0x2c')]||0x1f4;logger['error'](_0xd8d4('0x2d'),_0xd8d4('0x41'),_0x2b6f5d,JSON[_0xd8d4('0x2e')](_0x27198a));});}});}function getConnection(_0x4c3cca){var _0x4e2f18=_0x4c3cca[_0xd8d4('0x24')];var _0x3d608d=_0x4c3cca[_0xd8d4('0x42')];return request({'method':_0xd8d4('0x38'),'uri':util[_0xd8d4('0x20')]('%s/webservice.php',_0x4c3cca[_0xd8d4('0x22')]),'qs':{'operation':_0xd8d4('0x43'),'username':_0x4e2f18},'json':!![]})[_0xd8d4('0x26')](function(_0x8bf742){if(_0x8bf742[_0xd8d4('0x27')]){return request({'method':_0xd8d4('0x1f'),'uri':util[_0xd8d4('0x20')](_0xd8d4('0x21'),_0x4c3cca[_0xd8d4('0x22')]),'form':{'operation':'login','username':_0x4e2f18,'accessKey':md5(_0x8bf742[_0xd8d4('0x31')][_0xd8d4('0x44')]+_0x3d608d)},'json':!![]});}})[_0xd8d4('0x26')](function(_0x654a19){if(_0x654a19[_0xd8d4('0x27')]){return BPromise[_0xd8d4('0x28')](_0x654a19[_0xd8d4('0x31')]);}else{throw new Error(util[_0xd8d4('0x20')](_0xd8d4('0x45'),_0x4c3cca['id']));}})[_0xd8d4('0x2b')](function(_0x118e0f){var _0x506bef=_0x118e0f[_0xd8d4('0x2c')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0xd8d4('0x46'),_0x506bef,JSON[_0xd8d4('0x2e')](_0x118e0f));});}function request(_0x4dcb3b){logger[_0xd8d4('0x18')](_0xd8d4('0x47'),JSON[_0xd8d4('0x2e')](_0x4dcb3b));return rp(_0x4dcb3b);}exports[_0xd8d4('0x48')]=function(_0x44c5e7,_0x3fb85d,_0x154f12,_0x28b15a,_0x1bbc25,_0x404387){var _0x1f741e,_0x50bb66,_0x257666,_0x441b27;_0x404387[_0xd8d4('0x22')]=intUtil[_0xd8d4('0x49')](_0x404387['remoteUri']);if(_0x1bbc25&&_0x1bbc25[_0xd8d4('0x4a')]){logger[_0xd8d4('0x18')](_0xd8d4('0x4b'),_0xd8d4('0x4c'));_0x3fb85d[_0xd8d4('0x4d')]=util['format'](_0xd8d4('0x4e'),_0x404387['serverUrl'],_0x3fb85d[_0xd8d4('0x4f')],md5(_0x3fb85d[_0xd8d4('0x4f')]));}else{_0x3fb85d[_0xd8d4('0x4d')]='';}return getConnection(_0x404387)[_0xd8d4('0x26')](function(_0x5e072a){_0x441b27=_0x5e072a;return getUser(_0x404387,_0x28b15a[_0xd8d4('0x50')],_0x441b27);})[_0xd8d4('0x26')](function(_0x45a73c){_0x1f741e=_0x45a73c;logger[_0xd8d4('0x18')](_0xd8d4('0x51'),_0x1f741e['id']);return getEndUser(_0x404387,_0x3fb85d[_0xd8d4('0x52')],_0x3fb85d['calleridnum'],_0x441b27);})[_0xd8d4('0x26')](function(_0x2c63ea){_0x50bb66=_0x2c63ea;logger['info'](_0xd8d4('0x53'),_0x50bb66['id']);return createTicket(_0x404387,_0x1f741e,_0x50bb66,_0x154f12,_0x3fb85d,_0x154f12[_0xd8d4('0x54')],_0x441b27);})[_0xd8d4('0x26')](function(_0x3e7590){_0x257666=_0x3e7590;logger['info']('Ticket\x20created!');logger[_0xd8d4('0x18')](_0xd8d4('0x55'),_0x257666['id']);var _0x4bf48b=util[_0xd8d4('0x20')](_0xd8d4('0x56'),_0x404387['remoteUri'],_[_0xd8d4('0x57')](_0x257666['id'],'x')[0x1]);logger[_0xd8d4('0x18')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xd8d4('0x58'),_0x28b15a[_0xd8d4('0x16')]),'trigger:browser:url',{'uri':_0x4bf48b});})[_0xd8d4('0x2b')](function(_0x3c7933){logger['error'](_0xd8d4('0x4b'),JSON[_0xd8d4('0x2e')](_0x3c7933));});};exports[_0xd8d4('0x59')]=function(_0x4f4203,_0x1ee1f5,_0x3f1677,_0x2dba17,_0x204064,_0x4b367d,_0x16d1b3){var _0x428a23,_0x514295,_0x32e11e,_0x2cd8ba;_0x4b367d['remoteUri']=intUtil[_0xd8d4('0x49')](_0x4b367d[_0xd8d4('0x22')]);_0x4b367d[_0xd8d4('0x5a')]=intUtil['stripTrailingSlash'](_0x4b367d[_0xd8d4('0x5a')]);if(_0x16d1b3&&_0x16d1b3[_0xd8d4('0x5b')]&&_0x16d1b3['recordingFormat']!==_0xd8d4('0x5c')){logger[_0xd8d4('0x18')]('[OUTBOUND]',_0xd8d4('0x4c'));_0x1ee1f5[_0xd8d4('0x4d')]=util[_0xd8d4('0x20')](_0xd8d4('0x4e'),_0x4b367d['serverUrl'],_0x1ee1f5['uniqueid'],md5(_0x1ee1f5[_0xd8d4('0x4f')]));}return getConnection(_0x4b367d)['then'](function(_0x4cca03){_0x2cd8ba=_0x4cca03;return getUser(_0x4b367d,_0x2dba17[_0xd8d4('0x50')],_0x2cd8ba);})['then'](function(_0x4d9d12){_0x428a23=_0x4d9d12;logger['info'](_0xd8d4('0x51'),_0x428a23['id']);return getEndUser(_0x4b367d,_0x1ee1f5[_0xd8d4('0x5d')],_0x1ee1f5[_0xd8d4('0x5e')],_0x2cd8ba);})[_0xd8d4('0x26')](function(_0x1deaef){_0x514295=_0x1deaef;logger[_0xd8d4('0x18')](_0xd8d4('0x53'),_0x514295['id']);return createTicket(_0x4b367d,_0x428a23,_0x514295,_0x3f1677,_0x1ee1f5,_0x3f1677[_0xd8d4('0x54')],_0x2cd8ba);})[_0xd8d4('0x26')](function(_0x598a4f){_0x32e11e=_0x598a4f;logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x32e11e['id']);var _0x5f06b4=util[_0xd8d4('0x20')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4b367d[_0xd8d4('0x22')],_['split'](_0x32e11e['id'],'x')[0x1]);logger[_0xd8d4('0x18')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd8d4('0x20')]('user:%s',_0x2dba17[_0xd8d4('0x16')]),_0xd8d4('0x5f'),{'uri':_0x5f06b4});})[_0xd8d4('0x2b')](function(_0x1f53fd){logger['error'](_0xd8d4('0x60'),JSON['stringify'](_0x1f53fd));});};exports[_0xd8d4('0x61')]=function(_0x542a65,_0x2f4145,_0x14edea,_0x551e74,_0x5eb07f,_0x4f2f58){var _0x3f2c9c,_0x4f5067,_0x4b8987,_0x51c3d3;_0x4f2f58[_0xd8d4('0x22')]=intUtil[_0xd8d4('0x49')](_0x4f2f58[_0xd8d4('0x22')]);_0x4f2f58[_0xd8d4('0x5a')]=intUtil['stripTrailingSlash'](_0x4f2f58[_0xd8d4('0x5a')]);if(_0x5eb07f&&_0x5eb07f[_0xd8d4('0x4a')]){logger[_0xd8d4('0x18')]('['+_0x2f4145[_0xd8d4('0x62')][_0xd8d4('0x63')]()+']','Recording\x20is\x20enabled!');_0x2f4145[_0xd8d4('0x4d')]=util[_0xd8d4('0x20')](_0xd8d4('0x4e'),_0x4f2f58[_0xd8d4('0x5a')],_0x2f4145[_0xd8d4('0x4f')],md5(_0x2f4145[_0xd8d4('0x4f')]));}else{_0x2f4145[_0xd8d4('0x4d')]='';}return getConnection(_0x4f2f58)[_0xd8d4('0x26')](function(_0x8cdd90){_0x51c3d3=_0x8cdd90;return getUser(_0x4f2f58,'',_0x51c3d3);})[_0xd8d4('0x26')](function(_0x408ebf){_0x3f2c9c=_0x408ebf;logger[_0xd8d4('0x18')]('The\x20User\x20ID\x20is:',_0x3f2c9c['id']);return getEndUser(_0x4f2f58,_0x2f4145[_0xd8d4('0x52')],_0x2f4145['calleridnum'],_0x51c3d3);})[_0xd8d4('0x26')](function(_0xf248cb){_0x4f5067=_0xf248cb;logger[_0xd8d4('0x18')](_0xd8d4('0x53'),_0x4f5067['id']);return createTicket(_0x4f2f58,_0x3f2c9c,_0x4f5067,_0x14edea,_0x2f4145,_0x14edea['Fields'],_0x51c3d3);})[_0xd8d4('0x26')](function(_0x4d2761){_0x4b8987=_0x4d2761;logger[_0xd8d4('0x18')](_0xd8d4('0x64'));logger[_0xd8d4('0x18')](_0xd8d4('0x55'),_0x4b8987['id']);})[_0xd8d4('0x2b')](function(_0x3627ad){logger[_0xd8d4('0x2a')]('['+_0x2f4145['lastevent'][_0xd8d4('0x63')]()+']',JSON[_0xd8d4('0x2e')](_0x3627ad));});};
\ 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 17c4bd4..5e92da8 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 _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
+var _0x80df=['stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','merge','Tags','getString','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','map','forEach','type','nameField','toLowerCase','content','string','customField','custom_fields','push','variable','variableName','idField','customVariable','Variable','name','queue'];(function(_0x1e2475,_0x52fbdc){var _0x23afde=function(_0x10f3d7){while(--_0x10f3d7){_0x1e2475['push'](_0x1e2475['shift']());}};_0x23afde(++_0x52fbdc);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf80d('0x0'));var rp=require(_0xf80d('0x1'));var md5=require(_0xf80d('0x2'));var util=require(_0xf80d('0x3'));var Redis=require('ioredis');var intUtil=require(_0xf80d('0x4'));var config=require(_0xf80d('0x5'));var logger=require(_0xf80d('0x6'))(_0xf80d('0x7'));config[_0xf80d('0x8')]=_[_0xf80d('0x9')](config[_0xf80d('0x8')],{'host':_0xf80d('0xa'),'port':0x18eb});var io=require(_0xf80d('0xb'))(new Redis(config[_0xf80d('0x8')]));function emit(_0x5068d4,_0x30e2b3,_0x16b219){io['to'](_0x5068d4)[_0xf80d('0xc')](_0x30e2b3,_0x16b219);}var headers={'Content-Type':_0xf80d('0xd'),'Accept':_0xf80d('0xd')};function getTicket(_0x186339,_0x41595f,_0x45d290,_0x2fddc2,_0x2ef5d1){logger[_0xf80d('0xe')](_0xf80d('0xf'));return request({'uri':util[_0xf80d('0x10')](_0xf80d('0x11'),_0x186339['remoteUri']),'method':'POST','body':{'ticket':_[_0xf80d('0x12')]({'requester_id':_0x45d290['id'],'submitter_id':_0x41595f?_0x41595f['id']:undefined,'assignee_id':_0x41595f?_0x41595f['id']:undefined,'tags':getTags(_0x2fddc2[_0xf80d('0x13')],'name'),'subject':intUtil[_0xf80d('0x14')](_0x2fddc2['Subjects'],_0x2ef5d1,'\x20'),'description':intUtil[_0xf80d('0x14')](_0x2fddc2['Descriptions'],_0x2ef5d1,'\x0a'),'comment':{'public':![],'body':intUtil[_0xf80d('0x14')](_0x2fddc2['Descriptions'],_0x2ef5d1,'\x0a')}},getCustomFields(_0x2fddc2[_0xf80d('0x15')],_0x2ef5d1))}})[_0xf80d('0x16')](function(_0x369609){logger[_0xf80d('0xe')](_0xf80d('0x17'));return _0x369609[_0xf80d('0x18')];});}function getUser(_0x482043,_0x27f3a2){if(intUtil[_0xf80d('0x19')](_0x27f3a2)){logger[_0xf80d('0xe')](_0xf80d('0x1a'),_0x27f3a2);return request({'uri':util[_0xf80d('0x10')](_0xf80d('0x1b'),_0x482043[_0xf80d('0x1c')]),'qs':{'query':util[_0xf80d('0x10')](_0xf80d('0x1d'),_0x27f3a2)}})[_0xf80d('0x16')](function(_0x124174){if(_0x124174[_0xf80d('0x1e')]){logger['info'](_0xf80d('0x1f'));return _[_0xf80d('0x20')](_0x124174['results'],{'email':_0x27f3a2,'role':_0xf80d('0x21')});}else{logger['info'](_0xf80d('0x22'));return request({'uri':util[_0xf80d('0x10')](_0xf80d('0x23'),_0x482043[_0xf80d('0x1c')])})[_0xf80d('0x16')](function(_0x25d031){logger[_0xf80d('0xe')](_0xf80d('0x24'));return _0x25d031[_0xf80d('0x25')];});}});}else{logger[_0xf80d('0xe')](_0xf80d('0x22'));return request({'uri':util[_0xf80d('0x10')]('%s/users/me.json',_0x482043[_0xf80d('0x1c')])})[_0xf80d('0x16')](function(_0x5906fa){logger[_0xf80d('0xe')](_0xf80d('0x24'));return _0x5906fa[_0xf80d('0x25')];});}}function getEndUser(_0x947bb,_0x4986ad,_0x79142a){logger[_0xf80d('0xe')](_0xf80d('0x26'),_0x79142a);return request({'uri':util[_0xf80d('0x10')](_0xf80d('0x1b'),_0x947bb[_0xf80d('0x1c')]),'qs':{'query':util[_0xf80d('0x10')](_0xf80d('0x27'),_0x79142a)}})[_0xf80d('0x16')](function(_0x4d2579){var _0xe940d6;if(_0x4d2579[_0xf80d('0x28')][_0xf80d('0x29')]){_0x4d2579[_0xf80d('0x28')]=_[_0xf80d('0x2a')](_0x4d2579[_0xf80d('0x28')],{'suspended':![],'role':_0xf80d('0x2b')});if(_0x4d2579['results'][_0xf80d('0x29')]){_0xe940d6=_[_0xf80d('0x2c')](_0x4d2579[_0xf80d('0x28')]);}}if(_0xe940d6){logger[_0xf80d('0xe')]('Enduser\x20found!');return _0xe940d6;}else{logger['info'](_0xf80d('0x2d'));return request({'uri':util['format'](_0xf80d('0x2e'),_0x947bb[_0xf80d('0x1c')]),'method':_0xf80d('0x2f'),'body':{'user':{'role':'end-user','name':util[_0xf80d('0x10')](_0xf80d('0x30'),_0x4986ad||_0x79142a),'phone':_0x79142a}}})['then'](function(_0x2c36a5){logger[_0xf80d('0xe')](_0xf80d('0x31'));return _0x2c36a5['user'];});}});}function getAuth(_0x1d9769){var _0x9f700b;if(_0x1d9769[_0xf80d('0x32')]===_0xf80d('0x33')){_0x9f700b=util[_0xf80d('0x10')]('%s:%s',_0x1d9769[_0xf80d('0x34')],_0x1d9769['password']);}else if(_0x1d9769[_0xf80d('0x32')]===_0xf80d('0x35')){_0x9f700b=util[_0xf80d('0x10')](_0xf80d('0x36'),_0x1d9769['username'],_0x1d9769[_0xf80d('0x35')]);}return util[_0xf80d('0x10')](_0xf80d('0x37'),new Buffer(_0x9f700b)[_0xf80d('0x38')]('base64'));}function request(_0x1d4103){logger[_0xf80d('0x39')](_0xf80d('0x3a'),JSON[_0xf80d('0x3b')](_0x1d4103));return rp(_[_0xf80d('0x9')](_0x1d4103,{'method':_0xf80d('0x3c'),'headers':headers,'json':!![]}));}function getTags(_0x35039f,_0x45765a){var _0x503b42=[];if(_0x35039f&&_0x35039f[_0xf80d('0x29')]>0x0){_0x503b42=_[_0xf80d('0x3d')](_0x35039f,_0x45765a);}return _0x503b42;}function getCustomFields(_0x2e9e12,_0x4b0cdb){var _0x1ed344=[];var _0x47cd14={'custom_fields':[]};if(_0x2e9e12[_0xf80d('0x29')]>0x0){_[_0xf80d('0x3e')](_0x2e9e12,function(_0x13435c){if(_0x13435c[_0xf80d('0x3f')]==='string'&&_0x13435c['nameField']&&!_0x13435c['customField']){_0x47cd14[_0x13435c[_0xf80d('0x40')][_0xf80d('0x41')]()]=_0x13435c[_0xf80d('0x42')][_0xf80d('0x38')]();}else if(_0x13435c[_0xf80d('0x3f')]===_0xf80d('0x43')&&_0x13435c['idField']&&_0x13435c[_0xf80d('0x44')]){_0x47cd14[_0xf80d('0x45')][_0xf80d('0x46')]({'id':_0x13435c['idField'],'value':_0x13435c[_0xf80d('0x42')]['toString']()});}else if(_0x13435c[_0xf80d('0x3f')]===_0xf80d('0x47')&&_0x13435c[_0xf80d('0x48')]&&_0x13435c[_0xf80d('0x49')]&&_0x13435c[_0xf80d('0x44')]){_0x4b0cdb[_0x13435c[_0xf80d('0x48')]]&&_0x47cd14[_0xf80d('0x45')][_0xf80d('0x46')]({'id':_0x13435c[_0xf80d('0x49')],'value':_0x4b0cdb[_0x13435c[_0xf80d('0x48')]][_0xf80d('0x38')]()});}else if(_0x13435c[_0xf80d('0x3f')]===_0xf80d('0x4a')&&_0x13435c[_0xf80d('0x4b')]&&_0x13435c[_0xf80d('0x4b')][_0xf80d('0x4c')]&&_0x13435c[_0xf80d('0x49')]&&_0x13435c[_0xf80d('0x44')]){_0x4b0cdb[_0x13435c[_0xf80d('0x4b')][_0xf80d('0x4c')][_0xf80d('0x41')]()]&&_0x47cd14[_0xf80d('0x45')][_0xf80d('0x46')]({'id':_0x13435c[_0xf80d('0x49')],'value':_0x4b0cdb[_0x13435c[_0xf80d('0x4b')]['name'][_0xf80d('0x41')]()][_0xf80d('0x38')]()});}});}return _0x47cd14;}exports[_0xf80d('0x4d')]=function(_0x40d5ec,_0x2fbbe5,_0x558c24,_0x1bacb3,_0x26a848,_0x2b84f1){var _0x1819ae,_0x1a5b95;_0x2b84f1[_0xf80d('0x1c')]=intUtil[_0xf80d('0x4e')](_0x2b84f1[_0xf80d('0x1c')]);_0x2b84f1[_0xf80d('0x4f')]=intUtil[_0xf80d('0x4e')](_0x2b84f1[_0xf80d('0x4f')]);if(_0x26a848&&_0x26a848[_0xf80d('0x50')]){logger[_0xf80d('0xe')](_0xf80d('0x51'),_0xf80d('0x52'));_0x2fbbe5[_0xf80d('0x53')]=util[_0xf80d('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b84f1[_0xf80d('0x4f')],_0x2fbbe5[_0xf80d('0x54')],md5(_0x2fbbe5[_0xf80d('0x54')]));}else{_0x2fbbe5['recordingURL']='';}headers[_0xf80d('0x55')]=getAuth(_0x2b84f1);return getUser(_0x2b84f1,_0x1bacb3[_0xf80d('0x56')])['then'](function(_0x57673b){_0x1819ae=_0x57673b;logger[_0xf80d('0xe')]('The\x20User\x20ID\x20is:',_0x1819ae['id']);return getEndUser(_0x2b84f1,_0x2fbbe5[_0xf80d('0x57')],_0x2fbbe5[_0xf80d('0x58')]);})[_0xf80d('0x16')](function(_0x26fcee){_0x1a5b95=_0x26fcee;logger[_0xf80d('0xe')](_0xf80d('0x59'),_0x1a5b95['id']);return getTicket(_0x2b84f1,_0x1819ae,_0x1a5b95,_0x558c24,_0x2fbbe5);})[_0xf80d('0x16')](function(_0x114132){if(_0x114132){logger[_0xf80d('0xe')](_0xf80d('0x5a'),_0x114132['id']);switch(_0x2b84f1[_0xf80d('0x3f')]){case _0xf80d('0x5b'):logger['info'](_0xf80d('0x51'),_0xf80d('0x5c'));return request({'uri':util[_0xf80d('0x10')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x2b84f1[_0xf80d('0x1c')],_0x1819ae['id'],_0x114132['id']),'method':_0xf80d('0x2f')});case'newTab':logger[_0xf80d('0xe')](_0xf80d('0x51'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf80d('0x10')](_0xf80d('0x5d'),_0x1bacb3[_0xf80d('0x4c')]),_0xf80d('0x5e'),{'uri':util['format'](_0xf80d('0x5f'),_0x2b84f1[_0xf80d('0x1c')],_0x114132['id'])});break;default:logger[_0xf80d('0x60')]('[QUEUE]',_0xf80d('0x61'));}}})[_0xf80d('0x62')](function(_0x31796f){logger[_0xf80d('0x60')](_0xf80d('0x63'),util[_0xf80d('0x64')](_0x31796f,{'showHidden':!![],'depth':null}));});};exports[_0xf80d('0x65')]=function(_0x31ecdc,_0x6d0b18,_0x22b2e9,_0x543dba,_0x112342,_0x15aa20,_0x4501f4){var _0x32c02e,_0x5cec7c;_0x15aa20['remoteUri']=intUtil[_0xf80d('0x4e')](_0x15aa20[_0xf80d('0x1c')]);_0x15aa20['serverUrl']=intUtil[_0xf80d('0x4e')](_0x15aa20[_0xf80d('0x4f')]);if(_0x4501f4&&_0x4501f4[_0xf80d('0x66')]&&_0x4501f4[_0xf80d('0x66')]!=='none'){logger[_0xf80d('0xe')]('[OUTBOUND]',_0xf80d('0x52'));_0x6d0b18[_0xf80d('0x53')]=util[_0xf80d('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x15aa20['serverUrl'],_0x6d0b18[_0xf80d('0x54')],md5(_0x6d0b18[_0xf80d('0x54')]));}headers['Authorization']=getAuth(_0x15aa20);return getUser(_0x15aa20,_0x543dba['email'])[_0xf80d('0x16')](function(_0x3fe270){_0x32c02e=_0x3fe270;logger[_0xf80d('0xe')](_0xf80d('0x67'),_0x32c02e['id']);return getEndUser(_0x15aa20,_0x6d0b18[_0xf80d('0x68')],_0x6d0b18[_0xf80d('0x69')]);})[_0xf80d('0x16')](function(_0xd65617){_0x5cec7c=_0xd65617;logger['info'](_0xf80d('0x59'),_0x5cec7c['id']);return getTicket(_0x15aa20,_0x32c02e,_0x5cec7c,_0x22b2e9,_0x6d0b18);})[_0xf80d('0x16')](function(_0x246d1d){if(_0x246d1d){logger['info'](_0xf80d('0x5a'),_0x246d1d['id']);switch(_0x15aa20[_0xf80d('0x3f')]){case'integrationTab':logger[_0xf80d('0xe')](_0xf80d('0x6a'),_0xf80d('0x5c'));return request({'uri':util['format'](_0xf80d('0x6b'),_0x15aa20[_0xf80d('0x1c')],_0x32c02e['id'],_0x246d1d['id']),'method':_0xf80d('0x2f')});case'newTab':logger['info'](_0xf80d('0x6a'),_0xf80d('0x6c'));emit(util['format'](_0xf80d('0x5d'),_0x543dba['name']),_0xf80d('0x5e'),{'uri':util[_0xf80d('0x10')](_0xf80d('0x5f'),_0x15aa20['remoteUri'],_0x246d1d['id'])});break;default:logger[_0xf80d('0x60')](_0xf80d('0x6a'),_0xf80d('0x61'));}}})[_0xf80d('0x62')](function(_0x24c608){logger[_0xf80d('0x60')](_0xf80d('0x6d'),util[_0xf80d('0x64')](_0x24c608,{'showHidden':!![],'depth':null}));});};exports[_0xf80d('0x6e')]=function(_0x3a810f,_0x3bd5dd,_0x44709f,_0x532be4,_0x12f3a5,_0x1eb3e2){var _0x2ee191,_0x5e14f4;_0x1eb3e2[_0xf80d('0x1c')]=intUtil[_0xf80d('0x4e')](_0x1eb3e2['remoteUri']);_0x1eb3e2['serverUrl']=intUtil[_0xf80d('0x4e')](_0x1eb3e2[_0xf80d('0x4f')]);if(_0x12f3a5&&_0x12f3a5['monitor_format']){logger[_0xf80d('0xe')]('['+_0x3bd5dd[_0xf80d('0x6f')][_0xf80d('0x70')]()+']','Recording\x20is\x20enabled!');_0x3bd5dd['recordingURL']=util[_0xf80d('0x10')](_0xf80d('0x71'),_0x1eb3e2[_0xf80d('0x4f')],_0x3bd5dd[_0xf80d('0x54')],md5(_0x3bd5dd[_0xf80d('0x54')]));}else{_0x3bd5dd['recordingURL']='';}headers[_0xf80d('0x55')]=getAuth(_0x1eb3e2);return getUser(_0x1eb3e2)[_0xf80d('0x16')](function(_0x5bcbd9){_0x2ee191=_0x5bcbd9;logger[_0xf80d('0xe')](_0xf80d('0x67'),_0x2ee191['id']);return getEndUser(_0x1eb3e2,_0x3bd5dd[_0xf80d('0x57')],_0x3bd5dd[_0xf80d('0x58')]);})['then'](function(_0x38b552){_0x5e14f4=_0x38b552;logger[_0xf80d('0xe')](_0xf80d('0x59'),_0x5e14f4['id']);return getTicket(_0x1eb3e2,_0x2ee191,_0x5e14f4,_0x44709f,_0x3bd5dd);})[_0xf80d('0x16')](function(_0x297266){if(_0x297266){logger[_0xf80d('0xe')](_0xf80d('0x5a'),_0x297266['id']);}})[_0xf80d('0x62')](function(_0xcf78b){logger[_0xf80d('0x60')]('['+_0x3bd5dd[_0xf80d('0x6f')][_0xf80d('0x70')]()+']'+_0xf80d('0x72'),util[_0xf80d('0x64')](_0xcf78b,{'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 1de1820..19230b6 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 _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
+var _0xb2af=['answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','Called','complete','connect','rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','calleridname','Inbound','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','recordingFormat','none','[OUTBOUND]','destcalleridname','Outbound','toUpperCase','com','calleridnum','lodash','request-promise','md5','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','idField','content','toString','type','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isBefore','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientSecret','refresh_token','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','isNil','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','user','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','then','data','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Descriptions','Full_Name','First_Name','Last_Name','talktime','Call_Duration','utc'];(function(_0x48b99d,_0x487222){var _0x41b88c=function(_0x33869e){while(--_0x33869e){_0x48b99d['push'](_0x48b99d['shift']());}};_0x41b88c(++_0x487222);}(_0xb2af,0xd2));var _0xfb2a=function(_0x606e37,_0x393926){_0x606e37=_0x606e37-0x0;var _0x59a939=_0xb2af[_0x606e37];return _0x59a939;};'use strict';var _=require(_0xfb2a('0x0'));var rp=require(_0xfb2a('0x1'));var md5=require(_0xfb2a('0x2'));var util=require(_0xfb2a('0x3'));var intUtil=require('./util');var moment=require(_0xfb2a('0x4'));var Redis=require(_0xfb2a('0x5'));var BPromise=require(_0xfb2a('0x6'));var config=require(_0xfb2a('0x7'));var logger=require(_0xfb2a('0x8'))('zoho');config[_0xfb2a('0x9')]=_[_0xfb2a('0xa')](config[_0xfb2a('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xfb2a('0xb'))(new Redis(config[_0xfb2a('0x9')]));function emit(_0x1f3315,_0x55bb4e,_0x2c529e){io['to'](_0x1f3315)[_0xfb2a('0xc')](_0x55bb4e,_0x2c529e);}function request(_0x3d3333){logger[_0xfb2a('0xd')](_0xfb2a('0xe'),JSON[_0xfb2a('0xf')](_0x3d3333));return rp(_0x3d3333);}function getCustomFields(_0x2f4f0e,_0x3cf887){var _0x4712f5={};if(_0x2f4f0e[_0xfb2a('0x10')]>0x0){_[_0xfb2a('0x11')](_0x2f4f0e,function(_0x383645){if(_0x383645['type']==='string'&&_0x383645['idField']){_0x4712f5[_0x383645[_0xfb2a('0x12')]]=_0x383645[_0xfb2a('0x13')][_0xfb2a('0x14')]();}else if(_0x383645[_0xfb2a('0x15')]==='variable'&&_0x383645[_0xfb2a('0x16')]&&_0x383645['idField']&&_0x3cf887[_0x383645['variableName']]){_0x4712f5[_0x383645[_0xfb2a('0x12')]]=_0x3cf887[_0x383645['variableName']]['toString']();}else if(_0x383645[_0xfb2a('0x15')]===_0xfb2a('0x17')&&_0x383645[_0xfb2a('0x18')]&&_0x383645[_0xfb2a('0x18')][_0xfb2a('0x19')]&&_0x383645[_0xfb2a('0x12')]&&_0x3cf887[_0x383645[_0xfb2a('0x18')][_0xfb2a('0x19')][_0xfb2a('0x1a')]()]){_0x4712f5[_0x383645['idField']]=_0x3cf887[_0x383645[_0xfb2a('0x18')][_0xfb2a('0x19')][_0xfb2a('0x1a')]()][_0xfb2a('0x14')]();}});}return _0x4712f5;}function getName(_0x4a2ad5){if(_0x4a2ad5[_0xfb2a('0x1b')]('\x20')>0x0){var _0x5200e6=_0x4a2ad5[_0xfb2a('0x1c')](/ (.+)/);if(_0x5200e6[0x1]){return _0x5200e6;}}return[_0x4a2ad5,_0x4a2ad5];}var accountsTokens={};function getAccessToken(_0x2e2743){return new Promise(function(_0x1f230b,_0x593291){if(!_['isNil'](accountsTokens[_0x2e2743['id']])&&!_['isNil'](accountsTokens[_0x2e2743['id']]['access_token'])){if(moment()[_0xfb2a('0x1d')](accountsTokens[_0x2e2743['id']][_0xfb2a('0x1e')])){_0x1f230b(accountsTokens[_0x2e2743['id']][_0xfb2a('0x1f')]);}}var _0x3145d3;switch(_0x2e2743[_0xfb2a('0x20')]){case'US':_0x3145d3=_0xfb2a('0x21');break;case'AU':_0x3145d3=_0xfb2a('0x22');break;case'EU':_0x3145d3=_0xfb2a('0x23');break;case'IN':_0x3145d3=_0xfb2a('0x24');break;case'CN':_0x3145d3=_0xfb2a('0x25');break;default:_0x3145d3='https://accounts.zoho.eu';break;}var _0x3115f2={'method':'POST','uri':_0x3145d3+_0xfb2a('0x26'),'qs':{'refresh_token':_0x2e2743[_0xfb2a('0x27')],'client_id':_0x2e2743['clientId'],'client_secret':_0x2e2743[_0xfb2a('0x28')],'grant_type':_0xfb2a('0x29')},'json':!![]};return rp(_0x3115f2)['then'](function(_0x446dfa){accountsTokens[_0x2e2743['id']]={'access_token':_0x446dfa[_0xfb2a('0x1f')],'expires_in':moment()['add'](_0x446dfa[_0xfb2a('0x1e')],_0xfb2a('0x2a'))};_0x1f230b(_0x446dfa[_0xfb2a('0x1f')]);})[_0xfb2a('0x2b')](function(_0x3f9190){logger[_0xfb2a('0x2c')](_0xfb2a('0x2d'),_0x3f9190[_0xfb2a('0x2e')]);_0x593291(_0x3f9190);});});}function getUser(_0x111c67,_0x3d6768,_0x4b79e5,_0xbbf3b4){logger[_0xfb2a('0x2f')](_0xfb2a('0x30'));return request({'method':_0xfb2a('0x31'),'uri':util[_0xfb2a('0x32')](_0xfb2a('0x33'),_0x3d6768),'qs':{'type':_0xfb2a('0x34')},'headers':{'Authorization':_0xfb2a('0x35')+_0x111c67},'json':!![]})['then'](function(_0x225e04){if(_0x225e04['users']){var _0x4e53f1=-0x1;if(_[_0xfb2a('0x36')](_0x225e04[_0xfb2a('0x37')])){if(!_[_0xfb2a('0x38')](_0xbbf3b4)){_0x4e53f1=_['findIndex'](_0x225e04[_0xfb2a('0x37')],function(_0x4ee3b9){return _0x4ee3b9[_0xfb2a('0x39')]===_0xbbf3b4;});}if(_0x4e53f1>=0x0){logger[_0xfb2a('0x2f')](_0xfb2a('0x3a'));}else{logger[_0xfb2a('0x2f')](_0xfb2a('0x3b'));_0x4e53f1=_[_0xfb2a('0x3c')](_0x225e04['users'],function(_0x4966b3){return _0x4966b3[_0xfb2a('0x3d')][_0xfb2a('0x19')]==='Administrator';});}return _0x225e04['users'][_0x4e53f1];}else{if(_0x225e04[_0xfb2a('0x3e')][_0xfb2a('0x3d')][_0xfb2a('0x19')]===_0xfb2a('0x3f')){logger[_0xfb2a('0x2f')](_0xfb2a('0x3b'));user=_0x225e04['user'];return user;}else{logger[_0xfb2a('0x2c')](_0xfb2a('0x40'),JSON[_0xfb2a('0xf')](_0x225e04));throw new Error(_0xfb2a('0x41')+JSON[_0xfb2a('0xf')](_0x225e04));}}}else{logger[_0xfb2a('0x2c')](_0xfb2a('0x40'),JSON[_0xfb2a('0xf')](_0x225e04));throw new Error(_0xfb2a('0x41')+JSON[_0xfb2a('0xf')](_0x225e04));}})[_0xfb2a('0x2b')](function(_0x30614d){console[_0xfb2a('0x2c')](_0x30614d);});}function getZohoUser(_0x17bb29,_0xee9d74){return new BPromise(function(_0x2d336c,_0x319f14){request(_0x17bb29)[_0xfb2a('0x42')](function(_0x318e84){var _0x45ea7b=null;if(_0x318e84){_0x45ea7b=_0x318e84[_0xfb2a('0x43')][0x0];_0x45ea7b[_0xfb2a('0x44')]=_0xee9d74;}_0x2d336c(_0x45ea7b);})[_0xfb2a('0x2b')](function(_0x2cb825){_0x319f14(_0x2cb825);});});}function createEndUser(_0xcb6e47,_0x24f784,_0x357ff6,_0x25597a,_0x2e4b2f,_0x55c4ee){var _0x357ff6=getName(_0x357ff6);return request({'method':_0xfb2a('0x45'),'uri':_0xfb2a('0x46')+_0x24f784+_0xfb2a('0x47')+_[_0xfb2a('0x48')](_0x55c4ee[_0xfb2a('0x49')])+'s','body':{'data':[{'Last_Name':_0x357ff6[0x1],'First_Name':_0x357ff6[0x0],'Phone':_0x25597a,'Owner':{'name':!_['isNil'](_0x2e4b2f[_0xfb2a('0x4a')][_0xfb2a('0x19')])?_0x2e4b2f[_0xfb2a('0x4a')]['name']:!_[_0xfb2a('0x38')](_0x2e4b2f[_0xfb2a('0x4b')])?_0x2e4b2f[_0xfb2a('0x4b')]+'\x20'+_0x2e4b2f[_0xfb2a('0x4c')]:_0x2e4b2f['last_name'],'id':_0x2e4b2f['id']}}]},'headers':{'Authorization':_0xfb2a('0x35')+_0xcb6e47},'json':!![]})[_0xfb2a('0x42')](function(_0x1b9bd5){if(_0x1b9bd5&&_0x1b9bd5[_0xfb2a('0x43')][0x0][_0xfb2a('0x4d')]===_0xfb2a('0x4e')){var _0xfc1b13=_0x1b9bd5[_0xfb2a('0x43')][0x0][_0xfb2a('0x4f')];_0xfc1b13['enduserType']=_['startCase'](_0x55c4ee['moduleCreate'])+'s';return _0xfc1b13;}logger[_0xfb2a('0x2c')](_0xfb2a('0x40'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0xfb2a('0x2b')](function(_0x1d7367){console[_0xfb2a('0x50')](_0xfb2a('0x51'),_0x1d7367);});}function getEndUser(_0x4ba252,_0x10b446,_0x24d7b2,_0x69687,_0x4b1cc1,_0x5be2ae,_0x5613c1){var _0x321c0b={'method':_0xfb2a('0x31'),'uri':'','headers':{'Authorization':_0xfb2a('0x35')+_0x4ba252},'json':!![]};switch(_0x5613c1[_0xfb2a('0x52')]){case _0xfb2a('0x53'):_0x321c0b[_0xfb2a('0x54')]=_0xfb2a('0x46')+_0x10b446+_0xfb2a('0x55')+_0x4b1cc1+'))';return getZohoUser(_0x321c0b,_0xfb2a('0x56'))['then'](function(_0x4f9460){if(_0x4f9460)return _0x4f9460;_0x321c0b['uri']=_0xfb2a('0x46')+_0x10b446+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4b1cc1+'))';return getZohoUser(_0x321c0b,_0xfb2a('0x57'))['then'](function(_0x523414){if(_0x523414)return _0x523414;if(_0x5613c1[_0xfb2a('0x49')]!=_0xfb2a('0x58')){return createEndUser(_0x4ba252,_0x10b446,_0x69687,_0x4b1cc1,_0x5be2ae,_0x5613c1);}else{return{};}});});break;case'contact':_0x321c0b[_0xfb2a('0x54')]=_0xfb2a('0x46')+_0x10b446+_0xfb2a('0x55')+_0x4b1cc1+'))';return getZohoUser(_0x321c0b,'Contacts')[_0xfb2a('0x42')](function(_0xec9121){if(_0xec9121)return _0xec9121;if(_0x5613c1['moduleCreate']!='nothing'){return createEndUser(_0x4ba252,_0x10b446,_0x69687,_0x4b1cc1,_0x5be2ae,_0x5613c1);}else{return{};}});break;case _0xfb2a('0x59'):_0x321c0b[_0xfb2a('0x54')]=_0xfb2a('0x46')+_0x10b446+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4b1cc1+'))';return getZohoUser(_0x321c0b,_0xfb2a('0x57'))[_0xfb2a('0x42')](function(_0x1f5555){if(_0x1f5555)return _0x1f5555;if(_0x5613c1['moduleCreate']!=_0xfb2a('0x58')){return createEndUser(_0x4ba252,_0x10b446,_0x69687,_0x4b1cc1,_0x5be2ae,_0x5613c1);}else{return{};}});break;}}function getCall(_0x49a9a4,_0x4c42d4,_0x3b33f0,_0x2f1be3,_0x4f3a81,_0x124ee2,_0x2f5d29,_0x370f1d){logger[_0xfb2a('0x2f')](_0xfb2a('0x5a'));var _0x320741={};_0x320741[_0xfb2a('0x5b')]={'name':!_[_0xfb2a('0x38')](_0x2f1be3[_0xfb2a('0x4a')][_0xfb2a('0x19')])&&!_[_0xfb2a('0x38')](_0x2f1be3[_0xfb2a('0x3d')][_0xfb2a('0x19')])&&_0x2f1be3['profile'][_0xfb2a('0x19')]===_0xfb2a('0x5c')?_0x2f1be3[_0xfb2a('0x4a')][_0xfb2a('0x19')]:!_[_0xfb2a('0x38')](_0x2f1be3[_0xfb2a('0x4b')])?_0x2f1be3['first_name']+'\x20'+_0x2f1be3[_0xfb2a('0x4c')]:_0x2f1be3[_0xfb2a('0x4c')],'id':_0x2f1be3['id']};_0x320741[_0xfb2a('0x5d')]=intUtil[_0xfb2a('0x5e')](_0x124ee2['Subjects'],_0x2f5d29,'\x20');_0x320741['Description']=intUtil['getString'](_0x124ee2[_0xfb2a('0x5f')],_0x2f5d29,'\x0a');if(_0x4f3a81[_0xfb2a('0x44')]==='Contacts'){_0x320741['Who_Id']={'name':!_['isNil'](_0x4f3a81[_0xfb2a('0x60')])?_0x4f3a81[_0xfb2a('0x60')]:!_['isNil'](_0x4f3a81[_0xfb2a('0x61')])?_0x4f3a81[_0xfb2a('0x61')]+'\x20'+_0x4f3a81[_0xfb2a('0x62')]:_0x4f3a81['Last_Name'],'id':_0x4f3a81['id']};}if(_0x4f3a81[_0xfb2a('0x44')]==='Leads'){_0x320741['What_Id']={'name':!_['isNil'](_0x4f3a81[_0xfb2a('0x60')])?_0x4f3a81['Full_Name']:!_[_0xfb2a('0x38')](_0x4f3a81[_0xfb2a('0x61')])?_0x4f3a81[_0xfb2a('0x61')]+'\x20'+_0x4f3a81['Last_Name']:_0x4f3a81[_0xfb2a('0x62')],'id':_0x4f3a81['id']};_0x320741['$se_module']=_[_0xfb2a('0x48')](_0x4f3a81[_0xfb2a('0x44')]);}if(_0x2f5d29[_0xfb2a('0x63')]){_0x320741[_0xfb2a('0x64')]=moment[_0xfb2a('0x65')](parseInt(_0x2f5d29[_0xfb2a('0x63')])*0x3e8)[_0xfb2a('0x32')]('mm:ss');}else if(_0x2f5d29[_0xfb2a('0x66')]&&_0x2f5d29[_0xfb2a('0x67')]){_0x320741[_0xfb2a('0x64')]=moment['utc'](moment(_0x2f5d29['endtime'],_0xfb2a('0x68'))[_0xfb2a('0x69')](moment(_0x2f5d29[_0xfb2a('0x6a')],'YYYY-MM-DDTHH:mm:ss')))[_0xfb2a('0x32')](_0xfb2a('0x6b'));}switch(_0x2f5d29[_0xfb2a('0x6c')]){case _0xfb2a('0x6d'):_0x320741[_0xfb2a('0x6e')]=_0xfb2a('0x6f');break;case _0xfb2a('0x70'):case _0xfb2a('0x71'):_0x320741['Call_Result']='Answered';break;case _0xfb2a('0x72'):_0x320741['Call_Result']='Rejected';break;case _0xfb2a('0x73'):_0x320741['Call_Result']=_0xfb2a('0x74');break;case _0xfb2a('0x75'):_0x320741[_0xfb2a('0x6e')]=_0xfb2a('0x76');default:}_0x320741[_0xfb2a('0x77')]=(_0x370f1d==='outbound'?moment(_0x2f5d29['starttime'])[_0xfb2a('0x32')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x2f5d29[_0xfb2a('0x78')])[_0xfb2a('0x32')](_0xfb2a('0x68')))||moment()[_0xfb2a('0x32')]('YYYY-MM-DDTHH:mm:ss');_0x320741['Call_Type']=_0x370f1d||'Inbound';_0x320741=_[_0xfb2a('0x79')](_0x320741,getCustomFields(_0x124ee2[_0xfb2a('0x7a')],_0x2f5d29));return request({'method':_0xfb2a('0x45'),'uri':'https://www.zohoapis.'+_0x4c42d4+_0xfb2a('0x7b'),'headers':{'Authorization':_0xfb2a('0x35')+_0x49a9a4},'body':{'data':[_0x320741]},'json':!![]})[_0xfb2a('0x42')](function(_0x3a9d2c){if(_0x3a9d2c&&_0x3a9d2c['data'][0x0][_0xfb2a('0x4d')]===_0xfb2a('0x4e')){logger[_0xfb2a('0x2f')](_0xfb2a('0x7c'));return{'id':_0x3a9d2c[_0xfb2a('0x43')][0x0][_0xfb2a('0x4f')]['id']};}})['catch'](function(_0x1fdbdb){logger[_0xfb2a('0x2f')](_0xfb2a('0x7d'),_0x1fdbdb[_0xfb2a('0x2e')]);console[_0xfb2a('0x50')](_0xfb2a('0x7d'),_0x1fdbdb);});}exports[_0xfb2a('0x7e')]=function(_0x32125c,_0x33f42c,_0x2c1b41,_0x5cd07e,_0x43470d,_0x55c52a){var _0x30c0ad,_0x3b94dd,_0x36d19c;_0x55c52a[_0xfb2a('0x7f')]=intUtil[_0xfb2a('0x80')](_0x55c52a[_0xfb2a('0x7f')]);_0x55c52a[_0xfb2a('0x81')]=intUtil['stripTrailingSlash'](_0x55c52a[_0xfb2a('0x81')]);if(_0x43470d&&_0x43470d[_0xfb2a('0x82')]){logger[_0xfb2a('0x2f')]('[QUEUE]',_0xfb2a('0x83'));_0x33f42c[_0xfb2a('0x84')]=_0x55c52a[_0xfb2a('0x81')]+_0xfb2a('0x85')+_0x33f42c[_0xfb2a('0x86')]+_0xfb2a('0x87')+md5(_0x33f42c[_0xfb2a('0x86')]);}else{_0x33f42c[_0xfb2a('0x84')]='';}var _0x574138=_0x55c52a[_0xfb2a('0x7f')]===_0xfb2a('0x88')?'eu':'com';return getAccessToken(_0x55c52a)['then'](function(_0x52a0c6){_0x36d19c=_0x52a0c6;return getUser(_0x36d19c,_0x574138,_0x55c52a,_0x5cd07e['email']);})[_0xfb2a('0x42')](function(_0x55f45f){_0x30c0ad=_0x55f45f;logger[_0xfb2a('0x2f')](_0xfb2a('0x89'),_0x30c0ad['id']);return getEndUser(_0x36d19c,_0x574138,_0x55c52a,_0x33f42c[_0xfb2a('0x8a')],_0x33f42c['calleridnum'],_0x30c0ad,_0x2c1b41);})[_0xfb2a('0x42')](function(_0x5bae9f){_0x3b94dd=_0x5bae9f;return getCall(_0x36d19c,_0x574138,_0x55c52a,_0x30c0ad,_0x3b94dd,_0x2c1b41,_0x33f42c,_0xfb2a('0x8b'));})['then'](function(_0x4e33a8){if(_0x4e33a8){logger[_0xfb2a('0x2f')](_0xfb2a('0x8c'),_0x4e33a8['id']);logger[_0xfb2a('0x2f')](_0xfb2a('0x8d'),_0xfb2a('0x8e'));emit(util[_0xfb2a('0x32')](_0xfb2a('0x8f'),_0x5cd07e[_0xfb2a('0x19')]),_0xfb2a('0x90'),{'uri':_0xfb2a('0x91')+_0x55c52a[_0xfb2a('0x7f')]+_0xfb2a('0x92')+_0x4e33a8['id']});}})[_0xfb2a('0x2b')](function(_0x495f30){logger[_0xfb2a('0x2c')](_0xfb2a('0x8d'),JSON[_0xfb2a('0xf')](_0x495f30));});};exports[_0xfb2a('0x93')]=function(_0x31b310,_0x3cea35,_0x8cfb6c,_0x4e8f5b,_0x38d4f9,_0x277c4a,_0x26d01c){var _0x4192e6,_0x3a1732,_0x2f6656;_0x277c4a[_0xfb2a('0x7f')]=intUtil[_0xfb2a('0x80')](_0x277c4a[_0xfb2a('0x7f')]);_0x277c4a[_0xfb2a('0x81')]=intUtil[_0xfb2a('0x80')](_0x277c4a[_0xfb2a('0x81')]);if(_0x26d01c&&_0x26d01c[_0xfb2a('0x94')]&&_0x26d01c['recordingFormat']!==_0xfb2a('0x95')){logger[_0xfb2a('0x2f')](_0xfb2a('0x96'),_0xfb2a('0x83'));_0x3cea35['recordingURL']=_0x277c4a[_0xfb2a('0x81')]+_0xfb2a('0x85')+_0x3cea35[_0xfb2a('0x86')]+_0xfb2a('0x87')+md5(_0x3cea35[_0xfb2a('0x86')]);}var _0x3b8e83=_0x277c4a[_0xfb2a('0x7f')]===_0xfb2a('0x88')?'eu':'com';return getAccessToken(_0x277c4a)[_0xfb2a('0x42')](function(_0x2b3a51){_0x2f6656=_0x2b3a51;return getUser(_0x2f6656,_0x3b8e83,_0x277c4a,_0x4e8f5b['email']);})[_0xfb2a('0x42')](function(_0xa22a99){_0x4192e6=_0xa22a99;logger[_0xfb2a('0x2f')]('The\x20User\x20ID\x20is:',_0x4192e6['id']);return getEndUser(_0x2f6656,_0x3b8e83,_0x277c4a,_0x3cea35[_0xfb2a('0x97')],_0x3cea35['destcalleridnum'],_0x4192e6,_0x8cfb6c);})[_0xfb2a('0x42')](function(_0x2b3921){_0x3a1732=_0x2b3921;return getCall(_0x2f6656,_0x3b8e83,_0x277c4a,_0x4192e6,_0x3a1732,_0x8cfb6c,_0x3cea35,_0xfb2a('0x98'));})['then'](function(_0x558e78){if(_0x558e78){logger[_0xfb2a('0x2f')](_0xfb2a('0x8c'),_0x558e78['id']);logger[_0xfb2a('0x2f')]('[OUTBOUND]',_0xfb2a('0x8e'));emit(util[_0xfb2a('0x32')]('user:%s',_0x4e8f5b[_0xfb2a('0x19')]),'trigger:browser:url',{'uri':_0xfb2a('0x91')+_0x277c4a[_0xfb2a('0x7f')]+_0xfb2a('0x92')+_0x558e78['id']});}})[_0xfb2a('0x2b')](function(_0x5d8ecd){logger[_0xfb2a('0x2c')](_0xfb2a('0x96'),JSON[_0xfb2a('0xf')](_0x5d8ecd));});};exports['unmanaged']=function(_0x2548e5,_0x239cdd,_0x2d680b,_0x385c1b,_0x40303b,_0x2996fd){var _0x54a811,_0x32fc1f,_0x1cfefd;_0x2996fd[_0xfb2a('0x7f')]=intUtil[_0xfb2a('0x80')](_0x2996fd[_0xfb2a('0x7f')]);_0x2996fd[_0xfb2a('0x81')]=intUtil[_0xfb2a('0x80')](_0x2996fd[_0xfb2a('0x81')]);if(_0x40303b&&_0x40303b[_0xfb2a('0x82')]){logger[_0xfb2a('0x2f')]('['+_0x239cdd[_0xfb2a('0x6c')][_0xfb2a('0x99')]()+']',_0xfb2a('0x83'));_0x239cdd[_0xfb2a('0x84')]=_0x2996fd[_0xfb2a('0x81')]+'/api/voice/recordings/'+_0x239cdd['uniqueid']+_0xfb2a('0x87')+md5(_0x239cdd[_0xfb2a('0x86')]);}else{_0x239cdd[_0xfb2a('0x84')]='';}var _0x23a918=_0x2996fd[_0xfb2a('0x7f')]==='zoho.eu'?'eu':_0xfb2a('0x9a');return getAccessToken(_0x2996fd)[_0xfb2a('0x42')](function(_0x448eff){_0x1cfefd=_0x448eff;return getUser(_0x1cfefd,_0x23a918,_0x2996fd);})[_0xfb2a('0x42')](function(_0x502cda){_0x54a811=_0x502cda;logger[_0xfb2a('0x2f')](_0xfb2a('0x89'),_0x54a811['id']);return getEndUser(_0x1cfefd,_0x23a918,_0x2996fd,_0x239cdd[_0xfb2a('0x8a')],_0x239cdd[_0xfb2a('0x9b')],_0x54a811,_0x2d680b);})[_0xfb2a('0x42')](function(_0xda92d2){_0x32fc1f=_0xda92d2;return getCall(_0x1cfefd,_0x23a918,_0x2996fd,_0x54a811,_0x32fc1f,_0x2d680b,_0x239cdd,_0xfb2a('0x8b'));})[_0xfb2a('0x42')](function(_0x2d8495){if(_0x2d8495){logger[_0xfb2a('0x2f')](_0xfb2a('0x8c'),_0x2d8495['id']);}})[_0xfb2a('0x2b')](function(_0x1ac5a9){logger[_0xfb2a('0x2c')]('['+_0x239cdd[_0xfb2a('0x6c')]['toUpperCase']()+']',JSON['stringify'](_0x1ac5a9));});};
\ 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 2ab4fb2..8cdff64 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(_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
+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(_0x3318d6,_0x5964da){var _0x4d4418=function(_0x3f1ce1){while(--_0x3f1ce1){_0x3318d6['push'](_0x3318d6['shift']());}};_0x4d4418(++_0x5964da);}(_0x7a54,0x106));var _0x47a5=function(_0x57d42f,_0x34a8d7){_0x57d42f=_0x57d42f-0x0;var _0xbbd36f=_0x7a54[_0x57d42f];return _0xbbd36f;};'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 883e8c2..2d44c34 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 _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
+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(_0x169506,_0x3a4891){var _0x310dbc=function(_0x39ea78){while(--_0x39ea78){_0x169506['push'](_0x169506['shift']());}};_0x310dbc(++_0x3a4891);}(_0x7a54,0x106));var _0x47a5=function(_0x378126,_0x3769f2){_0x378126=_0x378126-0x0;var _0x6c4e38=_0x7a54[_0x378126];return _0x6c4e38;};'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 21f687b..dbb00ea 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 _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
+var _0x32ff=['rpc','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','error'];(function(_0x231b2e,_0x2a33f9){var _0x3feb2a=function(_0x5aa472){while(--_0x5aa472){_0x231b2e['push'](_0x231b2e['shift']());}};_0x3feb2a(++_0x2a33f9);}(_0x32ff,0xc7));var _0xf32f=function(_0x324bcd,_0x347993){_0x324bcd=_0x324bcd-0x0;var _0x2a864d=_0x32ff[_0x324bcd];return _0x2a864d;};'use strict';var jayson=require(_0xf32f('0x0'));var BPromise=require(_0xf32f('0x1'));var logger=require(_0xf32f('0x2'))(_0xf32f('0x3'));var client=jayson[_0xf32f('0x4')][_0xf32f('0x5')]({'port':0x2329});client[_0xf32f('0x6')]=function(_0x3ee77b,_0x1f96f0){return new BPromise(function(_0x397240,_0x1f6ca4){return client[_0xf32f('0x7')](_0x3ee77b,_0x1f96f0)[_0xf32f('0x8')](function(_0x5e5080){logger[_0xf32f('0x9')]('rpc',_0xf32f('0x3'),_0x3ee77b,_0x1f96f0,_0x5e5080);if(_0x5e5080[_0xf32f('0xa')]){logger[_0xf32f('0xa')](_0xf32f('0xb'),_0xf32f('0x3'),_0x3ee77b,_0x5e5080[_0xf32f('0xa')][_0xf32f('0xc')],_0x1f96f0);return _0x1f6ca4(_0x5e5080[_0xf32f('0xa')]['message']);}else{return _0x397240(_0x5e5080['result']);}})[_0xf32f('0xd')](function(_0x55ef47){logger['error'](_0xf32f('0xb'),_0xf32f('0x3'),_0x3ee77b,_0x55ef47,_0x1f96f0);return _0x1f6ca4(_0x55ef47);});});};module[_0xf32f('0xe')]=client;
\ No newline at end of file
diff --git a/server/services/email/index.js b/server/services/email/index.js
index 9fd6ce5..6526a94 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 _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
+var _0xf8af=['./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','then','getMailAccounts','initMailAccounts','mailAccounts','Setting','findOne','loginMailFrequency','catch','log','bluebird'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xf8af,0x8b));var _0xff8a=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xf8af[_0x2be8c2];return _0x97f531;};'use strict';var BPromise=require(_0xff8a('0x0'));var server=require('./server');var Realtime=require(_0xff8a('0x1'));var EmailChannel=require(_0xff8a('0x2'));var mailAccount=require(_0xff8a('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0xff8a('0x4'))['db'];function initRealtime(){return BPromise['resolve']()[_0xff8a('0x5')](mailAccount[_0xff8a('0x6')]())[_0xff8a('0x5')](realtime[_0xff8a('0x7')]())['then'](function(){email['refresh'](realtime[_0xff8a('0x8')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xff8a('0x5')](function(_0x406e06){return initRealtime();})[_0xff8a('0x5')](function(_0x1ce66c){return db[_0xff8a('0x9')][_0xff8a('0xa')]({'attributes':['id',_0xff8a('0xb')],'raw':!![]});})[_0xff8a('0x5')](function(_0x3bb1ba){return setInterval(initRealtime,_0x3bb1ba[_0xff8a('0xb')]*0x3e8);})[_0xff8a('0xc')](function(_0x5a31cb){console[_0xff8a('0xd')](_0x5a31cb);});}main();
\ No newline at end of file
diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js
index a01ce3c..c1cc731 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 _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
+var _0xa2c1=['New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verify','then','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','email','redis','localhost','../rpc/mailAccount','mailAccounts','imapAccounts','smtp','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','prototype','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','connected','messages','info'];(function(_0x637d19,_0x193894){var _0x4d9842=function(_0x11938f){while(--_0x11938f){_0x637d19['push'](_0x637d19['shift']());}};_0x4d9842(++_0x193894);}(_0xa2c1,0x7b));var _0x1a2c=function(_0x115a89,_0x24c57d){_0x115a89=_0x115a89-0x0;var _0x5945d9=_0xa2c1[_0x115a89];return _0x5945d9;};'use strict';var _=require(_0x1a2c('0x0'));var moment=require(_0x1a2c('0x1'));var BPromise=require(_0x1a2c('0x2'));var md5=require(_0x1a2c('0x3'));var Redis=require(_0x1a2c('0x4'));var config=require(_0x1a2c('0x5'));var logger=require('../../../config/logger')(_0x1a2c('0x6'));config[_0x1a2c('0x7')]=_['defaults'](config[_0x1a2c('0x7')],{'host':_0x1a2c('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1a2c('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require(_0x1a2c('0x9'));var md5Accounts={};function EmailChannel(_0x3b4cec){logger['info']('start\x20email\x20channel');this['mailAccounts']=_0x3b4cec[_0x1a2c('0xa')];this[_0x1a2c('0xb')]={};this[_0x1a2c('0xc')]=new EmailSmtp();}EmailChannel['prototype'][_0x1a2c('0xd')]=function(_0x4457c6){var _0x3ee8b8=this[_0x1a2c('0xa')][_0x4457c6];var _0x5f59b3={'id':_0x3ee8b8['id'],'name':_0x3ee8b8[_0x1a2c('0xe')],'key':_0x3ee8b8[_0x1a2c('0xf')],'active':_0x3ee8b8[_0x1a2c('0x10')],'Imap':{'status':_0x3ee8b8[_0x1a2c('0x11')][_0x1a2c('0x12')],'messageStatus':_0x3ee8b8[_0x1a2c('0x11')][_0x1a2c('0x13')],'total':_0x3ee8b8[_0x1a2c('0x11')][_0x1a2c('0x14')]}};if(_[_0x1a2c('0x15')](md5Accounts[_0x4457c6])){md5Accounts[_0x4457c6]={};}var _0xb688d0=md5(JSON[_0x1a2c('0x16')](_0x5f59b3));if(md5Accounts[_0x4457c6][_0x1a2c('0x3')]!==_0xb688d0){md5Accounts[_0x4457c6][_0x1a2c('0x3')]=_0xb688d0;io[_0x1a2c('0xd')]('mailAccount:update',_0x5f59b3);}};EmailChannel[_0x1a2c('0x17')][_0x1a2c('0x18')]=function(_0x3ceafa){for(var _0x45eeec in _0x3ceafa){if(_0x3ceafa[_0x1a2c('0x19')](_0x45eeec)){if(_0x3ceafa[_0x45eeec][_0x1a2c('0x11')]&&_0x3ceafa[_0x45eeec][_0x1a2c('0x10')]){var _0x162533=_0x3ceafa[_0x45eeec][_0x1a2c('0x11')];if(!this[_0x1a2c('0xb')]['hasOwnProperty'](_0x162533['id'])){this[_0x1a2c('0xb')][_0x162533['id']]=new EmailImap(_0x162533,_0x3ceafa[_0x45eeec][_0x1a2c('0x6')]);this[_0x1a2c('0xb')][_0x162533['id']]['on'](_0x1a2c('0x1a'),this[_0x1a2c('0x1b')][_0x1a2c('0x1c')](this,_0x45eeec));this['imapAccounts'][_0x162533['id']]['on'](_0x1a2c('0x6'),this[_0x1a2c('0x1d')][_0x1a2c('0x1c')](this,_0x45eeec));this[_0x1a2c('0xb')][_0x162533['id']]['on'](_0x1a2c('0x1e'),this[_0x1a2c('0x1f')][_0x1a2c('0x1c')](this,_0x45eeec));this[_0x1a2c('0xb')][_0x162533['id']]['on'](_0x1a2c('0x20'),this['handleImapError'][_0x1a2c('0x1c')](this,_0x45eeec));}}else{if(_['isNil'](this[_0x1a2c('0xa')][_0x45eeec]['Imap'])){this[_0x1a2c('0xa')][_0x45eeec]['Imap']={};}this[_0x1a2c('0xa')][_0x45eeec][_0x1a2c('0x11')][_0x1a2c('0x12')]='disabled';this[_0x1a2c('0xa')][_0x45eeec][_0x1a2c('0x11')][_0x1a2c('0x13')]='';this['emit'](_0x45eeec);}}}};EmailChannel[_0x1a2c('0x17')]['handleImapBox']=function(_0x405fb7,_0x1882fe){if(this[_0x1a2c('0xa')][_0x405fb7]){this[_0x1a2c('0xa')][_0x405fb7][_0x1a2c('0x11')][_0x1a2c('0x12')]=_0x1a2c('0x21');this[_0x1a2c('0xa')][_0x405fb7][_0x1a2c('0x11')][_0x1a2c('0x13')]=_0x1882fe[_0x1a2c('0xe')];if(_0x1882fe['messages']){this[_0x1a2c('0xa')][_0x405fb7][_0x1a2c('0x11')][_0x1a2c('0x14')]=_0x1882fe[_0x1a2c('0x22')][_0x1a2c('0x14')];}return this[_0x1a2c('0xd')](_0x405fb7);}};EmailChannel['prototype'][_0x1a2c('0x1d')]=function(_0x5a8636,_0xa5abf4){logger[_0x1a2c('0x23')](_0x1a2c('0x24'),_0xa5abf4[_0x1a2c('0x25')],_0xa5abf4[_0x1a2c('0x26')],_0xa5abf4[_0x1a2c('0x27')],_0x5a8636);if(this[_0x1a2c('0xa')][_0x5a8636]){return mailAccount[_0x1a2c('0x28')](_0x5a8636,_0xa5abf4)['then'](function(_0x3a869a){if(_0x3a869a){logger[_0x1a2c('0x23')]('Mail\x20accepted\x20from\x20routing');}})[_0x1a2c('0x29')](function(_0x3ccc83){logger[_0x1a2c('0x20')](_0x1a2c('0x2a'),JSON[_0x1a2c('0x16')](_0x3ccc83));});}};EmailChannel[_0x1a2c('0x17')][_0x1a2c('0x1f')]=function(_0x3f402d){if(this[_0x1a2c('0xa')][_0x3f402d]&&this[_0x1a2c('0xa')][_0x3f402d][_0x1a2c('0x11')]){if(this[_0x1a2c('0xb')][this[_0x1a2c('0xa')][_0x3f402d]['Imap']['id']]){delete this[_0x1a2c('0xb')][this[_0x1a2c('0xa')][_0x3f402d][_0x1a2c('0x11')]['id']];}this['mailAccounts'][_0x3f402d][_0x1a2c('0x11')][_0x1a2c('0x2b')]=moment();this[_0x1a2c('0xd')](_0x3f402d);}};EmailChannel[_0x1a2c('0x17')][_0x1a2c('0x2c')]=function(_0x5cf2e0,_0xc894bd){if(this[_0x1a2c('0xa')][_0x5cf2e0]){this[_0x1a2c('0xa')][_0x5cf2e0][_0x1a2c('0x11')][_0x1a2c('0x12')]=_0x1a2c('0x20');this[_0x1a2c('0xa')][_0x5cf2e0][_0x1a2c('0x11')][_0x1a2c('0x13')]=_0xc894bd;return this[_0x1a2c('0xd')](_0x5cf2e0);}};EmailChannel['prototype'][_0x1a2c('0x2d')]=function(_0x52cd54,_0x4fdbb0){return this[_0x1a2c('0xc')][_0x1a2c('0x2e')](_0x52cd54,_0x4fdbb0);};EmailChannel['prototype'][_0x1a2c('0x2f')]=function(_0x4ec593){var _0x42f0bd=this;if(this[_0x1a2c('0xa')][_0x4ec593['id']]){if(_[_0x1a2c('0x15')](this[_0x1a2c('0xa')][_0x4ec593['id']][_0x1a2c('0x30')])){this['mailAccounts'][_0x4ec593['id']][_0x1a2c('0x30')]={};}this[_0x1a2c('0xa')][_0x4ec593['id']]['Smtp'][_0x1a2c('0x2b')]=moment();return new BPromise(function(_0x21ca96,_0xcc1504){return _0x42f0bd[_0x1a2c('0xc')][_0x1a2c('0x31')](_0x4ec593)[_0x1a2c('0x32')](function(_0x8cf437){_0x42f0bd['mailAccounts'][_0x4ec593['id']][_0x1a2c('0x30')][_0x1a2c('0x12')]=_0x1a2c('0x33');_0x42f0bd[_0x1a2c('0xa')][_0x4ec593['id']][_0x1a2c('0x30')][_0x1a2c('0x13')]='';_0x42f0bd[_0x1a2c('0xd')](_0x4ec593['id']);_0x21ca96(_0x8cf437);})['catch'](function(_0x59b9d9){_0x42f0bd[_0x1a2c('0xa')][_0x4ec593['id']][_0x1a2c('0x30')][_0x1a2c('0x12')]=_0x1a2c('0x20');_0x42f0bd[_0x1a2c('0xa')][_0x4ec593['id']][_0x1a2c('0x30')][_0x1a2c('0x13')]=_0x59b9d9;_0x42f0bd[_0x1a2c('0xd')](_0x4ec593['id']);_0xcc1504(_0x59b9d9);});});}return this[_0x1a2c('0xc')]['verify'](_0x4ec593);};module[_0x1a2c('0x34')]=EmailChannel;
\ No newline at end of file
diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js
index ab0c429..c420da9 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 _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
+var _0xaabc=['events','EventEmitter','./utils','../../../config/logger','mailbox','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','password','host','port','tls','autotls','required','user','getHost','email','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','account','stringify','textCode','upperFirst','exports','util','imap','randomstring','mailparser','simpleParser','iconv','Iconv'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xaabc,0x13e));var _0xcaab=function(_0x2300c7,_0x255f74){_0x2300c7=_0x2300c7-0x0;var _0x23f720=_0xaabc[_0x2300c7];return _0x23f720;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xcaab('0x0'));var Imap=require(_0xcaab('0x1'));var _=require('lodash');var rs=require(_0xcaab('0x2'));var simpleParser=require(_0xcaab('0x3'))[_0xcaab('0x4')];var Iconv=require(_0xcaab('0x5'))[_0xcaab('0x6')];var EventEmitter=require(_0xcaab('0x7'))[_0xcaab('0x8')];var utils=require(_0xcaab('0x9'));var logger=require(_0xcaab('0xa'))('email');function EmailImap(_0x238f7a,_0x3b8185){this[_0xcaab('0xb')]='INBOX';this['account']=this[_0xcaab('0xc')](_0x238f7a,_0x3b8185);this['imap']=new Imap(this['account']);this[_0xcaab('0x1')][_0xcaab('0xd')](_0xcaab('0xe'),this[_0xcaab('0xf')][_0xcaab('0x10')](this));this[_0xcaab('0x1')][_0xcaab('0xd')](_0xcaab('0x11'),this[_0xcaab('0x12')][_0xcaab('0x10')](this));this[_0xcaab('0x1')]['on'](_0xcaab('0x13'),this[_0xcaab('0x14')][_0xcaab('0x10')](this));this[_0xcaab('0x1')][_0xcaab('0x15')]();}util[_0xcaab('0x16')](EmailImap,EventEmitter);EmailImap[_0xcaab('0x17')]['getAccount']=function(_0x924fd1,_0x402f44){var _0x4f40f5={'connTimeout':_0x924fd1['connTimeout']?_0x924fd1[_0xcaab('0x18')]*0x3e8:0x2710,'authTimeout':_0x924fd1[_0xcaab('0x19')]?_0x924fd1[_0xcaab('0x19')]*0x3e8:0x1388};if(_[_0xcaab('0x1a')](_0x924fd1[_0xcaab('0x1b')])){if(_0x924fd1[_0xcaab('0x1c')]){_0x4f40f5['user']=_0x924fd1['user'];_0x4f40f5['password']=_0x924fd1[_0xcaab('0x1d')];}_0x4f40f5[_0xcaab('0x1e')]=_0x924fd1['host'];_0x4f40f5[_0xcaab('0x1f')]=_0x924fd1[_0xcaab('0x1f')]||0x3e1;if(_0x924fd1[_0xcaab('0x20')]){_0x4f40f5[_0xcaab('0x20')]=!![];}else{_0x4f40f5[_0xcaab('0x20')]=![];_0x4f40f5[_0xcaab('0x21')]=_0xcaab('0x22');}}else{_0x4f40f5[_0xcaab('0x23')]=_0x924fd1['user'];_0x4f40f5['password']=_0x924fd1[_0xcaab('0x1d')];_0x4f40f5['host']=utils[_0xcaab('0x24')](_0x924fd1['service']);_0x4f40f5['port']=0x3e1;_0x4f40f5[_0xcaab('0x20')]=!![];}_0x4f40f5[_0xcaab('0x25')]=_0x402f44||_0x924fd1['user']||_0xcaab('0x26');return _0x4f40f5;};EmailImap[_0xcaab('0x17')][_0xcaab('0xf')]=function(){this[_0xcaab('0x1')][_0xcaab('0x27')](this['mailbox'],![],this[_0xcaab('0x28')][_0xcaab('0x10')](this));};EmailImap[_0xcaab('0x17')][_0xcaab('0x28')]=function(_0x541359,_0x2a52aa){if(_0x541359){this[_0xcaab('0x14')](_0x541359,!![]);}else{this[_0xcaab('0x29')](_0xcaab('0x2a'),_0x2a52aa);this[_0xcaab('0x2b')]();}};EmailImap[_0xcaab('0x17')][_0xcaab('0x2c')]=function(_0x5d2d9a){if(_0x5d2d9a){this['handleError'](_0x5d2d9a,!![]);}else{this['imap'][_0xcaab('0x11')]();}};EmailImap[_0xcaab('0x17')][_0xcaab('0x2b')]=function(){this[_0xcaab('0x1')][_0xcaab('0x2d')]([_0xcaab('0x2e')],this['handleReadUnseen']['bind'](this));};EmailImap['prototype']['handleReadUnseen']=function(_0xb0da40,_0x284720){if(_0xb0da40){this[_0xcaab('0x14')](_0xb0da40,!![]);}else{if(_0x284720[_0xcaab('0x2f')]){try{var _0x38621c=this[_0xcaab('0x1')][_0xcaab('0x30')](_0x284720,{'bodies':'','markSeen':!![]});_0x38621c['on']('message',this[_0xcaab('0x31')][_0xcaab('0x10')](this));_0x38621c[_0xcaab('0xd')](_0xcaab('0x13'),this[_0xcaab('0x32')][_0xcaab('0x10')](this));_0x38621c['once'](_0xcaab('0x11'),this[_0xcaab('0x33')][_0xcaab('0x10')](this));}catch(_0x3648c8){logger[_0xcaab('0x13')](_0x3648c8);}}else{this[_0xcaab('0x1')][_0xcaab('0x34')](!![],this[_0xcaab('0x2c')][_0xcaab('0x10')](this));}}};EmailImap[_0xcaab('0x17')][_0xcaab('0x31')]=function(_0x5debc1,_0x596156){_0x5debc1['on'](_0xcaab('0x35'),this[_0xcaab('0x36')][_0xcaab('0x10')](this));_0x5debc1[_0xcaab('0xd')](_0xcaab('0x37'),this[_0xcaab('0x38')][_0xcaab('0x10')](this));_0x5debc1['once'](_0xcaab('0x11'),this[_0xcaab('0x39')][_0xcaab('0x10')](this));};EmailImap[_0xcaab('0x17')][_0xcaab('0x36')]=function(_0xe4a33f,_0x24ef4f){simpleParser(_0xe4a33f,{'Iconv':Iconv},this[_0xcaab('0x3a')][_0xcaab('0x10')](this));};EmailImap[_0xcaab('0x17')][_0xcaab('0x38')]=function(_0x457a5a){};EmailImap[_0xcaab('0x17')][_0xcaab('0x39')]=function(){};EmailImap[_0xcaab('0x17')]['handleSimpleParser']=function(_0x2b501c,_0xb1935){if(_0x2b501c){logger[_0xcaab('0x13')](_0x2b501c);}else{var _0xdc4752=this;utils[_0xcaab('0x3b')](this[_0xcaab('0x3c')],_0xb1935,function(_0x540e4d){_0xdc4752[_0xcaab('0x29')](_0xcaab('0x25'),_0x540e4d);});}};EmailImap[_0xcaab('0x17')][_0xcaab('0x33')]=function(){this[_0xcaab('0x1')][_0xcaab('0x34')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xcaab('0x17')][_0xcaab('0x32')]=function(_0x228050){this[_0xcaab('0x14')](_0x228050);this['imap']['closeBox'](!![],this[_0xcaab('0x2c')]['bind'](this));};EmailImap[_0xcaab('0x17')][_0xcaab('0x12')]=function(){this[_0xcaab('0x29')](_0xcaab('0x11'));};EmailImap['prototype'][_0xcaab('0x14')]=function(_0x4e0007,_0x101f30){logger[_0xcaab('0x13')](_0xcaab('0x14'),this[_0xcaab('0x3c')]['email'],JSON[_0xcaab('0x3d')](_0x4e0007));var _0x49c86d='';if(_0x4e0007){if(_0x4e0007[_0xcaab('0x3e')]){_0x49c86d=_0x4e0007['textCode'];}else{for(var _0x3da6ca in _0x4e0007){if(_0x4e0007['hasOwnProperty'](_0x3da6ca)){_0x49c86d+=_[_0xcaab('0x3f')](_0x3da6ca)+':\x20'+_0x4e0007[_0x3da6ca]+'\x0a';}}}}if(_0x101f30){this[_0xcaab('0x1')]['end']();}else{this[_0xcaab('0x29')]('error',_0x49c86d);this[_0xcaab('0x29')](_0xcaab('0x11'));}};module[_0xcaab('0x40')]=EmailImap;
\ No newline at end of file
diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js
index d5d6f1e..9bb901f 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 _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
+var _0x4d83=['verify','exports','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString'];(function(_0x27ad07,_0x2d3d47){var _0x3148b4=function(_0x3e8f75){while(--_0x3e8f75){_0x27ad07['push'](_0x27ad07['shift']());}};_0x3148b4(++_0x2d3d47);}(_0x4d83,0xf4));var _0x34d8=function(_0x923f9b,_0x911264){_0x923f9b=_0x923f9b-0x0;var _0xfdf48e=_0x4d83[_0x923f9b];return _0xfdf48e;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x34d8('0x0'));var inlineBase64=require(_0x34d8('0x1'));function EmailSmtp(){}EmailSmtp[_0x34d8('0x2')][_0x34d8('0x3')]=function(_0x17815b,_0x4e8ecf){return new BPromise(function(_0x3640d8,_0x536157){var _0x53e764=nodemailer[_0x34d8('0x4')](_0x17815b);_0x53e764[_0x34d8('0x5')](_0x34d8('0x6'),inlineBase64());_0x53e764[_0x34d8('0x7')](_0x4e8ecf,function(_0xd3a043,_0x4b52e4){if(_0xd3a043){_0x536157(_0xd3a043[_0x34d8('0x8')]());}else{_0x3640d8(_0x4b52e4);}});});};EmailSmtp[_0x34d8('0x2')][_0x34d8('0x9')]=function(_0x413b26){return new BPromise(function(_0xb88477,_0x1f1bfa){var _0x5b576c=nodemailer[_0x34d8('0x4')](_0x413b26);_0x5b576c['verify'](function(_0xaa2be3,_0x56952c){if(_0xaa2be3){_0x1f1bfa(_0xaa2be3[_0x34d8('0x8')]());}else{if(_0x56952c){_0xb88477(_0x56952c);}else{_0x1f1bfa('Not\x20verifired');}}});});};module[_0x34d8('0xa')]=EmailSmtp;
\ No newline at end of file
diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js
index 57d611c..1a6f814 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 _0xb0c4=['name','split','length','slice','join','isEmpty','html','replace','body','textAsHtml','Empty\x20message ','Attachments','push','Title','gmail','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','moment','randomstring','path','util','node-tnef','email','../../../config/environment','address','anonymous','generate','@xcally.com','value'];(function(_0x50f996,_0x4e93e1){var _0x51bfe5=function(_0x264194){while(--_0x264194){_0x50f996['push'](_0x50f996['shift']());}};_0x51bfe5(++_0x4e93e1);}(_0xb0c4,0x198));var _0x4b0c=function(_0x5e77db,_0x356d1c){_0x5e77db=_0x5e77db-0x0;var _0x34b675=_0xb0c4[_0x5e77db];return _0x34b675;};'use strict';var _=require('lodash');var moment=require(_0x4b0c('0x0'));var random=require(_0x4b0c('0x1'));var fs=require('fs');var path=require(_0x4b0c('0x2'));var util=require(_0x4b0c('0x3'));var tnef=require(_0x4b0c('0x4'));var logger=require('../../../config/logger')(_0x4b0c('0x5'));var config=require(_0x4b0c('0x6'));function getAddress(_0x44742b){var _0x2e12fb=_['head'](_0x44742b['value']);return _0x2e12fb&&_0x2e12fb[_0x4b0c('0x7')]?_0x2e12fb[_0x4b0c('0x7')]:_0x4b0c('0x8')+random[_0x4b0c('0x9')](0x6)+_0x4b0c('0xa');}function getFirstName(_0x437b56){var _0x43292d=_['head'](_0x437b56[_0x4b0c('0xb')]);if(_0x43292d&&_0x43292d[_0x4b0c('0xc')]){var _0x33b264=_0x43292d[_0x4b0c('0xc')][_0x4b0c('0xd')](/\s+/);return _0x33b264[_0x4b0c('0xe')]?_0x33b264[_0x4b0c('0xf')](0x0,-0x1)[_0x4b0c('0x10')]('\x20'):_0x43292d[_0x4b0c('0xc')];}return'Anonymous';}function getLastName(_0x438e4e){var _0x342744=_['head'](_0x438e4e[_0x4b0c('0xb')]);if(_0x342744&&_0x342744['name']){var _0x2622c0=_0x342744[_0x4b0c('0xc')][_0x4b0c('0xd')](/\s+/);return _0x2622c0[_0x4b0c('0xe')]>0x1?_0x2622c0['pop']():'';}return'';}function getMails(_0x7852db,_0x4c01d4){var _0x5e0148='';for(var _0x3caef1=0x0;_0x3caef1<_0x4c01d4['value'][_0x4b0c('0xe')];_0x3caef1+=0x1){if(_0x4c01d4[_0x4b0c('0xb')][_0x3caef1]['address']!==_0x7852db){if(!_[_0x4b0c('0x11')](_0x5e0148)){_0x5e0148+=',';}_0x5e0148+=_0x4c01d4[_0x4b0c('0xb')][_0x3caef1][_0x4b0c('0xc')]||_0x4c01d4[_0x4b0c('0xb')][_0x3caef1]['address']||'';_0x5e0148+='\x20<';_0x5e0148+=_0x4c01d4[_0x4b0c('0xb')][_0x3caef1][_0x4b0c('0x7')]?_0x4c01d4[_0x4b0c('0xb')][_0x3caef1][_0x4b0c('0x7')]:_0x4b0c('0x8')+random[_0x4b0c('0x9')](0x6)+_0x4b0c('0xa');_0x5e0148+='>';}}return _0x5e0148;}function parseEmail(_0x2321a6,_0x191c9c,_0x5b1c91){if(_0x191c9c[_0x4b0c('0x12')]){var _0x3dca44=/